Browse Source

得润宝

cqp 2 days ago
parent
commit
a4a56da158
2 changed files with 13 additions and 3 deletions
  1. 8 0
      app/Service/DrbService.php
  2. 5 3
      app/Service/U8ServerService.php

+ 8 - 0
app/Service/DrbService.php

@@ -382,6 +382,14 @@ class DrbService extends Service
                                 "name"  => "来源单据号",
                                 "value" => $item['source_order_number'] ?? ''
                             ],
+                            [
+                                "name"  => "存货名称",
+                                "value" => $item['product_title'] ?? ''
+                            ],
+                            [
+                                "name"  => "数量",
+                                "value" => $item['number'] ?? 0,
+                            ],
                             [
                                 "name"  => "主计量", // 修改这里,对应模板字段
                                 "value" => $item['unit_title'] ?? ''

+ 5 - 3
app/Service/U8ServerService.php

@@ -83,7 +83,7 @@ class U8ServerService extends Service
             ->leftJoin('Inventory as b', 'b.cInvCode', 'a.cInvCode')
             ->leftJoin('ComputationUnit as c', 'c.cComunitCode', 'b.cComUnitCode')
             ->where('a.ID', $order['id'])
-            ->select('b.cInvName as product_title','b.cInvCode as product_code','a.fQuantity as quantity','c.cComUnitName as unit_title',DB::raw("CONVERT(varchar(10), a.dRequirDate, 120) as need_arrived_date"))
+            ->select('b.cInvName as product_title','b.cInvCode as product_code','c.cComUnitName as unit_title',DB::raw("CONVERT(varchar(10), a.dRequirDate, 120) as need_arrived_date"),DB::raw('ROUND(a.fQuantity, 2) as quantity'))
             ->get();
         // 转为数组的数组
         $detail = array_map(function ($item) {
@@ -143,7 +143,7 @@ class U8ServerService extends Service
             ->leftJoin('Inventory as b', 'b.cInvCode', 'a.cInvCode')
             ->leftJoin('ComputationUnit as c', 'c.cComunitCode', 'b.cComUnitCode')
             ->where('a.POID', $order['id'])
-            ->select('b.cInvName as product_title','b.cInvCode as product_code','a.iQuantity as quantity','c.cComUnitName as unit_title','a.iSum as amount')
+            ->select('b.cInvName as product_title','b.cInvCode as product_code','c.cComUnitName as unit_title',DB::raw('ROUND(a.iQuantity, 2) as quantity'),DB::raw('ROUND(a.iSum, 2) as amount'))
             ->get();
         // 转为数组的数组
         $detail = array_map(function ($item) {
@@ -197,8 +197,10 @@ class U8ServerService extends Service
         $order = (array) $order;
 
         $detail = $this->databaseService->table('AP_ApplyPayVouchs as a')
+            ->leftJoin('Inventory as b', 'b.cInvCode', 'a.cInvCode')
+            ->leftJoin('ComputationUnit as c', 'c.cComunitCode', 'b.cComUnitCode')
             ->where('a.PID', $order['id'])
-            ->select('a.cSource as source','a.cCoVouchID as source_order_number','a.iApplyAmt_f as amount')
+            ->select('a.cSource as source','a.cCoVouchID as source_order_number','b.cInvName as product_title',DB::raw('ROUND(a.iApplyAmt_s, 2) as number'), DB::raw('ROUND(a.iApplyAmt_f, 2) as amount'),'c.cComUnitName as unit_title')
             ->get();
         // 转为数组的数组
         $detail = array_map(function ($item) {