예제 #1
0
 public function actionAdmin()
 {
     $model = new LbInvoice();
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Modules'])) {
         $model->attributes = $_GET['Modules'];
     }
     LBApplication::renderPartial($this, '_form_view_aging_report', array('model' => $model));
 }
예제 #2
0
 public function actionChart()
 {
     $model = new LbInvoice('search');
     $model->unsetAttributes();
     // clear any default values
     $invoiceModel = new LbQuotation();
     LBApplication::renderPartial($this, 'chart', array('model' => $model, 'quotationModel' => $invoiceModel));
 }
예제 #3
0
 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));
 }