@php
$bill = $purchaseInvoice ?? null;
$dueDefault = ($bill && !empty($bill->due_date))
? \Carbon\Carbon::parse($bill->due_date)->format('Y-m-d')
: '';
if (old('discount_amount') !== null) {
$hdrDiscInput = old('discount_amount');
} elseif ($bill && ($bill->discount_type ?? 'fixed') === 'percentage') {
$pre = (float) ($bill->subtotal ?? 0) + (float) ($bill->discount_amount ?? 0);
$hdrDiscInput = $pre > 0 ? round(100 * (float) ($bill->discount_amount ?? 0) / $pre, 4) : 0;
} else {
$hdrDiscInput = old('discount_amount', $bill?->discount_amount ?? 0);
}
@endphp
Status
Vendor *
Purchase order
@if(!empty($warehouses) && count($warehouses))
@include('garage.partials.warehouse-location-fields', [
'fieldPrefix' => 'billWh',
'warehouses' => $warehouses,
'sectionsByWarehouse' => $sectionsByWarehouse,
'defaultWarehouseId' => $defaultWarehouseId ?? null,
'defaultSectionId' => $defaultSectionId ?? null,
'applyDefaults' => $applyDefaults ?? false,
'useBootstrap' => true,
'gridClass' => 'row g-2 mb-1 grg-wh-location gs-ro-fields-row',
'colClass' => 'col-12 col-sm-6 col-lg-3',
'labelClass' => 'gpo-lbl',
'selectClass' => 'gpo-sel js-chosen js-chosen-compact',
])
@endif