Limit customer vehicles to 2 per customer. #434
This commit is contained in:
parent
9c2c1e5895
commit
3fcb3d31b5
1 changed files with 12 additions and 3 deletions
|
|
@ -663,9 +663,18 @@
|
|||
|
||||
// display create vehicle form
|
||||
$("#add-vehicle").click(function() {
|
||||
$("#vehicle-form").data('mode', 'create');
|
||||
$("#vehicle-form-title").html("Add Vehicle");
|
||||
$("#vehicle-form-modal").modal('show');
|
||||
// check if there are already 2 vehicles in list
|
||||
if (vehicleRows.length == 2)
|
||||
{
|
||||
swal({
|
||||
text: 'Customer is limited to only 2 vehicles..',
|
||||
type: 'info',
|
||||
});
|
||||
} else {
|
||||
$("#vehicle-form").data('mode', 'create');
|
||||
$("#vehicle-form-title").html("Add Vehicle");
|
||||
$("#vehicle-form-modal").modal('show');
|
||||
}
|
||||
});
|
||||
|
||||
// find vehicle row by index
|
||||
|
|
|
|||
Loading…
Reference in a new issue