Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 3002-more_module_transactions
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
1835171fe8
|
@ -103,6 +103,7 @@ module.exports = function(Self) {
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
const provinceId = args.provinceFk || address.provinceFk;
|
const provinceId = args.provinceFk || address.provinceFk;
|
||||||
|
if (provinceId) {
|
||||||
const province = await models.Province.findById(provinceId, {
|
const province = await models.Province.findById(provinceId, {
|
||||||
include: {
|
include: {
|
||||||
relation: 'country'
|
relation: 'country'
|
||||||
|
@ -110,14 +111,15 @@ module.exports = function(Self) {
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
const isUeeMember = province.country().isUeeMember;
|
const isUeeMember = province.country().isUeeMember;
|
||||||
|
|
||||||
const incotermsId = args.incotermsFk || address.incotermsFk;
|
const incotermsId = args.incotermsFk || address.incotermsFk;
|
||||||
|
|
||||||
if (!isUeeMember && !incotermsId)
|
if (!isUeeMember && !incotermsId)
|
||||||
throw new UserError(`Incoterms is required for a non UEE member`);
|
throw new UserError(`Incoterms is required for a non UEE member`);
|
||||||
|
|
||||||
const customsAgentId = args.customsAgentFk || address.customsAgentFk;
|
const customsAgentId = args.customsAgentFk || address.customsAgentFk;
|
||||||
if (!isUeeMember && !customsAgentId)
|
if (!isUeeMember && !customsAgentId)
|
||||||
throw new UserError(`Customs agent is required for a non UEE member`);
|
throw new UserError(`Customs agent is required for a non UEE member`);
|
||||||
|
}
|
||||||
|
|
||||||
delete args.ctx; // Remove unwanted properties
|
delete args.ctx; // Remove unwanted properties
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue