*
* 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.
*/
function account_st_short($account, $c = 0, $THIS, $dc_type)
{
$counter = $c;
if ($account->id > 5)
{
if ($dc_type == 'D' && $account->cl_total_dc == 'C' && calculate($account->cl_total, 0, '!=')) {
echo '
';
} else if ($dc_type == 'C' && $account->cl_total_dc == 'D' && calculate($account->cl_total, 0, '!=')) {
echo '
';
} else {
echo '
';
}
echo '';
echo print_space($counter);
echo h(toCodeWithName($account->code, $account->name));
echo ' | ';
echo '';
echo toCurrency($account->cl_total_dc, $account->cl_total);
echo print_space($counter);
echo ' | ';
echo '
';
}
foreach ($account->children_groups as $id => $data)
{
$counter++;
account_st_short($data, $counter, $THIS, $dc_type);
$counter--;
}
if (count($account->children_ledgers) > 0)
{
$counter++;
foreach ($account->children_ledgers as $id => $data)
{
if ($dc_type == 'D' && $data['cl_total_dc'] == 'C' && calculate($data['cl_total'], 0, '!=')) {
echo '';
} else if ($dc_type == 'C' && $data['cl_total_dc'] == 'D' && calculate($data['cl_total'], 0, '!=')) {
echo '
';
} else {
echo '
';
}
echo '';
echo print_space($counter);
echo $THIS->Html->link(toCodeWithName($data['code'], $data['name']), array('plugin' => 'webzash', 'controller' => 'reports', 'action' => 'ledgerstatement', 'ledgerid' => $data['id']));
echo ' | ';
echo '';
echo toCurrency($data['cl_total_dc'], $data['cl_total']);
echo print_space($counter);
echo ' | ';
echo '
';
}
$counter--;
}
}
function print_space($count)
{
$html = '';
for ($i = 1; $i <= $count; $i++) {
$html .= ' ';
}
return $html;
}
?>
' .
__d('webzash', 'There is a difference in opening balance of ') .
toCurrency($bsheet['opdiff']['opdiff_balance_dc'], $bsheet['opdiff']['opdiff_balance']) .
'
';
}
/* Show difference in liabilities and assets total */
if (calculate($bsheet['final_liabilities_total'], $bsheet['final_assets_total'], '!=')) {
$final_total_diff = calculate($bsheet['final_liabilities_total'], $bsheet['final_assets_total'], '-');
//echo '' .
__d('webzash', 'There is a difference in Total Liabilities and Total Assets of ') .
toCurrency('X', $final_total_diff) .
'
';
}
?>
';
echo $this->Html->link(
__d('webzash', 'DOWNLOAD .CSV'),
'/' . $this->params->url . '/downloadcsv:true',
array('class' => 'btn btn-default btn-sm')
);
echo $this->Html->link(
__d('webzash', 'DOWNLOAD .XLS'),
'/' . $this->params->url . '/downloadxls:true',
array('class' => 'btn btn-default btn-sm')
);
echo $this->Html->link(__d('webzash', 'PRINT'), '',
array(
'class' => 'btn btn-default btn-sm',
'onClick' => "window.open('" . $this->Html->url('/' . $this->params->url . '/print:true') . "', 'windowname','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=1000,height=600'); return false;"
)
);
echo '';
echo '
';
?>
|
|
|
Liabilities | |
=')) {
echo '';
echo '' . __d('webzash', 'Total Liability') . ' | ';
echo '' . toCurrency('C', $bsheet['liabilities_total']) . ' | ';
echo ' ';
} else {
echo '';
echo '' . __d('webzash', 'Total Liability') . ' | ';
echo '' . toCurrency('C', $bsheet['liabilities_total']) . ' | ';
echo ' ';
}
?>
Owners Equity | |
=')) {
$total_equity=$bsheet['equity_total']+$bsheet['pandl'];
$retained_earnings = $bsheet['assets_total']-$total_equity-$bsheet['liabilities_total'];
echo '' . __d('webzash', 'Retained Eanrings') . ' | ';
echo '' . toCurrency('C', $retained_earnings) . ' | ';
echo ' ';
echo '' . __d('webzash', 'Profit & Loss Account (Net Profit)') . ' | ';
echo '' . toCurrency('C', $bsheet['pandl']) . ' | ';
} else {
$positive_pandl = calculate($bsheet['pandl'], 0, 'n');
$total_equity=$bsheet['equity_total']-$positive_pandl;
$retained_earnings = $bsheet['assets_total']-$total_equity-$bsheet['liabilities_total'];
echo '' . __d('webzash', 'Retained Eanrings') . ' | ';
echo '' . toCurrency('C', $retained_earnings) . ' | ';
echo ' ';
echo '' . __d('webzash', 'Profit & Loss Account (Net Loss)') . ' | ';
echo '' . toCurrency('D', $positive_pandl) . ' | ';
}
?>
';
if (calculate($total_equity, 0, '>=')) {
echo '';
echo '' . __d('webzash', 'Total Owners Equity') . ' | ';
echo '' . toCurrency('C', $final_total_equity) . ' | ';
echo ' ';
} else {
//echo '';
echo ' ';
echo '' . __d('webzash', 'Total Owners Equity') . ' | ';
//echo '' . toCurrency('C', $total_equity) . ' | ';
echo '' . toCurrency('C', $final_total_equity) . ' | ';
echo ' ';
}
?>
|
=')) {
echo '';
//echo '' . __d('webzash', 'Total Assets') . ' | ';
//echo '' . toCurrency('D', $bsheet['assets_total']) . ' | ';
echo ' ';
} else {
echo '';
//echo '' . __d('webzash', 'Total Assets') . ' | ';
//echo '' . toCurrency('D', $bsheet['assets_total']) . ' | ';
echo ' ';
}
?>
';
/* If diff in opening balance is Dr */
if ($bsheet['opdiff']['opdiff_balance_dc'] == 'D') {
echo '' . __d('webzash', 'Diff in O/P Balance') . ' | ';
echo '' . toCurrency('D', $bsheet['opdiff']['opdiff_balance']) . ' | ';
} else {
echo '  | ';
echo '  | ';
}
echo '';
}
?>
';
echo '' . __d('webzash', 'Total Assets') . ' | ';
echo '' .
toCurrency('D', $bsheet['final_assets_total']) .
' | ';
echo '';
?>
|
';
/* If diff in opening balance is Cr */
if ($bsheet['opdiff']['opdiff_balance_dc'] == 'C') {
echo '' . __d('webzash', 'Diff in O/P Balance') . ' | ';
echo '' . toCurrency('C', $bsheet['opdiff']['opdiff_balance']) . ' | ';
} else {
echo '  | ';
echo '  | ';
}
echo '';
}
?>
';
} else {
echo '';
}
echo '' . __d('webzash', 'Total Liabilities and Equity') . ' | ';
echo '' .
toCurrency('C', $final_total) .
' | ';
echo ' ';
?>
|