/**
  * 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 Customers the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Customers::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Beispiel #2
0
$this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => 'SalesInvoices[due_date]', 'model' => $model1, 'attribute' => 'due_date', 'options' => array('showAnim' => 'fold', 'dateFormat' => 'yy-mm-dd'), 'htmlOptions' => array('style' => 'height:20px;', 'value' => '2015-01-13')));
?>
            <?php 
echo $form->error($model1, 'due_date');
?>
        </div>
    </div>



    <div class="row">
        <?php 
echo $form->labelEx($model1, 'customer_id');
?>
        <?php 
$this->widget('bootstrap.widgets.select2.ESelect2', array('model' => $model1, 'attribute' => 'customer_id', 'data' => CHtml::listData(Customers::model()->findAll(), 'id', 'customerName'), 'htmlOptions' => array('class' => '')));
?>
        <?php 
echo $form->error($model1, 'customer_id');
?>
    </div>
    <br>
    <div id="form-content" style="margin-right: 5%;">
        <?php 
if ($mode === 'update') {
    foreach ($model2 as $indmodel) {
        $this->renderPartial('_form-sales-info', array('form' => $form, 'model2' => $indmodel, 'sts' => $sts));
        $sts++;
    }
} else {
    $this->renderPartial('_form-sales-info', array('form' => $form, 'model2' => $model2, 'sts' => 0));
Beispiel #3
0
<h2>Update MoneyReceived</h2>
<div style="border: 1px inset gold;padding: 3%;">
    <span><b>Customer: </b><?php 
echo Customers::model()->findByPk(SalesInvoices::model()->findByPk($id)->customer_id)->customerName;
?>
</span>
    <br>
    <br>
    <span><b>Sales Invoice: </b><?php 
echo $id;
?>
</span>
    <br>
    <br>
    <?php 
$this->renderPartial('_form', array('model' => $model, 'id' => $id));
?>
</div>
Beispiel #4
0
        <b>Issue Date</b><br>
        <span><?php 
echo $model->issue_date;
?>
</span><br><br>
        <b>Invoice Number</b><br>
        <span><?php 
echo $model->id;
?>
</span>
    </div>
    <br>
    <div style="font-family: calibri;line-break: loose;">
        <b>To:</b>
        <span><?php 
$customerModel = Customers::model()->findByPk($model->customer_id);
echo $customerModel->customerName;
?>
</span><br>
        <b>PAN Address:</b> <span><?php 
echo $customerModel->PANNumber;
?>
</span><br>
        <b>Billing Address:</b><span><?php 
echo $customerModel->BillingAddress;
?>
</span>
    </div>
    <br>
    <br>
    <div style="border: 2px inset #000000;">
Beispiel #5
0
    public static function getClientCustomersList($clientID)
    {
        $customers = array();

        $condition = new CDbCriteria();
        $condition->condition = "t.Client_Client_ID = '" . $clientID . "'";
        $condition->addCondition("t.Cust_Active_Relationship = '" . self::ACTIVE_RELATIONSHIP . "'");
        $condition->order = 'company.Company_Name ASC';
        $customersRes = Customers::model()->with('client.company')->findAll($condition);

        if ($customersRes) {
            foreach ($customersRes as $customer) {
                $customers[$customer->Customer_ID] =  ($customer->Cust_ID_Shortcut ? $customer->Cust_ID_Shortcut . ' - ' : '') . $customer->client->company->Company_Name;
            }
        }

        return $customers;
    }