Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2891-ticket_sale_problems
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-05-25 14:08:02 +02:00
commit 099ff657e4
53 changed files with 5344 additions and 3351 deletions

View File

@ -13,18 +13,26 @@ module.exports = function(Self) {
});
Self.getUserConfig = async ctx => {
let userConfig = await Self.app.models.UserConfig.findOne({
const models = Self.app.models;
let userConfig = await models.UserConfig.findOne({
where: {userFk: ctx.req.accessToken.userId}
});
const companyFilter = {where: {code: 'VNL'}};
const company = await models.Company.findOne(companyFilter);
const warehouseFilter = {where: {code: 'ALG'}};
const warehouse = await models.Warehouse.findOne(warehouseFilter);
if (!userConfig) {
let newConfig = {
warehouseFk: 1,
companyFk: 442,
warehouseFk: warehouse.id,
companyFk: company.id,
userFk: ctx.req.accessToken.userId
};
userConfig = await Self.app.models.UserConfig.create(newConfig);
userConfig = await models.UserConfig.create(newConfig);
}
return userConfig;
};

View File

@ -2,9 +2,9 @@ const app = require('vn-loopback/server/server');
describe('userConfig getUserConfig()', () => {
it(`should return the configuration data of a given user`, async() => {
await app.models.UserConfig.getUserConfig({req: {accessToken: {userId: 9}}})
.then(response => {
expect(response.warehouseFk).toEqual(1);
});
const result = await app.models.UserConfig.getUserConfig({req: {accessToken: {userId: 9}}});
expect(result.warehouseFk).toEqual(1);
expect(result.companyFk).toEqual(442);
});
});

View File

@ -16,6 +16,9 @@
"name": {
"type": "String"
},
"code": {
"type": "String"
},
"isInventory": {
"type": "Number"
},

View File

@ -1,26 +0,0 @@
CREATE OR REPLACE DEFINER = root@`%` VIEW `vn`.`saleValue` AS
SELECT `wh`.`name` AS `warehouse`,
`c`.`name` AS `client`,
`c`.`typeFk` AS `clientTypeFk`,
`u`.`name` AS `buyer`,
`it`.`id` AS `itemTypeFk`,
`it`.`name` AS `family`,
`s`.`itemFk` AS `itemFk`,
`s`.`concept` AS `concept`,
`s`.`quantity` AS `quantity`,
`b`.`buyingValue` + `b`.`freightValue` + `b`.`comissionValue` + `b`.`packageValue` AS `cost`,
(`b`.`buyingValue` + `b`.`freightValue` + `b`.`comissionValue` + `b`.`packageValue`) * `s`.`quantity` AS `value`,
`tm`.`year` AS `year`,
`tm`.`week` AS `week`
FROM `vn`.`sale` `s`
JOIN `vn`.`item` `i` ON `i`.`id` = `s`.`itemFk`
JOIN `vn`.`itemType` `it` ON `it`.`id` = `i`.`typeFk`
JOIN `account`.`user` `u` ON `u`.`id` = `it`.`workerFk`
JOIN `vn`.`ticket` `t` ON `t`.`id` = `s`.`ticketFk`
JOIN `vn`.`client` `c` ON `c`.`id` = `t`.`clientFk`
JOIN `vn`.`warehouse` `wh` ON `wh`.`id` = `t`.`warehouseFk`
JOIN `vn`.`time` `tm` ON `tm`.`dated` = CAST(`t`.`shipped` AS DATE)
JOIN `cache`.`last_buy` `lb` ON `lb`.`item_id` = `i`.`id` AND `lb`.`warehouse_id` = `wh`.`id`
JOIN `vn`.`buy` `b` ON `b`.`id` = `lb`.`buy_id`
WHERE `wh`.`isManaged` <> 0;

View File

@ -1,2 +0,0 @@
ALTER TABLE vn.`supplierAccount` ADD `beneficiary` VARCHAR(50) NULL DEFAULT NULL AFTER `bankFk`;
UPDATE vn.supplierAccount SET beneficiary = `description`;

View File

@ -1,28 +0,0 @@
DROP PROCEDURE IF EXISTS `bs`.`weekWaste`;
DELIMITER $$
$$
CREATE DEFINER = `root`@`%` PROCEDURE `bs`.`weekWaste__`()
BEGIN
DECLARE vWeek INT;
DECLARE vYear INT;
SELECT week, year
INTO vWeek, vYear
FROM vn.time
WHERE dated = DATE_ADD(CURDATE(), INTERVAL -1 WEEK);
SELECT *, 100 * dwindle / total AS percentage
FROM (
SELECT buyer,
SUM(saleTotal) AS total,
SUM(saleWaste) AS dwindle
FROM bs.waste
WHERE year = vYear
AND week = vWeek
GROUP BY buyer
) sub
ORDER BY percentage DESC;
END;$$
DELIMITER ;

View File

@ -1,32 +0,0 @@
DROP PROCEDURE IF EXISTS `bs`.`weekWaste_byWorker`;
DELIMITER $$
$$
CREATE
DEFINER = root@`%` PROCEDURE `bs`.`weekWaste_byWorker__`(IN vWorkerFk INT)
BEGIN
DECLARE vWeek INT;
DECLARE vYear INT;
SELECT week, year
INTO vWeek, vYear
FROM vn.time
WHERE dated = TIMESTAMPADD(WEEK, -1, CURDATE());
SELECT *, 100 * mermas / total AS porcentaje
FROM (
SELECT ws.family,
SUM(ws.saleTotal) AS total,
SUM(ws.saleWaste) AS mermas
FROM bs.waste ws
JOIN vn.worker w ON w.user = ws.buyer
WHERE year = vYear
AND week = vWeek
AND w.id = vWorkerFk
GROUP BY family
) sub
ORDER BY porcentaje DESC;
END;;$$
DELIMITER ;

View File

@ -1,30 +0,0 @@
DROP PROCEDURE IF EXISTS `bs`.`weekWaste_getDetail`;
DELIMITER $$
$$
CREATE
DEFINER = root@`%` PROCEDURE `bs`.`weekWaste_getDetail__`()
BEGIN
DECLARE vLastWeek DATE;
DECLARE vWeek INT;
DECLARE vYear INT;
SET vLastWeek = TIMESTAMPADD(WEEK, -1, CURDATE());
SET vYear = YEAR(vLastWeek);
SET vWeek = WEEK(vLastWeek, 1);
SELECT *, 100 * dwindle / total AS percentage
FROM (
SELECT buyer,
ws.family,
SUM(ws.saleTotal) AS total,
SUM(ws.saleWaste) AS dwindle
FROM bs.waste ws
WHERE year = vYear
AND week = vWeek
GROUP BY buyer, family
) sub
ORDER BY percentage DESC;
END;$$
DELIMITER ;

View File

@ -1,21 +0,0 @@
ALTER TABLE `bs`.`waste`
ADD itemFk INT NULL AFTER `family`;
ALTER TABLE `bs`.`waste`
ADD itemTypeFk SMALLINT(5) UNSIGNED NULL AFTER `itemFk`;
ALTER TABLE `bs`.`waste`
ADD CONSTRAINT waste_itemType_id
FOREIGN KEY (itemTypeFk) REFERENCES vn.itemType (id)
ON UPDATE CASCADE;
ALTER TABLE `bs`.`waste`
ADD CONSTRAINT waste_item_id
FOREIGN KEY (itemFk) REFERENCES vn.item (id)
ON UPDATE CASCADE;
ALTER TABLE `bs`.`waste` DROP PRIMARY KEY;
ALTER TABLE `bs`.`waste`
ADD PRIMARY KEY (buyer, `year`, week, family, itemFk);

View File

@ -1,37 +0,0 @@
UPDATE `bs`.nightTask t SET t.`procedure` = 'waste_addSales' WHERE t.id = 54;
DROP PROCEDURE IF EXISTS `bs`.`waste_Add`;
DELIMITER $$
$$
CREATE
DEFINER = root@`%` PROCEDURE `bs`.`waste_addSales`()
BEGIN
DECLARE vWeek INT;
DECLARE vYear INT;
SELECT week, year
INTO vWeek, vYear
FROM vn.time
WHERE dated = CURDATE();
REPLACE bs.waste
SELECT *, 100 * mermas / total as porcentaje
FROM (
SELECT buyer,
year,
week,
family,
itemFk,
itemTypeFk,
floor(sum(value)) as total,
floor(sum(IF(clientTypeFk = 'loses', value, 0))) as mermas
FROM vn.saleValue
where year = vYear and week = vWeek
GROUP BY family, itemFk
) sub
ORDER BY mermas DESC;
END;$$
DELIMITER ;

View File

@ -0,0 +1,4 @@
ALTER TABLE `vn`.`warehouse`
ADD `code` VARCHAR(3) NULL AFTER name;
UPDATE `vn`.`warehouse` SET `code` = 'ALG' WHERE `id` = 60;

File diff suppressed because one or more lines are too long

View File

@ -125,13 +125,13 @@ INSERT INTO `vn`.`warehouseAlias`(`id`, `name`)
(1, 'Main Warehouse'),
(2, 'Silla');
INSERT INTO `vn`.`warehouse`(`id`, `name`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`, `countryFk`)
INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory`, `hasAvailable`, `isManaged`, `hasStowaway`, `hasDms`, `hasComission`, `aliasFk`, `countryFk`)
VALUES
(1, 'Warehouse One', 1, 1, 1, 1, 1, 1, 1, 2, 1),
(2, 'Warehouse Two', 1, 1, 1, 1, 0, 0, 1, 2, 13),
(3, 'Warehouse Three', 1, 1, 1, 1, 0, 0, 0, 2, 1),
(4, 'Warehouse Four', 1, 1, 1, 1, 0, 0, 0, 2, 1),
(5, 'Warehouse Five', 1, 1, 1, 1, 0, 0, 0, 2, 1);
(1, 'Warehouse One', 'ALG', 1, 1, 1, 1, 1, 1, 1, 2, 1),
(2, 'Warehouse Two', NULL, 1, 1, 1, 1, 0, 0, 1, 2, 13),
(3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1),
(4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1),
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1);
INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPreparedByPacking`, `code`, `pickingPlacement`, `path`)
VALUES
@ -459,6 +459,19 @@ INSERT INTO `vn`.`company`(`id`, `code`, `supplierAccountFk`, `workerManagerFk`,
(791 , 'FTH', NULL, 30, NULL, 3, '2015-11-30', NULL),
(1381, 'ORN', NULL, 30, NULL, 7, NULL, 'ORN Company - Plant passport');
INSERT INTO `vn`.`taxArea` (`code`, `claveOperacionFactura`, `CodigoTransaccion`)
VALUES
('CEE', 1, 10),
('EQU', 0, 1),
('NATIONAL', 0, 1),
('WORLD', 2, 15);
INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaFk`, `isCEE`)
VALUES
('A', 'Global nacional', 1, 'NATIONAL', 0),
('T', 'Española rapida', 1, 'NATIONAL', 0),
('V', 'Intracomunitaria global', 0, 'CEE', 1);
INSERT INTO `vn`.`invoiceOut`(`id`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `hasPdf`)
VALUES
(1, 'T', 1014.24, CURDATE(), 101, CURDATE(), 442, CURDATE(), CURDATE(), 1, 1),
@ -504,19 +517,6 @@ INSERT INTO `vn`.`invoiceOutExpence`(`id`, `invoiceOutFk`, `amount`, `expenceFk`
(6, 4, 8.07, 2000000000, CURDATE()),
(7, 5, 8.07, 2000000000, CURDATE());
INSERT INTO `vn`.`taxArea` (`code`, `claveOperacionFactura`, `CodigoTransaccion`)
VALUES
('CEE', 1, 10),
('EQU', 0, 1),
('NATIONAL', 0, 1),
('WORLD', 2, 15);
INSERT INTO `vn`.`invoiceOutSerial` (`code`, `description`, `isTaxed`, `taxAreaFk`, `isCEE`)
VALUES
('A', 'Global nacional', 1, 'NATIONAL', 0),
('T', 'Española rapida', 1, 'NATIONAL', 0),
('V', 'Intracomunitaria global', 0, 'CEE', 1);
INSERT INTO `vn`.`zone` (`id`, `name`, `hour`, `agencyModeFk`, `travelingDays`, `price`, `bonus`, `m3Max`)
VALUES
(1, 'Zone pickup A', CONCAT(CURRENT_DATE(), ' ', TIME('23:59')), 1, 0, 0, 0, 30.50),
@ -774,6 +774,12 @@ INSERT INTO `vn`.`intrastat`(`id`, `description`, `taxClassFk`, `taxCodeFk`)
(05080000, 'Coral y materiales similares', 2, 2),
(06021010, 'Plantas vivas: Esqueje/injerto, Vid', 1, 1);
INSERT INTO `vn`.`itemFamily`(`code`, `description`)
VALUES
('EMB', 'Packagings'),
('SER', 'Services'),
('VT', 'Sales');
INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `isOnOffer`, `expenceFk`, `isBargain`, `comment`, `relevancy`, `image`, `taxClassFk`, `subName`, `minPrice`, `stars`, `family`)
VALUES
(1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 0, 2000000000, 0, NULL, 0, '1', 1, NULL, 0, 1, 'VT'),
@ -2250,10 +2256,6 @@ INSERT INTO `vn`.`campaign`(`code`, `dated`)
('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -2 YEAR)), '-11-01')),
('allSaints', CONCAT(YEAR(DATE_ADD(CURDATE(), INTERVAL -3 YEAR)), '-11-01'));
INSERT INTO `hedera`.`image`(`collectionFk`, `name`)
VALUES
('user', '4fa3ada0-3ac4-11eb-9ab8-27f6fc3b85fd');
INSERT INTO `hedera`.`imageCollectionSize`(`id`, `collectionFk`,`width`, `height`)
VALUES
(1, 4, 160, 160);

File diff suppressed because it is too large Load Diff

View File

@ -59,6 +59,7 @@ TABLES=(
component
componentType
continent
volumeConfig
)
dump_tables ${TABLES[@]}

View File

@ -892,7 +892,7 @@ export default {
penultimateMondayOfJanuary: 'vn-worker-calendar vn-calendar:nth-child(2) section:nth-child(22) > div',
lastMondayOfMarch: 'vn-worker-calendar vn-calendar:nth-child(4) section:nth-child(29) > div',
fistMondayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(8) > div',
secondFridayOfJun: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(12) > div',
secondFridayOfJun: 'vn-worker-calendar vn-calendar:nth-child(7) section:nth-child(12) > div',
secondTuesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(16) > div',
secondWednesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(17) > div',
secondThursdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(18) > div',

View File

@ -75,7 +75,7 @@ describe('Ticket Edit basic data path', () => {
const result = await page
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
expect(result).toContain('-€248.00');
expect(result).toContain('-€232.75');
});
it(`should select a new reason for the changes made then click on finalize`, async() => {

View File

@ -80,7 +80,7 @@ describe('Account create and basic data path', () => {
await page.reloadSection('account.card.roles');
const rolesCount = await page.countElement(selectors.accountRoles.anyResult);
expect(rolesCount).toEqual(34);
expect(rolesCount).toEqual(35);
});
});

View File

@ -71,7 +71,7 @@
vn-repeat-last on-last="$ctrl.focusLastInput()">
<vn-td number>
<span
ng-click="descriptor.show($event, saleClaimed.sale.itemFk)"
ng-click="itemDescriptor.show($event, saleClaimed.sale.itemFk)"
class="link">
{{::saleClaimed.sale.itemFk | zeroFill:6}}
</span>
@ -154,10 +154,11 @@
</div>
</vn-popover>
<vn-item-descriptor-popover
vn-id="descriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticketDescriptor">
vn-id="ticket-descriptor">
</vn-ticket-descriptor-popover>
<vn-confirm
vn-id="update-greuge"

View File

@ -129,7 +129,8 @@
</tpl-body>
</vn-dialog>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-popover
class="edit"

View File

@ -220,11 +220,12 @@
</vn-horizontal>
</vn-card>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticketDescriptor">
vn-id="ticket-descriptor">
</vn-ticket-descriptor-popover>

View File

@ -82,7 +82,8 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="item-descriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticket-descriptor">

View File

@ -202,7 +202,8 @@
</vn-vertical>
</div>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-confirm

View File

@ -195,8 +195,9 @@
</tpl-buttons>
</vn-dialog>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-entry-descriptor-popover
vn-id="entryDescriptor">
vn-id="entry-descriptor">
</vn-entry-descriptor-popover>

View File

@ -160,9 +160,10 @@
</vn-horizontal>
</vn-card>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-travel-descriptor-popover
vn-id="travelDescriptor">
vn-id="travel-descriptor">
</vn-travel-descriptor-popover>

View File

@ -1,5 +1,5 @@
module.exports = Self => {
Self.remoteMethod('getSummary', {
Self.remoteMethodCtx('getSummary', {
description: 'return the item information',
accessType: 'READ',
accepts: [{
@ -19,7 +19,7 @@ module.exports = Self => {
}
});
Self.getSummary = async id => {
Self.getSummary = async(ctx, id) => {
let promises = [];
let summary = {};
const models = Self.app.models;
@ -102,7 +102,9 @@ module.exports = Self => {
[summary.botanical] = res[2];
summary.niches = res[3];
res = await models.Item.getVisibleAvailable(summary.item.id, summary.item.itemType().warehouseFk);
const userConfig = await models.UserConfig.getUserConfig(ctx);
res = await models.Item.getVisibleAvailable(summary.item.id, userConfig.warehouseFk);
summary.available = res.available;
summary.visible = res.visible;

View File

@ -2,7 +2,8 @@ const app = require('vn-loopback/server/server');
describe('item getSummary()', () => {
it('should return summary with item, tags, botanical, niches, available and visible defined ', async() => {
let result = await app.models.Item.getSummary(1);
const ctx = {req: {accessToken: {userId: 1}}};
let result = await app.models.Item.getSummary(ctx, 1);
let keys = Object.keys(result);
expect(keys).toContain('item');

View File

@ -1,5 +1,8 @@
<vn-portal slot="menu">
<vn-item-descriptor item="$ctrl.item" card-reload="$ctrl.reload()"></vn-item-descriptor>
<vn-item-descriptor
warehouse-fk="$ctrl.vnConfig.warehouseFk"
item="$ctrl.item"
card-reload="$ctrl.reload()"></vn-item-descriptor>
<vn-left-menu source="card"></vn-left-menu>
</vn-portal>
<ui-view></ui-view>

View File

@ -21,7 +21,16 @@ class Controller extends Descriptor {
set entity(value) {
super.entity = value;
this.updateStock();
if (this.warehouseFk) this.updateStock();
}
get warehouseFk() {
return this._warehouseFk;
}
set warehouseFk(value) {
this._warehouseFk = value;
if (value) this.updateStock();
}
loadData() {
@ -35,7 +44,7 @@ class Controller extends Descriptor {
if (!this.item) return;
const params = {
warehouseFk: this.item.itemType.warehouseFk,
warehouseFk: this.warehouseFk,
dated: this.dated
};
@ -90,6 +99,7 @@ ngModule.vnComponent('vnItemDescriptor', {
bindings: {
item: '<',
dated: '<',
cardReload: '&'
cardReload: '&',
warehouseFk: '<?'
}
});

View File

@ -155,5 +155,6 @@
</vn-card>
</div>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>

View File

@ -112,10 +112,11 @@
<vn-float-button icon="add"></vn-float-button>
</a>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<vn-confirm
vn-id="clone"

View File

@ -107,13 +107,14 @@
</vn-card>
</vn-data-viewer>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticketDescriptor">
vn-id="ticket-descriptor">
</vn-ticket-descriptor-popover>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-dialog
vn-id="denyDialog"

View File

@ -23,7 +23,7 @@
<vn-tr ng-repeat="waste in detail.lines">
<vn-td shrink>
<span
ng-click="descriptor.show($event, waste.itemFk)"
ng-click="itemDescriptor.show($event, waste.itemFk)"
class="link">
{{::waste.itemFk}}
</span>
@ -38,5 +38,6 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="descriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>

View File

@ -41,7 +41,7 @@ describe('SalesMonitor salesFilter()', () => {
const filter = {};
const result = await app.models.SalesMonitor.salesFilter(ctx, filter);
expect(result.length).toEqual(7);
expect(result.length).toEqual(6);
});
it('should return the tickets matching the problems on null', async() => {

View File

@ -63,9 +63,10 @@
</vn-horizontal>
</vn-data-viewer>
<vn-order-prices-popover
vn-id="pricesPopover"
vn-id="prices-popover"
order="$ctrl.order">
</vn-order-prices-popover>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>

View File

@ -37,7 +37,7 @@
on-error-src/>
</vn-td>
<vn-td number>
<span ng-click="descriptor.show($event, row.itemFk)"
<span ng-click="itemDescriptor.show($event, row.itemFk)"
class="link">
{{::row.itemFk | zeroFill:6}}
</span>
@ -83,7 +83,8 @@
fixed-bottom-right>
</vn-float-button>
<vn-item-descriptor-popover
vn-id="descriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-confirm
vn-id="delete-row"

View File

@ -93,7 +93,7 @@
</vn-td>
<vn-td shrink>
<span
ng-click="descriptor.show($event, row.itemFk)"
ng-click="itemDescriptor.show($event, row.itemFk)"
class="link">
{{::row.itemFk | zeroFill:6}}
</span>
@ -119,8 +119,9 @@
</vn-horizontal>
</vn-card>
<vn-item-descriptor-popover
vn-id="descriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
<vn-client-descriptor-popover
vn-id="clientDescriptor">
vn-id="client-descriptor">
</vn-client-descriptor-popover>

View File

@ -34,7 +34,7 @@
<vn-tr ng-repeat="row in rows">
<vn-td shrink number>
<span
ng-click="descriptor.show($event, row.itemFk)"
ng-click="itemDescriptor.show($event, row.itemFk)"
class="link">
{{::row.itemFk}}
</span>
@ -58,6 +58,7 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="descriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>

View File

@ -41,7 +41,7 @@ describe('ticket filter()', () => {
const filter = {};
const result = await app.models.Ticket.filter(ctx, filter);
expect(result.length).toEqual(7);
expect(result.length).toEqual(6);
});
it('should return the tickets matching the problems on null', async() => {

View File

@ -24,7 +24,7 @@
<tr class="initial">
<td rowspan="{{::sale.components.length + 1}}" number>
<span
ng-click="descriptor.show($event, sale.itemFk, sale.id)"
ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"
class="link">
{{sale.itemFk | zeroFill:6}}
</span>
@ -103,11 +103,11 @@
</div>
</vn-side-menu>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>
<vn-zone-descriptor-popover
vn-id="zoneDescriptor">
vn-id="zone-descriptor">
</vn-zone-descriptor-popover>

View File

@ -57,15 +57,15 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="itemDescriptor"
warehouse-fk="this.ticket.warehouseFk",
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<vn-confirm
vn-id="deleteExpedition"
vn-id="delete-expedition"
on-accept="$ctrl.onDialogAccept($data)"
question="Delete expedition"
message="Are you sure you want to delete this expedition?">

View File

@ -25,7 +25,7 @@
</div>
<div class="description">
<h3>
<span class="link" ng-click="descriptor.show($event, sale.item.id)">
<span class="link" ng-click="itemDescriptor.show($event, sale.item.id)">
{{::sale.item.name}}
</span>
</h3>
@ -63,5 +63,6 @@
<vn-pagination model="model"></vn-pagination>
</vn-vertical>
<vn-item-descriptor-popover
vn-id="descriptor">
</vn-item-descriptor-popover>
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>

View File

@ -17,5 +17,8 @@ class Controller extends Section {
ngModule.vnComponent('vnTicketPicture', {
template: require('./index.html'),
controller: Controller
controller: Controller,
bindings: {
ticket: '<'
}
});

View File

@ -24,7 +24,7 @@
<vn-th>Atender</vn-th>
<vn-th number>Quantity</vn-th>
<vn-th number>Price</vn-th>
<vn-th number>Sale id</vn-th>
<vn-th number>Item id</vn-th>
<vn-th number>Ok</vn-th>
</vn-tr>
</vn-thead>
@ -101,10 +101,11 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="itemDescriptor">
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>
<a ui-sref="ticket.card.request.create"
vn-tooltip="New request"

View File

@ -70,5 +70,8 @@ class Controller extends Section {
ngModule.vnComponent('vnTicketRequestIndex', {
template: require('./index.html'),
controller: Controller
controller: Controller,
bindings: {
ticket: '<'
}
});

View File

@ -37,17 +37,20 @@
"abstract": true,
"component": "vn-ticket",
"description": "Tickets"
}, {
},
{
"url": "/index?q",
"state": "ticket.index",
"component": "vn-ticket-index",
"description": "Tickets"
}, {
},
{
"url": "/:id?sendSMS&phone&message",
"state": "ticket.card",
"abstract": true,
"component": "vn-ticket-card"
}, {
},
{
"url": "/summary",
"state": "ticket.card.summary",
"component": "vn-ticket-summary",
@ -55,7 +58,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/basic-data",
"state": "ticket.card.basicData",
"component": "vn-ticket-basic-data",
@ -63,7 +67,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/step-one",
"state": "ticket.card.basicData.stepOne",
"component": "vn-ticket-basic-data-step-one",
@ -71,7 +76,8 @@
"params": {
"ticket": "$ctrl.data"
}
}, {
},
{
"url" : "/step-two",
"state": "ticket.card.basicData.stepTwo",
"component": "vn-ticket-basic-data-step-two",
@ -79,7 +85,8 @@
"params": {
"ticket": "$ctrl.data"
}
}, {
},
{
"url" : "/sale",
"state": "ticket.card.sale",
"component": "vn-ticket-sale",
@ -87,7 +94,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url": "/observation",
"state": "ticket.card.observation",
"component": "vn-ticket-observation",
@ -95,7 +103,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url": "/volume",
"state": "ticket.card.volume",
"component": "vn-ticket-volume",
@ -103,7 +112,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url": "/expedition",
"state": "ticket.card.expedition",
"component": "vn-ticket-expedition",
@ -111,7 +121,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/package",
"state": "ticket.card.package",
"component": "vn-ticket-package",
@ -119,12 +130,14 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url": "/tracking",
"state": "ticket.card.tracking",
"abstract": true,
"component": "ui-view"
}, {
},
{
"url" : "/index",
"state": "ticket.card.tracking.index",
"component": "vn-ticket-tracking-index",
@ -132,7 +145,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url": "/edit",
"state": "ticket.card.tracking.edit",
"component": "vn-ticket-tracking-edit",
@ -141,7 +155,8 @@
"ticket": "$ctrl.ticket"
},
"acl": ["production", "administrative", "salesPerson"]
}, {
},
{
"url" : "/sale-checked",
"state": "ticket.card.saleChecked",
"component": "vn-ticket-sale-checked",
@ -149,7 +164,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/components",
"state": "ticket.card.components",
"component": "vn-ticket-components",
@ -157,7 +173,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/sale-tracking",
"state": "ticket.card.saleTracking",
"component": "vn-ticket-sale-tracking",
@ -165,7 +182,8 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/picture",
"state": "ticket.card.picture",
"component": "vn-ticket-picture",
@ -173,43 +191,54 @@
"params": {
"ticket": "$ctrl.ticket"
}
}, {
},
{
"url" : "/log",
"state": "ticket.card.log",
"component": "vn-ticket-log",
"description": "Log"
}, {
},
{
"url": "/weekly",
"state": "ticket.weekly",
"abstract": true,
"component": "ui-view",
"description": "Weekly"
}, {
},
{
"url": "/index?q",
"state": "ticket.weekly.index",
"component": "vn-ticket-weekly-index",
"description": "Weekly tickets"
}, {
},
{
"url": "/service",
"state": "ticket.card.service",
"component": "vn-ticket-service",
"description": "Service"
}, {
},
{
"url": "/request",
"state": "ticket.card.request",
"abstract": true,
"component": "ui-view"
}, {
},
{
"url" : "/index",
"state": "ticket.card.request.index",
"component": "vn-ticket-request-index",
"description": "Purchase request"
}, {
"description": "Purchase request",
"params": {
"ticket": "$ctrl.ticket"
}
},
{
"url" : "/create",
"state": "ticket.card.request.create",
"component": "vn-ticket-request-create",
"description": "New purchase request"
}, {
},
{
"url": "/create?clientFk",
"state": "ticket.create",
"component": "vn-ticket-create",

View File

@ -29,7 +29,7 @@
</vn-td>
<vn-td number>
<span
ng-click="$ctrl.showDescriptor($event, sale)"
ng-click="$ctrl.showItemDescriptor($event, sale)"
class="link">
{{::sale.itemFk | zeroFill:6}}
</span>
@ -52,7 +52,7 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk"
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>

View File

@ -17,7 +17,7 @@ class Controller extends Section {
]
};
}
showDescriptor(event, sale) {
showItemDescriptor(event, sale) {
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
@ -29,7 +29,7 @@ class Controller extends Section {
tooltip: 'Item diary'
}
};
this.$.descriptor.show(event.target, sale.itemFk);
this.$.itemDescriptor.show(event.target, sale.itemFk);
}
}

View File

@ -67,9 +67,9 @@
</vn-card>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="itemDescriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
vn-id="worker-descriptor">
</vn-worker-descriptor-popover>

View File

@ -122,7 +122,7 @@
</vn-td>
<vn-td shrink>
<span class="link" ng-if="sale.id"
ng-click="descriptor.show($event, sale.itemFk, sale.id)">
ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)">
{{sale.itemFk}}
</span>
<vn-autocomplete ng-if="!sale.id" class="dense"
@ -212,7 +212,7 @@
fixed-bottom-right>
</vn-float-button>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>

View File

@ -165,7 +165,7 @@
</vn-td>
<vn-td number shrink>
<span
ng-click="descriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)"
ng-click="itemDescriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)"
class="link">
{{sale.itemFk | zeroFill:6}}
</span>
@ -288,7 +288,7 @@
<vn-td number>
<span
ng-show="::request.saleFk"
ng-click="descriptor.show($event, request.sale.itemFk, request.sale.id)"
ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)"
class="link">
{{request.sale.itemFk | zeroFill:6}}
</span>
@ -308,10 +308,10 @@
</vn-horizontal>
</vn-card>
<vn-route-descriptor-popover
vn-id="routeDescriptor">
vn-id="route-descriptor">
</vn-route-descriptor-popover>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk",
ticket-fk="$ctrl.ticket.id">
</vn-item-descriptor-popover>

View File

@ -37,7 +37,7 @@
<vn-tr ng-repeat="sale in $ctrl.sales">
<vn-td number>
<span
ng-click="descriptor.show($event, sale.itemFk, sale.id)"
ng-click="itemDescriptor.show($event, sale.itemFk, sale.id)"
class="link">
{{sale.itemFk | zeroFill:6}}
</span>
@ -63,7 +63,7 @@
</vn-card>
</vn-vertical>
<vn-item-descriptor-popover
vn-id="descriptor"
vn-id="item-descriptor"
warehouse-fk="$ctrl.ticket.warehouseFk">
</vn-item-descriptor-popover>

View File

@ -12,4 +12,4 @@ claim: Reclamación {0}
sections:
agency:
description: 'Para agilizar su recogida, por favor, póngase en contacto con la oficina
de integrados. <br/> Tlf: 96 166 77 88 - Ana Gómez (Ext. 2113) <em>(agomez@integra2.com)</em>'
de integrados. <br/> Tlf: 96 166 77 88 - Ana Gómez (Ext. 2113) <em>(agomezf@integra2.com)</em>'