Merge branch '258-upload-warranty-csv' into 'master'
Add reason for invalid warranty. #258 Closes #258 See merge request jankstudio/resq!320
This commit is contained in:
commit
4c5733f891
1 changed files with 21 additions and 1 deletions
|
|
@ -26,6 +26,11 @@ use Catalyst\MenuBundle\Annotation\Menu;
|
||||||
|
|
||||||
class WarrantyController extends Controller
|
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")
|
* @Menu(selected="warranty_list")
|
||||||
*/
|
*/
|
||||||
|
|
@ -398,6 +403,7 @@ class WarrantyController extends Controller
|
||||||
'Application Type ID',
|
'Application Type ID',
|
||||||
'Battery ID',
|
'Battery ID',
|
||||||
'Ownership Type',
|
'Ownership Type',
|
||||||
|
'Reason Warranty Not Added',
|
||||||
]);
|
]);
|
||||||
foreach ($inv_entries as $row)
|
foreach ($inv_entries as $row)
|
||||||
{
|
{
|
||||||
|
|
@ -477,6 +483,19 @@ class WarrantyController extends Controller
|
||||||
empty($serial) ||
|
empty($serial) ||
|
||||||
($date_purchase == false))
|
($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
|
// add to invalid_entries
|
||||||
$invalid_entries[] = [
|
$invalid_entries[] = [
|
||||||
'owner_first_name' => $first_name,
|
'owner_first_name' => $first_name,
|
||||||
|
|
@ -496,7 +515,8 @@ class WarrantyController extends Controller
|
||||||
'distributor_address' => trim($fields[14]),
|
'distributor_address' => trim($fields[14]),
|
||||||
'application_type_id' => trim($fields[15]),
|
'application_type_id' => trim($fields[15]),
|
||||||
'battery_id' => $battery_id,
|
'battery_id' => $battery_id,
|
||||||
'ownership_typ' => trim($fields[17]),
|
'ownership_type' => trim($fields[17]),
|
||||||
|
'reason' => $reason,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue