From 967642f2befdfdb9159e2f2067f34c825f31691f Mon Sep 17 00:00:00 2001 From: Roshan Date: Mon, 7 Oct 2024 11:41:27 +0545 Subject: [PATCH] changes for bbnepal --- .../controllers/accounts/Ledger.php | 2 +- .../controllers/accounts/Reports.php | 23 +++++- .../application/helpers/accounts_helper.php | 2 +- account/application/libraries/Myaccounts.php | 44 ++++++++++-- .../ledger/ledger_cash_book_details.php | 70 +++++++++++++++++++ .../views/accounts/ledger/partywise.php | 1 + .../views/accounts/vouchers/show_voucher.php | 2 +- account/application/views/includes/nav.php | 2 +- .../views/inventory/items/list.php | 11 +-- .../views/inventory/purchases/register.php | 8 +-- .../views/inventory/sales/list.php | 2 +- .../views/inventory/sales/register.php | 9 ++- 12 files changed, 151 insertions(+), 25 deletions(-) create mode 100644 account/application/views/accounts/ledger/ledger_cash_book_details.php diff --git a/account/application/controllers/accounts/Ledger.php b/account/application/controllers/accounts/Ledger.php index 7780f7e..cc7dfb9 100644 --- a/account/application/controllers/accounts/Ledger.php +++ b/account/application/controllers/accounts/Ledger.php @@ -54,7 +54,7 @@ class Ledger extends CI_Controller $data['to_date'] = null; } if (isset($_GET)) { - $data = $_GET; + $data = $_GET; } $data['pageTitle'] = "View Party Ledger"; $data['fiscalStart'] = NepaliToEnglishDate($data['fromDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_from); diff --git a/account/application/controllers/accounts/Reports.php b/account/application/controllers/accounts/Reports.php index e8a60b1..b238497 100644 --- a/account/application/controllers/accounts/Reports.php +++ b/account/application/controllers/accounts/Reports.php @@ -38,7 +38,7 @@ class Reports extends CI_Controller $data['AccountGroups'] = $AccountGroups; loadView("accounts/ledgerall", $data); break; - case 'getledgersummary': + case 'getledgersummary': $account_id = $this->uri->segment(3); $data['pageTitle'] = "Ledger"; $Transactions = $this->db->where("status", 1)->where("account_id", $account_id)->get("tbl_voucherdetails")->result(); @@ -52,6 +52,25 @@ class Reports extends CI_Controller $data['account_id'] = $account_id; $this->load->view("accounts/ledgersummary", $data); break; + + case 'ledgerCashBook': + // $data = $this->uri->segment(3); + // $data['pageTitle'] = "Ledger"; + // $Transactions = $this->db->where("status", 1)->where("account_id", $account_id)->get("tbl_voucherdetails")->result(); + // $Account = $this->db->where("status", 1)->where("account_id", $account_id)->get("tbl_accounts")->row(); + // foreach ($Transactions as $T) { + // // $T->AccountCategory=$this->db->where("status",1)->where("accategory_id",$AccountGroup->acgroup_id)->get("tbl_accategories")->result(); + // $T->Voucher = $this->db->where("status", 1)->where("voucher_id", $T->voucher_id)->get("tbl_vouchers")->row(); + // } + // $data['Transactions'] = $Transactions; + // $data['Account'] = $Account; + // $data['account_id'] = $account_id; + $data['fiscalStart'] = NepaliToEnglishDate($data['fromDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_from); + $data['fiscalEnd'] = NepaliToEnglishDate($data['toDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_to); + + $this->load->view("accounts/ledger/ledger_cash_book_details",$data); + break; + case 'trialbalance_old': $data['pageTitle'] = "Trial Balance"; $AccountGroups = $this->db->where("status", 1)->get("tbl_acgroups")->result(); @@ -268,8 +287,6 @@ class Reports extends CI_Controller case 'getledgersummary': $account_id = $this->uri->segment(5); $this->myaccounts->showLedger($account_id); - - break; case 'default': //show_404(); diff --git a/account/application/helpers/accounts_helper.php b/account/application/helpers/accounts_helper.php index 2cf9a3d..e28c86c 100644 --- a/account/application/helpers/accounts_helper.php +++ b/account/application/helpers/accounts_helper.php @@ -80,7 +80,7 @@ function linkVoucher($voucher_id) $ci = &get_instance(); $Voucher = $ci->db->where("voucher_id", $voucher_id)->get("tbl_vouchers")->row(); $Name = $ci->db->where("vouchertype_id", $Voucher->voucher_type)->get("tbl_vouchertypes")->row()->voucher_type . " Voucher # " . $Voucher->voucher_no; - echo "$Name"; + echo "$Name"; } else { echo ""; } diff --git a/account/application/libraries/Myaccounts.php b/account/application/libraries/Myaccounts.php index 4b81182..5ff1fce 100644 --- a/account/application/libraries/Myaccounts.php +++ b/account/application/libraries/Myaccounts.php @@ -129,7 +129,8 @@ class myaccounts { $CI = &get_instance(); $Account = $CI->db->query("select * from tbl_accounts where account_id='$account_id'")->row(); - $Account->Balance = $this->getBalance($account_id); + // $Account->Balance = $this->getBalance($account_id); + // echo"
";print_r($Account); die();
         return $Account;
     }
     function getBalance($account_id)
@@ -179,7 +180,6 @@ class myaccounts
             $Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
         }
         //$q=$CI->db->get_compiled_select();
-        //print($q);
 ?>
         
@@ -684,7 +684,7 @@ class myaccounts
Leger for Account : account_name; ?> -
@@ -694,7 +694,7 @@ class myaccounts
Ledger Details for account_name; ?>
- +
@@ -769,13 +769,43 @@ class myaccounts
+ - + + '; + echo $html; + ?> +
+
+ + \ No newline at end of file diff --git a/account/application/views/accounts/ledger/partywise.php b/account/application/views/accounts/ledger/partywise.php index e249bc3..b100e87 100644 --- a/account/application/views/accounts/ledger/partywise.php +++ b/account/application/views/accounts/ledger/partywise.php @@ -16,6 +16,7 @@
+
diff --git a/account/application/views/accounts/vouchers/show_voucher.php b/account/application/views/accounts/vouchers/show_voucher.php index b225838..2d68c3c 100644 --- a/account/application/views/accounts/vouchers/show_voucher.php +++ b/account/application/views/accounts/vouchers/show_voucher.php @@ -9,4 +9,4 @@
- + diff --git a/account/application/views/includes/nav.php b/account/application/views/includes/nav.php index 260b9e1..5efc1fd 100644 --- a/account/application/views/includes/nav.php +++ b/account/application/views/includes/nav.php @@ -1,7 +1,7 @@ -