4797-lilium-worker-notifications #1229

Merged
pau merged 37 commits from 4797-lilium-worker-notifications into dev 2023-02-02 08:53:29 +00:00
13 changed files with 68 additions and 74 deletions
Showing only changes of commit 4c4f39282e - Show all commits

View File

@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- (Artículos -> Etiquetas) Permite intercambiar la relevancia entre dos etiquetas. - (Artículos -> Etiquetas) Permite intercambiar la relevancia entre dos etiquetas.
- (Tickets -> Añadir pago) Eliminado "null" en las referencias
## [2302.01] - 2023-01-26 ## [2302.01] - 2023-01-26

View File

@ -23,6 +23,7 @@ describe('Worker time control path', () => {
it('should go to the next month, go to current month and go 1 month in the past', async() => { it('should go to the next month, go to current month and go 1 month in the past', async() => {
let date = new Date(); let date = new Date();
date.setDate(1);
date.setMonth(date.getMonth() + 1); date.setMonth(date.getMonth() + 1);
let month = date.toLocaleString('default', {month: 'long'}); let month = date.toLocaleString('default', {month: 'long'});
@ -32,6 +33,7 @@ describe('Worker time control path', () => {
expect(result).toContain(month); expect(result).toContain(month);
date = new Date(); date = new Date();
date.setDate(1);
month = date.toLocaleString('default', {month: 'long'}); month = date.toLocaleString('default', {month: 'long'});
await page.click(selectors.workerTimeControl.previousMonthButton); await page.click(selectors.workerTimeControl.previousMonthButton);
@ -40,6 +42,7 @@ describe('Worker time control path', () => {
expect(result).toContain(month); expect(result).toContain(month);
date = new Date(); date = new Date();
date.setDate(1);
date.setMonth(date.getMonth() - 1); date.setMonth(date.getMonth() - 1);
const timestamp = Math.round(date.getTime() / 1000); const timestamp = Math.round(date.getTime() / 1000);
month = date.toLocaleString('default', {month: 'long'}); month = date.toLocaleString('default', {month: 'long'});

View File

@ -87,6 +87,7 @@ ngModule.vnComponent('vnButtonMenu', {
selectFields: '<?', selectFields: '<?',
initialData: '<?', initialData: '<?',
showFilter: '<?', showFilter: '<?',
fields: '<?',
field: '=?', field: '=?',
url: '@?', url: '@?',
data: '<?', data: '<?',

View File

@ -42,6 +42,7 @@ vn-log {
& > td.after, & > td.after,
& > th.after { & > th.after {
width: 40%; width: 40%;
white-space: pre-line;
} }
} }
} }

View File

@ -59,13 +59,11 @@ class Controller extends Dialog {
if (value) { if (value) {
const accountingType = value.accountingType; const accountingType = value.accountingType;
if (this.originalDescription) { if (accountingType.receiptDescription != null) {
this.receipt.description = this.receipt.description = accountingType.receiptDescription;
`${accountingType && accountingType.receiptDescription}, ${this.originalDescription}`; if (this.originalDescription) this.receipt.description += `, ${this.originalDescription}`;
} else { } else if (this.originalDescription)
this.receipt.description = this.receipt.description = this.originalDescription;
`${accountingType && accountingType.receiptDescription}`;
}
this.maxAmount = accountingType && accountingType.maxAmount; this.maxAmount = accountingType && accountingType.maxAmount;
this.receipt.payed = new Date(); this.receipt.payed = new Date();

View File

@ -47,44 +47,32 @@ module.exports = function(Self) {
} }
try { try {
const promises = [];
if (args.deletes) { if (args.deletes) {
for (const itemTagId of args.deletes) { for (const itemTagId of args.deletes)
const itemTagDeleted = models.ItemTag.destroyById(itemTagId, myOptions); await models.ItemTag.destroyById(itemTagId, myOptions);
promises.push(itemTagDeleted);
}
} }
if (args.updates) { if (args.updates) {
for (const row of args.updates) { for (const row of args.updates) {
if (row.data.priority) { if (row.data.priority) {
const itemTag = await models.ItemTag.findById(row.where.id, null, myOptions); const itemTag = await models.ItemTag.findById(row.where.id, null, myOptions);
const itemTagUpdatedPriority = itemTag.updateAttributes({ await itemTag.updateAttributes({
priority: row.data.priority + args.maxPriority priority: row.data.priority + args.maxPriority
}, myOptions); }, myOptions);
promises.push(itemTagUpdatedPriority);
} }
} }
for (const row of args.updates) { for (const row of args.updates) {
const itemTag = await models.ItemTag.findById(row.where.id, null, myOptions); const itemTag = await models.ItemTag.findById(row.where.id, null, myOptions);
const itemTagUpdated = itemTag.updateAttributes(row.data, myOptions); await itemTag.updateAttributes(row.data, myOptions);
promises.push(itemTagUpdated);
} }
} }
if (args.creates) { if (args.creates) {
for (const itemTag of args.creates) { for (const itemTag of args.creates)
const newItemTag = models.ItemTag.create(itemTag, myOptions); await models.ItemTag.create(itemTag, myOptions);
promises.push(newItemTag);
} }
}
const resolvedPromises = await Promise.all(promises);
if (tx) await tx.commit(); if (tx) await tx.commit();
return resolvedPromises;
} catch (e) { } catch (e) {
if (tx) await tx.rollback(); if (tx) await tx.rollback();
throw e; throw e;

View File

@ -12,9 +12,8 @@ describe('tag onSubmit()', () => {
deletes: deletes deletes: deletes
} }
}; };
const result = await models.Tag.onSubmit(ctx, options); await models.Tag.onSubmit(ctx, options);
expect(result.length).toEqual(1);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();
@ -33,9 +32,8 @@ describe('tag onSubmit()', () => {
updates: updates updates: updates
} }
}; };
const result = await models.Tag.onSubmit(ctx, options); await models.Tag.onSubmit(ctx, options);
expect(result.length).toEqual(1);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();
@ -62,9 +60,8 @@ describe('tag onSubmit()', () => {
creates: creates creates: creates
} }
}; };
const result = await models.Tag.onSubmit(ctx, options); await models.Tag.onSubmit(ctx, options);
expect(result.length).toEqual(1);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();
@ -88,9 +85,8 @@ describe('tag onSubmit()', () => {
} }
}; };
const result = await models.Tag.onSubmit(ctx, options); await models.Tag.onSubmit(ctx, options);
expect(result.length).toEqual(4);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();

View File

@ -24,36 +24,42 @@
</vn-textfield> </vn-textfield>
<vn-input-number <vn-input-number
type="number" type="number"
step="0.01"
label="Minimum M3" label="Minimum M3"
ng-model="supplierAgencyTerm.minimumM3" ng-model="supplierAgencyTerm.minimumM3"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-input-number <vn-input-number
type="number" type="number"
step="0.01"
label="Package Price" label="Package Price"
ng-model="supplierAgencyTerm.packagePrice" ng-model="supplierAgencyTerm.packagePrice"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-input-number <vn-input-number
type="number" type="number"
step="0.01"
label="Km Price" label="Km Price"
ng-model="supplierAgencyTerm.kmPrice" ng-model="supplierAgencyTerm.kmPrice"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-input-number <vn-input-number
type="number" type="number"
step="0.01"
label="M3 Price" label="M3 Price"
ng-model="supplierAgencyTerm.m3Price" ng-model="supplierAgencyTerm.m3Price"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-input-number <vn-input-number
type="number" type="number"
step="0.01"
label="Route Price" label="Route Price"
ng-model="supplierAgencyTerm.routePrice" ng-model="supplierAgencyTerm.routePrice"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-input-number <vn-input-number
type="number" type="number"
step="0.01"
label="Minimum Km" label="Minimum Km"
ng-model="supplierAgencyTerm.minimumKm" ng-model="supplierAgencyTerm.minimumKm"
rule> rule>

View File

@ -24,7 +24,7 @@ module.exports = Self => {
if (typeof options == 'object') if (typeof options == 'object')
Object.assign(myOptions, options); Object.assign(myOptions, options);
let statesList = await models.State.find({where: filter.where}, myOptions); let statesList = await models.State.find(filter, myOptions);
const isProduction = await models.Account.hasRole(userId, 'production', myOptions); const isProduction = await models.Account.hasRole(userId, 'production', myOptions);
const isSalesPerson = await models.Account.hasRole(userId, 'salesPerson', myOptions); const isSalesPerson = await models.Account.hasRole(userId, 'salesPerson', myOptions);
const isAdministrative = await models.Account.hasRole(userId, 'administrative', myOptions); const isAdministrative = await models.Account.hasRole(userId, 'administrative', myOptions);

View File

@ -22,6 +22,7 @@
disabled="!$ctrl.isEditable" disabled="!$ctrl.isEditable"
label="State" label="State"
value-field="code" value-field="code"
fields="['id', 'name', 'alertLevel', 'code']"
url="States/editableStates" url="States/editableStates"
on-change="$ctrl.changeState(value)"> on-change="$ctrl.changeState(value)">
</vn-button-menu> </vn-button-menu>

View File

@ -16,6 +16,7 @@
class="message" class="message"
label="Change state" label="Change state"
value-field="code" value-field="code"
fields="['id', 'name', 'alertLevel', 'code']"
url="States/editableStates" url="States/editableStates"
on-change="$ctrl.changeState(value)"> on-change="$ctrl.changeState(value)">
</vn-button-menu> </vn-button-menu>

View File

@ -4,9 +4,9 @@
<div class="content"> <div class="content">
<h1 class="title centered uppercase">{{$t('title')}}</h1> <h1 class="title centered uppercase">{{$t('title')}}</h1>
<p class="centered"> <p class="centered">
Recibo de <strong class="uppercase">{{client.socialName}}</strong>, la cantidad de Recibo de <strong class="uppercase">{{client.socialName}}</strong>,
<strong>{{receipt.amountPaid}} €</strong> en concepto de 'entrega a cuenta', quedando pendiente en la cantidad de <strong>{{receipt.amountPaid}} €</strong>
la cuenta del cliente un saldo de <strong>{{receipt.amountUnpaid}} €</strong>. en concepto de 'entrega a cuenta'.
</p> </p>
<div class="signature"> <div class="signature">
<img v-bind:src="getReportSrc('signature.png')" /> <img v-bind:src="getReportSrc('signature.png')" />

View File

@ -1,7 +1,6 @@
SELECT SELECT
r.id, r.id,
r.amountPaid, r.amountPaid,
cr.amount AS amountUnpaid,
r.payed, r.payed,
r.companyFk r.companyFk
FROM receipt r FROM receipt r