dever 3 jaren geleden
bovenliggende
commit
482046e023

+ 39 - 0
app/cash/assets/manage/html/order_list.html

@@ -0,0 +1,39 @@
+</form>
+<form class="layui-form form10" action="" target="f10" method="post">
+<iframe id="f10" name="f10" style="display:none;"></iframe>
+<div class="layui-form-item" id="show">
+    <table class="layui-table">
+      <thead>
+        <tr>
+          <th>昵称</th>
+          <th>加入时间</th>
+          <th>签名</th>
+        </tr> 
+      </thead>
+      <tbody>
+        <tr>
+          <td>贤心</td>
+          <td>2016-11-29</td>
+          <td>人生就像是一场修行</td>
+        </tr>
+        <tr>
+          <td>许闲心</td>
+          <td>2016-11-28</td>
+          <td>于千万人之中遇见你所遇见的人,于千万年之中,时间的无涯的荒野里…</td>
+        </tr>
+      </tbody>
+    </table>
+</div>
+
+<script>
+function audit(id, process, url)
+{
+    var index = layer.confirm('确定进行此项操作吗?', function()
+    {
+        $.post(url, {id:id,process:process}, function(t)
+        {
+            location.reload();
+        })
+    })
+}
+</script>

+ 48 - 1
app/cash/database/order.php

@@ -274,6 +274,15 @@ return array
             'option'    => $audit_type,
         ),
 
+        'fdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '完成时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+        ),
+
         'operdate'     => array
         (
             'type'      => 'int-11',
@@ -326,6 +335,8 @@ return array
         'insert' => false,
         'excel'	=> true,
 
+        'page_list' => 'order_list',
+
         'list_button' => array
         (
             'fast' => array('审核', '"order&where_id={id}&col=audit,desc&oper_save_jump=order&oper_table=order&oper_parent=order"', '{audit_type} == 2 && {audit} == 1'),
@@ -334,6 +345,42 @@ return array
 
     'request' => array
     (
-        
+        # 获取数量
+        'getNum' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
+                'type' => 'yes',
+                'type_id' => 'yes',
+                'source_type' => 'yes',
+                'source_id' => 'yes',
+                'status' => array('yes', 'in'),
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'col' => 'sum(num) as total',
+        ),
+
+        # 获取总金额
+        'getCash' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'start' => array('yes-cdate', '>='),
+                'end' => array('yes-cdate', '<='),
+                'type' => 'yes',
+                'type_id' => 'yes',
+                'source_type' => 'yes',
+                'source_id' => 'yes',
+                'status' => array('yes', 'in'),
+                'state' => 1,
+            ),
+            'type' => 'one',
+            'col' => 'sum(cash) as total',
+        ),
     ),
 );

+ 208 - 0
app/cash/database/shop.php

