From 1d600216497183432f440b7615deebe3de6d324e Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 4 Nov 2023 10:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8F=91=E7=A5=A8=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Common.php | 6 ++++++ app/api/controller/FinanceInvoice.php | 23 +++++++++++++++++------ app/common.php | 7 ------- 3 files changed, 23 insertions(+), 13 deletions(-) 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() {