Merge branch 'master' into hotfix-8222DeleteZoneSQL
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
commit
e95b2a4496
|
@ -130,6 +130,9 @@
|
|||
"Payment": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"PbxConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Postcode": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "PbxConfig",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "pbx.config"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true
|
||||
},
|
||||
"defaultPrefix": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"property": "*",
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "employee",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2040,7 +2040,7 @@ INSERT INTO `vn`.`ticketService`(`id`, `description`, `quantity`, `price`, `taxC
|
|||
INSERT INTO `pbx`.`config` (id,defaultPrefix)
|
||||
VALUES (1,'0034');
|
||||
|
||||
INSERT INTO `pbx`.`prefix` (country, prefix)
|
||||
INSERT IGNORE INTO `pbx`.`prefix` (country, prefix)
|
||||
VALUES
|
||||
('es', '0034'),
|
||||
('fr', '0033'),
|
||||
|
@ -4028,7 +4028,8 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c
|
|||
|
||||
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
|
||||
VALUES (19, '1169'),
|
||||
(8, '1183');
|
||||
(8, '1183'),
|
||||
(1, '1320');
|
||||
|
||||
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
|
||||
VALUES ('saysimle-url-mock', 1320);
|
||||
VALUES ('saysimle-url-mock', '1819');
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`buy_getLastWithoutInventory`(
|
||||
vItemFk INT,
|
||||
vWarehouseFk INT
|
||||
)
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
/**
|
||||
* Retorna la última compra que no sea inventario.
|
||||
*
|
||||
* @param vItemFk Id del artículo
|
||||
* @param vWarehouseFk Id del almacén
|
||||
* @return Id de compra
|
||||
*/
|
||||
DECLARE vBuyFk INT;
|
||||
|
||||
SELECT b.id INTO vBuyFk
|
||||
FROM buy b
|
||||
JOIN entry e ON e.id = b.entryFk
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
WHERE e.id <> (SELECT defaultEntry FROM entryConfig)
|
||||
AND e.supplierFk <> (SELECT supplierFk FROM inventoryConfig)
|
||||
AND e.typeFk <> 'inventory'
|
||||
AND b.itemFk = vItemFk
|
||||
AND (t.warehouseInFk = vWarehouseFk OR t.warehouseInFk IS NULL)
|
||||
ORDER BY ABS(DATEDIFF(util.VN_CURDATE(), t.landed)), e.created DESC
|
||||
LIMIT 1;
|
||||
|
||||
RETURN vBuyFk;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,107 @@
|
|||
INSERT IGNORE INTO vn.saySimpleCountry
|
||||
SET countryFk = 1,
|
||||
channel = '1320';
|
||||
|
||||
UPDATE vn.saySimpleConfig
|
||||
SET defaultChannel = '1819';
|
||||
|
||||
INSERT IGNORE INTO pbx.prefix (country, prefix) VALUES
|
||||
('ES', '0034'),
|
||||
('IT', '0039'),
|
||||
('DE', '0049'),
|
||||
('RO', '0040'),
|
||||
('NL', '0031'),
|
||||
('BE', '0032'),
|
||||
('RU', '007'),
|
||||
('PT', '00351'),
|
||||
('LT', '00370'),
|
||||
('UA', '00380'),
|
||||
('CO', '0057'),
|
||||
('FI', '00358'),
|
||||
('EC', '00593'),
|
||||
('LB', '00961'),
|
||||
('IL', '00972'),
|
||||
('TH', '0066'),
|
||||
('PA', '00507'),
|
||||
('GB', '0044'),
|
||||
('FR', '0033'),
|
||||
('PL', '0048'),
|
||||
('MX', '0052'),
|
||||
('MA', '00212'),
|
||||
('AI', '001268'),
|
||||
('GH', '00233'),
|
||||
('SE', '0046'),
|
||||
('AE', '00971'),
|
||||
('KE', '00254'),
|
||||
('AD', '00376'),
|
||||
('AO', '00244'),
|
||||
('LU', '00352'),
|
||||
('BY', '00375'),
|
||||
('MD', '00373'),
|
||||
('DK', '0045'),
|
||||
('ET', '00251'),
|
||||
('AU', '0061'),
|
||||
('CA', '0001'),
|
||||
('CL', '0056'),
|
||||
('CN', '0086'),
|
||||
('CR', '00506'),
|
||||
('GT', '00502'),
|
||||
('CI', '00225'),
|
||||
('PE', '0051'),
|
||||
('LK', '0094'),
|
||||
('ZA', '0027'),
|
||||
('TR', '0090'),
|
||||
('ZW', '00263'),
|
||||
('MY', '0060'),
|
||||
('NZ', '0064'),
|
||||
('IE', '00353'),
|
||||
('MN', '00976'),
|
||||
('SV', '00503'),
|
||||
('ZM', '00260'),
|
||||
('JP', '0081'),
|
||||
('RW', '00250'),
|
||||
('AL', '00355'),
|
||||
('KW', '00965'),
|
||||
('SG', '0065'),
|
||||
('SR', '00597'),
|
||||
('KR', '0082'),
|
||||
('US', '0001'),
|
||||
('RS', '00381'),
|
||||
('AT', '0043'),
|
||||
('EG', '0020'),
|
||||
('LV', '00371'),
|
||||
('CY', '00357'),
|
||||
('CZ', '00420'),
|
||||
('BB', '001246'),
|
||||
('SK', '00421'),
|
||||
('IN', '0091'),
|
||||
('DZ', '00213'),
|
||||
('BR', '0055'),
|
||||
('GR', '0030'),
|
||||
('MC', '00377'),
|
||||
('SI', '00386'),
|
||||
('GP', '00590'),
|
||||
('NO', '0047'),
|
||||
('CH', '0041'),
|
||||
('AR', '0054'),
|
||||
('CU', '0053'),
|
||||
('GQ', '00240'),
|
||||
('GN', '00224'),
|
||||
('HN', '00504'),
|
||||
('ML', '00223'),
|
||||
('NI', '00505'),
|
||||
('PK', '0092'),
|
||||
('PY', '00595'),
|
||||
('SN', '00221'),
|
||||
('UY', '00598'),
|
||||
('VE', '0058'),
|
||||
('BG', '00359'),
|
||||
('GE', '00995'),
|
||||
('EE', '00372'),
|
||||
('SA', '00966'),
|
||||
('RN', '00234'),
|
||||
('HK', '00852'),
|
||||
('GI', '00350'),
|
||||
('CM', '00237'),
|
||||
('HU', '0036'),
|
||||
('AM', '00374');
|
|
@ -245,6 +245,6 @@
|
|||
"Invalid or expired verification code": "Invalid or expired verification code",
|
||||
"Payment method is required": "Payment method is required",
|
||||
"The raid information is not correct": "The raid information is not correct",
|
||||
"Sales already moved": "Sales already moved"
|
||||
|
||||
"Sales already moved": "Sales already moved",
|
||||
"There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first"
|
||||
}
|
||||
|
|
|
@ -388,5 +388,6 @@
|
|||
"ticketLostExpedition": "El ticket [{{ticketId}}]({{{ticketUrl}}}) tiene la siguiente expedición perdida:{{ expeditionId }}",
|
||||
"The web user's email already exists": "El correo del usuario web ya existe",
|
||||
"Sales already moved": "Ya han sido transferidas",
|
||||
"The raid information is not correct": "La información de la redada no es correcta"
|
||||
"The raid information is not correct": "La información de la redada no es correcta",
|
||||
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero"
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ module.exports = Self => {
|
|||
JOIN vn.productionConfig pc
|
||||
WHERE sh.code = ? AND s.code = pc.sectorFromCode
|
||||
), tItemInSector AS (
|
||||
SELECT is2.itemFk, is2.created, is2.shelvingFk
|
||||
SELECT is2.itemFk, is2.created, sh.code
|
||||
FROM vn.itemShelving is2
|
||||
JOIN vn.shelving sh ON sh.id = is2.shelvingFk
|
||||
JOIN vn.parking p ON p.id = sh.parkingFk
|
||||
|
@ -59,7 +59,7 @@ module.exports = Self => {
|
|||
JOIN vn.productionConfig pc
|
||||
WHERE sh.code <> ?
|
||||
AND s.code = pc.sectorFromCode)
|
||||
SELECT ti.itemFK, tis.shelvingFk
|
||||
SELECT ti.itemFK, tis.code shelvingFk
|
||||
FROM tItemShelving ti
|
||||
JOIN tItemInSector tis ON tis.itemFk = ti.itemFk
|
||||
JOIN vn.productionConfig pc
|
||||
|
|
|
@ -387,10 +387,10 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
newOrderFromTicket() {
|
||||
this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(res => {
|
||||
const path = this.$state.href('order.card.catalog', {id: res.data});
|
||||
window.open(path, '_blank');
|
||||
this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(async res => {
|
||||
const path = await this.vnApp.getUrl(`order/${res.data}/catalog`);
|
||||
|
||||
window.open(path, '_blank');
|
||||
this.vnApp.showSuccess(this.$t('Order created'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -567,14 +567,10 @@ describe('Ticket', () => {
|
|||
const expectedResponse = {id: 123};
|
||||
|
||||
window.open = jasmine.createSpy('open');
|
||||
controller.$state.href = jasmine.createSpy('href')
|
||||
.and.returnValue('/somePath');
|
||||
|
||||
$httpBackend.expect('POST', `Orders/newFromTicket`, expectedParams).respond(expectedResponse);
|
||||
controller.newOrderFromTicket();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(window.open).toHaveBeenCalledWith('/somePath', '_blank');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -51,9 +51,9 @@ module.exports = Self => {
|
|||
};
|
||||
|
||||
const ticketList = await models.Ticket.find(filter, myOptions);
|
||||
|
||||
if (ticketList.length > 0)
|
||||
throw new UserError('There are tickets for this area, delete them first');
|
||||
const hasRefFk = ticketList.some(ticket => ticket.refFk);
|
||||
if (hasRefFk)
|
||||
throw new UserError('There are tickets to be invoiced');
|
||||
|
||||
await models.Zone.destroyById(id, myOptions);
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@ describe('zone deletezone()', () => {
|
|||
__: value => value
|
||||
};
|
||||
const ctx = {req: activeCtx};
|
||||
const zoneId = 4;
|
||||
const zoneId2 = 3;
|
||||
let ticketIDs;
|
||||
|
||||
beforeAll(async() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
|
||||
const zoneId = 4;
|
||||
const originalTickets = await models.Ticket.find({
|
||||
where: {
|
||||
zoneFk: zoneId
|
||||
|
@ -29,7 +29,7 @@ describe('zone deletezone()', () => {
|
|||
|
||||
it('should delete a zone and update their tickets', async() => {
|
||||
const tx = await models.Zone.beginTransaction({});
|
||||
|
||||
const zoneId = 4;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
await models.Zone.deleteZone(ctx, zoneId, options);
|
||||
|
@ -47,17 +47,18 @@ describe('zone deletezone()', () => {
|
|||
|
||||
it('should not delete the zone if it has tickets', async() => {
|
||||
const tx = await models.Zone.beginTransaction({});
|
||||
const zoneId = 1;
|
||||
|
||||
let error;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
await models.Zone.deleteZone(ctx, zoneId2, options);
|
||||
await models.Zone.deleteZone(ctx, zoneId, options);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
await tx.rollback();
|
||||
}
|
||||
|
||||
expect(error).toEqual('There are tickets for this area, delete them first');
|
||||
expect(error).toEqual('There are tickets to be invoiced');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ module.exports = {
|
|||
xmlDocument: document,
|
||||
format: 'code128',
|
||||
displayValue: false,
|
||||
width: 3.8,
|
||||
width: 3.5,
|
||||
height: 75,
|
||||
margin: 0
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue