From 9c8fb2c131a60558f7b05dd9963fcdc00d98a53b Mon Sep 17 00:00:00 2001 From: qiyu-xie Date: Mon, 18 Jan 2021 14:58:41 +0800 Subject: [PATCH] * Finish task#8963.#8962. Fix bug. --- module/program/control.php | 4 ++-- module/program/model.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index b98d158cdf..8e14781b47 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -213,7 +213,7 @@ class program extends control $this->view->PGMList = $this->program->getPGMList(); $this->view->budgetUnitList = $this->program->getBudgetUnitList(); $this->view->parentProgram = $parentProgram; - $this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram); + $this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram) + $program->budget; $this->display(); } @@ -994,7 +994,7 @@ class program extends control $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); $this->view->from = $from; $this->view->parentProgram = $parentProgram; - $this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram); + $this->view->remainBudget = $this->program->getParentRemainBudget($parentProgram) + $project->budget; $this->view->budgetUnitList = $this->program->getBudgetUnitList(); $this->display(); diff --git a/module/program/model.php b/module/program/model.php index 43bb2b8e0b..e7bfe437ed 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -293,7 +293,7 @@ class programModel extends model if($program->budget != 0 and $parentProgram->budget != 0) { $parentRemainBudget = $this->getParentRemainBudget($parentProgram); - if($program->budget > $parentRemainBudget + $program->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget; + if($program->budget > $parentRemainBudget + $oldProgram->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget; } } if(dao::isError()) return false; @@ -1569,7 +1569,7 @@ class programModel extends model if($project->budget != 0 and $parentProgram->budget != 0) { $parentRemainBudget = $this->getParentRemainBudget($parentProgram); - if($project->budget > $parentRemainBudget + $project->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget; + if($project->budget > $parentRemainBudget + $oldProject->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget; } }