@@ -0,0 +1,208 @@
+<?php
+
+$status = array
+(
+    1 => '未对账',
+    2 => '已对账',
+);
+
+$type = array
+(
+    1 => '按月对账',
+    2 => '按周对账',
+);
+
+$shop = function()
+{
+	$array = array();
+	$info = Dever::db('shop/info')->select();
+	if($info)
+	{
+		$array += $info;
+	}
+	return $array;
+};
+
+return array
+(
+    # 表名
+    'name' => 'shop',
+    # 显示给用户看的名称
+    'lang' => '门店对账单',
+    'order' => 90,
+    'config_status' => $status,
+    'config_type' => $type,
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            //'list'      => true,
+        ),
+
+        'type'        => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '对账单类型',
+            'default'   => '1',
+            'desc'      => '对账单类型',
+            'match'     => 'is_numeric',
+        ),
+
+        'day'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '对账单时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+            'search'	=> 'day',
+            'order'		=> 'desc',
+            'list'      => 'Dever::load("cash/lib/manage.statDate", "{type}", "{day}")',
+        ),
+
+        'shop_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '对账门店',
+            'default'   => '',
+            'desc'      => '对账门店',
+            'match'     => 'is_numeric',
+            'search'    => 'select',
+            'option'    => $shop,
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_shop_id'),
+            'list'      => 'Dever::load("shop/info-find#name", {shop_id})',
+        ),
+
+        'start'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '对账单开始时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+        ),
+
+        'end'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '对账单结束时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+            'list_name'	=> '对账周期',
+            'list'		=> 'Dever::load("cash/lib/manage.statTime", "{start}", "{end}")',
+        ),
+
+        'cash'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '对账金额',
+            'default'   => '0',
+            'desc'      => '对账金额',
+            'match'     => 'option',
+            'update'    => 'text',
+            'list'		=> true,
+        ),
+
+        'num'      => array
+        (
+            'type'      => 'varchar-100',
+            'name'      => '对账数量',
+            'default'   => '0',
+            'desc'      => '对账数量',
+            'match'     => 'option',
+            'update'    => 'text',
+            //'list'		=> true,
+        ),
+
+        'shop_status'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '门店对账状态',
+            'default'   => '1',
+            'desc'      => '门店对账状态',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $status,
+            'list'      => true,
+        ),
+
+        'status'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '平台对账状态',
+            'default'   => '1',
+            'desc'      => '平台对账状态',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $status,
+            'list'      => true,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '生成时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            //'search'    => 'date',
+            //'list'        => 'date("Y-m-d H:i:s", {cdate})',
+            //'list'      => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
+        ),
+    ),
+
+    'manage' => array
+    (
+        'delete' => false,
+        'edit' => false,
+        'insert' => false,
+        'excel'	=> true,
+
+        'list_button' => array(
+
+        	'list' => array('查看详情', '"order&project=cash&id={id}&page_type=1&type=shop"'),
+
+            'oper'  => array('确认对账金额', '"cash/lib/manage.audit?id={id}&type=shop"', '{status} == 1', 'Dever::load("cash/lib/manage.statYes", "{id}", "shop")', '请确认'),
+        ),
+    ),
+
+    'request' => array
+    (
+        # 获取总金额
+        'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'start' => array('yes-day', '>='),
+                'end' => array('yes-day', '<='),
+                'shop_id' => 'yes',
+                'status' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'page' => array(10, 'list'),
+            'col' => '*',
+        ),
+    ),
+);

+ 59 - 0
app/cash/lib/Cron.php

@@ -0,0 +1,59 @@
+<?php
+
+namespace Cash\Lib;
+
+use Dever;
+
+class Cron
+{
+    # 处理门店对账单
+    public function shop_api(){}
+    public function shop()
+    {
+        $num = Dever::input('num', -1);
+
+        $where['status'] = 2;
+       
+        $shop = Dever::db('shop/info')->select();
+
+        foreach ($shop as $k => $v) {
+        	$where['type'] = 1;
+            $where['type_id'] = $v['id'];
+        	$this->up($where, $v, 'shop', $num);
+        }
+    }
+
+    private function up($where, $info, $type, $num)
+    {
+        if ($info['stat_type'] == 2) {
+    		$method = 'week';
+    	} else {
+    		$method = 'month';
+    	}
+
+    	list($start, $end) = Dever::$method($num);
+
+    	$where['start'] = $start;
+        $where['end'] = $end;
+
+        $data = array();
+        $data[$type . '_id'] = $info['id'];
+        $data['type'] = $info['stat_type'];
+        $data['day'] = $start;
+        $info = Dever::db('cash/' . $type)->find($data);
+
+        $cash = Dever::db('cash/order')->getCash($where);
+        $data['cash'] = $cash['total'] ? $cash['total'] : 0;
+        $num = Dever::db('cash/order')->getNum($where);
+        $data['num'] = $num['total'] ? $num['total'] : 0;
+        $data['start'] = $start;
+        $data['end'] = $end;
+
+        if (!$info) {
+            Dever::db('cash/' . $type)->insert($data);
+        } else {
+            $data['where_id'] = $info['id'];
+            Dever::db('cash/' . $type)->update($data);
+        }
+    }
+}

