From 8b5212596850a356c37bdc8e3100d61b795841ad Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Mon, 22 Jan 2024 19:11:41 +0800 Subject: [PATCH] update --- app/adminapi/logic/quotation/QuotationLogic.php | 6 ++---- .../validate/contract/ProcurementContractDetailValidate.php | 1 + app/common/model/contract/Contract.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/adminapi/logic/quotation/QuotationLogic.php b/app/adminapi/logic/quotation/QuotationLogic.php index 92947ace8..1d085cbcb 100644 --- a/app/adminapi/logic/quotation/QuotationLogic.php +++ b/app/adminapi/logic/quotation/QuotationLogic.php @@ -43,11 +43,9 @@ class QuotationLogic extends BaseLogic */ public static function add(array $params): bool { - $amount_including_tax = 0; $quotation_detail = $params['quotation_detail']; $tax_rate_dict = DictData::where('type_value','tax_rate')->column('name','value'); foreach($quotation_detail as &$v){ - $amount_including_tax += $v['num'] * $v['tax_inclusive_price']; $v['tax_inclusive_amount'] = $v['num'] * $v['tax_inclusive_price']; $v['tax_exclusive_amount'] = $v['num'] * $v['tax_inclusive_price'] * (1- $tax_rate_dict[$v['tax_rate']] / 100); } @@ -75,8 +73,8 @@ class QuotationLogic extends BaseLogic 'num' => $item['num'], 'tax_rate' => $item['tax_rate'], 'tax_inclusive_price' => $item['tax_inclusive_price'], - 'tax_inclusive_amount' => $item['tax_inclusive_amount'], - 'tax_exclusive_amount' => $item['tax_exclusive_amount'], + 'tax_inclusive_amount' => $item['tax_inclusive_price'] * $item['num'], + 'tax_exclusive_amount' => $item['tax_inclusive_price'] * $item['num'] * (1- $tax_rate_dict[$item['tax_rate']] / 100), 'remark' => $item['remark'] ?? '' ]); } diff --git a/app/adminapi/validate/contract/ProcurementContractDetailValidate.php b/app/adminapi/validate/contract/ProcurementContractDetailValidate.php index ee8f01527..c09e8edc7 100644 --- a/app/adminapi/validate/contract/ProcurementContractDetailValidate.php +++ b/app/adminapi/validate/contract/ProcurementContractDetailValidate.php @@ -90,5 +90,6 @@ class ProcurementContractDetailValidate extends BaseValidate { return $this->only(['id']); } + } \ No newline at end of file diff --git a/app/common/model/contract/Contract.php b/app/common/model/contract/Contract.php index 0f93110a7..73d5069c4 100644 --- a/app/common/model/contract/Contract.php +++ b/app/common/model/contract/Contract.php @@ -59,7 +59,7 @@ class Contract extends BaseModel } public function getAnnexAttr($value){ - return !empty($value) ? json_decode($value,true) : null; + return !empty($value) ? json_decode($value,true) : ''; } } \ No newline at end of file