update
This commit is contained in:
parent
6580111243
commit
4891c6c3cf
@ -161,7 +161,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function detail(){
|
public function detail(){
|
||||||
$params = (new ExpenseValidate())->post()->goCheck('detail');
|
$params = (new ExpenseValidate())->get()->goCheck('detail');
|
||||||
$data = Db::name('oa_expense')->where('id',$params['id'])->find();
|
$data = Db::name('oa_expense')->where('id',$params['id'])->find();
|
||||||
$data['check_status_text'] = match ($data['check_status']){
|
$data['check_status_text'] = match ($data['check_status']){
|
||||||
0=>'待审核',1=>'审核中',2=>'审核通过',3=>'审核不通过',4=>'撤销审核'
|
0=>'待审核',1=>'审核中',2=>'审核通过',3=>'审核不通过',4=>'撤销审核'
|
||||||
|
@ -69,6 +69,7 @@
|
|||||||
return $this->fail('到账记录数据格式错误');
|
return $this->fail('到账记录数据格式错误');
|
||||||
}
|
}
|
||||||
$income_amount = 0;
|
$income_amount = 0;
|
||||||
|
$save_data = [];
|
||||||
foreach($params['detail'] as $k=>$v){
|
foreach($params['detail'] as $k=>$v){
|
||||||
if(empty($v['enter_time']) || !strtotime($v['enter_time'])){
|
if(empty($v['enter_time']) || !strtotime($v['enter_time'])){
|
||||||
return $this->fail('到账记录第'.($k+1).'行到账日期为空');
|
return $this->fail('到账记录第'.($k+1).'行到账日期为空');
|
||||||
@ -77,13 +78,18 @@
|
|||||||
return $this->fail('到账记录第'.($k+1).'行到帐金额为空');
|
return $this->fail('到账记录第'.($k+1).'行到帐金额为空');
|
||||||
}
|
}
|
||||||
$income_amount += $v['amount'];
|
$income_amount += $v['amount'];
|
||||||
|
$save_data[] = [
|
||||||
|
'inid' => $params['invoice_id'],
|
||||||
|
'amount' => $params['amount'],
|
||||||
|
'admin_id' => $this->adminId,
|
||||||
|
''
|
||||||
|
];
|
||||||
}
|
}
|
||||||
if($income_amount > (bcsub($invoice['amount'],$invoice['enter_amount'],2))){
|
if($income_amount > (bcsub($invoice['amount'],$invoice['enter_amount'],2))){
|
||||||
return $this->fail('到账金额大于发票金额,不允许保存');
|
return $this->fail('到账金额大于发票金额,不允许保存');
|
||||||
}
|
}
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return $this->success('ok');
|
return $this->success('ok');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user