Skip to content

Commit

Permalink
Merge pull request #3753 from ColoredCow/feature/prospect-updates
Browse files Browse the repository at this point in the history
Minor updates in prospect module
  • Loading branch information
rathorevaibhav authored Dec 28, 2024
2 parents 49e304c + fbc9d0e commit 73a3aed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 5 additions & 2 deletions Modules/Prospect/Entities/Prospect.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class Prospect extends Model
protected $fillable = [];
protected $table = 'prospects';

protected $casts = [
'proposal_sent_date' => 'datetime:Y-m-d',
];

public function pocUser()
{
return $this->belongsTo(User::class, 'poc_user_id');
Expand Down Expand Up @@ -41,14 +45,13 @@ public function getProspectDisplayName()
public function getFormattedBudgetAttribute()
{
$budget = (string) $this->budget;
$currency = $this->currency;

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

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

Expand Down
19 changes: 14 additions & 5 deletions Modules/Prospect/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@
<a href="{{ route('prospect.show', $prospect->id) }}" class="text-decoration-none">
{{ $prospect->project_name ?? $prospect->organization_name }}
</a>
<br>
<span class="text-secondary fz-14">
{{ $prospect->organization_name ?? $prospect->client->name }}
</span>
<div>
@if($prospect->customer_type == 'new')
<span class="w-10 h-10 rounded-circle bg-theme-warning d-inline-block" data-toggle="tooltip"
data-placement="top"
title="New Customer"></span>
@endif
<span class="text-secondary fz-14">
{{ $prospect->organization_name ?? $prospect->client->name }}
</span>
</div>
</div>
</td>
<td class="w-10p">
Expand All @@ -58,7 +64,10 @@
data-placement="top" title="{{ $prospect->pocUser->name ?? '' }}" />
</td>
<td class="w-20p">
<span>{{ $prospect->getFormattedDate($prospect->proposal_sent_date) }}</span>
<div>{{ $prospect->getFormattedDate($prospect->proposal_sent_date) }}</div>
@if ($prospect->proposal_sent_date)
<div class="fz-14 {{ $prospect->proposal_sent_date->lt(now()->subMonths(3)) ? 'text-danger' : 'text-secondary' }}">{{ $prospect->proposal_sent_date->diffForHumans() }}</div>
@endif
</td>
<td class="w-25p">
<span>
Expand Down

0 comments on commit 73a3aed

Please sign in to comment.