/** * Performs the AJAX validation. * @param SalesInvoices $model the model to be validated */ public function loadReceivedModel($id) { $model = MoneyReceived::model()->find(array('condition' => 'sales_invoice_id=:invoice AND status=:status', 'params' => array(':status' => 1, ':invoice' => $id))); return $model; }
?> </td> <td> <?php echo $SalesInvoice->total_amount; ?> </td> <td> <?php $balance = $SalesInvoice->total_amount; echo $balance; ?> </td> </tr> <?php foreach (MoneyReceived::model()->findAll(array('condition' => 'sales_invoice_id=:invoice', 'params' => array(':invoice' => $id))) as $receipt) { ?> <tr> <td> <?php echo CHtml::link('<button class="btn btn-default btn-sm"><span class="btn-label-style">Edit</span></button>', $this->createAbsoluteUrl('moneyReceived/update', array('id' => $receipt->id))); ?> </td> <td> </td> <td> <?php echo $receipt->received_date; ?> </td>
?> </th> <th><?php echo $total_credit_receivables; ?> </th> </tr> <tr><td colspan="10"></td></tr> <!----accounts-receivables-end---------------------------------------------------------------------------> <!---------cash-on-hand-begin-----------------------------------------------------------------------------> <tr> <th colspan="10">Cash On Hand</th> </tr> <?php $total_debit_cash = 0; foreach (MoneyReceived::model()->findAll(array('order' => 'received_date', 'condition' => 'received_date>=:start_date AND received_date<=:end_date', 'params' => array(':start_date' => $model->from_date, ':end_date' => $model->to_date))) as $receipt) { ?> <tr> <td colspan="8"><?php echo $receipt->received_date . '- ' . $receipt->customer->customerName . '-Receipt #' . $receipt->id; ?> </td> <td><?php $total_debit_cash += $receipt->amount; echo $receipt->amount; ?> </td> <td></td> </tr> <?php
echo $SalesInvoice->total_amount; ?> </td> <td> <?php $balance += $SalesInvoice->total_amount; echo $balance; ?> </td> </tr> <?php } ?> <?php foreach (MoneyReceived::model()->findAll(array('order' => 'received_date', 'condition' => 'customer_id=:customer', 'params' => array(':customer' => $id))) as $receipt) { ?> <tr> <td> <?php echo CHtml::link('<button class="btn btn-default btn-sm"><span class="btn-label-style">Edit</span></button>', $this->createAbsoluteUrl('moneyReceived/update', array('id' => $receipt->id))); ?> </td> <td> </td> <td> <?php echo $receipt->received_date; ?> </td>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return MoneyReceived the loaded model * @throws CHttpException */ public function loadModel($id) { $model = MoneyReceived::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }