Exemplo n.º 1
0
 public function getGeneraSubscription()
 {
     $lastGenera = $this->getFullRecords();
     if (count($lastGenera) <= 0) {
         $genera = new LbGenera();
         $genera->lb_genera_currency_symbol = "";
         $genera->save();
         $lastGenera = $this->getFullRecords();
     }
     $generaID = $lastGenera[0]->lb_record_primary_key;
     $dataProvider = LbGenera::model()->findByPk($generaID);
     return $dataProvider;
 }
Exemplo n.º 2
0
<?php

$thousand = LbGenera::model()->getGeneraSubscription()->lb_thousand_separator;
$decimal = LbGenera::model()->getGeneraSubscription()->lb_decimal_symbol;
$strnum = new LbInvoiceTotal();
$method = LBPayment::model()->method;
$date_from = date('Y-m-d');
$date_to = date('Y-m-d', strtotime("+1 month -1 day"));
$customer_id = false;
if (isset($_REQUEST['search_date_from']) && $_REQUEST['search_date_from'] != "") {
    $date_from = date('Y-m-d', strtotime($_REQUEST['search_date_from']));
}
if (isset($_REQUEST['search_date_to']) && $_REQUEST['search_date_to'] != "") {
    $date_to = date('Y-m-d', strtotime($_REQUEST['search_date_to']));
}
if (isset($_REQUEST['customer']) && $_REQUEST['customer'] != 0) {
    $customer_id = $_REQUEST['customer'];
}
$a = LbInvoice::model()->getInvoiceMonth($customer_id, $date_from, $date_to);
$PDFGst = '<table border="0" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">' . '<tr><td>
            <table border="0" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">
            <tr><td >
             <span style="font-size:20px;font-weight:bold;">GST Report</span>
             
            </td></tr>
            </table>
            </td></tr>' . '<tr><td>
            <table border="0" style="margin:auto;width:100%;" cellpadding="0" cellspacing="0">
            <tr><td >
             <span style="margin:10px;padding:10px">From: ' . $date_from . '</span>
             <span style="margin:10px;">To: ' . $date_to . '</span>
Exemplo n.º 3
0
 public function actionAjaxUpdateFieldGenera()
 {
     if (isset($_POST['pk']) && isset($_POST['name']) && isset($_POST['value'])) {
         $id = $_POST['pk'];
         $attribute = $_POST['name'];
         $value = $_POST['value'];
         // get model
         $model = LbGenera::model()->findByPk($id);
         // update
         $model->{$attribute} = $value;
         $model->save();
         return true;
     }
     return false;
 }
Exemplo n.º 4
0
<?php

$m = $this->module->id;
$credit_by = LbCoreEntity::model()->getCoreEntity($m, $model->lb_record_primary_key)->lb_created_by;
$canAdd = BasicPermission::model()->checkModules($m, 'add');
$canView = BasicPermission::model()->checkModules($m, 'view', $credit_by);
$canList = BasicPermission::model()->checkModules($m, 'list', $credit_by);
$canDelete = BasicPermission::model()->checkModules($m, 'delete', $credit_by);
$canEdit = BasicPermission::model()->checkModules($m, 'update', $credit_by);
$deleteTemplate = false;
if ($canDelete) {
    $deleteTemplate = "{delete}";
}
$currency_name = LbGenera::model()->getGeneraSubscription()->lb_genera_currency_symbol;
?>
<div style="margin-top: 30px">
    <?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'lb-quotation-items-form', 'enableAjaxValidation' => false, 'type' => 'horizontal'));
?>
    <?php 
$grid_id = 'quotation-line-item-grid-' . $model->lb_record_primary_key;
?>
    <?php 
