This commit is contained in:
weiz 2024-05-31 14:02:54 +08:00
parent fa4d1016a4
commit d7f341d8c3

View File

@ -682,7 +682,6 @@
}else{
$where[] = ['check_status','in','2,5,10'];
}
$where[] = ['is_cash','=', 0];
$lists = Db::name('oa_invoice')->field('id,type,invoice_title,invoice_subject,amount,invoice_type,check_status,admin_id,create_time,check_admin_ids,open_admin_id,open_time,code,delivery')->where($where)
->page($page_no, $page_size)->order('id desc')->select()->each(function($data){
$admin = Admin::field('name,dept_id')->where('id',$data['admin_id'])->findOrEmpty();
@ -733,10 +732,13 @@
$params = (new InvoiceValidate())->post()->goCheck('detail');
$data = Db::name('oa_invoice')->where('id',$params['id'])->find();
if(empty($data)){
return $this->success('申请信息不存在');
return $this->fail('申请信息不存在');
}
if($data['check_status'] < 5){
return $this->success('当前申请未开票');
return $this->fail('当前申请未开票');
}
if($data['is_cash'] > 0){
return $this->fail('发票已经新增有到账记录,请先反到账后再作废发票');
}
if($data['check_status']==5){
$res = Db::name('oa_invoice')->where('id',$params['id'])->update(['check_status'=>10]);