Browse Source

申请开票新逻辑优化

master
wanghongjun 8 months ago
parent
commit
28039462b4
  1. 10
      app/controller/api/InvoiceIssuance.php
  2. 3
      app/service/invoice/InvoiceIssuanceService.php
  3. 2
      app/service/invoice/TempInvoiceService.php

10
app/controller/api/InvoiceIssuance.php

@ -77,13 +77,21 @@ class InvoiceIssuance extends Base
$param = $this->request->post();
validate(InvoiceIssuanceValidate::class)->scene('feePay')->check($param);
$tax_number = $param['tax_number'] ?? '';
if (!empty($tax_number)) {
$str = '0-9A-HJ-NPQRTUWXY';
$pattern = '/^[' . $str . ']{2}\d{6}[' . $str . ']{10}$/';
if (!preg_match($pattern, $tax_number)) {
throw new \Exception('纳税人编号格式错误');
}
}
$res = InvoiceIssuanceService::validateFeePay(
$param['pucode'],
$param['expire_time'],
$param['project_id'],
$param['merge'],
$param['tax_number']
$tax_number
);
return $this->buildSuccess($res);

3
app/service/invoice/InvoiceIssuanceService.php

@ -104,6 +104,9 @@ class InvoiceIssuanceService
}
$pucodeArr = UserService::getTaxUser($tax_number);
if (empty($pucodeArr)) {
throw new FuncException('登录的用户id与纳税人编号不符,请重新输入');
}
$pucodeArr[] = $pucode;
$pucodeArr = array_unique($pucodeArr);

2
app/service/invoice/TempInvoiceService.php

@ -57,7 +57,7 @@ class TempInvoiceService
// 保存
$is_continue = false;// 是否跳过加工
$jsyj = 0; // 总金额
$ChinaTaxes = new ChinaTaxes($feeUsers, $invoiceDate);
$ChinaTaxes = new ChinaTaxes([$feeUsers], $invoiceDate);
$savingDetailedData = $ChinaTaxes->savingDetailedData();
if (!isset($savingDetailedData['sbpch'])) {
$VoucherData = $ChinaTaxes->queryIssuedPaymentVoucher($bdznsrsbh);

Loading…
Cancel
Save