Quantity validation on ticket packaging
This commit is contained in:
parent
ff047559e3
commit
7aeed467e9
|
@ -60,14 +60,8 @@
|
|||
},
|
||||
{
|
||||
"url" : "/package",
|
||||
"abstract": true,
|
||||
"state": "ticket.card.package",
|
||||
"component": "ui-view"
|
||||
},
|
||||
{
|
||||
"url": "/list",
|
||||
"state": "ticket.card.package.list",
|
||||
"component": "vn-ticket-package-list",
|
||||
"component": "vn-ticket-package",
|
||||
"params": {
|
||||
"ticket": "$ctrl.ticket"
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ngModule from '../../module';
|
||||
import ngModule from '../module';
|
||||
|
||||
class Controller {
|
||||
|
||||
|
@ -64,8 +64,8 @@ class Controller {
|
|||
|
||||
Controller.$inject = ['$http', '$scope'];
|
||||
|
||||
ngModule.component('vnTicketPackageList', {
|
||||
template: require('./package-list.html'),
|
||||
ngModule.component('vnTicketPackage', {
|
||||
template: require('./package.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
ticket: '<'
|
|
@ -1,7 +1,7 @@
|
|||
import './package-list.js';
|
||||
import './package.js';
|
||||
|
||||
describe('Ticket', () => {
|
||||
describe('Component vnTicketPackageList', () => {
|
||||
describe('Component vnTicketPackage', () => {
|
||||
let $componentController;
|
||||
let controller;
|
||||
let $httpBackend;
|
||||
|
@ -19,7 +19,7 @@ describe('Ticket', () => {
|
|||
accept: function() {}
|
||||
}
|
||||
};
|
||||
controller = $componentController('vnTicketPackageList', {$scope: $scope});
|
||||
controller = $componentController('vnTicketPackage', {$scope: $scope});
|
||||
}));
|
||||
|
||||
describe('removePackage()', () => {
|
|
@ -6,6 +6,6 @@ import './card/ticket-card';
|
|||
import './summary/ticket-summary';
|
||||
import './data/ticket-data';
|
||||
import './notes/ticket-observations';
|
||||
import './package/list/package-list';
|
||||
import './package/package';
|
||||
import './sale/sale';
|
||||
import './review/review';
|
||||
|
|
|
@ -289,7 +289,7 @@ export default {
|
|||
submitNotesButton: `${components.vnSubmit}`
|
||||
},
|
||||
ticketPackages: {
|
||||
packagesButton: `${components.vnMenuItem}[ui-sref="ticket.card.package.list"]`,
|
||||
packagesButton: `${components.vnMenuItem}[ui-sref="ticket.card.package"]`,
|
||||
firstPackageSelect: `${components.vnAutocomplete}[label="Package"] input`
|
||||
}
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ module.exports = function(Self) {
|
|||
});
|
||||
|
||||
function validateQuantity(quantity) {
|
||||
return quantity != 0;
|
||||
return !isNaN(quantity) && quantity != 0;
|
||||
}
|
||||
|
||||
Self.validatesPresenceOf('packagingFk', {message: 'Package cannot be blank'});
|
||||
|
|
Loading…
Reference in New Issue