Merge branch 'test' into 5094-application_post
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-02-15 09:19:39 +00:00
commit 9ec75a5af3
7 changed files with 37 additions and 26 deletions

View File

@ -0,0 +1,9 @@
ALTER TABLE `vn`.`itemConfig` ADD defaultTag INT DEFAULT 56 NOT NULL;
ALTER TABLE `vn`.`itemConfig` ADD CONSTRAINT itemConfig_FK FOREIGN KEY (defaultTag) REFERENCES vn.tag(id);
ALTER TABLE `vn`.`itemConfig` ADD validPriorities varchar(50) DEFAULT '[1,2,3]' NOT NULL;
ALTER TABLE `vn`.`itemConfig` ADD defaultPriority INT DEFAULT 2 NOT NULL;
ALTER TABLE `vn`.`item` MODIFY COLUMN relevancy tinyint(1) DEFAULT 0 NOT NULL COMMENT 'La web ordena de forma descendiente por este campo para mostrar los artículos';
INSERT INTO `salix`.`ACL`
(model, property, accessType, permission, principalType, principalId)
VALUES('ItemConfig', '*', 'READ', 'ALLOW', 'ROLE', 'buyer');

View File

@ -94,11 +94,6 @@
"model": "Supplier",
"foreignKey": "supplierFk"
},
"supplierContact": {
"type": "hasMany",
"model": "SupplierContact",
"foreignKey": "supplierFk"
},
"currency": {
"type": "belongsTo",
"model": "Currency",

View File

@ -6,13 +6,15 @@ class Controller extends ModuleCard {
const filter = {
include: [
{
relation: 'supplier'
},
{
relation: 'supplierContact',
relation: 'supplier',
scope: {
where: {
email: {neq: null}
include: {
relation: 'contacts',
scope: {
where: {
email: {neq: null},
}
}
}
}
},

View File

@ -40,7 +40,7 @@
</vn-item>
<vn-item
ng-if="$ctrl.isAgricultural()"
ng-click="sendPdfConfirmation.show({email: $ctrl.entity.supplierContact[0].email})"
ng-click="sendPdfConfirmation.show({email: $ctrl.entity.supplier.contacts[0].email})"
translate>
Send agricultural receipt as PDF
</vn-item>

View File

@ -66,12 +66,15 @@ export default class Controller extends Section {
let today = new Date();
const tomorrow = new Date(today);
tomorrow.setDate(tomorrow.getDate() + 1);
this.filterParams = {
dateFuture: tomorrow,
dateToAdvance: today,
warehouseFk: this.vnConfig.warehouseFk
};
this.$.model.applyFilter(null, this.filterParams);
this.$http.get(`UserConfigs/getUserConfig`)
.then(res => {
this.filterParams = {
dateFuture: tomorrow,
dateToAdvance: today,
warehouseFk: res.data.warehouseFk
};
this.$.model.addFilter({}, this.filterParams);
});
}
compareDate(date) {

View File

@ -59,12 +59,15 @@ export default class Controller extends Section {
setDefaultFilter() {
const today = new Date();
this.filterParams = {
originDated: today,
futureDated: today,
warehouseFk: this.vnConfig.warehouseFk
};
this.$.model.applyFilter(null, this.filterParams);
this.$http.get(`UserConfigs/getUserConfig`)
.then(res => {
this.filterParams = {
originDated: today,
futureDated: today,
warehouseFk: res.data.warehouseFk
};
this.$.model.applyFilter(null, this.filterParams);
});
}
compareDate(date) {

View File

@ -8,5 +8,4 @@ SELECT
r.payed
FROM client c
JOIN receipt r ON r.clientFk = c.id
JOIN supplier s ON c.fi = s.nif
WHERE r.id = ?
WHERE r.id = ?