Skip to content

Commit 6c1c833

Browse files
committed
1 parent d93aa0f commit 6c1c833

18 files changed

+76
-44
lines changed

app/Models/Purchases/PurchaseInvoice.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Models\Purchases;
44

5+
use Carbon\Carbon;
56
use App\Models\User;
67
use Spatie\Activitylog\LogOptions;
78
use App\Models\Companies\Companies;
@@ -40,11 +41,16 @@ public function PurchaseInvoiceLines()
4041
return $this->hasMany(PurchaseInvoiceLines::class);
4142
}
4243

43-
public function GetPrettyCreatedAttribute()
44+
public function GetshortCreatedAttribute()
4445
{
4546
return date('d F Y', strtotime($this->created_at));
4647
}
4748

49+
public function GetPrettyCreatedAttribute()
50+
{
51+
return Carbon::parse($this->created_at)->diffForHumans();
52+
}
53+
4854
public function getActivitylogOptions(): LogOptions
4955
{
5056
return LogOptions::defaults()->logOnly([ 'code', 'label', 'statu']);

app/Models/Purchases/PurchaseReceipt.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Models\Purchases;
44

5+
use Carbon\Carbon;
56
use App\Models\File;
67
use App\Models\User;
78
use Spatie\Activitylog\LogOptions;
@@ -53,11 +54,16 @@ public function files()
5354
return $this->hasMany(File::class, 'purchase_receipts_id');
5455
}
5556

56-
public function GetPrettyCreatedAttribute()
57+
public function GetshortCreatedAttribute()
5758
{
5859
return date('d F Y', strtotime($this->created_at));
5960
}
6061

62+
public function GetPrettyCreatedAttribute()
63+
{
64+
return Carbon::parse($this->created_at)->diffForHumans();
65+
}
66+
6167
public function GetPrettyControlDateAttribute()
6268
{
6369
return date('d F Y', strtotime($this->reception_control_date));

app/Models/Purchases/Purchases.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
namespace App\Models\Purchases;
44

5+
use Carbon\Carbon;
56
use App\Models\File;
67
use App\Models\User;
8+
use App\Models\Workflow\Deliverys;
79
use Spatie\Activitylog\LogOptions;
810
use App\Models\Companies\Companies;
911
use App\Models\Purchases\PurchaseLines;
@@ -12,7 +14,6 @@
1214
use App\Models\Companies\CompaniesContacts;
1315
use Spatie\Activitylog\Traits\LogsActivity;
1416
use App\Models\Companies\CompaniesAddresses;
15-
use App\Models\Workflow\Deliverys;
1617
use Illuminate\Database\Eloquent\Factories\HasFactory;
1718

1819
class Purchases extends Model
@@ -72,10 +73,15 @@ public function deliveries()
7273
return $this->hasMany(Deliverys::class);
7374
}
7475

75-
public function GetPrettyCreatedAttribute()
76+
public function GetshortCreatedAttribute()
7677
{
7778
return date('d F Y', strtotime($this->created_at));
7879
}
80+
81+
public function GetPrettyCreatedAttribute()
82+
{
83+
return Carbon::parse($this->created_at)->diffForHumans();
84+
}
7985

8086
public function getActivitylogOptions(): LogOptions
8187
{

app/Models/Purchases/PurchasesQuotation.php

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

33
namespace App\Models\Purchases;
44

5+
use Carbon\Carbon;
56
use App\Models\User;
67
use Spatie\Activitylog\LogOptions;
78
use App\Models\Companies\Companies;
@@ -46,14 +47,14 @@ public function UserManagement()
4647
return $this->belongsTo(User::class, 'user_id');
4748
}
4849

49-
public function PurchaseQuotationLines()
50+
public function GetshortCreatedAttribute()
5051
{
51-
return $this->hasMany(PurchaseQuotationLines::class)->orderBy('ordre');
52+
return date('d F Y', strtotime($this->created_at));
5253
}
5354

5455
public function GetPrettyCreatedAttribute()
5556
{
56-
return date('d F Y', strtotime($this->created_at));
57+
return Carbon::parse($this->created_at)->diffForHumans();
5758
}
5859

5960
public function getActivitylogOptions(): LogOptions

