|
|
@@ -149,7 +149,8 @@ class ExpendController extends BaseController
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
- $list = ExpendClass::getAllByCondition(['mainId' => $this->mainId, 'bx' => 0, 'staffId' => $staffId], null, '*', null, true);
|
|
|
+ $condition = ['mainId' => $this->mainId, 'bx' => 0, 'staffId' => $staffId, 'delStatus' => 0];
|
|
|
+ $list = ExpendClass::getAllByCondition($condition, null, '*', null, true);
|
|
|
$total = 0;
|
|
|
$staff = $this->shopAdmin;
|
|
|
$bxData = [
|
|
|
@@ -390,6 +391,18 @@ class ExpendController extends BaseController
|
|
|
if ($expend->mainId != $this->mainId){
|
|
|
util::fail('没有找到支出数据');
|
|
|
}
|
|
|
+ if ($expend->delStatus == 1) {
|
|
|
+ util::fail('此支出数据已是删除状态');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理报销表数据
|
|
|
+ if ($expend->bxId != 0) {
|
|
|
+ $expendBx = ExpendBxClass::getById($expend->bxId, true);
|
|
|
+ $expendBx->amount = $expendBx->amount - $expend->amount;
|
|
|
+ $expendBx->remark = $expendBx->remark . "| " . date("Y-m-d H:i") . " 删除支出:ID=" . $expend->id;
|
|
|
+ $expendBx->save();
|
|
|
+ }
|
|
|
+
|
|
|
$expend->delStaffId = $staffId;
|
|
|
$expend->delStaffName = $staff->name;
|
|
|
$expend->delStatus = 1;
|