$this->widget('bootstrap.widgets.TbGridView', array('id' => $grid_id, 'dataProvider' => $quotationItemModel->getquotationItems($model->lb_record_primary_key), 'htmlOptions' => array('style' => 'padding-top:50px'), 'template' => "{items}\n{summary}", 'columns' => array(array('header' => '#', 'type' => 'raw', 'value' => '1', 'htmlOptions' => array('width' => '10'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => $deleteTemplate, 'deleteButtonUrl' => '"' . $this->createUrl("deleteBlankItem") . '" .
                                                "?id={$data->lb_record_primary_key}"', 'afterDelete' => 'function(link,success,response){
                                var responseJSON = jQuery.parseJSON(response);
                                refreshTotal(responseJSON.lb_quotation_subtotal,responseJSON.lb_quotation_total_after_total);
                                refreshTaxGrid();
                            } ', 'htmlOptions' => array('width' => '10'), 'headerHtmlOptions' => array('class' => 'lb-grid-header')), array('header' => Yii::t('lang', 'Item'), 'type' => 'raw', 'value' => 'CHtml::activeTextArea($data,"lb_quotation_item_description",
                                              array("style"=>"width: 350px; border-top: none; border-left: none; border-right: none; box-shadow: none;",
                                                    "name"=>"lb_quotation_item_description_{$data->lb_record_primary_key}",
Exemplo n.º 5
0
echo '<td class="lb_td_InoviceInfo">';
$this->widget('editable.EditableField', array('type' => 'date', 'model' => $model, 'attribute' => 'lb_quotation_date', 'url' => $model->getActionURLNormalized('ajaxUpdateField'), 'placement' => 'right', 'format' => 'yyyy-mm-dd', 'viewformat' => 'dd M yyyy'));
echo '</td>';
echo '</tr>';
echo '<tr class="odd">';
echo '<th class="lb_th_InvoiceInfo">Term</th>';
echo '<td class="lb_td_InoviceInfo">';
//echo $form->dropDownList($model,'lb_quotation_term',$option_term,array('empty'=>$model->lb_quotation_term,'name'=>'lb_quotation_term[]','style'=>'width:100px;'));
$this->widget('editable.EditableField', array('type' => 'select', 'model' => $model, 'attribute' => 'lb_quotation_term', 'url' => $model->getActionURLNormalized('ajaxUpdateField'), 'source' => Editable::source(UserList::model()->getItemsForListCode('term'), 'system_list_item_id', 'system_list_item_name'), 'placement' => 'left'));
echo '</td>';
echo '</tr>';
echo '<tr class="odd">';
echo '<th class="lb_th_InvoiceInfo">Currency</th>';
echo '<td class="lb_td_InoviceInfo">';
// echo LbGenera::model()->getGeneraSubscription()->lb_genera_currency_symbol;
$this->widget('editable.EditableField', array('type' => 'select', 'model' => $model, 'attribute' => 'lb_quotation_currency', 'url' => $model->getActionURLNormalized('ajaxUpdateField'), 'emptytext' => LbGenera::model()->getGeneraSubscription()->lb_genera_currency_symbol, 'source' => CHtml::listData(LbGenera::model()->getCurrency("", LbGenera::LB_QUERY_RETURN_TYPE_MODELS_ARRAY), function ($gene) {
    return "{$gene->lb_record_primary_key}";
}, function ($gene) {
    return "{$gene->lb_genera_currency_symbol}";
}) + array("-1" => "-- Add new currency --"), 'placement' => 'left', 'htmlOptions' => array('id' => 'LbQuotation_quotation_genera_id_' . $model->lb_record_primary_key), 'onShown' => 'js: function() {
                            var $tip = $(this).data("editableContainer").tip();
                            var dropdown = $tip.find("select");
                            $(dropdown).bind("change", function(e){
                                onChangeCurrencyDropdown(e,' . $model->lb_record_primary_key . ');
                            });
                        }'));
echo '</td>';
echo '</tr>';
echo '<tr class="odd">';
echo '<th class="lb_th_InvoiceInfo">Created By</th>';
echo '<td class="lb_td_InoviceInfo">';
Exemplo n.º 6
0
<?php

/* @var $this DefaultController */
?>
<div style="width: 40%;">
<?php 
$genera = LbGenera::model()->getGeneraSubscription();
$this->widget('editable.EditableDetailView', array('id' => 'genera-id-details', 'data' => $genera, 'url' => $genera->getActionURL('ajaxUpdateFieldGenera'), 'placement' => 'right', 'attributes' => array(array('name' => 'lb_genera_currency_symbol', 'editable' => array('type' => 'text', 'inputclass' => 'input-large', 'emptytext' => 'Click to Update')), array('name' => 'lb_thousand_separator', 'editable' => array('type' => 'text', 'inputclass' => 'input-large', 'emptytext' => 'Click to Edit')), array('name' => 'lb_decimal_symbol', 'editable' => array('type' => 'text', 'inputclass' => 'input-large', 'emptytext' => 'Click to Edit')))));
?>
</div>
<script>
    
</script>