Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Build - Dec 24, 2024 #3752

Merged
merged 9 commits into from
Dec 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(*): fix the amount issue
Ayush8923 committed Nov 24, 2024
commit 62d50d96338abbd9eaab3f9ef9633825ba884d8a
8 changes: 7 additions & 1 deletion Modules/Prospect/Entities/Prospect.php
Original file line number Diff line number Diff line change
@@ -38,8 +38,14 @@ public function getProspectDisplayName()
return $this->organization_name ?? optional($this->client)->name ?? 'N/A';
}

public function formattedAmount($amount)
public function formattedIndianAmount($amount)
{
$amount = (string) $amount;

if (strlen($amount) <= 3) {
return $amount;
}

$formattedAmount = preg_replace('/\B(?=(\d{2})+(?!\d))/', ',', substr($amount, 0, -3)) .
',' . substr($amount, -3);

2 changes: 1 addition & 1 deletion Modules/Prospect/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@
<td class="w-30p">
<span>
{{ isset($prospect->currency) && isset($currencySymbols[$prospect->currency]) ? $currencySymbols[$prospect->currency] : '' }}
{{ $prospect->budget ? $prospect->formattedAmount($prospect->budget) : '-' }}
{{ $prospect->budget ? $prospect->formattedIndianAmount($prospect->budget) : '-' }}
</span>
</td>
<td class="w-20p">
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ class="ml-2">{{ config('prospect.customer-types')[$prospect->customer_type] ?? '
<label for="budget" class="font-weight-bold">Budget:</label>
<span class="ml-2">
{{ isset($prospect->currency) && isset($currencySymbols[$prospect->currency]) ? $currencySymbols[$prospect->currency] : '' }}
{{ $prospect->budget ? $prospect->formattedAmount($prospect->budget) : 'N/A' }}
{{ $prospect->budget ? $prospect->formattedIndianAmount($prospect->budget) : 'N/A' }}
</span>
</div>
</div>