Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix
gitea/salix/pipeline/pr-test This commit looks good Details
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-09-04 14:10:33 +02:00
commit 80839100c7
6 changed files with 58 additions and 73 deletions

View File

@ -23,43 +23,36 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DELETE tt.*
FROM tmp.sale_getProblems tt
JOIN ticketObservation tto ON tto.ticketFk = tt.ticketFk
JOIN observationType ot ON ot.id = tto.observationTypeFk
WHERE ot.code = 'administrative'
AND tto.description = 'Miriam';
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_problems (
ticketFk INT(11),
saleFk INT(11),
isFreezed INTEGER(1) DEFAULT 0,
risk DECIMAL(10,1) DEFAULT 0,
hasRisk TINYINT(1) DEFAULT 0,
hasHighRisk TINYINT(1) DEFAULT 0,
hasTicketRequest INTEGER(1) DEFAULT 0,
itemShortage VARCHAR(255),
isTaxDataChecked INTEGER(1) DEFAULT 1,
itemDelay VARCHAR(255),
itemLost VARCHAR(255),
hasComponentLack INTEGER(1),
hasRounding VARCHAR(255),
isTooLittle BOOL DEFAULT FALSE,
isVip BOOL DEFAULT FALSE,
PRIMARY KEY (ticketFk, saleFk)
) ENGINE = MEMORY;
CREATE OR REPLACE TEMPORARY TABLE tmp.sale_problems (
ticketFk INT(11),
saleFk INT(11),
isFreezed INTEGER(1) DEFAULT 0,
risk DECIMAL(10,1) DEFAULT 0,
hasRisk TINYINT(1) DEFAULT 0,
hasHighRisk TINYINT(1) DEFAULT 0,
hasTicketRequest INTEGER(1) DEFAULT 0,
itemShortage VARCHAR(255),
isTaxDataChecked INTEGER(1) DEFAULT 1,
itemDelay VARCHAR(255),
itemLost VARCHAR(255),
hasComponentLack INTEGER(1),
hasRounding VARCHAR(255),
isTooLittle BOOL DEFAULT FALSE,
isVip BOOL DEFAULT FALSE,
PRIMARY KEY (ticketFk, saleFk)
) ENGINE = MEMORY;
INSERT INTO tmp.sale_problems(ticketFk,
saleFk,
isFreezed,
risk,
hasRisk,
hasHighRisk,
hasTicketRequest,
isTaxDataChecked,
hasComponentLack,
hasRounding,
isTooLittle)
INSERT INTO tmp.sale_problems(ticketFk,
saleFk,
isFreezed,
risk,
hasRisk,
hasHighRisk,
hasTicketRequest,
isTaxDataChecked,
hasComponentLack,
hasRounding,
isTooLittle)
SELECT sgp.ticketFk,
s.id,
IF(FIND_IN_SET('isFreezed', t.problem), TRUE, FALSE) isFreezed,

View File

@ -0,0 +1,2 @@
-- Place your SQL code here
ALTER TABLE dipole.expedition_PrintOut MODIFY COLUMN isPrinted int(11) DEFAULT 0 NOT NULL COMMENT '0.- Not Printed ; 1.- Printed; 2.- Selected ; 3.- Error ; 4.- Waiting to be printed';

View File

@ -27,25 +27,25 @@ module.exports = function(Self) {
};
});
// this.beforeRemote('**', async ctx => {
// if (!this.hasFilter(ctx)) return;
this.beforeRemote('**', async ctx => {
if (!this.hasFilter(ctx)) return;
// const defaultLimit = this.app.orm.selectLimit;
// const filter = ctx.args.filter || {limit: defaultLimit};
const defaultLimit = this.app.orm.selectLimit;
const filter = ctx.args.filter || {limit: defaultLimit};
// if (filter.limit > defaultLimit) {
// filter.limit = defaultLimit;
// ctx.args.filter = filter;
// }
// });
if (filter.limit > defaultLimit) {
filter.limit = defaultLimit;
ctx.args.filter = filter;
}
});
// this.afterRemote('**', async ctx => {
// if (!this.hasFilter(ctx)) return;
this.afterRemote('**', async ctx => {
if (!this.hasFilter(ctx)) return;
// const {result} = ctx;
// const length = Array.isArray(result) ? result.length : result ? 1 : 0;
// if (length >= this.app.orm.selectLimit) throw new UserError('Too many records');
// });
const {result} = ctx;
const length = Array.isArray(result) ? result.length : result ? 1 : 0;
if (length >= this.app.orm.selectLimit) throw new UserError('Too many records');
});
// Register field ACL validation
/*

View File

@ -1,6 +1,6 @@
// module.exports = async function(app) {
// if (!app.orm) {
// const ormConfig = await app.models.OrmConfig.findOne();
// app.orm = ormConfig;
// }
// };
module.exports = async function(app) {
if (!app.orm) {
const ormConfig = await app.models.OrmConfig.findOne();
app.orm = ormConfig;
}
};

View File

@ -6,16 +6,6 @@
order="concept ASC, quantity DESC"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="Shelvings"
data="shelvings"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="Parkings"
data="parkings"
auto-load="true">
</vn-crud-model>
<vn-data-viewer model="model">
<vn-card class="vn-w-lg">
<vn-table model="model">
@ -208,7 +198,7 @@
</vn-td>
<vn-td expand>
<vn-autocomplete
data="shelvings"
url="Shelvings"
show-field="code"
value-field="code"
ng-model="itemShelvingSale.shelvingFk"
@ -217,7 +207,7 @@
</vn-td>
<vn-td expand>
<vn-autocomplete
data="parkings"
url="Parkings"
show-field="code"
value-field="id"
ng-model="itemShelvingSale.parkingFk"

View File

@ -7,8 +7,8 @@ SELECT m.code mandateCode,
sp.name province,
ad.value accountDetailValue
FROM client c
JOIN mandate m ON m.clientFk = c.id
JOIN mandateType mt ON mt.id = m.mandateTypeFk
JOIN mandate m ON m.clientFk = c.id
JOIN mandateType mt ON mt.id = m.mandateTypeFk
JOIN supplier s ON s.id = m.companyFk
LEFT JOIN country sc ON sc.id = s.countryFk
LEFT JOIN province sp ON sp.id = s.provinceFk
@ -18,7 +18,7 @@ SELECT m.code mandateCode,
WHERE m.companyFk = ?
AND m.finished IS NULL
AND c.id = ?
AND mt.name = 'CORE'
AND mt.code = 'CORE'
AND adt.description = 'Referencia Remesas'
GROUP BY m.id, ad.value
ORDER BY m.created DESC
ORDER BY m.created DESC