|
@@ -238,13 +238,13 @@ class Cash
|
|
|
|
|
|
public function setValue_commit($info)
|
|
|
{
|
|
|
- $state = Dever::db('option/bill_jiaofu')->upYes(array('where_start' => $info['jiaofu_date'], 'where_aid' => $info['aid'], 'where_status' => 2, 'set_agreement_id' => $info['id'], 'set_status' => 1, 'set_qdate' => time()));
|
|
|
+ $state = Dever::db('option/bill_jiaofu')->upYes(array('where_end' => $info['jiaofu_date'], 'where_aid' => $info['aid'], 'where_status' => 2, 'set_agreement_id' => $info['id'], 'set_status' => 1, 'set_qdate' => time()));
|
|
|
|
|
|
if ($state) {
|
|
|
$account_cash = Dever::db('option/cash')->select(array('aid' => $info['aid']));
|
|
|
if ($account_cash) {
|
|
|
foreach ($account_cash as $k => $v) {
|
|
|
- $cash = Dever::db('option/bill_jiaofu')->getTotal(array('where_start' => $info['jiaofu_date'], 'where_type' => $v['type'], 'where_aid' => $info['aid'], 'where_status' => 2));
|
|
|
+ $cash = Dever::db('option/bill_jiaofu')->getTotal(array('where_end' => $info['jiaofu_date'], 'where_type' => $v['type'], 'where_aid' => $info['aid'], 'where_status' => 2));
|
|
|
if ($cash) {
|
|
|
$update['where_id'] = $v['id'];
|
|
|
$update['daijiaofu'] = $v['daijiaofu'] - $cash['total'];
|