Exemplo n.º 1
0
                                        alert("Customer name cannot be blank.");
                                        return false;
                                    }
                            } ', 'success' => 'function(data, status, obj) {
                    if(data != null)
                    {
                        var dataJSON = jQuery.parseJSON(data);
                        $("#lb_invocie_status").html(dataJSON.lb_invoice_status_code);
                        onConfirmInvoiceSuccessful(dataJSON);
                    }
                            }'), array('id' => 'btn-confirm-invoice-' . $model->lb_record_primary_key));
    }
    // Buttom Write Off
    if ($model->lb_invoice_status_code != $model::LB_INVOICE_STATUS_CODE_WRITTEN_OFF && $model->lb_invoice_status_code != $model::LB_INVOICE_STATUS_CODE_PAID) {
        echo ' ';
        LBApplicationUI::ajaxButton(Yii::t('lang', 'Write off'), $model->getActionURLNormalized('ajaxUpdateStatus', array('id' => $model->lb_record_primary_key, 'status' => LbInvoice::LB_INVOICE_STATUS_CODE_WRITTEN_OFF)), array(), array('id' => 'btn-write-off-invoice-' . $model->lb_record_primary_key));
    }
}
if ($canDelete) {
    // Buttom DELETE
    if ($model->lb_invoice_status_code == $model::LB_INVOICE_STATUS_CODE_DRAFT) {
        echo ' ';
        LBApplicationUI::button(Yii::t('lang', 'Delete'), array('url' => $this->createUrl('delete', array('id' => $model->lb_record_primary_key)), 'htmlOptions' => array('onclick' => 'return confirm("Are you sure you want to delete this item?");', 'id' => 'btn-delete-invoice-' . $model->lb_record_primary_key)));
    }
}
echo '</div>';
/***************************** HIDDEN STUFF *************************************/
////// GENERIC MODAL HOLDER
////// We can use this to load anything into a modal,
////// through ajax as well
$this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'modal-holder-' . $model->lb_record_primary_key));
Exemplo n.º 2
0
<!-- //// SAVE BUTTON -->
<div style="display: block; clear: both; text-align: center; padding-top: 40px;" class="">
    <?php 
if ($canAdd) {
    LBApplicationUI::submitButton(Yii::t('lang', 'Save'), array('htmlOptions' => array('onclick' => 'saveQuotation(' . $model->lb_record_primary_key . '); return false;', 'style' => 'margin-left: auto; margin-right: auto', 'id' => 'btn-quotation-save-all-' . $model->lb_record_primary_key)));
    //// SHOW CONFIRM BUTTON IF QUOTATION IS A DRAFT
    if ($model->lb_quotation_status == $model::LB_QUOTATION_STATUS_CODE_DRAFT) {
        echo '&nbsp;';
        LBApplicationUI::ajaxButton(Yii::t('lang', 'Confirm quotation'), $model->getActionURLNormalized('ajaxtConfirm', array('id' => $model->lb_record_primary_key)), array('id' => 'ajax-submit-confirm-invoice-' . uniqid(), 'beforeSend' => 'function(data){
                                       if(!lbQuotation_choose_customer)
                                       {
                                            alert("Customer name cannot be blank.");
                                            return false;
                                       }
                                       
                                } ', 'success' => 'function(data, status, obj) {
                        if(data != null)
                        {
                            var dataJSON = jQuery.parseJSON(data);
                            
                            onConfirmQuotationSuccessful(dataJSON);
                        }
                                }'), array('id' => 'btn-confirm-quotation-' . $model->lb_record_primary_key));
    }
}
// Buttom DELETE
if ($model->lb_quotation_status == $model::LB_QUOTATION_STATUS_CODE_DRAFT && $canDelete) {
    echo '&nbsp;';
    LBApplicationUI::button(Yii::t('lang', 'Delete'), array('url' => $this->createUrl('delete', array('id' => $model->lb_record_primary_key)), 'htmlOptions' => array('onclick' => 'return confirm("Are you sure you want to delete this item?");', 'id' => 'btn-delete-quotation-' . $model->lb_record_primary_key)));
}
?>
Exemplo n.º 3
0
                    {
                        var dataJSON = jQuery.parseJSON(data);
                        $("#lb_invocie_status").html(dataJSON.lb_vd_invoice_status);
                        $("#po-number-container").html(dataJSON.lb_vd_invoice_no);
                        onConfirmInvoiceSuccessful(dataJSON);
                    }
                            }'), array('id' => 'btn-confirm-invoice-' . $model->lb_record_primary_key));
    }
    // Buttom Write Off
    if ($model->lb_vd_invoice_status != $model::LB_VD_CODE_WRITTEN_OFF) {
        echo '&nbsp;';
        LBApplicationUI::ajaxButton(Yii::t('lang', 'Write off'), LbVendor::model()->getActionURLNormalized('UpdateStatusVIWriteOff', array('id' => $model->lb_record_primary_key, 'status' => LbVendor::LB_VENDOR_STATUS_CODE_WRITTEN_OFF)), array('success' => 'function(data, status, obj) {
                    if(data != null)
                    {
                        var dataJSON = jQuery.parseJSON(data);
                        onConfirmInvoiceSuccessful(dataJSON);
                        $("#invoice-header-container .ribbon-green").html(dataJSON.lb_vendor_status);
                        $("#lb_invocie_status").html(dataJSON.lb_vendor_status);
                        $("#btn-write-off-invoice-"+dataJSON.lb_record_primary_key).remove();
                    }
                            }'), array('id' => 'btn-write-off-invoice-' . $model->lb_record_primary_key));
    }
}
if ($canDelete) {
    // Buttom DELETE
    if ($model->lb_vd_invoice_status == $model::LB_VD_STATUS_CODE_DRAFT) {
        echo '&nbsp;';
        LBApplicationUI::button(Yii::t('lang', 'Delete'), array('url' => LbVendor::model()->getActionURLNormalized('deleteVDInvoice', array('id' => $model->lb_record_primary_key)), 'htmlOptions' => array('onclick' => 'return confirm("Are you sure you want to delete this item?");', 'id' => 'btn-delete-invoice-' . $model->lb_record_primary_key)));
    }
}
echo '</div>';
echo '</div></div>';
Exemplo n.º 4
0
        }'));
