From f7568202ec7d2f015d7d3597c9fae185029d8945 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Mon, 30 Dec 2024 15:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=87=E6=80=BB=E7=BB=93=E6=8A=A5=E8=84=9A?= =?UTF-8?q?=E6=9C=AC3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invoice/InvoiceIssuanceService.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/service/invoice/InvoiceIssuanceService.php b/app/service/invoice/InvoiceIssuanceService.php index a939a0e..b679853 100644 --- a/app/service/invoice/InvoiceIssuanceService.php +++ b/app/service/invoice/InvoiceIssuanceService.php @@ -422,19 +422,28 @@ class InvoiceIssuanceService $daiZhengSummaryQuery = $ChinaTaxes->daiZhengSummaryQuery($bdznsrsbh); $ydzse = 0; $save = []; - foreach ($daiZhengSummaryQuery['cxwjbList'][0] as $value) { + foreach ($daiZhengSummaryQuery['cxwjbList'] as $value) { foreach ($value['cxwjbVO'] as $val) { $sbpch = $val['sbpch']; // 申报批次号 $ydzse += $val['ydzse']; // 应代征税额 $save[] = [ 'sbpch' => $sbpch, - 'ydzse' => $ydzse + 'ydzse' => $ydzse, + 'report_time' => strtotime($invoiceDate['skssqq']), + 'create_time' => time() ]; } } - $result = $ChinaTaxes->daiZhengSummaryReport($ydzse); - - (new InvoiceFinalReport())->saveAll($save); + if ($ydzse > 0) { + $result = $ChinaTaxes->daiZhengSummaryReport($ydzse); + if ($save && $result['code'] == 200) { + (new InvoiceFinalReport())->saveAll($save); + } else { + return $result['message'] ?? ''; + } + } else { + return $daiZhengSummaryQuery['message'] ?? ''; + } return true; }