|
|
@@ -42,10 +42,11 @@ class ExpendController extends BaseController
|
|
|
if (empty($main)) {
|
|
|
util::fail('没有门店信息');
|
|
|
}
|
|
|
- $main->money = bcsub($main->money, $amount, 2);
|
|
|
- if ($main->money < 0) {
|
|
|
+ $balance = bcsub($main->money, $amount, 2);
|
|
|
+ if ($balance < 0) {
|
|
|
util::fail('现金不足');
|
|
|
}
|
|
|
+ $main->money = $balance;
|
|
|
$main->save();
|
|
|
|
|
|
$staffId = $this->shopAdminId;
|
|
|
@@ -57,6 +58,7 @@ class ExpendController extends BaseController
|
|
|
$capitalType = dict::getDict('capitalType', 'expendRegister', 'id');
|
|
|
|
|
|
$data = [];
|
|
|
+ $data['balance'] = $balance;
|
|
|
$data['mainId'] = $mainId;
|
|
|
$data['sjId'] = $this->sjId;
|
|
|
$data['amount'] = $amount;
|