Skip to content

Commit 73a3aed

Browse files
Merge pull request #3753 from ColoredCow/feature/prospect-updates
Minor updates in prospect module
2 parents 49e304c + fbc9d0e commit 73a3aed

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

Modules/Prospect/Entities/Prospect.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ class Prospect extends Model
1212
protected $fillable = [];
1313
protected $table = 'prospects';
1414

15+
protected $casts = [
16+
'proposal_sent_date' => 'datetime:Y-m-d',
17+
];
18+
1519
public function pocUser()
1620
{
1721
return $this->belongsTo(User::class, 'poc_user_id');
@@ -41,14 +45,13 @@ public function getProspectDisplayName()
4145
public function getFormattedBudgetAttribute()
4246
{
4347
$budget = (string) $this->budget;
44-
$currency = $this->currency;
4548

4649
// if currency is less than one thousand
4750
if (strlen($budget) <= 3) {
4851
return $budget;
4952
}
5053

51-
$numberFormat = $currency == 'INR' ? 'en_IN' : 'en_US';
54+
$numberFormat = $this->currency == 'INR' ? 'en_IN' : 'en_US';
5255
$formatter = new \NumberFormatter($numberFormat, \NumberFormatter::DECIMAL);
5356
$formattedBudget = $formatter->format($budget);
5457

Modules/Prospect/Resources/views/index.blade.php

+14-5
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@
4646
<a href="{{ route('prospect.show', $prospect->id) }}" class="text-decoration-none">
4747
{{ $prospect->project_name ?? $prospect->organization_name }}
4848
</a>
49-
<br>
50-
<span class="text-secondary fz-14">
51-
{{ $prospect->organization_name ?? $prospect->client->name }}
52-
</span>
49+
<div>
50+
@if($prospect->customer_type == 'new')
51+
<span class="w-10 h-10 rounded-circle bg-theme-warning d-inline-block" data-toggle="tooltip"
52+
data-placement="top"
53+
title="New Customer"></span>
54+
@endif
55+
<span class="text-secondary fz-14">
56+
{{ $prospect->organization_name ?? $prospect->client->name }}
57+
</span>
58+
</div>
5359
</div>
5460
</td>
5561
<td class="w-10p">
@@ -58,7 +64,10 @@
5864
data-placement="top" title="{{ $prospect->pocUser->name ?? '' }}" />
5965
</td>
6066
<td class="w-20p">
61-
<span>{{ $prospect->getFormattedDate($prospect->proposal_sent_date) }}</span>
67+
<div>{{ $prospect->getFormattedDate($prospect->proposal_sent_date) }}</div>
68+
@if ($prospect->proposal_sent_date)
69+
<div class="fz-14 {{ $prospect->proposal_sent_date->lt(now()->subMonths(3)) ? 'text-danger' : 'text-secondary' }}">{{ $prospect->proposal_sent_date->diffForHumans() }}</div>
70+
@endif
6271
</td>
6372
<td class="w-25p">
6473
<span>

0 commit comments

Comments
 (0)