*/ //Da thu $total = array(); //Can thu $datatest = array(); //DA chi $datatest1 = array(); //Can chi $datatest2 = array(); $thang = array(); for ($i = 1; $i < 13; $i++) { //Da Thu $payment = LbPayment::model()->getPaymentTotalByMonth($year, $i); array_push($total, intval($payment)); //Can thu $oustanding_invoice = LbInvoice::model()->getTotalInvoiceByMonth($year, $i); array_push($datatest, intval($oustanding_invoice)); //Da chi=totalEx + totalVendor $totalExpenses = LbExpenses::model()->totalExByVDInMonth($i, $year); $totalVendor = LbPaymentVendor::model()->totalPaymentVendorInMonth($i, $year); array_push($datatest1, $totalExpenses + $totalVendor); //Can Chi $totalVendorInvoice = LbVendorInvoice::model()->getVendorInvoiceMonth($i, $year); $totalEx = LbExpenses::model()->getExByMonth($i, $year); array_push($datatest2, $totalVendorInvoice + $totalEx); array_push($thang, intval($i)); } $this->Widget('highcharts.HighchartsWidget', array('htmlOptions' => array(), 'options' => array('chart' => array('type' => 'column', 'colors' => array('#058DC7', '#5bb75b', '#ED561B', '#DDDF00')), 'yAxis' => array('title' => array('text' => '<b>$</b>'), 'style' => array('fontSize' => '14px')), 'xAxis' => array('title' => array('text' => '<b>Month</b>'), 'categories' => $thang, 'labels' => array('style' => array('fontSize' => '14px'))), 'plotOptions' => array('series' => array('pointWidth' => '13')), 'credits' => array('enabled' => false), 'series' => array(array('name' => 'Payment Received', 'data' => $total, 'stack' => 'male'), array('name' => 'Receivable', 'data' => $datatest, 'stack' => 'male'), array('name' => 'Bill Paid', 'data' => $datatest1, 'stack' => 'female'), array('name' => 'Payable', 'data' => $datatest2, 'stack' => 'female'))))); ?>
$m = $this->module->id; $canAdd = BasicPermission::model()->checkModules($m, 'add'); $canList = BasicPermission::model()->checkModules($m, 'list'); //echo $m; $canAddQuotation = BasicPermission::model()->checkModules('lbQuotation', 'add'); $canListQuotation = BasicPermission::model()->checkModules('lbQuotation', 'list'); $canAddPayment = BasicPermission::model()->checkModules('lbPayment', 'add'); $canView = BasicPermission::model()->checkModules($m, 'view'); //date echo '<div id="lb-container-header">'; echo '<div style="margin-left: -10px" class="lb-header-right"><h4>Employees</h4></div>'; echo '<div class="lb-header-left">'; // LBApplicationUI::backButton(LbExpenses::model()->getActionURLNormalized('expenses')); echo ' '; $this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'New'), 'items' => array(array('label' => Yii::t('lang', 'New Employee'), 'url' => LbEmployee::model()->getActionURLNormalized('create')), array('label' => Yii::t('lang', 'New Payment Voucher'), 'url' => LbExpenses::model()->getActionURLNormalized('createPaymentVoucher'))))), 'encodeLabel' => false)); echo '</div>'; echo '</div><br>'; ?> <div class="panel"> <div style="margin-top: 10px;" class="panel-header-title"> <div class="panel-header-title-left" > <span style="font-size: 16px;"><b><?php echo Yii::t('lang', 'All Employee'); ?> </b></span> </div> <div class="panel-header-title-right" style="margin-left:-80px;margin-top:-8px;"> <?php if ($canAdd) { ?>
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ $m = $this->module->id; $canAdd = BasicPermission::model()->checkModules($m, 'add'); $canList = BasicPermission::model()->checkModules($m, 'list'); echo '<div id="lb-container-header">'; echo '<div style="margin-left: -10px" class="lb-header-right"><h4>Expenses</h4></div>'; echo '<div class="lb-header-left">'; // LBApplicationUI::backButton(LbInvoice::model()->getActionURLNormalized("dashboard")); echo ' '; $this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> New', 'items' => array(array('label' => 'New Expense', 'url' => LbExpenses::model()->getActionURL('create', array('type' => 'render'))), array('label' => 'New Payment Voucher', 'url' => LbExpenses::model()->getActionURL('CreatePaymentVoucher', array('type' => 'render')))))), 'encodeLabel' => false)); echo '</div>'; echo '</div>'; //echo '<div class="btn-toolbar">'; // if($canAdd) // { // // LBApplicationUI::newButton(Yii::t('lang','New Payment Voucher'), array( // 'url'=> $this->createUrl('createPaymentVoucher'), // )); // } //echo '</div><br/>'; echo '<div text-size="30px" style="font-size:16px;padding-top:24px;"><b>Payment Voucher</b></div>'; echo '<div style="margin-top:18px;">'; //from echo Yii::t('lang', 'From') . ':</td>';
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; }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#lb-invoice-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); $this->widget('bootstrap.widgets.TbGridView', array('id' => 'lb-invoice-grid', 'dataProvider' => $invoiceModel->search(), 'filter' => $invoiceModel, 'columns' => array(array('name' => 'check', 'class' => 'CCheckBoxColumn', 'id' => 'selectedIds', 'value' => '$data->lb_record_primary_key', 'selectableRows' => '100', 'htmlOptions' => array('width' => '3px'), 'checkBoxHtmlOptions' => array("name" => "invoice_id[]")), array('name' => 'lb_invoice_no', 'type' => 'raw', 'value' => 'LBApplication::workspaceLink($data->lb_invoice_no, $data->customer ? $data->getViewURL($data->customer->lb_customer_name) : $data->getViewURL("No customer"))', 'htmlOptions' => array('width' => '50'), 'headerHtmlOptions' => array('width' => '50'), 'filter' => CHtml::activeTextField($invoiceModel, 'lb_invoice_no', array('class' => 'input-mini', 'style' => 'width:80%'))), array('header' => Yii::t('lang', 'Amount'), 'type' => 'raw', 'value' => '($data->total_invoice ? LbInvoice::CURRENCY_SYMBOL.$data->total_invoice->lb_invoice_total_after_taxes : "0.00")', 'htmlOptions' => array('width' => '50', 'style' => 'text-align:right'), 'headerHtmlOptions' => array('width' => '50', 'style' => 'text-align:right')), array('header' => Yii::t('lang', 'Outstanding'), 'type' => 'raw', 'value' => '($data->total_invoice ? LbInvoice::CURRENCY_SYMBOL.$data->total_invoice->lb_invoice_total_outstanding : "0.00")', 'htmlOptions' => array('width' => '50', 'style' => 'text-align:right'), 'headerHtmlOptions' => array('width' => '50', 'style' => 'text-align:right'))))); LBApplicationUI::submitButton('Save', array('htmlOptions' => array('onclick' => 'SaveInvoice();'))); echo '   '; LBApplicationUI::submitButton('Close', array('htmlOptions' => array('data-dismiss' => 'modal'))); ?> <script> function SaveInvoice(){ var invoice_id = $("input[type]:checked").serialize(); $.post("<?php echo LbExpenses::model()->getActionURLNormalized('AssignInvoice', array('expenses_id' => $expensesModel->lb_record_primary_key)); ?> ",invoice_id); refreshInvoice(); $("#modal-invoice-assign-form").modal("hide"); } </script>
echo $form->textFieldRow($contactModel, 'lb_customer_contact_last_name'); echo $form->textFieldRow($contactModel, 'lb_customer_contact_email_1'); echo $form->textFieldRow($contactModel, 'lb_customer_contact_office_phone'); echo $form->textFieldRow($contactModel, 'lb_customer_contact_mobile'); echo $form->hiddenField($contactModel, 'lb_customer_contact_is_active', array('value' => $contactModel::LB_CUSTOMER_CONTACT_IS_ACTIVE)); echo '</div></div>'; // end body echo '</div>'; // end accordion-group /** END CONTACT **/ ?> </fieldset> <?php // $expenses_id = $expensesModel->lb_record_primary_key; LBApplicationUI::submitButton('Save', array('url' => LbExpenses::model()->getActionURLNormalized('ExpensesNewCustomer', array('ajax' => 1, 'form_type' => 'ajax', 'expenses_id' => $expensesModel->lb_record_primary_key)), 'buttonType' => 'ajaxSubmit', 'ajaxOptions' => array('id' => 'ajax-expenses-new-customer-' . uniqid(), 'beforeSend' => 'function(data){ if ($("#LbCustomer_lb_customer_name").val() == "") { $("#customer_error").html("<div class=\'alert alert-block alert-error\'>Please fill in the required fields.</div>"); return false; } return true; } ', 'success' => 'function(data){ refreshCustomerName(); $("#modal-customer-form").modal("hide"); }'), 'htmlOptions' => array('style' => 'margin-left: auto; margin-right: auto', 'id' => 'ajax-btn-new-customer', 'live' => false))); ?> <?php
} // function assignInvoice(){ // var modal_element = $("#modal-invoice-assign-form"); // modal_element.find("#modal-header").html(); // modal_element.find("#modal-view-invoice-body-").show(); // modal_element.modal("show"); // } // function assignInvoice(){ $('#btn_view_invoice').click(); $('#modal-view-invoice-body-'+<?php echo $expenses_id; ?> ).html(getLoadingIconHTML(false)); $('#modal-view-invoice-body-'+<?php echo $expenses_id; ?> ).load("<?php echo LbExpenses::model()->getActionURLNormalized('AssignInvoice', array('form_type' => 'ajax', 'ajax' => 1, 'expenses_id' => $expenses_id)); ?> "); } function refreshInvoice(){ $('#tab2').load("<?php echo LbExpenses::model()->getActionURLNormalized('loadAjaxTabInvoice', array('id' => $expenses_id)); ?> "); } </script>
$this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-plus"></i> ' . Yii::t('lang', 'New'), 'items' => array(array('label' => Yii::t('lang', 'New Expenses'), 'url' => LbExpenses::model()->getActionURLNormalized('create')), array('label' => Yii::t('lang', 'New Payment Voucher'), 'url' => LbExpenses::model()->getActionURLNormalized('createPaymentVoucher'))))), 'encodeLabel' => false)); echo ' '; if ($id) { $this->widget('bootstrap.widgets.TbButton', array('label' => 'Print PDF', 'htmlOptions' => array('onclick' => 'print_PDF_PV()'))); } echo '</div>'; echo '</div><br>'; echo '<div class = "header">'; if ($id) { echo '<div style="overflow:hidden; border-top: 1px solid #fff;margin-top: 5px; padding-bottom:5px;margin-bottom:5px;">'; echo '</div>'; } else { echo '<h2>New Payment Voucher</h2>'; } echo '</div>'; $this->renderPartial('_form_pv', array('model' => $model, 'modelPV' => $modelPv)); $this->renderPartial('_form_line_expenses', array('model' => $model, 'modelPV' => $modelPv)); ?> <script type="text/javascript"> function print_PDF_PV() { var id = <?php echo $id; ?> ; window.open('<?php echo LbExpenses::model()->getActionURLNormalized("PrintPdfPV", array('id' => $id)); ?> ','_target'); } </script>
<div style="overflow: hidden;"> <h3 style="line-height: 10px;"><?php echo Yii::t('lang', 'Expenses'); ?> : <?php echo $model->lb_expenses_no; ?> </h3> </div> <?php //var_dump(LbBankAccount::model()->getBankAccount(Yii::app()->user->id)); echo '<div class="btn-toolbar">'; //LBApplicationUI::backButton(LbExpenses::model()->getActionURLNormalized('admin')); $this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('lang', 'Back'), 'url' => LbExpenses::model()->getActionURLNormalized('admin'))); // LBApplicationUI::button('Print PDF'); echo '</div><br/>'; //$this->widget('zii.widgets.CDetailView', array( // 'data'=>$model, // 'attributes'=>array( // 'lb_record_primary_key', // 'lb_category_id', // 'lb_expenses_amount', // 'lb_expenses_date', // 'lb_expenses_recurring_id', // 'lb_expenses_brank_account_id', // 'lb_expenses_note', // ), //)); //echo '<div style="float: left; width: 49%;">';
<input type="search" id="search_invoice" value="" style="border-radius: 15px;" value="" placeholder="Search" /> <a margin-top:-31px; href="<?php echo $url_next; ?> "><i class="icon-forward"> </i></a> <a margin-top:-31px;; href="<?php echo $url_last; ?> "><i class="icon-fast-forward"></i></a> </div> <?php echo '<div class="lb-header-left" style="margin-left:397px;margin-top:-15px;">'; // LBApplicationUI::backButton(LbInvoice::model()->getActionURLNormalized("dashboard")); if ($expenses_id > 0) { LBApplicationUI::backButton(LbExpenses::model()->getActionURLNormalized('View', array('id' => $expenses_id))); } else { LBApplicationUI::backButton(LbInvoice::model()->getActionURLNormalized("dashboard")); } echo ' '; $this->widget('bootstrap.widgets.TbButtonGroup', array('type' => '', 'buttons' => array(array('label' => '<i class="icon-th-large"></i> Action', 'items' => array(array('label' => 'Email', 'url' => '#', 'linkOptions' => array('onclick' => 'onclickFormEmail();')), array('label' => 'Enter Payment', 'url' => LbPayment::model()->getCreateURLNormalized(array('id' => $model->lb_invoice_customer_id))), array('label' => 'Copy Invoice', 'url' => '#', 'linkOptions' => array('onclick' => 'onclickCopyInvoice();')), array('label' => 'Generate PDF', 'url' => LbInvoice::model()->getActionURL('pdf', array('id' => $model->lb_record_primary_key)), 'linkOptions' => array('target' => '_blank')), array('label' => 'Get Public URL', 'url' => '#', 'linkOptions' => array('onclick' => 'onclickFormGetPublicPDF();return false;'))))), 'encodeLabel' => false)); echo '</div>'; echo '</div>'; //echo AutoComplete::widget([ // 'model' => $model, // 'attribute' => 'country', // 'clientOptions' => [ // 'source' => ['USA', 'RUS'], // ], //]); echo '<div id="logo_wrapper" style="overflow:hidden;text-align: center;clear:bold;">';
</div> <div class="panel-footer">financial year <?php echo date('d M Y', strtotime($financial_year)); ?> </div> <div> </div> </div> <div class="col-lg" > <div class="panel-header-summary"><h4 >You have spent</h4></div> <div class="panel-body"> <div class="info_content_summary"> <h1 style="color: #dd3d36"> <?php if (strtotime($date_now) > strtotime($financial_year)) { $total_Payment_bills = LbPaymentVendor::model()->getTotalPaymentNext($financial_year, $financial_next_year); $total_Payment_expenses = LbExpenses::model()->getTotalExpensesNext($financial_year, $financial_next_year); echo LbInvoice::CURRENCY_SYMBOL . number_format($total_Payment_bills + $total_Payment_expenses, 2); } else { $total_Payment_bills = LbPaymentVendor::model()->getTotalPaymentPrev($financial_year, $financial_prev_year); $total_Payment_expenses = LbExpenses::model()->getTotalExpensesPrev($financial_year, $financial_prev_year); echo LbInvoice::CURRENCY_SYMBOL . number_format($total_Payment_bills + $total_Payment_expenses, 2); } ?> </h1> </div> </div> </div>
public function actionAssignInvoice() { $expenses_id = isset($_REQUEST['expenses_id']) ? $_REQUEST['expenses_id'] : 0; $expensesModel = LbExpenses::model()->findByPk($expenses_id); $invoiceModel = new LbInvoice('search'); $invoiceModel->unsetAttributes(); if (isset($_GET['LbInvoice'])) { $invoiceModel->attributes = $_GET['LbInvoice']; } $invoice_id = Yii::app()->request->getParam('invoice_id'); if (isset($invoice_id) && is_array($invoice_id) && count($invoice_id) > 0) { foreach ($invoice_id as $invoice) { if ($invoice > 0) { if (isset($expenses_id) && $expenses_id > 0) { $expensesInvoice = new LbExpensesInvoice(); $expensesInvoice->lb_expenses_id = $expenses_id; $expensesInvoice->lb_invoice_id = $invoice; $expensesInvoice->save(); } } } } LBApplication::render($this, '_assign_invoice', array('invoiceModel' => $invoiceModel, 'expensesModel' => $expensesModel)); }
$('#modal-new-customer-body-'+<?php echo $expenses_id; ?> ).load("<?php echo LbExpenses::model()->getActionURLNormalized('ExpensesNewCustomer', array('form_type' => 'ajax', 'ajax' => 1, 'expenses_id' => $expenses_id)); ?> "); } function refreshCustomerName(){ $('#tab1').load("<?php echo LbExpenses::model()->getActionURLNormalized('LoadAjaxTabCustomer', array('id' => $expenses_id)); ?> "); } function assignCustomer(){ $('#btn_view_customer').click(); $('#modal-view-customer-body-'+<?php echo $expenses_id; ?> ).html(getLoadingIconHTML(false)); $('#modal-view-customer-body-'+<?php echo $expenses_id; ?> ).load("<?php echo LbExpenses::model()->getActionURLNormalized('AssignCustomer', array('form_type' => 'ajax', 'ajax' => 1, 'expenses_id' => $expenses_id)); ?> "); } </script>
echo CHtml::label('Attachments', 'LbExpenses_lb_expenses_document', array('class' => 'control-label required')); ?> <div class="controls"> <?php $this->widget('CMultiFileUpload', array('name' => 'documents', 'accept' => 'jpeg|jpg|gif|png|pdf|odt|docx|doc|dia', 'duplicate' => 'Duplicate file!', 'denied' => 'Invalid file type', 'htmlOptions' => array('class' => 'multi'))); ?> </div> </div> <div class="form-actions"> <?php echo CHtml::SubmitButton('Save', array('onclick' => 'return validation();')); ?> <?php $this->widget('bootstrap.widgets.TbButton', array('label' => 'Back', 'url' => LbExpenses::model()->getActionURLNormalized('expenses'))); ?> <?php // LBApplicationUI::backButton('admin'); ?> </div> <?php $this->endWidget(); ?> </div><!-- form --> <script language="javascript">
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; } }
//Permission Quotation $quotation_canAdd = BasicPermission::model()->checkModules('lbQuotation', 'add'); $quotation_canView = BasicPermission::model()->checkModules('lbQuotation', 'view'); //Permission Bills $bill_canAdd = BasicPermission::model()->checkModules('lbVendor', 'add'); $bill_canView = BasicPermission::model()->checkModules('lbVendor', 'view'); //Permission Report $report_canView = BasicPermission::model()->checkModules('lbReport', 'view'); $home_img = CHtml::image(Yii::app()->request->baseUrl . '/images/logo_home.png', '', array('height' => 30, 'width' => 30, 'style' => "margin-top:-5px")); ?> <div class="container" id="page"> <div id="lb-top-menu"> <?php $ownCompany = LbCustomer::model()->getOwnCompany(); $this->widget('bootstrap.widgets.TbNavbar', array('brand' => false, 'brandUrl' => isset(Yii::app()->user) ? LbInvoice::model()->getActionURL('dashboard') : Yii::app()->createUrl('site/login'), 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array()), array('class' => 'bootstrap.widgets.TbMenu', 'encodeLabel' => false, 'htmlOptions' => array('class' => 'pull-left'), 'items' => array(array('label' => $home_img, 'url' => LbInvoice::model()->getActionURL('dashboard')), array('label' => Yii::t('lang', 'Customers'), 'url' => LbCustomer::model()->getAdminURL(), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbCustomer'), 'items' => array(array('label' => Yii::t('lang', '<i class="icon-plus"></i> New Customer'), 'url' => LbCustomer::model()->getCreateURL(), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canAdd), '---', array('label' => Yii::t('lang', 'All Customers'), 'url' => LbCustomer::model()->getAdminURL(), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canView), array('label' => Yii::t('lang', 'Contracts'), 'url' => LbContracts::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canView), array('label' => Yii::t('lang', 'My Company'), 'url' => LbCustomer::model()->getActionURLNormalized('view', array('id' => $ownCompany->lb_record_primary_key)), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $customer_canView))), array('label' => Yii::t('lang', 'Income'), 'url' => LbInvoice::model()->getActionURL('dashboard'), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbInvoice'), 'items' => array(array('label' => Yii::t('lang', '<i class="icon-plus"></i> New Invoice'), 'url' => LbInvoice::model()->getCreateURLNormalized(array('group' => strtolower(LbInvoice::LB_INVOICE_GROUP_INVOICE))), 'visible' => $invoice_canAdd), array('label' => Yii::t('lang', '<i class="icon-plus"></i> New Quotation'), 'url' => LbQuotation::model()->getCreateURLNormalized(), 'visible' => $quotation_canAdd), array('label' => Yii::t('lang', '<i class="icon-plus"></i> Enter Payment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbPayment::model()->getCreateURLNormalized(), 'visible' => $quotation_canAdd), '---', array('label' => Yii::t('lang', 'Outstanding Invoices and Quotations'), 'linkOptions' => array('href' => LbInvoice::model()->getActionURL('dashboard'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbInvoice::model()->getActionURL('dashboard'), 'visible' => $invoice_canView), array('label' => Yii::t('lang', 'All Invoices'), 'linkOptions' => array('href' => LbInvoice::model()->getActionURL('admin'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbInvoice::model()->getActionURL('admin'), 'visible' => $invoice_canView), array('label' => Yii::t('lang', 'All Quotations'), 'linkOptions' => array('href' => LbQuotation::model()->getActionURL('admin'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbQuotation::model()->getActionURL('admin'), 'visible' => $quotation_canView))), array('label' => Yii::t('lang', 'Expenses'), 'items' => array(array('label' => Yii::t('lang', 'All Expenses'), 'linkOptions' => array('href' => LbExpenses::model()->getActionURL('expenses'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbExpenses::model()->getActionURL('expenses'), 'visible' => $expenses_canView), array('label' => Yii::t('lang', 'All Payment voucher'), 'linkOptions' => array('href' => LbExpenses::model()->getActionURL('paymentVoucher'), 'data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'url' => LbExpenses::model()->getActionURL('paymentVoucher'), 'visible' => $expenses_canView))), array('label' => Yii::t('lang', 'Bills'), 'url' => LbVendor::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbVendor'), 'items' => array(array('label' => Yii::t('lang', 'Outstanding'), 'url' => LbVendor::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canView), array('label' => Yii::t('lang', 'Make Payment'), 'url' => LbVendor::model()->getActionModuleURL('vendor', 'addPayment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canAdd))), array('label' => Yii::t('lang', 'Payroll'), 'url' => LbEmployee::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbVendor'), 'items' => array(array('label' => Yii::t('lang', 'All Employees'), 'url' => LbEmployee::model()->getActionURL('dashboard'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canView), array('label' => Yii::t('lang', 'Make Payment'), 'url' => LbEmployee::model()->getActionURL('EnterPayment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canAdd), array('label' => Yii::t('lang', 'All Payment'), 'url' => LbEmployee::model()->getActionURL('ListPayment'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $bill_canView))), array('label' => Yii::t('lang', 'Report'), 'url' => array('/lbReport/default/index'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => !Yii::app()->user->isGuest && Modules::model()->checkHiddenModule('lbReport'), 'items' => array(array('label' => Yii::t('lang', 'All'), 'url' => array('/lbReport/default/index?tab=all'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Aging Report'), 'url' => array('/lbReport/default/index?tab=aging_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Cash Receipt'), 'url' => array('/lbReport/default/index?tab=cash_receipt'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Invoice Journal'), 'url' => array('/lbReport/default/index?tab=invoice_journal'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'GST Report'), 'url' => array('/lbReport/default/index?tab=gst_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Sales Report'), 'url' => array('/lbReport/default/index?tab=sales_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Customer Statement'), 'url' => array('/lbReport/default/index?tab=customer_statement'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Employee Report'), 'url' => array('/lbReport/default/index?tab=employee_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView), array('label' => Yii::t('lang', 'Payment Report'), 'url' => array('/lbReport/default/index?tab=payment_report'), 'linkOptions' => array('data-workspace' => '1', 'id' => uniqid(), 'live' => false), 'visible' => $report_canView)))))), 'htmlOptions' => array('class' => 'navbar'))); ?> </div> <div id="lb-top-shortcuts"> <?php $onwSubcriptAccount = AccountSubscription::model()->getSubscriptionOwnerID(LBApplication::getCurrentlySelectedSubscription()); $onwSubcrip = false; if ($onwSubcriptAccount == Yii::app()->user->id) { $onwSubcrip = true; } $linx_app_menu_subscription_items = array(); $selected_subscription_label = 'Subscription'; if (!Yii::app()->user->isGuest) { $linx_app_account_subscriptions = AccountSubscription::model()->findSubscriptions(Yii::app()->user->id); foreach ($linx_app_account_subscriptions as $sub_id => $subscription) {
function actionViewPV() { $model = new LbExpenses(); $model->unsetAttributes(); // clear any default values $modelPV = new LbPaymentVoucher(); if (isset($_GET['LbExpenses'])) { $expensesFrm = $_GET['LbExpenses']; $model->attributes = $expensesFrm; if (isset($expensesFrm['lb_category_id']) && $expensesFrm['lb_category_id'] != '') { $model->lb_category_id = $expensesFrm['lb_category_id']; } if (isset($expensesFrm['from_date']) && $expensesFrm['from_date'] != '') { $model->from_date = date('Y-m-d', strtotime($expensesFrm['from_date'])); } if (isset($expensesFrm['to_date']) && $expensesFrm['to_date'] != '') { $model->to_date = date('Y-m-d', strtotime($expensesFrm['to_date'])); } } $this->render($this, 'admin', array('model' => $model, 'modelPv' => $modelPV)); }
var pv_title = $('#pv_title').val(); var pv_description = $('#pv_description').val(); var pv_date = $('#pv_date').val(); if(pv_no == '') alert('Please enter payment voucher no!'); else { if(idArr.length < 1) idArr = false; var pvid = <?php echo $id; ?> ; $.post("<?php echo LbExpenses::model()->getActionURLNormalized('savePaymentVoucher', array()); ?> ", {pv_no: pv_no, pv_title: pv_title,pv_description:pv_description,pv_date:pv_date,iem_ex_arr:idArr,idPv:pvid }, function(response){ var responseJSON = jQuery.parseJSON(response); if(responseJSON.success == 0) { // alert("Payment voucher no already exists. Please enter payment voucher no other"); // window.location.href = '<?php // echo YII::app()->baseUrl; ?> /index.php/lbExpenses/default/CreatePaymentVoucher/id/'+responseJSON.id; } else
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++; $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>