Browse Source

汇总结报脚本3

master
wanghongjun 11 months 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);
$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;
}

Loading…
Cancel
Save