ソースを参照

inMyGhsBalance

shish 1 年間 前
コミット
4ea1e41886
1 ファイル変更8 行追加0 行削除
  1. 8 0
      biz-hd/purchase/classes/PurchaseClass.php

+ 8 - 0
biz-hd/purchase/classes/PurchaseClass.php

@@ -1011,6 +1011,14 @@ class PurchaseClass extends BaseClass
             $list[$key]['supplierMobile'] = $ghsInfo[$ghsId]['mobile'] ?? '';
             $list[$key]['supplierAddress'] = $ghsInfo[$ghsId]['address'] ?? '';
             $list[$key]['debtAmount'] = $ghsInfo[$ghsId]['debtAmount'] ?? '';
+
+            //剩余欠款
+            $balance = $ghsInfo[$ghsId]['balance']??0;
+            $debtAmount = $ghsInfo[$ghsId]['debtAmount'] ?? 0;
+            $remainDebtAmount = bcsub($debtAmount, $balance, 2);
+            $list[$key]['remainDebtAmount'] = floatval($remainDebtAmount);
+            $list[$key]['inMyGhsBalance'] = floatval($balance);
+
             $list[$key]['lat'] = $ghsInfo[$ghsId]['lat'] ?? '';
             $list[$key]['long'] = $ghsInfo[$ghsId]['long'] ?? '';
             $list[$key]['supplierId'] = $ghsInfo[$ghsId]['id'] ?? '';