199 lines
19 KiB
PHP
199 lines
19 KiB
PHP
<div class="responsive-table m-0">
|
|
<table class="table" id="datatable">
|
|
<thead>
|
|
<tr>
|
|
@usercan('purchases.delete')
|
|
<th class="w-60">
|
|
<div class="d-flex align-items-center gap-3">
|
|
<input type="checkbox" class="select-all-delete multi-delete ">
|
|
</div>
|
|
</th>
|
|
@endusercan
|
|
<th>{{ __('SL') }}.</th>
|
|
<th class="text-start">{{ __('Date') }}</th>
|
|
@if (auth()->user()->accessToMultiBranch())
|
|
<th class="text-start">{{ __('Branch') }}</th>
|
|
@endif
|
|
<th class="text-start">{{ __('Invoice No') }}</th>
|
|
<th class="text-start">{{ __('Party Name') }}</th>
|
|
<th class="text-start">{{ __('Total') }}</th>
|
|
<th class="text-start">{{ __('Discount') }}</th>
|
|
<th class="text-start">{{ __('Paid') }}</th>
|
|
<th class="text-start">{{ __('Due') }}</th>
|
|
<th>{{ __('Status') }}</th>
|
|
<th>{{ __('Action') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($purchases as $purchase)
|
|
<tr>
|
|
@usercan('purchases.delete')
|
|
<td class="w-60 checkbox">
|
|
<input type="checkbox" name="ids[]" class="delete-checkbox-item multi-delete"
|
|
value="{{ $purchase->id }}">
|
|
</td>
|
|
@endusercan
|
|
<td>{{ ($purchases->currentPage() - 1) * $purchases->perPage() + $loop->iteration }}</td>
|
|
<td class="text-start">{{ formatted_date($purchase->purchaseDate) }}</td>
|
|
@if (auth()->user()->accessToMultiBranch())
|
|
<td class="text-start">{{ $purchase->branch->name ?? '' }}</td>
|
|
@endif
|
|
<td class="text-start">{{ $purchase->invoiceNumber }}</td>
|
|
<td class="text-start">{{ $purchase->party->name }}</td>
|
|
<td class="text-start">{{ currency_format($purchase->totalAmount, currency: business_currency()) }}
|
|
</td>
|
|
<td class="text-start">
|
|
{{ currency_format($purchase->discountAmount, currency: business_currency()) }}</td>
|
|
<td class="text-start">{{ currency_format($purchase->paidAmount, currency: business_currency()) }}
|
|
</td>
|
|
<td class="text-start">{{ currency_format($purchase->dueAmount, currency: business_currency()) }}
|
|
</td>
|
|
<td>
|
|
@if ($purchase->details->sum('quantities') == 0)
|
|
<div class="paid-badge">{{ __('Returned') }}</div>
|
|
@elseif($purchase->dueAmount == 0)
|
|
<div class="paid-badge">{{ __('Paid') }}</div>
|
|
@elseif($purchase->dueAmount > 0 && $purchase->dueAmount < $purchase->totalAmount)
|
|
<div class="unpaid-badge">{{ __('Partial Paid') }}</div>
|
|
@else
|
|
<div class="unpaid-badge-2">{{ __('Unpaid') }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="d-print-none">
|
|
<div class="dropdown table-action">
|
|
<button type="button" data-bs-toggle="dropdown">
|
|
<i class="far fa-ellipsis-v"></i>
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
|
|
@usercan('purchases.read')
|
|
<li>
|
|
<a target="_blank" href="{{ route('business.purchases.invoice', $purchase->id) }}">
|
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M2.66602 12.4331V5.37211C2.66602 3.46944 2.66602 2.5181 3.2518 1.92702C3.83759 1.33594 4.7804 1.33594 6.66602 1.33594H9.33268C11.2183 1.33594 12.1611 1.33594 12.7469 1.92702C13.3327 2.5181 13.3327 3.46944 13.3327 5.37211V12.4331C13.3327 13.4409 13.3327 13.9448 13.0247 14.1431C12.5214 14.4673 11.7434 13.7875 11.3521 13.5408C11.0287 13.3369 10.8671 13.2349 10.6877 13.2291C10.4938 13.2227 10.3293 13.3205 9.97995 13.5408L8.70602 14.3442C8.36235 14.5609 8.19055 14.6693 7.99935 14.6693C7.80815 14.6693 7.63635 14.5609 7.29268 14.3442L6.01877 13.5408C5.69545 13.3369 5.53379 13.2349 5.35437 13.2291C5.1605 13.2227 4.99597 13.3205 4.6466 13.5408C4.25532 13.7875 3.47726 14.4673 2.97398 14.1431C2.66602 13.9448 2.66602 13.4409 2.66602 12.4331Z" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M10.6673 4H5.33398" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M6.66732 6.66406H5.33398" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M9.66602 6.58333C9.11375 6.58333 8.66602 6.97507 8.66602 7.45833C8.66602 7.9416 9.11375 8.33333 9.66602 8.33333C10.2183 8.33333 10.666 8.72507 10.666 9.20833C10.666 9.6916 10.2183 10.0833 9.66602 10.0833M9.66602 6.58333C10.1014 6.58333 10.4718 6.8268 10.6091 7.16667M9.66602 6.58333V6M9.66602 10.0833C9.23062 10.0833 8.86022 9.83987 8.72295 9.5M9.66602 10.0833V10.6667" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round"/>
|
|
</svg>
|
|
{{ __('Invoice') }}
|
|
</a>
|
|
</li>
|
|
@endusercan
|
|
|
|
@usercan('purchases.read')
|
|
@php
|
|
$useTaxInvoice = moduleCheck('TaxInvoiceAddon') && invoice_setting($purchase->business_id) == 'standard_a4';
|
|
@endphp
|
|
|
|
@if($useTaxInvoice)
|
|
<li>
|
|
<a target="_blank" href="{{ route('business.purchases.tax.invoice', $purchase->id) }}">
|
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<g clip-path="url(#clip0_40008374_151568)">
|
|
<path d="M15.012 1.5C14.177 1.5 13.5 3.51472 13.5 6H15.012C15.7407 6 16.105 6 16.3306 5.74841C16.5562 5.49682 16.5169 5.1655 16.4384 4.50286C16.2311 2.75357 15.6707 1.5 15.012 1.5Z" stroke="#4D4D4D" stroke-width="1.25"/>
|
|
<path d="M13.5 6.0407V13.9844C13.5 15.1181 13.5 15.685 13.1535 15.9081C12.5873 16.2728 11.7121 15.5081 11.2718 15.2305C10.9081 15.0011 10.7263 14.8864 10.5244 14.8798C10.3063 14.8726 10.1212 14.9826 9.72817 15.2305L8.295 16.1343C7.90838 16.3781 7.7151 16.5 7.5 16.5C7.28491 16.5 7.09159 16.3781 6.705 16.1343L5.27185 15.2305C4.90811 15.0011 4.72624 14.8864 4.5244 14.8798C4.30629 14.8726 4.1212 14.9826 3.72815 15.2305C3.28796 15.5081 2.41265 16.2728 1.84646 15.9081C1.5 15.685 1.5 15.1181 1.5 13.9844V6.0407C1.5 3.90019 1.5 2.82994 2.15901 2.16497C2.81802 1.5 3.87868 1.5 6 1.5H15" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M7.5 6C6.67157 6 6 6.50368 6 7.125C6 7.7463 6.67157 8.25 7.5 8.25C8.32845 8.25 9 8.7537 9 9.375C9 9.9963 8.32845 10.5 7.5 10.5M7.5 6C8.1531 6 8.7087 6.31305 8.91465 6.75M7.5 6V5.25M7.5 10.5C6.84689 10.5 6.29127 10.1869 6.08535 9.75M7.5 10.5V11.25" stroke="#4D4D4D" stroke-width="1.25" stroke-linecap="round"/>
|
|
</g>
|
|
<defs>
|
|
<clipPath id="clip0_40008374_151568">
|
|
<rect width="18" height="18" fill="white"/>
|
|
</clipPath>
|
|
</defs>
|
|
</svg>
|
|
{{ __('Tax Invoice') }}
|
|
</a>
|
|
</li>
|
|
@endif
|
|
@endusercan
|
|
|
|
@usercan('purchase-returns.read')
|
|
<li>
|
|
<a
|
|
href="{{ route('business.purchase-returns.create', ['purchase_id' => $purchase->id]) }}">
|
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M2.25 9.75V6H15.75V9.75C15.75 12.5784 15.75 13.9927 14.8713 14.8713C13.9927 15.75 12.5784 15.75 9.75 15.75H8.25C5.42157 15.75 4.00736 15.75 3.12868 14.8713C2.25 13.9927 2.25 12.5784 2.25 9.75Z" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M2.25 6L2.89904 4.55769C3.40241 3.4391 3.65408 2.87981 4.16423 2.5649C4.67438 2.25 5.32875 2.25 6.6375 2.25H11.3625C12.6712 2.25 13.3256 2.25 13.8358 2.5649C14.3459 2.87981 14.5976 3.4391 15.1009 4.55769L15.75 6" stroke="#4B5563" stroke-linecap="round"/>
|
|
<path d="M9 6V2.25" stroke="#4B5563" stroke-linecap="round"/>
|
|
<path d="M6.375 10.125H10.5C11.3284 10.125 12 10.7966 12 11.625C12 12.4534 11.3284 13.125 10.5 13.125H9.75M7.5 8.625L6 10.125L7.5 11.625" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
{{ __('Purchase Return') }}
|
|
</a>
|
|
</li>
|
|
@endusercan
|
|
{{-- @if ($purchase->dueAmount > 0)
|
|
<li>
|
|
<a href="#" class="open-payment-modal" data-bs-toggle="modal"
|
|
data-bs-target="#add-payment-modal" data-url=""
|
|
data-total="{{ $purchase->totalAmount }}"
|
|
data-due="{{ $purchase->dueAmount }}">
|
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none"
|
|
xmlns="http://www.w3.org/2000/svg">
|
|
<path
|
|
d="M15.707 12.6265C15.2148 9.66495 13.6824 7.4596 12.3502 6.16425C11.9626 5.78731 11.7688 5.59885 11.3406 5.42443C10.9124 5.25 10.5444 5.25 9.80835 5.25H8.19165C7.45561 5.25 7.08757 5.25 6.65941 5.42443C6.23125 5.59885 6.03743 5.78731 5.64978 6.16425C4.31761 7.4596 2.78521 9.66495 2.29295 12.6265C1.9267 14.83 3.95945 16.5 6.23124 16.5H11.7688C14.0405 16.5 16.0733 14.83 15.707 12.6265Z"
|
|
stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round" />
|
|
<path
|
|
d="M5.44246 3.33215C5.28773 3.10694 5.06346 2.80124 5.52674 2.73154C6.00294 2.65988 6.49741 2.98586 6.98141 2.97916C7.41928 2.9731 7.64235 2.77889 7.88167 2.50161C8.13367 2.20963 8.5239 1.5 9 1.5C9.4761 1.5 9.86633 2.20963 10.1183 2.50161C10.3577 2.77889 10.5807 2.9731 11.0185 2.97916C11.5026 2.98586 11.9971 2.65988 12.4733 2.73154C12.9365 2.80124 12.7123 3.10694 12.5576 3.33215L11.8579 4.35048C11.5586 4.7861 11.409 5.0039 11.0958 5.12696C10.7827 5.25 10.378 5.25 9.56865 5.25H8.43135C7.62203 5.25 7.21732 5.25 6.90417 5.12696C6.59101 5.0039 6.44138 4.7861 6.14209 4.35048L5.44246 3.33215Z"
|
|
stroke="#4B5563" stroke-linejoin="round" />
|
|
<path
|
|
d="M10.2195 9.68661C10.0574 9.08804 9.23209 8.54789 8.24141 8.95199C7.25073 9.35601 7.09337 10.6561 8.59189 10.7943C9.26914 10.8567 9.71074 10.7218 10.115 11.1034C10.5193 11.4848 10.5944 12.5458 9.56089 12.8317C8.52739 13.1176 7.50401 12.6709 7.39258 12.0364M8.88079 8.24219V8.81249M8.88079 12.9196V13.4922"
|
|
stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round" />
|
|
</svg>
|
|
{{ __('Add Payment') }}
|
|
</a>
|
|
</li>
|
|
@endif --}}
|
|
<li>
|
|
<a href="#"
|
|
data-url="{{ route('business.view-payment', ['type' => 'purchase', 'id' => $purchase->id]) }}"
|
|
class="view-payment-btn" data-bs-toggle="modal"
|
|
data-bs-target="#view-payment-modal">
|
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M3 13.9844V6.0407C3 3.90019 3 2.82994 3.65901 2.16497C4.31802 1.5 5.37868 1.5 7.5 1.5H10.5C12.6213 1.5 13.6819 1.5 14.341 2.16497C15 2.82994 15 3.90019 15 6.0407V13.9844C15 15.1181 15 15.685 14.6535 15.9081C14.0873 16.2728 13.2121 15.5081 12.7718 15.2305C12.4081 15.0011 12.2263 14.8864 12.0244 14.8798C11.8063 14.8726 11.6212 14.9826 11.2282 15.2305L9.795 16.1343C9.40838 16.3781 9.2151 16.5 9 16.5C8.7849 16.5 8.59162 16.3781 8.205 16.1343L6.77185 15.2305C6.40811 15.0011 6.22624 14.8864 6.0244 14.8798C5.80629 14.8726 5.6212 14.9826 5.22815 15.2305C4.78796 15.5081 3.91265 16.2728 3.34646 15.9081C3 15.685 3 15.1181 3 13.9844Z" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M12 4H6" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M11 7H6" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M9 10H6" stroke="#4B5563" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
|
|
{{ __('View Payment') }}
|
|
</a>
|
|
</li>
|
|
@if (!in_array($purchase->id, $purchasesWithReturns))
|
|
@usercan('purchases.read')
|
|
<li>
|
|
<a href="{{ route('business.purchases.edit', $purchase->id) }}">
|
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M12.1606 3.73679L13.2119 2.68547C13.7925 2.10484 14.7339 2.10484 15.3145 2.68547C15.8951 3.2661 15.8951 4.20748 15.3145 4.78811L14.2632 5.83943M12.1606 3.73679L8.23515 7.66222C7.4512 8.4462 7.05919 8.83815 6.79228 9.31582C6.52535 9.7935 6.2568 10.9214 6 12C7.07857 11.7432 8.2065 11.4746 8.68418 11.2077C9.16185 10.9408 9.5538 10.5488 10.3378 9.76485L14.2632 5.83943M12.1606 3.73679L14.2632 5.83943" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
<path d="M15.75 9C15.75 12.1819 15.75 13.773 14.7615 14.7615C13.773 15.75 12.1819 15.75 9 15.75C5.81802 15.75 4.22703 15.75 3.23851 14.7615C2.25 13.773 2.25 12.1819 2.25 9C2.25 5.81802 2.25 4.22703 3.23851 3.23851C4.22703 2.25 5.81802 2.25 9 2.25" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
|
</svg>
|
|
{{ __('Edit') }}
|
|
</a>
|
|
</li>
|
|
@endusercan
|
|
@usercan('purchases.delete')
|
|
<li>
|
|
<a href="{{ route('business.purchases.destroy', $purchase->id) }}"
|
|
class="confirm-action" data-method="DELETE">
|
|
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
<path d="M14.625 4.125L14.1602 11.6438C14.0414 13.5648 13.9821 14.5253 13.5006 15.2159C13.2625 15.5573 12.956 15.8455 12.6005 16.062C11.8816 16.5 10.9192 16.5 8.99452 16.5C7.06734 16.5 6.10372 16.5 5.38429 16.0612C5.0286 15.8443 4.722 15.5556 4.48401 15.2136C4.00266 14.5219 3.94459 13.5601 3.82846 11.6364L3.375 4.125" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
|
<path d="M6.75 8.79688H11.25" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
|
<path d="M7.875 11.7422H10.125" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
|
<path d="M2.25 4.125H15.75M12.0416 4.125L11.5297 3.0688C11.1896 2.3672 11.0195 2.01639 10.7261 1.79761C10.6611 1.74908 10.5922 1.7059 10.5201 1.66852C10.1953 1.5 9.80542 1.5 9.02572 1.5C8.22645 1.5 7.82685 1.5 7.49662 1.67559C7.42343 1.71451 7.35359 1.75943 7.28783 1.80988C6.99109 2.03753 6.82533 2.40116 6.49381 3.12844L6.03955 4.125" stroke="#4B5563" stroke-width="1.2" stroke-linecap="round"/>
|
|
</svg>
|
|
{{ __('Delete') }}
|
|
</a>
|
|
</li>
|
|
@endusercan
|
|
@endif
|
|
</ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="mt-3">
|
|
{{ $purchases->links('vendor.pagination.bootstrap-5') }}
|
|
</div>
|