+ 184 - 5
app/cash/lib/Manage.php

@@ -13,11 +13,32 @@ class Manage
         return $config['config_audit_type'][$audit_type] . $config['config_audit'][$audit];
     }
 
-    /**
-     * 更新信息
-     *
-     * @return mixed
-     */
+    public function statDate($type, $day) 
+    {
+        if ($type == 1) {
+            $string = 'Y年m月';
+        } else {
+            $string = 'Y年W周';
+        }
+
+        return date($string, $day);
+    }
+
+    public function statYes($id, $type)
+    {
+        $table = 'cash/' . $type;
+
+        $info = Dever::db($table)->one($id);
+        $shop = Dever::db('shop/info')->find($info[$type . '_id']);
+
+        return $this->statDate($info['type'], $info['day']) . '与'.$shop['name'].'对账单款项是否正确<br />对账金额¥' . $info['cash'] . '元';
+    }
+
+    public function statTime($start, $end) 
+    {
+        return date('Y-m-d', $start) . ' ~ ' . date('Y-m-d', $end);
+    }
+
     public function orderUpdate($id, $name, $data)
     {
         Dever::config('base')->hook = true;
@@ -32,4 +53,162 @@ class Manage
             }
         }
     }
+
+    # 审核对账
+    public function audit_api()
+    {
+        $id = Dever::input('id');
+        $type = Dever::input('type', 'shop');
+        $table = 'cash/' . $type;
+
+        $info = Dever::db($table)->one($id);
+
+        if ($info) {
+            Dever::db($table)->update(array('where_id' => $id, 'status' => 2));
+        }
+
+        return 'ok';
+    }
+
+    # 查看对账单详情
+    public function view_api()
+    {
+        $id = Dever::input('id');
+
+        $type = Dever::input('type', 'shop');
+
+        $table = 'cash/' . $type;
+
+        $config = Dever::db($table)->config;
+
+        $info = Dever::db($table)->one($id);
+
+        $status = $config['config_status'][$info['status']];
+        $shop_status = $config['config_status'][$info['shop_status']];
+
+        $shop = Dever::db('shop/info')->find($info[$type . '_id']);
+
+        $html = '<div class="layui-col-md12"><div class="layui-card"><div class="layui-card-header">对账单详情</div><div class="layui-card-body">';
+
+        $html .= '<table class="layui-table"><tbody>';
+
+        $html .= '<tr>
+          <td width="80">对账门店</td>
+          <td>'.$this->table(false, array(array($shop['name']))).'</td>
+
+        </tr>';
+
+        $html .= '<tr>
+          <td width="80">对账周期</td>
+          <td>'.$this->table(false, array(array($this->statTime($info['start'], $info['end'])))).'</td>
+
+        </tr>';
+
+        $html .= '<tr>
+          <td width="80">对账金额</td>
+          <td>'.$this->table(false, array(array('¥' . $info['cash'] . ''))).'</td>
+
+        </tr>';
+
+        $html .= '<tr>
+          <td width="80">门店对账状态</td>
+          <td>'.$this->table(false, array(array($shop_status))).'</td>
+
+        </tr>';
+
+        $html .= '<tr>
+          <td width="100">平台对账状态</td>
+          <td>'.$this->table(false, array(array($status))).'</td>
+
+        </tr>';
+
+        $button = array();
+        if ($info['status'] == 1) {
+            $button[] = '<button class="layui-btn layui-btn-primary" onclick="">立即确认</button>';
+        }
+        $button[] = '<button class="layui-btn layui-btn-primary" onclick="">联系门店</button>';
+
+        $button[] = '<button class="layui-btn layui-btn-primary" onclick="">导出对账单</button>';
+        $html .= '<tr>
+              <td>功能按钮</td>
+              <td>'.$this->table(false, array($button)).'</td>
+
+            </tr>';
+
+        $html .= '</tbody></table></div></div>';
+
+        $where['type'] = 1;
+        $where['type_id'] = $info['shop_id'];
+        $where['status'] = 2;
+
+        $data = Dever::db('cash/order')->select_page($where);
+        if ($data) {
+            $head = array('结算单号', '订货单号', '结算类型', '下单日期', '完成日期', '结算日期', '对账金额', '结算状态');
+
+            $body = array();
+            $config = Dever::db('cash/order')->config;
+            foreach ($data as $k => $v) {
+                $cdate = date('Y-m-d H:i', $v['cdate']);
+                $fdate = date('Y-m-d H:i', $v['fdate']);
+                $operdate = date('Y-m-d H:i', $v['operdate']);
+                $cash = $v['cash'];
+                $body[] = array
+                (
+                    $v['order_num'],
+                    $v['source_order_num'],
+                    $config['config_jstype'][$v['jstype']],
+                    $cdate,
+                    $fdate,
+                    $operdate,
+                    $cash,
+                    '已入账'
+                );
+            }
+
+
+            $page = Dever::page("current");
+
+            $html .= '<div class="layui-card"><div class="layui-card-header">对账清单</div><div class="layui-card-body" style="max-heights: 500px;overflow: auto;">' . $this->table($head, $body)  . $page . '</div></div>';
+        }
+
+        $html .= '</div>';
+
+        return '<div class="layui-card-body">' . $html . '</div>';
+    }
+
+    private function table($head, $data)
+    {
+        $html = '';
+        if ($head) {
+            $html = '<table class="layui-table">';
+
+            $html .= '<thead><tr>';
+            foreach ($head as $k => $v) {
+                $html .= '<th>'.$v.'</th>';
+            }
+            $html .= '</tr></thead>';
+
+            $html .= '<tbody>';
+            foreach ($data as $k => $v) {
+                $html .= '<tr>';
+                foreach ($v as $k1 => $v1) {
+                    $html .= '<td>'.$v1.'</td>';
+                }
+                $html .= '</tr>';
+            }
+
+            $html .= '</tbody>';
+
+            $html .= '</table>';
+        } else {
+            foreach ($data as $k => $v) {
+                $html .= '';
+                foreach ($v as $k1 => $v1) {
+                    $html .= $v1 . '&nbsp;&nbsp;&nbsp;&nbsp;';
+                }
+                $html .= '';
+            }
+        }
+        return $html;
+    }
 }

