update marketing
All checks were successful
All checks were successful
This commit is contained in:
@@ -37,52 +37,29 @@
|
||||
<td class="text-start">{{ ucwords(str_replace('_', ' ', $day_book->platform)) }}</td>
|
||||
|
||||
@if ($day_book->platform == 'sale')
|
||||
<td class="text-start">
|
||||
{{ currency_format($day_book->sale?->totalAmount ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start">{{ currency_format($day_book->sale?->totalAmount ?? 0, currency: business_currency()) }}</td>
|
||||
@elseif ($day_book->platform == 'sale_return')
|
||||
<td class="text-start">
|
||||
{{ currency_format($day_book->saleReturn?->sale?->totalAmount ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start">{{ currency_format($day_book->saleReturn?->sale?->totalAmount ?? 0, currency: business_currency()) }}</td>
|
||||
@elseif ($day_book->platform == 'purchase')
|
||||
<td class="text-start">
|
||||
{{ currency_format($day_book->purchase?->totalAmount ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start">{{ currency_format($day_book->purchase?->totalAmount ?? 0, currency: business_currency()) }}</td>
|
||||
@elseif ($day_book->platform == 'purchase_return')
|
||||
<td class="text-start">
|
||||
{{ currency_format($day_book->purchaseReturn?->purchase?->totalAmount ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start">{{ currency_format($day_book->purchaseReturn?->purchase?->totalAmount ?? 0, currency: business_currency()) }}</td>
|
||||
@elseif ($day_book->platform == 'due_collect' || $day_book->platform == 'due_pay')
|
||||
<td class="text-start">
|
||||
{{ currency_format($day_book->dueCollect?->totalDue ?? 0, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start">{{ currency_format($day_book->dueCollect?->totalDue ?? 0, currency: business_currency()) }}</td>
|
||||
@else
|
||||
<td class="text-start">{{ currency_format(0, currency: business_currency()) }}</td>
|
||||
<td class="text-start">{{ currency_format(0) }}</td>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$total_amount = match ($day_book->platform) {
|
||||
'sale' => $day_book->sale?->totalAmount ?? 0,
|
||||
'sale_return' => $day_book->saleReturn?->sale?->totalAmount ?? 0,
|
||||
'purchase' => $day_book->purchase?->totalAmount ?? 0,
|
||||
'purchase_return' => $day_book->purchaseReturn?->purchase?->totalAmount ?? 0,
|
||||
'due_collect', 'due_pay' => $day_book->dueCollect?->totalDue ?? 0,
|
||||
default => 0
|
||||
};
|
||||
@endphp
|
||||
|
||||
@if ($day_book->type === 'credit')
|
||||
<td class="text-start text-success">{{ currency_format($total_amount, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start text-success">{{ currency_format($day_book->amount, currency: business_currency()) }}</td>
|
||||
@else
|
||||
<td class="text-start">{{ currency_format(0, currency: business_currency()) }}</td>
|
||||
<td class="text-start">{{ currency_format(0) }}</td>
|
||||
@endif
|
||||
|
||||
@if ($day_book->type === 'debit')
|
||||
<td class="text-start text-danger">{{ currency_format($day_book->amount, currency: business_currency()) }}
|
||||
</td>
|
||||
<td class="text-start text-danger">{{ currency_format($day_book->amount, currency: business_currency()) }}</td>
|
||||
@else
|
||||
<td class="text-start">{{ currency_format(0, currency: business_currency()) }}</td>
|
||||
<td class="text-start">{{ currency_format(0) }}</td>
|
||||
@endif
|
||||
|
||||
@if ($day_book->payment_type_id)
|
||||
@@ -110,18 +87,7 @@
|
||||
|
||||
@php
|
||||
$page_total_amount = $day_books->sum(function ($day_book) {
|
||||
return match ($day_book->platform) {
|
||||
'sale' => $day_book->sale?->totalAmount ?? 0,
|
||||
'sale_return' => $day_book->saleReturn?->sale?->totalAmount ?? 0,
|
||||
'purchase' => $day_book->purchase?->totalAmount ?? 0,
|
||||
'purchase_return' => $day_book->purchaseReturn?->purchase?->totalAmount ?? 0,
|
||||
'due_collect', 'due_pay' => $day_book->dueCollect?->totalDue ?? 0,
|
||||
default => 0
|
||||
};
|
||||
});
|
||||
|
||||
$page_money_in_new = $day_books->where('type', 'credit')->sum(function ($day_book) {
|
||||
return match ($day_book->platform) {
|
||||
return match($day_book->platform) {
|
||||
'sale' => $day_book->sale?->totalAmount ?? 0,
|
||||
'sale_return' => $day_book->saleReturn?->sale?->totalAmount ?? 0,
|
||||
'purchase' => $day_book->purchase?->totalAmount ?? 0,
|
||||
@@ -149,4 +115,4 @@
|
||||
<td class="d-print-none"></td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user