diff --git a/account/application/controllers/Welcome.php b/account/application/controllers/Welcome.php index 1e948ed..0adbe3f 100644 --- a/account/application/controllers/Welcome.php +++ b/account/application/controllers/Welcome.php @@ -180,6 +180,28 @@ class Welcome extends CI_Controller if ($query->num_rows() == 0) { $this->db->query("ALTER TABLE tbl_purchases ADD COLUMN purchase_ref VARCHAR(50)"); } + $query = $this->db->query("SHOW COLUMNS FROM tbl_accounts LIKE 'account_image'"); + + // If the column doesn't exist, alter the table to add it + if ($query->num_rows() == 0) { + $this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_image text"); + } + + $query = $this->db->query("SHOW COLUMNS FROM tbl_accounts LIKE 'account_number'"); + + // If the column doesn't exist, alter the table to add it + if ($query->num_rows() == 0) { + $this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_number VARCHAR(50)"); + } + + $query = $this->db->query("SHOW COLUMNS FROM tbl_accounts LIKE 'account_branch'"); + + // If the column doesn't exist, alter the table to add it + if ($query->num_rows() == 0) { + $this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_branch VARCHAR(50)"); + } + + $query = $this->db->query("SHOW COLUMNS FROM tbl_branches LIKE 'vat'"); // If the column doesn't exist, alter the table to add it diff --git a/account/application/controllers/accounts/Accountheads.php b/account/application/controllers/accounts/Accountheads.php index 8dfb86d..6a876d9 100644 --- a/account/application/controllers/accounts/Accountheads.php +++ b/account/application/controllers/accounts/Accountheads.php @@ -24,12 +24,14 @@ class Accountheads extends CI_Controller // 'account_plcategory' => filter_var($_POST['account_plcategory']), // 'account_currency' => filter_var($_POST['account_currency']), // 'account_partyname' => filter_var($_POST['account_partyname']), - // 'account_partyaddress' => filter_var($_POST['account_partyaddress']), - // 'account_partypan' => filter_var($_POST['account_partypan']), - // 'account_partycontact' => filter_var($_POST['account_partycontact']), - // 'account_partyemail' => filter_var($_POST['account_partyemail']), - // 'account_partycontactperson' => filter_var($_POST['account_partycontactperson']), - // 'account_partycontactpersoncontact' => filter_var($_POST['account_partycontactpersoncontact']), + 'account_number' => filter_var($_POST['account_number']), + 'account_branch' => filter_var($_POST['account_branch']), + 'account_partyaddress' => filter_var($_POST['account_partyaddress']), + 'account_partypan' => filter_var($_POST['account_partypan']), + 'account_partycontact' => filter_var($_POST['account_partycontact']), + 'account_partyemail' => filter_var($_POST['account_partyemail']), + 'account_partycontactperson' => filter_var($_POST['account_partycontactperson']), + 'account_partycontactpersoncontact' => filter_var($_POST['account_partycontactpersoncontact']), 'created_on' => date('Y-m-d H:i:s'), 'created_by' => 'admin', 'remarks' => filter_var($_POST['remarks']), @@ -84,6 +86,8 @@ class Accountheads extends CI_Controller 'account_type' => filter_var($_POST['account_type']), 'account_plcategory' => filter_var($_POST['account_plcategory']), 'account_currency' => filter_var($_POST['account_currency']), + 'account_number' => filter_var($_POST['account_number']), + 'account_branch' => filter_var($_POST['account_branch']), 'account_partyname' => filter_var($_POST['account_partyname']), 'account_partyaddress' => filter_var($_POST['account_partyaddress']), 'account_partypan' => filter_var($_POST['account_partypan']), diff --git a/account/application/views/accounts/accountheads/details.php b/account/application/views/accounts/accountheads/details.php index a3d8b31..9f45e85 100644 --- a/account/application/views/accounts/accountheads/details.php +++ b/account/application/views/accounts/accountheads/details.php @@ -76,6 +76,20 @@ + +
+
+ +
+
+ + +
+
+ +
+
+
diff --git a/account/application/views/accounts/accountheads/edit.php b/account/application/views/accounts/accountheads/edit.php index 9b8c226..7de040a 100644 --- a/account/application/views/accounts/accountheads/edit.php +++ b/account/application/views/accounts/accountheads/edit.php @@ -139,6 +139,32 @@
+ +
+ +
+ + +
+ +
+ +
+ + + +
+ + +
+ +
+ +
+ +
+ +
diff --git a/account/application/views/accounts/accountheads/list.php b/account/application/views/accounts/accountheads/list.php index fd7845e..9c81427 100644 --- a/account/application/views/accounts/accountheads/list.php +++ b/account/application/views/accounts/accountheads/list.php @@ -14,48 +14,129 @@
-
" enctype="multipart/form-data" name="tbl_accounts"> -
- -
-
-
+ " enctype="multipart/form-data" name="tbl_accounts"> +
+ +
+
+ + +
+
- -
-
-
-
- myaccounts->showAccountsCategoriesWithParentsCombo($fieldName = "accategory_id", $displayName = "Under", $fieldID = "accategory_id", $condition = "status=1", $default = "", $CSSclass = "select2", "required"); - ?> -
+
+ +
+
+ myaccounts->showAccountsCategoriesWithParentsCombo("accategory_id", "Under", "accategory_id", "status=1", "", "select2", "required"); + ?> +
+
-
-
-
-
-
- -
-
-
-
- -
-
+ + + + + +
+ +
+
+ + +
+
+
+
+ + +
+
+
+ +
+ +
+
+ + +
+
+
+ + +
+
+ +
- -
- - -
+
@@ -168,6 +249,23 @@ } }); } + $(document).ready(function() { + $('#accategory_id').change(function() { + var selectedOption = $(this).val(); + // Reset form and hide all additional fields + $('#additionalFields').hide(); + $('#bankFields').hide(); + $('.required-field').prop('required', false); + // Show additional fields based on selected option + if (selectedOption == 4 || selectedOption == 30) { + $('#additionalFields').show(); + $('.required-field').prop('required', true); + } else if (selectedOption == 2) { + $('#bankFields').show(); + $('.required-field').prop('required', true); + } + }); + });
diff --git a/account/uploads/batlogo11.jpg b/account/uploads/batlogo11.jpg new file mode 100644 index 0000000..aef8326 Binary files /dev/null and b/account/uploads/batlogo11.jpg differ