New changes in BBNepal

This commit is contained in:
2024-10-17 17:06:13 +05:45
parent 4ac5a5e491
commit 7008ec0310
7 changed files with 261 additions and 38 deletions

View File

@ -77,8 +77,8 @@ class Purchases extends CI_Controller
'remarks' => filter_var($_POST['remarks']),
'status' => 1,
);
pre($_POST);
die;
// pre($_POST);
// die;
//$this->db->insert('tbl_purchases', $TableData);
redirect("inventory/purchases/list");
}
@ -93,8 +93,22 @@ class Purchases extends CI_Controller
$this->db->delete('tbl_purchasedetails');
redirect("inventory/purchases/list");
break;
case 'purchase_register':
$data['PurchaseRecords'] = $this->MPurchases->getPurchaseRecords();
case 'purchase_register':
if (!isset($_POST['fromDate'])) {
$data['fromDate'] = null;
}
if (!isset($_POST['toDate'])) {
$data['toDate'] = null;
}
if (isset($_POST)) {
$data = $_POST;
}
$data['fiscalStart'] = NepaliToEnglishDate($data['fromDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_from);
$data['fiscalEnd'] = NepaliToEnglishDate($data['toDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_to);
$data['pageTitle'] = "Sales & Register";
$data['PurchaseRecords'] = $this->MPurchases->getPurchaseRecords($data['fiscalStart'],$data['fiscalEnd']);
loadView("inventory/purchases/register", $data);
break;