app/Models/Workflow/Invoices.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
namespace App\Models\Workflow;
44

5+
use Carbon\Carbon;
56
use App\Models\File;
67
use App\Models\User;
78
use Spatie\Activitylog\LogOptions;
89
use App\Models\Companies\Companies;
9-
use App\Services\InvoiceCalculatorService;
1010
use App\Models\Workflow\InvoiceLines;
1111
use Illuminate\Database\Eloquent\Model;
12+
use App\Services\InvoiceCalculatorService;
1213
use App\Models\Companies\CompaniesContacts;
1314
use Spatie\Activitylog\Traits\LogsActivity;
1415
use App\Models\Companies\CompaniesAddresses;
@@ -63,11 +64,16 @@ public function invoiceLines()
6364
return $this->hasMany(InvoiceLines::class)->orderBy('ordre');
6465
}
6566

66-
public function GetPrettyCreatedAttribute()
67+
public function GetshortCreatedAttribute()
6768
{
6869
return date('d F Y', strtotime($this->created_at));
6970
}
7071

72+
public function GetPrettyCreatedAttribute()
73+
{
74+
return Carbon::parse($this->created_at)->diffForHumans();
75+
}
76+
7177
public function getTotalPriceAttribute()
7278
{
7379
$InvoiceCalculatorService = new InvoiceCalculatorService($this);

resources/views/livewire/arrow-steps/arrow-lead.blade.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div class="row ">
22
<div class="col-12">
33
<div class="arrow-steps clearfix">
4-
<div class="step {{ $LeadStatu == 1 ? 'current' : '' }} {{ $LeadStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.new_trans_key') }}</a></span> </div>
5-
<div class="step {{ $LeadStatu == 2 ? 'current' : '' }} {{ $LeadStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.assigned_trans_key') }}</a></span> </div>
6-
<div class="step {{ $LeadStatu == 3 ? 'current' : '' }} {{ $LeadStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.in_progress_trans_key') }}</a></span> </div>
7-
<div class="step {{ $LeadStatu == 4 ? 'current' : '' }} {{ $LeadStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.converted_trans_key') }}</a><span> </div>
8-
<div class="step {{ $LeadStatu == 5 ? 'current' : '' }} {{ $LeadStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.lost_trans_key') }}</a><span> </div>
4+
<div class="col-2 step {{ $LeadStatu == 1 ? 'current' : '' }} {{ $LeadStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.new_trans_key') }}</a></span> </div>
5+
<div class="col-2 step {{ $LeadStatu == 2 ? 'current' : '' }} {{ $LeadStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.assigned_trans_key') }}</a></span> </div>
6+
<div class="col-2 step {{ $LeadStatu == 3 ? 'current' : '' }} {{ $LeadStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.in_progress_trans_key') }}</a></span> </div>
7+
<div class="col-2 step {{ $LeadStatu == 4 ? 'current' : '' }} {{ $LeadStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.converted_trans_key') }}</a><span> </div>
8+
<div class="col-2 step {{ $LeadStatu == 5 ? 'current' : '' }} {{ $LeadStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.lost_trans_key') }}</a><span> </div>
99
</div>
1010
</div>
1111
</div>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="row ">
22
<div class="col-12">
33
<div class="arrow-steps clearfix">
4-
<div class="step {{ $OpportunityStatu == 1 ? 'current' : '' }} {{ $OpportunityStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.new_trans_key') }}</a></span> </div>
5-
<div class="step {{ $OpportunityStatu == 2 ? 'current' : '' }} {{ $OpportunityStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.quote_made_trans_key') }}</a></span> </div>
6-
<div class="step {{ $OpportunityStatu == 3 ? 'current' : '' }} {{ $OpportunityStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.negotiation_trans_key') }}</a></span> </div>
7-
<div class="step {{ $OpportunityStatu == 4 ? 'current' : '' }} {{ $OpportunityStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.closed_won_trans_key') }}</a><span> </div>
8-
<div class="step {{ $OpportunityStatu == 5 ? 'current' : '' }} {{ $OpportunityStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.closed_lost_trans_key') }}</a><span> </div>
9-
<div class="step {{ $OpportunityStatu == 6 ? 'current' : '' }} {{ $OpportunityStatu <= 6 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(6)">{{ __('general_content.informational_trans_key') }}</a><span> </div>
4+
<div class="col-1 step {{ $OpportunityStatu == 1 ? 'current' : '' }} {{ $OpportunityStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.new_trans_key') }}</a></span> </div>
5+
<div class="col-2 step {{ $OpportunityStatu == 2 ? 'current' : '' }} {{ $OpportunityStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.quote_made_trans_key') }}</a></span> </div>
6+
<div class="col-2 step {{ $OpportunityStatu == 3 ? 'current' : '' }} {{ $OpportunityStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.negotiation_trans_key') }}</a></span> </div>
7+
<div class="col-2 step {{ $OpportunityStatu == 4 ? 'current' : '' }} {{ $OpportunityStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.closed_won_trans_key') }}</a><span> </div>
8+
<div class="col-2 step {{ $OpportunityStatu == 5 ? 'current' : '' }} {{ $OpportunityStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.closed_lost_trans_key') }}</a><span> </div>
9+
<div class="col-2 step {{ $OpportunityStatu == 6 ? 'current' : '' }} {{ $OpportunityStatu <= 6 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(6)">{{ __('general_content.informational_trans_key') }}</a><span> </div>
1010
</div>
1111
</div>
1212
</div>

resources/views/livewire/arrow-steps/arrow-order.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="row ">
22
<div class="col-12">
33
<div class="arrow-steps clearfix">
4-
<div class="step {{ $OrderStatu == 1 ? 'current' : '' }} {{ $OrderStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.open_trans_key') }}</a></span> </div>
5-
<div class="step {{ $OrderStatu == 2 ? 'current' : '' }} {{ $OrderStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.in_progress_trans_key') }}</a></span> </div>
4+
<div class="col-3 step {{ $OrderStatu == 1 ? 'current' : '' }} {{ $OrderStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.open_trans_key') }}</a></span> </div>
5+
<div class="col-2 step {{ $OrderStatu == 2 ? 'current' : '' }} {{ $OrderStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.in_progress_trans_key') }}</a></span> </div>
66
@if($OrderType == 1)
7-
<div class="step {{ $OrderStatu == 4 ? 'current' : '' }} {{ $OrderStatu == 3 ? ' done' : '' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.partly_delivered_trans_key') }}</a><span> </div>
8-
<div class="step {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'current' : '' }} {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'done' : '' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.delivered_trans_key') }}</a></span> </div>
7+
<div class="col-2 step {{ $OrderStatu == 4 ? 'current' : '' }} {{ $OrderStatu == 3 ? ' done' : '' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.partly_delivered_trans_key') }}</a><span> </div>
8+
<div class="col-3 step {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'current' : '' }} {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'done' : '' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.delivered_trans_key') }}</a></span> </div>
99
@else
10-
<div class="step {{ $OrderStatu == 4 ? 'current' : '' }} {{ $OrderStatu == 3 ? ' done' : '' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.partly_stored_trans_key') }}</a><span> </div>
11-
<div class="step {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'current' : '' }} {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'done' : '' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.stock_trans_key') }}</a></span> </div>
10+
<div class="col-2 step {{ $OrderStatu == 4 ? 'current' : '' }} {{ $OrderStatu == 3 ? ' done' : '' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.partly_stored_trans_key') }}</a><span> </div>
11+
<div class="col-3 step {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'current' : '' }} {{ $OrderStatu == 3 && $OrderStatu != 4 ? 'done' : '' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.stock_trans_key') }}</a></span> </div>
1212
@endif
1313
<!--<div class="step {{ $OrderStatu == 5 ? 'current' : '' }} {{ $OrderStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('Stopped') }}</a><span> </div>-->
1414
<!--<div class="step {{ $OrderStatu == 6 ? 'current' : '' }} {{ $OrderStatu <= 6 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(6)">{{ __('general_content.canceled_trans_key') }}</a><span> </div>-->

resources/views/livewire/arrow-steps/arrow-purchase.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div class="row ">
22
<div class="col-12">
33
<div class="arrow-steps clearfix">
4-
<div class="step {{ $PurchaseStatu == 1 ? 'current' : '' }} {{ $PurchaseStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.in_progress_trans_key') }}</a></span> </div>
5-
<div class="step {{ $PurchaseStatu == 2 ? 'current' : '' }} {{ $PurchaseStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.ordered_trans_key') }}</a></span> </div>
6-
<div class="step {{ $PurchaseStatu == 3 ? 'current' : '' }} {{ $PurchaseStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.partly_received_trans_key') }}</a></span> </div>
7-
<div class="step {{ $PurchaseStatu == 4 ? 'current' : '' }} {{ $PurchaseStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.rceived_trans_key') }}</a></span> </div>
4+
<div class="col-2 step {{ $PurchaseStatu == 1 ? 'current' : '' }} {{ $PurchaseStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.in_progress_trans_key') }}</a></span> </div>
5+
<div class="col-2 step {{ $PurchaseStatu == 2 ? 'current' : '' }} {{ $PurchaseStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.ordered_trans_key') }}</a></span> </div>
6+
<div class="col-2 step {{ $PurchaseStatu == 3 ? 'current' : '' }} {{ $PurchaseStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.partly_received_trans_key') }}</a></span> </div>
7+
<div class="col-2 step {{ $PurchaseStatu == 4 ? 'current' : '' }} {{ $PurchaseStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.rceived_trans_key') }}</a></span> </div>
88
<!--<div class="step {{ $PurchaseStatu == 5 ? 'current' : '' }} {{ $PurchaseStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.canceled_trans_key') }}</a></span> </div>-->
99
</div>
1010
</div>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="row ">
22
<div class="col-12">
33
<div class="arrow-steps clearfix">
4-
<div class="step {{ $QuoteStatu == 1 ? 'current' : '' }} {{ $QuoteStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.open_trans_key') }}</a></span> </div>
5-
<div class="step {{ $QuoteStatu == 2 ? 'current' : '' }} {{ $QuoteStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.send_trans_key') }}</a></span> </div>
6-
<div class="step {{ $QuoteStatu == 3 ? 'current' : '' }} {{ $QuoteStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.win_trans_key') }}</a></span> </div>
7-
<div class="step {{ $QuoteStatu == 4 ? 'current' : '' }} {{ $QuoteStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.lost_trans_key') }}</a></span> </div>
8-
<div class="step {{ $QuoteStatu == 5 ? 'current' : '' }} {{ $QuoteStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.closed_trans_key') }}</a></span> </div>
9-
<div class="step {{ $QuoteStatu == 6 ? 'current' : '' }} {{ $QuoteStatu <= 6 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(6)">{{ __('general_content.obsolete_trans_key') }}</a></span> </div>
4+
<div class="col-1 step {{ $QuoteStatu == 1 ? 'current' : '' }} {{ $QuoteStatu <= 1 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(1)">{{ __('general_content.open_trans_key') }}</a></span> </div>
5+
<div class="col-2 step {{ $QuoteStatu == 2 ? 'current' : '' }} {{ $QuoteStatu <= 2 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(2)">{{ __('general_content.send_trans_key') }}</a></span> </div>
6+
<div class="col-2 step {{ $QuoteStatu == 3 ? 'current' : '' }} {{ $QuoteStatu <= 3 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(3)">{{ __('general_content.win_trans_key') }}</a></span> </div>
7+
<div class="col-2 step {{ $QuoteStatu == 4 ? 'current' : '' }} {{ $QuoteStatu <= 4 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(4)">{{ __('general_content.lost_trans_key') }}</a></span> </div>
8+
<div class="col-2 step {{ $QuoteStatu == 5 ? 'current' : '' }} {{ $QuoteStatu <= 5 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(5)">{{ __('general_content.closed_trans_key') }}</a></span> </div>
9+
<div class="col-2 step {{ $QuoteStatu == 6 ? 'current' : '' }} {{ $QuoteStatu <= 6 ? ' ' : 'done' }}"> <span><a href="#" wire:click="changeStatu(6)">{{ __('general_content.obsolete_trans_key') }}</a></span> </div>
1010
</div>
1111
</div>
1212
</div>

0 commit comments

Comments
 (0)