更新发票申请

This commit is contained in:
yaooo 2023-11-04 10:03:39 +08:00
parent d88eb168d4
commit 1d60021649
3 changed files with 23 additions and 13 deletions

View File

@ -62,4 +62,10 @@ class Common extends ApiController
$this->apiSuccess('获取成功', $expense_cate);
}
//获取开票主体
public function get_invoice_subject()
{
$subject = Db::name('InvoiceSubject')->where(['status' => 1])->order('id desc')->select()->toArray();
$this->apiSuccess('获取成功', $subject);
}
}

View File

@ -123,7 +123,7 @@ class FinanceInvoice extends ApiController
}
//获取开票流程
public function get_expense_flow()
public function get_invoice_flow()
{
$this->uid = JWT_UID;
$loginAdmin = Db::name('Admin')->where(['id' => $this->uid])->find();
@ -140,24 +140,35 @@ class FinanceInvoice extends ApiController
$this->uid = JWT_UID;
$param = get_params();
$admin_id = $this->uid;
$loginAdmin = Db::name('Admin')->where(['id' => $this->uid])->find();
$this->did = $loginAdmin['did'];
if (empty($param['flow_id'])) {
$this->apiError("审批流程id不能为空");
}
if (empty($param['type'])) {
$this->apiError("抬头类型不能为空");
}
if (empty($param['invoice_title'])) {
$this->apiError("开票抬头不能为空");
}
$param['check_status'] = 1;
$param['check_step_sort'] = 0;
$flow_list = Db::name('Flow')->where('id',$param['flow_id'])->value('flow_list');
$flow = unserialize($flow_list);
if ($param['type'] == 1) {
if (!$param['invoice_tax']) {
if (empty($param['invoice_tax'])) {
$this->apiError("纳税人识别号不能为空");
}
if (!$param['invoice_bank']) {
if (empty($param['invoice_bank'])) {
$this->apiError("开户银行不能为空");
}
if (!$param['invoice_account']) {
if (empty($param['invoice_account'])) {
$this->apiError("银行账号不能为空");
}
if (!$param['invoice_banking']) {
if (empty($param['invoice_banking'])) {
$this->apiError("银行营业网点不能为空");
}
if (!$param['invoice_address']) {
if (empty($param['invoice_address'])) {
$this->apiError("银行地址不能为空");
}
}

View File

@ -482,13 +482,6 @@ function file_card($file,$view=''){
return $item;
}
//读取报销类型
function get_expense_cate()
{
$expense = Db::name('ExpenseCate')->where(['status' => 1])->select()->toArray();
return $expense;
}
//读取费用类型
function get_cost_cate()
{