wugg 2 tahun lalu
induk
melakukan
46b8c60980
2 mengubah file dengan 24 tambahan dan 22 penghapusan
  1. 21 19
      app/admin/controller/After.php
  2. 3 3
      app/command/NowReportHandle.php

+ 21 - 19
app/admin/controller/After.php

@@ -1072,25 +1072,27 @@ class After extends Base
                             }
 
                         }
-                        $data=[
-                            "orderCode"=>$info['orderCode'],
-                            "th_type"=>3,
-                            "th_num"=>$info['error_num'],
-                            "th_fee"=>round($sale['sale_price']*$info["error_num"],2),
-                            "thCode"=>$info['returnCode'],
-                            "spuCode"=>$sale['good_code'],
-                            "good_name"=>$sale['good_name'],
-                            "cat_id"=>$sale['cat_id'],
-                            "apply_id"=>$info['apply_id'],
-                            "apply_name"=>$info['apply_name'],
-                            "addtime"=>date("Y-m-d H:i:s"),
-                            "status"=>1,
-                            "is_del"=>0
-                        ];
-                        $inse=Db::name("th_data")->insert($data);
-                        if($inse==false){
-                            Db::rollback();
-                            return error_show(1004,"退货单更新失败");
+                        if($info['return_tag']==1){
+                            $data=[
+                                "orderCode"=>$info['orderCode'],
+                                "th_type"=>3,
+                                "th_num"=>$info['error_num'],
+                                "th_fee"=>round($sale['sale_price']*$info["error_num"],2),
+                                "thCode"=>$thNo,
+                                "spuCode"=>$sale['good_code'],
+                                "good_name"=>$sale['good_name'],
+                                "cat_id"=>$sale['cat_id'],
+                                "apply_id"=>$info['apply_id'],
+                                "apply_name"=>$info['apply_name'],
+                                "addtime"=>date("Y-m-d H:i:s"),
+                                "status"=>1,
+                                "is_del"=>0
+                            ];
+                            $inse=Db::name("th_data")->insert($data);
+                            if($inse==false){
+                                Db::rollback();
+                                return error_show(1004,"退货单更新失败");
+                            }
                         }
                         Db::commit();
                         return app_show(0,"退货单新建成功",["thNo"=>$thNo]);

+ 3 - 3
app/command/NowReportHandle.php

@@ -418,7 +418,7 @@ class NowReportHandle extends Command
                                 wgb.cat_id as '财务核算编号',
                                wpo.good_name as '商品名称',
                                 woo.send_num'出库数量',
-                               round( woo.send_num* good_price,2) '出库金额',
+                               round( woo.send_num* wpo.good_price,2) '出库金额',
                                woo.sendtime '本次出库时间',
                                 wgb.tax/100 '税率',
                             '' as '不含税出库金额',
@@ -427,8 +427,8 @@ class NowReportHandle extends Command
                                a.apply_name as '业务员',
                               wpo.cgder as '采购员',
                                nake_fee '成本裸价',
-                               wor.return_num 出库退货数量',
-                               wsm_type '仓库类型',
+                               wor.return_num  '出库退货数量',
+                               wwi.wsm_type '仓库类型',
                                ws.name '供应商名称',
                                wwi.name '仓库名称'
              ")->cursor();