correction of error for purchase and sales
This commit is contained in:
parent
ec6bfaf7ff
commit
e3c8a3b5fe
@ -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:
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//////
|
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,6 @@ class MStocks extends CI_Model
|
|||||||
}
|
}
|
||||||
public function getStockSummary($data)
|
public function getStockSummary($data)
|
||||||
{
|
{
|
||||||
|
|
||||||
$stocklocation_id = $data['stocklocation_id'] ?? null;
|
$stocklocation_id = $data['stocklocation_id'] ?? null;
|
||||||
$this->db->where("status", 1);
|
$this->db->where("status", 1);
|
||||||
if ($stocklocation_id != 0) {
|
if ($stocklocation_id != 0) {
|
||||||
|
@ -250,10 +250,10 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<?php foreach ($AccountGroups as $group) : ?>
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="p-0">
|
<td colspan="2" class="p-0">
|
||||||
<!-- <div id="group_<?php echo $group->acgroup_id; ?>" class=""> -->
|
<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>
|
||||||
@ -272,6 +272,7 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<?php $PL = $incomes_totalClosingCr - $incomes_totalClosingDr; ?>
|
<?php $PL = $incomes_totalClosingCr - $incomes_totalClosingDr; ?>
|
||||||
<tr>
|
<tr>
|
||||||
@ -312,11 +313,11 @@ $BIBAccounts = new BIBAccounts();
|
|||||||
<?php foreach ($AccountGroups as $group) : ?>
|
<?php foreach ($AccountGroups as $group) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="p-0">
|
<td colspan="2" class="p-0">
|
||||||
<!-- <div id="group_<?php echo $group->acgroup_id; ?>" class=""> -->
|
<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>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
@ -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>
|
||||||
@ -185,7 +187,8 @@
|
|||||||
foreach ($StockItems as $Stock) : $a++; ?>
|
foreach ($StockItems as $Stock) : $a++; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center"><?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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user