+ 17 - 7
app/cash/lib/Order.php

@@ -7,7 +7,7 @@ use Dever;
 class Order
 {
 	# 更新结算单
-    public function up($order, $jstype = 1, $audit = 1, $refund_id = -1)
+    public function up($order, $jstype = 1, $audit = 1, $refund = false)
     {
         if (!$order) {
             return false;
@@ -24,7 +24,11 @@ class Order
         }
         $where['source_order_id'] = $order['id'];
         $where['jstype'] = $jstype;
-        $where['refund_id'] = $refund_id;
+        if (!$refund) {
+            $where['refund_id'] = -1;
+        } else {
+            $where['refund_id'] = $refund['id'];
+        }
 
         $info = Dever::db('cash/order')->find($where);
 
@@ -42,6 +46,10 @@ class Order
 
         if ($update['status'] == 2) {
         	$update['operdate'] = time();
+            $update['fdate'] = $update['operdate'];
+            if (isset($order['fdate']) && $order['fdate'] && ($order['status'] == 5 || $order['status'] == 6)) {
+                $update['fdate'] = $order['fdate'];
+            }
         }
         if ($info) {
         	$update['where_id'] = $info['id'];
@@ -50,12 +58,14 @@ class Order
             $update['source_order_num'] = $order['order_num'];
             $update['num'] = $order['num'];
 
-            if ($audit == 2) {
-                $order['price'] -= $order['refund_cash'];
-                $order['p_price'] -= $order['refund_p_cash'];
+            if ($refund) {
+                $update['cash'] = $refund['cash'];
+                $update['p_cash'] = $refund['p_cash'];
+            } else {
+                $update['cash'] = $order['price'];
+                $update['p_cash'] = $order['p_price'];
             }
-            $update['cash'] = $order['price'];
-            $update['p_cash'] = $order['p_price'];
+
             if ($jstype == 2) {
                 $update['cash'] = -1*$update['cash'];
                 $update['p_cash'] = -1*$update['p_cash'];

+ 5 - 0
app/cash/template/manage/order_list.php

@@ -0,0 +1,5 @@
+<?php
+
+$view
+->fetch('#show', 'cash/lib/manage.view')
+->display();

+ 25 - 16
app/mshop/lib/Buy.php

@@ -423,7 +423,7 @@ class Buy
             } else {
                 $status = 5;
             }
-            $state = Dever::db('shop/buy_order')->update(array('where_id' => $data['id'], 'status' => $status));
+            $state = Dever::db('shop/buy_order')->update(array('where_id' => $data['id'], 'status' => $status, 'fdate' => time()));
             if ($state) {
                 $this->updatePs($data, 3);
                 # 增加库存
@@ -542,7 +542,18 @@ class Buy
         $tk = Dever::db('shop/buy_order_refund')->find(array('order_id' => $info['id'], 'type' => 1));
 
         $cdate = date('Y-m-d H:i', $info['cdate']);
-        $opertime = date('Y-m-d H:i', $info['operdate']);
+        if ($info['operdate']) {
+            $opertime = date('Y-m-d H:i', $info['operdate']);
+        } else {
+            $opertime = '';
+        }
+
+        if ($info['fdate']) {
+            $fdate = date('Y-m-d H:i', $info['fdate']);
+        } else {
+            $fdate = '';
+        }
+        
         
         $html = '<div class="layui-col-md12"><div class="layui-card"><div class="layui-card-header">基本信息</div><div class="layui-card-body">';
         $html .= '<table class="layui-table"><thead><tr><th style="width:20%">项目</th><th style="width:80%">详情</th></tr> </thead><tbody>';
@@ -551,7 +562,7 @@ class Buy
             $info['price'] = $info['p_price'];
         }
         $html .= '<tr>
-          <td>基本信息</td>
+          <td>订单信息</td>
           <td>'.$this->table(false, array(array('订单号:' . $info['order_num'], '金额:' . $info['price'], '数量:' . $info['num'], '状态:' . $status))).'</td>
 
         </tr>';
@@ -565,6 +576,10 @@ class Buy
         } else {
             $time = array('订货时间:' . $opertime);
         }
+
+        if ($fdate) {
+            $time[] = '完成时间:' . $fdate;
+        }
         
         $html .= '<tr>
           <td>订单时间</td>
@@ -670,6 +685,8 @@ class Buy
             $info['ps_info']['cdate'] = date('Y-m-d H:i', $info['ps_info']['cdate']);
             if ($info['ps_info']['ydate']) {
                 $info['ps_info']['ydate'] = date('Y-m-d H:i', $info['ps_info']['ydate']);
+            } else {
+                $info['ps_info']['ydate'] = '无';
             }
 
             $status = Dever::db('shop/buy_order_ps')->config['status'];
@@ -681,19 +698,11 @@ class Buy
                 $info['ps_info']['service_name'] = $service['name'];
             }
 
-            $head = array('名称', '单号', '费用', '配货员', '更多');
+            $head = array('名称', '单号', '费用', '数量', '重量', '体积', '配货员', '打包员', '发货时间', '收货时间');
 
-            $table = array();
-            $table['打包员'] = $info['ps_info']['dby'];
-            $table['数量'] = $info['ps_info']['num'];
-            $table['重量'] = $info['ps_info']['zl'];
-            $table['体积'] = $info['ps_info']['tj'];
-            $table['发货时间'] = $info['ps_info']['cdate'];
-            if ($info['ps_info']['ydate']) {
-                $table['收货时间'] = $info['ps_info']['ydate'];
-            }
+            //, '<a href="javascript:showAlert($(\'#refund_content\').html());">查看</a><span id="refund_content" style="display:none">'.Dever::table($table).'</span>')
 
-            $body = array(array($info['ps_info']['service_name'], $info['ps_info']['order_num'], $info['ps_info']['price'], $info['ps_info']['phy'], '<a href="javascript:showAlert($(\'#refund_content\').html());">查看</a><span id="refund_content" style="display:none">'.Dever::table($table).'</span>'));
+            $body = array(array($info['ps_info']['service_name'], $info['ps_info']['order_num'], $info['ps_info']['price'], $info['ps_info']['num'], $info['ps_info']['zl'], $info['ps_info']['tj'], $info['ps_info']['phy'], $info['ps_info']['dby'], $info['ps_info']['cdate'], $info['ps_info']['ydate']));
 
             $html .= '<div class="layui-card"><div class="layui-card-header">物流信息</div><div class="layui-card-body">' . $this->table($head, $body) . '</div></div>';
         }
@@ -793,7 +802,7 @@ class Buy
             );
 
 
