?
Current Path : /home1/savoy/public_html/savoyglobal.net/sgms/application/views/Accounting/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sgms/application/views/Accounting/pdf_ageing_report.php |
<?php $company_details= $this->mastermodel->get_data_srow('company','1','company_id'); $html =''; $html.='<html> <body style="margin: 20px 20px 30px 20px;">'; $html.='<table width="100%"> <tr><td colspan="3"><img src="'.base_url().'assets/images/'.$company_details->logo.'" width="400" height="148"/></td></tr> <tr><td>Printout Date: '.date('d-m-Y').', '.date('h:i:s a').'</td></tr> </table><br><br>'; $html.='<hr>'; $html.='<div align="center"><b><u>Statement Of Account Outstanding as on '.$date.'</u></b></div>'; $html.='<head><body><table width="100%" border="0" cellpadding="2" cellspacing="2"> <tbody><tr><td><table><tr><td align="left">'.$company->company_name.'</td></tr> <tr><td align="left">'.$company->address.'</td></tr> <tr><td align="left">Tel: '.$company->contact_no.'</td></tr> <tr><td align="left">Fax: '.$company->fax.'</td></tr> <tr><td align="left">Email: '.$company->email.'</td></tr></table></td> <td align="right"><table><tr><td align="left">'.$accdet->chart_account_name.'</td></tr> <tr><td align="left">'.$accdet->address.'</td></tr> <tr><td align="left">Code:'.$accdet->chart_account_code.'</td></tr></td></table></td></tr></table>'; $html.='<br/><hr>'; $html.='<div align="center">AGING ANALYSIS</div>'; $html.='<table width="100%" border="1" cellpadding="-1" cellspacing="-1"> <tr><th style="background-color:#80C0FF;">Balance</th> <th style="background-color:#80C0FF;">Current</th> <th style="background-color:#80C0FF;">> 30 Days</th> <th style="background-color:#80C0FF;">> 90 Days</th> <th style="background-color:#80C0FF;">> 180 Days</th> <th style="background-color:#80C0FF;">> 270 Days</th> <th style="background-color:#80C0FF;">> 365 Days</th></tr>'; $html.='<tr><td>'.$balance.'</td><td>'.$current.'</td><td>'.$lthirty.'</td> <td>'.$lninty.'</td><td>'.$loneeighty.'</td> <td>'.$ltseventy.'</td><td>'.$ltsixty.'</td></tr></table>'; $html.='<br/><br/><br/> <table width="100%" border="0" cellpadding="1" cellspacing="1"> <thead> <tr> <th style="background-color:#80C0FF;width:100px;width:15%">Date</th> <th style="background-color:#80C0FF;width:15%">Transaction No</th> <th style="background-color:#80C0FF;width:30%">Description</th> <th style="background-color:#80C0FF;width:13%">Debit</th> <th style="background-color:#80C0FF;width:13%">Credit</th> <th style="background-color:#80C0FF;width:14%">Balance</th> </tr></thead>'; $balance=0; $totdebit=0; $totcredit=0; $totbal=0; $dnewdate=$this->accountingmodel->mintransdate($accountcode); $open=$this->accountingmodel->opening_bal_statementacc($dnewdate,$accountcode,'gl_trans'); if($dnewdate) { $dnewdate1=$this->mastermodel->convdatformat($dnewdate); } else { $dnewdate1=""; } if(isset($open->row()->debit)||isset($open->row()->credit)) { $opendebit=$open->row()->debit; $opencredit=$open->row()->credit; } else { $opendebit=0; $opencredit=0; } $opencredit=0-$opencredit; $openbal=$opendebit-$opencredit; if($openbal<0) { $openbal=abs($openbal); $sfx="Cr"; } else if($openbal>0) { $sfx="Dr"; } else { $sfx=""; } $balance=$openbal; $totdebit=$opendebit; $totcredit=$opencredit; $html.='<tr style="font-weight:bold"> <td style="width:15%"></td> <td style="width:15%"></td> <td style="width:30%">Opening Balance</td> <td style="text-align:right;width:13%">'.number_format($opendebit,'2').'</td> <td style="text-align:right;width:13%">'.number_format($opencredit,'2').'</td> <td style="text-align:right;width:14%">'.number_format($openbal,'2').' '.$sfx.'</td> </tr>'; foreach($statement as $dbt) { $tdate=$this->mastermodel->convdatformat($dbt['transaction_date']); $amount=$dbt['amount']; $refs=$dbt['ref_code']; $acc=$dbt['account_code']; $balance+=$amount; $trtype=$dbt['type']; if($trtype=='registration') { $qtnref=""; } else if($trtype=='cancellation') { $qtnref=""; } else { $qtnref=""; } if($balance<0) { $newbalance=abs($balance); $sfx="Cr"; } else { $newbalance=$balance; $sfx="Dr"; } if($amount>0) { $debit=$amount; $credit=0; } else { $debit=0; $credit=0-$amount; } $description=$dbt['memo']; $html.='<tr style="font-size:11px" > <td style="width:15%">'.$tdate.'</td> <td style="width:15%">'.$refs.'</td> <td style="width:30%">'.$description.'</td> <td style="text-align:right;width:13%">'.number_format($debit,'2').'</td> <td style="text-align:right;width:13%"> '.number_format($credit,'2').'</td> <td style="text-align:right;width:14%">'.number_format($newbalance,'2').' '.$sfx.'</td> </tr>'; $totdebit+=$debit; $totcredit+=$credit; } $totbal=$totdebit-$totcredit; if($totbal<0) { $totbal=abs($totbal); $sfx3="Cr"; } else { $sfx3="Dr"; } $html.='<tr style="font-weight:bold;"> <td colspan="6" style="border-top:1px solid"></td> </tr>'; $html.='<tr style="font-weight:bold"> <td style="width:15%"></td> <td style="width:15%"></td> <td style="width:30%">Total Debit/Credit</td> <td style="text-align:right;width:13%">'.number_format($totdebit,'2').'</td> <td style="text-align:right;width:13%">'.number_format($totcredit,'2').'</td> <td style="text-align:right;width:14%">'.number_format($totbal,'2').' '.$sfx3.'</td> </tr>'; $html.='</table><br/><hr>'; $html.='<script type="text/php"> if ( isset($pdf) ) { $font = Font_Metrics::get_font("verdana", "normal"); $pdf->page_text(25, 570, "'.$company->footer.' Page {PAGE_NUM} of {PAGE_COUNT}", $font, 10, array(0,0,0)); } </script>'; $html.='</body></head></html>'; //echo $html; pdf_create($html, 'Aging Report',1); ?>