Added customer trade and location in invoice pending reason page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 3m13s
Laravel Larastan / larastan (pull_request) Failing after 3m57s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 3m13s
Laravel Larastan / larastan (pull_request) Failing after 3m57s
This commit is contained in:
@@ -53,6 +53,8 @@ class InvoicePendingReason extends Page
|
||||
->afterStateUpdated(function ($state, $set, callable $get,$livewire) {
|
||||
$plantId = $get('plant_id');
|
||||
$set('document_number', null);
|
||||
$set('customer_trade_name', null);
|
||||
$set('location', null);
|
||||
})
|
||||
->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null)
|
||||
->hintColor('danger'),
|
||||
@@ -125,14 +127,41 @@ class InvoicePendingReason extends Page
|
||||
->toArray();
|
||||
})
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
if (empty($plantId)) {
|
||||
return [];
|
||||
}
|
||||
$documentNumber = $get('document_number');
|
||||
|
||||
$customers = InvoiceDataValidation::where('plant_id', $plantId)
|
||||
->where('document_number', $documentNumber)
|
||||
->value('customer_trade_name');
|
||||
|
||||
$location = InvoiceDataValidation::where('plant_id', $plantId)
|
||||
->where('document_number', $documentNumber)
|
||||
->value('location');
|
||||
|
||||
$set('customer_trade_name', $customers);
|
||||
$set('location', $location);
|
||||
})
|
||||
->extraAttributes(fn ($get) => [
|
||||
'class' => $get('pqBlockError') ? 'border-red-500' : '',
|
||||
])
|
||||
->hint(fn ($get) => $get('pqBlockError') ? $get('pqBlockError') : null)
|
||||
->hintColor('danger'),
|
||||
TextInput::make('remark')
|
||||
TextInput::make('customer_trade_name')
|
||||
->label('Customer Trade Name')
|
||||
->required()
|
||||
->readOnly()
|
||||
->reactive()
|
||||
->columnSpan(1),
|
||||
TextInput::make('location')
|
||||
->label('Location')
|
||||
->required()
|
||||
->readOnly()
|
||||
->reactive()
|
||||
->columnSpan(1),
|
||||
TextInput::make('remark')
|
||||
->label('Remark')
|
||||
->reactive()
|
||||
->maxLength(40)
|
||||
|
||||
Reference in New Issue
Block a user