8355-testToMaster #3336
|
@ -29,35 +29,34 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.sendToSupport = async(ctx, reason, additionalData) => {
|
Self.sendToSupport = async(ctx, reason, additionalData) => {
|
||||||
|
const userId = ctx.req.accessToken.userId;
|
||||||
const emailUser =
|
const emailUser =
|
||||||
await Self.app.models.EmailUser.findById(ctx.req.accessToken.userId, {fields: ['email']});
|
await Self.app.models.EmailUser.findById(userId, {fields: ['email']});
|
||||||
|
|
||||||
let html = `<strong>Motivo</strong>:<br/>${reason}<br/>`;
|
let html = `<h2>Motivo: ${reason}</h2>`;
|
||||||
html += `<strong>Usuario</strong>:<br/>${ctx.req.accessToken.userId} ${emailUser.email}<br/>`;
|
html += `<h3>Usuario: ${userId} ${emailUser.email}</h3>`;
|
||||||
|
html += `<h3>Additional Data:</h3>`;
|
||||||
|
html += '<ul>';
|
||||||
|
for (const [key, val] of Object.entries(additionalData)) {
|
||||||
|
if (key !== 'config') html += `<li>${key}: ${parse(val)}</li>`;
|
||||||
|
else {
|
||||||
|
html += `<li>${key}:</li><ul style="list-style-type: square;">`;
|
||||||
|
for (const [confKey, confVal] of Object.entries(val))
|
||||||
|
html += `<li>${confKey}: ${parse(confVal)}</li>`;
|
||||||
|
html += '</ul>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
html += '</ul>';
|
||||||
|
|
||||||
delete additionalData.backError.config.headers.Authorization;
|
const {message, path, name} = additionalData;
|
||||||
const httpRequest = JSON.parse(additionalData?.httpRequest);
|
|
||||||
|
|
||||||
if (httpRequest)
|
|
||||||
delete httpRequest.config.headers.Authorization;
|
|
||||||
additionalData.httpRequest = httpRequest;
|
|
||||||
|
|
||||||
for (const data in additionalData)
|
|
||||||
html += `<strong>${data}</strong>:<br/>${tryParse(additionalData[data])}<br/>`;
|
|
||||||
|
|
||||||
const subjectReason = httpRequest?.data?.error;
|
|
||||||
await smtp.send({
|
await smtp.send({
|
||||||
to: `${config.app.reportEmail}, ${emailUser.email}`,
|
to: `${config.app.reportEmail}, ${emailUser.email}`,
|
||||||
subject:
|
subject: `[Support-Salix] ${path} ${name}: ${message}`,
|
||||||
'[Support-Salix] ' +
|
|
||||||
additionalData?.frontPath + ' ' +
|
|
||||||
subjectReason?.name + ':' +
|
|
||||||
subjectReason?.message,
|
|
||||||
html
|
html
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function tryParse(value) {
|
function parse(value) {
|
||||||
try {
|
try {
|
||||||
try {
|
try {
|
||||||
value = JSON.parse(value);
|
value = JSON.parse(value);
|
||||||
|
|
|
@ -2128,7 +2128,7 @@ INSERT INTO `ACL` VALUES (746,'Claim','getSummary','READ','ALLOW','ROLE','claimV
|
||||||
INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative',NULL);
|
INSERT INTO `ACL` VALUES (747,'CplusRectificationType','*','READ','ALLOW','ROLE','administrative',NULL);
|
||||||
INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
INSERT INTO `ACL` VALUES (748,'SiiTypeInvoiceOut','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
||||||
INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
INSERT INTO `ACL` VALUES (749,'InvoiceCorrectionType','*','READ','ALLOW','ROLE','salesPerson',NULL);
|
||||||
INSERT INTO `ACL` VALUES (750,'InvoiceOut','transferInvoice','WRITE','ALLOW','ROLE','administrative',NULL);
|
INSERT INTO `ACL` VALUES (750,'InvoiceOut','transfer','WRITE','ALLOW','ROLE','administrative',NULL);
|
||||||
INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee',NULL);
|
INSERT INTO `ACL` VALUES (751,'Application','executeProc','*','ALLOW','ROLE','employee',NULL);
|
||||||
INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee',NULL);
|
INSERT INTO `ACL` VALUES (752,'Application','executeFunc','*','ALLOW','ROLE','employee',NULL);
|
||||||
INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee',NULL);
|
INSERT INTO `ACL` VALUES (753,'NotificationSubscription','getList','READ','ALLOW','ROLE','employee',NULL);
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE vn.`zone` MODIFY COLUMN `price` DECIMAL(10,2);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
-- Place your SQL code here
|
-- Place your SQL code here
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE vn.productionConfig ADD itemOrderReviewHours int(11) DEFAULT 24 NULL
|
ALTER TABLE vn.productionConfig ADD IF NOT EXISTS itemOrderReviewHours int(11) DEFAULT 24 NULL
|
||||||
COMMENT 'Horas que no se tienen en cuenta para comprobar orden en el almacén, null para desactivar revisión';
|
COMMENT 'Horas que no se tienen en cuenta para comprobar orden en el almacén, null para desactivar revisión';
|
||||||
|
|
|
@ -27,18 +27,6 @@ export default class Controller extends Component {
|
||||||
setTimeout(() => element.classList.add('shown'), 30);
|
setTimeout(() => element.classList.add('shown'), 30);
|
||||||
shape.element = element;
|
shape.element = element;
|
||||||
|
|
||||||
if (data.additionalData && this.vnToken.token) {
|
|
||||||
this.additionalData = data.additionalData;
|
|
||||||
let supportButton = document.createElement('i');
|
|
||||||
supportButton.setAttribute('class', 'material-icons clickable');
|
|
||||||
supportButton.addEventListener('click', () => this.$.supportDialog.show());
|
|
||||||
element.appendChild(supportButton);
|
|
||||||
|
|
||||||
let buttonIcon = 'support_agent';
|
|
||||||
buttonIcon = document.createTextNode(buttonIcon);
|
|
||||||
supportButton.appendChild(buttonIcon);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shape.type)
|
if (shape.type)
|
||||||
element.classList.add(shape.type);
|
element.classList.add(shape.type);
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,6 @@ export default class Controller extends Dialog {
|
||||||
responseHandler(response) {
|
responseHandler(response) {
|
||||||
if (response !== 'accept')
|
if (response !== 'accept')
|
||||||
return super.responseHandler(response);
|
return super.responseHandler(response);
|
||||||
|
|
||||||
this.$http.post('Ostickets/send-to-support', {
|
|
||||||
reason: this.reason,
|
|
||||||
additionalData: this.additionalData
|
|
||||||
})
|
|
||||||
.then(() => super.responseHandler(response))
|
|
||||||
.then(() => this.vnApp.showSuccess(this.$t('Email sended!')));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,5 +247,7 @@
|
||||||
"The raid information is not correct": "The raid information is not correct",
|
"The raid information is not correct": "The raid information is not correct",
|
||||||
"Payment method is required": "Payment method is required",
|
"Payment method is required": "Payment method is required",
|
||||||
"Sales already moved": "Sales already moved",
|
"Sales already moved": "Sales already moved",
|
||||||
"Holidays to past days not available": "Holidays to past days not available"
|
"Holidays to past days not available": "Holidays to past days not available",
|
||||||
|
"There are tickets to be invoiced": "There are tickets to be invoiced for this zone, please delete them first",
|
||||||
|
"Price cannot be blank": "Price cannot be blank"
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,7 +391,7 @@
|
||||||
"Sales already moved": "Ya han sido transferidas",
|
"Sales already moved": "Ya han sido transferidas",
|
||||||
"The raid information is not correct": "La información de la redada no es correcta",
|
"The raid information is not correct": "La información de la redada no es correcta",
|
||||||
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero",
|
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero",
|
||||||
|
"Price cannot be blank": "Price cannot be blank",
|
||||||
"An item type with the same code already exists": "Un tipo con el mismo código ya existe",
|
"An item type with the same code already exists": "Un tipo con el mismo código ya existe",
|
||||||
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles"
|
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,18 @@ module.exports = Self => {
|
||||||
Self.validatesPresenceOf('agencyModeFk', {
|
Self.validatesPresenceOf('agencyModeFk', {
|
||||||
message: `Agency cannot be blank`
|
message: `Agency cannot be blank`
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Self.validatesPresenceOf('price', {
|
||||||
|
message: 'Price cannot be blank'
|
||||||
|
});
|
||||||
|
Self.validateAsync('price', priceIsValid, {
|
||||||
|
message: 'Price must be greater than 0'
|
||||||
|
});
|
||||||
|
|
||||||
|
async function priceIsValid(err, done) {
|
||||||
|
if (this.price <= 0)
|
||||||
|
err();
|
||||||
|
|
||||||
|
done();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
subject: Incoterms Authorization
|
||||||
|
title: Incoterms Authorization
|
||||||
|
description:
|
||||||
|
dear: Dear customer
|
||||||
|
instructions: Please find attached the Incoterms authorization form, which you must complete and sign.
|
||||||
|
conclusion: Thank you for your attention!
|
|
@ -0,0 +1,16 @@
|
||||||
|
reportName: balance-compensation
|
||||||
|
Place: Algemesí, on
|
||||||
|
Compensation: Compensation of debtor and creditor balances
|
||||||
|
In one hand: On one hand
|
||||||
|
CIF: with CIF
|
||||||
|
NIF: with NIF
|
||||||
|
Home: and address located at
|
||||||
|
In other hand: On the other hand
|
||||||
|
Sr: Mr./Ms.
|
||||||
|
Agree: Agree
|
||||||
|
Date: On the date of
|
||||||
|
Compensate: the balance of has been compensated
|
||||||
|
From client: from the client/supplier
|
||||||
|
Against the balance of: against the balance of
|
||||||
|
Reception: Please confirm receipt of this compensation at the email
|
||||||
|
Greetings: Best regards,
|
|
@ -0,0 +1,39 @@
|
||||||
|
reportName: autorization-incoterms
|
||||||
|
description: '<em>{socialName}</em> a duly constituted and responsible company <em>limited</em>
|
||||||
|
and registered under corporate law {country} and here represented by {socialName}, with address in {address},
|
||||||
|
CIF <em>{fiscalID}</em>. Hereinafter referred to as {name}.'
|
||||||
|
issued: 'In {0}, on {1} of {2} of {3}'
|
||||||
|
client: 'Customer {0}'
|
||||||
|
declaration: '<em>{socialName}</em> hereby declares that:'
|
||||||
|
declarations:
|
||||||
|
- 'All purchases made by {socialName} with {companyName} They are delivered according to the conditions defined in the Incoterm.'
|
||||||
|
- '{socialName} recognizes that it is important for {companyName} have
|
||||||
|
proof of intra-community delivery of the goods to {destinationCountry} to
|
||||||
|
be able to invoice with 0% VAT.'
|
||||||
|
- 'Therefore, by signing this agreement, {socialName} declares that all goods
|
||||||
|
purchased from {companyName} will be delivered to {destinationCountry}.'
|
||||||
|
- 'Besides, {socialName} shall, at the first request of {companyName},
|
||||||
|
provide proof that all products purchased from {companyName} have
|
||||||
|
been delivered in {destinationCountry}.'
|
||||||
|
- 'In addition to the above, {companyName} will provide to {socialName}
|
||||||
|
a monthly summary that includes all bills (and corresponding deliveries).
|
||||||
|
{socialName} will sign and return the monthly summary to {companyName},
|
||||||
|
S.L. within 5 days of receiving the summary.'
|
||||||
|
signer:
|
||||||
|
representative: Representative
|
||||||
|
representativeRole: Position of the representative
|
||||||
|
signed: Date of signature
|
||||||
|
manager: Manager
|
||||||
|
months:
|
||||||
|
- 'January'
|
||||||
|
- 'February'
|
||||||
|
- 'March'
|
||||||
|
- 'April'
|
||||||
|
- 'May'
|
||||||
|
- 'June'
|
||||||
|
- 'July'
|
||||||
|
- 'August'
|
||||||
|
- 'September'
|
||||||
|
- 'October'
|
||||||
|
- 'November'
|
||||||
|
- 'December'
|
Loading…
Reference in New Issue