</tr> <tr><td height="25"> </td></tr> <tr> <td colspan="2"> <table border="0" style="width:98%"> <tr> <td width="110"> To: </td> <td width="400"> <b>' . (isset($model->customer) ? $model->customer->lb_customer_name : '') . '</b><br> </td> <td> ' . $model->lb_invoice_no . ' | </td> <td><span style="margin-left: 0px;color: #000000; font-weight: bold">Total:</span>' . $strnum->adddotstring($invoice_total->lb_invoice_total_after_taxes, $thousand, $decimal) . '</td> </tr> <tr valign="top"> <td> Biiling Address: </td> <td> ' . $address . ' </td> </tr> <tr> <td> Attention: </td> <td> ' . $att . '
/* @var $this LbInvoiceController */ /* @var $model LbInvoice */ /* @var $ownCompany LbCustomer */ $currency_name = LbGenera::model()->getGeneraSubscription()->lb_genera_currency_symbol; $thousand = LbGenera::model()->getGeneraSubscription()->lb_thousand_separator; $decimal = LbGenera::model()->getGeneraSubscription()->lb_decimal_symbol; $strnum = new LbInvoiceTotal(); // Subtotal Invoice $invoice_subtotal_arr = LbInvoiceTotal::model()->getInvoiceTotal($model->lb_record_primary_key); // Discount Invoice $invoice_discount_arr = LbInvoiceItem::model()->getInvoiceDiscounts($model->lb_record_primary_key, 'ModelArray'); $invoice_discount = ""; foreach ($invoice_discount_arr as $invoice_discount_row) { $invoice_discount .= '<tr><td>' . $invoice_discount_row['lb_invoice_item_description'] . ":" . '</td> <td>' . $currency_name . $strnum->adddotstring($invoice_discount_row['lb_invoice_item_total'], $thousand, $decimal) . '</td> </tr>'; } //End Discount // Tax Invoice $invoice_tax_arr = LbInvoiceItem::model()->getInvoiceTaxes($model->lb_record_primary_key, 'ModelArray'); $invoice_tax = ""; foreach ($invoice_tax_arr as $invoice_tax_row) { $tax_arr = LbTax::model()->find('lb_record_primary_key=' . $invoice_tax_row['lb_invoice_item_description']); if ($tax_arr['lb_tax_value'] != null && $tax_arr['lb_tax_name'] != null) { $tax_name = 'Tax'; if ($tax_arr['lb_tax_name'] != "") { $tax_name = $tax_arr['lb_tax_name']; } $invoice_tax .= '<tr> <td>' . $tax_name . ' (' . $tax_arr['lb_tax_value'] . "%):" . '</td>
<td width="100"><b>Total</b></td> </tr>'; $subtotalEx = 0; foreach ($item_quotation_arr as $item_quotation_row) { $i++; $expensesManage = LbExpenses::model()->findByPk($item_quotation_row['lb_expenses_id']); $subtotalEx = $subtotalEx + $expensesManage['lb_expenses_amount']; $tblEx .= '<tr> <td height="35" align="center" width="32">' . $i . '</td> <td >' . $expensesManage['lb_expenses_date'] . '</td> <td >' . $expensesManage['lb_expenses_no'] . '</td> <td width="">' . $expensesManage['lb_category_id'] . '</td> <td width="">' . $expensesManage['lb_expenses_note'] . '</td> <td align="" width="">' . $strnum->adddotstring($expensesManage['lb_expenses_amount'], $thousand, $decimal) . '</td> </tr>'; } $tblEx .= '</table>'; echo $tblEx; echo '<table border="0" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">'; echo '<tr> <td height="35" align="center" width="50"></td> <td width="100"></td> <td width="200"></td> <td width="100"></td> <td width="100" align="center"><b>Total</b></td> <td width="100" align="left">$' . number_format($subtotalEx, 2, '.', ',') . '</td>