echo '</div>';
// end note div
echo '</div>';
echo '<div style="text-align: center; width:100%;" class="invoice-total-container">';
if ($canEdit) {
    //// SAVE BUTTON
    LBApplicationUI::submitButton('Save', array('htmlOptions' => array('onclick' => 'saveInvoice(' . $model->lb_record_primary_key . '); return false;', 'style' => 'margin-left: auto; margin-right: auto', 'id' => 'btn-invoice-save-all-' . $model->lb_record_primary_key)));
    //// SHOW CONFIRM BUTTON IF INVOICE IS A DRAFT
    if ($model->lb_vendor_status == $model::LB_PO_STATUS_CODE_DRAFT) {
        echo '&nbsp;';
        LBApplicationUI::ajaxButton(Yii::t('lang', 'Confirm Invoice'), $model->getActionURLNormalized('AjaxConfirmVenDor', array('id' => $model->lb_record_primary_key)), array('id' => 'ajax-submit-confirm-invoice-' . uniqid(), 'success' => 'function(data, status, obj) {
                    if(data != null)
                    {
                        var dataJSON = jQuery.parseJSON(data);
                        $("#lb_invocie_status").html(dataJSON.lb_vendor_status);
                        $("#po-number-container").html(dataJSON.lb_vendor_no);
                        onConfirmInvoiceSuccessful(dataJSON);
                    }
                            }'), array('id' => 'btn-confirm-invoice-' . $model->lb_record_primary_key));
    }
    // Buttom Write Off
    //    if ($model->lb_vendor_status != $model::lb)
    //    {
    //        echo '&nbsp;';
    //        LBApplicationUI::ajaxButton(Yii::t('lang','Write off'),
    //            $model->getActionURLNormalized('UpdateStatusWriteOff',
    //                array('id'=>$model->lb_record_primary_key,'status'=> LbVendor::LB_VENDOR_STATUS_CODE_WRITTEN_OFF)),
    //            array(
    //                'success' => 'function(data, status, obj) {
    //                    if(data != null)
Exemplo n.º 5
0
                        $("#invoice_no_change").html(dataJSON.lb_invoice_no);
                        
                        onConfirmInvoiceSuccessful(dataJSON);
                    }
                            }'), array('id' => 'btn-confirm-invoice-' . $model->lb_record_primary_key));
    }
    // Buttom Write Off
    if ($model->lb_invoice_status_code != $model::LB_INVOICE_STATUS_CODE_WRITTEN_OFF && $model->lb_invoice_status_code != $model::LB_INVOICE_STATUS_CODE_PAID) {
        echo '&nbsp;';
        LBApplicationUI::ajaxButton(Yii::t('lang', 'Write off'), $model->getActionURLNormalized('ajaxUpdateStatus', array('id' => $model->lb_record_primary_key, 'status' => LbInvoice::LB_INVOICE_STATUS_CODE_WRITTEN_OFF)), array('success' => 'function(data, status, obj) {
                    if(data != null)
                    {
                    
                        var dataJSON = jQuery.parseJSON(data);
                        
                        $("#lb_invocie_status").html(dataJSON.lb_invoice_status_code);
                        $(".lb_badge_status").html(dataJSON.lb_invoice_status_code);
                        $("#invoice_no_change").html(dataJSON.lb_invoice_no);
                        
                        onConfirmInvoiceSuccessful(dataJSON);
                    }
                            }'), array('id' => 'btn-write-off-invoice-' . $model->lb_record_primary_key));
    }
}
if ($canDelete) {
    // Buttom DELETE
    if ($model->lb_invoice_status_code == $model::LB_INVOICE_STATUS_CODE_DRAFT) {
        echo '&nbsp;';
        LBApplicationUI::button(Yii::t('lang', 'Delete'), array('url' => $this->createUrl('delete', array('id' => $model->lb_record_primary_key)), 'htmlOptions' => array('onclick' => 'return confirm("Are you sure you want to delete this item?");', 'id' => 'btn-delete-invoice-' . $model->lb_record_primary_key)));
    }
}