purchasevoucher

This commit is contained in:
Sampanna Rimal
2024-08-06 12:48:20 +05:45
parent d164f3139d
commit 52f9c0dd15
4 changed files with 52 additions and 6 deletions

View File

@ -221,5 +221,18 @@ class Welcome extends CI_Controller
$this->db->query("ALTER TABLE tbl_items ADD COLUMN units_id INT(11)");
}
$query = $this->db->query("SHOW COLUMNS FROM tbl_purchases LIKE 'vatToggle'");
// If the column doesn't exist, alter the table to add it
if ($query->num_rows() == 0) {
$this->db->query("ALTER TABLE tbl_purchases ADD COLUMN vatToggle INT(11)");
}
$query = $this->db->query("SHOW COLUMNS FROM tbl_sales LIKE 'vatToggle'");
// If the column doesn't exist, alter the table to add it
if ($query->num_rows() == 0) {
$this->db->query("ALTER TABLE tbl_sales ADD COLUMN vatToggle INT(11)");
}
}
}

View File

@ -24,6 +24,7 @@ class Purchases extends CI_Controller
$this->db->where('purchases_id', $id);
$data['PurchaseDetails'] = $this->db->get("tbl_purchasedetails")->result();
$data['pageTitle'] = "View Purchase";
// print_r($data);die;
loadView("inventory/purchases/view", $data);
break;
case 'create':
@ -35,6 +36,7 @@ class Purchases extends CI_Controller
'purchase_date' => filter_var($_POST['purchase_date']),
'discount' => filter_var($_POST['discountpercentage']),
'created_on' => date('Y-m-d H:i:s'),
'vatToggle' => filter_var($_POST['vatToggleValue']),
'created_by' => 'admin',
'remarks' => '',
'status' => 1,