Updated warning message against tube_sticker and pack_slip master data
This commit is contained in:
@@ -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!")
|
||||
|
||||
Reference in New Issue
Block a user