示例#1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLocationDest()
 {
     return $this->hasOne(StockLocation::className(), ['id' => 'location_dest_id']);
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSource0()
 {
     return $this->hasOne(StockLocation::className(), ['id' => 'source']);
 }
示例#3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getChainedLocation()
 {
     return $this->hasOne(StockLocation::className(), ['id' => 'chained_location_id']);
 }
示例#4
0
 public function actionPrintTest($id, $uid, $page = 1, $maxItemPerPage = 17)
 {
     $this->layout = 'printout';
     $model = $this->findModel($id);
     $dest = [];
     $locDest = null;
     $user = \app\models\ResUsers::findOne($uid);
     // var_dump(count($model->stockMoves));
     $renderTo = 'print';
     if ($model->type == 'in') {
     } elseif ($model->type == 'out') {
     } elseif ($model->type == 'internal') {
         $renderTo = 'printDummy';
     } else {
     }
     foreach ($model->stockMoves as $move) {
         if (!isset($dest[$move->location_dest_id])) {
             $dest[$move->location_dest_id] = $move->locationDest->id;
             $locDest = $move->location_dest_id;
         }
     }
     $partner = false;
     if (count($dest) != 1) {
         throw new \yii\web\NotAcceptableHttpException("Something Wrong With data that Your Trying to Access");
     } else {
         $partner = StockLocation::findOne($locDest);
     }
     return $this->render($renderTo, ['model' => $model, 'partner' => $partner, 'page' => $page, 'maxItemPerPage' => $maxItemPerPage, 'user' => $user]);
 }
示例#5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStockLocations()
 {
     return $this->hasMany(StockLocation::className(), ['partner_id' => 'id']);
 }
示例#6
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStockLocations()
 {
     return $this->hasMany(StockLocation::className(), ['valuation_out_account_id' => 'id']);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPickingLocation()
 {
     return $this->hasOne(StockLocation::className(), ['id' => 'picking_location']);
 }
示例#8
0
            dataType: "json"
        }).done(function(data) { callback(data.results);});
        }
    }
SCRIPT;
$form = ActiveForm::begin(['id' => 'saldostockbarang-form', 'options' => ['class' => 'form-horizontal'], 'method' => 'get']);
?>

    <?php 
// auto complete pakai select
echo $form->field($formModel, 'product_id')->widget(Select2::classname(), ['options' => ['placeholder' => 'Select Product'], 'pluginOptions' => ['tags' => true, 'allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => $url, 'dataType' => 'json', 'data' => new JsExpression('function(term,page) { return {search:term.term}; }'), 'results' => new JsExpression('function(data,page) { return {results:data.results}; }')], 'initSelection' => new JsExpression($initScript)]]);
?>

  
    <?php 
$stock = StockLocation::find()->all();
$listData = ArrayHelper::map($stock, 'id', 'complete_name');
echo $form->field($formModel, 'warelct')->dropDownList($listData, ['prompt' => 'Select...']);
?>

    <?php 
echo Html::submitButton('Search');
?>

    <!-- input -->


<?php 
ActiveForm::end();
?>