This commit is contained in:
Alex Moreno 2023-06-28 07:20:12 +02:00
commit 9b0cf7f378
7 changed files with 20 additions and 7 deletions

View File

@ -22,11 +22,13 @@ module.exports = Self => {
const tokenId = ctx.req.accessToken.id; const tokenId = ctx.req.accessToken.id;
const now = new Date(); const now = new Date();
const differenceMilliseconds = now - created; const differenceMilliseconds = now - new Date(created);
const differenceSeconds = Math.floor(differenceMilliseconds / 1000); const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']}); const accessTokenConfig = await models.AccessTokenConfig.findOne({fields: ['renewPeriod']});
console.log(userId, created, now, differenceMilliseconds, differenceSeconds, accessTokenConfig.renewPeriod, differenceSeconds <= accessTokenConfig.renewPeriod);
if (differenceSeconds <= accessTokenConfig.renewPeriod) if (differenceSeconds <= accessTokenConfig.renewPeriod)
throw new UserError(`The renew period has not been exceeded`); throw new UserError(`The renew period has not been exceeded`);

View File

@ -9,7 +9,7 @@ describe('Travel descriptor path', () => {
browser = await getBrowser(); browser = await getBrowser();
page = browser.page; page = browser.page;
await page.loginAndModule('buyer', 'travel'); await page.loginAndModule('buyer', 'travel');
await page.write(selectors.travelIndex.generalSearchFilter, '1'); await page.write(selectors.travelIndex.generalSearchFilter, '3');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
await page.waitForState('travel.card.summary'); await page.waitForState('travel.card.summary');
}); });
@ -23,7 +23,7 @@ describe('Travel descriptor path', () => {
await page.waitForState('travel.index'); await page.waitForState('travel.index');
const result = await page.countElement(selectors.travelIndex.anySearchResult); const result = await page.countElement(selectors.travelIndex.anySearchResult);
expect(result).toBeGreaterThanOrEqual(7); expect(result).toBeGreaterThanOrEqual(1);
}); });
it('should navigate to the first search result', async() => { it('should navigate to the first search result', async() => {

View File

@ -49,6 +49,7 @@ export class Layout extends Component {
const differenceMilliseconds = now - new Date(this.vnToken.created); const differenceMilliseconds = now - new Date(this.vnToken.created);
const differenceSeconds = Math.floor(differenceMilliseconds / 1000); const differenceSeconds = Math.floor(differenceMilliseconds / 1000);
console.log(this.vnToken.created, now, differenceMilliseconds, differenceSeconds, this.renewPeriod, differenceSeconds > this.renewPeriod);
if (differenceSeconds > this.renewPeriod) { if (differenceSeconds > this.renewPeriod) {
this.$http.post('VnUsers/renewToken') this.$http.post('VnUsers/renewToken')
.then(json => { .then(json => {

View File

@ -156,7 +156,7 @@
icon="install_mobile" icon="install_mobile"
ng-show="$ctrl.totalChecked > 0" ng-show="$ctrl.totalChecked > 0"
ng-click="$ctrl.sendDocuware()" ng-click="$ctrl.sendDocuware()"
vn-tooltip="Set as delivered and open delivery note(s)" vn-tooltip="Set as delivered and send delivery note(s) to the tablet"
tooltip-position="left"> tooltip-position="left">
</vn-button> </vn-button>
<vn-button class="round vn-mb-sm" <vn-button class="round vn-mb-sm"

View File

@ -3,7 +3,7 @@ Go to lines: Ir a lineas
Not available: No disponible Not available: No disponible
Not visible: No visible Not visible: No visible
Payment on account...: Pago a cuenta... Payment on account...: Pago a cuenta...
Set as delivered and open delivery note(s): Marcar como servido/s y abrir albarán/es Set as delivered and send delivery note(s) to the tablet: Marcar como servido/s y enviar albarán/es a la tablet
Closure: Cierre Closure: Cierre
You cannot make a payment on account from multiple clients: No puedes realizar un pago a cuenta de clientes diferentes You cannot make a payment on account from multiple clients: No puedes realizar un pago a cuenta de clientes diferentes
Filter by selection: Filtro por selección Filter by selection: Filtro por selección

View File

@ -37,6 +37,16 @@ class Controller extends SearchPanel {
} }
applyFilters(param) { applyFilters(param) {
if (typeof this.filter.scopeDays === 'number') {
const shippedFrom = Date.vnNew();
shippedFrom.setHours(0, 0, 0, 0);
const shippedTo = new Date(shippedFrom.getTime());
shippedTo.setDate(shippedTo.getDate() + this.filter.scopeDays);
shippedTo.setHours(23, 59, 59, 999);
Object.assign(this.filter, {shippedFrom, shippedTo});
}
this.model.applyFilter({}, this.filter) this.model.applyFilter({}, this.filter)
.then(() => { .then(() => {
if (param && this.model._orgData.length === 1) if (param && this.model._orgData.length === 1)

View File

@ -92,7 +92,7 @@
</span> </span>
</vn-td> </vn-td>
<vn-td expand>{{entry.supplierName}}</vn-td> <vn-td expand>{{entry.supplierName}}</vn-td>
<vn-td shrink>{{entry.ref}}</vn-td> <vn-td shrink>{{entry.reference}}</vn-td>
<vn-td shrink>{{entry.hb}}</vn-td> <vn-td shrink>{{entry.hb}}</vn-td>
<vn-td shrink>{{entry.freightValue | currency: 'EUR': 2}}</vn-td> <vn-td shrink>{{entry.freightValue | currency: 'EUR': 2}}</vn-td>
<vn-td shrink>{{entry.packageValue | currency: 'EUR': 2}}</vn-td> <vn-td shrink>{{entry.packageValue | currency: 'EUR': 2}}</vn-td>