-            $html .= '<div class="layui-card"><div class="layui-card-header">商品清单</div><div class="layui-card-body" style="max-height: 500px;overflow: auto;">' . $this->table($head, $body) . '</div></div>';
+            $html .= '<div class="layui-card"><div class="layui-card-header">商品清单</div><div class="layui-card-body" style="max-heights: 500px;overflow: auto;">' . $this->table($head, $body) . '</div></div>';
         }
 
         if ($refund_body) {
@@ -808,7 +817,7 @@ class Buy
                 '-'
             );
 
-            $html .= '<div class="layui-card"><div class="layui-card-header">缺货与报损商品</div><div class="layui-card-body" style="max-height: 300px;overflow: auto;">' . $this->table($head, $refund_body) . '</div></div>';
+            $html .= '<div class="layui-card"><div class="layui-card-header">缺货与报损商品</div><div class="layui-card-body" style="max-heights: 300px;overflow: auto;">' . $this->table($head, $refund_body) . '</div></div>';
         }
 
         if ($type == 1) {

+ 1 - 1
app/mshop/src/Data.php

@@ -446,7 +446,7 @@ class Data extends Core
                 $this->data['data'][$k]['order'] = floatval($this->data['data'][$k]['order']);
                 $this->data['data'][$k]['goods'] = floatval($this->data['data'][$k]['goods']);
 
-                $this->data['data'][$k]['day'] = date('Y-m-d', $v['day']);
+                $this->data['data'][$k]['day'] = date('m-d', $v['day']);
                 $this->data['total']['cash'] += $this->data['data'][$k]['cash'];
                 $this->data['total']['order'] += $this->data['data'][$k]['order'];
                 $this->data['total']['goods'] += $this->data['data'][$k]['goods'];

+ 9 - 0
app/shop/database/buy_order.php

@@ -210,6 +210,15 @@ return array
             'match'     => 'is_numeric',
         ),
 
