|
|
|
@ -406,7 +406,7 @@ class CompanyStatementOfflineController extends ThinkController
|
|
|
|
|
if (count($_REQUEST['info']) < 2) {
|
|
|
|
|
$this->error("未添加剩余打款金额");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dump($_REQUEST['info']);die();
|
|
|
|
|
if(!isset($_REQUEST['info'])) $this->error("参数错误");
|
|
|
|
|
$info = $_REQUEST['info'];
|
|
|
|
|
$ydata = [];
|
|
|
|
@ -418,6 +418,11 @@ class CompanyStatementOfflineController extends ThinkController
|
|
|
|
|
foreach($info as $k=>$v){
|
|
|
|
|
$ydata = $CompanyInfo->where("id= '{$k}'")->find();
|
|
|
|
|
|
|
|
|
|
$sumPartInfo = M("company_statement_info_part","tab_")
|
|
|
|
|
->field("sum(statement_money) statement_money")
|
|
|
|
|
->where(['info_id'=>$k])
|
|
|
|
|
->find();
|
|
|
|
|
|
|
|
|
|
$company_info = json_decode($ydata['company_info'],true);
|
|
|
|
|
if($ydata['verify_status'] == 2){
|
|
|
|
|
$company_info['payee_name'] = $v['payee_name'];
|
|
|
|
@ -444,12 +449,14 @@ class CompanyStatementOfflineController extends ThinkController
|
|
|
|
|
|
|
|
|
|
// array_pop($info);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$id = $ydata["id"];
|
|
|
|
|
unset($ydata["id"]);
|
|
|
|
|
|
|
|
|
|
$sumUnPayAmount = array_sum(array_column($info,'unpay_amount'));
|
|
|
|
|
|
|
|
|
|
if ($sumUnPayAmount > $ydata['statement_money'] ) {
|
|
|
|
|
// dump($sumUnPayAmount+$sumPartInfo['statement_money']);die();
|
|
|
|
|
if (($sumUnPayAmount+$sumPartInfo['statement_money']) > $ydata['statement_money'] ) {
|
|
|
|
|
$this->error("剩余打款金额超过结算金额");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|