Compare commits
38 Commits
114e7aa4c2
...
BBnepal_ro
Author | SHA1 | Date | |
---|---|---|---|
7008ec0310 | |||
4ac5a5e491 | |||
ad3e5eb1ec | |||
318998d272 | |||
967642f2be | |||
e3c8a3b5fe | |||
ec6bfaf7ff | |||
4683fe67a7 | |||
60f4c75eb0 | |||
684e01bf48 | |||
497f567cba | |||
31e7f8de87 | |||
a5d29a202e | |||
4109787bc4 | |||
b1c6bad445 | |||
15b3e542a3 | |||
cd361f79aa | |||
759b97e1f0 | |||
161703be17 | |||
78670b1b95 | |||
8c5bfd147b | |||
f488c286bd | |||
5df46f007d | |||
c9e54804c8 | |||
cb443cd551 | |||
ee30970d1f | |||
fe8786f03f | |||
16246fbdeb | |||
0f5bafdf3e | |||
c64472a21e | |||
2ebd3a2ea9 | |||
c08ed22b78 | |||
9ebdd5a858 | |||
213be12e2a | |||
e9fc0b8270 | |||
169a49c376 | |||
b06ce0569a | |||
e47ff3321d |
4
.env
4
.env
@ -3,7 +3,7 @@ APP_URL=http://localhost/bbnepal/School-With-Accounts/account/
|
|||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=localhost
|
DB_HOST=localhost
|
||||||
DB_PORT=3309
|
DB_PORT=3309
|
||||||
DATABASE_OPTIONS=bbnepal_accounting,myurlsco_accounts1,myurlsco_accounts2,myurlsco_accounts3
|
DATABASE_OPTIONS=bbnepal_accounting,myurlsco_accounts1,myurlsco_accounts2,myurlsco_accounts3,myurlsco_bbnepal_acc #given
|
||||||
DB_DATABASE=bbnepal_accounting
|
DB_DATABASE=bbnepal_accounting # given
|
||||||
DB_USERNAME=root
|
DB_USERNAME=root
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
@ -241,5 +241,8 @@ class Welcome extends CI_Controller
|
|||||||
if ($query->num_rows() == 0) {
|
if ($query->num_rows() == 0) {
|
||||||
$this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_bank VARCHAR(50)");
|
$this->db->query("ALTER TABLE tbl_accounts ADD COLUMN account_bank VARCHAR(50)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->db->query("ALTER TABLE tbl_translations MODIFY COLUMN nepali VARCHAR(255) COLLATE utf8_unicode_ci");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@ class Ledger extends CI_Controller
|
|||||||
}
|
}
|
||||||
public function _remap($alias = "", $params = array())
|
public function _remap($alias = "", $params = array())
|
||||||
{
|
{
|
||||||
|
|
||||||
$data['dataValue'] = $this->session;
|
$data['dataValue'] = $this->session;
|
||||||
|
// echo "<pre>"; print_r($_GET['accategory_id']);die();
|
||||||
|
|
||||||
$data['pageTitle'] = "Account Head";
|
$data['pageTitle'] = "Account Head";
|
||||||
switch ($alias) {
|
switch ($alias) {
|
||||||
@ -19,9 +19,13 @@ class Ledger extends CI_Controller
|
|||||||
$data['pageTitle'] = "Ledger";
|
$data['pageTitle'] = "Ledger";
|
||||||
$AccountGroups = $this->db->where("status", 1)->get("tbl_acgroups")->result();
|
$AccountGroups = $this->db->where("status", 1)->get("tbl_acgroups")->result();
|
||||||
foreach ($AccountGroups as $AccountGroup) {
|
foreach ($AccountGroups as $AccountGroup) {
|
||||||
$AccountGroup->AccountCategories = $this->db->where("status", 1)->where("acgroup_id", $AccountGroup->acgroup_id)->get("tbl_accategories")->result();
|
// $AccountGroup->AccountCategories = $this->db->where("status", 1)->where("acgroup_id", $AccountGroup->acgroup_id)->get("tbl_accategories")->result();
|
||||||
|
$AccountGroup->AccountCategories = $this->db->where("status", 1)->where("accategory_id ", ($_GET['accategory_id'] ?? ""))->get("tbl_accategories")->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
$data['AccountGroups'] = $AccountGroups;
|
$data['AccountGroups'] = $AccountGroups;
|
||||||
|
// echo "<pre>"; print_r($data['AccountGroups']);die();
|
||||||
|
|
||||||
loadView("accounts/ledger/navigate", $data);
|
loadView("accounts/ledger/navigate", $data);
|
||||||
break;
|
break;
|
||||||
case 'getledgersummary':
|
case 'getledgersummary':
|
||||||
@ -39,11 +43,27 @@ class Ledger extends CI_Controller
|
|||||||
$this->load->view("accounts/ledgersummary", $data);
|
$this->load->view("accounts/ledgersummary", $data);
|
||||||
break;
|
break;
|
||||||
case 'partyledger':
|
case 'partyledger':
|
||||||
$data['pageTitle'] = "View Party Ledger";
|
// $data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
// $data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
// $_GET['show_ledger'];
|
// $_GET['show_ledger'];
|
||||||
|
|
||||||
|
if (!isset($_GET['from_date'])) {
|
||||||
|
$data['from_date'] = null;
|
||||||
|
}
|
||||||
|
if (!isset($_GET['to_date'])) {
|
||||||
|
$data['to_date'] = null;
|
||||||
|
}
|
||||||
|
if (isset($_GET)) {
|
||||||
|
$data = $_GET;
|
||||||
|
}
|
||||||
|
$data['pageTitle'] = "View Party Ledger";
|
||||||
|
$data['fiscalStart'] = NepaliToEnglishDate($data['fromDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
$data['fiscalEnd'] = NepaliToEnglishDate($data['toDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['show_ledger'])) {
|
if (isset($_GET['show_ledger'])) {
|
||||||
$fromDate_Nepali = $_GET['from_date'];
|
$fromDate_Nepali=$data['from_date'];
|
||||||
$toDate_Nepali = $_GET['to_date'];
|
$toDate_Nepali =$data['to_date'];
|
||||||
$data['fromDate'] = NepaliToEnglishDate($fromDate_Nepali);
|
$data['fromDate'] = NepaliToEnglishDate($fromDate_Nepali);
|
||||||
$data['toDate'] = NepaliToEnglishDate($toDate_Nepali);
|
$data['toDate'] = NepaliToEnglishDate($toDate_Nepali);
|
||||||
$data['fromDate_Nepali'] = $fromDate_Nepali;
|
$data['fromDate_Nepali'] = $fromDate_Nepali;
|
||||||
@ -75,15 +95,44 @@ class Ledger extends CI_Controller
|
|||||||
loadView("accounts/daybook", $data);
|
loadView("accounts/daybook", $data);
|
||||||
break;
|
break;
|
||||||
case 'bank_book':
|
case 'bank_book':
|
||||||
|
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['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
// $data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
$data['pageTitle'] = "Bank Book";
|
$data['pageTitle'] = "Bank Book";
|
||||||
loadView("accounts/ledger_bankbook", $data);
|
loadView("accounts/ledger_bankbook", $data);
|
||||||
break;
|
break;
|
||||||
case 'cash_book':
|
case 'cash_book':
|
||||||
|
|
||||||
|
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['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
// $data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
$data['pageTitle'] = "Cash Book";
|
$data['pageTitle'] = "Cash Book";
|
||||||
loadView("accounts/ledger_cashbook", $data);
|
loadView("accounts/ledger_cashbook", $data);
|
||||||
break;
|
break;
|
||||||
case 'receiveables':
|
case 'receiveables':
|
||||||
$data['pageTitle'] = "Accounts Receiveables";
|
$data['pageTitle'] = "Accounts Receivables";
|
||||||
loadView("accounts/ledger_receiveables", $data);
|
loadView("accounts/ledger_receiveables", $data);
|
||||||
break;
|
break;
|
||||||
case 'payables':
|
case 'payables':
|
||||||
|
@ -52,6 +52,25 @@ class Reports extends CI_Controller
|
|||||||
$data['account_id'] = $account_id;
|
$data['account_id'] = $account_id;
|
||||||
$this->load->view("accounts/ledgersummary", $data);
|
$this->load->view("accounts/ledgersummary", $data);
|
||||||
break;
|
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':
|
case 'trialbalance_old':
|
||||||
$data['pageTitle'] = "Trial Balance";
|
$data['pageTitle'] = "Trial Balance";
|
||||||
$AccountGroups = $this->db->where("status", 1)->get("tbl_acgroups")->result();
|
$AccountGroups = $this->db->where("status", 1)->get("tbl_acgroups")->result();
|
||||||
@ -65,8 +84,20 @@ class Reports extends CI_Controller
|
|||||||
loadView("accounts/trialbalance", $data);
|
loadView("accounts/trialbalance", $data);
|
||||||
break;
|
break;
|
||||||
case 'trialbalance':
|
case 'trialbalance':
|
||||||
$data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
if (!isset($_POST['fromDate'])) {
|
||||||
$data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
$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);
|
||||||
|
// echo "<pre>"; print_r($data); die();
|
||||||
|
|
||||||
$data['pageTitle'] = "Trial Balance";
|
$data['pageTitle'] = "Trial Balance";
|
||||||
loadView("accounts/trialbalance_new", $data);
|
loadView("accounts/trialbalance_new", $data);
|
||||||
break;
|
break;
|
||||||
@ -116,7 +147,7 @@ class Reports extends CI_Controller
|
|||||||
break;
|
break;
|
||||||
case 'balance_by_ledger':
|
case 'balance_by_ledger':
|
||||||
$accategory_id = 0;
|
$accategory_id = 0;
|
||||||
$data['pageTitle'] = "Account Balances By Group";
|
$data['pageTitle'] = "Account Balances By Ledgers";
|
||||||
if (isset($_GET['group'])) {
|
if (isset($_GET['group'])) {
|
||||||
$accategory_id = ($_GET['group']) ? $_GET['group'] : 0;
|
$accategory_id = ($_GET['group']) ? $_GET['group'] : 0;
|
||||||
}
|
}
|
||||||
@ -132,8 +163,17 @@ class Reports extends CI_Controller
|
|||||||
loadView("accounts/pl", $data);
|
loadView("accounts/pl", $data);
|
||||||
break;
|
break;
|
||||||
case 'pl':
|
case 'pl':
|
||||||
$data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
if (!isset($_POST['fromDate'])) {
|
||||||
$data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
$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'] = "Profit & Loss Statement";
|
$data['pageTitle'] = "Profit & Loss Statement";
|
||||||
loadView("accounts/pl_new", $data);
|
loadView("accounts/pl_new", $data);
|
||||||
break;
|
break;
|
||||||
@ -147,8 +187,20 @@ class Reports extends CI_Controller
|
|||||||
loadView("accounts/balancesheet", $data);
|
loadView("accounts/balancesheet", $data);
|
||||||
break;
|
break;
|
||||||
case 'balance_sheet':
|
case 'balance_sheet':
|
||||||
$data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
// $data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
$data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
// $data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
|
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'] = "Balance Sheet";
|
$data['pageTitle'] = "Balance Sheet";
|
||||||
loadView("accounts/balancesheet_new", $data);
|
loadView("accounts/balancesheet_new", $data);
|
||||||
break;
|
break;
|
||||||
@ -157,8 +209,20 @@ class Reports extends CI_Controller
|
|||||||
loadView("accounts/balance_sheet_vertical", $data);
|
loadView("accounts/balance_sheet_vertical", $data);
|
||||||
break;
|
break;
|
||||||
case 'cash_flow':
|
case 'cash_flow':
|
||||||
$data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
// $data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
$data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
// $data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
|
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'] = "Cash Flow";
|
$data['pageTitle'] = "Cash Flow";
|
||||||
loadView("accounts/cash_flow", $data);
|
loadView("accounts/cash_flow", $data);
|
||||||
break;
|
break;
|
||||||
@ -171,8 +235,22 @@ class Reports extends CI_Controller
|
|||||||
loadView("accounts/incomes_expenses", $data);
|
loadView("accounts/incomes_expenses", $data);
|
||||||
break;
|
break;
|
||||||
case 'receipt_and_payment':
|
case 'receipt_and_payment':
|
||||||
$data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
if (!isset($_POST['fromDate'])) {
|
||||||
$data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
$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['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
// $data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
$data['pageTitle'] = "Cash Flow";
|
$data['pageTitle'] = "Cash Flow";
|
||||||
loadView("accounts/receipt_and_payment", $data);
|
loadView("accounts/receipt_and_payment", $data);
|
||||||
break;
|
break;
|
||||||
@ -209,8 +287,6 @@ class Reports extends CI_Controller
|
|||||||
case 'getledgersummary':
|
case 'getledgersummary':
|
||||||
$account_id = $this->uri->segment(5);
|
$account_id = $this->uri->segment(5);
|
||||||
$this->myaccounts->showLedger($account_id);
|
$this->myaccounts->showLedger($account_id);
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'default':
|
case 'default':
|
||||||
//show_404();
|
//show_404();
|
||||||
|
@ -26,6 +26,8 @@ class Vouchers extends CI_Controller
|
|||||||
break;
|
break;
|
||||||
case 'listvouchers':
|
case 'listvouchers':
|
||||||
$data['pageTitle'] = "Vouchers";
|
$data['pageTitle'] = "Vouchers";
|
||||||
|
$data['fiscalStart'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
$data['fiscalEnd'] = NepaliDate($this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
$fromDate_bs = isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth();
|
$fromDate_bs = isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth();
|
||||||
$todate_bs = isset($_GET['to_date']) ? $_GET['to_date'] : NepaliDate(Today());
|
$todate_bs = isset($_GET['to_date']) ? $_GET['to_date'] : NepaliDate(Today());
|
||||||
$fromDate_ad = NepaliToEnglishDate($fromDate_bs);
|
$fromDate_ad = NepaliToEnglishDate($fromDate_bs);
|
||||||
|
@ -50,6 +50,7 @@ class Purchases extends CI_Controller
|
|||||||
'items_id' => $item,
|
'items_id' => $item,
|
||||||
'qty' => $_POST['quantity'][$a],
|
'qty' => $_POST['quantity'][$a],
|
||||||
'rate' => $_POST['rate'][$a],
|
'rate' => $_POST['rate'][$a],
|
||||||
|
'vat' => $_POST['vat'][$a],
|
||||||
'created_on' => date('Y-m-d H:i:s'),
|
'created_on' => date('Y-m-d H:i:s'),
|
||||||
'created_by' => 'admin',
|
'created_by' => 'admin',
|
||||||
'remarks' => '',
|
'remarks' => '',
|
||||||
@ -76,8 +77,8 @@ class Purchases extends CI_Controller
|
|||||||
'remarks' => filter_var($_POST['remarks']),
|
'remarks' => filter_var($_POST['remarks']),
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
);
|
);
|
||||||
pre($_POST);
|
// pre($_POST);
|
||||||
die;
|
// die;
|
||||||
//$this->db->insert('tbl_purchases', $TableData);
|
//$this->db->insert('tbl_purchases', $TableData);
|
||||||
redirect("inventory/purchases/list");
|
redirect("inventory/purchases/list");
|
||||||
}
|
}
|
||||||
@ -93,7 +94,21 @@ class Purchases extends CI_Controller
|
|||||||
redirect("inventory/purchases/list");
|
redirect("inventory/purchases/list");
|
||||||
break;
|
break;
|
||||||
case 'purchase_register':
|
case 'purchase_register':
|
||||||
$data['PurchaseRecords'] = $this->MPurchases->getPurchaseRecords();
|
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);
|
loadView("inventory/purchases/register", $data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -12,14 +12,17 @@ class Reports extends CI_Controller
|
|||||||
}
|
}
|
||||||
public function _remap($alias = "", $params = array())
|
public function _remap($alias = "", $params = array())
|
||||||
{
|
{
|
||||||
|
// dd($this->session);
|
||||||
$data['dataValue'] = $this->session;
|
$data['dataValue'] = $this->session;
|
||||||
$data['pageTitle'] = "Sales";
|
$data['pageTitle'] = "Sales";
|
||||||
|
$datas['fiscalStart'] =NepaliDate($this->session->FiscalYear->fiscalyear_from);
|
||||||
|
$datas['fiscalEnd'] =NepaliDate($this->session->FiscalYear->fiscalyear_to);
|
||||||
switch ($alias) {
|
switch ($alias) {
|
||||||
case 'purchase_vs_sales':
|
case 'purchase_vs_sales':
|
||||||
$data['StockRecords']=$this->MStocks->getStockRecords();
|
$data['StockRecords']=$this->MStocks->getStockRecords();
|
||||||
$data['PurchaseDetails'] = $this->MPurchases->getItemPurchases();
|
$data['PurchaseDetails'] = $this->MPurchases->getItemPurchases();
|
||||||
$data['SalesDetails'] = $this->MSales->getItemSales();
|
$data['SalesDetails'] = $this->MSales->getItemSales();
|
||||||
$data['StockItems'] = $this->MStocks->getStockSummary();
|
$data['StockItems'] = $this->MStocks->getStockSummary($datas);
|
||||||
loadview("inventory/reports/purchase_vs_sales", $data);
|
loadview("inventory/reports/purchase_vs_sales", $data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -44,12 +44,13 @@ class Sales extends CI_Controller
|
|||||||
// print_r($_POST);die;
|
// print_r($_POST);die;
|
||||||
|
|
||||||
foreach ($_POST['item_id'] as $item) {
|
foreach ($_POST['item_id'] as $item) {
|
||||||
if ($item != 0 || $_POST['qty'][$i] != 0 || $_POST['rate'][$i] != 0) :
|
if ($item != 0 || $_POST['qty'][$i] != 0 || $_POST['rate'][$i] != 0 || $_POST['vat'][$i] != 0) :
|
||||||
$TableData = array(
|
$TableData = array(
|
||||||
'sales_id' => $sales_id,
|
'sales_id' => $sales_id,
|
||||||
'items_id' => $item,
|
'items_id' => $item,
|
||||||
'qty' => $_POST['qty'][$i],
|
'qty' => $_POST['qty'][$i],
|
||||||
'rate' => $_POST['rate'][$i],
|
'rate' => $_POST['rate'][$i],
|
||||||
|
'vat' => $_POST['vat'][$i],
|
||||||
'created_on' => date('Y-m-d H:i:s'),
|
'created_on' => date('Y-m-d H:i:s'),
|
||||||
'created_by' => 'admin',
|
'created_by' => 'admin',
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
@ -67,7 +68,21 @@ class Sales extends CI_Controller
|
|||||||
redirect("inventory/sales/list");
|
redirect("inventory/sales/list");
|
||||||
break;
|
break;
|
||||||
case 'sales_register':
|
case 'sales_register':
|
||||||
$data['SalesRecords'] = $this->MSales->getSalesRecords();
|
|
||||||
|
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['SalesRecords'] = $this->MSales->getSalesRecords($data['fiscalStart'],$data['fiscalEnd']);
|
||||||
loadView("inventory/sales/register", $data);
|
loadView("inventory/sales/register", $data);
|
||||||
break;
|
break;
|
||||||
case 'details':
|
case 'details':
|
||||||
@ -114,7 +129,6 @@ class Sales extends CI_Controller
|
|||||||
$data['SalesRecords'] = $this->MSales->getSalesRecords();
|
$data['SalesRecords'] = $this->MSales->getSalesRecords();
|
||||||
loadView("inventory/sales/list", $data);
|
loadView("inventory/sales/list", $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,10 +6,18 @@ class Stocks extends CI_Controller
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->load->model('MStocks');
|
$this->load->model('MStocks');
|
||||||
checkLogin();
|
$this->load->helper('form');
|
||||||
|
// checkLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function _remap($alias = "", $params = array())
|
public function _remap($alias = "", $params = array())
|
||||||
{
|
{
|
||||||
|
// echo "<pre>"; var_dump($alias = "", $params = array()); die();
|
||||||
|
// echo "<pre>"; var_dump($alias,$this->input->post('fromDate'),$this->input->post('stocklocations_id'),$this->input->post('toDate')); die();
|
||||||
|
|
||||||
|
|
||||||
|
// var_dump(($_POST['stocklocations_id']));die();
|
||||||
$data['dataValue'] = $this->session;
|
$data['dataValue'] = $this->session;
|
||||||
$data['pageTitle'] = "Inventory Stock";
|
$data['pageTitle'] = "Inventory Stock";
|
||||||
switch ($alias) {
|
switch ($alias) {
|
||||||
@ -57,8 +65,28 @@ class Stocks extends CI_Controller
|
|||||||
loadView("inventory/stocks/add", $data);
|
loadView("inventory/stocks/add", $data);
|
||||||
break;
|
break;
|
||||||
case 'summary':
|
case 'summary':
|
||||||
$data['StockRecords'] = $this->MStocks->getStockSummary();
|
|
||||||
// pre($data['StockRecords']);
|
if (!isset($_POST['stocklocations_id'])) {
|
||||||
|
$data['stocklocations_id'] = null;
|
||||||
|
}
|
||||||
|
if (!isset($_POST['fromDate'])) {
|
||||||
|
$data['fromDate'] = null;
|
||||||
|
}
|
||||||
|
if (!isset($_POST['toDate'])) {
|
||||||
|
$data['toDate'] = null;
|
||||||
|
}
|
||||||
|
if (isset($_POST)) {
|
||||||
|
$data = $_POST;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['pageTitle'] = "Inventory Stock";
|
||||||
|
$data['fiscalStart'] = NepaliToEnglishDate($data['fromDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_from);
|
||||||
|
$data['fiscalEnd'] = NepaliToEnglishDate($data['toDate'] ?? $this->session->userdata['FiscalYear']->fiscalyear_to);
|
||||||
|
|
||||||
|
|
||||||
|
$data['StockRecords'] = $this->MStocks->getStockSummary($data);
|
||||||
|
|
||||||
|
|
||||||
loadView("inventory/stocks/summary", $data);
|
loadView("inventory/stocks/summary", $data);
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
@ -68,8 +96,24 @@ class Stocks extends CI_Controller
|
|||||||
redirect("inventory/stocks/list");
|
redirect("inventory/stocks/list");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
// var_dump("hello");
|
||||||
|
// die();
|
||||||
|
// echo '<pre>';
|
||||||
|
// var_dump($_POST['fromDate'], $_POST['toDate']);
|
||||||
|
// die();
|
||||||
$data['StockRecords'] = $this->MStocks->getStockRecords();
|
$data['StockRecords'] = $this->MStocks->getStockRecords();
|
||||||
loadView("inventory/stocks/list", $data);
|
loadView("inventory/stocks/list", $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// public function summary()
|
||||||
|
// {
|
||||||
|
// var_dump("hello");
|
||||||
|
// die();
|
||||||
|
// echo '<pre>';
|
||||||
|
// var_dump($_POST['stocklocations_id'], $_POST['fromDate'], $_POST['toDate']);
|
||||||
|
// die();
|
||||||
|
// $data['StockRecords'] = $this->MStocks->getStockSummary($_POST['stocklocations_id'] = 0, $_POST['fromDate'], $_POST['toDate']);
|
||||||
|
// // echo "<pre>", var_dump($data['StockRecords']); die();
|
||||||
|
// loadView("inventory/stocks/summary", $data);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ function generateACCategoryCode($group_id)
|
|||||||
$acgroup_code = $ci->db->where("acgroup_id=$group_id")->get("tbl_acgroups")->row()->acgroup_code;
|
$acgroup_code = $ci->db->where("acgroup_id=$group_id")->get("tbl_acgroups")->row()->acgroup_code;
|
||||||
$lastACCategoryCode = $ci->db->select_max("accategory_code")->where("acgroup_id=$group_id")->get("tbl_accategories")->row()->accategory_code;
|
$lastACCategoryCode = $ci->db->select_max("accategory_code")->where("acgroup_id=$group_id")->get("tbl_accategories")->row()->accategory_code;
|
||||||
$category_part = substr($lastACCategoryCode, 1);
|
$category_part = substr($lastACCategoryCode, 1);
|
||||||
|
|
||||||
$category_part = (float)$category_part + 1;
|
$category_part = (float)$category_part + 1;
|
||||||
//if($category_part<10)$category_part="00".$category_part;
|
//if($category_part<10)$category_part="00".$category_part;
|
||||||
if ($category_part < 10) $category_part = "00" . $category_part;
|
if ($category_part < 10) $category_part = "00" . $category_part;
|
||||||
@ -18,7 +17,6 @@ function generateAccountCode($category_id)
|
|||||||
$accategory_code = $ci->db->where("accategory_id=$category_id")->get("tbl_accategories")->row()->accategory_code;
|
$accategory_code = $ci->db->where("accategory_id=$category_id")->get("tbl_accategories")->row()->accategory_code;
|
||||||
$lastAccountCode = $ci->db->select_max("account_code")->where("accategory_id=$category_id")->get("tbl_accounts")->row()->account_code;
|
$lastAccountCode = $ci->db->select_max("account_code")->where("accategory_id=$category_id")->get("tbl_accounts")->row()->account_code;
|
||||||
$account_part = substr($lastAccountCode, 4);
|
$account_part = substr($lastAccountCode, 4);
|
||||||
|
|
||||||
$account_part = (float)$account_part + 1;
|
$account_part = (float)$account_part + 1;
|
||||||
//if($category_part<10)$category_part="00".$category_part;
|
//if($category_part<10)$category_part="00".$category_part;
|
||||||
if ($account_part < 10) $account_part = "00" . $account_part;
|
if ($account_part < 10) $account_part = "00" . $account_part;
|
||||||
@ -54,13 +52,10 @@ function showAccountCategoriesSelector($fieldName, $fieldID, $condition = "1=1",
|
|||||||
$html .= " required";
|
$html .= " required";
|
||||||
}
|
}
|
||||||
$html .= ">";
|
$html .= ">";
|
||||||
|
|
||||||
$html .= "<option value='' " . (($selectedID == '') ? "SELECTED" : "") . ">Select Account Category</option>";
|
$html .= "<option value='' " . (($selectedID == '') ? "SELECTED" : "") . ">Select Account Category</option>";
|
||||||
|
|
||||||
foreach ($AccountCategories as $AccountCategory) {
|
foreach ($AccountCategories as $AccountCategory) {
|
||||||
$html .= "<option value='$AccountCategory->accategory_id'" . (($selectedID == $AccountCategory->accategory_id) ? "selected" : "") . ">" . getFieldfromValue("tbl_acgroups", "acgroup_name", "acgroup_id", $AccountCategory->acgroup_id) . " >> $AccountCategory->accategory_name</option>";
|
$html .= "<option value='$AccountCategory->accategory_id'" . (($selectedID == $AccountCategory->accategory_id) ? "selected" : "") . ">" . getFieldfromValue("tbl_acgroups", "acgroup_name", "acgroup_id", $AccountCategory->acgroup_id) . " >> $AccountCategory->accategory_name</option>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= "</select>";
|
$html .= "</select>";
|
||||||
echo $html;
|
echo $html;
|
||||||
}
|
}
|
||||||
@ -68,7 +63,6 @@ function showAccountCategoriesByIds($AccountCategories = array())
|
|||||||
{
|
{
|
||||||
// pre($AccountCategories); //die;
|
// pre($AccountCategories); //die;
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
|
|
||||||
if ($AccountCategories) {
|
if ($AccountCategories) {
|
||||||
$AccountCategories_a = $ci->db->where("status", 1);
|
$AccountCategories_a = $ci->db->where("status", 1);
|
||||||
$AccountCategories_a = $AccountCategories_a->where_in("accategory_id", $AccountCategories);
|
$AccountCategories_a = $AccountCategories_a->where_in("accategory_id", $AccountCategories);
|
||||||
@ -80,22 +74,19 @@ function showAccountCategoriesByIds($AccountCategories = array())
|
|||||||
echo implode(", ", $html);
|
echo implode(", ", $html);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function linkVoucher($voucher_id)
|
function linkVoucher($voucher_id)
|
||||||
{
|
{
|
||||||
if($voucher_id!=0) {
|
if ($voucher_id != 0) {
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
$Voucher = $ci->db->where("voucher_id", $voucher_id)->get("tbl_vouchers")->row();
|
$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;
|
$Name = $ci->db->where("vouchertype_id", $Voucher->voucher_type)->get("tbl_vouchertypes")->row()->voucher_type . " Voucher # " . $Voucher->voucher_no;
|
||||||
echo "<a class='link' target='_blank' href='" . site_url("accounts/vouchers/show_voucher/" . $voucher_id) . "'>$Name</a>";
|
echo "<a class='open-modal' target='_blank' href='" . site_url("accounts/vouchers/show_voucher/" . $voucher_id) . "'>$Name</a>";
|
||||||
} else {
|
} else {
|
||||||
echo "";
|
echo "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function linkLedger($Account)
|
function linkLedger($Account)
|
||||||
{
|
{
|
||||||
|
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
echo "<a class='link' target='_blank' href='" . site_url("accounts/ledger/partyledger?from_date=" . FYStart() . "&to_date=" . FYEnd() . "&account_id=" . $Account->account_id . "&show_ledger=true") . "'>$Account->account_name</a>";
|
echo "<a class='link' target='_blank' href='" . site_url("accounts/ledger/partyledger?from_date=" . FYStart() . "&to_date=" . FYEnd() . "&account_id=" . $Account->account_id . "&show_ledger=true") . "'>$Account->account_name</a>";
|
||||||
}
|
}
|
||||||
@ -143,15 +134,11 @@ function generateVoucherNo($vouchertype_id = "")
|
|||||||
{
|
{
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
$voucherTypeCondition = ($vouchertype_id != "") ? " WHERE voucher_type = '$vouchertype_id'" : "";
|
$voucherTypeCondition = ($vouchertype_id != "") ? " WHERE voucher_type = '$vouchertype_id'" : "";
|
||||||
|
|
||||||
$query = $ci->db->query("SELECT MAX(voucher_no) AS voucher_no FROM tbl_vouchers" . $voucherTypeCondition);
|
$query = $ci->db->query("SELECT MAX(voucher_no) AS voucher_no FROM tbl_vouchers" . $voucherTypeCondition);
|
||||||
$row = $query->row();
|
$row = $query->row();
|
||||||
|
|
||||||
$newVoucherNo = ($row->voucher_no !== null) ? $row->voucher_no + 1 : 1;
|
$newVoucherNo = ($row->voucher_no !== null) ? $row->voucher_no + 1 : 1;
|
||||||
|
|
||||||
return $newVoucherNo;
|
return $newVoucherNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
function countChildCategories($acgroup_id)
|
function countChildCategories($acgroup_id)
|
||||||
{
|
{
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
|
@ -44,8 +44,8 @@ function createNepaliDateInput($name, $display, $id, $default = "", $class = "")
|
|||||||
<?php if ($display != "") : ?>
|
<?php if ($display != "") : ?>
|
||||||
<label for="datepicker<?php echo $id; ?>"><?php echo function_exists("myLang") ? myLang($display) : $display; ?></label>
|
<label for="datepicker<?php echo $id; ?>"><?php echo function_exists("myLang") ? myLang($display) : $display; ?></label>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="input-group" id="ass_date" data-target-input="nearest">
|
<div class="input-group ass_date" id="ass_date" data-target-input="nearest">
|
||||||
<input id="<?php echo $id; ?>" name="<?php echo $name; ?>" type="text" class="form-control nepaliDatePicker <?php echo $class; ?>" autocomplete="off" value="<?php echo ($default == "") ? NepaliDate() : $default; ?>">
|
<input id="<?php echo $id; ?>" name="<?php echo $name; ?>" type="text" class="form-control <?php echo $class; ?>" autocomplete="off" value="<?php echo ($default == "") ? NepaliDate() : $default; ?>">
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -95,14 +95,14 @@ function getFieldfromValue($tableName, $fieldName, $lookupField, $referenceValue
|
|||||||
return "N/A";
|
return "N/A";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function fillComboWithValue($fieldName, $displayName, $fieldID, $tableName, $displayField, $valueField, $default = "", $CSSclass = "", $multiple = false, $condition = "")
|
function fillComboWithValue($fieldName, $displayName, $fieldID, $tableName, $displayField, $valueField, $default = "", $CSSclass = "", $multiple = false, $condition = "", $required=false)
|
||||||
{
|
{
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
?>
|
?>
|
||||||
<?php if ($displayName != "") : ?>
|
<?php if ($displayName != "") : ?>
|
||||||
<label for="<?php echo $fieldID; ?>"><?php echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></label>
|
<label for="<?php echo $fieldID; ?>"><?php echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></label>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<select name="<?php echo $fieldName; ?><?php echo ($multiple) ? "[]" : ""; ?>" <?php if ($CSSclass != "none") : ?>class="form-control select2 <?php echo $CSSclass; ?>" <?php else : ?> class="form-control" <?php endif; ?> id="<?php echo $fieldID; ?>" <?php echo ($multiple) ? "multiple" : ""; ?>>
|
<select name="<?php echo $fieldName; ?><?php echo ($multiple) ? "[]" : ""; ?>" <?php if ($CSSclass != "none") : ?>class="form-control select2 <?php echo $CSSclass; ?>" <?php else : ?> class="form-control" <?php endif; ?> id="<?php echo $fieldID; ?>" <?php echo ($multiple) ? "multiple" : ""; ?><?php echo ($required) ? "required" : ""; ?>>
|
||||||
<option value="">Select <?php echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></option>
|
<option value="">Select <?php echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></option>
|
||||||
<?php
|
<?php
|
||||||
$q = "select * from $tableName";
|
$q = "select * from $tableName";
|
||||||
|
@ -76,7 +76,67 @@ class bibaccounts
|
|||||||
$group->cr_total += $accountBalances['cr_total'];
|
$group->cr_total += $accountBalances['cr_total'];
|
||||||
$group->regular_balance_dr += $accountBalances['regular_balance_dr'];
|
$group->regular_balance_dr += $accountBalances['regular_balance_dr'];
|
||||||
$group->regular_balance_cr += $accountBalances['regular_balance_cr'];
|
$group->regular_balance_cr += $accountBalances['regular_balance_cr'];
|
||||||
$account->balances=$accountBalances;
|
$account->balances = $accountBalances;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
$group->dr_total > 0 &&
|
||||||
|
$group->cr_total > 0 &&
|
||||||
|
$group->regular_balance_dr > 0 &&
|
||||||
|
$group->regular_balance_cr > 0 &&
|
||||||
|
$group->opening_balance_dr > 0 &&
|
||||||
|
$group->opening_balance_cr > 0
|
||||||
|
) $group->isZero = 1;
|
||||||
|
else $group->isZero = 0;
|
||||||
|
$group->opening_balance = ($group->posting_side == "DR") ? $group->opening_balance_dr - $group->opening_balance_cr : $group->opening_balance_cr - $group->opening_balance_dr;
|
||||||
|
$group->closing_balance = ($group->posting_side == "DR") ? $group->dr_total - $group->cr_total : $group->cr_total - $group->dr_total;
|
||||||
|
$group->regular_balance = ($group->posting_side == "DR") ? $group->regular_balance_dr - $group->regular_balance_cr : $group->regular_balance_cr - $group->regular_balance_dr;
|
||||||
|
|
||||||
|
$group->accounts = $accounts;
|
||||||
|
$result[] = $group;
|
||||||
|
}
|
||||||
|
// pre($result);die;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// new function
|
||||||
|
function getAccountGroupsWithBalancesNew($acgroup_id = null, $fiscalStart = null, $fiscalEnd = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
$CI = &get_instance();
|
||||||
|
$result = [];
|
||||||
|
|
||||||
|
$whereClause = "";
|
||||||
|
if ($acgroup_id !== null) {
|
||||||
|
$whereClause = "WHERE acgroup_id = '$acgroup_id' AND status=1 AND created_on >= '$fiscalStart' AND created_on >= '$fiscalEnd' ";
|
||||||
|
}
|
||||||
|
|
||||||
|
$t = "SELECT * FROM `tbl_acgroups` $whereClause";
|
||||||
|
$accountGroups = $CI->db->query($t)->result();
|
||||||
|
foreach ($accountGroups as $group) {
|
||||||
|
$t = "SELECT * FROM tbl_accounts
|
||||||
|
WHERE (accategory_id IN (SELECT accategory_id FROM tbl_accategories WHERE acgroup_id = '{$group->acgroup_id}')
|
||||||
|
OR accategory_id IN (SELECT parent_category_id FROM tbl_accategories WHERE accategory_id IN (SELECT accategory_id FROM tbl_accategories WHERE acgroup_id = '{$group->acgroup_id}')))
|
||||||
|
AND status <> -1";
|
||||||
|
|
||||||
|
$accounts = $CI->db->query($t)->result();
|
||||||
|
|
||||||
|
$group->dr_total = 0;
|
||||||
|
$group->cr_total = 0;
|
||||||
|
$group->regular_balance_dr = 0;
|
||||||
|
$group->regular_balance_cr = 0;
|
||||||
|
$group->opening_balance_dr = 0;
|
||||||
|
$group->opening_balance_cr = 0;
|
||||||
|
|
||||||
|
foreach ($accounts as $account) {
|
||||||
|
$accountBalances = $this->getAccountBalances($account->account_id);
|
||||||
|
// pre($accountBalances);die;
|
||||||
|
$group->opening_balance_dr += $accountBalances['opening_balance_dr'];
|
||||||
|
$group->opening_balance_cr += $accountBalances['opening_balance_cr'];
|
||||||
|
$group->dr_total += $accountBalances['dr_total'];
|
||||||
|
$group->cr_total += $accountBalances['cr_total'];
|
||||||
|
$group->regular_balance_dr += $accountBalances['regular_balance_dr'];
|
||||||
|
$group->regular_balance_cr += $accountBalances['regular_balance_cr'];
|
||||||
|
$account->balances = $accountBalances;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
$group->dr_total > 0 &&
|
$group->dr_total > 0 &&
|
||||||
@ -99,7 +159,9 @@ class bibaccounts
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getAccountCategoriesWithBalances($acgroup_id = null, $accategory_id=null)
|
// new function ends
|
||||||
|
|
||||||
|
function getAccountCategoriesWithBalances($acgroup_id = null, $accategory_id = null)
|
||||||
{
|
{
|
||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
$result = [];
|
$result = [];
|
||||||
@ -138,7 +200,7 @@ class bibaccounts
|
|||||||
$category->cr_total += $accountBalances['cr_total'];
|
$category->cr_total += $accountBalances['cr_total'];
|
||||||
$category->regular_balance_dr += $accountBalances['regular_balance_dr'];
|
$category->regular_balance_dr += $accountBalances['regular_balance_dr'];
|
||||||
$category->regular_balance_cr += $accountBalances['regular_balance_cr'];
|
$category->regular_balance_cr += $accountBalances['regular_balance_cr'];
|
||||||
$account->balances=$accountBalances;
|
$account->balances = $accountBalances;
|
||||||
}
|
}
|
||||||
$category->posting_side = $CI->db->query("SELECT posting_side FROM tbl_acgroups WHERE acgroup_id=(SELECT acgroup_id FROM tbl_accategories WHERE accategory_id='" . $category->accategory_id . "')")->row()->posting_side;
|
$category->posting_side = $CI->db->query("SELECT posting_side FROM tbl_acgroups WHERE acgroup_id=(SELECT acgroup_id FROM tbl_accategories WHERE accategory_id='" . $category->accategory_id . "')")->row()->posting_side;
|
||||||
|
|
||||||
@ -150,7 +212,7 @@ class bibaccounts
|
|||||||
$result[] = $category;
|
$result[] = $category;
|
||||||
}
|
}
|
||||||
// pre($category);
|
// pre($category);
|
||||||
if($accategory_id!=null)return isset($category)?$category:'';
|
if ($accategory_id != null) return isset($category) ? $category : '';
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -538,7 +600,7 @@ class bibaccounts
|
|||||||
$fiscal_year_id = ($fiscal_year_id == "") ? $this->FY : $fiscal_year_id;
|
$fiscal_year_id = ($fiscal_year_id == "") ? $this->FY : $fiscal_year_id;
|
||||||
$branch_id = ($branch_id == "") ? $this->Branch : $branch_id;
|
$branch_id = ($branch_id == "") ? $this->Branch : $branch_id;
|
||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
$query = $CI->db->query("SELECT SUM(dr) AS dr_total, SUM(cr) AS cr_total FROM tbl_voucherdetails WHERE account_id='$account_id' AND status=1 AND fiscalyear_id='$fiscal_year_id' AND branch_id='$branch_id'");
|
$query = $CI->db->query("SELECT SUM(dr) AS dr_total, SUM(cr) AS cr_total FROM tbl_voucherdetails WHERE account_id='$account_id' AND status=1 AND fiscalyear_id='$fiscal_year_id' AND branch_id='$branch_id' ");
|
||||||
$result = $query->row();
|
$result = $query->row();
|
||||||
|
|
||||||
$drTotal = $result->dr_total;
|
$drTotal = $result->dr_total;
|
||||||
@ -578,7 +640,51 @@ class bibaccounts
|
|||||||
'regular_balance_cr' => $regularBalanceCr,
|
'regular_balance_cr' => $regularBalanceCr,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
function getAccountBalancesNew($account_id, $fiscal_year_id = "", $branch_id = "",$fiscalStart = null, $fiscalEnd = null)
|
||||||
|
{
|
||||||
|
$fiscal_year_id = ($fiscal_year_id == "") ? $this->FY : $fiscal_year_id;
|
||||||
|
$branch_id = ($branch_id == "") ? $this->Branch : $branch_id;
|
||||||
|
$CI = &get_instance();
|
||||||
|
$query = $CI->db->query("SELECT SUM(dr) AS dr_total, SUM(cr) AS cr_total FROM tbl_voucherdetails WHERE account_id='$account_id' AND status=1 AND fiscalyear_id='$fiscal_year_id' AND branch_id='$branch_id' AND created_on >= '$fiscalStart' AND created_on >= '$fiscalEnd' ");
|
||||||
|
$result = $query->row();
|
||||||
|
echo "<pre>";print_r($result);die();
|
||||||
|
$drTotal = $result->dr_total;
|
||||||
|
$crTotal = $result->cr_total;
|
||||||
|
|
||||||
|
$posting_side = $CI->db->query("SELECT posting_side FROM tbl_acgroups WHERE acgroup_id=(SELECT acgroup_id FROM tbl_accategories WHERE accategory_id=(SELECT accategory_id FROM tbl_accounts WHERE account_id='$account_id'))")->row()->posting_side;
|
||||||
|
|
||||||
|
$drBalance = 0;
|
||||||
|
$crBalance = 0;
|
||||||
|
|
||||||
|
if ($posting_side == "DR") {
|
||||||
|
$drBalance = $drTotal - $crTotal;
|
||||||
|
} else {
|
||||||
|
$crBalance = $crTotal - $drTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
$openingBalanceQuery = $CI->db->query("SELECT SUM(dr) AS opening_balance_dr, SUM(cr) AS opening_balance_cr FROM tbl_voucherdetails WHERE account_id='$account_id' AND voucher_id=0 AND status=1 AND fiscalyear_id='$fiscal_year_id' AND branch_id='$branch_id'");
|
||||||
|
$openingBalanceResult = $openingBalanceQuery->row();
|
||||||
|
|
||||||
|
$openingBalanceDr = $openingBalanceResult->opening_balance_dr;
|
||||||
|
$openingBalanceCr = $openingBalanceResult->opening_balance_cr;
|
||||||
|
|
||||||
|
$regularBalanceQuery = $CI->db->query("SELECT SUM(dr) AS regular_balance_dr, SUM(cr) AS regular_balance_cr FROM tbl_voucherdetails WHERE account_id='$account_id' AND voucher_id<>0 AND status=1 AND fiscalyear_id='$fiscal_year_id' AND branch_id='$branch_id'");
|
||||||
|
$regularBalanceResult = $regularBalanceQuery->row();
|
||||||
|
|
||||||
|
$regularBalanceDr = $regularBalanceResult->regular_balance_dr;
|
||||||
|
$regularBalanceCr = $regularBalanceResult->regular_balance_cr;
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'dr_total' => $drTotal,
|
||||||
|
'cr_total' => $crTotal,
|
||||||
|
'dr_balance' => $drBalance,
|
||||||
|
'cr_balance' => $crBalance,
|
||||||
|
'opening_balance_dr' => $openingBalanceDr,
|
||||||
|
'opening_balance_cr' => $openingBalanceCr,
|
||||||
|
'regular_balance_dr' => $regularBalanceDr,
|
||||||
|
'regular_balance_cr' => $regularBalanceCr,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//////
|
//////
|
||||||
@ -586,7 +692,7 @@ class bibaccounts
|
|||||||
{
|
{
|
||||||
if (!isset($ReportOptions['AmountColWidth'])) $ReportOptions['AmountColWidth'] = 180;
|
if (!isset($ReportOptions['AmountColWidth'])) $ReportOptions['AmountColWidth'] = 180;
|
||||||
?>
|
?>
|
||||||
<table class="table table-sm table-accounts">
|
<table id='myTable'class="table table-sm table-accounts">
|
||||||
<?php if ($displayHeadings) { ?>
|
<?php if ($displayHeadings) { ?>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -608,12 +714,13 @@ class bibaccounts
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($accountCategories as $accountCategory) : ?>
|
<?php foreach ($accountCategories as $accountCategory) : ?>
|
||||||
<?php //print_r($accountCategory);die; ?>
|
<?php //print_r($accountCategory);die;
|
||||||
|
?>
|
||||||
<?php if ($ReportOptions['showZeroBalances'] && $accountCategory->isZero == true) continue; ?>
|
<?php if ($ReportOptions['showZeroBalances'] && $accountCategory->isZero == true) continue; ?>
|
||||||
<tr class="<?php echo ($accountCategory->isParent) ? ' parent-row' : ''; ?>" data-toggle="collapse" data-target="#accategory_<?php echo $accountCategory->accategory_id; ?>">
|
<tr class="<?php echo ($accountCategory->isParent) ? ' parent-row' : ''; ?>" data-toggle="collapse" data-target="#accategory_<?php echo $accountCategory->accategory_id; ?>">
|
||||||
<td class="group-name">
|
<td class="group-name">
|
||||||
<?php if($accountCategory->parent_category_id): ?>
|
<?php if ($accountCategory->parent_category_id): ?>
|
||||||
<?php echo " ". $accountCategory->accategory_name; ?>
|
<?php echo " " . $accountCategory->accategory_name; ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<b><?php echo $accountCategory->accategory_name; ?></b>
|
<b><?php echo $accountCategory->accategory_name; ?></b>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -766,17 +873,16 @@ class bibaccounts
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="group-name"> <i><?php echo $Account->account_name; ?></i></td>
|
<td class="group-name"> <i><?php echo $Account->account_name; ?></i></td>
|
||||||
<?php if ($ReportOptions['showOB']) : ?>
|
<?php if ($ReportOptions['showOB']) : ?>
|
||||||
<td class="group-total "><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->opening_balance : 0); ?></td>
|
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->opening_balance : 0); ?></td>
|
||||||
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->opening_balance : 0); ?></td>
|
<td class="group-total "><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->opening_balance : 0); ?></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($ReportOptions['showPeriod']) : ?>
|
<?php if ($ReportOptions['showPeriod']) : ?>
|
||||||
<td class="group-total"><i><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->regular_balance : 0); ?></i></td>
|
|
||||||
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->regular_balance : 0); ?><?php //pre($Account);
|
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->regular_balance : 0); ?><?php //pre($Account);
|
||||||
?></td>
|
?></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($ReportOptions['showClosing']) : ?>
|
<?php if ($ReportOptions['showClosing']) : ?>
|
||||||
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->closing_balance : 0); ?></td>
|
<td class="group-total col-2"><?php echo myCurrency(($Account->posting_side == 'DR') ? $Account->closing_balance : 0); ?></td>
|
||||||
<td class="group-total"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->closing_balance : 0); ?></td>
|
<td class="group-total col-2"><?php echo myCurrency(($Account->posting_side == 'CR') ? $Account->closing_balance : 0); ?></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -818,14 +924,14 @@ class bibaccounts
|
|||||||
/*
|
/*
|
||||||
* Retrieves the account groups and accounts with balances that has cash/bank in debit side
|
* Retrieves the account groups and accounts with balances that has cash/bank in debit side
|
||||||
*/
|
*/
|
||||||
function getIncomeAndExpenditure()
|
function getIncomeAndExpenditure($fiscalStart,$fiscalEnd)
|
||||||
{
|
{
|
||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
#2 >> Bank Accounts
|
#2 >> Bank Accounts
|
||||||
#3 >> Cash Accounts
|
#3 >> Cash Accounts
|
||||||
$Incomes = array();
|
$Incomes = array();
|
||||||
$Expenses = array();
|
$Expenses = array();
|
||||||
$t = "select * from tbl_voucherdetails where voucher_id in (select voucher_id from tbl_voucherdetails where voucher_id<>0 and account_id in (select account_id from tbl_accounts where accategory_id=2 or accategory_id=3)) and account_id not in (select account_id from tbl_accounts where accategory_id=2 or accategory_id=3)";
|
$t = "select * from tbl_voucherdetails where voucher_id in (select voucher_id from tbl_voucherdetails where voucher_id<>0 and account_id in (select account_id from tbl_accounts where accategory_id=2 or accategory_id=3)) AND created_on >= '$fiscalStart' AND created_on >= '$fiscalEnd' and account_id not in (select account_id from tbl_accounts where accategory_id=2 or accategory_id=3)";
|
||||||
$accounts = $CI->db->query($t)->result();
|
$accounts = $CI->db->query($t)->result();
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$account->details = $CI->db->query("select * from tbl_accounts where account_id=" . $account->account_id)->row();
|
$account->details = $CI->db->query("select * from tbl_accounts where account_id=" . $account->account_id)->row();
|
||||||
@ -960,9 +1066,9 @@ class bibaccounts
|
|||||||
|
|
||||||
return $sides;
|
return $sides;
|
||||||
}
|
}
|
||||||
function prepareIncomeExpenses()
|
function prepareIncomeExpenses($fiscalStart,$fiscalEnd)
|
||||||
{
|
{
|
||||||
$cashFlow = $this->getIncomeAndExpenditure();
|
$cashFlow = $this->getIncomeAndExpenditure($fiscalStart,$fiscalEnd);
|
||||||
$a = 0;
|
$a = 0;
|
||||||
foreach ($cashFlow as $side) :
|
foreach ($cashFlow as $side) :
|
||||||
$Groups = array();
|
$Groups = array();
|
||||||
|
@ -577,7 +577,7 @@ class bibaccounts
|
|||||||
//////
|
//////
|
||||||
function renderAccountCategoriesTable($accountCategories, $ReportOptions, $displayHeadings = true, $parentCategories = [])
|
function renderAccountCategoriesTable($accountCategories, $ReportOptions, $displayHeadings = true, $parentCategories = [])
|
||||||
{
|
{
|
||||||
if(!isset($ReportOptions['AmountColWidth']))$ReportOptions['AmountColWidth']=180;
|
if (!isset($ReportOptions['AmountColWidth'])) $ReportOptions['AmountColWidth'] = 180;
|
||||||
?>
|
?>
|
||||||
<table class="table table-sm">
|
<table class="table table-sm">
|
||||||
<?php if ($displayHeadings) { ?>
|
<?php if ($displayHeadings) { ?>
|
||||||
@ -659,7 +659,7 @@ class bibaccounts
|
|||||||
}
|
}
|
||||||
function renderAccountCategoriesTableForBS($accountCategories, $ReportOptions, $displayHeadings = true, $parentCategories = [])
|
function renderAccountCategoriesTableForBS($accountCategories, $ReportOptions, $displayHeadings = true, $parentCategories = [])
|
||||||
{
|
{
|
||||||
if(!isset($ReportOptions['AmountColWidth']))$ReportOptions['AmountColWidth']=180;
|
if (!isset($ReportOptions['AmountColWidth'])) $ReportOptions['AmountColWidth'] = 180;
|
||||||
?>
|
?>
|
||||||
<table class="table table-hover table-sm">
|
<table class="table table-hover table-sm">
|
||||||
|
|
||||||
@ -667,7 +667,7 @@ class bibaccounts
|
|||||||
|
|
||||||
<?php foreach ($accountCategories as $accountCategory) : ?>
|
<?php foreach ($accountCategories as $accountCategory) : ?>
|
||||||
|
|
||||||
<?php if ($ReportOptions['showZeroBalances']==false && $accountCategory->isZero == true) continue; ?>
|
<?php if ($ReportOptions['showZeroBalances'] == false && $accountCategory->isZero == true) continue; ?>
|
||||||
<tr class="<?php echo ($accountCategory->isParent) ? 'bg-darker parent-row' : ''; ?>" data-toggle="collapse" data-target="#accategory_<?php echo $accountCategory->accategory_id; ?>">
|
<tr class="<?php echo ($accountCategory->isParent) ? 'bg-darker parent-row' : ''; ?>" data-toggle="collapse" data-target="#accategory_<?php echo $accountCategory->accategory_id; ?>">
|
||||||
<td class="group-name"><?php echo $accountCategory->accategory_name; ?></td>
|
<td class="group-name"><?php echo $accountCategory->accategory_name; ?></td>
|
||||||
<?php if ($ReportOptions['showOB']) : ?>
|
<?php if ($ReportOptions['showOB']) : ?>
|
||||||
@ -725,7 +725,7 @@ class bibaccounts
|
|||||||
|
|
||||||
function renderAccountsTable($Accounts, $ReportOptions, $displayHeadings = false)
|
function renderAccountsTable($Accounts, $ReportOptions, $displayHeadings = false)
|
||||||
{
|
{
|
||||||
if(!isset($ReportOptions['AmountColWidth']))$ReportOptions['AmountColWidth']=180;
|
if (!isset($ReportOptions['AmountColWidth'])) $ReportOptions['AmountColWidth'] = 180;
|
||||||
?>
|
?>
|
||||||
<table class="table table-hover table-gray">
|
<table class="table table-hover table-gray">
|
||||||
<?php if ($displayHeadings) { ?>
|
<?php if ($displayHeadings) { ?>
|
||||||
@ -773,7 +773,7 @@ class bibaccounts
|
|||||||
}
|
}
|
||||||
function renderAccountsTableForBS($Accounts, $ReportOptions, $displayHeadings = false)
|
function renderAccountsTableForBS($Accounts, $ReportOptions, $displayHeadings = false)
|
||||||
{
|
{
|
||||||
if(!isset($ReportOptions['AmountColWidth']))$ReportOptions['AmountColWidth']=180;
|
if (!isset($ReportOptions['AmountColWidth'])) $ReportOptions['AmountColWidth'] = 180;
|
||||||
?>
|
?>
|
||||||
<table class="table table-hover table-gray">
|
<table class="table table-hover table-gray">
|
||||||
|
|
||||||
@ -801,8 +801,4 @@ class bibaccounts
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////
|
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ class myaccounts
|
|||||||
$crTotal = 0;
|
$crTotal = 0;
|
||||||
$drTotal = 0;
|
$drTotal = 0;
|
||||||
$fields = array();
|
$fields = array();
|
||||||
|
// print_r($VoucherDetails);die;
|
||||||
foreach ($VoucherDetails as $VoucherDetail) :
|
foreach ($VoucherDetails as $VoucherDetail) :
|
||||||
$i++;
|
$i++;
|
||||||
$fields['account_name_' . $i] = $VoucherDetail->account_name;
|
$fields['account_name_' . $i] = $VoucherDetail->account_name;
|
||||||
@ -90,6 +91,9 @@ class myaccounts
|
|||||||
$fields['amount_in_words'] = trim($CI->numbertoword->nepali_word($crTotal));
|
$fields['amount_in_words'] = trim($CI->numbertoword->nepali_word($crTotal));
|
||||||
else
|
else
|
||||||
$fields['amount_in_words'] = trim($CI->numbertoword->english_word($crTotal));
|
$fields['amount_in_words'] = trim($CI->numbertoword->english_word($crTotal));
|
||||||
|
|
||||||
|
// $fields['narration_' . $i] = $VoucherDetail->narration;
|
||||||
|
|
||||||
$file = APPPATH . "/../pdf/e_voucher1.pdf";
|
$file = APPPATH . "/../pdf/e_voucher1.pdf";
|
||||||
$pdf = new FPDM($file);
|
$pdf = new FPDM($file);
|
||||||
//pre($pdf->getContent($file,"PDF"));
|
//pre($pdf->getContent($file,"PDF"));
|
||||||
@ -125,7 +129,8 @@ class myaccounts
|
|||||||
{
|
{
|
||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
$Account = $CI->db->query("select * from tbl_accounts where account_id='$account_id'")->row();
|
$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"<pre>";print_r($Account); die();
|
||||||
return $Account;
|
return $Account;
|
||||||
}
|
}
|
||||||
function getBalance($account_id)
|
function getBalance($account_id)
|
||||||
@ -175,18 +180,17 @@ class myaccounts
|
|||||||
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
|
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
|
||||||
}
|
}
|
||||||
//$q=$CI->db->get_compiled_select();
|
//$q=$CI->db->get_compiled_select();
|
||||||
//print($q);
|
|
||||||
?>
|
?>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<?php if ($accategory_id == "") : ?>
|
<?php if ($accategory_id == "") : ?>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<form method="get">
|
<form method="get">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-5">
|
<div class="col-3">
|
||||||
<?php $this->showAccountsCategoriesCombo("accategory_id", "", "accategory_id"); ?>
|
<?php $this->showAccountsCategoriesCombo("accategory_id", "", "accategory_id"); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<input type="submit" value="Show Accounts" class="form-control btn btn-success">
|
<input type="submit" value="Show Accounts" class=" btn btn-success btn-sm">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -197,7 +201,7 @@ class myaccounts
|
|||||||
$html = "";
|
$html = "";
|
||||||
$html .= "<table class='table table-bordered table-striped longdataTable'>";
|
$html .= "<table class='table table-bordered table-striped longdataTable'>";
|
||||||
$html .= "<thead>";
|
$html .= "<thead>";
|
||||||
$html .= "<tr><th>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Action</th></tr>";
|
$html .= "<tr><th>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Balance</th><th class='text-center col-1'>Action</th></tr>";
|
||||||
$html .= "</thead><tbody>";
|
$html .= "</thead><tbody>";
|
||||||
$sn = 0;
|
$sn = 0;
|
||||||
$BalanceTotal = 0;
|
$BalanceTotal = 0;
|
||||||
@ -205,12 +209,12 @@ class myaccounts
|
|||||||
$balance = getBalance($Account->account_id);
|
$balance = getBalance($Account->account_id);
|
||||||
$BalanceTotal += $balance;
|
$BalanceTotal += $balance;
|
||||||
// pre($Account);
|
// pre($Account);
|
||||||
$html .= "<tr><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-2 text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
$html .= "<tr><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='text-right col-1'>" . myCurrency($balance) . "</td><td class='text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
||||||
endforeach;
|
endforeach;
|
||||||
$html .= "</tbody><tfoot>";
|
$html .= "</tbody><tfoot>";
|
||||||
if ($full==""){
|
// if ($full == "") {
|
||||||
$html .= "<tr><th colspan=2 class='text-right '>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th><th></th></tr>";
|
$html .= "<tr><th colspan=2 class='text-right '>Total</th><th class='text-right'>" . (($BalanceTotal > 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . (($BalanceTotal < 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th>" . myCurrency($BalanceTotal) . "</th><th></th></tr>";
|
||||||
}
|
// }
|
||||||
$html .= "</tfoot></table>\n";
|
$html .= "</tfoot></table>\n";
|
||||||
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
||||||
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
||||||
@ -543,7 +547,6 @@ class myaccounts
|
|||||||
<tr>
|
<tr>
|
||||||
<!-- <th class="col-1.5" rowspan="2"><?php //myLang(" Category");
|
<!-- <th class="col-1.5" rowspan="2"><?php //myLang(" Category");
|
||||||
?></th> -->
|
?></th> -->
|
||||||
|
|
||||||
<th class="col-1.5" rowspan="2"><?php myLang("Ledger"); ?></th>
|
<th class="col-1.5" rowspan="2"><?php myLang("Ledger"); ?></th>
|
||||||
<th class="col-1.5" rowspan="2"><?php myLang(" Group"); ?></th>
|
<th class="col-1.5" rowspan="2"><?php myLang(" Group"); ?></th>
|
||||||
<th colspan="2" class="col-3 text-center">Opening Balance</th>
|
<th colspan="2" class="col-3 text-center">Opening Balance</th>
|
||||||
@ -662,15 +665,13 @@ class myaccounts
|
|||||||
$data['oldBalance'] = $oldBalance;
|
$data['oldBalance'] = $oldBalance;
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
function showLedger($account_id, $fromDate = "", $toDate = "")
|
function showLedger($account_id, $fromDate = "", $toDate = "", $fiscalStart = "", $fiscalEnd = "")
|
||||||
{
|
{
|
||||||
|
|
||||||
$oldBalance = $this->getOldBalance($account_id, FYStart());
|
$oldBalance = $this->getOldBalance($account_id, FYStart());
|
||||||
$fromDate = ($fromDate == "") ? NepaliToEnglishDate(FYStart()) : $fromDate;
|
$fromDate = ($fromDate == "") ? NepaliToEnglishDate(FYStart()) : $fromDate;
|
||||||
$toDate = ($toDate == "") ? Today() : $toDate;
|
$toDate = ($toDate == "") ? Today() : $toDate;
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
$Transactions = $ci->db->where("transaction_date between '$fromDate' AND '$toDate'")->where("status", 1)->where("account_id", $account_id)->get("tbl_voucherdetails")->result();
|
$Transactions = $ci->db->where("transaction_date between '$fromDate' AND '$toDate'")->where("status", 1)->where("account_id", $account_id)->get("tbl_voucherdetails")->result();
|
||||||
|
|
||||||
$Account = $ci->db->where("status", 1)->where("account_id", $account_id)->get("tbl_accounts")->row();
|
$Account = $ci->db->where("status", 1)->where("account_id", $account_id)->get("tbl_accounts")->row();
|
||||||
foreach ($Transactions as $T) {
|
foreach ($Transactions as $T) {
|
||||||
$T->Voucher = $ci->db->where("status", 1)->where("voucher_id", $T->voucher_id)->get("tbl_vouchers")->row();
|
$T->Voucher = $ci->db->where("status", 1)->where("voucher_id", $T->voucher_id)->get("tbl_vouchers")->row();
|
||||||
@ -681,14 +682,19 @@ class myaccounts
|
|||||||
?>
|
?>
|
||||||
<div class="card-primary card-outline ">
|
<div class="card-primary card-outline ">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0">Leger for Account : <?php echo $Account->account_name; ?> <a href="<?php echo site_url("accounts/ledger/print/" . $Account->account_id . "/?" . $_SERVER['QUERY_STRING']); ?>" class="btn btn-success btn-sm float-right">Print</a></h5>
|
<h5 class="m-0">Leger for Account : <?php echo $Account->account_name; ?>
|
||||||
|
<!-- <a href="<?php echo site_url("accounts/ledger/print/" . $Account->account_id . "/?" . $_SERVER['QUERY_STRING']); ?>" class="btn btn-success btn-sm float-right">Print</a> -->
|
||||||
|
<button type="submit" id="downloadCsv1" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
|
</button>
|
||||||
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body p-0 mb-20" id="printableDiv">
|
<div class="card-body p-0 mb-20" id="printableDiv">
|
||||||
<h3 class="text-center"><?php echo $ci->session->userdata("CompanyName"); ?></h3>
|
<h3 class="text-center"><?php echo $ci->session->userdata("CompanyName"); ?></h3>
|
||||||
<h5 class="text-center">Ledger Details for <?php echo $Account->account_name; ?> </h5>
|
<h5 class="text-center">Ledger Details for <?php echo $Account->account_name; ?> </h5>
|
||||||
<?php $TableData = $Transactions; ?>
|
<?php $TableData = $Transactions; ?>
|
||||||
<?php $TotalCols = 7; ?>
|
<?php $TotalCols = 7; ?>
|
||||||
<table class="table table-bordered table-head-fixed text-nowrap table-striped ">
|
<table id='myTable1' class="table table-bordered table-head-fixed text-nowrap table-striped ">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-1"><?php myLang("Date"); ?></th>
|
<th class="col-1"><?php myLang("Date"); ?></th>
|
||||||
@ -699,6 +705,7 @@ class myaccounts
|
|||||||
<th class="col-1 text-right"><?php myLang("Debit"); ?></th>
|
<th class="col-1 text-right"><?php myLang("Debit"); ?></th>
|
||||||
<th class="col-1 text-right"><?php myLang("Credit"); ?></th>
|
<th class="col-1 text-right"><?php myLang("Credit"); ?></th>
|
||||||
<th class="col-1"><?php myLang("Balance"); ?></th>
|
<th class="col-1"><?php myLang("Balance"); ?></th>
|
||||||
|
<input type="hidden" id="refdate" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>">
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -706,12 +713,10 @@ class myaccounts
|
|||||||
$drTotal = 0;
|
$drTotal = 0;
|
||||||
$crTotal = 0;
|
$crTotal = 0;
|
||||||
$balance = 0;
|
$balance = 0;
|
||||||
|
|
||||||
foreach ($TableData as $TableRow) : $r++;
|
foreach ($TableData as $TableRow) : $r++;
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo NepaliDate(($TableRow->transaction_date)); ?></td>
|
<td><?php echo NepaliDate(($TableRow->transaction_date)); ?></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if ($TableRow->voucher_id != 0) :
|
if ($TableRow->voucher_id != 0) :
|
||||||
@ -721,9 +726,7 @@ class myaccounts
|
|||||||
echo $T->account_name;
|
echo $T->account_name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
// pre($Tr);
|
// pre($Tr);
|
||||||
else :
|
else :
|
||||||
echo "Opening Balance";
|
echo "Opening Balance";
|
||||||
@ -733,7 +736,6 @@ class myaccounts
|
|||||||
?></td> -->
|
?></td> -->
|
||||||
<td>
|
<td>
|
||||||
<?php linkVoucher($TableRow->voucher_id); ?>
|
<?php linkVoucher($TableRow->voucher_id); ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo myCurrency($TableRow->dr);
|
<td><?php echo myCurrency($TableRow->dr);
|
||||||
$drTotal += $TableRow->dr; ?></td>
|
$drTotal += $TableRow->dr; ?></td>
|
||||||
@ -766,6 +768,74 @@ class myaccounts
|
|||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="myModalLabel">Modal Title</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" id="modal-body">
|
||||||
|
<!-- Content loaded via AJAX will go here -->
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('.open-modal').click(function(e) {
|
||||||
|
e.preventDefault(); // Prevent the default link behavior
|
||||||
|
|
||||||
|
const url = $(this).attr('href'); // Get the URL from the link
|
||||||
|
$('#modal-body').load(url, function() {
|
||||||
|
$('#myModal').modal('show'); // Show the modal after loading content
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv1').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable1');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
<!-- <div class="container ">
|
<!-- <div class="container ">
|
||||||
<div class="row mt-100 ">
|
<div class="row mt-100 ">
|
||||||
<div class="col-2"><span class="underline-text"><?php echo $ci->session->userdata("loggedUser"); ?></span></div>
|
<div class="col-2"><span class="underline-text"><?php echo $ci->session->userdata("loggedUser"); ?></span></div>
|
||||||
@ -782,13 +852,30 @@ class myaccounts
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
function footerfunctions()
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
$(".ass_date").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#refdate').data('start'),
|
||||||
|
maxDate: $('#refdate').data('end'),
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
function ledgerPDF_FPDM($account_id, $fromDate, $toDate)
|
function ledgerPDF_FPDM($account_id, $fromDate, $toDate)
|
||||||
{
|
{
|
||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
$CI->load->library("numbertoword");
|
$CI->load->library("numbertoword");
|
||||||
$ledgerData = $this->getLedgerData($account_id, $fromDate, $toDate);
|
$ledgerData = $this->getLedgerData($account_id, $fromDate, $toDate);
|
||||||
$file = APPPATH . "/../pdf/e_ledger1.pdf";
|
$file = APPPATH . "/../pdf/
|
||||||
|
.pdf";
|
||||||
$pdf = new FPDM($file);
|
$pdf = new FPDM($file);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$crTotal = 0;
|
$crTotal = 0;
|
||||||
@ -931,7 +1018,7 @@ class myaccounts
|
|||||||
// $pdf->Output("F", $OutputFileLocation . $OutputFile);
|
// $pdf->Output("F", $OutputFileLocation . $OutputFile);
|
||||||
// return $OutputFile;
|
// return $OutputFile;
|
||||||
}
|
}
|
||||||
function listVouchers($fromDate = "", $toDate = "", $account_id = "", $vouchertype_id = "", $showAccounts = false, $showVoucherTypes = false)
|
function listVouchers($fromDate = "", $toDate = "", $account_id = "", $vouchertype_id = "", $showAccounts = false, $showVoucherTypes = false, $fiscalStart = "", $fiscalEnd = "")
|
||||||
{
|
{
|
||||||
// echo $toDate;
|
// echo $toDate;
|
||||||
$ci = &get_instance();
|
$ci = &get_instance();
|
||||||
@ -967,13 +1054,14 @@ class myaccounts
|
|||||||
<th width="90"><?php myLang("Dr"); ?></th>
|
<th width="90"><?php myLang("Dr"); ?></th>
|
||||||
<th width="90"><?php myLang("Cr"); ?></th>
|
<th width="90"><?php myLang("Cr"); ?></th>
|
||||||
<!--<th><?php myLang("Voucher State"); ?></th> -->
|
<!--<th><?php myLang("Voucher State"); ?></th> -->
|
||||||
<th class="table-col col-2">Action</th>
|
<th class="table-col col-1 text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $a = 0; $drTotal=0;$crTotal=0;
|
<?php $a = 0;
|
||||||
|
$drTotal = 0;
|
||||||
|
$crTotal = 0;
|
||||||
foreach ($TableData as $TableRow) : $a++; ?>
|
foreach ($TableData as $TableRow) : $a++; ?>
|
||||||
|
|
||||||
<tr data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo ($TableRow->voucher_state == "Reversed") ? "table-danger" : ""; ?>">
|
<tr data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo ($TableRow->voucher_state == "Reversed") ? "table-danger" : ""; ?>">
|
||||||
<!-- <td><?php echo $TableRow->voucher_id; ?></td> -->
|
<!-- <td><?php echo $TableRow->voucher_id; ?></td> -->
|
||||||
<td><?php echo $TableRow->voucher_no; ?></td>
|
<td><?php echo $TableRow->voucher_no; ?></td>
|
||||||
@ -982,33 +1070,37 @@ class myaccounts
|
|||||||
<?php foreach ($TableRow->Transactions as $Transaction) : ?>
|
<?php foreach ($TableRow->Transactions as $Transaction) : ?>
|
||||||
<div><?php echo (($Transaction->cr) ? " " : "") . $this->getAccountDetails($Transaction->account_id)->account_name; ?></div>
|
<div><?php echo (($Transaction->cr) ? " " : "") . $this->getAccountDetails($Transaction->account_id)->account_name; ?></div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if($TableRow->narration): ?>
|
<?php if ($TableRow->narration): ?>
|
||||||
(<span class="narration_display"><?php echo $TableRow->narration; ?></span>)
|
(<span class="narration_display"><?php echo $TableRow->narration; ?></span>)
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
<?php if ($showVoucherTypes) : ?>
|
<?php if ($showVoucherTypes) : ?>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
<?php echo $TableRow->VoucherType->voucher_name; ?>
|
<?php echo $TableRow->VoucherType->voucher_name; ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<td>
|
<td>
|
||||||
<?php foreach ($TableRow->Transactions as $Transaction) : $drTotal+=$Transaction->dr; ?>
|
<?php foreach ($TableRow->Transactions as $Transaction) : $drTotal += $Transaction->dr; ?>
|
||||||
<?php echo myCurrency($Transaction->dr); ?>
|
<?php echo myCurrency($Transaction->dr); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php foreach ($TableRow->Transactions as $Transaction) : $crTotal+=$Transaction->cr; ?>
|
<?php foreach ($TableRow->Transactions as $Transaction) : $crTotal += $Transaction->cr; ?>
|
||||||
<?php echo myCurrency($Transaction->cr); ?>
|
<?php echo myCurrency($Transaction->cr); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td><?php echo $TableRow->voucher_type; ?></td> -->
|
<!-- <td><?php echo $TableRow->voucher_type; ?></td> -->
|
||||||
<!-- <td><?php echo $TableRow->voucher_state; ?></td> -->
|
<!-- <td><?php echo $TableRow->voucher_state; ?></td> -->
|
||||||
<td class="col-1">
|
<td class="col-1 text-center">
|
||||||
<a onClick="javascript:showDetails(<?php echo $TableRow->voucher_id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
|
<a onClick="javascript:showDetails(<?php echo $TableRow->voucher_id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
|
||||||
|
<!-- <a onClick="javascript:showDetails(<?php //echo $TableRow->voucher_id;
|
||||||
|
?>);" class="btn btn-info btn-xs" title="View Details"><i class="fas fa-edit"></i></a> -->
|
||||||
<a onClick="javascript:showPDF(<?php echo $TableRow->voucher_id; ?>);" class="btn btn-primary btn-xs" title="View PDF"><i class="fa fa-file-pdf"></i></a>
|
<a onClick="javascript:showPDF(<?php echo $TableRow->voucher_id; ?>);" class="btn btn-primary btn-xs" title="View PDF"><i class="fa fa-file-pdf"></i></a>
|
||||||
|
<?php //print_r($ci->session->userdata());die;
|
||||||
|
?>
|
||||||
|
<?php if ($ci->session->userdata('LoggedUser') != 'admin'): ?>
|
||||||
<a onClick="javascript:deleteVoucher(<?php echo $TableRow->voucher_id; ?>);" class="btn btn-danger btn-xs" title="Delete Voucher"><i class="fa fa-trash"></i></a>
|
<a onClick="javascript:deleteVoucher(<?php echo $TableRow->voucher_id; ?>);" class="btn btn-danger btn-xs" title="Delete Voucher"><i class="fa fa-trash"></i></a>
|
||||||
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -1043,6 +1135,7 @@ class myaccounts
|
|||||||
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
|
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" id="refdate" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1125,6 +1218,15 @@ class myaccounts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
$(".ass_date").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#refdate').data('start'),
|
||||||
|
maxDate: $('#refdate').data('end'),
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -1217,7 +1319,7 @@ class myaccounts
|
|||||||
<td><?php echo myCurrency($drTotal); ?></td>
|
<td><?php echo myCurrency($drTotal); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="<?php echo $TotalCols; ?>" class="text-left" height=100>Narration: <?php echo $TableRow->narration; ?></td>
|
<td colspan="<?php echo $TotalCols; ?>" class="text-left" height=100><i>Narration: <?php echo $TableRow->narration; ?></i></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="<?php echo $TotalCols; ?>" class="text-center" height=200>
|
<td colspan="<?php echo $TotalCols; ?>" class="text-center" height=200>
|
||||||
@ -1303,13 +1405,8 @@ class myaccounts
|
|||||||
</option>
|
</option>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<button type="button" class="btn input-group-text addplus" data-toggle="modal" data-target="#exampleModal"><i class="fas fa-plus"></i></button>
|
<button type="button" class="btn input-group-text addplus" data-toggle="modal" data-target="#exampleModal"><i class="fas fa-plus"></i></button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
function showAccountsCategoriesCombo($fieldName, $displayName, $fieldID, $condition = "", $default = "", $CSSclass = "")
|
function showAccountsCategoriesCombo($fieldName, $displayName, $fieldID, $condition = "", $default = "", $CSSclass = "")
|
||||||
@ -1321,7 +1418,8 @@ class myaccounts
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<select name="<?php echo $fieldName; ?>" class="form-control select2 <?php echo $CSSclass; ?>" id="<?php echo $fieldID; ?>">
|
<select name="<?php echo $fieldName; ?>" class="form-control select2 <?php echo $CSSclass; ?>" id="<?php echo $fieldID; ?>">
|
||||||
<option value="">Select </option>
|
<option value="">Select </option>
|
||||||
<!-- <option value="">Select <?php //echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></option> -->
|
<!-- <option value="">Select <?php //echo function_exists("myLang") ? myLang($displayName) : $displayName;
|
||||||
|
?></option> -->
|
||||||
<?php
|
<?php
|
||||||
$q = "select *,(select acgroup_name from tbl_acgroups where tbl_accategories.acgroup_id=tbl_acgroups.acgroup_id) as acgroup_name from tbl_accategories";
|
$q = "select *,(select acgroup_name from tbl_acgroups where tbl_accategories.acgroup_id=tbl_acgroups.acgroup_id) as acgroup_name from tbl_accategories";
|
||||||
$q .= ($condition != "") ? " where $condition" : " where status=1";
|
$q .= ($condition != "") ? " where $condition" : " where status=1";
|
||||||
@ -1343,21 +1441,15 @@ class myaccounts
|
|||||||
<?php $current_acgroup = $value->acgroup_name;
|
<?php $current_acgroup = $value->acgroup_name;
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
*/
|
*/
|
||||||
foreach ($Values as $value) : ?>
|
foreach ($Values as $value) : ?>
|
||||||
|
|
||||||
|
|
||||||
<option value="<?php echo $value->accategory_id; ?>" <?php echo ($value->accategory_id == $default) ? 'SELECTED' : ''; ?>>
|
<option value="<?php echo $value->accategory_id; ?>" <?php echo ($value->accategory_id == $default) ? 'SELECTED' : ''; ?>>
|
||||||
|
|
||||||
<?php echo $value->accategory_name; ?>
|
<?php echo $value->accategory_name; ?>
|
||||||
</option>
|
</option>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
function showFixedAccountsCategoriesCombo($fieldName, $displayName, $fieldID, $condition = "", $default = "", $CSSclass = "")
|
function showFixedAccountsCategoriesCombo($fieldName, $displayName, $fieldID, $condition = "", $default = "", $CSSclass = "")
|
||||||
@ -1367,9 +1459,10 @@ class myaccounts
|
|||||||
<?php if ($displayName != "") : ?>
|
<?php if ($displayName != "") : ?>
|
||||||
<label for="<?php echo $fieldID; ?>"><?php echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></label>
|
<label for="<?php echo $fieldID; ?>"><?php echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></label>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<select name="<?php echo $fieldName; ?>" class="form-control select2 <?php echo $CSSclass; ?>" id="<?php echo $fieldID; ?>">
|
<select name="<?php echo $fieldName; ?>" class="form-control select2 <?php echo $CSSclass; ?>" id="<?php echo $fieldID; ?> " required>
|
||||||
<option value="">Select </option>
|
<option value="">Select </option>
|
||||||
<!-- <option value="">Select <?php //echo function_exists("myLang") ? myLang($displayName) : $displayName; ?></option> -->
|
<!-- <option value="">Select <?php //echo function_exists("myLang") ? myLang($displayName) : $displayName;
|
||||||
|
?></option> -->
|
||||||
<?php
|
<?php
|
||||||
$q = "select *,(select acgroup_name from tbl_acgroups where tbl_accategories.acgroup_id=tbl_acgroups.acgroup_id) as acgroup_name from tbl_accategories";
|
$q = "select *,(select acgroup_name from tbl_acgroups where tbl_accategories.acgroup_id=tbl_acgroups.acgroup_id) as acgroup_name from tbl_accategories";
|
||||||
$q .= ($condition != "") ? " where $condition" : " where status=1";
|
$q .= ($condition != "") ? " where $condition" : " where status=1";
|
||||||
@ -1392,21 +1485,15 @@ class myaccounts
|
|||||||
<?php $current_acgroup = $value->acgroup_name;
|
<?php $current_acgroup = $value->acgroup_name;
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
*/
|
*/
|
||||||
foreach ($Values as $value) : ?>
|
foreach ($Values as $value) : ?>
|
||||||
|
|
||||||
|
|
||||||
<option value="<?php echo $value->accategory_id; ?>" <?php echo ($value->accategory_id == $default) ? 'SELECTED' : ''; ?>>
|
<option value="<?php echo $value->accategory_id; ?>" <?php echo ($value->accategory_id == $default) ? 'SELECTED' : ''; ?>>
|
||||||
|
|
||||||
<?php echo $value->accategory_name; ?>
|
<?php echo $value->accategory_name; ?>
|
||||||
</option>
|
</option>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
function showAccountsCategoriesWithParentsCombo($fieldName, $displayName, $fieldID, $condition = "", $default = "", $CSSclass = "", $extras = "")
|
function showAccountsCategoriesWithParentsCombo($fieldName, $displayName, $fieldID, $condition = "", $default = "", $CSSclass = "", $extras = "")
|
||||||
@ -1549,7 +1636,6 @@ class myaccounts
|
|||||||
$ci->dbforge->add_column('tbl_vouchertypes', array('default_debits' => array('type' => 'VARCHAR', 'constraint' => 255)));
|
$ci->dbforge->add_column('tbl_vouchertypes', array('default_debits' => array('type' => 'VARCHAR', 'constraint' => 255)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hasTransaction($type, $id)
|
function hasTransaction($type, $id)
|
||||||
{
|
{
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
@ -39,9 +39,9 @@ class MPurchases extends CI_Model
|
|||||||
}
|
}
|
||||||
return $PurchaseRecords;
|
return $PurchaseRecords;
|
||||||
}
|
}
|
||||||
public function getPurchaseRecords()
|
public function getPurchaseRecords($fromDate, $toDate)
|
||||||
{
|
{
|
||||||
$PurchaseRecords = $this->db->where("status", 1)->get("tbl_purchases")->result();
|
$PurchaseRecords = $this->db->where("status", 1)->where("created_on between '$fromDate' AND '$toDate'")->get("tbl_purchases")->result();
|
||||||
foreach ($PurchaseRecords as $PurchaseRecord) {
|
foreach ($PurchaseRecords as $PurchaseRecord) {
|
||||||
$PurchaseRecord->Details = $this->getPurchaseDetails($PurchaseRecord->purchase_id);
|
$PurchaseRecord->Details = $this->getPurchaseDetails($PurchaseRecord->purchase_id);
|
||||||
$PurchaseRecord->TotalPurchase = $this->getTotalPurchaseAmount($PurchaseRecord->purchase_id);
|
$PurchaseRecord->TotalPurchase = $this->getTotalPurchaseAmount($PurchaseRecord->purchase_id);
|
||||||
|
@ -39,9 +39,9 @@ class MSales extends CI_Model
|
|||||||
}
|
}
|
||||||
return $SalesRecords;
|
return $SalesRecords;
|
||||||
}
|
}
|
||||||
public function getSalesRecords()
|
public function getSalesRecords($fromDate, $toDate)
|
||||||
{
|
{
|
||||||
$SalesRecords = $this->db->where("status", 1)->get("tbl_sales")->result();
|
$SalesRecords = $this->db->where("status", 1)->where("created_on between '$fromDate' AND '$toDate'")->get("tbl_sales")->result();
|
||||||
foreach ($SalesRecords as $SalesRecord) {
|
foreach ($SalesRecords as $SalesRecord) {
|
||||||
$SalesRecord->Details = $this->getSalesDetails($SalesRecord->sales_id);
|
$SalesRecord->Details = $this->getSalesDetails($SalesRecord->sales_id);
|
||||||
$SalesRecord->totalsales = $this->getTotalSalesAmount($SalesRecord->sales_id);
|
$SalesRecord->totalsales = $this->getTotalSalesAmount($SalesRecord->sales_id);
|
||||||
@ -57,7 +57,7 @@ class MSales extends CI_Model
|
|||||||
}
|
}
|
||||||
$this->db->group_by('items_id');
|
$this->db->group_by('items_id');
|
||||||
$query = $this->db->get();
|
$query = $this->db->get();
|
||||||
$SalesRecords=$query->result();
|
$SalesRecords = $query->result();
|
||||||
foreach ($SalesRecords as $SalesRecord) {
|
foreach ($SalesRecords as $SalesRecord) {
|
||||||
$SalesRecord->Item = $this->db->where("item_id", $SalesRecord->items_id)->get("tbl_items")->row();
|
$SalesRecord->Item = $this->db->where("item_id", $SalesRecord->items_id)->get("tbl_items")->row();
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ class MStocks extends CI_Model
|
|||||||
$nos++;
|
$nos++;
|
||||||
$rate += $Item->rate;
|
$rate += $Item->rate;
|
||||||
}
|
}
|
||||||
if($nos!=0) $rate = $rate / $nos;
|
if ($nos != 0) $rate = $rate / $nos;
|
||||||
|
|
||||||
$SalesStock = new stdClass;
|
$SalesStock = new stdClass;
|
||||||
$SalesStock->qty = $qty;
|
$SalesStock->qty = $qty;
|
||||||
@ -94,7 +94,7 @@ class MStocks extends CI_Model
|
|||||||
$nos++;
|
$nos++;
|
||||||
$rate += $Item->rate;
|
$rate += $Item->rate;
|
||||||
}
|
}
|
||||||
if($nos!=0) $rate = $rate / $nos;
|
if ($nos != 0) $rate = $rate / $nos;
|
||||||
$PurchaseStock = new stdClass;
|
$PurchaseStock = new stdClass;
|
||||||
$PurchaseStock->qty = $qty;
|
$PurchaseStock->qty = $qty;
|
||||||
$PurchaseStock->rate = $rate;
|
$PurchaseStock->rate = $rate;
|
||||||
@ -116,7 +116,7 @@ class MStocks extends CI_Model
|
|||||||
$nos++;
|
$nos++;
|
||||||
$rate += $Item->price;
|
$rate += $Item->price;
|
||||||
}
|
}
|
||||||
if($nos!=0) $rate = $rate / $nos;
|
if ($nos != 0) $rate = $rate / $nos;
|
||||||
$OpeningStock = new stdClass;
|
$OpeningStock = new stdClass;
|
||||||
$OpeningStock->qty = $qty;
|
$OpeningStock->qty = $qty;
|
||||||
$OpeningStock->rate = $rate;
|
$OpeningStock->rate = $rate;
|
||||||
@ -125,12 +125,12 @@ class MStocks extends CI_Model
|
|||||||
}
|
}
|
||||||
public function getClosingStock($item_id)
|
public function getClosingStock($item_id)
|
||||||
{
|
{
|
||||||
$OpeningStock=$this->getOpeningStock($item_id);
|
$OpeningStock = $this->getOpeningStock($item_id);
|
||||||
$PurchaseStock=$this->getItemPurchaseStock($item_id);
|
$PurchaseStock = $this->getItemPurchaseStock($item_id);
|
||||||
$SalesStock=$this->getItemSalesStock($item_id);
|
$SalesStock = $this->getItemSalesStock($item_id);
|
||||||
$ClosingStock = new stdClass;
|
$ClosingStock = new stdClass;
|
||||||
$ClosingStock->qty =$PurchaseStock->qty+$OpeningStock->qty-$SalesStock->qty;
|
$ClosingStock->qty = $PurchaseStock->qty + $OpeningStock->qty - $SalesStock->qty;
|
||||||
$ClosingStock->rate = $PurchaseStock->rate+$OpeningStock->rate-$SalesStock->rate;
|
$ClosingStock->rate = $PurchaseStock->rate + $OpeningStock->rate - $SalesStock->rate;
|
||||||
$ClosingStock->amount = $ClosingStock->qty * $ClosingStock->rate;
|
$ClosingStock->amount = $ClosingStock->qty * $ClosingStock->rate;
|
||||||
return $ClosingStock;
|
return $ClosingStock;
|
||||||
}
|
}
|
||||||
@ -151,8 +151,9 @@ class MStocks extends CI_Model
|
|||||||
$Item->Closing = $this->getClosingStock($item_id);
|
$Item->Closing = $this->getClosingStock($item_id);
|
||||||
return $Item;
|
return $Item;
|
||||||
}
|
}
|
||||||
public function getStockSummary($stocklocation_id = 0)
|
public function getStockSummary($data)
|
||||||
{
|
{
|
||||||
|
$stocklocation_id = $data['stocklocation_id'] ?? null;
|
||||||
$this->db->where("status", 1);
|
$this->db->where("status", 1);
|
||||||
if ($stocklocation_id != 0) {
|
if ($stocklocation_id != 0) {
|
||||||
$this->db->where("stocklocations_id", $stocklocation_id);
|
$this->db->where("stocklocations_id", $stocklocation_id);
|
||||||
@ -160,9 +161,19 @@ class MStocks extends CI_Model
|
|||||||
$StockRecords = $this->db->select("distinct(items_id) as items_id")->get("tbl_stocks")->result();
|
$StockRecords = $this->db->select("distinct(items_id) as items_id")->get("tbl_stocks")->result();
|
||||||
foreach ($StockRecords as $StockRecord) {
|
foreach ($StockRecords as $StockRecord) {
|
||||||
$StockRecord->Summary = $this->getStockItemSummary($StockRecord->items_id);
|
$StockRecord->Summary = $this->getStockItemSummary($StockRecord->items_id);
|
||||||
// $StockRecord->StockLocation = $this->db->where("stocklocation_id", $StockRecord->stocklocations_id)->get("tbl_stocklocations")->row();
|
$this->db->where("stocklocation_id ", $StockRecord->Summary->stocklocations_id);
|
||||||
$StockRecord->Item = $this->db->where("item_id", $StockRecord->items_id)->get("tbl_items")->row();
|
$query1 = $this->db->get("tbl_stocklocations");
|
||||||
|
$result2 = $query1->result();
|
||||||
|
$StockRecord->StockLocation = $result2;
|
||||||
|
//tbl_items
|
||||||
|
$this->db->where('created_on >=', date('Y-m-d', (strtotime($data['fiscalStart']))));
|
||||||
|
$this->db->where('created_on <=', date('Y-m-d', (strtotime($data['fiscalEnd']))));
|
||||||
|
$this->db->where('item_id', $StockRecord->items_id);
|
||||||
|
$query3 = $this->db->get('tbl_items');
|
||||||
|
$result3 = $query3->result();
|
||||||
|
$StockRecord->Item = $result3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $StockRecords;
|
return $StockRecords;
|
||||||
}
|
}
|
||||||
public function getStockRecords($stocklocation_id = 0)
|
public function getStockRecords($stocklocation_id = 0)
|
||||||
@ -215,6 +226,5 @@ class MStocks extends CI_Model
|
|||||||
$Item = $this->db->where("item_id", $id)->get("tbl_items")->row();
|
$Item = $this->db->where("item_id", $id)->get("tbl_items")->row();
|
||||||
$Unit = $this->db->where("unit_id", $Item->units_id)->get("tbl_units")->row();
|
$Unit = $this->db->where("unit_id", $Item->units_id)->get("tbl_units")->row();
|
||||||
return $Unit;
|
return $Unit;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"><?php echo isset($AccountCategory) ? 'Edit' : 'Create'; ?>
|
<h5 class="m-0 card-title"><?php echo isset($AccountCategory) ? 'Edit' : 'Create'; ?>
|
||||||
<?php echo $pageTitle; ?>
|
<?php echo $pageTitle; ?>
|
||||||
<!-- <a href="<?php //echo site_url("master/accategories/list");
|
<!-- <a href="<?php //echo site_url("master/accategories/list");
|
||||||
?>" class="btn btn-sm btn-primary float-right">List <?php //echo $pageTitle;
|
?>" class="btn btn-sm btn-primary float-right">List <?php //echo $pageTitle;
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"><?php echo $pageTitle . 's'; ?>
|
<h5 class="m-0 card-title"><?php echo $pageTitle . 's'; ?>
|
||||||
<!-- <a href="<?php //echo site_url("master/accategories/add_child");
|
<!-- <a href="<?php //echo site_url("master/accategories/add_child");
|
||||||
?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle;
|
?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle;
|
||||||
?></a> -->
|
?></a> -->
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
<table class="table table-bordered table-striped longdataTable">
|
<table class="table table-bordered table-striped longdataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-2">Type</th>
|
<th class="col-1">Type</th>
|
||||||
<th>Category Name</th>
|
<th>Category Name</th>
|
||||||
<td class="col-1">Action</th>
|
<th class="col-1 text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
break;
|
break;
|
||||||
endforeach; ?>
|
endforeach; ?>
|
||||||
<?php if ($TableRow->parent_category_id == 0) : ?>
|
<?php if ($TableRow->parent_category_id == 0) : ?>
|
||||||
<tr>
|
<tr class="text-center">
|
||||||
<td><?php echo $TableRow->AccountGroup->acgroup_name; ?></td>
|
<td><?php echo $TableRow->AccountGroup->acgroup_name; ?></td>
|
||||||
<td><?php echo $TableRow->accategory_name; ?></td>
|
<td><?php echo $TableRow->accategory_name; ?></td>
|
||||||
<td><a href="<?php echo site_url("master/accategories/edit_parents/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> </a>
|
<td><a href="<?php echo site_url("master/accategories/edit_parents/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> </a>
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<div class="col-7">
|
<div class="col-7">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<?php fillComboWithValue("accategory_id", "Under", "accategory_id", "tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id, "", false, "status=1"); ?>
|
<?php fillComboWithValue("accategory_id", "Under", "accategory_id", "tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id, "", false, "status=1", $required=true); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -80,7 +80,10 @@
|
|||||||
$category_name = getFieldfromValue("tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id);
|
$category_name = getFieldfromValue("tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id);
|
||||||
?>
|
?>
|
||||||
<div id="creditorFields" style="display: none;">
|
<div id="creditorFields" style="display: none;">
|
||||||
<!-- <?php //if ($category_name == "Sundry Creditors" || $category_name == "Sundry Debtors") : ?> -->
|
<!-- <?php //if ($category_name == "Sundry Creditors" || $category_name == "Sundry Debtors") :
|
||||||
|
?> -->
|
||||||
|
<hr>
|
||||||
|
<div class="row" style="padding-bottom: 4px;"><b>Mailing Details:</b></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -96,11 +99,11 @@
|
|||||||
<label for="account_partyaddress">Party Address</label><input type="text" class="form-control" id="account_partyaddress" value="<?php echo $TableData->account_partyaddress; ?>" name="account_partyaddress">
|
<label for="account_partyaddress">Party Address</label><input type="text" class="form-control" id="account_partyaddress" value="<?php echo $TableData->account_partyaddress; ?>" name="account_partyaddress">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="account_partypan">PAN</label><input type="text" class="form-control" id="account_partypan" value="<?php echo $TableData->account_partypan; ?>" name="account_partypan">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="row" style="padding-bottom: 4px;"><b>Contact Details:</b></div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
<!--COL END-->
|
<!--COL END-->
|
||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -110,8 +113,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!--COL END-->
|
<!--COL END-->
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -142,14 +143,89 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--COL END-->
|
<!--COL END-->
|
||||||
</div>
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="row" style="padding-bottom: 4px;"><b>Tax Information:</b></div>
|
||||||
<!-- <?php //endif; ?> -->
|
<div class="row">
|
||||||
|
<div class="col-md-6 col-lg-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partypan">PAN</label><input type="text" class="form-control" id="account_partypan" value="<?php echo $TableData->account_partypan; ?>" name="account_partypan">
|
||||||
</div>
|
</div>
|
||||||
<div class="row" id="bankFields" >
|
</div>
|
||||||
<!-- <?php //if ($category_name == "Bank Account") : ?> -->
|
|
||||||
|
|
||||||
|
<!-- <?php //endif;
|
||||||
|
?> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="bankFields">
|
||||||
|
<!-- <?php //if ($category_name == "Bank Account") :
|
||||||
|
?> -->
|
||||||
|
<hr>
|
||||||
|
<div class="row" style="padding-bottom: 4px;"><b>Mailing Details:</b></div>
|
||||||
|
<div class="row">
|
||||||
|
<!--COL START-->
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partyname">Party Name</label><input type="text" class="form-control" id="account_partyname" value="<?php echo $TableData->account_partyname; ?>" name="account_partyname">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--COL END-->
|
||||||
|
|
||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partyaddress">Party Address</label><input type="text" class="form-control" id="account_partyaddress" value="<?php echo $TableData->account_partyaddress; ?>" name="account_partyaddress">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--COL START-->
|
||||||
|
<hr>
|
||||||
|
<div class="row" style="padding-bottom: 4px;"><b>Contact Details:</b></div>
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<!--COL END-->
|
||||||
|
<!--COL START-->
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partyemail">Party Email</label><input type="email" class="form-control" id="account_partyemail" value="<?php echo $TableData->account_partyemail; ?>" name="account_partyemail">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--COL END-->
|
||||||
|
<!--COL START-->
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partycontact">Party Contact</label><input type="text" class="form-control" id="account_partycontact" value="<?php echo $TableData->account_partycontact; ?>" name="account_partycontact">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--COL END-->
|
||||||
|
<!--COL START-->
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partycontactperson">Contact Person</label><input type="text" class="form-control" id="account_partycontactperson" value="<?php echo $TableData->account_partycontactperson; ?>" name="account_partycontactperson">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--COL END-->
|
||||||
|
|
||||||
|
<!--COL START-->
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="account_partycontactpersoncontact">Contact Person Phone</label><input type="text" class="form-control" id="account_partycontactpersoncontact" value="<?php echo $TableData->account_partycontactpersoncontact; ?>" name="account_partycontactpersoncontact">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--COL END-->
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="row" style="padding-bottom: 4px;"><b>Account Details:</b></div>
|
||||||
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
|
|
||||||
@ -179,12 +255,14 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<!--COL END-->
|
<!--COL END-->
|
||||||
<!-- <?php //endif; ?> -->
|
<!-- <?php //endif;
|
||||||
|
?> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<hr>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -224,7 +302,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
function updateFields() {
|
function updateFields() {
|
||||||
var category = $('#accategory_id').val(); // Assuming the category select field has this ID
|
var category = $('#accategory_id').val(); // Assuming the category select field has this ID
|
||||||
|
|
||||||
@ -247,5 +325,5 @@ $(document).ready(function() {
|
|||||||
$('#accategory_id').change(function() {
|
$('#accategory_id').change(function() {
|
||||||
updateFields();
|
updateFields();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@ -7,7 +7,7 @@
|
|||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"><?php myLang('Create Account'); ?>
|
<h5 class="m-0 card-title"><?php myLang('Create Account'); ?>
|
||||||
<?php //echo $pageTitle;
|
<?php //echo $pageTitle;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -135,7 +135,7 @@
|
|||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
|
||||||
<h5 class="m-0">
|
<h5 class="m-0 card-title">
|
||||||
<?php echo myLang('List Accounts'); ?>
|
<?php echo myLang('List Accounts'); ?>
|
||||||
<?php //myLang($pageTitle);
|
<?php //myLang($pageTitle);
|
||||||
?>
|
?>
|
||||||
@ -164,10 +164,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
|
|
||||||
<th class="col-1.5" rowspan="2"><?php myLang("Ledger"); ?></th>
|
<th class="col-1.5 vm" rowspan="2"><?php myLang("Ledger"); ?></th>
|
||||||
<th class="col-1.5" rowspan="2"><?php myLang(" Group"); ?></th>
|
<th class="col-1.5 vm" rowspan="2"><?php myLang(" Group"); ?></th>
|
||||||
<th colspan="2" class="col-3 text-center">Opening Balance</th>
|
<th colspan="2" class="col-3 text-center">Opening Balance</th>
|
||||||
<th class="col-2 text-center" rowspan="2"><?php myLang("Action"); ?></th>
|
<th class="col-1 text-center" rowspan="2"><?php myLang("Action"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
|
@ -3,19 +3,16 @@ $drWidth = 250;
|
|||||||
$crWidth = 250;
|
$crWidth = 250;
|
||||||
$AccountCategories = $this->acc->getAccountCategories($acgroup_id);
|
$AccountCategories = $this->acc->getAccountCategories($acgroup_id);
|
||||||
$array = json_decode(json_encode($AccountCategories), true);
|
$array = json_decode(json_encode($AccountCategories), true);
|
||||||
$tree=buildCategoryTree($array, false);
|
$tree = buildCategoryTree($array, false);
|
||||||
function buildCategoryTree($categories, $parent_id = 0, $showZero = true)
|
function buildCategoryTree($categories, $parent_id = 0, $showZero = true)
|
||||||
{
|
{
|
||||||
$tree = array();
|
$tree = array();
|
||||||
|
|
||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
if ($category['parent_category_id'] == $parent_id) {
|
if ($category['parent_category_id'] == $parent_id) {
|
||||||
$children = buildCategoryTree($categories, $category['accategory_id'], $showZero);
|
$children = buildCategoryTree($categories, $category['accategory_id'], $showZero);
|
||||||
|
|
||||||
if (!empty($children)) {
|
if (!empty($children)) {
|
||||||
$category['children'] = $children;
|
$category['children'] = $children;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($showZero && ($category['dr'] !== 0 || $category['cr'] !== 0)) {
|
if ($showZero && ($category['dr'] !== 0 || $category['cr'] !== 0)) {
|
||||||
$tree[] = $category;
|
$tree[] = $category;
|
||||||
} elseif (!$showZero && ($category['dr'] !== 0 && $category['cr'] !== 0)) {
|
} elseif (!$showZero && ($category['dr'] !== 0 && $category['cr'] !== 0)) {
|
||||||
@ -23,24 +20,29 @@ function buildCategoryTree($categories, $parent_id = 0, $showZero = true)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tree;
|
return $tree;
|
||||||
}
|
}
|
||||||
|
function displayCategoryTree($tree)
|
||||||
function displayCategoryTree($tree) {
|
{
|
||||||
echo '<table class="table table-bordered">';
|
echo '<table class="table table-bordered">';
|
||||||
|
|
||||||
foreach ($tree as $category) {
|
foreach ($tree as $category) {
|
||||||
|
// print_r($category);die;
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td class="col-1">' . $category['accategory_id'] . '</td>';
|
echo '<td class="col-1">' . $category['accategory_id'] . '</td>';
|
||||||
echo '<td><a href="'.site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] .'">' . $category['accategory_name'] . '</a></td>';
|
echo '<td class="col-6">'
|
||||||
echo '<td width="250">' . myCurrency($category['dr']) . '</td>';
|
. ($category['parent_category_id'] == 0
|
||||||
echo '<td>' . myCurrency($category['cr']) . '</td>';
|
? "<b><a href='" . site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] . "'>"
|
||||||
|
: "<a href='" . site_url("accounts/reports/balance_by_ledger") . "?group=" . $category['accategory_id'] . "'>")
|
||||||
|
. $category['accategory_name']
|
||||||
|
. "</a>"
|
||||||
|
. ($category['parent_category_id'] == 0 ? "</b>" : "")
|
||||||
|
. '</td>';
|
||||||
|
echo '<td class="col-2">' . myCurrency($category['dr']) . '</td>';
|
||||||
|
echo '<td class="col-2">' . myCurrency($category['cr']) . '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
if (isset($category['children']) && !empty($category['children'])) {
|
if (isset($category['children']) && !empty($category['children'])) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td colspan="4">';
|
echo '<td colspan="4 ">';
|
||||||
displayCategoryTree($category['children']);
|
displayCategoryTree($category['children']);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
@ -55,10 +57,10 @@ function displayCategoryTree($tree) {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<?php //pre($tree); ?>
|
<?php //pre($tree);
|
||||||
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
@ -77,8 +79,6 @@ function displayCategoryTree($tree) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<script>
|
<script>
|
||||||
function toggleSubTable(row) {
|
function toggleSubTable(row) {
|
||||||
@ -86,9 +86,5 @@ function displayCategoryTree($tree) {
|
|||||||
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
|
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$drWidth = 250;
|
$drWidth = 250;
|
||||||
$crWidth = 250;
|
$crWidth = 250;
|
||||||
|
$balanceWidth = 250;
|
||||||
|
|
||||||
$AccountCategories = $this->myaccounts->getChildAccountCategories();
|
$AccountCategories = $this->myaccounts->getChildAccountCategories();
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
@ -10,7 +12,6 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
|
|||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
@ -27,16 +28,21 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
|
|||||||
<th>Account</th>
|
<th>Account</th>
|
||||||
<th width="<?php echo $drWidth; ?>">Dr</th>
|
<th width="<?php echo $drWidth; ?>">Dr</th>
|
||||||
<th width="<?php echo $crWidth; ?>">Cr</th>
|
<th width="<?php echo $crWidth; ?>">Cr</th>
|
||||||
|
<th class="col-1 text-center">Balance</th>
|
||||||
|
<th class="col-1 text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$drTotal = 0;
|
$drTotal = 0;
|
||||||
$crTotal = 0;
|
$crTotal = 0;
|
||||||
|
$balanceTotal = 0;
|
||||||
foreach ($AccountCategories as $AccountCategory) :
|
foreach ($AccountCategories as $AccountCategory) :
|
||||||
$drTotal += $AccountCategory->dr;
|
$drTotal += $AccountCategory->dr;
|
||||||
$crTotal += $AccountCategory->cr;
|
$crTotal += $AccountCategory->cr;
|
||||||
|
$balanceTotal += $AccountCategory->Balance
|
||||||
?>
|
?>
|
||||||
|
<!-- <?php //print_r($AccountCategory);die; ?> -->
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>">
|
<a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>">
|
||||||
@ -44,7 +50,9 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountCategory->dr); ?></td>
|
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountCategory->dr); ?></td>
|
||||||
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($AccountCategory->cr); ?></td>
|
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency(abs($AccountCategory->cr)); ?></td>
|
||||||
|
<td class="text-right"><?php echo myCurrency($AccountCategory->Balance); ?></td>
|
||||||
|
<td class="text-center"><a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>" class="btn btn-info btn-xs"><i class="fas fa-eye"></i> </a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -52,20 +60,18 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Total</th>
|
<th>Total</th>
|
||||||
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></td>
|
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></td>
|
||||||
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($crTotal); ?></td>
|
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency(abs($crTotal)); ?></td>
|
||||||
|
<td class="text-right"><?php echo myCurrency($balanceTotal); ?></td>
|
||||||
|
<td ></td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<script>
|
<script>
|
||||||
function toggleSubTable(row) {
|
function toggleSubTable(row) {
|
||||||
@ -73,5 +79,4 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
|
|||||||
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
|
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
@ -0,0 +1,168 @@
|
|||||||
|
<?php
|
||||||
|
$drWidth = 250;
|
||||||
|
$crWidth = 250;
|
||||||
|
$Accounts = $this->acc->getAccountsByCategory($accategory_id);
|
||||||
|
$array = json_decode(json_encode($Accounts), true);
|
||||||
|
// print_r($array);die;
|
||||||
|
$tree = buildCategoryTree($array, false);
|
||||||
|
function buildCategoryTree($categories, $parent_id = 0, $showZero = true)
|
||||||
|
{
|
||||||
|
$tree = array();
|
||||||
|
foreach ($categories as $category) {
|
||||||
|
// print_r($category);die;
|
||||||
|
// print_r(myCurrency(getBalance($category['account_id'])));die;
|
||||||
|
$category['dr'] = getDrTotal('account_id');
|
||||||
|
$category['cr'] = getCrTotal('account_id');
|
||||||
|
if ($showZero && ($category['dr'] !== 0 || $category['cr'] !== 0)) {
|
||||||
|
$tree[] = $category;
|
||||||
|
} elseif (!$showZero && ($category['dr'] !== 0 && $category['cr'] !== 0)) {
|
||||||
|
$tree[] = $category;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $tree;
|
||||||
|
}
|
||||||
|
function displayCategoryTree($tree)
|
||||||
|
{
|
||||||
|
echo '<table id="myTable" class="table table-bordered">';
|
||||||
|
echo '<thead>';
|
||||||
|
echo '<tr>';
|
||||||
|
echo '<th>Sn</th>';
|
||||||
|
echo '<th>Account</th>';
|
||||||
|
echo '<th class="text-right">Balance</th>';
|
||||||
|
echo '</tr>';
|
||||||
|
echo '</thead>';
|
||||||
|
echo '<tbody>';
|
||||||
|
$BalanceTotal = 0;
|
||||||
|
foreach ($tree as $category) {
|
||||||
|
echo '<tr>';
|
||||||
|
echo '<td class="col-1">' . $category['account_id'] . '</td>';
|
||||||
|
echo '<td class="col-9"><a href="#" onClick="showLedger(' . $category['account_id'] . ')">' . $category['account_name'] . '</a></td>';
|
||||||
|
echo '<td class="col-2">' . myCurrency(getBalance($category['account_id'])) . '</td>';
|
||||||
|
$BalanceTotal += getBalance($category['account_id']);
|
||||||
|
echo '</tr>';
|
||||||
|
if (isset($category['children']) && !empty($category['children'])) {
|
||||||
|
echo '<tr>';
|
||||||
|
echo '<td colspan="4 ">';
|
||||||
|
displayCategoryTree($category['children']);
|
||||||
|
echo '</td>';
|
||||||
|
echo '</tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo '</tbody>';
|
||||||
|
echo '<tfoot>';
|
||||||
|
echo "<tr><th colspan=2 class='text-right'>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th></tr>";
|
||||||
|
echo '</table>';
|
||||||
|
}
|
||||||
|
$html = "";
|
||||||
|
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
||||||
|
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
||||||
|
<div class=\"modal-content\">
|
||||||
|
<div class=\"modal-header\">
|
||||||
|
<h5 class=\"modal-title\" id=\"exampleModalLabel\">Ledger Details</h5>
|
||||||
|
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
|
||||||
|
<span aria-hidden=\"true\">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class=\"modal-body\" id=\"details_container\">
|
||||||
|
Ledger Details Goes Here
|
||||||
|
</div>
|
||||||
|
<!--<div class=\"modal-footer\">
|
||||||
|
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>
|
||||||
|
<button type=\"button\" class=\"btn btn-success\" data-dismiss=\"modal\">Print</button>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>";
|
||||||
|
$html .= '<script>function showLedger(id) {$.ajax({url: \'';
|
||||||
|
$html .= site_url("accounts/reports/ajax/getledgersummary/");
|
||||||
|
$html .= '\' + id,success: function(data) {$(\'#ledgerdetails_box #details_container\').html(data);$(\'#ledgerdetails_box\').modal(\'show\');}});}</script>';
|
||||||
|
echo $html;
|
||||||
|
?>
|
||||||
|
<style>
|
||||||
|
.expandable {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<?php //pre($tree);
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="card card-primary card-outline">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<input type="checkbox" name="showZero" value="true" id="showZero">
|
||||||
|
<label for="showZero">
|
||||||
|
Show Zero Balances
|
||||||
|
</label>
|
||||||
|
<?php displayCategoryTree($tree); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<script>
|
||||||
|
function toggleSubTable(row) {
|
||||||
|
var subTable = row.nextElementSibling;
|
||||||
|
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
|
||||||
|
}
|
||||||
|
function showLedger(id) {
|
||||||
|
// $("#accountsContainer").html("");
|
||||||
|
// alert(id);
|
||||||
|
$.ajax({
|
||||||
|
url: "<?php echo site_url("accounts/reports/ajax/getledgersummary/"); ?>" + id, //accounts/getledgersummary/
|
||||||
|
success: function(data) {
|
||||||
|
$("#ledgerdetails_box #details_container").html(data);
|
||||||
|
$("#ledgerdetails_box").modal("show");
|
||||||
|
$('.dataTable').DataTable().clear().destroy();
|
||||||
|
$(".dataTable").dataTable();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
|
</div>
|
||||||
|
<!-- /.content -->
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$t="INSERT INTO tbl_acgroups (acgroup_id, acgroup_code, acgroup_name, posting_side, created_on, created_by, remarks, status, display_order)
|
$t = "INSERT INTO tbl_acgroups (acgroup_id, acgroup_code, acgroup_name, posting_side, created_on, created_by, remarks, status, display_order)
|
||||||
SELECT 5, '5', 'Equity', 'CR', '2023-05-22', 'admin', '', 1, 2
|
SELECT 5, '5', 'Equity', 'CR', '2023-05-22', 'admin', '', 1, 2
|
||||||
WHERE NOT EXISTS (
|
WHERE NOT EXISTS (
|
||||||
SELECT 1 FROM tbl_acgroups WHERE acgroup_id = 5
|
SELECT 1 FROM tbl_acgroups WHERE acgroup_id = 5
|
||||||
@ -12,16 +12,14 @@ $AssetsAccounts = $this->acc->getAccountsByGroup(1);
|
|||||||
$LiabilitiesTotal = $this->acc->getAccountBalanceByGroup(2);
|
$LiabilitiesTotal = $this->acc->getAccountBalanceByGroup(2);
|
||||||
$EquityTotal = $this->acc->getAccountBalanceByGroup(5);
|
$EquityTotal = $this->acc->getAccountBalanceByGroup(5);
|
||||||
$AssetsTotal = $this->acc->getAccountBalanceByGroup(1, false);
|
$AssetsTotal = $this->acc->getAccountBalanceByGroup(1, false);
|
||||||
|
|
||||||
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
|
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
|
||||||
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
|
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
|
||||||
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
||||||
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
||||||
$PL = $IncomesTotal - $ExpensesTotal;
|
$PL = $IncomesTotal - $ExpensesTotal;
|
||||||
$LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL;
|
$LiabilitiesTotal = $LiabilitiesTotal + $EquityTotal + $PL;
|
||||||
?>
|
?>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -39,13 +37,11 @@ $LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL;
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="bg-dark">
|
<tr class="bg-dark">
|
||||||
|
|
||||||
<th>Liabilities</th>
|
<th>Liabilities</th>
|
||||||
<th class="col-2">Amount</th>
|
<th class="col-2">Amount</th>
|
||||||
<th>Assets</th>
|
<th>Assets</th>
|
||||||
<th class="col-2">Amount</th>
|
<th class="col-2">Amount</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr class="bg-light">
|
<tr class="bg-light">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<?php $this->acc->showTable($LiabilitiesAccounts); ?>
|
<?php $this->acc->showTable($LiabilitiesAccounts); ?>
|
||||||
@ -54,33 +50,22 @@ $LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL;
|
|||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<?php $this->acc->showTable($AssetsAccounts, false); ?>
|
<?php $this->acc->showTable($AssetsAccounts, false); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<tr class="bg-light">
|
<tr class="bg-light">
|
||||||
|
|
||||||
<th>Net Profit:</th>
|
<th>Net Profit:</th>
|
||||||
<th><?php echo myCurrency($PL); ?></th>
|
<th><?php echo myCurrency($PL); ?></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="bg-light">
|
<tr class="bg-light">
|
||||||
|
|
||||||
<th>Total Liabilities:</th>
|
<th>Total Liabilities:</th>
|
||||||
<th><?php echo myCurrency($LiabilitiesTotal); ?></th>
|
<th><?php echo myCurrency($LiabilitiesTotal); ?></th>
|
||||||
<th>Total Assets: </th>
|
<th>Total Assets: </th>
|
||||||
<th><?php echo myCurrency($AssetsTotal); ?></th>
|
<th><?php echo myCurrency($AssetsTotal); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,7 +12,6 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
|
|
||||||
.group-name {
|
.group-name {
|
||||||
width: 40%;
|
width: 40%;
|
||||||
font-weight: 600px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-total {
|
.group-total {
|
||||||
@ -84,6 +83,31 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
box-shadow: inset 0 0 0 transparent;
|
box-shadow: inset 0 0 0 transparent;
|
||||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table1 {
|
||||||
|
border: 0px !important;
|
||||||
|
padding: 0;
|
||||||
|
margin: 10 !important;
|
||||||
|
width: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-responsive {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
-webkit-flex: 1 1 auto;
|
||||||
|
-ms-flex: 1 1 auto;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<section class="content">
|
<section class="content">
|
||||||
@ -92,7 +116,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action=<?php echo base_url('accounts/reports/balance_sheet'); ?> id="FilterForm">
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
@ -103,56 +127,50 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<label class="form-check-label">Select
|
|
||||||
All</label>
|
|
||||||
</div>
|
|
||||||
<div class="form-check">
|
|
||||||
<input type="hidden" name="showOB" value="not">
|
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
Export
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
|
||||||
<a href="#" class="dropdown-item">Pdf</a>
|
|
||||||
<div class="dropdown-divider"></div>
|
|
||||||
<a href="#" class="dropdown-item">View calendar</a>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
@ -166,58 +184,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
</div>
|
</div>
|
||||||
<!-- /.card-tools -->
|
<!-- /.card-tools -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="card-body">
|
|
||||||
<form method="post" action="" id="FilterForm">
|
|
||||||
<div class="row align-items-end">
|
|
||||||
<div class="col-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-2">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-1 text-center">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="showOB"><?php myLang("Opening"); ?></label>
|
|
||||||
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "" : "CHECKED"; ?>>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-1 text-center">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="showClosing"><?php myLang("Closing"); ?></label>
|
|
||||||
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "" : "CHECKED"; ?>>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-1 text-center">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="showPeriod"><?php myLang("Period"); ?></label>
|
|
||||||
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<div class="form-group d-flex justify-content-end">
|
|
||||||
<button type="submit" class="btn btn-primary mr-2">Filter</button>
|
|
||||||
<button type="submit" class="btn btn-success mr-2">Export</button>
|
|
||||||
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<script>
|
|
||||||
function resetForm() {
|
|
||||||
document.getElementById("fromDate").value = "2078-4-1";
|
|
||||||
document.getElementById("toDate").value = "2079-3-32";
|
|
||||||
document.getElementById("showOB").checked = false;
|
|
||||||
document.getElementById("showClosing").checked = false;
|
|
||||||
document.getElementById("FilterForm").submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.container-fluid -->
|
</div><!-- /.container-fluid -->
|
||||||
</section>
|
</section>
|
||||||
@ -226,10 +193,11 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button> -->
|
<!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle
|
|
||||||
Collapse</button>
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-body p-0">
|
<div class="card-body pl-2 ">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
<?php
|
<?php
|
||||||
// echo $_POST['showClosing'];
|
// echo $_POST['showClosing'];
|
||||||
$ReportOptions = array(
|
$ReportOptions = array(
|
||||||
@ -239,21 +207,21 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
'showPeriod' => false,
|
'showPeriod' => false,
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
<table class="table table-bordered">
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalancesNew(2, $fiscalStart, $fiscalEnd); ?>
|
||||||
|
<?php $Side1Total = 0; ?>
|
||||||
|
<div class="col-6 p-0 m-0 gy-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id='myTable' class="table mb-0 pb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="group-name"><b>Particulars</b></td>
|
<th class="group-name pl-1">Particulars</th>
|
||||||
<td class="group-total text-right pr-2 "><b>Amount</b></td>
|
<th class="group-total text-center col-1">Amount</th>
|
||||||
<td class="group-name"><b>Particulars</b></td>
|
|
||||||
<td class="group-total text-right pr-2"><b>Amount</b></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
|
||||||
<td colspan="2" class="p-0">
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalancesNew(2, $fiscalStart, $fiscalEnd); ?>
|
||||||
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
|
|
||||||
<?php $Side1Total = 0; ?>
|
<?php $Side1Total = 0; ?>
|
||||||
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
|
||||||
<?php
|
<?php
|
||||||
// Initialize variables for column totals
|
// Initialize variables for column totals
|
||||||
$incomes_totalOpeningDr = 0;
|
$incomes_totalOpeningDr = 0;
|
||||||
@ -270,7 +238,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="group-details p-0">
|
<td colspan="7" class="group-details p-0">
|
||||||
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -281,9 +249,8 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$Side1Total += $group->closing_balance;
|
$Side1Total += $group->closing_balance;
|
||||||
?>
|
?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalancesNew(5, $fiscalStart, $fiscalEnd); ?>
|
||||||
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
|
|
||||||
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
|
||||||
<?php
|
<?php
|
||||||
// Initialize variables for column totals
|
// Initialize variables for column totals
|
||||||
$incomes_totalOpeningDr = 0;
|
$incomes_totalOpeningDr = 0;
|
||||||
@ -295,12 +262,12 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
?>
|
?>
|
||||||
<?php foreach ($AccountGroups as $group) : ?>
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
|
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
|
||||||
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
|
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="group-details p-0">
|
<td colspan="7" class="group-details p-0">
|
||||||
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -311,11 +278,25 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$Side1Total += $group->closing_balance;
|
$Side1Total += $group->closing_balance;
|
||||||
?>
|
?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
<td colspan="2" class="p-0">
|
</div>
|
||||||
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?>
|
<div class="col-6 p-0 m-0">
|
||||||
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
<div class="table-responsive">
|
||||||
|
<table class="table mt-0 pt-0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="group-name pl-1">Particulars</th>
|
||||||
|
<th class="group-total text-center col-1">Amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalancesNew(1, $fiscalStart, $fiscalEnd); ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Initialize variables for column totals
|
// Initialize variables for column totals
|
||||||
$totalOpeningDr = 0;
|
$totalOpeningDr = 0;
|
||||||
@ -327,12 +308,12 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
?>
|
?>
|
||||||
<?php foreach ($AccountGroups as $group) : ?>
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
|
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
|
||||||
<td class="group-total"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
|
<td class="group-total text-right "><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="group-details p-0">
|
<td colspan="7" class="group-details p-0">
|
||||||
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -348,33 +329,85 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
||||||
?>
|
?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
|
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
|
||||||
$TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
|
$TotalIncomes = ($BIBAccounts->getAccountGroupsWithBalancesNew(3, $fiscalStart, $fiscalEnd)[0]->closing_balance) ?? 0;
|
||||||
$TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
|
$TotalExpenses = ($BIBAccounts->getAccountGroupsWithBalancesNew(4, $fiscalStart, $fiscalEnd)[0]->closing_balance) ?? 0;
|
||||||
$PL = $TotalIncomes - $TotalExpenses;
|
$PL = $TotalIncomes - $TotalExpenses;
|
||||||
$Side1Total += $PL;
|
$Side1Total += $PL;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<div class="col-6 p-0 m-0 gy-0">
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<td><b> Profit/Loss</b></td>
|
||||||
|
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="p-0">
|
<td colspan="2" class="p-0">
|
||||||
<table class="table table-bordered">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Total Profit/Loss</td>
|
<th class="pl-1">Total Amount</th>
|
||||||
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
|
<th class="cr closing-cr">
|
||||||
|
<?php echo myCurrency($Side1Total); ?>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="2" class="p-0">
|
</tr>
|
||||||
</td>
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6 p-0 m-0 gy-0">
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<th> </th>
|
||||||
|
<th> </th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="p-0">
|
<td colspan="2" class="p-0">
|
||||||
<table class="table table-bordered">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total Amount</th>
|
<th class="pl-1">Total Amount</th>
|
||||||
|
<th class="dr closing-dr">
|
||||||
|
<?php echo myCurrency($totalClosingDr); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="col-12 p-0">
|
||||||
|
<table class="table">
|
||||||
|
<?php
|
||||||
|
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
|
||||||
|
// $TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
|
||||||
|
// $TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
|
||||||
|
// $PL = $TotalIncomes - $TotalExpenses;
|
||||||
|
// $Side1Total += $PL;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td>Total Profit/Loss</td>
|
||||||
|
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<th class="pl-1">Total Amount</th>
|
||||||
<th class="cr closing-cr">
|
<th class="cr closing-cr">
|
||||||
<?php echo myCurrency($Side1Total); ?>
|
<?php echo myCurrency($Side1Total); ?>
|
||||||
</th>
|
</th>
|
||||||
@ -382,9 +415,9 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="2" class="p-0">
|
<td colspan="2" class="p-0">
|
||||||
<table class="table table-bordered">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total Amount</th>
|
<th class="pl-1">Total Amount</th>
|
||||||
<th class="dr closing-dr">
|
<th class="dr closing-dr">
|
||||||
<?php echo myCurrency($totalClosingDr); ?>
|
<?php echo myCurrency($totalClosingDr); ?>
|
||||||
</th>
|
</th>
|
||||||
@ -393,19 +426,31 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?php //pre($BIBAccounts->getAccountGroupsWithBalances($acgroup_id = null));
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
function footerfunctions()
|
||||||
|
{
|
||||||
?>
|
?>
|
||||||
</div>
|
<script>
|
||||||
</div>
|
$(document).ready(function() {
|
||||||
</div>
|
// Prevent the dropdown from closing when clicking inside
|
||||||
</div>
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
</div>
|
event.stopPropagation();
|
||||||
</div>
|
});
|
||||||
</div>
|
});
|
||||||
<?php
|
</script>
|
||||||
function footerfunctions()
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
document.getElementById("toggleShowAll").click();
|
document.getElementById("toggleShowAll").click();
|
||||||
@ -471,5 +516,42 @@ function footerfunctions()
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<!-- pdf document -->
|
||||||
}
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
405
account/application/views/accounts/balancesheet_newbackup.php
Normal file
405
account/application/views/accounts/balancesheet_newbackup.php
Normal file
@ -0,0 +1,405 @@
|
|||||||
|
<?php
|
||||||
|
$this->load->library("BIBAccounts");
|
||||||
|
$BIBAccounts = new BIBAccounts();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<section class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card card-primary card-outline">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
||||||
|
<div class="card-tools">
|
||||||
|
<form method="post" action="" id="FilterForm">
|
||||||
|
<!-- button with a dropdown -->
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
|
Filters
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu" role="menu">
|
||||||
|
<div class="form-group p-2 pb-0">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<!-- <div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox">
|
||||||
|
<label class="form-check-label">Select
|
||||||
|
All</label>
|
||||||
|
</div> -->
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button>
|
||||||
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle
|
||||||
|
Collapse</button> -->
|
||||||
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a href="#" class="dropdown-item">View calendar</a>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
function resetForm() {
|
||||||
|
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
|
||||||
|
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
|
||||||
|
document.getElementById("showOB").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("FilterForm").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
<!-- /.card-tools -->
|
||||||
|
</div>
|
||||||
|
<!-- <div class="card-body">
|
||||||
|
<form method="post" action="" id="FilterForm">
|
||||||
|
<div class="row align-items-end">
|
||||||
|
<div class="col-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDate"><?php //myLang("Starting Period"); ?></label>
|
||||||
|
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php //echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDate"><?php //myLang("Ending Period"); ?></label>
|
||||||
|
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php //echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-1 text-center">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="showOB"><?php// myLang("Opening"); ?></label>
|
||||||
|
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "" : "CHECKED"; ?>>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-1 text-center">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="showClosing"><?php //myLang("Closing"); ?></label>
|
||||||
|
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "" : "CHECKED"; ?>>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-1 text-center">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="showPeriod"><?php //myLang("Period"); ?></label>
|
||||||
|
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group d-flex justify-content-end">
|
||||||
|
<button type="submit" class="btn btn-primary mr-2">Filter</button>
|
||||||
|
<button type="submit" class="btn btn-success mr-2">Export</button>
|
||||||
|
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
function resetForm() {
|
||||||
|
document.getElementById("fromDate").value = "2078-4-1";
|
||||||
|
document.getElementById("toDate").value = "2079-3-32";
|
||||||
|
document.getElementById("showOB").checked = false;
|
||||||
|
document.getElementById("showClosing").checked = false;
|
||||||
|
document.getElementById("FilterForm").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</div><!-- /.container-fluid -->
|
||||||
|
</section>
|
||||||
|
<div class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
|
||||||
|
<div class="card card-primary card-outline">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<?php
|
||||||
|
// echo $_POST['showClosing'];
|
||||||
|
$ReportOptions = array(
|
||||||
|
'showZeroBalances' => false,
|
||||||
|
'showOB' => false,
|
||||||
|
'showClosing' => true,
|
||||||
|
'showPeriod' => false,
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td class="group-name "><b>Liabilities</b></td>
|
||||||
|
<td class="group-total text-right pr-2 "><b>Amount</b></td>
|
||||||
|
<td class="group-name"><b>Assets</b></td>
|
||||||
|
<td class="group-total text-right pr-2"><b>Amount</b></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
|
||||||
|
<?php $Side1Total = 0; ?>
|
||||||
|
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
||||||
|
<?php
|
||||||
|
// Initialize variables for column totals
|
||||||
|
$incomes_totalOpeningDr = 0;
|
||||||
|
$incomes_totalOpeningCr = 0;
|
||||||
|
$incomes_totalThisYearDr = 0;
|
||||||
|
$incomes_totalThisYearCr = 0;
|
||||||
|
$incomes_totalClosingDr = 0;
|
||||||
|
$incomes_totalClosingCr = 0;
|
||||||
|
?>
|
||||||
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
|
<td><b><?php echo $group->acgroup_name; ?></b></td>
|
||||||
|
<td width="20%"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" class="group-details p-0">
|
||||||
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// Update column totals
|
||||||
|
$Side1Total += $group->closing_balance;
|
||||||
|
?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
|
||||||
|
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
||||||
|
<?php
|
||||||
|
// Initialize variables for column totals
|
||||||
|
$incomes_totalOpeningDr = 0;
|
||||||
|
$incomes_totalOpeningCr = 0;
|
||||||
|
$incomes_totalThisYearDr = 0;
|
||||||
|
$incomes_totalThisYearCr = 0;
|
||||||
|
$incomes_totalClosingDr = 0;
|
||||||
|
$incomes_totalClosingCr = 0;
|
||||||
|
?>
|
||||||
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
|
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
|
||||||
|
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" class="group-details p-0">
|
||||||
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// Update column totals
|
||||||
|
$Side1Total += $group->closing_balance;
|
||||||
|
?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?>
|
||||||
|
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
||||||
|
<?php
|
||||||
|
// Initialize variables for column totals
|
||||||
|
$totalOpeningDr = 0;
|
||||||
|
$totalOpeningCr = 0;
|
||||||
|
$totalThisYearDr = 0;
|
||||||
|
$totalThisYearCr = 0;
|
||||||
|
$totalClosingDr = 0;
|
||||||
|
$totalClosingCr = 0;
|
||||||
|
?>
|
||||||
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
|
<td class="group-name"><b><?php echo $group->acgroup_name; ?></b></td>
|
||||||
|
<td class="group-total text-right pr-2"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" class="group-details p-0">
|
||||||
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// Update column totals
|
||||||
|
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
|
||||||
|
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
|
||||||
|
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
|
||||||
|
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
|
||||||
|
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
|
||||||
|
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
||||||
|
?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
|
||||||
|
$TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
|
||||||
|
$TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
|
||||||
|
$PL = $TotalIncomes - $TotalExpenses;
|
||||||
|
$Side1Total += $PL;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<td>Total Profit/Loss</td>
|
||||||
|
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th>Total Amount</th>
|
||||||
|
<th class="cr closing-cr">
|
||||||
|
<?php echo myCurrency($Side1Total); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th>Total Amount</th>
|
||||||
|
<th class="dr closing-dr">
|
||||||
|
<?php echo myCurrency($totalClosingDr); ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php //pre($BIBAccounts->getAccountGroupsWithBalances($acgroup_id = null));
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
function footerfunctions()
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var exportButton = document.getElementById("exportButton");
|
||||||
|
exportButton.addEventListener("click", function() {
|
||||||
|
exportTableToCSV("table.csv");
|
||||||
|
});
|
||||||
|
|
||||||
|
function exportTableToCSV(filename) {
|
||||||
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#fromDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#fromDate').data('start'),
|
||||||
|
maxDate: $('#fromDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#toDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#toDate').data('start'),
|
||||||
|
maxDate: $('#toDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
@ -8,9 +8,7 @@ $ExpenseAccounts = $this->acc->getAccountsByGroup(4);
|
|||||||
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
||||||
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
||||||
$PL = $IncomesTotal - $ExpensesTotal;
|
$PL = $IncomesTotal - $ExpensesTotal;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
table,
|
table,
|
||||||
td,
|
td,
|
||||||
@ -92,81 +90,109 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
box-shadow: inset 0 0 0 transparent;
|
box-shadow: inset 0 0 0 transparent;
|
||||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table1 {
|
||||||
|
border: 0px !important;
|
||||||
|
padding: 0;
|
||||||
|
margin: 10 !important;
|
||||||
|
width: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-responsive {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
-webkit-flex: 1 1 auto;
|
||||||
|
-ms-flex: 1 1 auto;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body.p-0 .table tbody>tr>td:last-of-type,
|
||||||
|
.card-body.p-0 .table tbody>tr>th:last-of-type,
|
||||||
|
.card-body.p-0 .table tfoot>tr>td:last-of-type,
|
||||||
|
.card-body.p-0 .table tfoot>tr>th:last-of-type,
|
||||||
|
.card-body.p-0 .table thead>tr>td:last-of-type,
|
||||||
|
.card-body.p-0 .table thead>tr>th:last-of-type {
|
||||||
|
padding-right: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-bold {
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header ">
|
<div class="card-header ">
|
||||||
<h3 class="card-title mt-1">Cash Flow<?php //echo $pageTitle;
|
<h3 class="card-title mt-1">Cash Flow<?php //echo $pageTitle;
|
||||||
?> </h3>
|
?> </h3>
|
||||||
|
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action=<?php echo base_url('accounts/reports/cash_flow'); ?> id="FilterForm">
|
||||||
|
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
Filters
|
Filters
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" role="menu">
|
<div class="dropdown-menu" role="menu">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
|
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" name="showOB" value="not">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
Export
|
Export
|
||||||
|
</button> -->
|
||||||
|
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
<a href="#" class="dropdown-item">Pdf</a>
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
@ -174,10 +200,9 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<a href="#" class="dropdown-item">View calendar</a>
|
<a href="#" class="dropdown-item">View calendar</a>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
<!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> -->
|
<!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> -->
|
||||||
|
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
@ -233,9 +258,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
document.getElementById("fromDate").value = "2078-4-1";
|
document.getElementById("fromDate").value = "2078-4-1";
|
||||||
@ -245,31 +268,30 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
document.getElementById("FilterForm").submit();
|
document.getElementById("FilterForm").submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<!-- <div class="card-header">
|
<!-- <div class="card-header">
|
||||||
<h4 class="card-title">Cash Flow</h4>
|
<h4 class="card-title">Cash Flow</h4>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="card-body table-responsive p-0">
|
<div class="card-body table-responsive p-0">
|
||||||
|
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses($fiscalStart, $fiscalEnd);
|
||||||
|
// echo "<pre>";print_r($IncomesExpenses); die();
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
|
|
||||||
|
|
||||||
|
|
||||||
<table class="table table-head-fixed table-bordered g-0">
|
<table id='myTable' class="table table-bordered p-0 ">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="" width="35%"><?php myLang("Cash inflow"); ?></th>
|
<th class="" width="30%"><?php myLang("Cash inflow"); ?></th>
|
||||||
<th class="text-right" width="15%"></th>
|
<th class="text-right" width="10%"></th>
|
||||||
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
|
<th class="text-right pr-1" width="10%"><?php myLang("Amount"); ?></th>
|
||||||
<th class="" width="35%"><?php echo myLang("Cash outflow"); ?></th>
|
<th class="pl-2" width="30%"><?php echo myLang("Cash outflow"); ?></th>
|
||||||
<th class="text-right" width="15%"></th>
|
<th class="text-right" width="10%"></th>
|
||||||
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
|
<th class="text-right pr-1" width="10%"><?php myLang("Amount"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -277,37 +299,35 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<td colspan=3 class="p-0">
|
<td colspan=3 class="p-0">
|
||||||
<table class="table g-0">
|
<table class="table g-0">
|
||||||
<?php $total1 = 0;
|
<?php $total1 = 0;
|
||||||
|
$counter = 0;
|
||||||
|
$index = 0;
|
||||||
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
|
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
|
||||||
|
|
||||||
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
|
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
|
||||||
<!-- <tr>
|
<!-- <tr>
|
||||||
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
|
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
|
||||||
<td width="15%"></td>
|
<td width="15%"></td>
|
||||||
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
|
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
|
||||||
|
|
||||||
</tr> -->
|
</tr> -->
|
||||||
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
|
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
|
||||||
<tr>
|
<tr class="parent-row" class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $index; ?>">
|
||||||
<td class="" width="70%"><b><?php echo $Incomes['category']; ?></b></td>
|
<td class="" width="60%"><b><?php echo $Incomes['category']; ?></b></td>
|
||||||
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
<td width="20%"></td>
|
||||||
<td width="15%"></td>
|
<td class="text-right " width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php $total1 += $Incomes['amount']; ?>
|
<?php $total1 += $Incomes['amount']; ?>
|
||||||
<tr>
|
<tr class="collapse" data-target="#group_<?php echo $index; ?>">
|
||||||
<td class="" width="70%"> <?php echo $Incomes['account']; ?></td>
|
<td class="" width="60%"> <?php echo $Incomes['account']; ?></td>
|
||||||
<td width="15%"></td>
|
<td class="text-right " width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
||||||
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
<td width="20%"></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php $counter = $index ?>
|
||||||
<?php }; ?>
|
<?php }; ?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td colspan=3 class="p-0">
|
<td colspan=3 class="p-0">
|
||||||
<table class="table g-0">
|
<table class="table p-0">
|
||||||
<?php $total = 0;
|
<?php $total = 0;
|
||||||
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
|
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
|
||||||
if ($Expenses['account'] == "GROUP TOTAL") : ?>
|
if ($Expenses['account'] == "GROUP TOTAL") : ?>
|
||||||
@ -315,53 +335,41 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
|
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
|
||||||
<td width="15%"></td>
|
<td width="15%"></td>
|
||||||
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
|
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
|
||||||
|
|
||||||
|
|
||||||
</tr> -->
|
</tr> -->
|
||||||
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
|
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
|
||||||
<tr>
|
<tr data-toggle="collapse" data-target="#group_<?php echo $counter; ?>">
|
||||||
<td class="" width="70%"><b><?php echo $Expenses['category']; ?></b></td>
|
<td class="" width="60%"><b><?php echo $Expenses['category']; ?></b></td>
|
||||||
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
<td width="20%"></td>
|
||||||
<td width="15%"></td>
|
<td class="text-right " width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php $total += $Expenses['amount']; ?>
|
<?php $total += $Expenses['amount']; ?>
|
||||||
<tr>
|
<tr class="collapse" data-target="#group_<?php echo $counter; ?>">
|
||||||
<td class="" width="70%"> <?php echo $Expenses['account']; ?></td>
|
<td class="" width="60%"> <?php echo $Expenses['account']; ?></td>
|
||||||
<td width="15%"></td>
|
<td class="text-right" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
||||||
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
<td width="20%"></td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php }; ?>
|
<?php }; ?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Total</th>
|
<th class="p-1">Total</th>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"><?php echo myCurrency($total1); ?></td>
|
<td class="text-right text-bold"><?php echo myCurrency($total1); ?></td>
|
||||||
|
<th class="p-1">Total</th>
|
||||||
<th>Total</th>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"><?php echo myCurrency($total); ?></td>
|
<td class="text-right text-bold"><?php echo myCurrency($total); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"></td>
|
<td class="text-right"></td>
|
||||||
|
<th class="pl-1">Net Inflow</th>
|
||||||
<th>Net Inflow</th>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"><?php echo myCurrency($total1 - $total); ?></td>
|
<td class="text-right text-bold"><?php echo myCurrency($total1 - $total); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $Bank = $BIBAccounts->getAccountCategoriesWithBalances(null, 2); ?>
|
<?php $Bank = $BIBAccounts->getAccountCategoriesWithBalances(null, 2); ?>
|
||||||
<?php foreach ($Bank->accounts as $account) : ?>
|
<?php foreach ($Bank->accounts as $account) : ?>
|
||||||
@ -369,40 +377,88 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<th></th>
|
<th></th>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"></td>
|
<td class="text-right"></td>
|
||||||
|
<th class="pl-1"><?php echo $account->account_name; ?></th>
|
||||||
<th><?php echo $account->account_name; ?></th>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
|
<td class="text-right text-bold"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php $Cash = $BIBAccounts->getAccountCategoriesWithBalances(null, 3); ?>
|
<?php $Cash = $BIBAccounts->getAccountCategoriesWithBalances(null, 3); ?>
|
||||||
|
|
||||||
<?php foreach ($Cash->accounts as $account) : ?>
|
<?php foreach ($Cash->accounts as $account) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th></th>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"></td>
|
<td class="text-right"></td>
|
||||||
|
<th class="pl-1"><?php echo $account->account_name; ?></th>
|
||||||
<th><?php echo $account->account_name; ?></th>
|
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-right"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
|
<td class="text-right text-bold"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<?php //pre($IncomesExpenses);
|
<?php //pre($IncomesExpenses);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div><!-- /.container-fluid -->
|
</div><!-- /.container-fluid -->
|
||||||
</section>
|
</section>
|
||||||
|
<?php function footerFunctions()
|
||||||
|
{ ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// var exportButton = document.getElementById("exportButton");
|
||||||
|
// exportButton.addEventListener("click", function() {
|
||||||
|
// exportTableToCSV("table.csv");
|
||||||
|
// });
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Trigger click event on page load
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
<?php function footerFunctions()
|
function exportTableToCSV(filename) {
|
||||||
{ ?>
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$("#fromDate").nepaliDatePicker({
|
$("#fromDate").nepaliDatePicker({
|
||||||
dateFormat: "%y-%m-%d",
|
dateFormat: "%y-%m-%d",
|
||||||
@ -419,4 +475,40 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
maxDate: $('#toDate').data('end'),
|
maxDate: $('#toDate').data('end'),
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
|
<?php } ?>
|
@ -1,24 +1,97 @@
|
|||||||
|
<style>
|
||||||
|
.mt-26 {
|
||||||
|
margin-top: 26px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
<div class="card-tools">
|
||||||
|
<form method="post" action="" id="FilterForm">
|
||||||
|
<!-- button with a dropdown -->
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
|
Filters
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu" role="menu">
|
||||||
|
<div class="form-group p-2 pb-0">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
|
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
|
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox">
|
||||||
|
<label class="form-check-label">Select
|
||||||
|
All</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input type="hidden" name="showOB" value="not">
|
||||||
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<label class="form-check-label">Opening</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<label class="form-check-label">Closing</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
|
<label class="form-check-label">Period</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-group p-2 pb-0">
|
||||||
|
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
|
</button>
|
||||||
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a href="#" class="dropdown-item">View calendar</a>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
function resetForm() {
|
||||||
|
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
|
||||||
|
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
|
||||||
|
document.getElementById("showOB").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("FilterForm").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="GET" action="">
|
<form method="GET" action="">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-2"><?php createNepaliDateInput("from_date", "Date", "from_date", isset($_GET['from_date']) ? $_GET['from_date'] : ''); ?></div>
|
<div class="col-2"><?php createNepaliDateInput("from_date", "Date", "from_date", isset($_GET['from_date']) ? $_GET['from_date'] : ''); ?></div>
|
||||||
<div class="col-1"><?php createButton("show_voucher", "Show", "show_voucher", "Submit", "mt-30"); ?></div>
|
<div class="col-1"><?php createButton("show_voucher", "Show", "show_voucher", "Submit", "mt-26 btn btn-block btn-primary btn-sm "); ?></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div id="dataTable_Commands"></div>
|
<div id="dataTable_Commands"></div>
|
||||||
@ -30,8 +103,6 @@
|
|||||||
$vouchertype_id = isset($_GET['vouchertypes']) ? $_GET['vouchertypes'] : '';
|
$vouchertype_id = isset($_GET['vouchertypes']) ? $_GET['vouchertypes'] : '';
|
||||||
$this->myaccounts->listVouchers($fromDate, $fromDate, $account_id, $vouchertype_id, true, true);
|
$this->myaccounts->listVouchers($fromDate, $fromDate, $account_id, $vouchertype_id, true, true);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -39,3 +110,39 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('voucherList1');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
@ -0,0 +1,70 @@
|
|||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div id="dataTable_wrapper">
|
||||||
|
<?php //$this->myaccounts->getAllAccountsTable(3);
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
$accategory_id = 3;
|
||||||
|
$CI = &get_instance();
|
||||||
|
|
||||||
|
// $CI->db->where("status", 1)->where("(accategory_id = 2 OR accategory_id = 3)");
|
||||||
|
$CI->db->where("status", 1)->where("accategory_id = 3")->where("created_on >= '$fiscalStart'")->where("created_on >= '$fiscalEnd'");
|
||||||
|
$CI->db->order_by("account_name ASC");
|
||||||
|
$Accounts = $CI->db->get("tbl_accounts")->result();
|
||||||
|
|
||||||
|
foreach ($Accounts as $Account) {
|
||||||
|
$Account->Group = $CI->db->query("select * from tbl_acgroups where acgroup_id=(select acgroup_id from tbl_accategories where accategory_id = $Account->accategory_id)")->row();
|
||||||
|
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="row mb-3">
|
||||||
|
|
||||||
|
<!-- <div id="dataTable_commands" class="col text-right"></div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$html = "";
|
||||||
|
$html .= "<table id='myTable' class='table table-bordered table-striped longdataTable'>";
|
||||||
|
$html .= "<thead>";
|
||||||
|
$html .= "<tr><th class='text-center' width='25'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Balance</th><th class='text-center col-1'>Action</th></tr>";
|
||||||
|
$html .= "</thead><tbody>";
|
||||||
|
$sn = 0;
|
||||||
|
$BalanceTotal = 0;
|
||||||
|
foreach ($Accounts as $Account) : $sn++;
|
||||||
|
$balance = getBalance($Account->account_id);
|
||||||
|
$BalanceTotal += $balance;
|
||||||
|
// pre($Account);
|
||||||
|
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-1'>" . (myCurrency($balance)) . "</td><td class=' text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
||||||
|
endforeach;
|
||||||
|
$html .= "</tbody><tfoot>";
|
||||||
|
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . (($BalanceTotal > 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . (($BalanceTotal < 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th></tr>";
|
||||||
|
$html .= "</tfoot></table>\n";
|
||||||
|
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
||||||
|
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
||||||
|
<div class=\"modal-content\">
|
||||||
|
<div class=\"modal-header\">
|
||||||
|
<h5 class=\"modal-title\" id=\"exampleModalLabel\">Ledger Details</h5>
|
||||||
|
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
|
||||||
|
<span aria-hidden=\"true\">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class=\"modal-body\" id=\"details_container\">
|
||||||
|
Ledger Details Goes Here
|
||||||
|
</div>
|
||||||
|
<!--<div class=\"modal-footer\">
|
||||||
|
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>
|
||||||
|
<button type=\"button\" class=\"btn btn-success\" data-dismiss=\"modal\">Print</button>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>";
|
||||||
|
$html .= '<script>function showLedger(id) {$.ajax({url: \'';
|
||||||
|
$html .= site_url("accounts/reports/ajax/getledgersummary/");
|
||||||
|
$html .= '\' + id,success: function(data) {$(\'#ledgerdetails_box #details_container\').html(data);$(\'#ledgerdetails_box\').modal(\'show\');}});}</script>';
|
||||||
|
echo $html;
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -1,5 +1,4 @@
|
|||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -15,8 +14,8 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header disabled color-palette">
|
||||||
<h3 class="card-title m-0"><?php echo $pageTitle; ?></h3>
|
<h5 class="card-title m-0"><?php echo $pageTitle; ?></h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -79,7 +78,6 @@ $tree .= "]";
|
|||||||
var id = $(this).attr("id").substr(8);
|
var id = $(this).attr("id").substr(8);
|
||||||
showLedger(id);
|
showLedger(id);
|
||||||
});
|
});
|
||||||
|
|
||||||
function getAccounts(id) {
|
function getAccounts(id) {
|
||||||
$("#accountsContainer").empty();
|
$("#accountsContainer").empty();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -94,7 +92,6 @@ $tree .= "]";
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
getAccountsAll();
|
getAccountsAll();
|
||||||
|
|
||||||
function getAccountsAll() {
|
function getAccountsAll() {
|
||||||
$("#accountsContainer").html("");
|
$("#accountsContainer").html("");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -107,7 +104,6 @@ $tree .= "]";
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLedger(id) {
|
function showLedger(id) {
|
||||||
// $("#accountsContainer").html("");
|
// $("#accountsContainer").html("");
|
||||||
alert(id);
|
alert(id);
|
||||||
|
@ -1,46 +1,36 @@
|
|||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header bg-primary disabled color-palette">
|
||||||
|
|
||||||
<h3 class="card-title m-0"><?php echo $pageTitle; ?></h3>
|
<h3 class="card-title m-0"><?php echo $pageTitle; ?></h3>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="GET" action="#">
|
<form method="GET" action="#">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col"><?php createNepaliDateInput("from_date", "", "from_date", isset($fromDate_Nepali) ? $fromDate_Nepali : firstDayOfNepaliMonth()); ?></div>
|
<div class="col"><?php createNepaliDateInput("from_date", "", "from_date", isset($fromDate_Nepali) ? $fromDate_Nepali : firstDayOfNepaliMonth()); ?></div>
|
||||||
<div class="col"><?php createNepaliDateInput("to_date", "", "to_date", isset($toDate_Nepali) ? $toDate_Nepali : ''); ?></div>
|
<div class="col"><?php createNepaliDateInput("to_date", "", "to_date", isset($toDate_Nepali) ? $toDate_Nepali : ''); ?></div>
|
||||||
<div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : 1, $CSSclass = ""); ?> </div>
|
<div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : 1, $CSSclass = ""); ?> </div>
|
||||||
<div class="col"><?php createButton("show_ledger", "Show Ledger", "show_ledger","Submit", "btn btn-primary"); ?></div>
|
<div class="col"><?php createButton("show_ledger", "Show Ledger", "show_ledger", "Submit", "btn btn-primary"); ?></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<button id="openModal" class="btn btn-primary">Open Modal</button>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div id="dataTable_Commands">
|
<div id="dataTable_Commands">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
if(!isset($account_id)){
|
if (!isset($account_id)) {
|
||||||
$account_id = 1;
|
$account_id = 1;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (isset($account_id) && $account_id != "") {
|
<?php if (isset($account_id) && $account_id != "") {
|
||||||
$fromDate = NepaliToEnglishDate(isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth());
|
$fromDate = NepaliToEnglishDate(isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth());
|
||||||
$toDate = isset($_GET['to_date']) ? $_GET['to_date'] : Today();
|
$toDate = isset($_GET['to_date']) ? $_GET['to_date'] : Today();
|
||||||
$this->myaccounts->showLedger($account_id, $fromDate, $toDate);
|
$this->myaccounts->showLedger($account_id, $fromDate, $toDate, $fiscalStart, $fiscalEnd);
|
||||||
} ?>
|
} ?>
|
||||||
<div class="modal fade" id="ledgerdetails_box" tabindex="-1" role="dialog" aria-labelledby="ledgerdetails_box" aria-hidden="true">
|
<div class="modal fade" id="ledgerdetails_box" tabindex="-1" role="dialog" aria-labelledby="ledgerdetails_box" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-xl" role="document">
|
<div class="modal-dialog modal-xl" role="document">
|
||||||
@ -57,6 +47,9 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
<button type="button" class="btn btn-success" data-dismiss="modal">Print</button>
|
<button type="button" class="btn btn-success" data-dismiss="modal">Print</button>
|
||||||
|
<!-- <button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
|
</button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -67,4 +60,39 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
@ -3,11 +3,11 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header disabled color-palette">
|
||||||
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action="<?php echo base_url('accounts/ledger/bank_book'); ?>" id="FilterForm">
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
@ -18,47 +18,49 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" name="showOB" value="not">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
Export
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
|
<!-- <button class="btn btn-warning btn-sm " onclick="exportTableToCSV('accounts_data.csv')">Export to CSV</button> -->
|
||||||
|
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
<a href="#" class="dropdown-item">Pdf</a>
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
@ -90,7 +92,7 @@
|
|||||||
$accategory_id = 3;
|
$accategory_id = 3;
|
||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
|
|
||||||
$CI->db->where("status", 1)->where("accategory_id = 2");
|
$CI->db->where("status", 1)->where("accategory_id = 2")->where('created_on >=', date('Y-m-d', (strtotime($fiscalStart))))->where('created_on <=', date('Y-m-d', (strtotime($fiscalEnd))));
|
||||||
$CI->db->order_by("account_name ASC");
|
$CI->db->order_by("account_name ASC");
|
||||||
$Accounts = $CI->db->get("tbl_accounts")->result();
|
$Accounts = $CI->db->get("tbl_accounts")->result();
|
||||||
|
|
||||||
@ -106,9 +108,9 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$html = "";
|
$html = "";
|
||||||
$html .= "<table class='table table-bordered table-striped longdataTable'>";
|
$html .= "<table id='myTable'class='table table-bordered table-striped longdataTable'>";
|
||||||
$html .= "<thead>";
|
$html .= "<thead>";
|
||||||
$html .= "<tr><th class='text-center'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center '>Action</th></tr>";
|
$html .= "<tr><th class='text-center col-1'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Balance</th><th class='text-center col-1 '>Action</th></tr>";
|
||||||
$html .= "</thead><tbody>";
|
$html .= "</thead><tbody>";
|
||||||
$sn = 0;
|
$sn = 0;
|
||||||
$BalanceTotal = 0;
|
$BalanceTotal = 0;
|
||||||
@ -116,10 +118,10 @@
|
|||||||
$balance = getBalance($Account->account_id);
|
$balance = getBalance($Account->account_id);
|
||||||
$BalanceTotal += $balance;
|
$BalanceTotal += $balance;
|
||||||
// pre($Account);
|
// pre($Account);
|
||||||
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-2 text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-1'>" . (myCurrency($balance)) . "</td><td class='text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
||||||
endforeach;
|
endforeach;
|
||||||
$html .= "</tbody><tfoot>";
|
$html .= "</tbody><tfoot>";
|
||||||
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th><th></th></tr>";
|
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . (($BalanceTotal > 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . (($BalanceTotal < 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th></tr>";
|
||||||
$html .= "</tfoot></table>\n";
|
$html .= "</tfoot></table>\n";
|
||||||
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
||||||
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
||||||
@ -158,6 +160,116 @@
|
|||||||
<?php function footerFunctions()
|
<?php function footerFunctions()
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// var exportButton = document.getElementById("exportButton");
|
||||||
|
// exportButton.addEventListener("click", function() {
|
||||||
|
// exportTableToCSV("table.csv");
|
||||||
|
// });
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Trigger click event on page load
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function exportTableToCSV(filename) {
|
||||||
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#fromDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#fromDate').data('start'),
|
||||||
|
maxDate: $('#fromDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#toDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#toDate').data('start'),
|
||||||
|
maxDate: $('#toDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -4,8 +4,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline ">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header disabled color-palette">
|
||||||
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
|
<h3 class="card-title mt-1"><?php echo $pageTitle; ?> </h3>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action="" id="FilterForm">
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
@ -18,47 +18,54 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" name="showOB" value="not">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
Export
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
|
<!-- <button id="exportButton">Export to Excel</button> -->
|
||||||
|
|
||||||
|
<!-- <button class="btn btn-warning btn-sm " id="downloadBtn">Download CSV</button> -->
|
||||||
|
|
||||||
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button> -->
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
<a href="#" class="dropdown-item">Pdf</a>
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
@ -67,7 +74,7 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
@ -91,7 +98,7 @@
|
|||||||
$CI = &get_instance();
|
$CI = &get_instance();
|
||||||
|
|
||||||
// $CI->db->where("status", 1)->where("(accategory_id = 2 OR accategory_id = 3)");
|
// $CI->db->where("status", 1)->where("(accategory_id = 2 OR accategory_id = 3)");
|
||||||
$CI->db->where("status", 1)->where("accategory_id = 3");
|
$CI->db->where("status", 1)->where("accategory_id = 3")->where("created_on >= '$fiscalStart'")->where("created_on >= '$fiscalEnd'");
|
||||||
$CI->db->order_by("account_name ASC");
|
$CI->db->order_by("account_name ASC");
|
||||||
$Accounts = $CI->db->get("tbl_accounts")->result();
|
$Accounts = $CI->db->get("tbl_accounts")->result();
|
||||||
|
|
||||||
@ -107,9 +114,9 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$html = "";
|
$html = "";
|
||||||
$html .= "<table class='table table-bordered table-striped longdataTable'>";
|
$html .= "<table id='myTable' class='table table-bordered table-striped longdataTable'>";
|
||||||
$html .= "<thead>";
|
$html .= "<thead>";
|
||||||
$html .= "<tr><th class='text-center' width='25'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center' width='25'>Action</th></tr>";
|
$html .= "<tr><th class='text-center' width='25'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Balance</th><th class='text-center col-1'>Action</th></tr>";
|
||||||
$html .= "</thead><tbody>";
|
$html .= "</thead><tbody>";
|
||||||
$sn = 0;
|
$sn = 0;
|
||||||
$BalanceTotal = 0;
|
$BalanceTotal = 0;
|
||||||
@ -117,10 +124,10 @@
|
|||||||
$balance = getBalance($Account->account_id);
|
$balance = getBalance($Account->account_id);
|
||||||
$BalanceTotal += $balance;
|
$BalanceTotal += $balance;
|
||||||
// pre($Account);
|
// pre($Account);
|
||||||
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-2 text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td><a href='#' onClick='showLedger(" . $Account->account_id . ")'>" . $Account->account_name . "</a></td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-1'>" . (myCurrency($balance)) . "</td><td class=' text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
|
||||||
endforeach;
|
endforeach;
|
||||||
$html .= "</tbody><tfoot>";
|
$html .= "</tbody><tfoot>";
|
||||||
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th><th></th></tr>";
|
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . (($BalanceTotal > 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . (($BalanceTotal < 0) ? myCurrency(abs($BalanceTotal)) : "") . "</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th></tr>";
|
||||||
$html .= "</tfoot></table>\n";
|
$html .= "</tfoot></table>\n";
|
||||||
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
|
||||||
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
<div class=\"modal-dialog modal-xl\" role=\"document\">
|
||||||
@ -159,6 +166,117 @@
|
|||||||
<?php function footerFunctions()
|
<?php function footerFunctions()
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// var exportButton = document.getElementById("exportButton");
|
||||||
|
// exportButton.addEventListener("click", function() {
|
||||||
|
// exportTableToCSV("table.csv");
|
||||||
|
// });
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Trigger click event on page load
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function exportTableToCSV(filename) {
|
||||||
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#fromDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#fromDate').data('start'),
|
||||||
|
maxDate: $('#fromDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#toDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#toDate').data('start'),
|
||||||
|
maxDate: $('#toDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -6,7 +6,7 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline ">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header disabled color-palette">
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline ">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header disabled color-palette">
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
|
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -18,9 +15,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -29,12 +23,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<?php function footerFunctions()
|
<?php function footerFunctions()
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -4,7 +4,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline ">
|
||||||
<div class="card-header bg-primary disabled color-palette">
|
<div class="card-header disabled color-palette">
|
||||||
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
|
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
430
account/application/views/accounts/pl-bckup.php
Normal file
430
account/application/views/accounts/pl-bckup.php
Normal file
@ -0,0 +1,430 @@
|
|||||||
|
<?php
|
||||||
|
$this->load->library("BIBAccounts");
|
||||||
|
$BIBAccounts = new BIBAccounts();
|
||||||
|
?>
|
||||||
|
<!-- Include jQuery -->
|
||||||
|
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||||
|
<!-- Include jQuery UI -->
|
||||||
|
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||||
|
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||||
|
<style>
|
||||||
|
table,
|
||||||
|
td,
|
||||||
|
tr {
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-name {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-total {
|
||||||
|
width: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-gray {
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table td,
|
||||||
|
.table th {
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-darker {
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
td .table {
|
||||||
|
border: 0px !important;
|
||||||
|
margin-bottom: 0rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
table td:first-child {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-bordered.vertical-borders td,
|
||||||
|
.table-bordered.vertical-borders th {
|
||||||
|
border-left: 1px solid #dee2e6;
|
||||||
|
border-right: 1px solid #dee2e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-bordered.vertical-borders thead th {
|
||||||
|
padding: 0.25rem;
|
||||||
|
border-top: none;
|
||||||
|
border-bottom: 2px solid #dee2e6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-bordered.vertical-borders tfoot th {
|
||||||
|
padding: 0.25rem;
|
||||||
|
border-top: 2px solid #dee2e6;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency {
|
||||||
|
font-weight: normal !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.underline {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: calc(1.5rem + 1px);
|
||||||
|
padding: 0.375rem 0.75rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.5;
|
||||||
|
color: #495057;
|
||||||
|
background-color: #fff;
|
||||||
|
background-clip: padding-box;
|
||||||
|
border: 1px solid #ced4da;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
box-shadow: inset 0 0 0 transparent;
|
||||||
|
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="card card-primary card-outline ">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2 class="card-title mt-1"><?php echo $pageTitle; ?> <?php //myLang("Report");
|
||||||
|
?></h2>
|
||||||
|
<div class="card-tools">
|
||||||
|
<form method="post" action="" id="FilterForm">
|
||||||
|
<!-- button with a dropdown -->
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
|
Filters
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu" role="menu">
|
||||||
|
<div class="form-group p-2 pb-0">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<!-- <div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox">
|
||||||
|
<label class="form-check-label">Select
|
||||||
|
All</label>
|
||||||
|
</div> -->
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button>
|
||||||
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a href="#" class="dropdown-item">View calendar</a>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
function resetForm() {
|
||||||
|
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
|
||||||
|
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
|
||||||
|
document.getElementById("showOB").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("FilterForm").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
<div class="card card-primary card-outline ">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<?php
|
||||||
|
// echo $_POST['showClosing'];
|
||||||
|
$ReportOptions = array(
|
||||||
|
'showZeroBalances' => false,
|
||||||
|
'showOB' => false,
|
||||||
|
'showClosing' => true,
|
||||||
|
'showPeriod' => false,
|
||||||
|
);
|
||||||
|
// die;
|
||||||
|
?>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="group-name" width="85%">Particulars</th>
|
||||||
|
<th class="group-total text-center" width="10%">Amount</th>
|
||||||
|
<th class="group-name" width="85%">Particulars</th>
|
||||||
|
<th class="group-total text-center" width="15%">Amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(3); ?>
|
||||||
|
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
||||||
|
<?php
|
||||||
|
// Initialize variables for column totals
|
||||||
|
$incomes_totalOpeningDr = 0;
|
||||||
|
$incomes_totalOpeningCr = 0;
|
||||||
|
$incomes_totalThisYearDr = 0;
|
||||||
|
$incomes_totalThisYearCr = 0;
|
||||||
|
$incomes_totalClosingDr = 0;
|
||||||
|
$incomes_totalClosingCr = 0;
|
||||||
|
?>
|
||||||
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
|
<td class="group-name"><b><?php //echo $group->acgroup_name;
|
||||||
|
?></b></td>
|
||||||
|
<td class="group-total text-right"><?php //echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0);
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" class="group-details p-0" width="85%">
|
||||||
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// Update column totals
|
||||||
|
$incomes_totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
|
||||||
|
$incomes_totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
|
||||||
|
$incomes_totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
|
||||||
|
$incomes_totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
|
||||||
|
$incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
|
||||||
|
$incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
||||||
|
?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?>
|
||||||
|
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
||||||
|
<?php
|
||||||
|
// Initialize variables for column totals
|
||||||
|
$totalOpeningDr = 0;
|
||||||
|
$totalOpeningCr = 0;
|
||||||
|
$totalThisYearDr = 0;
|
||||||
|
$totalThisYearCr = 0;
|
||||||
|
$totalClosingDr = 0;
|
||||||
|
$totalClosingCr = 0;
|
||||||
|
?>
|
||||||
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
|
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
||||||
|
<td class="group-name" width="85%"> <?php //echo $group->acgroup_name;
|
||||||
|
?></td>
|
||||||
|
<td class="group-total" width="15%"><?php //echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0);
|
||||||
|
?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" class="group-details p-0">
|
||||||
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
|
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
// Update column totals
|
||||||
|
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
|
||||||
|
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
|
||||||
|
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
|
||||||
|
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
|
||||||
|
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
|
||||||
|
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
||||||
|
?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
|
||||||
|
<?php if ($incomes_totalClosingCr > $totalClosingDr) : ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" width="15%">
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th>Total Profit</th>
|
||||||
|
<th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php else : ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th>Total Loss</th>
|
||||||
|
<th class="cr closing-cr"><?php echo myCurrency(abs($PL)); ?></th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td colspan="2">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th>Total Incomes</th>
|
||||||
|
<th class="cr closing-cr">
|
||||||
|
<?php if ($PL > 0) : ?>
|
||||||
|
<?php echo myCurrency($incomes_totalClosingCr); ?>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td colspan="2" class="p-0">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th>Total Expenses</th>
|
||||||
|
<th class="dr closing-dr">
|
||||||
|
<?php if ($PL > 0) : ?>
|
||||||
|
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php echo myCurrency($totalClosingDr); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
function footerfunctions()
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Trigger click event on page load
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var exportButton = document.getElementById("exportButton");
|
||||||
|
exportButton.addEventListener("click", function() {
|
||||||
|
exportTableToCSV("table.csv");
|
||||||
|
});
|
||||||
|
|
||||||
|
function exportTableToCSV(filename) {
|
||||||
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#fromDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#fromDate').data('start'),
|
||||||
|
maxDate: $('#fromDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#toDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#toDate').data('start'),
|
||||||
|
maxDate: $('#toDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
@ -17,7 +17,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-bordered table-hover">
|
<table id='myTable'class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="4">Profit & Loss Statement</th>
|
<th colspan="4">Profit & Loss Statement</th>
|
||||||
@ -95,7 +95,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
?>
|
?>
|
||||||
<table class="table table-bordered table-hover">
|
<table id='myTable' class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Account</th>
|
<th>Account</th>
|
||||||
@ -121,6 +121,41 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
</tr>
|
</tr>
|
||||||
</tfoot> -->
|
</tfoot> -->
|
||||||
</table>
|
</table>
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,35 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
box-shadow: inset 0 0 0 transparent;
|
box-shadow: inset 0 0 0 transparent;
|
||||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table1 {
|
||||||
|
border: 0px !important;
|
||||||
|
padding: 0;
|
||||||
|
margin: 10 !important;
|
||||||
|
width: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-responsive {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
-webkit-flex: 1 1 auto;
|
||||||
|
-ms-flex: 1 1 auto;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-bold {
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -97,7 +126,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<h2 class="card-title mt-1"><?php echo $pageTitle; ?> <?php //myLang("Report");
|
<h2 class="card-title mt-1"><?php echo $pageTitle; ?> <?php //myLang("Report");
|
||||||
?></h2>
|
?></h2>
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action="<?php echo base_url('accounts/reports/pl'); ?>" id="FilterForm">
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
@ -108,46 +137,52 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" name="showOB" value="not">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
Export
|
Export
|
||||||
|
</button> -->
|
||||||
|
<!-- <button type="submit" onclick="exportTableToCSV('accounts_data.csv')" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
@ -157,7 +192,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
@ -168,6 +203,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
document.getElementById("FilterForm").submit();
|
document.getElementById("FilterForm").submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -177,9 +213,10 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-body p-0">
|
<div class="card-body pl-2 pr-2">
|
||||||
|
<div class="row">
|
||||||
<?php
|
<?php
|
||||||
// echo $_POST['showClosing'];
|
// echo $_POST['showClosing'];
|
||||||
$ReportOptions = array(
|
$ReportOptions = array(
|
||||||
@ -190,20 +227,17 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
);
|
);
|
||||||
// die;
|
// die;
|
||||||
?>
|
?>
|
||||||
<table class="table table-bordered">
|
<div class="col-6 p-0">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id='myTable' class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="group-name" width="85%">Particulars</th>
|
<th class="group-name pl-1">Particulars</th>
|
||||||
<th class="group-total text-center" width="10%">Amount</th>
|
<th class="group-total text-center col-1">Amount</th>
|
||||||
<th class="group-name" width="85%">Particulars</th>
|
|
||||||
<th class="group-total text-center" width="15%">Amount</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalancesNew(3, $fiscalStart, $fiscalEnd); ?>
|
||||||
<td colspan="2" class="p-0">
|
|
||||||
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(3); ?>
|
|
||||||
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
|
||||||
<?php
|
<?php
|
||||||
// Initialize variables for column totals
|
// Initialize variables for column totals
|
||||||
$incomes_totalOpeningDr = 0;
|
$incomes_totalOpeningDr = 0;
|
||||||
@ -214,19 +248,14 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$incomes_totalClosingCr = 0;
|
$incomes_totalClosingCr = 0;
|
||||||
?>
|
?>
|
||||||
<?php foreach ($AccountGroups as $group) : ?>
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
|
||||||
<td class="group-name"><b><?php //echo $group->acgroup_name;
|
|
||||||
?></b></td>
|
|
||||||
<td class="group-total text-right"><?php //echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0);
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="group-details p-0" width="85%">
|
<td colspan="2" class="p-0">
|
||||||
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
// Update column totals
|
// Update column totals
|
||||||
@ -237,12 +266,41 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
|
$incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
|
||||||
$incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
$incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<tfoot>
|
||||||
|
<?php $PL = $incomes_totalClosingCr - $incomes_totalClosingDr; ?>
|
||||||
|
<tr>
|
||||||
|
<td class="p-1">Total Incomes</th>
|
||||||
|
<td class="cr closing-cr text-bold">
|
||||||
|
<?php if ($PL > 0) : ?>
|
||||||
|
<?php echo myCurrency($incomes_totalClosingCr); ?>
|
||||||
|
<?php else : ?>
|
||||||
|
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</div>
|
||||||
<td colspan="2" class="p-0">
|
</div>
|
||||||
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?>
|
<div class="col-6 p-0">
|
||||||
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
<div class="table-responsive">
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="group-name pl-1">Particulars</th>
|
||||||
|
<th class="group-total text-center col-1">Amount</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalancesNew(4, $fiscalStart, $fiscalEnd); ?>
|
||||||
<?php
|
<?php
|
||||||
// Initialize variables for column totals
|
// Initialize variables for column totals
|
||||||
$totalOpeningDr = 0;
|
$totalOpeningDr = 0;
|
||||||
@ -253,15 +311,9 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$totalClosingCr = 0;
|
$totalClosingCr = 0;
|
||||||
?>
|
?>
|
||||||
<?php foreach ($AccountGroups as $group) : ?>
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
|
|
||||||
<td class="group-name" width="85%"> <?php //echo $group->acgroup_name;
|
|
||||||
?></td>
|
|
||||||
<td class="group-total" width="15%"><?php //echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0);
|
|
||||||
?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="group-details p-0">
|
<td colspan="2" class="p-0">
|
||||||
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
|
<div id="group_<?php echo $group->acgroup_id; ?>" class="">
|
||||||
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
|
||||||
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
|
||||||
</i>
|
</i>
|
||||||
@ -278,79 +330,54 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
|
||||||
?>
|
?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
|
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
|
||||||
<?php if ($incomes_totalClosingCr > $totalClosingDr) : ?>
|
<?php if ($incomes_totalClosingCr > $totalClosingDr) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="15%">
|
<!-- <th></th>
|
||||||
</td>
|
<th></th> -->
|
||||||
<td colspan="2" class="p-0">
|
<th class="pl-1">Total Profit</th>
|
||||||
<table class="table table-bordered">
|
<th class="cr closing-cr text-right text-bold"><?php echo myCurrency($PL); ?></th>
|
||||||
<tr>
|
|
||||||
<th>Total Profit</th>
|
|
||||||
<th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php else : ?>
|
|
||||||
<tr>
|
|
||||||
<td colspan="2" class="p-0">
|
|
||||||
<table class="table table-bordered">
|
|
||||||
<tr>
|
|
||||||
<th>Total Loss</th>
|
|
||||||
<th class="cr closing-cr"><?php echo myCurrency(abs($PL)); ?></th>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
<td colspan="2">
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<tr>
|
</tbody>
|
||||||
<td colspan="2" class="p-0">
|
<tfoot>
|
||||||
<table class="table table-bordered">
|
<th class="pl-1">Total Expenses</th>
|
||||||
<tr>
|
<th class="dr closing-dr text-bold">
|
||||||
<th>Total Incomes</th>
|
|
||||||
<th class="cr closing-cr">
|
|
||||||
<?php if ($PL > 0) : ?>
|
|
||||||
<?php echo myCurrency($incomes_totalClosingCr); ?>
|
|
||||||
<?php else : ?>
|
|
||||||
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
<td colspan="2" class="p-0">
|
|
||||||
<table class="table table-bordered">
|
|
||||||
<tr>
|
|
||||||
<th>Total Expenses</th>
|
|
||||||
<th class="dr closing-dr">
|
|
||||||
<?php if ($PL > 0) : ?>
|
<?php if ($PL > 0) : ?>
|
||||||
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
|
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php echo myCurrency($totalClosingDr); ?>
|
<?php echo myCurrency($totalClosingDr); ?>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tfoot>
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
function footerfunctions()
|
function footerfunctions()
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
// Trigger click event on page load
|
// Trigger click event on page load
|
||||||
@ -417,6 +444,42 @@ function footerfunctions()
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -8,7 +8,6 @@ $ExpenseAccounts = $this->acc->getAccountsByGroup(4);
|
|||||||
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
|
||||||
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
|
||||||
$PL = $IncomesTotal - $ExpensesTotal;
|
$PL = $IncomesTotal - $ExpensesTotal;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
table,
|
table,
|
||||||
@ -91,86 +90,75 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
box-shadow: inset 0 0 0 transparent;
|
box-shadow: inset 0 0 0 transparent;
|
||||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||||
}
|
}
|
||||||
.table.table-head-fixed thead tr:nth-child(1) th{
|
|
||||||
padding-left: 6px;;
|
.table.table-head-fixed thead tr:nth-child(1) th {
|
||||||
|
padding-left: 6px;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card card-primary card-outline ">
|
<div class="card card-primary card-outline ">
|
||||||
|
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title mt-1">Receipts And Payments <?php //echo $pageTitle;
|
<h3 class="card-title mt-1">Receipts And Payments <?php //echo $pageTitle;
|
||||||
?> </h3>
|
?> </h3>
|
||||||
|
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action=<?php echo base_url('accounts/reports/receipt_and_payment'); ?> id="FilterForm">
|
||||||
|
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
Filters
|
Filters
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" role="menu">
|
<div class="dropdown-menu" role="menu">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
|
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" name="showOB" value="not">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-danger btn-sm " data-toggle="dropdown" data-offset="-52">
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
Export
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
<a href="#" class="dropdown-item">Pdf</a>
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
@ -179,9 +167,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> -->
|
<!-- <button type="button" class="btn btn-warning btn-sm" onclick="resetForm()">Reset</button> -->
|
||||||
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
@ -195,39 +181,43 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
</div>
|
</div>
|
||||||
<!-- /.card-tools -->
|
<!-- /.card-tools -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="card-body">
|
<!-- <div class="card-body">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action="" id="FilterForm">
|
||||||
<div class="row align-items-end">
|
<div class="row align-items-end">
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php //myLang("Starting Period");
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
?></label>
|
||||||
|
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php //echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from);
|
||||||
|
?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php //myLang("Ending Period");
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
?></label>
|
||||||
|
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php //echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to);
|
||||||
|
?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-1 text-center">
|
<div class="col-1 text-center">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="showOB"><?php myLang("Opening"); ?></label>
|
<label for="showOB"><?php //myLang("Opening");
|
||||||
|
?></label>
|
||||||
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-1 text-center">
|
<div class="col-1 text-center">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="showClosing"><?php myLang("Closing"); ?></label>
|
<label for="showClosing"><?php //myLang("Closing");
|
||||||
|
?></label>
|
||||||
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-1 text-center">
|
<div class="col-1 text-center">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="showPeriod"><?php myLang("Period"); ?></label>
|
<label for="showPeriod"><?php //myLang("Period");
|
||||||
|
?></label>
|
||||||
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -240,9 +230,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
document.getElementById("fromDate").value = "2078-4-1";
|
document.getElementById("fromDate").value = "2078-4-1";
|
||||||
@ -252,23 +240,20 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
document.getElementById("FilterForm").submit();
|
document.getElementById("FilterForm").submit();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
|
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses($fiscalStart, $fiscalEnd) ?>
|
||||||
<table class="table table-head-fixed table-bordered g-0">
|
<table id='myTable' class="table table-head-fixed table-bordered g-0" id="TrialBalanceTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="" width="35%"><?php myLang("Receipts"); ?></th>
|
<th class="" width="30%"><?php myLang("Receipts"); ?></th>
|
||||||
<th class="text-right" width="15%"></th>
|
<th class="text-right" width="10%"></th>
|
||||||
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th>
|
<th class="text-right pr-2" width="10%"><?php myLang("Amount"); ?></th>
|
||||||
<th class="" width="35%"><?php echo myLang("Payments"); ?></th>
|
<th class="" width="30%"><?php echo myLang("Payments"); ?></th>
|
||||||
<th class="text-right" width="15%"></th>
|
<th class="text-right" width="10%"></th>
|
||||||
<th class="text-right pr-2" width="15%"><?php myLang("Amount"); ?></th>
|
<th class="text-right pr-2" width="10%"><?php myLang("Amount"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -276,33 +261,34 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<td colspan=3 class="p-0">
|
<td colspan=3 class="p-0">
|
||||||
<table class="table g-0">
|
<table class="table g-0">
|
||||||
<?php $total1 = 0;
|
<?php $total1 = 0;
|
||||||
|
$counter = 0;
|
||||||
|
$index = 0;
|
||||||
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
|
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
|
||||||
|
|
||||||
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
|
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
|
||||||
<!--tr>
|
<!--tr>
|
||||||
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
|
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
|
||||||
<td width="15%"></td>
|
<td width="15%"></td>
|
||||||
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
|
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
|
||||||
|
|
||||||
</tr-->
|
</tr-->
|
||||||
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
|
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
|
||||||
<tr>
|
<?php $index++; ?>
|
||||||
<td class="" width="70%"><b><?php echo $Incomes['category']; ?></b></td>
|
<tr class="parent-row" class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $index; ?>">
|
||||||
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
<td class="" width="60%"><b><?php echo $Incomes['category']; ?></b></td>
|
||||||
<td width="15%"></td>
|
<td width="20%"></td>
|
||||||
|
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php $total1 += $Incomes['amount']; ?>
|
<?php $total1 += $Incomes['amount']; ?>
|
||||||
<tr>
|
<tr class="collapse" data-target="#group_<?php echo $index; ?>">
|
||||||
<td class="pr-2" width="70%"> <?php echo $Incomes['account']; ?></td>
|
<td class="pr-2" width="60%">
|
||||||
<td width="15%"></td>
|
<?php echo $Incomes['account']; ?>
|
||||||
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
</td>
|
||||||
|
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
|
||||||
|
<td width="20%"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php $counter = $index ?>
|
||||||
<?php }; ?>
|
<?php }; ?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td colspan=3 class="p-0">
|
<td colspan=3 class="p-0">
|
||||||
@ -314,32 +300,26 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
|
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
|
||||||
<td width="15%"></td>
|
<td width="15%"></td>
|
||||||
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
|
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
|
||||||
|
|
||||||
|
|
||||||
</tr-->
|
</tr-->
|
||||||
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
|
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
|
||||||
<tr>
|
<?php $counter++; ?>
|
||||||
<td class="pr-2" width="70%"><b><?php echo $Expenses['category']; ?></b></td>
|
<tr data-toggle="collapse" data-target="#group_<?php echo $counter; ?>">
|
||||||
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
<td class="pr-2" width="60%"><b><?php echo $Expenses['category']; ?></b></td>
|
||||||
<td width="15%"></td>
|
<td width="20%"></td>
|
||||||
|
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php $total += $Expenses['amount']; ?>
|
<?php $total += $Expenses['amount']; ?>
|
||||||
<tr>
|
<tr class="collapse" data-target="#group_<?php echo $counter; ?>">
|
||||||
<td class="" width="70%"> <?php echo $Expenses['account']; ?></td>
|
<td class="" width="60%">
|
||||||
<td width="15%"></td>
|
|
||||||
<td class="text-right pr-2" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
<?php echo $Expenses['account']; ?>
|
||||||
|
</td>
|
||||||
|
<td class="text-right pr-2" width="20%"><?php echo myCurrency($Expenses['amount']); ?></td>
|
||||||
|
<td width="20%"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php }; ?>
|
<?php }; ?>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -362,9 +342,7 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<th></th>
|
<th></th>
|
||||||
<td class="pr-2"><?php echo myCurrency($balance_fi); ?></td>
|
<td class="pr-2"><?php echo myCurrency($balance_fi); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th class="pl-2">Total</th>
|
<th class="pl-2">Total</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
@ -374,21 +352,70 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
<td class="pr-2"><?php echo myCurrency($total); ?></td>
|
<td class="pr-2"><?php echo myCurrency($total); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div><!-- /.container-fluid -->
|
</div><!-- /.container-fluid -->
|
||||||
</section>
|
</section>
|
||||||
|
<?php function footerFunctions()
|
||||||
|
{ ?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// var exportButton = document.getElementById("exportButton");
|
||||||
|
// exportButton.addEventListener("click", function() {
|
||||||
|
// exportTableToCSV("table.csv");
|
||||||
|
// });
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Trigger click event on page load
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
<?php function footerFunctions()
|
function exportTableToCSV(filename) {
|
||||||
{ ?>
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$("#fromDate").nepaliDatePicker({
|
$("#fromDate").nepaliDatePicker({
|
||||||
dateFormat: "%y-%m-%d",
|
dateFormat: "%y-%m-%d",
|
||||||
@ -405,4 +432,41 @@ $PL = $IncomesTotal - $ExpensesTotal;
|
|||||||
maxDate: $('#toDate').data('end'),
|
maxDate: $('#toDate').data('end'),
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
|
|
||||||
|
<?php } ?>
|
@ -25,7 +25,7 @@
|
|||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?>
|
<h5 class="m-0 card-title"><?php echo $pageTitle; ?>
|
||||||
<!-- <a href="<?php //echo site_url("accounts/setup/addsingleentryvoucher"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle; ?></a> -->
|
<!-- <a href="<?php //echo site_url("accounts/setup/addsingleentryvoucher"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle; ?></a> -->
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
@ -34,15 +34,15 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<?php $TableData = $this->db->query("select * from tbl_vouchertypes")->result(); ?>
|
<?php $TableData = $this->db->query("select * from tbl_vouchertypes")->result(); ?>
|
||||||
<table class="table table-bordered table-striped dataTable">
|
<table class="table table-bordered table-striped longdataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th >Sn</th>
|
<th class="text-center">Sn</th>
|
||||||
<th class="col-2">Voucher Name</th>
|
<th class="col-2">Voucher Name</th>
|
||||||
<th class="col-4">Default Debits</th>
|
<th class="col-4">Default Debits</th>
|
||||||
<th class="col-4">Default Credits</th>
|
<th class="col-4">Default Credits</th>
|
||||||
<th class="col-1 text-center">Voucher Color</th>
|
<th class="col-1 text-center">Voucher Color</th>
|
||||||
<th class="table-col col-1 text-center">Action</th>
|
<th class=" text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<?php foreach ($TableRow as $cols) : $id = $cols;
|
<?php foreach ($TableRow as $cols) : $id = $cols;
|
||||||
break;
|
break;
|
||||||
endforeach; ?><tr class="<?php echo ($TableRow->status == 0) ? "table-danger" : ""; ?>">
|
endforeach; ?><tr class="<?php echo ($TableRow->status == 0) ? "table-danger" : ""; ?>">
|
||||||
<td><?php echo $sn; ?></td>
|
<td class="text-center"><?php echo $sn; ?></td>
|
||||||
<td><?php echo $TableRow->voucher_name; ?></td>
|
<td><?php echo $TableRow->voucher_name; ?></td>
|
||||||
<td><?php echo showAccountCategoriesByIds(($TableRow->default_debits!="")?explode(",",$TableRow->default_debits):array()); ?></td>
|
<td><?php echo showAccountCategoriesByIds(($TableRow->default_debits!="")?explode(",",$TableRow->default_debits):array()); ?></td>
|
||||||
<td><?php echo showAccountCategoriesByIds(($TableRow->default_credits!="")?explode(",",$TableRow->default_credits):array()); ?></td>
|
<td><?php echo showAccountCategoriesByIds(($TableRow->default_credits!="")?explode(",",$TableRow->default_credits):array()); ?></td>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
$this->load->library("BIBAccounts");
|
$this->load->library("BIBAccounts");
|
||||||
$BIBAccounts = new BIBAccounts();
|
$BIBAccounts = new BIBAccounts();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- Include jQuery -->
|
<!-- Include jQuery -->
|
||||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||||
@ -21,6 +22,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
|
|
||||||
.group-total {
|
.group-total {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-gray {
|
.table-gray {
|
||||||
@ -31,9 +33,10 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
.table th {
|
.table th {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-darker {
|
.table t .bg-darker {
|
||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,6 +75,10 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-right {
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.form-control {
|
.form-control {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -88,16 +95,21 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
box-shadow: inset 0 0 0 transparent;
|
box-shadow: inset 0 0 0 transparent;
|
||||||
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-gray tr th {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h2 class="card-title mt-1"><?php echo $pageTitle; ?> <?php //myLang("Report"); ?></h2>
|
<h2 class="card-title mt-1"><?php echo $pageTitle; ?> <?php //myLang("Report");
|
||||||
|
?></h2>
|
||||||
|
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action=<?php echo site_url('/Accounts/Reports/trialbalance'); ?> id="FilterForm">
|
||||||
|
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@ -105,55 +117,53 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
Filters
|
Filters
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" role="menu">
|
<div class="dropdown-menu" role="menu">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
|
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input type="hidden" name="showOB" value="not">
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
<button type="button" class="btn btn-info btn-sm " onclick="resetForm()">Reset</button>
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2 btn-sm text-center">Search </button>
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="submit" class="btn btn-warning btn-sm" data-toggle="dropdown" data-offset="-52">
|
<!-- <button type="submit" class="btn btn-warning btn-sm" data-toggle="dropdown" data-offset="-52">
|
||||||
Export
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
@ -203,12 +213,12 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
$showZeroBalances = false;
|
$showZeroBalances = false;
|
||||||
?>
|
?>
|
||||||
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(); ?>
|
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(); ?>
|
||||||
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
<table id='myTable' class="table table-bordered vertical-borders" id="TrialBalanceTable">
|
||||||
<thead class="bg-gray">
|
<thead class="bg-gray">
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">Particulars</th>
|
<th rowspan="2 class="">Particulars</th>
|
||||||
<?php if ($ReportOptions['showOB']) : ?>
|
<?php if ($ReportOptions['showOB']) : ?>
|
||||||
<th colspan="2" class="text-center">Opening</th>
|
<th colspan=" 2" class="text-center">Opening</th>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($ReportOptions['showPeriod']) : ?>
|
<?php if ($ReportOptions['showPeriod']) : ?>
|
||||||
<th colspan="2" class="text-center">Current Period</th>
|
<th colspan="2" class="text-center">Current Period</th>
|
||||||
@ -249,7 +259,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<?php if ($ReportOptions['showOB']) : ?>
|
<?php if ($ReportOptions['showOB']) : ?>
|
||||||
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->opening_balance : 0);
|
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->opening_balance : 0);
|
||||||
?></td>
|
?></td>
|
||||||
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "CR") ? $group->opening_balance : 0);
|
<td class="group-total "><?php // echo myCurrency(($group->posting_side == "CR") ? $group->opening_balance : 0);
|
||||||
?></td>
|
?></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ($ReportOptions['showPeriod']) : ?>
|
<?php if ($ReportOptions['showPeriod']) : ?>
|
||||||
@ -312,6 +322,14 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
function footerfunctions()
|
function footerfunctions()
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
// var exportButton = document.getElementById("exportButton");
|
// var exportButton = document.getElementById("exportButton");
|
||||||
// exportButton.addEventListener("click", function() {
|
// exportButton.addEventListener("click", function() {
|
||||||
@ -377,6 +395,43 @@ function footerfunctions()
|
|||||||
maxDate: $('#toDate').data('end'),
|
maxDate: $('#toDate').data('end'),
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -99,7 +99,7 @@ button:hover {
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<h1 class="text-center"><?php echo $pageTitle; ?> Voucher</h1>
|
<h1 class="text-center"><?php echo $pageTitle; ?></h1>
|
||||||
<!-- <fieldset>
|
<!-- <fieldset>
|
||||||
<legend><span id="selectedAccountName"></span> Balance</legend><span id="selectedAccountBalance" style="padding: 6px 0px; display: inline-block; text-align: right; width: 100%;">Choose A/C First</span>
|
<legend><span id="selectedAccountName"></span> Balance</legend><span id="selectedAccountBalance" style="padding: 6px 0px; display: inline-block; text-align: right; width: 100%;">Choose A/C First</span>
|
||||||
</fieldset> -->
|
</fieldset> -->
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="GET" action="">
|
<form method="GET" action="">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -26,11 +21,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "Account", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : ''); //fillComboWithValue("account_id","Account","account_id","tbl_accounts","account_name","account_id",isset($_GET['account_id'])?$_GET['account_id']:'');
|
<!-- <div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "Account", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : ''); //fillComboWithValue("account_id","Account","account_id","tbl_accounts","account_name","account_id",isset($_GET['account_id'])?$_GET['account_id']:'');
|
||||||
?></div> -->
|
?></div> -->
|
||||||
|
|
||||||
<div class="col-2"><?php createNepaliDateInput("from_date", "From Date", "from_date", isset($fromDate_bs) ? $fromDate_bs : FYStart()); ?></div>
|
<div class="col-2"><?php createNepaliDateInput("from_date", "From Date", "from_date", isset($fromDate_bs) ? $fromDate_bs : FYStart()); ?></div>
|
||||||
<div class="col-2"><?php createNepaliDateInput("to_date", "To Date", "to_date", isset($toDate_bs) ? $toDate_bs : FYEnd()); ?></div>
|
<div class="col-2"><?php createNepaliDateInput("to_date", "To Date", "to_date", isset($toDate_bs) ? $toDate_bs : FYEnd()); ?></div>
|
||||||
<div class="col-1"><?php createButton("show_voucher", "Show", "show_voucher", "Submit", "mt-30"); ?></div>
|
<div class="col-1"><?php createButton("show_voucher", "Show", "show_voucher", "Submit", "mt-26"); ?></div>
|
||||||
<div class="col-1"><?php createButton("show_voucher_reset", "Reset", "reset", site_url("accounts/vouchers/listvouchers"), "mt-30"); ?></div>
|
<div class="col-1"><?php createButton("show_voucher_reset", "Reset", "reset", site_url("accounts/vouchers/listvouchers"), "mt-26"); ?></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div id="dataTable_Commands"></div>
|
<div id="dataTable_Commands"></div>
|
||||||
@ -40,10 +34,8 @@
|
|||||||
// echo $toDate;
|
// echo $toDate;
|
||||||
$account_id = isset($_GET['account_id']) ? $_GET['account_id'] : '';
|
$account_id = isset($_GET['account_id']) ? $_GET['account_id'] : '';
|
||||||
$vouchertype_id = isset($_GET['vouchertypes']) ? $_GET['vouchertypes'] : '';
|
$vouchertype_id = isset($_GET['vouchertypes']) ? $_GET['vouchertypes'] : '';
|
||||||
$this->myaccounts->listVouchers($fromDate, $toDate, $account_id, $vouchertype_id, true);
|
$this->myaccounts->listVouchers($fromDate, $toDate, $account_id, $vouchertype_id, true, false, $fiscalStart, $fiscalEnd);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,3 +43,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<!-- <?php echo isset($item) ? 'Edit' : 'Create'; ?> -->
|
<!-- <?php echo isset($item) ? 'Edit' : 'Create'; ?> -->
|
||||||
<h5 class="m-0">Create <?php echo $pageTitle; ?>
|
<h5 class="m-0 card-title">Create <?php echo $pageTitle; ?>
|
||||||
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle);
|
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle);
|
||||||
?>
|
?>
|
||||||
</h5>
|
</h5>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0">
|
<h5 class="m-0 card-title">
|
||||||
Current Fiscal Year :
|
Current Fiscal Year :
|
||||||
<?php $currentFiscalYear = showFiscalYear(); ?>
|
<?php $currentFiscalYear = showFiscalYear(); ?>
|
||||||
|
|
||||||
@ -95,12 +95,12 @@
|
|||||||
<table class="table table-bordered table-striped longdataTable">
|
<table class="table table-bordered table-striped longdataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Fiscal Year </th>
|
<th class="col-2">Fiscal Year </th>
|
||||||
<th> Code</th>
|
<th class="col-4"> Code</th>
|
||||||
<th>From</th>
|
<th>From</th>
|
||||||
<th>To</th>
|
<th>To</th>
|
||||||
<!-- <th>Created By</th> -->
|
<!-- <th>Created By</th> -->
|
||||||
<th>Action</th>
|
<th class="col-1 text-center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -115,7 +115,7 @@
|
|||||||
<td><?php echo $TableRow->fiscalyear_to; ?></td>
|
<td><?php echo $TableRow->fiscalyear_to; ?></td>
|
||||||
<!-- <td><?php //echo $TableRow->created_by;
|
<!-- <td><?php //echo $TableRow->created_by;
|
||||||
?></td> -->
|
?></td> -->
|
||||||
<td>
|
<td class="text-center">
|
||||||
<!-- <?php //showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?> -->
|
<!-- <?php //showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?> -->
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<title><?php echo myLang($this->config->item("ProjectTitle")); ?> >> <?php echo isset($pageTitle)?$pageTitle:" | Dashboard"; ?></title>
|
<title><?php echo myLang($this->config->item("ProjectTitle")); ?> >> <?php echo isset($pageTitle) ? $pageTitle : " | Dashboard"; ?></title>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
||||||
@ -39,6 +39,80 @@
|
|||||||
<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
|
<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
|
||||||
<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/bstreeview/css/bstreeview.min.css">
|
<link rel="stylesheet" href="<?php echo base_url(); ?>plugins/bstreeview/css/bstreeview.min.css">
|
||||||
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/bbnepalcustom.css">
|
<link rel="stylesheet" href="<?php echo base_url(); ?>dist/css/bbnepalcustom.css">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- CSV File create -->
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// document.getElementById('downloadBtn').addEventListener('click', function() {
|
||||||
|
// const table = document.getElementById('myTable');
|
||||||
|
// const csvData = [];
|
||||||
|
// const rowCount = table.rows.length;
|
||||||
|
// const output = [];
|
||||||
|
|
||||||
|
// for (let i = 0; i < rowCount; i++) {
|
||||||
|
// const row = table.rows[i];
|
||||||
|
// const rowArray = [];
|
||||||
|
// let skipCell = 0;
|
||||||
|
|
||||||
|
// for (let j = 0; j < row.cells.length; j++) {
|
||||||
|
// const cell = row.cells[j];
|
||||||
|
|
||||||
|
// if (skipCell > 0) {
|
||||||
|
// skipCell--;
|
||||||
|
// continue; // Skip this cell due to rowspan
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const cellContent = cell.textContent.trim();
|
||||||
|
// const colspan = cell.colSpan || 1;
|
||||||
|
// const rowspan = cell.rowSpan || 1;
|
||||||
|
|
||||||
|
// // Fill the rowArray for the colspan
|
||||||
|
// for (let k = 0; k < colspan; k++) {
|
||||||
|
// if (k === colspan - 1) {
|
||||||
|
// rowArray.push(cellContent); // Last cell of colspan gets content
|
||||||
|
// } else {
|
||||||
|
// rowArray.push(''); // Fill empty for additional colspan cells
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Set skipCell to account for rowspan
|
||||||
|
// skipCell = rowspan - 1;
|
||||||
|
|
||||||
|
// // Ensure that the row length matches the maximum number of columns
|
||||||
|
// while (rowArray.length < output.length) {
|
||||||
|
// rowArray.push(''); // Fill empty cells
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Fill the output structure
|
||||||
|
// output[i] = rowArray;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Join rows for CSV format
|
||||||
|
// output.forEach(row => {
|
||||||
|
// const filledRow = row.map(cell => cell === undefined ? '' : cell);
|
||||||
|
// csvData.push(filledRow.join(','));
|
||||||
|
// });
|
||||||
|
|
||||||
|
// const csvContent = csvData.join('\n');
|
||||||
|
// const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
|
||||||
|
// const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
// const link = document.createElement('a');
|
||||||
|
// link.setAttribute('href', url);
|
||||||
|
// link.setAttribute('download', 'table_with_colspan_rowspan.csv');
|
||||||
|
// document.body.appendChild(link);
|
||||||
|
// link.click();
|
||||||
|
// document.body.removeChild(link);
|
||||||
|
// });
|
||||||
|
</script>
|
||||||
|
<!-- csv printing ends -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Override Defaults By Prajwal -->
|
<!-- Override Defaults By Prajwal -->
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@ -301,12 +375,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.narration_display
|
|
||||||
{
|
.narration_display {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
.text-bold .currency
|
|
||||||
{
|
.text-bold .currency {
|
||||||
font-weight: 600 !important;
|
font-weight: 600 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
<!-- Navbar -->
|
<!-- Navbar -->
|
||||||
|
|
||||||
<nav class="main-header navbar navbar-expand navbar-white navbar-light ">
|
<nav class="main-header navbar navbar-expand navbar-white navbar-light hidden-navbar ">
|
||||||
|
|
||||||
<!-- Left navbar links -->
|
<!-- Left navbar links -->
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ $subparam2 = $this->uri->segment(4);
|
|||||||
<!-- Sidebar user panel (optional) -->
|
<!-- Sidebar user panel (optional) -->
|
||||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||||
<div class="image"> <img src="<?php echo base_url(); ?>dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> </div>
|
<div class="image"> <img src="<?php echo base_url(); ?>dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> </div>
|
||||||
<div class="info"> <a href="#" class="d-block"><?php echo $this->session->userdata("CompanyName"); ?> (<?php echo ($this->session->userdata("FiscalYear")->fiscalyear_year); ?>)</a></div>
|
<div class="info"> <a href="#" class="d-block"><?php echo $this->session->userdata("CompanyName"); ?> (<?php echo ($this->session->userdata("FiscalYear")?->fiscalyear_year); ?>)</a></div>
|
||||||
</div> <!-- SidebarSearch Form -->
|
</div> <!-- SidebarSearch Form -->
|
||||||
<div class="form-inline pb-2">
|
<div class="form-inline pb-2">
|
||||||
<div class="input-group" data-widget="sidebar-search">
|
<div class="input-group" data-widget="sidebar-search">
|
||||||
@ -50,14 +50,14 @@ $subparam2 = $this->uri->segment(4);
|
|||||||
<!-- <li class="nav-item"><a href="<?php echo site_url("master/acgroups"); ?>" class="nav-link <?php echo ($param == "acgroups") ? "active" : ""; ?>">
|
<!-- <li class="nav-item"><a href="<?php echo site_url("master/acgroups"); ?>" class="nav-link <?php echo ($param == "acgroups") ? "active" : ""; ?>">
|
||||||
<p>Account Types</p>
|
<p>Account Types</p>
|
||||||
</a></li> -->
|
</a></li> -->
|
||||||
<li class="nav-item"><a href="<?php echo site_url("master/accategories/parent");
|
<!-- <li class="nav-item"><a href="<?php echo site_url("master/accategories/parent");
|
||||||
?>" class="nav-link <?php echo (($param == "accategories" && $subparam == "parent") ||
|
?>" class="nav-link <?php echo (($param == "accategories" && $subparam == "parent") ||
|
||||||
($param == "accategories" && $subparam == "edit_parent") ||
|
($param == "accategories" && $subparam == "edit_parent") ||
|
||||||
($param == "accategories" && $subparam == "add_parent")
|
($param == "accategories" && $subparam == "add_parent")
|
||||||
) ? "active" : "";
|
) ? "active" : "";
|
||||||
?>">
|
?>">
|
||||||
<p>Account Categories</p>
|
<p>Account Categories</p>
|
||||||
</a></li>
|
</a></li> -->
|
||||||
<li class="nav-item"><a href="<?php echo site_url("master/accategories/childs"); ?>" class="nav-link <?php echo (($param == "accategories" && $subparam == "childs") ||
|
<li class="nav-item"><a href="<?php echo site_url("master/accategories/childs"); ?>" class="nav-link <?php echo (($param == "accategories" && $subparam == "childs") ||
|
||||||
($param == "accategories" && $subparam == "add_child") ||
|
($param == "accategories" && $subparam == "add_child") ||
|
||||||
($param == "accategories" && $subparam == "edit_child")
|
($param == "accategories" && $subparam == "edit_child")
|
||||||
@ -116,7 +116,7 @@ $subparam2 = $this->uri->segment(4);
|
|||||||
<?php if ($LoggedUser == "admin") : ?>
|
<?php if ($LoggedUser == "admin") : ?>
|
||||||
<?php foreach ($VoucherTypes as $VoucherType) : if ($VoucherType->voucher_alias != "sales" && $VoucherType->voucher_alias != "purchase") : ?>
|
<?php foreach ($VoucherTypes as $VoucherType) : if ($VoucherType->voucher_alias != "sales" && $VoucherType->voucher_alias != "purchase") : ?>
|
||||||
<li class="nav-item"><a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="nav-link <?php echo ($subparam == $VoucherType->voucher_alias && $subparam2 == "create") ? "active" : ""; ?>">
|
<li class="nav-item"><a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="nav-link <?php echo ($subparam == $VoucherType->voucher_alias && $subparam2 == "create") ? "active" : ""; ?>">
|
||||||
<p><?php echo $VoucherType->voucher_name; ?> Voucher</p>
|
<p><?php echo $VoucherType->voucher_name; ?></p>
|
||||||
</a></li>
|
</a></li>
|
||||||
<?php endif;
|
<?php endif;
|
||||||
endforeach; ?>
|
endforeach; ?>
|
||||||
@ -160,7 +160,7 @@ $subparam2 = $this->uri->segment(4);
|
|||||||
showMenu("Profit and Loss Statement", "accounts/reports/pl");
|
showMenu("Profit and Loss Statement", "accounts/reports/pl");
|
||||||
showMenu("Balance Sheet", "accounts/reports/balance_sheet");
|
showMenu("Balance Sheet", "accounts/reports/balance_sheet");
|
||||||
// showMenu("Balance Sheet (Vertical)", "accounts/reports/balance_sheet_vertical");
|
// showMenu("Balance Sheet (Vertical)", "accounts/reports/balance_sheet_vertical");
|
||||||
showMenu("Receipt And Payment", "accounts/reports/receipt_and_payment");
|
showMenu("Receipt and Payment", "accounts/reports/receipt_and_payment");
|
||||||
// showMenu("Income And Expenses", "accounts/reports/incomes_and_expenses");
|
// showMenu("Income And Expenses", "accounts/reports/incomes_and_expenses");
|
||||||
showMenu("Cash Flow", "accounts/reports/cash_flow");
|
showMenu("Cash Flow", "accounts/reports/cash_flow");
|
||||||
showMenu("Ratio Analysis", "accounts/reports/ratio_analysis");
|
showMenu("Ratio Analysis", "accounts/reports/ratio_analysis");
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
<th width="30%"><?php myLang('Inventory Group'); ?></th>
|
<th width="30%"><?php myLang('Inventory Group'); ?></th>
|
||||||
<!-- <th width="5%"><?php //myLang('Unit'); ?></th> -->
|
<!-- <th width="5%"><?php //myLang('Unit'); ?></th> -->
|
||||||
<th width="57%"><?php myLang('Remarks'); ?></th>
|
<th width="57%"><?php myLang('Remarks'); ?></th>
|
||||||
<td width="8%"><?php myLang("Action"); ?></th>
|
<td class="text-center col-1"><?php myLang("Action"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -100,11 +100,11 @@
|
|||||||
<?php foreach ($TableRow as $cols) : $id = $cols;
|
<?php foreach ($TableRow as $cols) : $id = $cols;
|
||||||
break;
|
break;
|
||||||
endforeach; ?><tr>
|
endforeach; ?><tr>
|
||||||
<td><?php echo $a; ?></td>
|
<td class="text-center"><?php echo $a; ?></td>
|
||||||
<td><?php echo $TableRow->title; ?></td>
|
<td><?php echo $TableRow->title; ?></td>
|
||||||
<!-- <td><?php //echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td> -->
|
<!-- <td><?php //echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td> -->
|
||||||
<td><?php echo $TableRow->description; ?></td>
|
<td><?php echo $TableRow->description; ?></td>
|
||||||
<td>
|
<td class="text-center">
|
||||||
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
||||||
<?php showDeleteButton($id); ?>
|
<?php showDeleteButton($id); ?>
|
||||||
</td>
|
</td>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php fillComboWithValue("units_id", "Units <span class='text-danger'>*</span>", "units_id", "tbl_units", "title", "unit_id", isset($item) ? $item->units_id : '',); ?>
|
<?php fillComboWithValue("units_id", "Units <span class='text-danger'>*</span>", "units_id", "tbl_units", "title", "unit_id", isset($item) ? $item->units_id : '', "", false, "", true); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--COL END-->
|
<!--COL END-->
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<!--COL START-->
|
<!--COL START-->
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php fillComboWithValue("itemcategories_id", "Group <span class='text-danger'>*</span>", "itemcategories_id", "tbl_itemcategories", "title", "itemcategory_id", isset($item) ? $item->itemcategories_id : ''); ?>
|
<?php fillComboWithValue("itemcategories_id", "Group <span class='text-danger'>*</span>", "itemcategories_id", "tbl_itemcategories", "title", "itemcategory_id", isset($item) ? $item->itemcategories_id : '', "", false, "", true); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--COL END-->
|
<!--COL END-->
|
||||||
@ -117,7 +117,7 @@
|
|||||||
<table class="table table-bordered table-striped longdataTable">
|
<table class="table table-bordered table-striped longdataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="5%"><?php myLang('S.N'); ?></th>
|
<th width="5%" class="text-center"><?php myLang('S.N'); ?></th>
|
||||||
<th width="25%"><?php myLang('Name'); ?></th>
|
<th width="25%"><?php myLang('Name'); ?></th>
|
||||||
<th width="10%"><?php myLang('Code'); ?></th>
|
<th width="10%"><?php myLang('Code'); ?></th>
|
||||||
<th width="10%"><?php myLang('Units'); ?></th>
|
<th width="10%"><?php myLang('Units'); ?></th>
|
||||||
@ -125,7 +125,7 @@
|
|||||||
<th width="10%" class="text-right"><?php myLang('Qty'); ?></th>
|
<th width="10%" class="text-right"><?php myLang('Qty'); ?></th>
|
||||||
<th width="10%" class="text-right"><?php myLang('Rate'); ?></th>
|
<th width="10%" class="text-right"><?php myLang('Rate'); ?></th>
|
||||||
<th width="10%" class="text-right"><?php myLang('Total'); ?></th>
|
<th width="10%" class="text-right"><?php myLang('Total'); ?></th>
|
||||||
<td width="10%" class="text-bold"><?php myLang("Action"); ?></th>
|
<td width="7%" class="col-1 text-bold text-center"><?php myLang("Action"); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -134,15 +134,18 @@
|
|||||||
<?php foreach ($TableRow as $cols) : $id = $cols;
|
<?php foreach ($TableRow as $cols) : $id = $cols;
|
||||||
break;
|
break;
|
||||||
endforeach; ?><tr>
|
endforeach; ?><tr>
|
||||||
<td><?php echo $a; ?></td>
|
<td class="text-center"><?php echo $a; ?></td>
|
||||||
<td><?php echo $TableRow->title; ?></td>
|
<td><?php echo $TableRow->title; ?></td>
|
||||||
<td><?php echo $TableRow->item_code; ?></td>
|
<td><?php echo $TableRow->item_code; ?></td>
|
||||||
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td>
|
<td><?php echo number_format((int)getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id),2); ?></td>
|
||||||
|
|
||||||
|
|
||||||
<td><?php echo getFieldfromValue("tbl_itemcategories", "title", "itemcategory_id", $TableRow->itemcategories_id); ?></td>
|
<td><?php echo getFieldfromValue("tbl_itemcategories", "title", "itemcategory_id", $TableRow->itemcategories_id); ?></td>
|
||||||
<td class="text-right"><?php echo $TableRow->Stock->qty; ?></td>
|
<td class="text-right"><?php echo number_format((int)$TableRow->Stock->qty,2); ?></td>
|
||||||
<td class="text-right"><?php echo $TableRow->Stock->rate; ?></td>
|
|
||||||
<td class="text-right"><?php echo $TableRow->Stock->amount; ?></td>
|
<td class="text-right"><?php echo number_format((int)$TableRow->Stock->rate,2); ?></td>
|
||||||
<td>
|
<td class="text-right"><?php echo number_format((int)$TableRow->Stock->amount,2); ?></td>
|
||||||
|
<td class="text-center">
|
||||||
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
||||||
<?php showDeleteButton($id); ?>
|
<?php showDeleteButton($id); ?>
|
||||||
</td>
|
</td>
|
||||||
|
@ -143,6 +143,7 @@
|
|||||||
<th class="text-right">Qty</th>
|
<th class="text-right">Qty</th>
|
||||||
<th class="text-right">Units</th>
|
<th class="text-right">Units</th>
|
||||||
<th class="text-right">Rate</th>
|
<th class="text-right">Rate</th>
|
||||||
|
<th class="text-right" width=13%>VAT<span class="text-danger">*</span></th>
|
||||||
<th class="text-right">Amount</th>
|
<th class="text-right">Amount</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -154,6 +155,8 @@
|
|||||||
<td width=10%> <input type="text" class="form-control input-group-sm" name="quantity[]"></td>
|
<td width=10%> <input type="text" class="form-control input-group-sm" name="quantity[]"></td>
|
||||||
<td width=5%><input type="text" class="form-control item_unit" name="pcs/dozen/kgs" required> </td>
|
<td width=5%><input type="text" class="form-control item_unit" name="pcs/dozen/kgs" required> </td>
|
||||||
<td width=15%><input type="text" class="form-control" name="rate[]"></td>
|
<td width=15%><input type="text" class="form-control" name="rate[]"></td>
|
||||||
|
<td><input type="number" name="vat[]" class="form-control vat" required></td>
|
||||||
|
|
||||||
<td width=15%><input type="text" class="form-control" name="total[]"></td>
|
<td width=15%><input type="text" class="form-control" name="total[]"></td>
|
||||||
<td width="5%">
|
<td width="5%">
|
||||||
<button type="button" class="btn btn-primary btn-xs addPurchaseDetail" id="addPurchaseDetail">
|
<button type="button" class="btn btn-primary btn-xs addPurchaseDetail" id="addPurchaseDetail">
|
||||||
@ -174,9 +177,9 @@
|
|||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="vatToggle">VAT</label>
|
<label for="vatToggle" class="d-none">VAT</label>
|
||||||
<input type="checkbox" id="vatToggle" checked>
|
<input class="d-none" type="checkbox" id="vatToggle" checked>
|
||||||
<input type="hidden" id="vatToggleValue" name="vatToggleValue" value="1">
|
<input type="hidden" class="d-none" id="vatToggleValue" name="vatToggleValue" value="1">
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right "><b>Total Amount</b></td>
|
<td class="text-right "><b>Total Amount</b></td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
@ -198,11 +201,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td class="text-right "><b>13% VAT</b></td>
|
<td class="text-right d-none "><b>13% VAT</b></td>
|
||||||
<td class="text-right">
|
<td class="text-right d-none">
|
||||||
<input type="text" class="form-control" name="tax" id="tax" />
|
<input type="text" class="form-control" name="tax" id="tax" />
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td>
|
||||||
|
<input type="hidden" name="vat_checkbox_value" id="vat_checkbox_value" value="0">
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-right "><b>Grand Total Amount</b></td>
|
<td class="text-right "><b>Grand Total Amount</b></td>
|
||||||
@ -404,7 +409,7 @@
|
|||||||
calculateTotals();
|
calculateTotals();
|
||||||
});
|
});
|
||||||
// Calculate totals on change of rate or quantity
|
// Calculate totals on change of rate or quantity
|
||||||
$(document).on("change", ".purchase-detail input[name^='quantity'], .purchase-detail input[name^='rate']", function() {
|
$(document).on("change", ".purchase-detail input[name^='quantity'], .purchase-detail input[name^='rate'],.purchase-detail input[name^='vat']", function() {
|
||||||
calculateRowTotal($(this).closest(".purchase-detail"));
|
calculateRowTotal($(this).closest(".purchase-detail"));
|
||||||
calculateTotals();
|
calculateTotals();
|
||||||
});
|
});
|
||||||
@ -419,6 +424,9 @@
|
|||||||
calculateTotals('amount');
|
calculateTotals('amount');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
function updateSerialNumbers(){
|
function updateSerialNumbers(){
|
||||||
$('.purchase-detail').each(function(index){
|
$('.purchase-detail').each(function(index){
|
||||||
$(this).find('.bbsn').text(index + 1);
|
$(this).find('.bbsn').text(index + 1);
|
||||||
@ -429,7 +437,15 @@
|
|||||||
function calculateRowTotal(row) {
|
function calculateRowTotal(row) {
|
||||||
var quantity = parseFloat(row.find("input[name^='quantity']").val()) || 0;
|
var quantity = parseFloat(row.find("input[name^='quantity']").val()) || 0;
|
||||||
var rate = parseFloat(row.find("input[name^='rate']").val()) || 0;
|
var rate = parseFloat(row.find("input[name^='rate']").val()) || 0;
|
||||||
var total = quantity * rate;
|
var vat = parseFloat(row.find('input[name^="vat"]').val()) || 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
var lineTotal = quantity * rate;
|
||||||
|
var vat_amt =(vat/100)*lineTotal;
|
||||||
|
var total =lineTotal + vat_amt ;
|
||||||
|
|
||||||
|
//
|
||||||
|
// var total = quantity * rate;
|
||||||
row.find("input[name^='total']").val(total.toFixed(2));
|
row.find("input[name^='total']").val(total.toFixed(2));
|
||||||
}
|
}
|
||||||
// Calculate totals
|
// Calculate totals
|
||||||
@ -441,10 +457,8 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(type=='amount'){
|
if(type=='amount'){
|
||||||
alert("amount");
|
|
||||||
discountamount = parseFloat($("input[name='discount']").val());
|
discountamount = parseFloat($("input[name='discount']").val());
|
||||||
discountpercent = (discountamount * 100) / subtotal;
|
discountpercent = (discountamount * 100) / subtotal;
|
||||||
alert(discountamount);
|
|
||||||
$("#discountpercentage").val(discountpercent.toFixed(2));
|
$("#discountpercentage").val(discountpercent.toFixed(2));
|
||||||
}else{
|
}else{
|
||||||
discountpercent = parseFloat($("input[name='discountpercentage']").val());
|
discountpercent = parseFloat($("input[name='discountpercentage']").val());
|
||||||
@ -455,18 +469,19 @@
|
|||||||
// var discountamount = subtotal * (discountpercent/100);
|
// var discountamount = subtotal * (discountpercent/100);
|
||||||
var taxable = subtotal - discountamount;
|
var taxable = subtotal - discountamount;
|
||||||
var tax = 0;
|
var tax = 0;
|
||||||
if ($('#vatToggle').is(':checked')) {
|
// if ($('#vatToggle').is(':checked')) {
|
||||||
tax = taxable * 0.13; // Include 13% VAT if checkbox is checked
|
// tax = taxable * 0.13; // Include 13% VAT if checkbox is checked
|
||||||
}
|
// }
|
||||||
var grandTotal = taxable + tax;
|
// var grandTotal = taxable + tax;
|
||||||
|
var grandTotal = taxable;
|
||||||
|
|
||||||
|
|
||||||
$("#subtotal").val(subtotal.toFixed(2));
|
$("#subtotal").val(subtotal.toFixed(2));
|
||||||
// $("#discount").val(discountamount.toFixed(2));
|
// $("#discount").val(discountamount.toFixed(2));
|
||||||
$("#taxable").val(taxable.toFixed(2));
|
$("#taxable").val(taxable.toFixed(2));
|
||||||
$("#tax").val(tax.toFixed(2));
|
$("#tax").val(tax.toFixed(2));
|
||||||
$("#grand_total").val(grandTotal.toFixed(2));
|
$("#grand_total").val(grandTotal.toFixed(2));
|
||||||
}
|
};
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php function footerFunctions()
|
<?php function footerFunctions()
|
||||||
|
@ -12,12 +12,11 @@
|
|||||||
<table class="table table-bordered table-striped dataTable">
|
<table class="table table-bordered table-striped dataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php myLang('S.N'); ?></th>
|
<th class="text-center"><?php myLang('S.N'); ?></th>
|
||||||
<th><?php myLang('Date'); ?></th>
|
<th><?php myLang('Date'); ?></th>
|
||||||
<th><?php myLang('Purchase Transaction'); ?></th>
|
<th><?php myLang('Purchase Transaction'); ?></th>
|
||||||
<th><?php myLang('Amount'); ?></th>
|
<th class="text-center"><?php myLang('Amount'); ?></th>
|
||||||
|
<td class="text-center"><b>Action</b></th>
|
||||||
<td><b>Action</b></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -28,11 +27,12 @@
|
|||||||
endforeach; ?><tr>
|
endforeach; ?><tr>
|
||||||
<td><?php echo $TableRow->purchase_ref; ?></td>
|
<td><?php echo $TableRow->purchase_ref; ?></td>
|
||||||
<td><?php echo $TableRow->purchase_date; ?></td>
|
<td><?php echo $TableRow->purchase_date; ?></td>
|
||||||
<td><b><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></b>
|
<td><b><?php echo (($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name ?? "")); ?></b>
|
||||||
<div class="row ml-2 mr-2" style="border-bottom: 1px solid;">
|
<div class="row ml-2 mr-2" style="border-bottom: 1px solid;">
|
||||||
<span class="col item_name"><?php echo myLang("Particulars") ?></span>
|
<span class="col item_name"><?php echo myLang("Particulars") ?></span>
|
||||||
<span class="col item_qty"><?php echo myLang("Qty") ?></span>
|
<span class="col item_qty"><?php echo myLang("Qty") ?></span>
|
||||||
<span class="col item_rate"><?php echo myLang("Rate") ?></span>
|
<span class="col item_rate"><?php echo myLang("Rate") ?></span>
|
||||||
|
<span class="col item_vat"><?php echo myLang("vat") ?></span>
|
||||||
<span class="col item_amount"><?php echo myLang("Amount") ?></span>
|
<span class="col item_amount"><?php echo myLang("Amount") ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php $l = 0;
|
<?php $l = 0;
|
||||||
@ -40,8 +40,9 @@
|
|||||||
<div class="row ml-2 mr-2">
|
<div class="row ml-2 mr-2">
|
||||||
<span class="col item_name"><?php echo $r->Item->title; ?></span>
|
<span class="col item_name"><?php echo $r->Item->title; ?></span>
|
||||||
<span class="col item_qty"><?php echo $r->qty; ?></span>
|
<span class="col item_qty"><?php echo $r->qty; ?></span>
|
||||||
<span class="col item_rate text-right"><?php echo myCurrency($r->rate, true); ?></span>
|
<span class="col item_rate"><?php echo myCurrency($r->rate, true); ?></span>
|
||||||
<span class="col item_amount text-right"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
|
<span class="col item_vat"><?php echo myCurrency($r->vat, true); ?></span>
|
||||||
|
<span class="col item_amount"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
|
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
|
||||||
@ -52,9 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
|
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
|
||||||
|
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
|
||||||
|
|
||||||
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
|
|
||||||
<?php showDeleteButton($id); ?>
|
<?php showDeleteButton($id); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -5,31 +5,100 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5>
|
<!-- <h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5> -->
|
||||||
</div>
|
</div>
|
||||||
|
<form class="ml-4" method="post" action="<?php echo base_url('accounts/reports/pl'); ?>" id="FilterForm">
|
||||||
|
<!-- button with a dropdown -->
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
|
Filters
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu" role="menu">
|
||||||
|
<div class="form-group p-2 pb-0">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<!-- <div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox">
|
||||||
|
<label class="form-check-label">Select
|
||||||
|
All</label>
|
||||||
|
</div> -->
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button> -->
|
||||||
|
<!-- <button type="submit" onclick="exportTableToCSV('accounts_data.csv')" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
|
</button>
|
||||||
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a href="#" class="dropdown-item">View calendar</a>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button>
|
||||||
|
</form>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php $TableData = $this->db->query("select * from tbl_purchases where status=1")->result(); ?>
|
<?php $TableData = $this->db->query("select * from tbl_purchases where status=1")->result(); ?>
|
||||||
<table class="table table-bordered table-striped dataTable">
|
<table class="table table-bordered table-striped dataTable" id="myTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php myLang('S.N'); ?></th>
|
<th width="3%" class="text-center"><?php myLang('S.N'); ?></th>
|
||||||
<th><?php myLang('Date'); ?></th>
|
<th width="10%" class="col-1"><?php myLang('Date'); ?></th>
|
||||||
<th><?php myLang('Purchase Transaction'); ?></th>
|
<th class="table-col col-9"><?php myLang('Purchase Transaction'); ?></th>
|
||||||
<th><?php myLang('Amount'); ?></th>
|
<th width="8%" class="col-2"><?php myLang('Amount'); ?></th>
|
||||||
|
|
||||||
<td><b>Action</b></th>
|
<td class="col-1 text-center"><b>Action</b></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $a = 0;
|
<?php $a = 0;
|
||||||
|
$n = 0;
|
||||||
foreach ($PurchaseRecords as $TableRow) : $a++;
|
foreach ($PurchaseRecords as $TableRow) : $a++;
|
||||||
$id = $TableRow->purchase_id; ?>
|
$id = $TableRow->purchase_id; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $TableRow->purchase_ref; ?></td>
|
<td><?php echo ++$n; ?></td>
|
||||||
<td><?php echo $TableRow->purchase_date; ?></td>
|
<td><?php echo $TableRow->purchase_date; ?></td>
|
||||||
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></td>
|
<td><?php echo ($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name) ?? ""; ?></td>
|
||||||
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
|
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
|
||||||
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
|
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
|
||||||
<?php showDeleteButton($id); ?>
|
<?php showDeleteButton($id); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -50,3 +119,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
<!-- <button class="btn btn-primary btn-xs float-right" style="margin-left: 2px;" onclick="printDiv('printableArea')"><i class="fas fa-print"></i></button> -->
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add","Create New ".$pageTitle); ?></h5>
|
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add","Create New ".$pageTitle); ?></h5>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id="printableArea">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="row bill-header">
|
<div class="row bill-header">
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<p><strong>Bill Number:</strong> <?php echo $Purchase->purchase_id; ?></p>
|
<p><strong>Bill Number:</strong> <?php echo $Purchase->purchase_id; ?></p>
|
||||||
<p><strong>Date:</strong> <?php echo dbDate($Purchase->purchase_date); ?></p>
|
<p><strong>Date:</strong> <?php echo dbDate($Purchase->purchase_date); ?></p>
|
||||||
<p><strong>Vendor:</strong> <?php echo $this->myaccounts->getAccountDetails($Purchase->accounts_id)->account_name; ?></p>
|
<p><strong>Vendor:</strong> <?php echo (($this->myaccounts->getAccountDetails($Purchase->accounts_id)->account_name ?? "")); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -40,6 +40,9 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="text-right"><strong>Price</strong></p>
|
<p class="text-right"><strong>Price</strong></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p class="text-right"><strong>VAT</strong></p>
|
||||||
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="text-right"><strong>Total</strong></p>
|
<p class="text-right"><strong>Total</strong></p>
|
||||||
</div>
|
</div>
|
||||||
@ -58,7 +61,10 @@
|
|||||||
<p><?php $rate=$PurchaseDetail->rate; echo myCurrency($rate); ?></p>
|
<p><?php $rate=$PurchaseDetail->rate; echo myCurrency($rate); ?></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p><?php $ltotal=$rate*$qty; $total+=$ltotal; echo myCurrency($ltotal); ?></p>
|
<p><?php $vat=$PurchaseDetail->vat; echo myCurrency($vat); ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p><?php $ltotal=$rate*$qty*((100-$vat)/100); $total+=$ltotal; echo myCurrency($ltotal); ?></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -88,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -96,3 +102,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function printDiv(divName) {
|
||||||
|
var printContents = document.getElementById(divName).innerHTML;
|
||||||
|
var originalContents = document.body.innerHTML;
|
||||||
|
|
||||||
|
document.body.innerHTML = printContents;
|
||||||
|
|
||||||
|
window.print();
|
||||||
|
|
||||||
|
document.body.innerHTML = originalContents;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@ -45,7 +45,9 @@
|
|||||||
<?php $PTotal = 0;
|
<?php $PTotal = 0;
|
||||||
$a = 0;
|
$a = 0;
|
||||||
foreach ($PurchaseDetails as $Purchase) : $a++; ?>
|
foreach ($PurchaseDetails as $Purchase) : $a++; ?>
|
||||||
|
<?php// var_dump($Purchase->Item->title);die(); ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td><?php echo $a; ?></td>
|
<td><?php echo $a; ?></td>
|
||||||
<td><?php echo $Purchase->Item->title; ?></td>
|
<td><?php echo $Purchase->Item->title; ?></td>
|
||||||
<td class="text-right"><?php echo $Purchase->total_qty; ?></td>
|
<td class="text-right"><?php echo $Purchase->total_qty; ?></td>
|
||||||
@ -184,8 +186,9 @@
|
|||||||
<?php $a = 0;
|
<?php $a = 0;
|
||||||
foreach ($StockItems as $Stock) : $a++; ?>
|
foreach ($StockItems as $Stock) : $a++; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $a; ?></td>
|
<td class="text-center"><?php echo $a; ?></td>
|
||||||
<td><?php echo $Stock->Item->title; ?></td>
|
<?php //echo "<pre>";print_r($Stock->Summary->Item->title); die() ;?>
|
||||||
|
<td><?php echo $Stock->Summary->Item->title; ?></td>
|
||||||
<td><?php echo $Stock->Summary->Unit->title; ?></td>
|
<td><?php echo $Stock->Summary->Unit->title; ?></td>
|
||||||
<td class="text-right"><?php echo $oqty = $Stock->Summary->Opening->qty; ?></td>
|
<td class="text-right"><?php echo $oqty = $Stock->Summary->Opening->qty; ?></td>
|
||||||
<td class="text-right"><?php echo myCurrency($orate = $Stock->Summary->Opening->rate); ?></td>
|
<td class="text-right"><?php echo myCurrency($orate = $Stock->Summary->Opening->rate); ?></td>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<div class="col-2">
|
<div class="col-2">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Transaction Date <span class="text-danger">*</span></legend>
|
<legend>Transaction Date <span class="text-danger">*</span></legend>
|
||||||
<input type="text" class="form-control2" id="salesDate" value="<?php echo NepaliDate(); ?>" data-start="<?php echo $fiscalStart;?>" data-end="<?php echo $fiscalEnd;?>" name="salesDate" required>
|
<input type="text" class="form-control2" id="salesDate" value="<?php echo NepaliDate(); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" name="salesDate" required>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
@ -31,7 +31,7 @@
|
|||||||
<legend> Enter Transaction </legend>
|
<legend> Enter Transaction </legend>
|
||||||
<div class="form-row mb-2">
|
<div class="form-row mb-2">
|
||||||
<div class="form-group col">
|
<div class="form-group col">
|
||||||
<?php $this->myaccounts->showAccountsCombo("accounts_id", " Account <span class='text-danger'>*</span>", "accounts_id", "accategory_id=4","required"); ?>
|
<?php $this->myaccounts->showAccountsCombo("accounts_id", " Account <span class='text-danger'>*</span>", "accounts_id", "accategory_id=4", "required"); ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="form-group col">
|
<!-- <div class="form-group col">
|
||||||
<label for="salesDate">Sales Date:</label>
|
<label for="salesDate">Sales Date:</label>
|
||||||
@ -49,6 +49,7 @@
|
|||||||
<th width=50%>Items <span class="text-danger">*</span></th>
|
<th width=50%>Items <span class="text-danger">*</span></th>
|
||||||
<th class="text-center" width=5%>Qty <span class="text-danger">*</span></th>
|
<th class="text-center" width=5%>Qty <span class="text-danger">*</span></th>
|
||||||
<th class="text-center" width=5%>Units</th>
|
<th class="text-center" width=5%>Units</th>
|
||||||
|
<th class="text-center" width=13%>VAT<span class="text-danger">*</span></th>
|
||||||
<th class="text-center" width=13%>Rate <span class="text-danger">*</span></th>
|
<th class="text-center" width=13%>Rate <span class="text-danger">*</span></th>
|
||||||
<th class="text-right" width=20%>Amount</th>
|
<th class="text-right" width=20%>Amount</th>
|
||||||
<th width=5%></th>
|
<th width=5%></th>
|
||||||
@ -65,7 +66,9 @@
|
|||||||
</select></td>
|
</select></td>
|
||||||
<td> <input type="text" class="form-control input-group-sm" name="qty[]" required></td>
|
<td> <input type="text" class="form-control input-group-sm" name="qty[]" required></td>
|
||||||
<td><input type="text" class="form-control item_unit" name="pcs/dozen/kgs" required> </td>
|
<td><input type="text" class="form-control item_unit" name="pcs/dozen/kgs" required> </td>
|
||||||
|
<td><input type="number" name="vat[]" class="form-control vat" required></td>
|
||||||
<td><input type="text" class="form-control" name="rate[]" required></td>
|
<td><input type="text" class="form-control" name="rate[]" required></td>
|
||||||
|
<span class="total-price"></span>
|
||||||
<td><input type="text" class="form-control" name="ltotal[]" required></td>
|
<td><input type="text" class="form-control" name="ltotal[]" required></td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn btn-primary btn-xs add-row">
|
<button type="button" class="btn btn-primary btn-xs add-row">
|
||||||
@ -98,10 +101,13 @@
|
|||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-right "><b>13% VAT</b></td>
|
<td class="text-right d-none"><b><input type="checkbox" name="vat_checkbox" id="vat_checkbox"
|
||||||
<td class="text-right">
|
>13% VAT</b></td>
|
||||||
|
<td class="text-right d-none">
|
||||||
<input type="text" class="form-control" id="tax">
|
<input type="text" class="form-control" id="tax">
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<input type="hidden" name="vat_checkbox_value" id="vat_checkbox_value" value="0">
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-right "><b>Grand Total Amount</b></td>
|
<td class="text-right "><b>Grand Total Amount</b></td>
|
||||||
@ -147,7 +153,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$(document).on('input', '.sales-detail-duplicator input[name^="qty"], .sales-detail-duplicator input[name^="rate"]', function() {
|
$(document).on('input', '.sales-detail-duplicator input[name^="qty"],.sales-detail-duplicator input[name^="vat"], .sales-detail-duplicator input[name^="rate"]', function() {
|
||||||
calculateLineTotal($(this).closest('tr'));
|
calculateLineTotal($(this).closest('tr'));
|
||||||
calculateTotals();
|
calculateTotals();
|
||||||
});
|
});
|
||||||
@ -161,9 +167,12 @@
|
|||||||
calculateLineTotal($(this).closest("tr"));
|
calculateLineTotal($(this).closest("tr"));
|
||||||
calculateTotals('amount');
|
calculateTotals('amount');
|
||||||
});
|
});
|
||||||
|
$(document).on("change", "input[name=vat_checkbox]", function() {
|
||||||
function updateSerialNumbers(){
|
calculateLineTotal($(this).closest("tr"));
|
||||||
$('.purchase-detail').each(function(index){
|
calculateTotals('vat');
|
||||||
|
});
|
||||||
|
function updateSerialNumbers() {
|
||||||
|
$('.purchase-detail').each(function(index) {
|
||||||
$(this).find('.bbsn').text(index + 1);
|
$(this).find('.bbsn').text(index + 1);
|
||||||
})
|
})
|
||||||
counter = $('.purchase-detail').length;
|
counter = $('.purchase-detail').length;
|
||||||
@ -172,9 +181,13 @@
|
|||||||
function calculateLineTotal(row) {
|
function calculateLineTotal(row) {
|
||||||
var quantity = parseFloat(row.find('input[name^="qty"]').val());
|
var quantity = parseFloat(row.find('input[name^="qty"]').val());
|
||||||
var rate = parseFloat(row.find('input[name^="rate"]').val());
|
var rate = parseFloat(row.find('input[name^="rate"]').val());
|
||||||
if (!isNaN(quantity) && !isNaN(rate)) {
|
var vat = parseFloat(row.find('input[name^="vat"]').val());
|
||||||
|
if (!isNaN(quantity) && !isNaN(rate) && !isNaN(vat)) {
|
||||||
var lineTotal = quantity * rate;
|
var lineTotal = quantity * rate;
|
||||||
row.find("input[name^='ltotal[]']").val(lineTotal.toFixed(2));
|
var vat_amt =(vat/100)*lineTotal;
|
||||||
|
var ltotal =lineTotal + vat_amt ;
|
||||||
|
console.log(lineTotal,vat_amt,ltotal);
|
||||||
|
row.find("input[name^='ltotal[]']").val(ltotal.toFixed(2));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,7 +196,7 @@
|
|||||||
var counter = $('.sales-detail-duplicator').length;
|
var counter = $('.sales-detail-duplicator').length;
|
||||||
var currentRow = $(".sales-detail-duplicator").clone().show();
|
var currentRow = $(".sales-detail-duplicator").clone().show();
|
||||||
$(document).on("click", ".add-row", function() {
|
$(document).on("click", ".add-row", function() {
|
||||||
counter+=1;
|
counter += 1;
|
||||||
var newRow = currentRow.clone();
|
var newRow = currentRow.clone();
|
||||||
newRow.find('.bbsn').text(counter);
|
newRow.find('.bbsn').text(counter);
|
||||||
$("#salesDetails").append(newRow);
|
$("#salesDetails").append(newRow);
|
||||||
@ -191,7 +204,7 @@
|
|||||||
// calculateTotals();
|
// calculateTotals();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '.select_item', function(){
|
$(document).on('change', '.select_item', function() {
|
||||||
|
|
||||||
var selectedOption = $(this).find(':selected');
|
var selectedOption = $(this).find(':selected');
|
||||||
var selectedValue = selectedOption.val();
|
var selectedValue = selectedOption.val();
|
||||||
@ -200,7 +213,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: "<?php echo site_url("inventory/Sales/getunitbyitem/"); ?>" + selectedValue,
|
url: "<?php echo site_url("inventory/Sales/getunitbyitem/"); ?>" + selectedValue,
|
||||||
async: true,
|
async: true,
|
||||||
dataType:"json",
|
dataType: "json",
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
@ -229,7 +242,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function calculateTotals(type='') {
|
function calculateTotals(type = '') {
|
||||||
var subtotal = 0;
|
var subtotal = 0;
|
||||||
$(".sales-detail-duplicator").each(function() {
|
$(".sales-detail-duplicator").each(function() {
|
||||||
var lineTotal = parseFloat($(this).find("input[name^='ltotal']").val());
|
var lineTotal = parseFloat($(this).find("input[name^='ltotal']").val());
|
||||||
@ -239,27 +252,39 @@
|
|||||||
});
|
});
|
||||||
var discountamount = 0;
|
var discountamount = 0;
|
||||||
var discountpercent = 0;
|
var discountpercent = 0;
|
||||||
if(type=='amount'){
|
var tax_percentage =0;
|
||||||
alert("amount");
|
if (type == 'amount') {
|
||||||
discountamount = parseFloat($("input[name='discount']").val());
|
discountamount = parseFloat($("input[name='discount']").val());
|
||||||
discountpercent = (discountamount * 100) / subtotal;
|
discountpercent = (discountamount * 100) / subtotal;
|
||||||
alert(discountamount);
|
|
||||||
$("#discountpercentage").val(discountpercent.toFixed(2));
|
$("#discountpercentage").val(discountpercent.toFixed(2));
|
||||||
|
} else if(type == 'vat'){
|
||||||
|
checkBox = $("input[name='vat_checkbox_value']").val();
|
||||||
|
if(checkBox == "0"){
|
||||||
|
// if(checkBox){
|
||||||
|
tax_percentage= 0.13;
|
||||||
|
$("input[name='vat_checkbox_value']").val('13');
|
||||||
}else{
|
}else{
|
||||||
|
tax_percentage =0;
|
||||||
|
$("input[name='vat_checkbox_value']").val('0');
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
else {
|
||||||
discountpercent = parseFloat($("input[name='discountpercentage']").val());
|
discountpercent = parseFloat($("input[name='discountpercentage']").val());
|
||||||
discountamount = subtotal * (discountpercent/100);
|
discountamount = subtotal * (discountpercent / 100);
|
||||||
$("#discount").val(discountamount.toFixed(2));
|
$("#discount").val(discountamount.toFixed(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
var taxable = subtotal - discountamount;
|
var taxable = subtotal - discountamount;
|
||||||
var tax = taxable * 0.13;
|
var tax = taxable * tax_percentage;
|
||||||
var grandTotal = taxable + tax;
|
// var grandTotal = taxable + tax;
|
||||||
|
var grandTotal = taxable;
|
||||||
$('#subtotal').val(subtotal.toFixed(2));
|
$('#subtotal').val(subtotal.toFixed(2));
|
||||||
|
|
||||||
$("#taxable").val(taxable.toFixed(2));
|
$("#taxable").val(taxable.toFixed(2));
|
||||||
$('#tax').val(tax.toFixed(2));
|
$('#tax').val(tax.toFixed(2));
|
||||||
$('#grandtotal').val(grandTotal.toFixed(2));
|
$('#grandtotal').val(grandTotal.toFixed(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php function footerFunctions()
|
<?php function footerFunctions()
|
||||||
@ -271,6 +296,6 @@
|
|||||||
minDate: $('#salesDate').data('start'),
|
minDate: $('#salesDate').data('start'),
|
||||||
maxDate: $('#salesDate').data('end'),
|
maxDate: $('#salesDate').data('end'),
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php } ?>
|
<?php } ?>
|
@ -12,23 +12,24 @@
|
|||||||
<table class="table table-bordered table-striped dataTable">
|
<table class="table table-bordered table-striped dataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="table-col col-1"><?php myLang('Sales Voucher #'); ?></th>
|
<th class="table-col col-1 text-center"><?php myLang('Sales Voucher #'); ?></th>
|
||||||
<th width="10%"><?php myLang('Date'); ?></th>
|
<th width="10%"><?php myLang('Date'); ?></th>
|
||||||
<th><?php myLang('Transaction'); ?></th>
|
<th><?php myLang('Transaction'); ?></th>
|
||||||
<th class="table-col col-1"><?php myLang('Amount'); ?></th>
|
<th class="table-col col-1 text-center"><?php myLang('Amount'); ?></th>
|
||||||
<th class="table-col col-1"><?php myLang('Action'); ?></th>
|
<th class="table-col col-1 text-center"><?php myLang('Action'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($SalesRecords as $TableRow) : ?>
|
<?php foreach ($SalesRecords as $TableRow) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $TableRow->sales_id; ?></td>
|
<td class="text-center"><?php echo $TableRow->sales_id; ?></td>
|
||||||
<td><?php echo $TableRow->sales_date; ?></td>
|
<td><?php echo $TableRow->sales_date; ?></td>
|
||||||
<td><b><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></b>
|
<td><b><?php echo (($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name) ?? ""); ?></b>
|
||||||
<div class="row ml-2 mr-2" style="border-bottom: 1px solid;">
|
<div class="row ml-2 mr-2" style="border-bottom: 1px solid;">
|
||||||
<span class="col item_name"><?php echo myLang("Particulars") ?></span>
|
<span class="col item_name"><?php echo myLang("Particulars") ?></span>
|
||||||
<span class="col item_qty"><?php echo myLang("Qty") ?></span>
|
<span class="col item_qty"><?php echo myLang("Qty") ?></span>
|
||||||
<span class="col item_rate"><?php echo myLang("Rate") ?></span>
|
<span class="col item_rate"><?php echo myLang("Rate") ?></span>
|
||||||
|
<span class="col item_vat"><?php echo myLang("VAT") ?></span>
|
||||||
<span class="col item_amount"><?php echo myLang("Amount") ?></span>
|
<span class="col item_amount"><?php echo myLang("Amount") ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php $l = 0;
|
<?php $l = 0;
|
||||||
@ -36,8 +37,9 @@
|
|||||||
<div class="row ml-2 mr-2">
|
<div class="row ml-2 mr-2">
|
||||||
<span class="col item_name"><?php echo $r->Item->title; ?></span>
|
<span class="col item_name"><?php echo $r->Item->title; ?></span>
|
||||||
<span class="col item_qty"><?php echo $r->qty; ?></span>
|
<span class="col item_qty"><?php echo $r->qty; ?></span>
|
||||||
<span class="col item_rate text-right"><?php echo myCurrency($r->rate, true); ?></span>
|
<span class="col item_rate"><?php echo myCurrency($r->rate, true); ?></span>
|
||||||
<span class="col item_amount text-right"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
|
<span class="col item_vat"><?php echo myCurrency($r->vat, true); ?></span>
|
||||||
|
<span class="col item_amount"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
|
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
|
||||||
@ -48,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo myCurrency($TableRow->totalsales); ?></td>
|
<td><?php echo myCurrency($TableRow->totalsales); ?></td>
|
||||||
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
|
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
|
||||||
<?php showDeleteButton($TableRow->sales_id); ?>
|
<?php showDeleteButton($TableRow->sales_id); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -5,31 +5,87 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> <a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
|
<h5 class="m-0 card-title"><?php echo $pageTitle; ?> </h5><a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a>
|
||||||
|
<!-- Filter Start -->
|
||||||
|
<form method="post" action="" id="FilterForm">
|
||||||
|
<!-- button with a dropdown -->
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
|
Filters
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu" role="menu">
|
||||||
|
<div class="form-group p-2 pb-0">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
</form>
|
||||||
|
<!-- Filter Ends -->
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php $TableData = $this->db->query("select * from tbl_sales where status=1")->result(); ?>
|
<?php $TableData = $this->db->query("select * from tbl_sales where status=1")->result(); ?>
|
||||||
<table class="table table-bordered table-striped dataTable">
|
<table class="table table-bordered table-striped dataTable" id='myTable'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="table-col col-1"><?php myLang('Sales Voucher #'); ?></th>
|
<th class=" col-1 text-center"><?php myLang('ID'); ?></th>
|
||||||
<th width="10%"><?php myLang('Date'); ?></th>
|
<th class=" col-1 text-center"><?php myLang('Sales Voucher #'); ?></th>
|
||||||
|
<th class=" col-1 text-center"><?php myLang('Item'); ?></th>
|
||||||
|
<th class="col-1"><?php myLang('Date'); ?></th>
|
||||||
<th><?php myLang('Transaction'); ?></th>
|
<th><?php myLang('Transaction'); ?></th>
|
||||||
<th class="table-col col-1"><?php myLang('Amount'); ?></th>
|
<th class="table-col col-1 text-center"><?php myLang('Amount'); ?></th>
|
||||||
<th class="table-col col-1"><?php myLang('Action'); ?></th>
|
<th class="text-center" width="5%"> <?php myLang('Action'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($SalesRecords as $TableRow) : ?>
|
<?php $n = 0; ?>
|
||||||
|
<?php foreach ($SalesRecords as $key => $TableRow) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $TableRow->sales_id; ?></td>
|
<td class="text-center"><?php echo ++$n; ?></td>
|
||||||
|
<td class="text-center"><?php echo $TableRow->sales_id; ?></td>
|
||||||
|
<td class="text-center"><?php echo ($TableRow->Details[$key]->Item->title) ?? ""; ?></td>
|
||||||
<td><?php echo $TableRow->sales_date; ?></td>
|
<td><?php echo $TableRow->sales_date; ?></td>
|
||||||
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?>
|
<td><?php echo (($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name) ?? ""); ?>
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo myCurrency($TableRow->totalsales); ?></td>
|
<td><?php echo myCurrency($TableRow->totalsales); ?></td>
|
||||||
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
|
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
|
||||||
<?php showDeleteButton($TableRow->sales_id); ?>
|
<?php showDeleteButton($TableRow->sales_id); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -50,3 +106,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
@ -7,11 +7,11 @@
|
|||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
<!-- <button class="btn btn-primary btn-xs float-right" style="margin-left: 2px;" onclick="printDiv('printableArea')"><i class="fas fa-print"></i></button> -->
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> <a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
|
<h5 class="m-0"><?php echo $pageTitle; ?> <a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div id="printableArea">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="row bill-header">
|
<div class="row bill-header">
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<p><strong>Bill Number:</strong> <?php echo $Sales->sales_id; ?></p>
|
<p><strong>Bill Number:</strong> <?php echo $Sales->sales_id; ?></p>
|
||||||
<p><strong>Date:</strong> <?php echo dbDate($Sales->sales_date); ?></p>
|
<p><strong>Date:</strong> <?php echo dbDate($Sales->sales_date); ?></p>
|
||||||
<p><strong>Vendor:</strong> <?php echo $this->myaccounts->getAccountDetails($Sales->accounts_id)->account_name; ?></p>
|
<p><strong>Vendor:</strong> <?php echo (($this->myaccounts->getAccountDetails($Sales->accounts_id)->account_name ?? "")); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -40,6 +40,9 @@
|
|||||||
<div class="col text-right">
|
<div class="col text-right">
|
||||||
<p><strong>Price</strong></p>
|
<p><strong>Price</strong></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col text-right">
|
||||||
|
<p><strong>VAT</strong></p>
|
||||||
|
</div>
|
||||||
<div class="col text-right">
|
<div class="col text-right">
|
||||||
<p><strong>Total</strong></p>
|
<p><strong>Total</strong></p>
|
||||||
</div>
|
</div>
|
||||||
@ -57,6 +60,9 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<p><?php $rate=$SalesDetail->rate; echo myCurrency($rate); ?></p>
|
<p><?php $rate=$SalesDetail->rate; echo myCurrency($rate); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<p><?php $vat=($SalesDetail->vat); echo myCurrency($vat); ?></p>
|
||||||
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p><?php $ltotal=$rate*$qty; $total+=$ltotal; echo myCurrency($ltotal); ?></p>
|
<p><?php $ltotal=$rate*$qty; $total+=$ltotal; echo myCurrency($ltotal); ?></p>
|
||||||
</div>
|
</div>
|
||||||
@ -80,13 +86,15 @@
|
|||||||
<?php //print_r($Purchase->vatToggle);die; ?>
|
<?php //print_r($Purchase->vatToggle);die; ?>
|
||||||
<!-- <?php //if($Sales->vatToggle != 1): ?> -->
|
<!-- <?php //if($Sales->vatToggle != 1): ?> -->
|
||||||
<p><strong>Taxable amount:</strong> <?php echo myCurrency($taxable,true); ?></p>
|
<p><strong>Taxable amount:</strong> <?php echo myCurrency($taxable,true); ?></p>
|
||||||
<p><strong>Tax (13%):</strong> <?php echo myCurrency($tax=($taxable*13)/100,true); ?></p>
|
<!-- <p><strong>Tax (13%):</strong> <?php echo myCurrency($tax=($taxable*13)/100,true); ?></p> -->
|
||||||
<!-- <?php //endif; ?> -->
|
<!-- <?php //endif; ?> -->
|
||||||
<p><strong>Total:</strong> <?php echo myCurrency(($taxable+$tax),true); ?></p>
|
<!-- <p><strong>Total:</strong> <?php echo myCurrency(($taxable+$tax),true); ?></p> -->
|
||||||
|
<p><strong>Total:</strong> <?php echo myCurrency(($taxable),true); ?></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,21 +2,14 @@
|
|||||||
<!-- <div class="content">
|
<!-- <div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card card-primary ">
|
<div class="card card-primary ">
|
||||||
|
|
||||||
|
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?php //echo $pageTitle;
|
<h3 class="card-title"><?php //echo $pageTitle;
|
||||||
?> </h3>
|
?> </h3>
|
||||||
|
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-plus"></i>
|
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="post" action="" id="FilterForm">
|
<form method="post" action="" id="FilterForm">
|
||||||
<div class="row align-items-end">
|
<div class="row align-items-end">
|
||||||
@ -62,7 +55,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group d-flex justify-content-end">
|
<div class="form-group d-flex justify-content-end">
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary mr-2">Choose</button>
|
<button type="submit" class="btn btn-primary mr-2">Choose</button>
|
||||||
<button type="submit" class="btn btn-primary mr-2">Filter</button>
|
<button type="submit" class="btn btn-primary mr-2">Filter</button>
|
||||||
<button type="submit" class="btn btn-success mr-2">Export</button>
|
<button type="submit" class="btn btn-success mr-2">Export</button>
|
||||||
@ -70,7 +62,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
@ -89,10 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -100,68 +88,77 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="card-title">
|
<h5 class="card-title">
|
||||||
<?php echo $pageTitle; ?>
|
<?php echo $pageTitle; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <?php //echo $pageTitle;
|
<!-- <?php //echo $pageTitle;
|
||||||
?> <a href="<?php //echo site_url("inventory/purchases/add");
|
?> <a href="<?php //echo site_url("inventory/purchases/add");
|
||||||
?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle;
|
?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle;
|
||||||
?></a> -->
|
?></a> -->
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
<div class="card-tools">
|
<div class="card-tools">
|
||||||
|
<!-- test -->
|
||||||
|
|
||||||
|
<!-- test ends -->
|
||||||
|
|
||||||
|
<form method="post" action=<?php echo site_url('/Inventory/Stocks/summary'); ?> id="FilterForm">
|
||||||
<!-- button with a dropdown -->
|
<!-- button with a dropdown -->
|
||||||
|
<input type="hidden" name="stocklocations_id" value="1" />
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
|
||||||
Filters
|
Filters
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" role="menu">
|
<div class="dropdown-menu" role="menu">
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group p-2 pb-0">
|
<div class="form-group p-2 pb-0">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
<input type="text" class="form-control " name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
|
||||||
|
<!-- <input type="text" class="form-control " name="fromDate" value="" data-end="<?php echo $fiscalEnd; ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period"> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
<label for="toDate"><?php myLang("Ending Period"); ?></label>
|
||||||
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
<input type="text" class="form-control " name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<div class="form-check">
|
<!-- <div class="form-check">
|
||||||
|
|
||||||
<input class="form-check-input" type="checkbox">
|
<input class="form-check-input" type="checkbox">
|
||||||
<label class="form-check-label">Select
|
<label class="form-check-label">Select
|
||||||
All</label>
|
All</label>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
|
<!-- <input type="hidden" name="showOB" value="not"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<label class="form-check-label">Opening</label>
|
<label class="form-check-label" for="showOB">Opening</label>
|
||||||
|
StockRecords
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox"> -->
|
<!-- <input class="form-check-input" type="checkbox"> -->
|
||||||
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
|
||||||
<label class="form-check-label">Closing</label>
|
<label class="form-check-label" for="showClosing">Closing</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
<!-- <input class="form-check-input" type="checkbox" checked> -->
|
||||||
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
|
||||||
<label class="form-check-label">Period</label>
|
<label class="form-check-label" for="showPeriod">Period</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<button type="submit" class="btn btn-primary mr-2 text-center">Search Now</button>
|
<div class="form-group p-2 pb-0 text-right">
|
||||||
|
<button type="button" class="btn btn-info btn-sm " style="width:60px;height:30px;" onclick="resetForm()">Reset</button>
|
||||||
|
<button type="submit" class="btn btn-primary mr-2 btn-sm" style="width:60px;height:30px;">Search </button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
<!-- <button type="submit" class="btn btn-warning btn-sm " data-toggle="dropdown" data-offset="-52">
|
||||||
Export
|
Export
|
||||||
|
</button> -->
|
||||||
|
<button type="submit" id="downloadCsv" class="btn btn-warning btn-sm ">
|
||||||
|
Export csv
|
||||||
</button>
|
</button>
|
||||||
|
<!-- <button class="btn btn-warning btn-sm " onclick="exportTableToCSV('accounts_data.csv')">Export to CSV</button> -->
|
||||||
|
|
||||||
<!-- <div class="dropdown-menu" role="menu">
|
<!-- <div class="dropdown-menu" role="menu">
|
||||||
<a href="#" class="dropdown-item">Export</a>
|
<a href="#" class="dropdown-item">Export</a>
|
||||||
<a href="#" class="dropdown-item">Pdf</a>
|
<a href="#" class="dropdown-item">Pdf</a>
|
||||||
@ -170,27 +167,33 @@
|
|||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- <button class="btn btn-secondary toggle-collapse btn-sm" id="toggleShowAll">Toggle Collapse</button> -->
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
function resetForm() {
|
||||||
|
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
|
||||||
|
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
|
||||||
|
document.getElementById("showOB").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
|
||||||
|
document.getElementById("FilterForm").submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<table class="table table-bordered table-striped dataTable">
|
<table id='myTable' class="table table-bordered table-striped dataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2" width="40"><?php myLang('S.No.'); ?></th>
|
<th rowspan="2" width="40" style="vertical-align: middle;"><?php myLang('S.No.'); ?></th>
|
||||||
<th rowspan="2"><?php myLang('Item'); ?></th>
|
<th rowspan="2" style="vertical-align: middle;"> <?php myLang('Item'); ?></th>
|
||||||
|
<th rowspan="2" width="80" style="vertical-align: middle;"><?php myLang('Units'); ?></th>
|
||||||
<th rowspan="2" width="80"><?php myLang('Units'); ?></th>
|
|
||||||
|
|
||||||
<th colspan="3" class="text-center"><?php myLang('Opening'); ?></th>
|
<th colspan="3" class="text-center"><?php myLang('Opening'); ?></th>
|
||||||
<th colspan="3" class="text-center"><?php myLang('Purchase'); ?></th>
|
<th colspan="3" class="text-center"><?php myLang('Purchase'); ?></th>
|
||||||
<th colspan="3" class="text-center"><?php myLang('Sales'); ?></th>
|
<th colspan="3" class="text-center"><?php myLang('Sales'); ?></th>
|
||||||
<th colspan="3" class="text-center"><?php myLang('Closing'); ?></th>
|
<th colspan="3" class="text-center"><?php myLang('Closing'); ?></th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
|
|
||||||
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
|
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
|
||||||
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
|
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
|
||||||
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
|
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
|
||||||
@ -203,17 +206,20 @@
|
|||||||
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
|
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
|
||||||
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
|
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
|
||||||
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
|
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<?php $Total = 0;
|
||||||
<?php $Total = 0;$PTotal=0;$STotal=0;$CTotal=0;
|
$PTotal = 0;
|
||||||
foreach ($StockRecords as $TableRow) : ?>
|
$STotal = 0;
|
||||||
|
$CTotal = 0;
|
||||||
|
foreach ($StockRecords as $index => $TableRow) : ?>
|
||||||
|
<?php if ((count($TableRow->Item)) > 0):; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td class="text-center"><?php echo $index + 1; ?></td>
|
||||||
<td><?php echo ($TableRow->Item)?$TableRow->Item->title:"N/A"; ?></td>
|
<td><?php echo ($TableRow->Summary->Item->title) ? $TableRow->Summary->Item->title : "N/A"; ?></td>
|
||||||
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->Item->units_id); ?></td>
|
<!-- $StockRecord->Summary->Unit->unit_id -->
|
||||||
|
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->Summary->Unit->unit_id); ?></td>
|
||||||
<td class="text-right"><?php echo $TableRow->Summary->Opening->qty; ?></td>
|
<td class="text-right"><?php echo $TableRow->Summary->Opening->qty; ?></td>
|
||||||
<td class="text-right"><?php echo $TableRow->Summary->Opening->rate; ?></td>
|
<td class="text-right"><?php echo $TableRow->Summary->Opening->rate; ?></td>
|
||||||
<td><?php echo myCurrency($lTotal = $TableRow->Summary->Opening->amount);
|
<td><?php echo myCurrency($lTotal = $TableRow->Summary->Opening->amount);
|
||||||
@ -230,14 +236,13 @@
|
|||||||
<td class="text-right"><?php echo $TableRow->Summary->Closing->rate; ?></td>
|
<td class="text-right"><?php echo $TableRow->Summary->Closing->rate; ?></td>
|
||||||
<td><?php echo myCurrency($cTotal = $TableRow->Summary->Closing->amount);
|
<td><?php echo myCurrency($cTotal = $TableRow->Summary->Closing->amount);
|
||||||
$CTotal += $cTotal; ?></td>
|
$CTotal += $cTotal; ?></td>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="4" class="text-right"><b><?php echo myLang("Total"); ?></b></td>
|
<td colspan="5" class="text-right"><b><?php echo myLang("Total"); ?></b></td>
|
||||||
<td><?php echo myCurrency($Total); ?></td>
|
<td><?php echo myCurrency($Total); ?></td>
|
||||||
<td colspan="2"></td>
|
<td colspan="2"></td>
|
||||||
<td><?php echo myCurrency($PTotal); ?></td>
|
<td><?php echo myCurrency($PTotal); ?></td>
|
||||||
@ -245,6 +250,7 @@
|
|||||||
<td><?php echo myCurrency($STotal); ?></td>
|
<td><?php echo myCurrency($STotal); ?></td>
|
||||||
<td colspan="2"></td>
|
<td colspan="2"></td>
|
||||||
<td><?php echo myCurrency($CTotal); ?></td>
|
<td><?php echo myCurrency($CTotal); ?></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
@ -255,3 +261,120 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php function footerFunctions()
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Prevent the dropdown from closing when clicking inside
|
||||||
|
$('.dropdown-menu').on('click', function(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
// var exportButton = document.getElementById("exportButton");
|
||||||
|
// exportButton.addEventListener("click", function() {
|
||||||
|
// exportTableToCSV("table.csv");
|
||||||
|
// });
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
// Trigger click event on page load
|
||||||
|
document.getElementById("toggleShowAll").click();
|
||||||
|
});
|
||||||
|
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
var nestedRows = document.getElementsByClassName("collapse");
|
||||||
|
for (var i = 0; i < nestedRows.length; i++) {
|
||||||
|
if (nestedRows[i].classList.contains("show")) {
|
||||||
|
nestedRows[i].classList.remove("show");
|
||||||
|
} else {
|
||||||
|
nestedRows[i].classList.add("show");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function exportTableToCSV(filename) {
|
||||||
|
var csv = [];
|
||||||
|
var rows = document.querySelectorAll("table tr:not(.hide)");
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
var row = [];
|
||||||
|
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
|
||||||
|
// Check if the parent row is collapsed or hidden
|
||||||
|
var parentRow = rows[i].closest(".collapse");
|
||||||
|
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
|
||||||
|
if (isParentCollapsed) {
|
||||||
|
continue; // Skip child table rows if parent is collapsed
|
||||||
|
}
|
||||||
|
for (var j = 0; j < cols.length; j++) {
|
||||||
|
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
|
||||||
|
row.push(cellValue);
|
||||||
|
}
|
||||||
|
csv.push(row.join(","));
|
||||||
|
}
|
||||||
|
// Create a CSV file
|
||||||
|
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
|
||||||
|
var encodedUri = encodeURI(csvContent);
|
||||||
|
var link = document.createElement("a");
|
||||||
|
link.setAttribute("href", encodedUri);
|
||||||
|
link.setAttribute("download", filename);
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#fromDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#fromDate').data('start'),
|
||||||
|
maxDate: $('#fromDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
$("#toDate").nepaliDatePicker({
|
||||||
|
dateFormat: "%y-%m-%d",
|
||||||
|
closeOnDateSelect: true,
|
||||||
|
minDate: $('#toDate').data('start'),
|
||||||
|
maxDate: $('#toDate').data('end'),
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- pdf document -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.0/xlsx.full.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('downloadCsv').addEventListener('click', function() {
|
||||||
|
const table = document.getElementById('myTable');
|
||||||
|
const rows = Array.from(table.rows);
|
||||||
|
const data = [];
|
||||||
|
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const cells = Array.from(row.cells);
|
||||||
|
const rowData = [];
|
||||||
|
cells.forEach((cell) => {
|
||||||
|
// Handle colspan
|
||||||
|
const colspan = cell.colSpan || 1;
|
||||||
|
for (let i = 0; i < (colspan - 1); i++) {
|
||||||
|
rowData.push(''); // Fill empty cells for merged columns
|
||||||
|
}
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
rowData.push(cell.innerText.trim());
|
||||||
|
}
|
||||||
|
// Fill empty cells for colspan
|
||||||
|
});
|
||||||
|
data.push(rowData);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create a worksheet
|
||||||
|
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||||
|
const workbook = XLSX.utils.book_new();
|
||||||
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||||
|
|
||||||
|
// Export to Excel
|
||||||
|
XLSX.writeFile(workbook, 'table.xlsx');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- pdf document ends-->
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
@ -5,7 +5,7 @@
|
|||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"><?php echo isset($unit) ? 'Edit' : 'Add'; ?>
|
<h5 class="m-0 card-title"><?php echo isset($unit) ? 'Edit' : 'Add'; ?>
|
||||||
<?php myLang('Inventory Unit'); ?>
|
<?php myLang('Inventory Unit'); ?>
|
||||||
<?php //echo $pageTitle; ?>
|
<?php //echo $pageTitle; ?>
|
||||||
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle); ?>
|
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle); ?>
|
||||||
@ -59,7 +59,7 @@
|
|||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h5 class="m-0"> <?php myLang(' List Inventory Units'); ?> <?php //echo $pageTitle; ?>
|
<h5 class="m-0 card-title"> <?php myLang(' List Inventory Units'); ?> <?php //echo $pageTitle; ?>
|
||||||
<?php //showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?>
|
<?php //showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
@ -68,10 +68,10 @@
|
|||||||
<table class="table table-bordered table-striped longdataTable">
|
<table class="table table-bordered table-striped longdataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="table-col col-1"><?php myLang('S.N'); ?></th>
|
<th class="text-center" width="5%"><?php myLang('S.N'); ?></th>
|
||||||
<th><?php myLang('Unit Name '); ?></th>
|
<th class="col-5" width="30%"><?php myLang('Unit Name '); ?></th>
|
||||||
<th><?php myLang('Unit Code'); ?></th>
|
<th class="col-5" width="57%"><?php myLang('Unit Code'); ?></th>
|
||||||
<th class="table-col col-1">Action</th>
|
<th class="col-1 text-center" >Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -80,10 +80,10 @@
|
|||||||
<?php foreach ($TableRow as $cols) : $id = $cols;
|
<?php foreach ($TableRow as $cols) : $id = $cols;
|
||||||
break;
|
break;
|
||||||
endforeach; ?><tr>
|
endforeach; ?><tr>
|
||||||
<td><?php echo $a; ?></td>
|
<td class="text-center"><?php echo $a; ?></td>
|
||||||
<td><?php echo $TableRow->title; ?></td>
|
<td><?php echo $TableRow->title; ?></td>
|
||||||
<td><?php echo $TableRow->description; ?></td>
|
<td><?php echo $TableRow->description; ?></td>
|
||||||
<td><?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
<td class="text-center"><?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
|
||||||
<?php showDeleteButton($id); ?>
|
<?php showDeleteButton($id); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -1,39 +1,34 @@
|
|||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5>
|
||||||
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add","Create New ".$pageTitle); ?></h5>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body ">
|
<div class="card-body ">
|
||||||
|
|
||||||
<?php $TableData = $this->db->query("select * from tbl_translations where status=1")->result(); ?>
|
<?php $TableData = $this->db->query("select * from tbl_translations where status=1")->result(); ?>
|
||||||
<table class="table table-bordered table-striped longdataTable">
|
<table class="table table-bordered table-striped longdataTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center col-1"><?php myLang('Translation Id'); ?></th>
|
<th class="text-center col-1"><?php myLang('Translation Id'); ?></th>
|
||||||
<th class="text-center col-2"><?php myLang('English'); ?></th>
|
<th class="text-center col-5"><?php myLang('English'); ?></th>
|
||||||
<th class="text-center col-2"><?php myLang('Nepali'); ?></th>
|
<th class="text-center col-5"><?php myLang('Nepali'); ?></th>
|
||||||
<th class="text-center col-1"><?php myLang('Action'); ?></th>
|
<th class="text-center col-1"><?php myLang('Action'); ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $a=0; foreach ($TableData as $TableRow) : $a++; ?>
|
<?php $a = 0;
|
||||||
|
foreach ($TableData as $TableRow) : $a++; ?>
|
||||||
<?php foreach ($TableRow as $cols) : $id = $cols;
|
<?php foreach ($TableRow as $cols) : $id = $cols;
|
||||||
break;
|
break;
|
||||||
endforeach; ?><tr>
|
endforeach; ?><tr>
|
||||||
<td class="text-center"><?php echo $TableRow->translation_id; ?></td>
|
<td class="text-center"><?php echo $TableRow->translation_id; ?></td>
|
||||||
<td><?php echo $TableRow->english; ?></td>
|
<td><?php echo $TableRow->english; ?></td>
|
||||||
<td><?php echo $TableRow->nepali; ?></td>
|
<td><?php echo $TableRow->nepali; ?></td>
|
||||||
<td class="text-center"><a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> Edit</a>
|
<td class="text-center"><a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i></a>
|
||||||
<a onClick="javascript:doDelete(<?php echo $id; ?>);" class="btn btn-danger btn-xs"><i class="fas fa-trash"></i> Delete</a>
|
<a onClick="javascript:doDelete(<?php echo $id; ?>);" class="btn btn-danger btn-xs"><i class="fas fa-trash"></i></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
16
account/dist/css/bbnepalcustom.css
vendored
16
account/dist/css/bbnepalcustom.css
vendored
@ -123,12 +123,22 @@ margin-bottom: .5rem;
|
|||||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||||
margin-top: 0 !important;
|
margin-top: 0 !important;
|
||||||
}
|
}
|
||||||
.card-body.p-0 .table tbody>tr>td:last-of-type, .card-body.p-0 .table tbody>tr>th:last-of-type, .card-body.p-0 .table tfoot>tr>td:last-of-type, .card-body.p-0 .table tfoot>tr>th:last-of-type, .card-body.p-0 .table thead>tr>td:last-of-type, .card-body.p-0 .table thead>tr>th:last-of-type {
|
/* .card-body.p-0 .table tbody>tr>td:last-of-type, .card-body.p-0 .table tbody>tr>th:last-of-type, .card-body.p-0 .table tfoot>tr>td:last-of-type, .card-body.p-0 .table tfoot>tr>th:last-of-type, .card-body.p-0 .table thead>tr>td:last-of-type, .card-body.p-0 .table thead>tr>th:last-of-type {
|
||||||
padding-right: 0!important;
|
padding-right: 0px!important;
|
||||||
}
|
} */
|
||||||
.form-group textarea.form-control {
|
.form-group textarea.form-control {
|
||||||
height: 50px !important;
|
height: 50px !important;
|
||||||
}
|
}
|
||||||
.select2-container .select2-selection--single {
|
.select2-container .select2-selection--single {
|
||||||
height: 30px!important;
|
height: 30px!important;
|
||||||
}
|
}
|
||||||
|
.mt-26{
|
||||||
|
margin-top: 26px;
|
||||||
|
}
|
||||||
|
table.dataTable>thead>tr>th:not(.sorting_disabled), table.dataTable>thead>tr>td:not(.sorting_disabled) {
|
||||||
|
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.text-right{
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
account/pdf/ledgers/ledger_30.wpdf
Normal file
BIN
account/pdf/ledgers/ledger_30.wpdf
Normal file
Binary file not shown.
BIN
account/pdf/ledgers/ledger_31.wpdf
Normal file
BIN
account/pdf/ledgers/ledger_31.wpdf
Normal file
Binary file not shown.
BIN
account/pdf/ledgers/ledger_33.wpdf
Normal file
BIN
account/pdf/ledgers/ledger_33.wpdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
account/pdf/vouchers/Voucher_4.pdf
Normal file
BIN
account/pdf/vouchers/Voucher_4.pdf
Normal file
Binary file not shown.
Binary file not shown.
1170
account/plugins/nepalidatepicker/nepaliDatePicker.min.js
vendored
1170
account/plugins/nepalidatepicker/nepaliDatePicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -25,6 +25,7 @@ SET time_zone = "+00:00";
|
|||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `tbl_accategories`
|
-- Table structure for table `tbl_accategories`
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `tbl_accategories` (
|
CREATE TABLE `tbl_accategories` (
|
||||||
|
@ -74,6 +74,12 @@ $route['student/admission_payment'] = 'Student/admission-payment';
|
|||||||
$route['student/get_installdetails'] = 'Student/get-installdetails';
|
$route['student/get_installdetails'] = 'Student/get-installdetails';
|
||||||
$route['student/paypalipn_admission'] = 'Student/paypalipn-admission';
|
$route['student/paypalipn_admission'] = 'Student/paypalipn-admission';
|
||||||
|
|
||||||
|
//inventory
|
||||||
|
$route['inventory/stocks/summary'] = 'Inventory/Stocks/summary';
|
||||||
|
|
||||||
|
|
||||||
|
//inventory ends
|
||||||
|
|
||||||
$route['admin'] = 'Admin/index';
|
$route['admin'] = 'Admin/index';
|
||||||
$route['admin-logout'] = 'Admin/admin_logout';
|
$route['admin-logout'] = 'Admin/admin_logout';
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@
|
|||||||
$('[data-toggle="tooltip"]').tooltip()
|
$('[data-toggle="tooltip"]').tooltip()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
634
composer.lock
generated
634
composer.lock
generated
File diff suppressed because it is too large
Load Diff
2
env (2)
2
env (2)
@ -3,7 +3,7 @@ APP_URL=http://localhost/bbnepal/BBnepal-Accounts
|
|||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=mysql
|
||||||
DB_HOST=127.0.0.1:3309
|
DB_HOST=127.0.0.1:3309
|
||||||
DB_PORT=3309
|
DB_PORT=3309
|
||||||
DATABASE_OPTIONS=bbnepal_accounting,myurlsco_accounts1,myurlsco_accounts2,myurlsco_accounts3
|
DATABASE_OPTIONS=bbnepal_accounting,myurlsco_accounts1,myurlsco_accounts2,myurlsco_accounts3 #given
|
||||||
DB_DATABASE=bbnepal_accounting
|
DB_DATABASE=bbnepal_accounting
|
||||||
DB_USERNAME=root
|
DB_USERNAME=root
|
||||||
DB_PASSWORD=
|
DB_PASSWORD=
|
17
vendor/autoload.php
vendored
17
vendor/autoload.php
vendored
@ -3,8 +3,21 @@
|
|||||||
// autoload.php @generated by Composer
|
// autoload.php @generated by Composer
|
||||||
|
|
||||||
if (PHP_VERSION_ID < 50600) {
|
if (PHP_VERSION_ID < 50600) {
|
||||||
echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
if (!headers_sent()) {
|
||||||
exit(1);
|
header('HTTP/1.1 500 Internal Server Error');
|
||||||
|
}
|
||||||
|
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||||
|
if (!ini_get('display_errors')) {
|
||||||
|
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||||
|
fwrite(STDERR, $err);
|
||||||
|
} elseif (!headers_sent()) {
|
||||||
|
echo $err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
trigger_error(
|
||||||
|
$err,
|
||||||
|
E_USER_ERROR
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
109
vendor/composer/ClassLoader.php
vendored
109
vendor/composer/ClassLoader.php
vendored
@ -42,35 +42,37 @@ namespace Composer\Autoload;
|
|||||||
*/
|
*/
|
||||||
class ClassLoader
|
class ClassLoader
|
||||||
{
|
{
|
||||||
/** @var ?string */
|
/** @var \Closure(string):void */
|
||||||
|
private static $includeFile;
|
||||||
|
|
||||||
|
/** @var string|null */
|
||||||
private $vendorDir;
|
private $vendorDir;
|
||||||
|
|
||||||
// PSR-4
|
// PSR-4
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var array<string, array<string, int>>
|
||||||
* @psalm-var array<string, array<string, int>>
|
|
||||||
*/
|
*/
|
||||||
private $prefixLengthsPsr4 = array();
|
private $prefixLengthsPsr4 = array();
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var array<string, list<string>>
|
||||||
* @psalm-var array<string, array<int, string>>
|
|
||||||
*/
|
*/
|
||||||
private $prefixDirsPsr4 = array();
|
private $prefixDirsPsr4 = array();
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var list<string>
|
||||||
* @psalm-var array<string, string>
|
|
||||||
*/
|
*/
|
||||||
private $fallbackDirsPsr4 = array();
|
private $fallbackDirsPsr4 = array();
|
||||||
|
|
||||||
// PSR-0
|
// PSR-0
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* List of PSR-0 prefixes
|
||||||
* @psalm-var array<string, array<string, string[]>>
|
*
|
||||||
|
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||||
|
*
|
||||||
|
* @var array<string, array<string, list<string>>>
|
||||||
*/
|
*/
|
||||||
private $prefixesPsr0 = array();
|
private $prefixesPsr0 = array();
|
||||||
/**
|
/**
|
||||||
* @var array[]
|
* @var list<string>
|
||||||
* @psalm-var array<string, string>
|
|
||||||
*/
|
*/
|
||||||
private $fallbackDirsPsr0 = array();
|
private $fallbackDirsPsr0 = array();
|
||||||
|
|
||||||
@ -78,8 +80,7 @@ class ClassLoader
|
|||||||
private $useIncludePath = false;
|
private $useIncludePath = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]
|
* @var array<string, string>
|
||||||
* @psalm-var array<string, string>
|
|
||||||
*/
|
*/
|
||||||
private $classMap = array();
|
private $classMap = array();
|
||||||
|
|
||||||
@ -87,29 +88,29 @@ class ClassLoader
|
|||||||
private $classMapAuthoritative = false;
|
private $classMapAuthoritative = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool[]
|
* @var array<string, bool>
|
||||||
* @psalm-var array<string, bool>
|
|
||||||
*/
|
*/
|
||||||
private $missingClasses = array();
|
private $missingClasses = array();
|
||||||
|
|
||||||
/** @var ?string */
|
/** @var string|null */
|
||||||
private $apcuPrefix;
|
private $apcuPrefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var self[]
|
* @var array<string, self>
|
||||||
*/
|
*/
|
||||||
private static $registeredLoaders = array();
|
private static $registeredLoaders = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ?string $vendorDir
|
* @param string|null $vendorDir
|
||||||
*/
|
*/
|
||||||
public function __construct($vendorDir = null)
|
public function __construct($vendorDir = null)
|
||||||
{
|
{
|
||||||
$this->vendorDir = $vendorDir;
|
$this->vendorDir = $vendorDir;
|
||||||
|
self::initializeIncludeClosure();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[]
|
* @return array<string, list<string>>
|
||||||
*/
|
*/
|
||||||
public function getPrefixes()
|
public function getPrefixes()
|
||||||
{
|
{
|
||||||
@ -121,8 +122,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return array<string, list<string>>
|
||||||
* @psalm-return array<string, array<int, string>>
|
|
||||||
*/
|
*/
|
||||||
public function getPrefixesPsr4()
|
public function getPrefixesPsr4()
|
||||||
{
|
{
|
||||||
@ -130,8 +130,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return list<string>
|
||||||
* @psalm-return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public function getFallbackDirs()
|
public function getFallbackDirs()
|
||||||
{
|
{
|
||||||
@ -139,8 +138,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return list<string>
|
||||||
* @psalm-return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public function getFallbackDirsPsr4()
|
public function getFallbackDirsPsr4()
|
||||||
{
|
{
|
||||||
@ -148,8 +146,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string[] Array of classname => path
|
* @return array<string, string> Array of classname => path
|
||||||
* @psalm-return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public function getClassMap()
|
public function getClassMap()
|
||||||
{
|
{
|
||||||
@ -157,8 +154,7 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string[] $classMap Class to filename map
|
* @param array<string, string> $classMap Class to filename map
|
||||||
* @psalm-param array<string, string> $classMap
|
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -176,23 +172,24 @@ class ClassLoader
|
|||||||
* appending or prepending to the ones previously set for this prefix.
|
* appending or prepending to the ones previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param string[]|string $paths The PSR-0 root directories
|
* @param list<string>|string $paths The PSR-0 root directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function add($prefix, $paths, $prepend = false)
|
public function add($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
|
$paths = (array) $paths;
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->fallbackDirsPsr0
|
$this->fallbackDirsPsr0
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr0 = array_merge(
|
$this->fallbackDirsPsr0 = array_merge(
|
||||||
$this->fallbackDirsPsr0,
|
$this->fallbackDirsPsr0,
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,19 +198,19 @@ class ClassLoader
|
|||||||
|
|
||||||
$first = $prefix[0];
|
$first = $prefix[0];
|
||||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->prefixesPsr0[$first][$prefix]
|
$this->prefixesPsr0[$first][$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||||
$this->prefixesPsr0[$first][$prefix],
|
$this->prefixesPsr0[$first][$prefix],
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,7 +220,7 @@ class ClassLoader
|
|||||||
* appending or prepending to the ones previously set for this namespace.
|
* appending or prepending to the ones previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param string[]|string $paths The PSR-4 base directories
|
* @param list<string>|string $paths The PSR-4 base directories
|
||||||
* @param bool $prepend Whether to prepend the directories
|
* @param bool $prepend Whether to prepend the directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
@ -232,17 +229,18 @@ class ClassLoader
|
|||||||
*/
|
*/
|
||||||
public function addPsr4($prefix, $paths, $prepend = false)
|
public function addPsr4($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
|
$paths = (array) $paths;
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
// Register directories for the root namespace.
|
// Register directories for the root namespace.
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->fallbackDirsPsr4
|
$this->fallbackDirsPsr4
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$this->fallbackDirsPsr4 = array_merge(
|
$this->fallbackDirsPsr4 = array_merge(
|
||||||
$this->fallbackDirsPsr4,
|
$this->fallbackDirsPsr4,
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||||
@ -252,18 +250,18 @@ class ClassLoader
|
|||||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||||
}
|
}
|
||||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||||
} elseif ($prepend) {
|
} elseif ($prepend) {
|
||||||
// Prepend directories for an already registered namespace.
|
// Prepend directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
(array) $paths,
|
$paths,
|
||||||
$this->prefixDirsPsr4[$prefix]
|
$this->prefixDirsPsr4[$prefix]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Append directories for an already registered namespace.
|
// Append directories for an already registered namespace.
|
||||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||||
$this->prefixDirsPsr4[$prefix],
|
$this->prefixDirsPsr4[$prefix],
|
||||||
(array) $paths
|
$paths
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,7 +271,7 @@ class ClassLoader
|
|||||||
* replacing any others previously set for this prefix.
|
* replacing any others previously set for this prefix.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix
|
* @param string $prefix The prefix
|
||||||
* @param string[]|string $paths The PSR-0 base directories
|
* @param list<string>|string $paths The PSR-0 base directories
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -291,7 +289,7 @@ class ClassLoader
|
|||||||
* replacing any others previously set for this namespace.
|
* replacing any others previously set for this namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||||
* @param string[]|string $paths The PSR-4 base directories
|
* @param list<string>|string $paths The PSR-4 base directories
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*
|
*
|
||||||
@ -425,7 +423,8 @@ class ClassLoader
|
|||||||
public function loadClass($class)
|
public function loadClass($class)
|
||||||
{
|
{
|
||||||
if ($file = $this->findFile($class)) {
|
if ($file = $this->findFile($class)) {
|
||||||
includeFile($file);
|
$includeFile = self::$includeFile;
|
||||||
|
$includeFile($file);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -476,9 +475,9 @@ class ClassLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||||
*
|
*
|
||||||
* @return self[]
|
* @return array<string, self>
|
||||||
*/
|
*/
|
||||||
public static function getRegisteredLoaders()
|
public static function getRegisteredLoaders()
|
||||||
{
|
{
|
||||||
@ -555,18 +554,26 @@ class ClassLoader
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private static function initializeIncludeClosure()
|
||||||
|
{
|
||||||
|
if (self::$includeFile !== null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* Scope isolated include.
|
* Scope isolated include.
|
||||||
*
|
*
|
||||||
* Prevents access to $this/self from included files.
|
* Prevents access to $this/self from included files.
|
||||||
*
|
*
|
||||||
* @param string $file
|
* @param string $file
|
||||||
* @return void
|
* @return void
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
function includeFile($file)
|
self::$includeFile = \Closure::bind(static function($file) {
|
||||||
{
|
|
||||||
include $file;
|
include $file;
|
||||||
|
}, null, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
15
vendor/composer/InstalledVersions.php
vendored
15
vendor/composer/InstalledVersions.php
vendored
@ -98,7 +98,7 @@ class InstalledVersions
|
|||||||
{
|
{
|
||||||
foreach (self::getInstalled() as $installed) {
|
foreach (self::getInstalled() as $installed) {
|
||||||
if (isset($installed['versions'][$packageName])) {
|
if (isset($installed['versions'][$packageName])) {
|
||||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ class InstalledVersions
|
|||||||
*/
|
*/
|
||||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||||
{
|
{
|
||||||
$constraint = $parser->parseConstraints($constraint);
|
$constraint = $parser->parseConstraints((string) $constraint);
|
||||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||||
|
|
||||||
return $provided->matches($constraint);
|
return $provided->matches($constraint);
|
||||||
@ -328,7 +328,9 @@ class InstalledVersions
|
|||||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir];
|
$installed[] = self::$installedByVendor[$vendorDir];
|
||||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||||
|
$required = require $vendorDir.'/composer/installed.php';
|
||||||
|
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||||
self::$installed = $installed[count($installed) - 1];
|
self::$installed = $installed[count($installed) - 1];
|
||||||
}
|
}
|
||||||
@ -340,12 +342,17 @@ class InstalledVersions
|
|||||||
// only require the installed.php file if this file is loaded from its dumped location,
|
// only require the installed.php file if this file is loaded from its dumped location,
|
||||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||||
self::$installed = require __DIR__ . '/installed.php';
|
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||||
|
$required = require __DIR__ . '/installed.php';
|
||||||
|
self::$installed = $required;
|
||||||
} else {
|
} else {
|
||||||
self::$installed = array();
|
self::$installed = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self::$installed !== array()) {
|
||||||
$installed[] = self::$installed;
|
$installed[] = self::$installed;
|
||||||
|
}
|
||||||
|
|
||||||
return $installed;
|
return $installed;
|
||||||
}
|
}
|
||||||
|
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
@ -471,6 +471,5 @@ return array(
|
|||||||
'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => $vendorDir . '/sebastian/recursion-context/src/InvalidArgumentException.php',
|
'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => $vendorDir . '/sebastian/recursion-context/src/InvalidArgumentException.php',
|
||||||
'SebastianBergmann\\ResourceOperations\\ResourceOperations' => $vendorDir . '/sebastian/resource-operations/src/ResourceOperations.php',
|
'SebastianBergmann\\ResourceOperations\\ResourceOperations' => $vendorDir . '/sebastian/resource-operations/src/ResourceOperations.php',
|
||||||
'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php',
|
'SebastianBergmann\\Version' => $vendorDir . '/sebastian/version/src/Version.php',
|
||||||
'Stringable' => $vendorDir . '/myclabs/php-enum/stubs/Stringable.php',
|
|
||||||
'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php',
|
'Text_Template' => $vendorDir . '/phpunit/php-text-template/src/Template.php',
|
||||||
);
|
);
|
||||||
|
3
vendor/composer/autoload_files.php
vendored
3
vendor/composer/autoload_files.php
vendored
@ -7,11 +7,8 @@ $baseDir = dirname($vendorDir);
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||||
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
|
|
||||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
|
||||||
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
|
|
||||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||||
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||||
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
|
'3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php',
|
||||||
|
1
vendor/composer/autoload_namespaces.php
vendored
1
vendor/composer/autoload_namespaces.php
vendored
@ -7,5 +7,4 @@ $baseDir = dirname($vendorDir);
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'org\\bovigo\\vfs' => array($vendorDir . '/mikey179/vfsstream/src/main/php'),
|
'org\\bovigo\\vfs' => array($vendorDir . '/mikey179/vfsstream/src/main/php'),
|
||||||
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
|
|
||||||
);
|
);
|
||||||
|
6
vendor/composer/autoload_psr4.php
vendored
6
vendor/composer/autoload_psr4.php
vendored
@ -9,23 +9,23 @@ return array(
|
|||||||
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'),
|
'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'),
|
||||||
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
|
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
|
||||||
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
|
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
|
||||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
|
||||||
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||||
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
|
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
|
||||||
'Pusher\\' => array($vendorDir . '/pusher/pusher-php-server/src'),
|
'Pusher\\' => array($vendorDir . '/pusher/pusher-php-server/src'),
|
||||||
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
|
||||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
|
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
|
||||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
|
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
|
||||||
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
|
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
|
||||||
'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'),
|
'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'),
|
||||||
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
|
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
|
||||||
|
'PHPStan\\PhpDocParser\\' => array($vendorDir . '/phpstan/phpdoc-parser/src'),
|
||||||
'Nilambar\\NepaliDate\\' => array($vendorDir . '/ernilambar/nepali-date/src'),
|
'Nilambar\\NepaliDate\\' => array($vendorDir . '/ernilambar/nepali-date/src'),
|
||||||
'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),
|
|
||||||
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
|
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
|
||||||
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
|
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
|
||||||
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
|
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
|
||||||
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
|
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
|
||||||
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
|
'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'),
|
||||||
|
'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'),
|
||||||
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
|
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
|
||||||
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
|
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
|
||||||
);
|
);
|
||||||
|
25
vendor/composer/autoload_real.php
vendored
25
vendor/composer/autoload_real.php
vendored
@ -31,25 +31,18 @@ class ComposerAutoloaderInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
|
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$includeFiles = \Composer\Autoload\ComposerStaticInitade43c0983b611153cb43d6dce42fdb7::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInitade43c0983b611153cb43d6dce42fdb7::$files;
|
||||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
composerRequireade43c0983b611153cb43d6dce42fdb7($fileIdentifier, $file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $loader;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $fileIdentifier
|
|
||||||
* @param string $file
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function composerRequireade43c0983b611153cb43d6dce42fdb7($fileIdentifier, $file)
|
|
||||||
{
|
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
||||||
require $file;
|
require $file;
|
||||||
}
|
}
|
||||||
|
}, null, null);
|
||||||
|
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||||
|
$requireFile($fileIdentifier, $file);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $loader;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
33
vendor/composer/autoload_static.php
vendored
33
vendor/composer/autoload_static.php
vendored
@ -8,11 +8,8 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||||
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
|
|
||||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
|
||||||
'2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
|
|
||||||
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
|
||||||
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
'6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||||
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
|
'3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php',
|
||||||
@ -33,7 +30,6 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
),
|
),
|
||||||
'S' =>
|
'S' =>
|
||||||
array (
|
array (
|
||||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
|
||||||
'Symfony\\Polyfill\\Ctype\\' => 23,
|
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||||
'Symfony\\Component\\Yaml\\' => 23,
|
'Symfony\\Component\\Yaml\\' => 23,
|
||||||
),
|
),
|
||||||
@ -46,6 +42,7 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
'Psr\\Http\\Client\\' => 16,
|
'Psr\\Http\\Client\\' => 16,
|
||||||
'Prophecy\\' => 9,
|
'Prophecy\\' => 9,
|
||||||
'PhpOffice\\PhpSpreadsheet\\' => 25,
|
'PhpOffice\\PhpSpreadsheet\\' => 25,
|
||||||
|
'PHPStan\\PhpDocParser\\' => 21,
|
||||||
),
|
),
|
||||||
'N' =>
|
'N' =>
|
||||||
array (
|
array (
|
||||||
@ -53,7 +50,6 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
),
|
),
|
||||||
'M' =>
|
'M' =>
|
||||||
array (
|
array (
|
||||||
'MyCLabs\\Enum\\' => 13,
|
|
||||||
'Matrix\\' => 7,
|
'Matrix\\' => 7,
|
||||||
),
|
),
|
||||||
'G' =>
|
'G' =>
|
||||||
@ -65,6 +61,7 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
'D' =>
|
'D' =>
|
||||||
array (
|
array (
|
||||||
'Doctrine\\Instantiator\\' => 22,
|
'Doctrine\\Instantiator\\' => 22,
|
||||||
|
'Doctrine\\Deprecations\\' => 22,
|
||||||
'DeepCopy\\' => 9,
|
'DeepCopy\\' => 9,
|
||||||
),
|
),
|
||||||
'C' =>
|
'C' =>
|
||||||
@ -88,10 +85,6 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/webmozart/assert/src',
|
0 => __DIR__ . '/..' . '/webmozart/assert/src',
|
||||||
),
|
),
|
||||||
'Symfony\\Polyfill\\Mbstring\\' =>
|
|
||||||
array (
|
|
||||||
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
|
|
||||||
),
|
|
||||||
'Symfony\\Polyfill\\Ctype\\' =>
|
'Symfony\\Polyfill\\Ctype\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||||
@ -110,7 +103,7 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
),
|
),
|
||||||
'Psr\\Log\\' =>
|
'Psr\\Log\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
|
0 => __DIR__ . '/..' . '/psr/log/src',
|
||||||
),
|
),
|
||||||
'Psr\\Http\\Message\\' =>
|
'Psr\\Http\\Message\\' =>
|
||||||
array (
|
array (
|
||||||
@ -129,14 +122,14 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
|
0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
|
||||||
),
|
),
|
||||||
|
'PHPStan\\PhpDocParser\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src',
|
||||||
|
),
|
||||||
'Nilambar\\NepaliDate\\' =>
|
'Nilambar\\NepaliDate\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/ernilambar/nepali-date/src',
|
0 => __DIR__ . '/..' . '/ernilambar/nepali-date/src',
|
||||||
),
|
),
|
||||||
'MyCLabs\\Enum\\' =>
|
|
||||||
array (
|
|
||||||
0 => __DIR__ . '/..' . '/myclabs/php-enum/src',
|
|
||||||
),
|
|
||||||
'Matrix\\' =>
|
'Matrix\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
|
0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
|
||||||
@ -157,6 +150,10 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator',
|
0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator',
|
||||||
),
|
),
|
||||||
|
'Doctrine\\Deprecations\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations',
|
||||||
|
),
|
||||||
'DeepCopy\\' =>
|
'DeepCopy\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy',
|
0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy',
|
||||||
@ -175,13 +172,6 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
0 => __DIR__ . '/..' . '/mikey179/vfsstream/src/main/php',
|
0 => __DIR__ . '/..' . '/mikey179/vfsstream/src/main/php',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'H' =>
|
|
||||||
array (
|
|
||||||
'HTMLPurifier' =>
|
|
||||||
array (
|
|
||||||
0 => __DIR__ . '/..' . '/ezyang/htmlpurifier/library',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
public static $classMap = array (
|
public static $classMap = array (
|
||||||
@ -650,7 +640,6 @@ class ComposerStaticInitade43c0983b611153cb43d6dce42fdb7
|
|||||||
'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/recursion-context/src/InvalidArgumentException.php',
|
'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/recursion-context/src/InvalidArgumentException.php',
|
||||||
'SebastianBergmann\\ResourceOperations\\ResourceOperations' => __DIR__ . '/..' . '/sebastian/resource-operations/src/ResourceOperations.php',
|
'SebastianBergmann\\ResourceOperations\\ResourceOperations' => __DIR__ . '/..' . '/sebastian/resource-operations/src/ResourceOperations.php',
|
||||||
'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php',
|
'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php',
|
||||||
'Stringable' => __DIR__ . '/..' . '/myclabs/php-enum/stubs/Stringable.php',
|
|
||||||
'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php',
|
'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
731
vendor/composer/installed.json
vendored
731
vendor/composer/installed.json
vendored
File diff suppressed because it is too large
Load Diff
171
vendor/composer/installed.php
vendored
171
vendor/composer/installed.php
vendored
@ -1,9 +1,9 @@
|
|||||||
<?php return array(
|
<?php return array(
|
||||||
'root' => array(
|
'root' => array(
|
||||||
'name' => 'codeigniter/framework',
|
'name' => 'codeigniter/framework',
|
||||||
'pretty_version' => '1.0.0+no-version-set',
|
'pretty_version' => 'dev-main',
|
||||||
'version' => '1.0.0.0',
|
'version' => 'dev-main',
|
||||||
'reference' => NULL,
|
'reference' => '497f567cba71733b286514954ef72c9fe5d46c51',
|
||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -11,14 +11,23 @@
|
|||||||
),
|
),
|
||||||
'versions' => array(
|
'versions' => array(
|
||||||
'codeigniter/framework' => array(
|
'codeigniter/framework' => array(
|
||||||
'pretty_version' => '1.0.0+no-version-set',
|
'pretty_version' => 'dev-main',
|
||||||
'version' => '1.0.0.0',
|
'version' => 'dev-main',
|
||||||
'reference' => NULL,
|
'reference' => '497f567cba71733b286514954ef72c9fe5d46c51',
|
||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
|
'doctrine/deprecations' => array(
|
||||||
|
'pretty_version' => '1.1.3',
|
||||||
|
'version' => '1.1.3.0',
|
||||||
|
'reference' => 'dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab',
|
||||||
|
'type' => 'library',
|
||||||
|
'install_path' => __DIR__ . '/../doctrine/deprecations',
|
||||||
|
'aliases' => array(),
|
||||||
|
'dev_requirement' => true,
|
||||||
|
),
|
||||||
'doctrine/instantiator' => array(
|
'doctrine/instantiator' => array(
|
||||||
'pretty_version' => '1.5.0',
|
'pretty_version' => '1.5.0',
|
||||||
'version' => '1.5.0.0',
|
'version' => '1.5.0.0',
|
||||||
@ -29,54 +38,45 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'ernilambar/nepali-date' => array(
|
'ernilambar/nepali-date' => array(
|
||||||
'pretty_version' => '1.0.5',
|
'pretty_version' => '1.0.7',
|
||||||
'version' => '1.0.5.0',
|
'version' => '1.0.7.0',
|
||||||
'reference' => '8ac91a49267e3821bf03f052d3cb6b7876af4a12',
|
'reference' => '886dcb25b10760b4f9c35083d0a1d3ef6fb98584',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../ernilambar/nepali-date',
|
'install_path' => __DIR__ . '/../ernilambar/nepali-date',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'ezyang/htmlpurifier' => array(
|
|
||||||
'pretty_version' => 'v4.16.0',
|
|
||||||
'version' => '4.16.0.0',
|
|
||||||
'reference' => '523407fb06eb9e5f3d59889b3978d5bfe94299c8',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../ezyang/htmlpurifier',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'guzzlehttp/guzzle' => array(
|
'guzzlehttp/guzzle' => array(
|
||||||
'pretty_version' => '7.5.0',
|
'pretty_version' => '7.9.2',
|
||||||
'version' => '7.5.0.0',
|
'version' => '7.9.2.0',
|
||||||
'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba',
|
'reference' => 'd281ed313b989f213357e3be1a179f02196ac99b',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
|
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'guzzlehttp/promises' => array(
|
'guzzlehttp/promises' => array(
|
||||||
'pretty_version' => '1.5.2',
|
'pretty_version' => '2.0.3',
|
||||||
'version' => '1.5.2.0',
|
'version' => '2.0.3.0',
|
||||||
'reference' => 'b94b2807d85443f9719887892882d0329d1e2598',
|
'reference' => '6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../guzzlehttp/promises',
|
'install_path' => __DIR__ . '/../guzzlehttp/promises',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'guzzlehttp/psr7' => array(
|
'guzzlehttp/psr7' => array(
|
||||||
'pretty_version' => '2.4.3',
|
'pretty_version' => '2.7.0',
|
||||||
'version' => '2.4.3.0',
|
'version' => '2.7.0.0',
|
||||||
'reference' => '67c26b443f348a51926030c83481b85718457d3d',
|
'reference' => 'a70f5c95fb43bc83f07c9c948baa0dc1829bf201',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
|
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'maennchen/zipstream-php' => array(
|
'maennchen/zipstream-php' => array(
|
||||||
'pretty_version' => '2.2.6',
|
'pretty_version' => '3.1.0',
|
||||||
'version' => '2.2.6.0',
|
'version' => '3.1.0.0',
|
||||||
'reference' => '30ad6f93cf3efe4192bc7a4c9cad11ff8f4f237f',
|
'reference' => 'b8174494eda667f7d13876b4a7bfef0f62a7c0d1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../maennchen/zipstream-php',
|
'install_path' => __DIR__ . '/../maennchen/zipstream-php',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -110,23 +110,14 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'myclabs/deep-copy' => array(
|
'myclabs/deep-copy' => array(
|
||||||
'pretty_version' => '1.11.0',
|
'pretty_version' => '1.12.0',
|
||||||
'version' => '1.11.0.0',
|
'version' => '1.12.0.0',
|
||||||
'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614',
|
'reference' => '3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../myclabs/deep-copy',
|
'install_path' => __DIR__ . '/../myclabs/deep-copy',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'myclabs/php-enum' => array(
|
|
||||||
'pretty_version' => '1.8.4',
|
|
||||||
'version' => '1.8.4.0',
|
|
||||||
'reference' => 'a867478eae49c9f59ece437ae7f9506bfaa27483',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../myclabs/php-enum',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'paragonie/random_compat' => array(
|
'paragonie/random_compat' => array(
|
||||||
'pretty_version' => 'v9.99.100',
|
'pretty_version' => 'v9.99.100',
|
||||||
'version' => '9.99.100.0',
|
'version' => '9.99.100.0',
|
||||||
@ -137,9 +128,9 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'paragonie/sodium_compat' => array(
|
'paragonie/sodium_compat' => array(
|
||||||
'pretty_version' => 'v1.19.0',
|
'pretty_version' => 'v1.21.1',
|
||||||
'version' => '1.19.0.0',
|
'version' => '1.21.1.0',
|
||||||
'reference' => 'cb15e403ecbe6a6cc515f855c310eb6b1872a933',
|
'reference' => 'bb312875dcdd20680419564fe42ba1d9564b9e37',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../paragonie/sodium_compat',
|
'install_path' => __DIR__ . '/../paragonie/sodium_compat',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -155,27 +146,27 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'phpdocumentor/reflection-docblock' => array(
|
'phpdocumentor/reflection-docblock' => array(
|
||||||
'pretty_version' => '5.3.0',
|
'pretty_version' => '5.4.1',
|
||||||
'version' => '5.3.0.0',
|
'version' => '5.4.1.0',
|
||||||
'reference' => '622548b623e81ca6d78b721c5e029f4ce664f170',
|
'reference' => '9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock',
|
'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'phpdocumentor/type-resolver' => array(
|
'phpdocumentor/type-resolver' => array(
|
||||||
'pretty_version' => '1.6.2',
|
'pretty_version' => '1.8.2',
|
||||||
'version' => '1.6.2.0',
|
'version' => '1.8.2.0',
|
||||||
'reference' => '48f445a408c131e38cab1c235aa6d2bb7a0bb20d',
|
'reference' => '153ae662783729388a584b4361f2545e4d841e3c',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
|
'install_path' => __DIR__ . '/../phpdocumentor/type-resolver',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'phpoffice/phpspreadsheet' => array(
|
'phpoffice/phpspreadsheet' => array(
|
||||||
'pretty_version' => '1.26.0',
|
'pretty_version' => '2.2.2',
|
||||||
'version' => '1.26.0.0',
|
'version' => '2.2.2.0',
|
||||||
'reference' => '5b6ceea9705b068f993e268e4debc566c2637063',
|
'reference' => 'ffbcee68069b073bff07a71eb321dcd9f2763513',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
|
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -190,6 +181,15 @@
|
|||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
|
'phpstan/phpdoc-parser' => array(
|
||||||
|
'pretty_version' => '1.31.0',
|
||||||
|
'version' => '1.31.0.0',
|
||||||
|
'reference' => '249f15fb843bf240cf058372dad29e100cee6c17',
|
||||||
|
'type' => 'library',
|
||||||
|
'install_path' => __DIR__ . '/../phpstan/phpdoc-parser',
|
||||||
|
'aliases' => array(),
|
||||||
|
'dev_requirement' => true,
|
||||||
|
),
|
||||||
'phpunit/php-code-coverage' => array(
|
'phpunit/php-code-coverage' => array(
|
||||||
'pretty_version' => '4.0.8',
|
'pretty_version' => '4.0.8',
|
||||||
'version' => '4.0.8.0',
|
'version' => '4.0.8.0',
|
||||||
@ -254,9 +254,9 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'psr/http-client' => array(
|
'psr/http-client' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '1.0.3',
|
||||||
'version' => '1.0.1.0',
|
'version' => '1.0.3.0',
|
||||||
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
|
'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/http-client',
|
'install_path' => __DIR__ . '/../psr/http-client',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -269,9 +269,9 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'psr/http-factory' => array(
|
'psr/http-factory' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '1.1.0',
|
||||||
'version' => '1.0.1.0',
|
'version' => '1.1.0.0',
|
||||||
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
|
'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/http-factory',
|
'install_path' => __DIR__ . '/../psr/http-factory',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -284,9 +284,9 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'psr/http-message' => array(
|
'psr/http-message' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '2.0',
|
||||||
'version' => '1.0.1.0',
|
'version' => '2.0.0.0',
|
||||||
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
|
'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/http-message',
|
'install_path' => __DIR__ . '/../psr/http-message',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -299,27 +299,27 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
'psr/log' => array(
|
'psr/log' => array(
|
||||||
'pretty_version' => '1.1.4',
|
'pretty_version' => '3.0.2',
|
||||||
'version' => '1.1.4.0',
|
'version' => '3.0.2.0',
|
||||||
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
|
'reference' => 'f16e1d5863e37f8d8c2a01719f5b34baa2b714d3',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/log',
|
'install_path' => __DIR__ . '/../psr/log',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'psr/simple-cache' => array(
|
'psr/simple-cache' => array(
|
||||||
'pretty_version' => '1.0.1',
|
'pretty_version' => '3.0.0',
|
||||||
'version' => '1.0.1.0',
|
'version' => '3.0.0.0',
|
||||||
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
|
'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../psr/simple-cache',
|
'install_path' => __DIR__ . '/../psr/simple-cache',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'pusher/pusher-php-server' => array(
|
'pusher/pusher-php-server' => array(
|
||||||
'pretty_version' => '7.2.2',
|
'pretty_version' => '7.2.4',
|
||||||
'version' => '7.2.2.0',
|
'version' => '7.2.4.0',
|
||||||
'reference' => '4ace4873873b06c25cecb2dd6d9fdcbf2f20b640',
|
'reference' => 'de2f72296808f9cafa6a4462b15a768ff130cddb',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../pusher/pusher-php-server',
|
'install_path' => __DIR__ . '/../pusher/pusher-php-server',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -335,9 +335,9 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'sebastian/code-unit-reverse-lookup' => array(
|
'sebastian/code-unit-reverse-lookup' => array(
|
||||||
'pretty_version' => '1.0.2',
|
'pretty_version' => '1.0.3',
|
||||||
'version' => '1.0.2.0',
|
'version' => '1.0.3.0',
|
||||||
'reference' => '1de8cd5c010cb153fcd68b8d0f64606f523f7619',
|
'reference' => '92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
|
'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@ -425,32 +425,23 @@
|
|||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'symfony/deprecation-contracts' => array(
|
'symfony/deprecation-contracts' => array(
|
||||||
'pretty_version' => 'v2.5.2',
|
'pretty_version' => 'v3.5.0',
|
||||||
'version' => '2.5.2.0',
|
'version' => '3.5.0.0',
|
||||||
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
|
'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-ctype' => array(
|
'symfony/polyfill-ctype' => array(
|
||||||
'pretty_version' => 'v1.27.0',
|
'pretty_version' => 'v1.31.0',
|
||||||
'version' => '1.27.0.0',
|
'version' => '1.31.0.0',
|
||||||
'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a',
|
'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => true,
|
'dev_requirement' => true,
|
||||||
),
|
),
|
||||||
'symfony/polyfill-mbstring' => array(
|
|
||||||
'pretty_version' => 'v1.27.0',
|
|
||||||
'version' => '1.27.0.0',
|
|
||||||
'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534',
|
|
||||||
'type' => 'library',
|
|
||||||
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
|
||||||
'aliases' => array(),
|
|
||||||
'dev_requirement' => false,
|
|
||||||
),
|
|
||||||
'symfony/yaml' => array(
|
'symfony/yaml' => array(
|
||||||
'pretty_version' => 'v4.4.45',
|
'pretty_version' => 'v4.4.45',
|
||||||
'version' => '4.4.45.0',
|
'version' => '4.4.45.0',
|
||||||
|
19
vendor/doctrine/deprecations/LICENSE
vendored
Normal file
19
vendor/doctrine/deprecations/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2020-2021 Doctrine Project
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
157
vendor/doctrine/deprecations/README.md
vendored
Normal file
157
vendor/doctrine/deprecations/README.md
vendored
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
# Doctrine Deprecations
|
||||||
|
|
||||||
|
A small (side-effect free by default) layer on top of
|
||||||
|
`trigger_error(E_USER_DEPRECATED)` or PSR-3 logging.
|
||||||
|
|
||||||
|
- no side-effects by default, making it a perfect fit for libraries that don't know how the error handler works they operate under
|
||||||
|
- options to avoid having to rely on error handlers global state by using PSR-3 logging
|
||||||
|
- deduplicate deprecation messages to avoid excessive triggering and reduce overhead
|
||||||
|
|
||||||
|
We recommend to collect Deprecations using a PSR logger instead of relying on
|
||||||
|
the global error handler.
|
||||||
|
|
||||||
|
## Usage from consumer perspective:
|
||||||
|
|
||||||
|
Enable Doctrine deprecations to be sent to a PSR3 logger:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::enableWithPsrLogger($logger);
|
||||||
|
```
|
||||||
|
|
||||||
|
Enable Doctrine deprecations to be sent as `@trigger_error($message, E_USER_DEPRECATED)`
|
||||||
|
messages by setting the `DOCTRINE_DEPRECATIONS` environment variable to `trigger`.
|
||||||
|
Alternatively, call:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::enableWithTriggerError();
|
||||||
|
```
|
||||||
|
|
||||||
|
If you only want to enable deprecation tracking, without logging or calling `trigger_error`
|
||||||
|
then set the `DOCTRINE_DEPRECATIONS` environment variable to `track`.
|
||||||
|
Alternatively, call:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::enableTrackingDeprecations();
|
||||||
|
```
|
||||||
|
|
||||||
|
Tracking is enabled with all three modes and provides access to all triggered
|
||||||
|
deprecations and their individual count:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$deprecations = \Doctrine\Deprecations\Deprecation::getTriggeredDeprecations();
|
||||||
|
|
||||||
|
foreach ($deprecations as $identifier => $count) {
|
||||||
|
echo $identifier . " was triggered " . $count . " times\n";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Suppressing Specific Deprecations
|
||||||
|
|
||||||
|
Disable triggering about specific deprecations:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::ignoreDeprecations("https://link/to/deprecations-description-identifier");
|
||||||
|
```
|
||||||
|
|
||||||
|
Disable all deprecations from a package
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::ignorePackage("doctrine/orm");
|
||||||
|
```
|
||||||
|
|
||||||
|
### Other Operations
|
||||||
|
|
||||||
|
When used within PHPUnit or other tools that could collect multiple instances of the same deprecations
|
||||||
|
the deduplication can be disabled:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::withoutDeduplication();
|
||||||
|
```
|
||||||
|
|
||||||
|
Disable deprecation tracking again:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::disable();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage from a library/producer perspective:
|
||||||
|
|
||||||
|
When you want to unconditionally trigger a deprecation even when called
|
||||||
|
from the library itself then the `trigger` method is the way to go:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::trigger(
|
||||||
|
"doctrine/orm",
|
||||||
|
"https://link/to/deprecations-description",
|
||||||
|
"message"
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
If variable arguments are provided at the end, they are used with `sprintf` on
|
||||||
|
the message.
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::trigger(
|
||||||
|
"doctrine/orm",
|
||||||
|
"https://github.com/doctrine/orm/issue/1234",
|
||||||
|
"message %s %d",
|
||||||
|
"foo",
|
||||||
|
1234
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
When you want to trigger a deprecation only when it is called by a function
|
||||||
|
outside of the current package, but not trigger when the package itself is the cause,
|
||||||
|
then use:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Doctrine\Deprecations\Deprecation::triggerIfCalledFromOutside(
|
||||||
|
"doctrine/orm",
|
||||||
|
"https://link/to/deprecations-description",
|
||||||
|
"message"
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
Based on the issue link each deprecation message is only triggered once per
|
||||||
|
request.
|
||||||
|
|
||||||
|
A limited stacktrace is included in the deprecation message to find the
|
||||||
|
offending location.
|
||||||
|
|
||||||
|
Note: A producer/library should never call `Deprecation::enableWith` methods
|
||||||
|
and leave the decision how to handle deprecations to application and
|
||||||
|
frameworks.
|
||||||
|
|
||||||
|
## Usage in PHPUnit tests
|
||||||
|
|
||||||
|
There is a `VerifyDeprecations` trait that you can use to make assertions on
|
||||||
|
the occurrence of deprecations within a test.
|
||||||
|
|
||||||
|
```php
|
||||||
|
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
|
||||||
|
|
||||||
|
class MyTest extends TestCase
|
||||||
|
{
|
||||||
|
use VerifyDeprecations;
|
||||||
|
|
||||||
|
public function testSomethingDeprecation()
|
||||||
|
{
|
||||||
|
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issue/1234');
|
||||||
|
|
||||||
|
triggerTheCodeWithDeprecation();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSomethingDeprecationFixed()
|
||||||
|
{
|
||||||
|
$this->expectNoDeprecationWithIdentifier('https://github.com/doctrine/orm/issue/1234');
|
||||||
|
|
||||||
|
triggerTheCodeWithoutDeprecation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## What is a deprecation identifier?
|
||||||
|
|
||||||
|
An identifier for deprecations is just a link to any resource, most often a
|
||||||
|
Github Issue or Pull Request explaining the deprecation and potentially its
|
||||||
|
alternative.
|
38
vendor/doctrine/deprecations/composer.json
vendored
Normal file
38
vendor/doctrine/deprecations/composer.json
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"name": "doctrine/deprecations",
|
||||||
|
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "library",
|
||||||
|
"homepage": "https://www.doctrine-project.org/",
|
||||||
|
"require": {
|
||||||
|
"php": "^7.1 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/coding-standard": "^9",
|
||||||
|
"phpstan/phpstan": "1.4.10 || 1.10.15",
|
||||||
|
"phpstan/phpstan-phpunit": "^1.0",
|
||||||
|
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
|
||||||
|
"psalm/plugin-phpunit": "0.18.4",
|
||||||
|
"psr/log": "^1 || ^2 || ^3",
|
||||||
|
"vimeo/psalm": "4.30.0 || 5.12.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"DeprecationTests\\": "test_fixtures/src",
|
||||||
|
"Doctrine\\Foo\\": "test_fixtures/vendor/doctrine/foo"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
313
vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php
vendored
Normal file
313
vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php
vendored
Normal file
@ -0,0 +1,313 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Doctrine\Deprecations;
|
||||||
|
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
use function array_key_exists;
|
||||||
|
use function array_reduce;
|
||||||
|
use function assert;
|
||||||
|
use function debug_backtrace;
|
||||||
|
use function sprintf;
|
||||||
|
use function str_replace;
|
||||||
|
use function strpos;
|
||||||
|
use function strrpos;
|
||||||
|
use function substr;
|
||||||
|
use function trigger_error;
|
||||||
|
|
||||||
|
use const DEBUG_BACKTRACE_IGNORE_ARGS;
|
||||||
|
use const DIRECTORY_SEPARATOR;
|
||||||
|
use const E_USER_DEPRECATED;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Manages Deprecation logging in different ways.
|
||||||
|
*
|
||||||
|
* By default triggered exceptions are not logged.
|
||||||
|
*
|
||||||
|
* To enable different deprecation logging mechanisms you can call the
|
||||||
|
* following methods:
|
||||||
|
*
|
||||||
|
* - Minimal collection of deprecations via getTriggeredDeprecations()
|
||||||
|
* \Doctrine\Deprecations\Deprecation::enableTrackingDeprecations();
|
||||||
|
*
|
||||||
|
* - Uses @trigger_error with E_USER_DEPRECATED
|
||||||
|
* \Doctrine\Deprecations\Deprecation::enableWithTriggerError();
|
||||||
|
*
|
||||||
|
* - Sends deprecation messages via a PSR-3 logger
|
||||||
|
* \Doctrine\Deprecations\Deprecation::enableWithPsrLogger($logger);
|
||||||
|
*
|
||||||
|
* Packages that trigger deprecations should use the `trigger()` or
|
||||||
|
* `triggerIfCalledFromOutside()` methods.
|
||||||
|
*/
|
||||||
|
class Deprecation
|
||||||
|
{
|
||||||
|
private const TYPE_NONE = 0;
|
||||||
|
private const TYPE_TRACK_DEPRECATIONS = 1;
|
||||||
|
private const TYPE_TRIGGER_ERROR = 2;
|
||||||
|
private const TYPE_PSR_LOGGER = 4;
|
||||||
|
|
||||||
|
/** @var int-mask-of<self::TYPE_*>|null */
|
||||||
|
private static $type;
|
||||||
|
|
||||||
|
/** @var LoggerInterface|null */
|
||||||
|
private static $logger;
|
||||||
|
|
||||||
|
/** @var array<string,bool> */
|
||||||
|
private static $ignoredPackages = [];
|
||||||
|
|
||||||
|
/** @var array<string,int> */
|
||||||
|
private static $triggeredDeprecations = [];
|
||||||
|
|
||||||
|
/** @var array<string,bool> */
|
||||||
|
private static $ignoredLinks = [];
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
private static $deduplication = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trigger a deprecation for the given package and identfier.
|
||||||
|
*
|
||||||
|
* The link should point to a Github issue or Wiki entry detailing the
|
||||||
|
* deprecation. It is additionally used to de-duplicate the trigger of the
|
||||||
|
* same deprecation during a request.
|
||||||
|
*
|
||||||
|
* @param float|int|string $args
|
||||||
|
*/
|
||||||
|
public static function trigger(string $package, string $link, string $message, ...$args): void
|
||||||
|
{
|
||||||
|
$type = self::$type ?? self::getTypeFromEnv();
|
||||||
|
|
||||||
|
if ($type === self::TYPE_NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset(self::$ignoredLinks[$link])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($link, self::$triggeredDeprecations)) {
|
||||||
|
self::$triggeredDeprecations[$link]++;
|
||||||
|
} else {
|
||||||
|
self::$triggeredDeprecations[$link] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self::$deduplication === true && self::$triggeredDeprecations[$link] > 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset(self::$ignoredPackages[$package])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
|
||||||
|
|
||||||
|
$message = sprintf($message, ...$args);
|
||||||
|
|
||||||
|
self::delegateTriggerToBackend($message, $backtrace, $link, $package);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trigger a deprecation for the given package and identifier when called from outside.
|
||||||
|
*
|
||||||
|
* "Outside" means we assume that $package is currently installed as a
|
||||||
|
* dependency and the caller is not a file in that package. When $package
|
||||||
|
* is installed as a root package then deprecations triggered from the
|
||||||
|
* tests folder are also considered "outside".
|
||||||
|
*
|
||||||
|
* This deprecation method assumes that you are using Composer to install
|
||||||
|
* the dependency and are using the default /vendor/ folder and not a
|
||||||
|
* Composer plugin to change the install location. The assumption is also
|
||||||
|
* that $package is the exact composer packge name.
|
||||||
|
*
|
||||||
|
* Compared to {@link trigger()} this method causes some overhead when
|
||||||
|
* deprecation tracking is enabled even during deduplication, because it
|
||||||
|
* needs to call {@link debug_backtrace()}
|
||||||
|
*
|
||||||
|
* @param float|int|string $args
|
||||||
|
*/
|
||||||
|
public static function triggerIfCalledFromOutside(string $package, string $link, string $message, ...$args): void
|
||||||
|
{
|
||||||
|
$type = self::$type ?? self::getTypeFromEnv();
|
||||||
|
|
||||||
|
if ($type === self::TYPE_NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
|
||||||
|
|
||||||
|
// first check that the caller is not from a tests folder, in which case we always let deprecations pass
|
||||||
|
if (isset($backtrace[1]['file'], $backtrace[0]['file']) && strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) {
|
||||||
|
$path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $package) . DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
|
if (strpos($backtrace[0]['file'], $path) === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos($backtrace[1]['file'], $path) !== false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset(self::$ignoredLinks[$link])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($link, self::$triggeredDeprecations)) {
|
||||||
|
self::$triggeredDeprecations[$link]++;
|
||||||
|
} else {
|
||||||
|
self::$triggeredDeprecations[$link] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self::$deduplication === true && self::$triggeredDeprecations[$link] > 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset(self::$ignoredPackages[$package])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message = sprintf($message, ...$args);
|
||||||
|
|
||||||
|
self::delegateTriggerToBackend($message, $backtrace, $link, $package);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list<array{function: string, line?: int, file?: string, class?: class-string, type?: string, args?: mixed[], object?: object}> $backtrace
|
||||||
|
*/
|
||||||
|
private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package): void
|
||||||
|
{
|
||||||
|
$type = self::$type ?? self::getTypeFromEnv();
|
||||||
|
|
||||||
|
if (($type & self::TYPE_PSR_LOGGER) > 0) {
|
||||||
|
$context = [
|
||||||
|
'file' => $backtrace[0]['file'] ?? null,
|
||||||
|
'line' => $backtrace[0]['line'] ?? null,
|
||||||
|
'package' => $package,
|
||||||
|
'link' => $link,
|
||||||
|
];
|
||||||
|
|
||||||
|
assert(self::$logger !== null);
|
||||||
|
|
||||||
|
self::$logger->notice($message, $context);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! (($type & self::TYPE_TRIGGER_ERROR) > 0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$message .= sprintf(
|
||||||
|
' (%s:%d called by %s:%d, %s, package %s)',
|
||||||
|
self::basename($backtrace[0]['file'] ?? 'native code'),
|
||||||
|
$backtrace[0]['line'] ?? 0,
|
||||||
|
self::basename($backtrace[1]['file'] ?? 'native code'),
|
||||||
|
$backtrace[1]['line'] ?? 0,
|
||||||
|
$link,
|
||||||
|
$package
|
||||||
|
);
|
||||||
|
|
||||||
|
@trigger_error($message, E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A non-local-aware version of PHPs basename function.
|
||||||
|
*/
|
||||||
|
private static function basename(string $filename): string
|
||||||
|
{
|
||||||
|
$pos = strrpos($filename, DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
|
if ($pos === false) {
|
||||||
|
return $filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
return substr($filename, $pos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function enableTrackingDeprecations(): void
|
||||||
|
{
|
||||||
|
self::$type = self::$type ?? 0;
|
||||||
|
self::$type |= self::TYPE_TRACK_DEPRECATIONS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function enableWithTriggerError(): void
|
||||||
|
{
|
||||||
|
self::$type = self::$type ?? 0;
|
||||||
|
self::$type |= self::TYPE_TRIGGER_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function enableWithPsrLogger(LoggerInterface $logger): void
|
||||||
|
{
|
||||||
|
self::$type = self::$type ?? 0;
|
||||||
|
self::$type |= self::TYPE_PSR_LOGGER;
|
||||||
|
self::$logger = $logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function withoutDeduplication(): void
|
||||||
|
{
|
||||||
|
self::$deduplication = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function disable(): void
|
||||||
|
{
|
||||||
|
self::$type = self::TYPE_NONE;
|
||||||
|
self::$logger = null;
|
||||||
|
self::$deduplication = true;
|
||||||
|
self::$ignoredLinks = [];
|
||||||
|
|
||||||
|
foreach (self::$triggeredDeprecations as $link => $count) {
|
||||||
|
self::$triggeredDeprecations[$link] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ignorePackage(string $packageName): void
|
||||||
|
{
|
||||||
|
self::$ignoredPackages[$packageName] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function ignoreDeprecations(string ...$links): void
|
||||||
|
{
|
||||||
|
foreach ($links as $link) {
|
||||||
|
self::$ignoredLinks[$link] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getUniqueTriggeredDeprecationsCount(): int
|
||||||
|
{
|
||||||
|
return array_reduce(self::$triggeredDeprecations, static function (int $carry, int $count) {
|
||||||
|
return $carry + $count;
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns each triggered deprecation link identifier and the amount of occurrences.
|
||||||
|
*
|
||||||
|
* @return array<string,int>
|
||||||
|
*/
|
||||||
|
public static function getTriggeredDeprecations(): array
|
||||||
|
{
|
||||||
|
return self::$triggeredDeprecations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int-mask-of<self::TYPE_*>
|
||||||
|
*/
|
||||||
|
private static function getTypeFromEnv(): int
|
||||||
|
{
|
||||||
|
switch ($_SERVER['DOCTRINE_DEPRECATIONS'] ?? $_ENV['DOCTRINE_DEPRECATIONS'] ?? null) {
|
||||||
|
case 'trigger':
|
||||||
|
self::$type = self::TYPE_TRIGGER_ERROR;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'track':
|
||||||
|
self::$type = self::TYPE_TRACK_DEPRECATIONS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
self::$type = self::TYPE_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::$type;
|
||||||
|
}
|
||||||
|
}
|
66
vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php
vendored
Normal file
66
vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php
vendored
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Doctrine\Deprecations\PHPUnit;
|
||||||
|
|
||||||
|
use Doctrine\Deprecations\Deprecation;
|
||||||
|
|
||||||
|
use function sprintf;
|
||||||
|
|
||||||
|
trait VerifyDeprecations
|
||||||
|
{
|
||||||
|
/** @var array<string,int> */
|
||||||
|
private $doctrineDeprecationsExpectations = [];
|
||||||
|
|
||||||
|
/** @var array<string,int> */
|
||||||
|
private $doctrineNoDeprecationsExpectations = [];
|
||||||
|
|
||||||
|
public function expectDeprecationWithIdentifier(string $identifier): void
|
||||||
|
{
|
||||||
|
$this->doctrineDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function expectNoDeprecationWithIdentifier(string $identifier): void
|
||||||
|
{
|
||||||
|
$this->doctrineNoDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @before
|
||||||
|
*/
|
||||||
|
public function enableDeprecationTracking(): void
|
||||||
|
{
|
||||||
|
Deprecation::enableTrackingDeprecations();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @after
|
||||||
|
*/
|
||||||
|
public function verifyDeprecationsAreTriggered(): void
|
||||||
|
{
|
||||||
|
foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) {
|
||||||
|
$actualCount = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0;
|
||||||
|
|
||||||
|
$this->assertTrue(
|
||||||
|
$actualCount > $expectation,
|
||||||
|
sprintf(
|
||||||
|
"Expected deprecation with identifier '%s' was not triggered by code executed in test.",
|
||||||
|
$identifier
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($this->doctrineNoDeprecationsExpectations as $identifier => $expectation) {
|
||||||
|
$actualCount = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0;
|
||||||
|
|
||||||
|
$this->assertTrue(
|
||||||
|
$actualCount === $expectation,
|
||||||
|
sprintf(
|
||||||
|
"Expected deprecation with identifier '%s' was triggered by code executed in test, but expected not to.",
|
||||||
|
$identifier
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user