This commit is contained in:
Shohrat 2023-11-22 02:03:13 +05:00
parent 58a65e05bf
commit 31a3481c8e
7 changed files with 69 additions and 25 deletions

View File

@ -93,7 +93,6 @@ class Order extends ComponentBase
<td><a href="/order-detail/' . $ordersFiltered[$x]->id . '" style="font-weight: bold;">' . $ordersFiltered[$x]->client->name . '</a></td>
<td><a href="/order-detail/' . $ordersFiltered[$x]->id . '" style="font-weight: bold;">' . $ordersFiltered[$x]->contract_no . '</a></td>
<td>' . $ordersFiltered[$x]->client->country . '</td>
<td>' . number_format($ordersFiltered[$x]->order_all_amount) . ' kg</td>
<td><span class="badge badge-soft-primary"
style="font-size: 14px;">' . number_format($ordersFiltered[$x]->order_all_price) . ' $</span>
</td>

View File

@ -513,17 +513,45 @@ class Sewer extends ComponentBase
$sewer = SewerModel::where("id", $data["sewerId"])->with(['pivot_sewer', 'rulon_action.product'])->first();
if($sewer){
$stock = Stock::where("type", 'rulon')->first();
$createResult = new RulonAction();
$createResult->product_id = $sewer->rulon_action->product_id;
$createResult->type = 'inbox';
$createResult->amount = (float)$sewer->pivot_sewer[0]->spent_amount;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->note = "#Dikiş".$sewer->id." maglumat girizidi, soňundan pozulan";
$createResult->save();
if($sewer->produced_bag_qty > 0){
$stock = Stock::where("type", 'rulon')->first();
$createResult = new RulonAction();
$createResult->product_id = $sewer->rulon_action->product_id;
$createResult->type = 'inbox';
$createResult->amount = (float)$sewer->pivot_sewer[0]->spent_amount;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->note = "#Dikiş".$sewer->id." maglumat girizidi, soňundan pozulan";
$createResult->save();
$stockBag = Stock::where("type", 'bag')->first();
$createResultBag = new BagAction();
$createResultBag->product_id = $sewer->id;
$createResultBag->type = 'outbox';
$createResultBag->status_accountant = "new";
$createResultBag->status_director = "new";
$createResultBag->note = "#Dikiş".$sewer->id." maglumat girizidi, soňundan pozulan";
$createResultBag->amount = -$sewer->produced_bag_qty;
$createResultBag->stock_id = $stockBag->id;
$createResultBag->user_id = $user->id;
$createResultBag->save();
}elseif ($sewer->produced_bag_qty == 0){
$stock = Stock::where("type", 'rulon')->first();
$createResult = new RulonAction();
$createResult->product_id = $sewer->rulon_action->product_id;
$createResult->type = 'inbox';
$createResult->amount = (float)$sewer->pivot_sewer[0]->amount;
$createResult->stock_id = $stock->id;
$createResult->user_id = $user->id;
$createResult->note = "#Dikiş".$sewer->id." maglumat girizidi, soňundan pozulan";
$createResult->save();
}
}
$sewer->delete();

View File

@ -3,11 +3,28 @@ columns:
label: id
type: number
name:
label: name
label: Ady
type: text
searchable: true
note:
label: note
label: Bellik
type: text
searchable: true
building_id:
label: building_id
type: number
label: 'Bina (korps)'
type: text
searchable: true
select: name
relation: building
mechanic_id:
label: Mehanik
type: text
searchable: true
select: name
relation: mechanic
employee_id:
label: Jogapkar
type: text
searchable: true
select: name
relation: employee

View File

@ -76,7 +76,7 @@ function onStart(){
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
<!-- <th>Sazlamalar</th> -->
</tr>
</thead>
<tbody>
@ -113,7 +113,7 @@ function onStart(){
{% endif %}
<td>{{record.note}}</td>
<td>
<!-- <td>
<div style="display: flex;justify-content: center;">
{% if record.user_id != user.id %}
@ -146,7 +146,7 @@ function onStart(){
{% endif %}
</div>
</td>
</td> -->
</tr>
{% endfor %}
</tbody>
@ -161,7 +161,7 @@ function onStart(){
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
<!-- <th>Sazlamalar</th> -->
</tr>
</tfoot>
</table>

View File

@ -74,7 +74,7 @@ function onStart(){
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
<!-- <th>Sazlamalar</th> -->
</tr>
</thead>
<tbody>
@ -93,7 +93,7 @@ function onStart(){
<td style="color: {% if record.status_director == 'accept' %}darkgreen {% else %}darkred {% endif %};">{% if record.status_director == 'accept' %} + {% else %}<a href="#" data-request="onApproveAction" data-request-data="user_type: 'director', id: {{record.id}}" style="color: darkred;" data-request-confirm="Tassyklamak isleyarsinizmi?"> Tassyklanmadyk </a> {% endif %}</td>
<td style="color: {% if record.status_accountant == 'accept' %}darkgreen {% else %}darkred {% endif %};">{% if record.status_accountant == 'accept' %} + {% else %} <a href="#" data-request="onApproveAction" data-request-data="user_type: 'accountant', id: {{record.id}}'" style="color: darkred;" data-request-confirm="Tassyklamak isleyarsinizmi?"> Tassyklanmadyk </a> {% endif %}</td>
<td>{{record.note}}</td>
<td>
<!-- <td>
<div style="display: flex;justify-content: center;">
{% if record.user_id != user.id %}
@ -126,7 +126,7 @@ function onStart(){
{% endif %}
</div>
</td>
</td> -->
</tr>
{% endfor %}
</tbody>
@ -141,7 +141,7 @@ function onStart(){
<th>Direktor</th>
<th>Bugalter</th>
<th>Bellik</th>
<th>Sazlamalar</th>
<!-- <th>Sazlamalar</th> -->
</tr>
</tfoot>
</table>

View File

@ -106,7 +106,7 @@ function onStart(){
<th>Klent</th>
<th>Şertnama nomer</th>
<th>Ýurdy</th>
<th>Mukdary</th>
<!-- <th>Mukdary</th> -->
<th>Bahasy</th>
<th>Tölenen</th>
<th>Bergisi</th>
@ -125,7 +125,7 @@ function onStart(){
<th>Klent</th>
<th>Şertnama nomer</th>
<th>Ýurdy</th>
<th>Mukdary</th>
<!-- <th>Mukdary</th> -->
<th>Bahasy</th>
<th>Tölenen</th>
<th>Bergisi</th>

View File

@ -36,7 +36,7 @@
<div id="sidebar-menu">
<!-- Left Menu Start -->
<ul class="metismenu list-unstyled" id="side-menu">
<li class="menu-title">Разделы</li>
<li class="menu-title">Bölümler</li>
{% for permission in user.permission2 %}