收款统计
This commit is contained in:
@@ -279,7 +279,7 @@ class FinReceiptService
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新计算折让金额
|
||||
* 更新:绑定收款记录,计算折让金额
|
||||
* @param Request $request
|
||||
* @param array $data
|
||||
* @param string $scene
|
||||
@@ -296,9 +296,24 @@ class FinReceiptService
|
||||
//折让金额
|
||||
$payment = FinPaymentApply::where('id', $payment_apply_id)->first();
|
||||
$receipt = FinReceipt::find($id);
|
||||
$data['discount_amount'] = $payment->amount - $payment->amount ?? 0;
|
||||
$data['discount_amount'] = $payment->amount - $receipt->amount ?? 0;
|
||||
|
||||
$updated = $this->logicUpdateBy($config, $data);
|
||||
return $this->postProcess(ucfirst($scene), $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收款记录统计
|
||||
* @return bool|int
|
||||
*/
|
||||
public function statistics()
|
||||
{
|
||||
$finReceipt = FinReceipt::find($id);
|
||||
if(!empty($finReceipt->received_at)){
|
||||
throw new BusinessException('该记录已将确认入账');
|
||||
}
|
||||
$res = $this->logic->credit($id);
|
||||
$this->afterServiceUpdate(['id'=>$id]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user