|
|
@ -107,8 +107,9 @@ class InvoiceIssuance extends Base |
|
|
throw new \Exception('缺少必要参数'); |
|
|
throw new \Exception('缺少必要参数'); |
|
|
} |
|
|
} |
|
|
$InvoiceIssuance = (new InvoiceIssuanceModel())->where('id', $id)->find(); |
|
|
$InvoiceIssuance = (new InvoiceIssuanceModel())->where('id', $id)->find(); |
|
|
if ($InvoiceIssuance['status'] == 3) { |
|
|
if (in_array($InvoiceIssuance['status'], [3, 4])) { |
|
|
throw new \Exception('已开票,无法作废'); |
|
|
$status = $InvoiceIssuance['status'] == 3 ? '已开票' : '已作废'; |
|
|
|
|
|
throw new \Exception($status . ',无法作废'); |
|
|
} |
|
|
} |
|
|
$data = ['status' => 4]; |
|
|
$data = ['status' => 4]; |
|
|
$result = $InvoiceIssuance->save($data); |
|
|
$result = $InvoiceIssuance->save($data); |
|
|
|