+        'fdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '完成时间',
+            'default'   => '',
+            'match'     => 'is_numeric',
+            'desc'      => '',
+        ),
+
         'operdate'     => array
         (
             'type'      => 'int-11',

+ 3 - 7
app/shop/database/info.php

@@ -54,11 +54,7 @@ $method = array
     3 => '以上全支持',
 );
 
-$stat_type = array
-(
-    1 => '按月对账',
-    2 => '按周对账',
-);
+$stat_type = Dever::db('cash/shop')->config['config_type'];
 
 return array
 (
@@ -516,7 +512,7 @@ return array
         (
             'type'      => 'int-11',
             'name'      => '对账单生成日期-这里直接填写对账周期内的第几天即可,如按月对账,这里填写10,就是本月10号生成上一个月的对账单,如按周对账,这里填写2,就是本周二生成上一周的对账单',
-            'default'   => '',
+            'default'   => '10',
             'desc'      => '对账单生成日期',
             'match'     => 'option',
             'update'    => 'text',
@@ -575,7 +571,7 @@ return array
 
             'br1' => array('<br /><br />'),
 
-            'add1' => array('批量设置商品', '"info&where_id={id}&col=goods&oper_save_jump=info&oper_table=info&oper_parent=info"'),
+            //'add1' => array('批量设置商品', '"info&where_id={id}&col=goods&oper_save_jump=info&oper_table=info&oper_parent=info"'),
             'list22' => array('商品管理', '"goods&search_option_shop_id={id}&oper_table=info"'),
 
 

+ 8 - 4
app/shop/lib/Cron.php

@@ -98,9 +98,10 @@ class Cron
         }
     }
 
