278 lines
13 KiB
HTML
278 lines
13 KiB
HTML
title = "order-detail/logistics"
|
|
url = "/order-detail/logistics/:orderId"
|
|
layout = "platform_main"
|
|
is_hidden = 0
|
|
|
|
[order]
|
|
==
|
|
<?php
|
|
function onStart(){
|
|
|
|
$this["orderId"] = $this->param("orderId");
|
|
|
|
$orderId = $this->param("orderId");
|
|
|
|
$this["order"] = Romanah\Gokbakja\Models\Order::where("id", $orderId)
|
|
->withCount(['order_items as order_all_amount' => function($query) {
|
|
$query->select(DB::raw('sum(amount)'));
|
|
}])
|
|
->withCount(['order_items as order_all_price' => function($query) {
|
|
$query->select(DB::raw('sum(price)'));
|
|
}])
|
|
->first();
|
|
|
|
$count = Romanah\Gokbakja\Models\OrderItem::where("order_id", $orderId)->count();
|
|
|
|
if($count > 0){
|
|
$this["all"] = ($this["order"]->order_all_amount * $this["order"]->order_all_price) / $count;
|
|
}
|
|
|
|
$this["orderItems"] = Romanah\Gokbakja\Models\OrderItem::where("order_id", $orderId)->get();
|
|
|
|
$this["transports"] = Romanah\Gokbakja\Models\ShippingTransport::where("shipping_id", $this["order"]->shipping_id)->with('shipping.order')->with('order_item')->orderBy("id", "DESC")->get();
|
|
|
|
|
|
|
|
}
|
|
?>
|
|
==
|
|
{% put styles %}
|
|
<link href="{{'assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
|
type="text/css" />
|
|
<link href="{{'assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
|
type="text/css" />
|
|
<link href="{{'assets/libs/datatables.net-select-bs4/css/select.bootstrap4.min.css'|theme}}" rel="stylesheet"
|
|
type="text/css" />
|
|
|
|
<link href="{{'assets/libs/select2/css/select2.min.css'|theme}}" rel="stylesheet" type="text/css">
|
|
{% endput %}
|
|
|
|
<div class="container-fluid">
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box d-flex align-items-center justify-content-between">
|
|
<h4 class="mb-0">Sargyt Maglumatlary</h4>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<!-- Left sidebar -->
|
|
<div class="email-leftbar card">
|
|
{% partial "order/aside" active=2 orderId=orderId %}
|
|
</div>
|
|
<!-- End Left sidebar -->
|
|
|
|
|
|
<!-- Right Sidebar -->
|
|
<div class="email-rightbar mb-3">
|
|
<div class="row">
|
|
{% if crudOrders %}
|
|
<div class="col-md-12">
|
|
<div class="collapse multi-collapse" id="multiCollapseExample1">
|
|
<form data-request="onCreateTransportItem" data-request-flash data-request-validate>
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col">
|
|
<label class="form-label">Transport Saýlaň</label>
|
|
<select class="form-control select2" name="transport_type">
|
|
<option value="0">Saýla</option>
|
|
|
|
<option value="truck">Tyr</option>
|
|
<option value="train">Wagon</option>
|
|
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col">
|
|
<div>
|
|
<label class="form-label">Ugramaly Senesi</label>
|
|
<div class="input-group" id="datepicker2">
|
|
<input type="text" class="form-control" placeholder="d.m.Y"
|
|
data-date-format="d.m.yyyy" data-date-container="#datepicker2" data-provide="datepicker"
|
|
data-date-autoclose="true" name="date">
|
|
|
|
<span class="input-group-text"><i class="mdi mdi-calendar"></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col">
|
|
<div>
|
|
<label class="form-label">Transport No</label>
|
|
<input type="text" name="transport_no" class="form-control"
|
|
placeholder="Transport No">
|
|
</div>
|
|
</div>
|
|
<div class="col">
|
|
<div>
|
|
<label class="form-label">Bellik</label>
|
|
<input type="text" name="note" class="form-control"
|
|
placeholder="Bellik">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col">
|
|
<button type="submit" class="btn btn-primary waves-effect waves-light"
|
|
style="margin-top: 30px;width: 100%;">Goş</button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% partial "order/item_header" contract_no=order.contract_no orderId=order.id clientName=order.client.name
|
|
allAmount=order.order_all_amount allPrice=order.order_all_price all=all %}
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h3 class="card-title" style="font-size: 22px;color: #1e2038;">Sargyt Logistika Maglumatlary</h3>
|
|
<p class="card-title-desc" style="color: #6c6ff5;font-size: 17px;" ></p>
|
|
</div>
|
|
<div class="col-md-6" style="text-align: right;">
|
|
{% if crudOrders %}
|
|
{% if order.user_id == user.id %}
|
|
<a class="btn btn-primary" data-bs-toggle="collapse" href="#multiCollapseExample1"
|
|
role="button" aria-expanded="false" aria-controls="multiCollapseExample1">Transport
|
|
Goş</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<table id="datatable-buttons" class="table table-striped table-bordered dt-responsive nowrap"
|
|
style="border-collapse: collapse; border-spacing: 0; width: 100%;" data-page-length='13'>
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 5%;">№</th>
|
|
|
|
<th>Transport Kody</th>
|
|
<th>Transport</th>
|
|
<th>Şu wagtky ýeri</th>
|
|
<th>Transport No</th>
|
|
<th>Ugramaly Sene</th>
|
|
<th>Bellik</th>
|
|
<th>Statusy</th>
|
|
<th>Sazlamalar</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="transport_item_datas">
|
|
{% for key, transport in transports %}
|
|
<tr>
|
|
<td style="font-weight: bold;">{{(key+1)}}</td>
|
|
|
|
<td>#{{transport.id}}</td>
|
|
<td><a href="#" style="font-weight: bold;">
|
|
{% if transport.transport_type == 'truck' %}
|
|
TYR
|
|
{% else %}
|
|
WAGON
|
|
{% endif %}
|
|
</a></td>
|
|
<td>{{transport.place_now}}</td>
|
|
<td>{{transport.transport_no}}</td>
|
|
<td>{% if transport.date %}{{transport.date|date('d.m.Y')}}{% endif %}</td>
|
|
<td>{{transport.note}}</td>
|
|
<td style="font-weight: bold;color: #6c6ff5;">
|
|
{% if transport.status == "complated" %}
|
|
Tamamlandy
|
|
{% elseif transport.status == "loaded" %}
|
|
Ýüklendi
|
|
{% elseif transport.status == "loading" %}
|
|
Ýüklenýär
|
|
{% elseif transport.status == "proccess" %}
|
|
Ýolda
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
|
|
|
|
{% if transport.shipping.order.user_id == user.id %}
|
|
|
|
{% if crudOrders %}
|
|
<button data-request="onModalSetTransport"
|
|
data-request-data="transportId: {{transport.id}}"
|
|
data-bs-toggle="modal" data-bs-target=".bs-example-modal-sm-1" type="button" class="btn btn-warning waves-light waves-effect"><i class="fa fa-pen"></i></button>
|
|
{% endif %}
|
|
|
|
<a href="/orders/transport/loaded/{{orderId}}/{{transport.id}}" type="button" class="btn btn-primary waves-light waves-effect"><i class="fa fa-truck-loading"></i></a>
|
|
|
|
{% else %}
|
|
|
|
<a href="/orders/transport/loaded/{{orderId}}/{{transport.id}}" type="button" class="btn btn-primary waves-light waves-effect"><i class="fa fa-truck-loading"></i></a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
<tfoot>
|
|
<tr>
|
|
<th style="width: 5%;">№</th>
|
|
<th>Transport Kody</th>
|
|
<th>Transport</th>
|
|
<th>Şu wagtky ýeri</th>
|
|
<th>Transport No</th>
|
|
<th>Ugramaly Sene</th>
|
|
<th>Bellik</th>
|
|
<th>Statusy</th>
|
|
<th>Sazlamalar</th>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="modal fade bs-example-modal-sm-1" tabindex="-1" role="dialog"
|
|
aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content" id="modal-form">
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div> <!-- card -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- End row -->
|
|
</div>
|
|
|
|
|
|
{% put scripts %}
|
|
<script src="{{'assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js'|theme}}"></script>
|
|
<script src="{{'assets/libs/select2/js/select2.min.js'|theme}}"></script>
|
|
<script src="{{'assets/js/pages/form-advanced.init.js'|theme}}"></script>
|
|
|
|
{% endput %}
|
|
{% partial 'dataTableJs' %}
|