Exemple #1
0
                    <h5>
                <?php 
        echo number_format($saleorline->usdsum($model->recid), 2) . ' ' . $model->currencyname->currencycode;
        ?>
                    </h5>
                         </div>
               </div>
            <?php 
        //elseif($model->currencyname->currencycode == "THB"):
        ?>
            <div class="col-sm-4">
                 <div style="color: white;text-align: right;">
                    <h5>
                 <?php 
        if ($model->currencyname->currencycode != "THB") {
            echo number_format($saleorline->Usdsum($model->recid) * $model->currencyrate) . ' ' . 'THB';
        } else {
            echo number_format($saleorline->thbsum($model->recid), 2) . ' ' . 'THB';
        }
        ?>
                    </h5>
                 </div>
            </div>
    <?php 
    }
    ?>
            <?php 
}
?>
        </div>
      
Exemple #2
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\models\Saleorder */
$this->title = $model->saleno;
$this->params['breadcrumbs'][] = ['label' => 'Saleorders', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
   <?php 
$saleline = new \backend\models\Saleorderline();
?>
<div class="saleorder-view">

    <p>
        <?php 
echo Html::a('Update', ['update', 'id' => $model->recid], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('Delete', ['delete', 'id' => $model->recid], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['saleno', ['attribute' => 'saledate', 'value' => Yii::$app->formatter->asDate($model->saledate, 'dd-MM-yyyy')], ['attribute' => 'customer', 'value' => $model->customer ? $model->customername->Cus_Name : ""], ['attribute' => 'saleman', 'value' => $model->saleman ? $model->salename->Sale_Name : ''], 'refno', 'description', ['attribute' => 'shipdate', 'value' => Yii::$app->formatter->asDate($model->shipdate, 'dd-MM-yyyy')], ['attribute' => 'shipfrom', 'value' => $model->shipfrom ? $model->shipfromname->Cry_nameEN : ''], ['attribute' => 'shipto', 'value' => $model->shipto ? $model->shiptoname->Cry_nameEN : ''], 'paymentterm', ['attribute' => 'currency', 'value' => $model->currency ? $model->currencyname->currencycode : ''], ['attribute' => 'totalqty', 'value' => number_format($saleline->Ordersum($model->recid)) . " Pcs"], ['attribute' => 'totalamt', 'value' => number_format($saleline->Usdsum($model->recid)) . " " . $model->currencyname->currencycode], ['attribute' => 'totalthb', 'value' => $model->currencyname->currencycode != 'THB' ? number_format($saleline->Usdsum($model->recid) * $model->currencyrate) . " THB" : number_format($saleline->Thbsum($model->recid)) . " " . $model->currencyname->currencycode], 'currencyrate', 'createdate']]);
?>

</div>