// print_r($invoice_total); ?> <h5 style="margin: 20px 0px 5px 0px;font-weight: bold;"> <span> <input class="pdf_checkbox" name="<?php echo $data_invocie->lb_record_primary_key; ?> " type="checkbox" value="<?php echo $data_invocie->lb_record_primary_key; ?> " /> </span> <span style="text-decoration: underline;"> <?php echo LBApplication::workspaceLink($data_invocie->lb_vd_invoice_no); ?> </span> <sapn style="margin-left: 65px;color: #000000; font-weight: normal">Total: <?php echo $invoice_total->lb_vendor_last_outstanding; ?> </span> </h5> <table border="0" width="100%" class="items table table-bordered"> <thead> <tr> <th width="250" class="lb-grid-header"><?php echo Yii::t('lang', 'Amount Paid'); ?> </th> <th width="150" class="lb-grid-header"><?php
/* @var $expenses_invoice array of LbExpensesInvoice models */ $canAddInvoice = BasicPermission::model()->checkModules('lbInvoice', 'add'); $canAddDelete = BasicPermission::model()->checkModules('lbCustomer', 'delete'); if ($canAddInvoice) { echo '<div class="btn-toolbar">'; // LBApplicationUI::newButton(Yii::t('lang','New Invoice'), array('url'=>$this->createUrl('addInvoice'))); $this->widget('bootstrap.widgets.TbButton', array('label' => 'New Invoice', 'url' => LbInvoice::model()->getCreateURLNormalized(array('group' => strtolower(LbInvoice::LB_INVOICE_GROUP_INVOICE), 'expenses_id' => $expenses_id)))); $this->widget('bootstrap.widgets.TbButton', array('label' => 'Assign Invoice', 'htmlOptions' => array('onclick' => 'assignInvoice();'))); echo '</div>'; } $i = 0; foreach ($expenses_invoice as $ex_invoice) { $invoice = LbInvoice::model()->findByPk($ex_invoice->lb_invoice_id); $i++; echo "\n <div style='overflow:hidden; border-top: 1px solid #EEEEEE;margin-top: 5px;'>\n <div style='float:left'>\n <h4><span style='padding: 0 8px;background:#EEEEEE;border-radius:50%;'>{$i}</span> " . LBApplication::workspaceLink($invoice->lb_invoice_no, $invoice->customer ? $invoice->getViewURL($invoice->customer->lb_customer_name) : $invoice->getViewURL("No customer")) . "</h4>\n </div>"; if ($canAddDelete) { echo "<div style='float:right;margin-top:5px;'>\n <a href='#' onclick='ajaxDeleteInvoiceExpenses(" . $invoice->lb_record_primary_key . "); return false;'>\n <i class='icon-trash'></i>\n Delete\n </a>\n </div>"; } echo "</div>\n <div id='error_delete_expense_invoice_" . $invoice->lb_record_primary_key . "' class='alert alert-block alert-error' style='display:none;'></div>\n "; } // end for //form assign invoice $this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'modal-invoice-assign-form')); echo '<div class="modal-header" style="max-width:700px;">'; echo '<a class="close" data-dismiss="modal">×</a>'; echo '<h4>Assign Invoice</h4>'; echo '</div>'; echo '<div class="modal-body" style="max-height:500px" id="modal-view-invoice-body-' . $expenses_id . '">'; echo '</div>'; $this->endWidget();
$invoice_total = LbInvoiceTotal::model()->find('lb_invoice_id=' . intval($data_invocie->lb_record_primary_key)); ?> <h5 style="margin: 20px 0px 5px 0px;font-weight: bold;"> <span> <input class="pdf_checkbox" name="<?php echo $data_invocie->lb_record_primary_key; ?> " type="checkbox" value="<?php echo $data_invocie->lb_record_primary_key; ?> " /> </span> <span style="text-decoration: underline;"> <?php echo LBApplication::workspaceLink($data_invocie->lb_invoice_no, LbInvoice::model()->getViewInvoiceURL($data_invocie->lb_record_primary_key, $data->lb_customer_name)); ?> </span> <sapn style="margin-left: 65px;color: #000000; font-weight: normal">Total: <?php echo $invoice_total->lb_invoice_total_after_taxes; ?> </span> </h5> <table border="0" width="100%" class="items table table-bordered"> <thead> <tr> <th width="250" class="lb-grid-header"><?php echo Yii::t('lang', 'Amount Paid'); ?> </th> <th width="150" class="lb-grid-header"><?php
{ quotaiton_status_accepted = true; } else { quotaiton_status_accepted = false; } $("#quotation_status_container").html(newValue); }')); echo '</div>'; $modelInv = LbInvoice::model()->getInvoiceByQuotation($model->lb_record_primary_key); if (count($modelInv->data) > 0) { echo '<div>'; echo Yii::t('lang', 'Quotation') . ': '; foreach ($modelInv->data as $modelInvItem) { echo LBApplication::workspaceLink($modelInvItem->lb_invoice_no, $modelInvItem->customer ? LbInvoice::model()->getViewParamModuleURL($modelInvItem->customer->lb_customer_name, null, $modelInvItem->lb_record_primary_key, "lbInvoice") : LbInvoice::model()->getViewParamModuleURL("No customer", null, $modelInvItem->lb_record_primary_key, "lbInvoice")); echo ", "; } echo '</div>'; } echo '</div>'; // company info echo '<div class="pull-right" style="text-align: right; margin-right: 25px;width:60%;">'; echo '<h3>' . (isset($model->owner) ? $model->owner->lb_customer_name : '') . '</h3><br/>'; if (isset($model->owner) && $model->owner->lb_customer_registration) { echo 'Registration No: ' . $model->owner->lb_customer_registration . '. '; } echo 'Website: ' . (isset($model->owner) ? $model->owner->lb_customer_website_url : ''); echo '<div id="container-supplier-contact" style="float: right; max-width: 600px;">'; if (isset($model->ownerAddress) && $model->ownerAddress) { $ownCompanyAddress = $model->ownerAddress;
}')); echo '</td>'; echo '</tr>'; echo '<tr class="odd">'; echo '<th class="lb_th_InvoiceInfo">Created By</th>'; echo '<td class="lb_td_InoviceInfo">'; echo $create_by; echo '</td>'; echo '</tr>'; echo '</tbody>'; echo '</table>'; if (isset($model->lb_quotation_id) && $model->lb_quotation_id != 0) { $modelQuo = LbQuotation::model()->findByPk($model->lb_quotation_id); echo '<div>'; echo Yii::t('lang', 'Quotation') . ': '; echo LBApplication::workspaceLink($modelQuo->lb_quotation_no, $modelQuo->customer ? LbQuotation::model()->getViewParamModuleURL($modelQuo->customer->lb_customer_name, null, $modelQuo->lb_record_primary_key, "lbQuotation") : LbQuotation::model()->getViewParamModuleURL("No customer", null, $modelQuo->lb_record_primary_key, "lbQuotation")); echo '</div>'; } echo '</div>'; echo '</div>'; echo '</div>'; // end header container div $this->endWidget(); ?> <script lang="javascript"> function link(e,r) { // alert(r) window.open('<?php LbInvoice::model()->getActionModuleURL('default', 'view'); ?>
<div> <div id ="show_invoice"> <?php if (isset($_REQUEST['status_id'])) { $status = '("' . $_REQUEST['status_id'] . '")'; } else { $status = '("' . LbInvoice::LB_INVOICE_STATUS_CODE_DRAFT . '","' . LbInvoice::LB_INVOICE_STATUS_CODE_OPEN . '","' . LbInvoice::LB_INVOICE_STATUS_CODE_OVERDUE . '")'; } ?> <?php $this->widget('bootstrap.widgets.TbGridView', array('id' => 'lb-invoice-Outstanding-grid', 'dataProvider' => $model->getInvoiceByStatus($status, FALSE, 10, $canList), 'template' => "{items}\n{pager}\n{summary}", 'columns' => array(array('type' => 'raw', 'value' => function ($data) { if ($data->lb_invoice_status_code == "I_OPEN") { return "<a href='#' onclick='ajaxCheckStatus({$data->lb_record_primary_key}); return false;'>{$data->lb_invoice_no}</a>" . "<br/>" . LBApplicationUI::getStatusBadge($data->lb_invoice_status_code); } else { return LBApplication::workspaceLink($data->lb_invoice_no, $data->customer ? $data->getViewURL($data->customer->lb_customer_name) : $data->getViewURL("No customer")) . "<br/>" . LBApplicationUI::getStatusBadge($data->lb_invoice_status_code); } }, 'htmlOptions' => array('width' => '130')), array('type' => 'raw', 'value' => '$data->customer ? $data->customer->lb_customer_name."<br><span style=\'color:#666;\'>". $data->lb_invoice_subject."</span>" : "No customer" ."<br><span style=\'color:#666;\'>". $data->lb_invoice_subject."</span>"', 'htmlOptions' => array('width' => '')), array('type' => 'raw', 'value' => 'date("d M Y",strtotime($data->lb_invoice_due_date))', 'htmlOptions' => array('width' => '100')), array('type' => 'raw', 'value' => 'LbInvoice::model()->getStatusAmount($data->lb_invoice_status_code,$data->total_invoice ? $data->total_invoice->lb_invoice_total_outstanding : "0.00")', 'htmlOptions' => array('width' => '120'))))); ?> </div> </div> <!-- <div> <a class="more" href="<?php //php echo LbInvoice::model()->getActionURLNormalized('admin'); ?> "><?php //php echo Yii::t('lang','see more invoices'); ?> </a>
echo '<div class="modal-header" style="max-width:700px;">'; echo '<a class="close" data-dismiss="modal">×</a>'; echo '<h4>Assign Customer</h4>'; echo '</div>'; echo '<div class="modal-body" style="max-height:500px" id="modal-view-customer-body-' . $expenses_id . '">'; echo '</div>'; $this->endWidget(); $this->widget('bootstrap.widget.TbButton', array('type' => '', 'htmlOptions' => array('data-toggle' => 'modal', 'data-target' => '#modal-customer-assign-form', 'style' => 'display:none', 'id' => 'btn_view_customer'))); // end form assign } $i = 0; foreach ($expenses_customer as $customer) { $client = LbCustomer::model()->findByPk($customer->lb_customer_id); if (count($client) > 0) { $i++; echo "\n <div style='overflow:hidden; border-top: 1px solid #EEEEEE;margin-top: 5px;'id='list_customer'>\n <div style='float:left'>\n \n <h4><span style='padding: 0 8px;background:#EEEEEE;border-radius:50%;'>{$i}</span>" . LBApplication::workspaceLink($client->lb_customer_name, $client->getViewURLNormalized($client->lb_customer_name)) . "</h4>\n </div>"; if ($canAddDelete) { echo "<div style='float:right;margin-top:5px;'>\n <a href='#' onclick='ajaxDeleteCustomerExpenses(" . $client->lb_record_primary_key . "); return false;'>\n <i class='icon-trash'></i>\n Delete\n </a>\n </div>"; } echo "</div>\n <div id='error_delete_expense_customer_" . $client->lb_record_primary_key . "' class='alert alert-block alert-error' style='display:none;'></div>\n "; } } // end for ?> <script> function ajaxDeleteCustomerExpenses(id) { $.ajax({ type:'POST',