Updated warning message against tube_sticker and pack_slip master data
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / review (pull_request) Failing after 29s
Laravel Pint / pint (pull_request) Successful in 2m16s
Laravel Larastan / larastan (pull_request) Failing after 3m17s

This commit is contained in:
dhanabalan
2025-11-29 17:20:07 +05:30
parent 0812484926
commit 1aa1937b39
2 changed files with 106 additions and 132 deletions

View File

@@ -3270,7 +3270,7 @@ class CreateInvoiceValidation extends CreateRecord
$hasPumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
$hasCapacitorQr = $record->stickerMasterRelation->panel_box_code ?? null;
if (! $hasMotorQr && ! $hasPumpQr && ! $hasPumpSetQr && ! $hasCapacitorQr) {
if (! $hasMotorQr && ! $hasPumpQr && ! $hasPumpSetQr) {// && ! $hasCapacitorQr
$hasMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
$hasPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
@@ -3278,12 +3278,21 @@ class CreateInvoiceValidation extends CreateRecord
$hasPumpQr = $record->stickerMasterRelation->pack_slip_pump ?? null;
}
$invalidPackage = false;
$hasTubeMotorQr = $record->stickerMasterRelation->tube_sticker_motor ?? null;
$hasPackMotorQr = $record->stickerMasterRelation->pack_slip_motor ?? null;
$hasTubePumpSetQr = $record->stickerMasterRelation->tube_sticker_pumpset ?? null;
$hasPackPumpSetQr = $record->stickerMasterRelation->pack_slip_pumpset ?? null;
if ($hasTubeMotorQr != $hasPackMotorQr || $hasTubePumpSetQr != $hasPackPumpSetQr) {
$invalidPackage = true;
}
$hadMotorQr = $record->motor_scanned_status ?? null;
$hadPumpQr = $record->pump_scanned_status ?? null;
$hadPumpSetQr = $record->scanned_status_set ?? null;
$hadCapacitorQr = $record->capacitor_scanned_status ?? null;
if (! $hasMotorQr && ! $hasPumpQr && ! $hasPumpSetQr && ! $hasCapacitorQr) {
if ((! $hasMotorQr && ! $hasPumpQr && ! $hasPumpSetQr && ! $hasCapacitorQr) || $invalidPackage) {
Notification::make()
->title('Invalid: Item Code')
->body("Scanned 'Item Code' doesn't have valid package type to proceed!")