wugg 1 year ago
parent
commit
07a5f64c93

+ 8 - 4
app/command/ExecByRelaComNoHandle.php

@@ -406,6 +406,7 @@ class ExecByRelaComNoHandle extends Command
             a.supplierName as '公司名称', 
              a.apply_id '业务部门名称' ,
              a.apply_name as '业务人员',
+             if(a.pay_id>0,'是','否') 是否拆单,
              a.order_type as '订单类型',
              a.good_type as '商品类型',
              woo.outCode '发货编号',
@@ -430,6 +431,7 @@ class ExecByRelaComNoHandle extends Command
             `wpo`.`open_fee` AS `开模费`,
             `wpo`.`teach_fee` AS `工艺费`,
             `wpo`.`delivery_fee` AS `物流费`,
+            `wpo`.`diff_fee` AS `公差金额`,
             `wpo`.`good_price` AS `成本合计`,
             `wpo`.`total_fee` AS `采购货款`,
             ifnull( `wgb`.`tax`, `wgz`.`tax` )/100 AS `采购税点`,
@@ -506,7 +508,7 @@ class ExecByRelaComNoHandle extends Command
             ->leftJoin("good_basic wgb", "wgb.spuCode=wpo.spuCode and wgb.is_del=0")
             ->leftJoin("warehouse_info wwi", "wwi.wsm_code = wpo.wsm_code")
             ->where([
-                'wpi.status' => [4, 6],
+                'wpi.status' => 2,
                 'wpi.is_del' => 0,
                 'wpo.order_type' => 1,
                 'wpo.order_source' => 0,
@@ -524,8 +526,8 @@ class ExecByRelaComNoHandle extends Command
                                 wgb.cat_id as '三级分类',
                                 wgb.cat_id as '财务核算编号',
                                wpo.good_name as '商品名称',
-                            if(wpi.status=4,wpi.send_num,wpi.wsm_num) '入库数量',
-	                        round( if(wpi.status=4,wpi.send_num,wpi.wsm_num) * good_price, 2 ) '入库金额',
+                                wpi.send_num'入库数量',
+	                        round( wpi.send_num * good_price, 2 ) '入库金额',
                                wpi.updatetime '本次入库时间',
                             wgb.tax/100 '采购税率',
                             '' as '不含税入库金额',
@@ -637,6 +639,7 @@ class ExecByRelaComNoHandle extends Command
 					companyName '公司名称',
 					department '业务部门',
 					ownerName '业务人员',
+					if(cxCode='','否','是') '是否拆单',
 					'网络部采购单' '订单类型',
 					'' as '商品类型',
 					'' as '发货编号',
@@ -661,9 +664,10 @@ class ExecByRelaComNoHandle extends Command
 		            openPrice AS `开模费`,
 		            costPrice AS `工艺费`,
 		            deliveryPrice AS `物流费`,
+		            0 AS `公差金额`,
 		            goodPrice AS `成本合计`,
 		            totalPrice AS `采购货款`,
-		            tax AS `采购税点`, 
+		            tax/100 AS `采购税点`,
 				    supplierName AS `供应商名称`,
 					'否'as '是否库存品',
 		            '包邮' as '发货方式',

+ 2 - 0
app/command/NowReportHandle.php

@@ -639,6 +639,8 @@ class NowReportHandle extends Command
 		            openPrice AS `开模费`,
 		            costPrice AS `工艺费`,
 		            deliveryPrice AS `物流费`,
+		            deliveryPrice AS `物流费`,
+		            0 AS `公差金额`,
 		            goodPrice AS `成本合计`,
 		            totalPrice AS `采购货款`,
 		            tax/100 AS `采购税点`, 

+ 1 - 1
app/command/SplitSale.php

@@ -327,7 +327,7 @@ class SplitSale extends Command
                 'wsm_code' => $cgd['wsm_code'] ?? '',
                 'cgder' => $sale['cgder'] ?? '',
                 'cgder_id' => $sale['cgderid'] ?? 0,
-                'depart' => isset($sale['cgder_id']) ? get_company_name_by_uid($sale['cgder_id']) : '',
+                'depart' => isset($sale['cgderid']) ? get_company_name_by_uid($sale['cgderid']) : '',
                  'qrdNo' => $orderCode,
                 'spuCode' => $cgd['spuCode'] ?? $sale['good_code'],
                 'good_name' => $sale['good_name'],

+ 1 - 1
app/common.php

@@ -1529,7 +1529,7 @@ if (!function_exists('check_activity')) {
     {
         $act = Db::name('activity_info')
             ->alias('ai')
-            ->field('ai.id,ai.activity_code,ai.activity_stock,ai.moq_num,ai.activity_price,ai.is_activity,ai.settle_price')
+            ->field('ai.id,ai.activity_code,ai.activity_stock,ai.moq_num,ai.activity_price,ai.is_activity,ai.settle_price,ai.cost_price')
             ->join('good_activity ga', 'ga.activity_code=ai.activity_code')
             ->where([
                 'ai.skuCode' => $skuCode,