-    # 处理月度对账数据
+    # 处理月度对账数据 废弃,直接用结算单处理
     public function sell_month_api()
     {
+        return;
         $num = Dever::input('num', -1);
         if ($num > 0) {
             $month = Dever::input('start', date('Y-m', strtotime('-'.$num.' month')));
@@ -134,9 +135,10 @@ class Cron
         }
     }
 
-    # 处理月度对账数据:门店采购
+    # 处理月度对账数据:门店采购 废弃,直接用结算单处理
     public function buy_month_api()
     {
+        return;
         $num = Dever::input('num', -1);
         if ($num > 0) {
             $month = Dever::input('start', date('Y-m', strtotime('-'.$num.' month')));
@@ -171,9 +173,10 @@ class Cron
         }
     }
 
-    # 处理月度对账数据:仓库对账
+    # 处理月度对账数据:仓库对账 废弃,直接用结算单处理
     public function store_month_api()
     {
+        return;
         $num = Dever::input('num', -1);
         if ($num > 0) {
             $month = Dever::input('start', date('Y-m', strtotime('-'.$num.' month')));
@@ -208,9 +211,10 @@ class Cron
         }
     }
 
-    # 处理月度对账数据:工厂对账
+    # 处理月度对账数据:工厂对账 废弃,直接用结算单处理
     public function factory_month_api()
     {
+        return;
         $num = Dever::input('num', -1);
         if ($num > 0) {
             $month = Dever::input('start', date('Y-m', strtotime('-'.$num.' month')));

+ 3 - 3
app/shop/lib/Refund.php

@@ -172,7 +172,7 @@ class Refund
                     }
 
                     if ($data['source_id'] && $data['source_id'] > 0) {
-                        Dever::load('cash/lib/order')->up($data, 2, 1, $log['id']);
+                        Dever::load('cash/lib/order')->up($data, 2, 1, $log);
                     } else {
                         Dever::load('cash/lib/order')->up($data, 1, 3);
                     }
@@ -259,7 +259,7 @@ class Refund
             }
 
             if ($cash && $this->type == 'buy' && $order['source_id'] && $order['source_id'] > 0) {
-                Dever::load('cash/lib/order')->up($order, 2, 3, $info['id']);
+                Dever::load('cash/lib/order')->up($order, 2, 3, $info);
             }
         } else {
             if ($info['type'] == 2) {
@@ -296,7 +296,7 @@ class Refund
             }
 
             if ($cash && $this->type == 'buy' && $order['source_id'] && $order['source_id'] > 0) {
-                Dever::load('cash/lib/order')->up($order, 2, 2, $info['id']);
+                Dever::load('cash/lib/order')->up($order, 2, 2, $info);
             }
         }