Browse Source

汇总结报脚本3

master
wanghongjun 1 year ago
parent
commit
f7568202ec
  1. 19
      app/service/invoice/InvoiceIssuanceService.php

19
app/service/invoice/InvoiceIssuanceService.php

@ -422,19 +422,28 @@ class InvoiceIssuanceService
$daiZhengSummaryQuery = $ChinaTaxes->daiZhengSummaryQuery($bdznsrsbh); $daiZhengSummaryQuery = $ChinaTaxes->daiZhengSummaryQuery($bdznsrsbh);
$ydzse = 0; $ydzse = 0;
$save = []; $save = [];
foreach ($daiZhengSummaryQuery['cxwjbList'][0] as $value) { foreach ($daiZhengSummaryQuery['cxwjbList'] as $value) {
foreach ($value['cxwjbVO'] as $val) { foreach ($value['cxwjbVO'] as $val) {
$sbpch = $val['sbpch']; // 申报批次号 $sbpch = $val['sbpch']; // 申报批次号
$ydzse += $val['ydzse']; // 应代征税额 $ydzse += $val['ydzse']; // 应代征税额
$save[] = [ $save[] = [
'sbpch' => $sbpch, 'sbpch' => $sbpch,
'ydzse' => $ydzse 'ydzse' => $ydzse,
'report_time' => strtotime($invoiceDate['skssqq']),
'create_time' => time()
]; ];
} }
} }
$result = $ChinaTaxes->daiZhengSummaryReport($ydzse); if ($ydzse > 0) {
$result = $ChinaTaxes->daiZhengSummaryReport($ydzse);
(new InvoiceFinalReport())->saveAll($save); if ($save && $result['code'] == 200) {
(new InvoiceFinalReport())->saveAll($save);
} else {
return $result['message'] ?? '';
}
} else {
return $daiZhengSummaryQuery['message'] ?? '';
}
return true; return true;
} }

Loading…
Cancel
Save