Add reason for invalid warranty. #258
This commit is contained in:
parent
11b60c8655
commit
0d60fe1a9d
1 changed files with 21 additions and 1 deletions
|
|
@ -26,6 +26,11 @@ use Catalyst\MenuBundle\Annotation\Menu;
|
|||
|
||||
class WarrantyController extends Controller
|
||||
{
|
||||
const PURCHASE_DATE_EMPTY = 'Purchase date missing.';
|
||||
const PLATE_NUM_EMPTY = 'Plate number missing.';
|
||||
const SERIAL_EMPTY = 'Serial number missing.';
|
||||
const PURCHASE_DATE_INVALID = 'Invalid purchase date.';
|
||||
|
||||
/**
|
||||
* @Menu(selected="warranty_list")
|
||||
*/
|
||||
|
|
@ -398,6 +403,7 @@ class WarrantyController extends Controller
|
|||
'Application Type ID',
|
||||
'Battery ID',
|
||||
'Ownership Type',
|
||||
'Reason Warranty Not Added',
|
||||
]);
|
||||
foreach ($inv_entries as $row)
|
||||
{
|
||||
|
|
@ -477,6 +483,19 @@ class WarrantyController extends Controller
|
|||
empty($serial) ||
|
||||
($date_purchase == false))
|
||||
{
|
||||
$reason = '';
|
||||
if (empty($plate_number))
|
||||
$reason = $reason . self::PLATE_NUM_EMPTY . ' ';
|
||||
if (empty($serial))
|
||||
$reason = $reason . self::SERIAL_EMPTY . ' ';
|
||||
if (empty($purchase_date))
|
||||
$reason = $reason . self::PURCHASE_DATE_EMPTY . ' ';
|
||||
else
|
||||
{
|
||||
if ($date_purchase == false)
|
||||
$reason = $reason . self::PURCHASE_DATE_INVALID . ' ';
|
||||
}
|
||||
|
||||
// add to invalid_entries
|
||||
$invalid_entries[] = [
|
||||
'owner_first_name' => $first_name,
|
||||
|
|
@ -496,7 +515,8 @@ class WarrantyController extends Controller
|
|||
'distributor_address' => trim($fields[14]),
|
||||
'application_type_id' => trim($fields[15]),
|
||||
'battery_id' => $battery_id,
|
||||
'ownership_typ' => trim($fields[17]),
|
||||
'ownership_type' => trim($fields[17]),
|
||||
'reason' => $reason,
|
||||
];
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue