Skip to content

Commit 28192ca

Browse files
committed
1 parent 9b8b285 commit 28192ca

File tree

5 files changed

+114
-5
lines changed

5 files changed

+114
-5
lines changed

app/Models/Workflow/OrderLines.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ public function Task()
7070
return $this->hasMany(Task::class, 'order_lines_id')->orderBy('ordre');
7171
}
7272

73+
public function getPurchaseLinesAttribute()
74+
{
75+
return $this->Task->flatMap(function ($task) {
76+
return $task->purchaseLines;
77+
});
78+
}
79+
7380
public function OrderLineDetails()
7481
{
7582
return $this->hasOne(OrderLineDetails::class, 'order_lines_id');

app/Models/Workflow/Orders.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ public function OrderLines()
9191
return $this->hasMany(OrderLines::class)->orderBy('ordre');
9292
}
9393

94+
public function getPurchaseLinesCountAttribute()
95+
{
96+
return $this->OrderLines->sum(function ($orderLine) {
97+
return $orderLine->Task->sum(function ($task) {
98+
return $task->purchaseLines->count();
99+
});
100+
});
101+
}
102+
94103
// Relationship with the files associated with the Quote
95104
public function files()
96105
{

resources/lang/en/general_content.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283

284284
'order_info_trans_key' => 'Order info',
285285
'order_line_trans_key' => 'Order lines',
286+
'business_Review_trans_key' => 'Business Review',
286287

287288
'delivery_info_trans_key' => 'Delivery info',
288289
'delivery_lines_trans_key' => 'Delivery lines',

resources/lang/fr/general_content.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283

284284
'order_info_trans_key' => 'Information de commande',
285285
'order_line_trans_key' => 'Ligne de la commande',
286+
'business_Review_trans_key' => 'Bilan d\'affaire',
286287

287288
'delivery_info_trans_key' => 'Bon de livraison info',
288289
'delivery_lines_trans_key' => 'Lignes du bon de livraison',
@@ -905,13 +906,13 @@
905906
'section_info_trans_key' => 'La fonction Sections vous permet de définir toutes les sections composant votre entreprise, c\'est-à-dire les zones physiques où sont regroupés les postes de travail et les opérateurs en fonction de leur métier et de leur coût.',
906907

907908
//ACCOUNTING
908-
'accounting_trans_key' => 'Comptabilité',
909+
'accounting_trans_key' => 'Comptabilité',
909910
'new_payment_methods_trans_key' => 'Nouveau mode de paiement',
910911
'new_payment_conditions_trans_key' => 'Nouvelle condition de paiement',
911912
'new_delevery_method_trans_key' => 'Noueau mode de livraison',
912913
'new_vat_trans_key' => 'Nouvelle TVA',
913-
'accounting_allocations_trans_key' => 'Allocation comptable',
914-
'new_accounting_allocations_trans_key' => 'Nouvelle allocation comptable',
914+
'accounting_allocations_trans_key' => 'Allocation comptable',
915+
'new_accounting_allocations_trans_key' => 'Nouvelle allocation comptable',
915916

916917
//TIME
917918
'times_setting_trans_key' => 'Réglage temps',

resources/views/workflow/orders-show.blade.php

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
<ul class="nav nav-pills">
1919
<li class="nav-item"><a class="nav-link active" href="#Order" data-toggle="tab">{{ __('general_content.order_info_trans_key') }}</a></li>
2020
<li class="nav-item"><a class="nav-link" href="#Lines" data-toggle="tab">{{ __('general_content.order_line_trans_key') }} ({{ count($Order->OrderLines) }})</a></li>
21-
<li class="nav-item"><a class="nav-link" href="#Charts" data-toggle="tab">{{ __('general_content.charts_trans_key') }}</a></li><li class="nav-item">
22-
<li class="nav-item"><a class="nav-link" href="#Bilan" data-toggle="tab">Bilan d'affaire</a></li><li class="nav-item">
21+
<li class="nav-item"><a class="nav-link" href="#Charts" data-toggle="tab">{{ __('general_content.charts_trans_key') }}</a></li>
22+
<li class="nav-item"><a class="nav-link" href="#Bilan" data-toggle="tab">{{ __('general_content.business_Review_trans_key') }}</a></li>
23+
<li class="nav-item"><a class="nav-link" href="#purchase" data-toggle="tab">{{ __('general_content.purchase_list_trans_key') }} ({{ $Order->purchase_lines_count }})</a></li>
24+
2325
<!--<a class="nav-link" href="#Views" data-toggle="tab">{{ __('general_content.guest_page_trans_key') }}</a></li>-->
2426
@if(count($CustomFields)> 0)
2527
<li class="nav-item"><a class="nav-link" href="#CustomFields" data-toggle="tab">{{ __('general_content.custom_fields_trans_key') }} ({{ count($CustomFields) }})</a></li>
@@ -299,6 +301,95 @@
299301
</div>
300302
<div class="tab-pane " id="Views">
301303
</div>
304+
<div class="tab-pane" id="purchase">
305+
<div class="table-responsive p-0">
306+
<table class="table table-hover">
307+
<thead>
308+
<tr>
309+
<th>{{ __('general_content.order_trans_key') }}</th>
310+
<th>{{ __('general_content.label_trans_key') }}</th>
311+
<th>{{__('general_content.task_trans_key') }}</th>
312+
<th>{{ __('general_content.product_trans_key') }}</th>
313+
<th>{{ __('general_content.qty_trans_key') }}</th>
314+
<th>{{ __('general_content.qty_reciept_trans_key') }}</th>
315+
<th>{{ __('general_content.qty_invoice_trans_key') }}</th>
316+
<th>{{ __('general_content.price_trans_key') }}</th>
317+
<th>{{ __('general_content.discount_trans_key') }}</th>
318+
<th>{{ __('general_content.vat_trans_key') }}</th>
319+
</tr>
320+
</thead>
321+
<tbody>
322+
@forelse ($Order->OrderLines as $orderLine)
323+
@foreach ($orderLine->purchase_lines as $PurchaseLine)
324+
<tr>
325+
<td>
326+
<a class="btn btn-primary btn-sm" href="{{ route('purchases.show', ['id' => $PurchaseLine->purchases_id])}}">
327+
<i class="fas fa-folder"></i>
328+
{{ $PurchaseLine->purchase->code }}
329+
</a>
330+
</td>
331+
<td>
332+
@if($PurchaseLine->tasks->OrderLines ?? null)
333+
{{ $PurchaseLine->tasks->OrderLines->label }}
334+
@endif
335+
</td>
336+
<td>
337+
@if($PurchaseLine->tasks_id ?? null)
338+
<a href="{{ route('production.task.statu.id', ['id' => $PurchaseLine->tasks->id]) }}" class="btn btn-sm btn-success">{{__('general_content.view_trans_key') }} </a>
339+
#{{ $PurchaseLine->tasks->id }} - {{ $PurchaseLine->tasks->label }}
340+
@if($PurchaseLine->tasks->component_id )
341+
- {{ $PurchaseLine->tasks->Component['label'] }}
342+
@endif
343+
@else
344+
{{ $PurchaseLine->label }}
345+
@endif
346+
</td>
347+
348+
<td>
349+
@if($PurchaseLine->tasks_id ?? null)
350+
@if($PurchaseLine->tasks->component_id )
351+
<x-ButtonTextView route="{{ route('products.show', ['id' => $PurchaseLine->tasks->component_id])}}" />
352+
@endif
353+
@else
354+
@if($PurchaseLine->product_id )
355+
<x-ButtonTextView route="{{ route('products.show', ['id' => $PurchaseLine->product_id])}}" />
356+
@endif
357+
@endif
358+
</td>
359+
<td>{{ $PurchaseLine->qty }}</td>
360+
<td>{{ $PurchaseLine->receipt_qty }}</td>
361+
<td>{{ $PurchaseLine->invoiced_qty }}</td>
362+
<td>{{ $PurchaseLine->selling_price }} {{ $Factory->curency }}</td>
363+
<td>{{ $PurchaseLine->discount }} %</td>
364+
<td>
365+
@if($PurchaseLine->accounting_vats_id)
366+
{{ $PurchaseLine->VAT['rate'] }} %
367+
@else
368+
-
369+
@endif
370+
</td>
371+
</tr>
372+
@endforeach
373+
@empty
374+
<x-EmptyDataLine col="11" text="{{ __('general_content.no_data_trans_key') }}" />
375+
@endforelse
376+
<tfoot>
377+
<tr>
378+
<th>{{ __('general_content.order_trans_key') }}</th>
379+
<th>{{__('general_content.label_trans_key') }}</th>
380+
<th>{{__('general_content.task_trans_key') }}</th>
381+
<th>{{ __('general_content.product_trans_key') }}</th>
382+
<th>{{ __('general_content.qty_trans_key') }}</th>
383+
<th>{{ __('general_content.qty_reciept_trans_key') }}</th>
384+
<th>{{ __('general_content.qty_invoice_trans_key') }}</th>
385+
<th>{{ __('general_content.price_trans_key') }}</th>
386+
<th>{{ __('general_content.discount_trans_key') }}</th>
387+
<th>{{ __('general_content.vat_trans_key') }}</th>
388+
</tr>
389+
</tfoot>
390+
</table>
391+
</div>
392+
</div>
302393
@if($CustomFields)
303394
<div class="tab-pane " id="CustomFields">
304395
@include('include.custom-fields-form', ['id' => $Order->id, 'type' => 'order'])

0 commit comments

Comments
 (0)