3372-ticket_sale multi-check for recalculatePrice #811

Merged
carlosjr merged 7 commits from 3372-ticket_sale into dev 2021-12-01 12:55:56 +00:00
23 changed files with 319 additions and 51 deletions
Showing only changes of commit 85721dcf45 - Show all commits

View File

@ -0,0 +1,33 @@
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=96;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=95;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=115;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=123;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=94;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=101;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=80;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=125;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=98;
UPDATE vn.department
SET notificationEmail='direccioncomercial@verdnatura.es'
WHERE id=92;
UPDATE vn.department
SET notificationEmail=''
WHERE id=43;

View File

@ -796,25 +796,26 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`)
('SER', 'Services'), ('SER', 'Services'),
('VT', 'Sales'); ('VT', 'Sales');
INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`, `comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`) INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`,
`comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`)
VALUES VALUES
(1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0), (1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'VT', 0, NULL),
(2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0), (2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL),
(3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0), (3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL),
(4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0), (4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL),
(5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0), (5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL),
(6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0), (6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL),
(7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0), (7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL),
(8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0), (8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL),
(9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1), (9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL),
(10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0), (10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL),
(11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0), (11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL),
(12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0), (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL),
(13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT', 1), (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT', 1, NULL),
(14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1), (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL),
(15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0), (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL),
(16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0), (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL),
(71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0); (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL);
-- Update the taxClass after insert of the items -- Update the taxClass after insert of the items
UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2
@ -2419,3 +2420,6 @@ INSERT INTO `vn`.`expeditionScan` (`id`, `expeditionFk`, `scanned`, `palletFk`)
(10, 10, CURDATE(), 1); (10, 10, CURDATE(), 1);
CALL `cache`.`last_buy_refresh`(FALSE); CALL `cache`.`last_buy_refresh`(FALSE);
UPDATE `vn`.`item` SET `genericFk` = 9
WHERE `id` = 2;

View File

@ -27,7 +27,7 @@ export async function getBrowser() {
args, args,
defaultViewport: null, defaultViewport: null,
headless: headless, headless: headless,
slowMo: 5, // slow down by ms slowMo: 1, // slow down by ms
// ignoreDefaultArgs: ['--disable-extensions'], // ignoreDefaultArgs: ['--disable-extensions'],
// executablePath: '/usr/bin/google-chrome-stable', // executablePath: '/usr/bin/google-chrome-stable',
// executablePath: '/usr/bin/firefox-developer-edition', // executablePath: '/usr/bin/firefox-developer-edition',

View File

@ -382,6 +382,7 @@ export default {
relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]', relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]',
origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]', origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
compression: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.compression"]', compression: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.compression"]',
generic: 'vn-autocomplete[ng-model="$ctrl.item.genericFk"]',
isFragile: 'vn-check[ng-model="$ctrl.item.isFragile"]', isFragile: 'vn-check[ng-model="$ctrl.item.isFragile"]',
longName: 'vn-textfield[ng-model="$ctrl.item.longName"]', longName: 'vn-textfield[ng-model="$ctrl.item.longName"]',
isActiveCheckbox: 'vn-check[label="Active"]', isActiveCheckbox: 'vn-check[label="Active"]',

View File

@ -23,15 +23,17 @@ describe('Item Edit basic data path', () => {
it(`should edit the item basic data`, async() => { it(`should edit the item basic data`, async() => {
await page.clearInput(selectors.itemBasicData.name); await page.clearInput(selectors.itemBasicData.name);
await page.write(selectors.itemBasicData.name, 'Rose of Purity'); await page.write(selectors.itemBasicData.name, 'Rose of Purity');
await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium');
await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares');
await page.clearInput(selectors.itemBasicData.relevancy);
await page.write(selectors.itemBasicData.relevancy, '1');
await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain');
await page.clearInput(selectors.itemBasicData.compression);
await page.write(selectors.itemBasicData.compression, '2');
await page.clearInput(selectors.itemBasicData.longName); await page.clearInput(selectors.itemBasicData.longName);
await page.write(selectors.itemBasicData.longName, 'RS Rose of Purity'); await page.write(selectors.itemBasicData.longName, 'RS Rose of Purity');
await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium');
await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain');
await page.clearInput(selectors.itemBasicData.relevancy);
await page.write(selectors.itemBasicData.relevancy, '1');
await page.clearInput(selectors.itemBasicData.compression);
await page.write(selectors.itemBasicData.compression, '2');
await page.clearInput(selectors.itemBasicData.generic);
await page.autocompleteSearch(selectors.itemBasicData.generic, '16');
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox); await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox); await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox);
await page.waitToClick(selectors.itemBasicData.isFragile); await page.waitToClick(selectors.itemBasicData.isFragile);
@ -101,6 +103,13 @@ describe('Item Edit basic data path', () => {
expect(result).toEqual('2'); expect(result).toEqual('2');
}); });
it(`should confirm the item generic was edited`, async() => {
const result = await page
.waitToGetProperty(selectors.itemBasicData.generic, 'value');
expect(result).toEqual('16 - Pallet');
});
it(`should confirm the item long name was edited`, async() => { it(`should confirm the item long name was edited`, async() => {
const result = await page const result = await page
.waitToGetProperty(selectors.itemBasicData.longName, 'value'); .waitToGetProperty(selectors.itemBasicData.longName, 'value');

View File

@ -129,13 +129,13 @@
.icon-columndelete:before { .icon-columndelete:before {
content: "\e91d"; content: "\e91d";
} }
.icon-complementos:before { .icon-accessory:before {
content: "\e91e"; content: "\e91e";
} }
.icon-components:before { .icon-components:before {
content: "\e91f"; content: "\e91f";
} }
.icon-confeccion:before { .icon-handmade:before {
content: "\e920"; content: "\e920";
} }
.icon-consignatarios:before { .icon-consignatarios:before {
@ -180,7 +180,7 @@
.icon-fixedPrice:before { .icon-fixedPrice:before {
content: "\e92e"; content: "\e92e";
} }
.icon-flor:before { .icon-flower:before {
content: "\e92f"; content: "\e92f";
} }
.icon-frozen:before { .icon-frozen:before {
@ -207,7 +207,7 @@
.icon-history:before { .icon-history:before {
content: "\e937"; content: "\e937";
} }
.icon-Inactivo:before { .icon-disabled:before {
content: "\e938"; content: "\e938";
} }
.icon-info:before { .icon-info:before {
@ -285,7 +285,7 @@
.icon-photo:before { .icon-photo:before {
content: "\e951"; content: "\e951";
} }
.icon-planta:before { .icon-plant:before {
content: "\e952"; content: "\e952";
} }
.icon-stowaway:before { .icon-stowaway:before {
@ -300,13 +300,13 @@
.icon-regentry:before { .icon-regentry:before {
content: "\e956"; content: "\e956";
} }
.icon-reserva:before { .icon-reserve:before {
content: "\e957"; content: "\e957";
} }
.icon-revision:before { .icon-revision:before {
content: "\e958"; content: "\e958";
} }
.icon-riesgo:before { .icon-risk:before {
content: "\e959"; content: "\e959";
} }
.icon-services:before { .icon-services:before {
@ -372,7 +372,7 @@
.icon-unavailable:before { .icon-unavailable:before {
content: "\e96e"; content: "\e96e";
} }
.icon-verde:before { .icon-greenery:before {
content: "\e96f"; content: "\e96f";
} }
.icon-volume:before { .icon-volume:before {

View File

@ -82,7 +82,7 @@
<vn-quick-link <vn-quick-link
tooltip="Client invoices list" tooltip="Client invoices list"
state="['invoiceOut.index', {q: $ctrl.filter}]" state="['invoiceOut.index', {q: $ctrl.filter}]"
icon="icon-invoices"> icon="icon-invoice">
</vn-quick-link> </vn-quick-link>
</div> </div>
<div ng-transclude="btnThree"> <div ng-transclude="btnThree">

View File

@ -16,7 +16,7 @@
{"state": "client.card.note.index", "icon": "insert_drive_file"}, {"state": "client.card.note.index", "icon": "insert_drive_file"},
{"state": "client.card.credit.index", "icon": "credit_card"}, {"state": "client.card.credit.index", "icon": "credit_card"},
{"state": "client.card.greuge.index", "icon": "work"}, {"state": "client.card.greuge.index", "icon": "work"},
{"state": "client.card.balance.index", "icon": "icon-invoices"}, {"state": "client.card.balance.index", "icon": "icon-invoice"},
{"state": "client.card.recovery.index", "icon": "icon-recovery"}, {"state": "client.card.recovery.index", "icon": "icon-recovery"},
{"state": "client.card.webAccess", "icon": "cloud"}, {"state": "client.card.webAccess", "icon": "cloud"},
{"state": "client.card.log", "icon": "history"}, {"state": "client.card.log", "icon": "history"},

View File

@ -113,7 +113,6 @@
<vn-dialog <vn-dialog
vn-id="filterDialog" vn-id="filterDialog"
on-accept="$ctrl.addTime()"
message="Filter item"> message="Filter item">
<tpl-body class="itemFilter"> <tpl-body class="itemFilter">
<vn-horizontal> <vn-horizontal>

View File

@ -133,7 +133,7 @@ class Controller extends Section {
case 'producerFk': case 'producerFk':
case 'typeFk': case 'typeFk':
case 'size': case 'size':
case 'ink': case 'inkFk':
where[key] = value; where[key] = value;
} }
} }

View File

@ -176,6 +176,11 @@
"model": "Expense", "model": "Expense",
"foreignKey": "expenseFk" "foreignKey": "expenseFk"
}, },
"generic": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "genericFk"
},
"tags": { "tags": {
"type": "hasMany", "type": "hasMany",
"model": "ItemTag", "model": "ItemTag",

View File

@ -137,6 +137,29 @@
ng-model="$ctrl.item.compression" ng-model="$ctrl.item.compression"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-autocomplete
vn-one
label="Generic"
url="Items/withName"
ng-model="$ctrl.item.genericFk"
show-field="name"
value-field="id"
search-function="$ctrl.itemSearchFunc($search)"
order="id DESC"
tabindex="1">
<tpl-item>
{{::id}} - {{::name}}
</tpl-item>
<append>
<vn-icon-button
icon="filter_alt"
vn-click-stop="$ctrl.showFilterDialog($ctrl.item)"
vn-tooltip="Filter...">
</vn-icon-button>
</append>
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textarea <vn-textarea
vn-one vn-one
label="Description" label="Description"
@ -203,3 +226,92 @@
<button response="accept" translate>Create</button> <button response="accept" translate>Create</button>
</tpl-buttons> </tpl-buttons>
</vn-dialog> </vn-dialog>
<!-- Filter item dialog -->
<vn-dialog
vn-id="filterDialog"
message="Filter item">
<tpl-body class="itemFilter">
<vn-horizontal>
<vn-textfield
label="Name"
ng-model="$ctrl.itemFilterParams.name"
vn-focus>
</vn-textfield>
<vn-textfield
label="Size"
ng-model="$ctrl.itemFilterParams.size">
</vn-textfield>
<vn-autocomplete
label="Producer"
ng-model="$ctrl.itemFilterParams.producerFk"
url="Producers"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Type"
ng-model="$ctrl.itemFilterParams.typeFk"
url="ItemTypes"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Color"
ng-model="$ctrl.itemFilterParams.inkFk"
url="Inks"
show-field="name"
value-field="id">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal class="vn-mb-md">
<vn-button vn-none
label="Search"
ng-click="$ctrl.filter()">
</vn-button>
</vn-horizontal>
<vn-crud-model
vn-id="itemsModel"
url="Items/withName"
filter="$ctrl.itemFilter"
data="items"
limit="10">
</vn-crud-model>
<vn-data-viewer
model="itemsModel"
class="vn-w-lg">
<vn-table class="scrollable">
<vn-thead>
<vn-tr>
<vn-th shrink>ID</vn-th>
<vn-th expand>Item</vn-th>
<vn-th number>Size</vn-th>
<vn-th expand>Producer</vn-th>
<vn-th>Color</vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<a ng-repeat="item in items"
class="clickable vn-tr search-result"
ng-click="$ctrl.selectItem(item.id)">
<vn-td shrink>
<span
ng-click="itemDescriptor.show($event, item.id)"
class="link">
{{::item.id}}
</span>
</vn-td>
<vn-td expand>{{::item.name}}</vn-td>
<vn-td number>{{::item.size}}</vn-td>
<vn-td expand>{{::item.producer.name}}</vn-td>
<vn-td>{{::item.ink.name}}</vn-td>
</a>
</vn-tbody>
</vn-table>
</vn-data-viewer>
<vn-item-descriptor-popover
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-item-descriptor-popover>
</tpl-body>
</vn-dialog>

View File

@ -17,6 +17,65 @@ class Controller extends Section {
return this.$http.patch(query, this.newIntrastat) return this.$http.patch(query, this.newIntrastat)
.then(res => this.item.intrastatFk = res.data.id); .then(res => this.item.intrastatFk = res.data.id);
} }
itemSearchFunc($search) {
return /^\d+$/.test($search)
? {id: $search}
: {name: {like: '%' + $search + '%'}};
}
showFilterDialog(item) {
this.activeItem = item;
this.itemFilterParams = {};
this.itemFilter = {
include: [
{
relation: 'producer',
scope: {
fields: ['name']
}
},
{
relation: 'ink',
scope: {
fields: ['name']
}
}
]
};
this.$.filterDialog.show();
}
selectItem(id) {
this.activeItem['genericFk'] = id;
this.$.filterDialog.hide();
}
filter() {
const filter = this.itemFilter;
const params = this.itemFilterParams;
const where = {};
for (let key in params) {
const value = params[key];
if (!value) continue;
switch (key) {
case 'name':
where[key] = {like: `%${value}%`};
break;
case 'producerFk':
case 'typeFk':
case 'size':
case 'inkFk':
where[key] = value;
}
}
filter.where = where;
this.$.itemsModel.applyFilter(filter);
}
} }
ngModule.vnComponent('vnItemBasicData', { ngModule.vnComponent('vnItemBasicData', {

View File

@ -11,3 +11,4 @@ Identifier: Identificador
Fragile: Frágil Fragile: Frágil
Is shown at website, app that this item cannot travel (wreath, palms, ...): Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...) Is shown at website, app that this item cannot travel (wreath, palms, ...): Se muestra en la web, app que este artículo no puede viajar (coronas, palmas, ...)
Multiplier: Multiplicador Multiplier: Multiplicador
Generic: Genérico

View File

@ -55,7 +55,13 @@ module.exports = Self => {
{ {
relation: 'address', relation: 'address',
scope: { scope: {
fields: ['id', 'street', 'postalCode', 'city'], fields: ['street', 'city', 'provinceFk', 'phone', 'nickname', 'postalCode'],
include: {
relation: 'province',
scope: {
fields: ['name']
}
}
} }
}, },
] ]

View File

@ -142,10 +142,15 @@
</vn-th> </vn-th>
<vn-th number>Ticket</vn-th> <vn-th number>Ticket</vn-th>
<vn-th>Client</vn-th> <vn-th>Client</vn-th>
<vn-th number shrink>Packages</vn-th> <vn-th shrink>Province</vn-th>
<vn-th shrink>Warehouse</vn-th> <vn-th shrink>
<vn-th expand>Postcode</vn-th> <span translate>
Population
</span>
</vn-th>
<vn-th expand>PC</vn-th>
<vn-th>Address</vn-th> <vn-th>Address</vn-th>
<vn-th shrink>Warehouse</vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
@ -165,10 +170,11 @@
{{::ticket.nickname}} {{::ticket.nickname}}
</span> </span>
</vn-td> </vn-td>
<vn-td number shrink>{{::ticket.packages}}</vn-td> <vn-td shrink>{{::ticket.address.province.name}}</vn-td>
<vn-td expand>{{::ticket.warehouse.name}}</vn-td> <vn-td shrink>{{::ticket.address.city}}</vn-td>
<vn-td number shrink>{{::ticket.address.postalCode}}</vn-td> <vn-td number shrink>{{::ticket.address.postalCode}}</vn-td>
<vn-td expand title="{{::ticket.address.street}}">{{::ticket.address.street}}</vn-td> <vn-td expand title="{{::ticket.address.street}}">{{::ticket.address.street}}</vn-td>
<vn-td expand>{{::ticket.warehouse.name}}</vn-td>
</vn-tr> </vn-tr>
</vn-tbody> </vn-tbody>
</vn-table> </vn-table>

View File

@ -11,3 +11,4 @@ The selected ticket is not suitable for this route: El ticket seleccionado no es
PC: CP PC: CP
The route's vehicle doesn't have a departing warehouse: El vehículo de la ruta no tiene un almacén de salida The route's vehicle doesn't have a departing warehouse: El vehículo de la ruta no tiene un almacén de salida
The route doesn't have a vehicle: La ruta no tiene un vehículo The route doesn't have a vehicle: La ruta no tiene un vehículo
Population: Población

View File

@ -13,7 +13,7 @@
{"state": "supplier.card.fiscalData", "icon": "account_balance"}, {"state": "supplier.card.fiscalData", "icon": "account_balance"},
{"state": "supplier.card.billingData", "icon": "icon-payment"}, {"state": "supplier.card.billingData", "icon": "icon-payment"},
{"state": "supplier.card.address.index", "icon": "icon-delivery"}, {"state": "supplier.card.address.index", "icon": "icon-delivery"},
{"state": "supplier.card.account", "icon": "icon-accounts"}, {"state": "supplier.card.account", "icon": "icon-account"},
{"state": "supplier.card.contact", "icon": "contact_phone"}, {"state": "supplier.card.contact", "icon": "contact_phone"},
{"state": "supplier.card.log", "icon": "history"}, {"state": "supplier.card.log", "icon": "history"},
{"state": "supplier.card.consumption", "icon": "show_chart"} {"state": "supplier.card.consumption", "icon": "show_chart"}

View File

@ -167,7 +167,7 @@
tooltip-position="left"> tooltip-position="left">
</vn-button> </vn-button>
<vn-button class="round sm vn-mb-sm" <vn-button class="round sm vn-mb-sm"
icon="icon-invoices" icon="icon-invoice"
ng-click="makeInvoiceConfirmation.show()" ng-click="makeInvoiceConfirmation.show()"
ng-show="$ctrl.totalChecked > 0" ng-show="$ctrl.totalChecked > 0"
vn-tooltip="Make invoice..." vn-tooltip="Make invoice..."

View File

@ -83,7 +83,7 @@
"worker": "$ctrl.worker" "worker": "$ctrl.worker"
} }
}, { }, {
"url": "/time-control", "url": "/time-control?timestamp",
"state": "worker.card.timeControl", "state": "worker.card.timeControl",
"component": "vn-worker-time-control", "component": "vn-worker-time-control",
"description": "Time control", "description": "Time control",

View File

@ -91,6 +91,7 @@
</vn-label-value> </vn-label-value>
</div> </div>
<vn-calendar <vn-calendar
vn-id="calendar"
class="vn-pt-md" class="vn-pt-md"
ng-model="$ctrl.date" ng-model="$ctrl.date"
has-events="$ctrl.hasEvents($day)"> has-events="$ctrl.hasEvents($day)">

View File

@ -15,7 +15,15 @@ class Controller extends Section {
} }
$postLink() { $postLink() {
this.date = new Date(); const timestamp = this.$params.timestamp;
let initialDate = new Date();
if (timestamp) {
initialDate = new Date(timestamp * 1000);
this.$.calendar.defaultDate = initialDate;
}
this.date = initialDate;
} }
get worker() { get worker() {

View File

@ -129,5 +129,28 @@ describe('Component vnWorkerTimeControl', () => {
expect(controller.fetchHours).toHaveBeenCalledWith(); expect(controller.fetchHours).toHaveBeenCalledWith();
}); });
}); });
describe('$postLink() ', () => {
it(`should set the controller date as today if no timestamp is defined`, () => {
controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())};
controller.$params = {timestamp: undefined};
controller.$postLink();
expect(controller.date).toEqual(jasmine.any(Date));
});
it(`should set the controller date using the received timestamp`, () => {
const timestamp = 1;
const date = new Date(timestamp);
controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())};
controller.$.calendar = {};
controller.$params = {timestamp: timestamp};
controller.$postLink();
expect(controller.date.toDateString()).toEqual(date.toDateString());
});
});
}); });
}); });