diff --git a/app/api/controller/Common.php b/app/api/controller/Common.php index 5f432a8..0df67b1 100644 --- a/app/api/controller/Common.php +++ b/app/api/controller/Common.php @@ -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); + } } diff --git a/app/api/controller/FinanceInvoice.php b/app/api/controller/FinanceInvoice.php index 2f34357..a00c070 100644 --- a/app/api/controller/FinanceInvoice.php +++ b/app/api/controller/FinanceInvoice.php @@ -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("银行地址不能为空"); } } diff --git a/app/common.php b/app/common.php index 91e9339..419dcc8 100644 --- a/app/common.php +++ b/app/common.php @@ -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() {