update
This commit is contained in:
parent
fa4d1016a4
commit
d7f341d8c3
@ -682,7 +682,6 @@
|
|||||||
}else{
|
}else{
|
||||||
$where[] = ['check_status','in','2,5,10'];
|
$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)
|
$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){
|
->page($page_no, $page_size)->order('id desc')->select()->each(function($data){
|
||||||
$admin = Admin::field('name,dept_id')->where('id',$data['admin_id'])->findOrEmpty();
|
$admin = Admin::field('name,dept_id')->where('id',$data['admin_id'])->findOrEmpty();
|
||||||
@ -733,10 +732,13 @@
|
|||||||
$params = (new InvoiceValidate())->post()->goCheck('detail');
|
$params = (new InvoiceValidate())->post()->goCheck('detail');
|
||||||
$data = Db::name('oa_invoice')->where('id',$params['id'])->find();
|
$data = Db::name('oa_invoice')->where('id',$params['id'])->find();
|
||||||
if(empty($data)){
|
if(empty($data)){
|
||||||
return $this->success('申请信息不存在');
|
return $this->fail('申请信息不存在');
|
||||||
}
|
}
|
||||||
if($data['check_status'] < 5){
|
if($data['check_status'] < 5){
|
||||||
return $this->success('当前申请未开票');
|
return $this->fail('当前申请未开票');
|
||||||
|
}
|
||||||
|
if($data['is_cash'] > 0){
|
||||||
|
return $this->fail('发票已经新增有到账记录,请先反到账后再作废发票');
|
||||||
}
|
}
|
||||||
if($data['check_status']==5){
|
if($data['check_status']==5){
|
||||||
$res = Db::name('oa_invoice')->where('id',$params['id'])->update(['check_status'=>10]);
|
$res = Db::name('oa_invoice')->where('id',$params['id'])->update(['check_status'=>10]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user