public function getExByMonth($month = false, $year = false) { $modelEx = LbExpenses::model()->findAll('YEAR(lb_expenses_date) = ' . $year . ' AND MONTH(lb_expenses_date) =' . $month); $total = 0; foreach ($modelEx as $data) { if (LbPvExpenses::model()->getExpensesPVById($data->lb_record_primary_key) == false) { $total += $data->lb_expenses_amount; } } return $total; }
public function getTotalExpensesPrev($financial_year, $financial_prev_year) { $All_PV = LbPaymentVoucher::model()->getTotalPaymentPrev($financial_year, $financial_prev_year); foreach ($All_PV as $row) { $pvexpenses = LbPvExpenses::model()->findAll('lb_payment_voucher_id = ' . $row->lb_record_primary_key); $total = 0; foreach ($pvexpenses as $data) { $modelExpenses = LbExpenses::model()->find('lb_record_primary_key = ' . $data->lb_expenses_id); if ($modelExpenses) { $total += $modelExpenses->lb_expenses_amount; } } return $total; } }
function actiondeletePVExpenses($id) { return LbPvExpenses::model()->deleteByPk($id); }
' . (isset($modelAddress->lb_customer_address_country) ? $modelAddress->lb_customer_address_country . ' ' : '') . ' ' . (isset($modelAddress->lb_customer_address_postal_code) ? $modelAddress->lb_customer_address_postal_code : '') . '<br> ' . (isset($modelAddress->lb_customer_address_phone_1) ? "Phone: " . $modelAddress->lb_customer_address_phone_1 . " " : '') . ' ' . (isset($modelAddress->lb_customer_address_fax) ? "Fax: " . $modelAddress->lb_customer_address_fax : '') . '<br> ' . (isset($modelAddress->lb_customer_address_email) ? "Email: " . $modelAddress->lb_customer_address_email : '') . ' </td> </tr>'; $tblPV .= '</table>'; echo $tblPV . '<br /><br />'; //item expenses $i = 0; $strnum = new LbInvoiceTotal(); $thousand = LbGenera::model()->getGeneraSubscription()->lb_thousand_separator; $decimal = LbGenera::model()->getGeneraSubscription()->lb_decimal_symbol; $item_quotation_arr = LbPvExpenses::model()->findAll('lb_payment_voucher_id = ' . $model->lb_record_primary_key); if (count($item_quotation_arr) > 0) { $tblEx = '<table border="1" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">'; $tblEx .= '<tr> <td height="35" align="center" width="50">#</td> <td width="100"><b>Expenses Date</b></td> <td width="200"><b>Expenses No</b></td> <td width="100"><b>Expenses category</b></td> <td width="100"><b>Expenses note</b></td> <td width="100"><b>Total</b></td> </tr>'; $subtotalEx = 0; foreach ($item_quotation_arr as $item_quotation_row) { $i++;