* * 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; } ?> '; } /* 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 '
'; } ?>

Options

Form->create('Balancesheet', array( 'inputDefaults' => array( 'div' => 'form-group', 'wrapInput' => false, 'class' => 'form-control', ), )); echo $this->Form->input('opening', array( 'type' => 'checkbox', 'label' => __d('webzash', 'Show Opening Balance Sheet'), 'class' => 'checkbox', )); echo $this->Form->input('startdate', array( 'label' => __d('webzash', 'Start date'), 'afterInput' => '' . __d('webzash', 'Note : Leave start date as empty if you want statement from the start of the financial year.') . '', )); echo $this->Form->input('enddate', array( 'label' => __d('webzash', 'End date'), 'afterInput' => '' . __d('webzash', 'Note : Leave end date as empty if you want statement till the end of the financial year.') . '', )); echo '
'; echo $this->Form->submit(__d('webzash', 'Submit'), array( 'div' => false, 'class' => 'btn btn-primary' )); echo $this->Html->tag('span', '', array('class' => 'link-pad')); echo $this->Html->link(__d('webzash', 'Clear'), array('plugin' => 'webzash', 'controller' => 'reports', 'action' => 'balancesheet'), array('class' => 'btn btn-default')); echo '
'; echo $this->Form->end(); ?>

'; 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 '

'; ?>
=')) { echo ''; echo ''; echo ''; echo ''; } else { echo ''; echo ''; echo ''; echo ''; } ?> =')) { $total_equity=$bsheet['equity_total']+$bsheet['pandl']; $retained_earnings = $bsheet['assets_total']-$total_equity-$bsheet['liabilities_total']; echo ''; echo ''; echo ''; echo ''; echo ''; } 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 ''; echo ''; echo ''; echo ''; echo ''; } ?> '; if (calculate($total_equity, 0, '>=')) { echo ''; echo ''; echo ''; echo ''; } else { //echo ''; echo ''; echo ''; //echo ''; echo ''; echo ''; } ?>
Liabilities
' . __d('webzash', 'Total Liability') . '' . toCurrency('C', $bsheet['liabilities_total']) . '
' . __d('webzash', 'Total Liability') . '' . toCurrency('C', $bsheet['liabilities_total']) . '
Owners Equity
' . __d('webzash', 'Retained Eanrings') . '' . toCurrency('C', $retained_earnings) . '
' . __d('webzash', 'Profit & Loss Account (Net Profit)') . '' . toCurrency('C', $bsheet['pandl']) . '' . __d('webzash', 'Retained Eanrings') . '' . toCurrency('C', $retained_earnings) . '
' . __d('webzash', 'Profit & Loss Account (Net Loss)') . '' . toCurrency('D', $positive_pandl) . '
' . __d('webzash', 'Total Owners Equity') . '' . toCurrency('C', $final_total_equity) . '
' . __d('webzash', 'Total Owners Equity') . '' . toCurrency('C', $total_equity) . '' . toCurrency('C', $final_total_equity) . '
=')) { echo ''; //echo ''; //echo ''; echo ''; } else { echo ''; //echo ''; //echo ''; echo ''; } ?> '; /* If diff in opening balance is Dr */ if ($bsheet['opdiff']['opdiff_balance_dc'] == 'D') { echo ''; echo ''; } else { echo ''; echo ''; } echo ''; } ?> '; echo ''; echo ''; echo ''; ?>
' . __d('webzash', 'Total Assets') . '' . toCurrency('D', $bsheet['assets_total']) . '
' . __d('webzash', 'Total Assets') . '' . toCurrency('D', $bsheet['assets_total']) . '
' . __d('webzash', 'Diff in O/P Balance') . '' . toCurrency('D', $bsheet['opdiff']['opdiff_balance']) . '  
' . __d('webzash', 'Total Assets') . '' . toCurrency('D', $bsheet['final_assets_total']) . '
'; /* If diff in opening balance is Cr */ if ($bsheet['opdiff']['opdiff_balance_dc'] == 'C') { echo ''; echo ''; } else { echo ''; echo ''; } echo ''; } ?> '; } else { echo ''; } echo ''; echo ''; echo ''; ?>
' . __d('webzash', 'Diff in O/P Balance') . '' . toCurrency('C', $bsheet['opdiff']['opdiff_balance']) . '  
' . __d('webzash', 'Total Liabilities and Equity') . '' . toCurrency('C', $final_total) . '