daterangefix and vouchertextremove

This commit is contained in:
Sampanna Rimal 2024-08-21 13:47:09 +05:45
parent 5df46f007d
commit f488c286bd
8 changed files with 40 additions and 8 deletions

View File

@ -40,6 +40,8 @@ class Ledger extends CI_Controller
break;
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'];
if (isset($_GET['show_ledger'])) {
$fromDate_Nepali = $_GET['from_date'];

View File

@ -26,6 +26,8 @@ class Vouchers extends CI_Controller
break;
case 'listvouchers':
$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();
$todate_bs = isset($_GET['to_date']) ? $_GET['to_date'] : NepaliDate(Today());
$fromDate_ad = NepaliToEnglishDate($fromDate_bs);

View File

@ -44,8 +44,8 @@ function createNepaliDateInput($name, $display, $id, $default = "", $class = "")
<?php if ($display != "") : ?>
<label for="datepicker<?php echo $id; ?>"><?php echo function_exists("myLang") ? myLang($display) : $display; ?></label>
<?php endif; ?>
<div class="input-group" 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; ?>">
<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 <?php echo $class; ?>" autocomplete="off" value="<?php echo ($default == "") ? NepaliDate() : $default; ?>">
</div>
<?php
}

View File

@ -664,7 +664,7 @@ class myaccounts
$data['oldBalance'] = $oldBalance;
return $data;
}
function showLedger($account_id, $fromDate = "", $toDate = "")
function showLedger($account_id, $fromDate = "", $toDate = "", $fiscalStart = "", $fiscalEnd = "" )
{
$oldBalance = $this->getOldBalance($account_id, FYStart());
$fromDate = ($fromDate == "") ? NepaliToEnglishDate(FYStart()) : $fromDate;
@ -699,6 +699,7 @@ class myaccounts
<th class="col-1 text-right"><?php myLang("Debit"); ?></th>
<th class="col-1 text-right"><?php myLang("Credit"); ?></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>
</thead>
<tbody>
@ -777,6 +778,22 @@ class myaccounts
</div>
</div>
<?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)
{
@ -926,7 +943,7 @@ class myaccounts
// $pdf->Output("F", $OutputFileLocation . $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;
$ci = &get_instance();
@ -1041,6 +1058,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" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
<input type="hidden" id="refdate" data-start="<?php echo $fiscalStart; ?>" data-end="<?php echo $fiscalEnd; ?>">
</div>
</div>
</div>
@ -1119,6 +1137,15 @@ class myaccounts
}
}
</script>
<script>
$(".ass_date").nepaliDatePicker({
dateFormat: "%y-%m-%d",
closeOnDateSelect: true,
minDate: $('#refdate').data('start'),
maxDate: $('#refdate').data('end'),
});
</script>
<?php
}
?>

View File

@ -40,7 +40,7 @@
<?php if (isset($account_id) && $account_id != "") {
$fromDate = NepaliToEnglishDate(isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth());
$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-dialog modal-xl" role="document">

View File

@ -99,7 +99,7 @@ button:hover {
</fieldset>
</div>
<div class="col-8">
<h1 class="text-center"><?php echo $pageTitle; ?> Voucher</h1>
<h1 class="text-center"><?php echo $pageTitle; ?></h1>
<!-- <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>
</fieldset> -->

View File

@ -34,7 +34,7 @@
// echo $toDate;
$account_id = isset($_GET['account_id']) ? $_GET['account_id'] : '';
$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>
@ -43,3 +43,4 @@
</div>
</div>
</div>

Binary file not shown.