Merge branch 'dev' into 6444-MigrateVn2008.intrastat_netoFunctionToVn
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
80314d86cf
|
@ -7,18 +7,25 @@ def RUN_BUILD
|
|||
|
||||
node {
|
||||
stage('Setup') {
|
||||
switch (env.BRANCH_NAME) {
|
||||
case 'test':
|
||||
env.NODE_ENV = 'test'
|
||||
env.BACK_REPLICAS = 2
|
||||
break
|
||||
case 'master':
|
||||
env.NODE_ENV = 'production'
|
||||
env.BACK_REPLICAS = 4
|
||||
break
|
||||
default:
|
||||
env.NODE_ENV = 'dev'
|
||||
env.BACK_REPLICAS = 1
|
||||
|
||||
configFileProvider([
|
||||
configFile(fileId: 'salix.properties',
|
||||
variable: 'PROPS_FILE')
|
||||
]) {
|
||||
def props = readProperties file: PROPS_FILE
|
||||
env.DEBUG = props.DEBUG
|
||||
}
|
||||
|
||||
if (PROTECTED_BRANCH) {
|
||||
configFileProvider([
|
||||
configFile(fileId: "salix.branch.${env.BRANCH_NAME}",
|
||||
variable: 'BRANCH_PROPS_FILE')
|
||||
]) {
|
||||
def props = readProperties file: BRANCH_PROPS_FILE
|
||||
env.BACK_REPLICAS = props.BACK_REPLICAS
|
||||
env.NODE_ENV = props.NODE_ENV
|
||||
}
|
||||
}
|
||||
|
||||
PROTECTED_BRANCH = [
|
||||
|
@ -31,9 +38,10 @@ node {
|
|||
RUN_TESTS = !PROTECTED_BRANCH && FROM_GIT
|
||||
RUN_BUILD = PROTECTED_BRANCH && FROM_GIT
|
||||
|
||||
// Uncomment to enable debugging
|
||||
// https://loopback.io/doc/en/lb3/Setting-debug-strings.html#debug-strings-reference
|
||||
//env.DEBUG = 'strong-remoting:shared-method'
|
||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||
echo "Node: ${NODE_NAME}"
|
||||
echo "Workspace: ${WORKSPACE}"
|
||||
echo "Debug: ${env.DEBUG}"
|
||||
}
|
||||
}
|
||||
pipeline {
|
||||
|
|
|
@ -564,13 +564,13 @@ INSERT INTO `vn`.`supplierActivity`(`code`, `name`)
|
|||
|
||||
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`)
|
||||
VALUES
|
||||
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||
(69, 'Packaging', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
||||
(567, 'Holland', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||
(791, 'Bros SL', 'Bros nick', 5115000791, 1, '37718083S', 0, util.VN_CURDATE(), 1, 'supplier address 7', 'ASGARD', 3, 46600, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
||||
(1381, 'Ornamentales', 'Ornamentales', 7185001381, 1, '07972486L', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
|
||||
(1, 'PLANTS SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||
(2, 'FARMER KING', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||
(69, 'PACKAGING', 'Packaging nick', 4100000069, 1, '94935005K', 0, util.VN_CURDATE(), 1, 'supplier address 5', 'ASGARD', 3, 46600, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
|
||||
(442, 'VERDNATURA LEVANTE SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
||||
(567, 'HOLLAND', 'Holland nick', 4000020567, 1, '14364089Z', 0, util.VN_CURDATE(), 1, 'supplier address 6', 'ASGARD', 3, 46600, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
|
||||
(791, 'BROS SL', 'Bros nick', 5115000791, 1, '37718083S', 0, util.VN_CURDATE(), 1, 'supplier address 7', 'ASGARD', 3, 46600, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
|
||||
(1381, 'ORNAMENTALES', 'Ornamentales', 7185001381, 1, '07972486L', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
|
||||
|
||||
INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `provinceFk`, `postalCode`, `city`, `phone`, `mobile`)
|
||||
VALUES
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
-- Place your SQL code here
|
||||
UPDATE vn.supplier
|
||||
SET name = UPPER(name),
|
||||
nickname = UPPER(nickname);
|
|
@ -24,7 +24,7 @@ describe('Supplier summary & descriptor path', () => {
|
|||
it(`should confirm there's data on the summary header`, async() => {
|
||||
const result = await page.waitToGetProperty(selectors.supplierSummary.header, 'innerText');
|
||||
|
||||
expect(result).toContain('Plants SL - 1');
|
||||
expect(result).toContain('PLANTS SL - 1');
|
||||
});
|
||||
|
||||
it(`should confirm there's data on the summary basic data`, async() => {
|
||||
|
|
|
@ -24,7 +24,7 @@ describe('Supplier fiscal data path', () => {
|
|||
country: null,
|
||||
postcode: null,
|
||||
city: 'Valencia',
|
||||
socialName: 'Farmer King SL',
|
||||
socialName: 'FARMER KING SL',
|
||||
taxNumber: '12345678Z',
|
||||
account: '0123456789',
|
||||
sageWithholding: 'retencion estimacion objetiva',
|
||||
|
@ -46,7 +46,7 @@ describe('Supplier fiscal data path', () => {
|
|||
country: 'España',
|
||||
postcode: '46000',
|
||||
city: 'Valencia',
|
||||
socialName: 'Farmer King SL',
|
||||
socialName: 'FARMER KING SL',
|
||||
taxNumber: '12345678Z',
|
||||
account: '0123456789',
|
||||
sageWithholding: 'RETENCION ESTIMACION OBJETIVA',
|
||||
|
|
|
@ -204,6 +204,7 @@
|
|||
"It was not able to remove the next expeditions:": "It was not able to remove the next expeditions: {{expeditions}}",
|
||||
"Incorrect pin": "Incorrect pin.",
|
||||
"The notification subscription of this worker cant be modified": "The notification subscription of this worker cant be modified",
|
||||
"Name should be uppercase": "Name should be uppercase",
|
||||
"Fecha fuera de rango": "Fecha fuera de rango",
|
||||
"There is no zone for these parameters 34": "There is no zone for these parameters 34"
|
||||
}
|
|
@ -337,5 +337,6 @@
|
|||
"You already have the mailAlias": "Ya tienes este alias de correo",
|
||||
"The alias cant be modified": "Este alias de correo no puede ser modificado",
|
||||
"No tickets to invoice": "No hay tickets para facturar",
|
||||
"Name should be uppercase": "El nombre debe ir en mayúscula",
|
||||
"An email is necessary": "Es necesario un email"
|
||||
}
|
||||
|
|
|
@ -8,14 +8,14 @@ describe('InvoiceIn filter()', () => {
|
|||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
search: 'Plants SL',
|
||||
search: 'PLANTS SL',
|
||||
}
|
||||
};
|
||||
|
||||
const result = await models.InvoiceIn.filter(ctx, {}, options);
|
||||
|
||||
expect(result.length).toEqual(5);
|
||||
expect(result[0].supplierName).toEqual('Plants SL');
|
||||
expect(result[0].supplierName).toEqual('PLANTS SL');
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
|
|
@ -5,7 +5,7 @@ describe('Supplier getSummary()', () => {
|
|||
const supplier = await app.models.Supplier.getSummary(1);
|
||||
|
||||
expect(supplier.id).toEqual(1);
|
||||
expect(supplier.name).toEqual('Plants SL');
|
||||
expect(supplier.name).toEqual('PLANTS SL');
|
||||
expect(supplier.nif).toEqual('06089160W');
|
||||
expect(supplier.account).toEqual('4100000001');
|
||||
expect(supplier.payDay).toEqual(15);
|
||||
|
|
|
@ -25,13 +25,13 @@ describe('Supplier newSupplier()', () => {
|
|||
try {
|
||||
const options = {transaction: tx};
|
||||
ctx.args = {
|
||||
name: 'newSupplier',
|
||||
name: 'NEWSUPPLIER',
|
||||
nif: '12345678Z'
|
||||
};
|
||||
|
||||
const result = await models.Supplier.newSupplier(ctx, options);
|
||||
|
||||
expect(result.name).toEqual('newSupplier');
|
||||
expect(result.name).toEqual('NEWSUPPLIER');
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('Supplier updateFiscalData', () => {
|
|||
const administrativeId = 5;
|
||||
const employeeId = 1;
|
||||
const defaultData = {
|
||||
name: 'Plants SL',
|
||||
name: 'PLANTS SL',
|
||||
nif: '06089160W',
|
||||
account: '4100000001',
|
||||
sageTaxTypeFk: 4,
|
||||
|
@ -56,7 +56,7 @@ describe('Supplier updateFiscalData', () => {
|
|||
});
|
||||
|
||||
ctx.args = {
|
||||
name: 'Weapon Dealer',
|
||||
name: 'WEAPON DEALER',
|
||||
nif: 'A68446004',
|
||||
account: '4000000005',
|
||||
sageTaxTypeFk: 5,
|
||||
|
@ -72,7 +72,7 @@ describe('Supplier updateFiscalData', () => {
|
|||
|
||||
const result = await app.models.Supplier.updateFiscalData(ctx, supplierId);
|
||||
|
||||
expect(result.name).toEqual('Weapon Dealer');
|
||||
expect(result.name).toEqual('WEAPON DEALER');
|
||||
expect(result.nif).toEqual('A68446004');
|
||||
expect(result.account).toEqual('4000000005');
|
||||
expect(result.sageTaxTypeFk).toEqual(5);
|
||||
|
|
|
@ -129,7 +129,7 @@ describe('loopback model Supplier', () => {
|
|||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const newSupplier = await models.Supplier.create({name: 'Alfred Pennyworth'}, options);
|
||||
const newSupplier = await models.Supplier.create({name: 'ALFRED PENNYWORTH'}, options);
|
||||
const fetchedSupplier = await models.Supplier.findById(newSupplier.id, null, options);
|
||||
|
||||
expect(Number(fetchedSupplier.account)).toEqual(4100000000 + newSupplier.id);
|
||||
|
|
|
@ -46,6 +46,12 @@ module.exports = Self => {
|
|||
Self.validateAsync('postCode', hasValidPostcode, {
|
||||
message: `The postcode doesn't exist. Please enter a correct one`
|
||||
});
|
||||
Self.validatesFormatOf('name', {
|
||||
message: 'Name should be uppercase',
|
||||
allowNull: false,
|
||||
allowBlank: false,
|
||||
with: /^[^a-z]*$/
|
||||
});
|
||||
|
||||
async function hasValidPostcode(err, done) {
|
||||
if (!this.postcode)
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<vn-textfield
|
||||
label="Supplier name"
|
||||
ng-model="$ctrl.supplier.name"
|
||||
vn-focus>
|
||||
vn-focus
|
||||
ng-keyup="$ctrl.supplier.name = $ctrl.supplier.name.toUpperCase()">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
|
|
Loading…
Reference in New Issue