Approve invoice Fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-10-03 14:48:00 +05:30
parent 495776e377
commit 936f5d23da

View File

@ -314,7 +314,7 @@ class Invoice extends BaseController
helper('session');
$where = ['isactive' => 1, 'status' => 'Approved', 'invoice_id' => (int)$id];
$details = $model->where($where)->findAll();
if (!empty($details)) { // change
if (empty($details)) { // Array Empty Means allow to Approve.
$data = ['status' => 'Approved', 'updated_by' => get_logged_user_id()];
if ($model->update($id, $data)) {
$this->approve_notifications((int)$id);