From 54040e31f5beac3c559362d699120f785c5ec669 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Mon, 29 Jan 2024 09:28:33 +0800 Subject: [PATCH] fixed --- .../statistics/StatisticsController.php | 22 ++++++++++--------- composer.json | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/adminapi/controller/statistics/StatisticsController.php b/app/adminapi/controller/statistics/StatisticsController.php index 382bd22b2..f6ef4a657 100644 --- a/app/adminapi/controller/statistics/StatisticsController.php +++ b/app/adminapi/controller/statistics/StatisticsController.php @@ -181,7 +181,7 @@ //年度回款金额 $year_refund_amount = FinanceReturnedRecord::whereYear('return_date',$year)->sum('amount'); - $outstanding_payment= bcsub($year_refund_plan_amount,$year_refund_amount); + $year_not_refund_amount= bcsub($year_refund_plan_amount,$year_refund_amount); $invoice_series = [ 'name' => '开票金额', @@ -195,25 +195,33 @@ 'name' => '回款金额', 'data' => [] ]; + $not_refund_series = [ + 'name' => '未回款金额', + 'data' => [] + ]; foreach($column as &$v){ $month = $v; if($month < 10){ $month = '0'.$month; } $invoice_series['data'][] = FinanceInvoiceApply::whereMonth('invoicing_date',$year.'-'.$month)->sum('invoicing_amount'); - $refund_plan_series['data'][] = FinanceReturnedMoney::whereMonth('return_date',$year.'-'.$month)->sum('amount'); - $refund_series['data'][] = FinanceReturnedRecord::whereMonth('return_date',$year.'-'.$month)->sum('amount'); + $refund_plan = FinanceReturnedMoney::whereMonth('return_date',$year.'-'.$month)->sum('amount'); + $refund = FinanceReturnedRecord::whereMonth('return_date',$year.'-'.$month)->sum('amount'); + $refund_plan_series['data'][] = $refund_plan; + $refund_series['data'][] = $refund; + $not_refund_series['data'][] = $refund_plan - $refund; $v = $v.'月'; } $result = [ 'year_invoicing_amount' => $year_invoicing_amount, 'year_refund_plan_amount' => $year_refund_plan_amount, 'year_refund_amount' => $year_refund_amount, + 'year_not_refund_amount' => $year_not_refund_amount, 'invoice_series' => $invoice_series, 'refund_plan_series' => $refund_plan_series, 'refund_series' => $refund_series, + 'not_refund_series' => $not_refund_series, 'column' => $column, - 'outstanding_payment' => $outstanding_payment, ]; return $this->success('success',$result); } @@ -328,8 +336,6 @@ $year_payment_plan_amount = FinancePaymentPlan::whereYear('pay_date',$year)->sum('amount'); //年度付款金额 $year_payment_amount = FinancePaymentApply::whereYear('pay_date',$year)->sum('amount'); - //未回款金额 - $year_outstanding_amount = FinancePaymentApply::whereYear('pay_date',$year)->sum('amount'); $invoice_series = [ 'name' => '收票金额', 'data' => [] @@ -342,10 +348,6 @@ 'name' => '付款金额', 'data' => [] ]; - $outstanding_payment= [ - 'name' => '未回款金额', - 'data' => [] - ]; foreach($column as &$v){ $month = $v; if($month < 10){ diff --git a/composer.json b/composer.json index a496329e2..120018d79 100755 --- a/composer.json +++ b/composer.json @@ -33,7 +33,8 @@ "alibabacloud/client": "^1.5", "rmccue/requests": "^2.0", "w7corp/easywechat": "^6.8", - "tencentcloud/sms": "^3.0" + "tencentcloud/sms": "^3.0", + "ext-bcmath": "*" }, "require-dev": { "symfony/var-dumper": "^4.2",