Merge branch 'dev' of https://git.verdnatura.es/salix into dev
This commit is contained in:
commit
31fa66e052
|
@ -10,19 +10,38 @@
|
|||
<vn-title>Pay method</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
vn-two
|
||||
label="Pay method"
|
||||
vn-acl="administrative, salesAssistant"
|
||||
vn-acl="salesAssistant"
|
||||
field="$ctrl.client.payMethodFk"
|
||||
url="/client/api/PayMethods"
|
||||
select-fields="ibanRequired"
|
||||
initial-data="$ctrl.client.payMethod">
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-two
|
||||
label="Swift / BIC"
|
||||
url="/client/api/BankEntities"
|
||||
field="$ctrl.client.bankEntityFk"
|
||||
select-fields="['name']"
|
||||
initial-data="$ctrl.client.bankEntityFk"
|
||||
where="{or: [{bic: {regexp: 'search'}}, {name: {regexp: 'search'}}]}"
|
||||
value-field="id"
|
||||
show-field="bic"
|
||||
vn-acl="salesAssistant">
|
||||
<tpl-item>
|
||||
<vn-horizontal>
|
||||
<vn-one>{{bic}}</vn-one>
|
||||
<vn-one>
|
||||
<div class="ellipsize" style="max-width: 10em">{{name}}</div>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Due day"
|
||||
field="$ctrl.client.dueDay"
|
||||
vn-acl="administrative, salesAssistant">
|
||||
vn-acl="salesAssistant">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
|
@ -30,7 +49,7 @@
|
|||
vn-one
|
||||
label="IBAN"
|
||||
field="$ctrl.client.iban"
|
||||
vn-acl="administrative, salesAssistant">
|
||||
vn-acl="salesAssistant">
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal pad-small-v>
|
||||
|
@ -38,26 +57,26 @@
|
|||
<vn-check
|
||||
label="Received LCR"
|
||||
field="$ctrl.client.hasLcr"
|
||||
vn-acl="administrative, salesAssistant">
|
||||
vn-acl="salesAssistant">
|
||||
</vn-check>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-check
|
||||
label="Received core VNL"
|
||||
field="$ctrl.client.hasCoreVnl"
|
||||
vn-acl="administrative, salesAssistant">
|
||||
vn-acl="salesAssistant">
|
||||
</vn-check>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-check
|
||||
label="Received B2B VNL"
|
||||
field="$ctrl.client.hasSepaVnl"
|
||||
vn-acl="administrative, salesAssistant">
|
||||
vn-acl="salesAssistant">
|
||||
</vn-check>
|
||||
</vn-one>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Save" vn-acl="administrative, salesAssistant"></vn-submit>
|
||||
<vn-submit label="Save" vn-acl="salesAssistant"></vn-submit>
|
||||
</vn-button-bar>
|
||||
</form>
|
|
@ -1,4 +1,5 @@
|
|||
vn-dialog vn-one {
|
||||
min-width: 15em;
|
||||
|
||||
vn-dialog {
|
||||
vn-client-summary vn-one {
|
||||
min-width: 10em;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import createNightmare from '../../helpers/helpers';
|
||||
|
||||
describe('Client', () => {
|
||||
xdescribe('Client', () => {
|
||||
describe('Edit pay method path', () => {
|
||||
const nightmare = createNightmare();
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "BankEntity",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "bankEntity",
|
||||
"database": "vn"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"bic": {
|
||||
"type": "String"
|
||||
},
|
||||
"name": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"country": {
|
||||
"type": "belongsTo",
|
||||
"model": "Country",
|
||||
"foreignKey": "countryFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "ClientRisk",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "clientRisk",
|
||||
"database": "vn"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"client": {
|
||||
"type": "belongsTo",
|
||||
"model": "Client",
|
||||
"foreignKey": "clientFk"
|
||||
},
|
||||
"company": {
|
||||
"type": "belongsTo",
|
||||
"model": "Company",
|
||||
"foreignKey": "companyFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,9 @@
|
|||
"AddressObservation": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"BankEntity": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ClientCredit": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -55,5 +58,8 @@
|
|||
},
|
||||
"Defaulter": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ClientRisk": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
/**
|
||||
* Cambios para evitar fallos en local.
|
||||
* Ya está en producción
|
||||
**/
|
||||
|
||||
ALTER TABLE `vn2008`.`Clientes`
|
||||
ADD COLUMN `bankEntityFk` INT(10) UNSIGNED NULL AFTER `hasLcr`;
|
||||
|
||||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `client` AS
|
||||
SELECT
|
||||
`c`.`id_cliente` AS `id`,
|
||||
`c`.`cliente` AS `name`,
|
||||
`c`.`if` AS `fi`,
|
||||
`c`.`razonSocial` AS `socialName`,
|
||||
`c`.`contacto` AS `contact`,
|
||||
`c`.`domicilio` AS `street`,
|
||||
`c`.`poblacion` AS `city`,
|
||||
`c`.`codPostal` AS `postcode`,
|
||||
`c`.`telefono` AS `phone`,
|
||||
`c`.`movil` AS `mobile`,
|
||||
`c`.`fax` AS `fax`,
|
||||
`c`.`real` AS `isRelevant`,
|
||||
`c`.`e-mail` AS `email`,
|
||||
`c`.`iban` AS `iban`,
|
||||
`c`.`vencimiento` AS `dueDay`,
|
||||
`c`.`Cuenta` AS `accountingAccount`,
|
||||
`c`.`RE` AS `isEqualizated`,
|
||||
`c`.`province_id` AS `provinceFk`,
|
||||
`c`.`invoice` AS `hasToInvoice`,
|
||||
`c`.`credito` AS `credit`,
|
||||
`c`.`Id_Pais` AS `countryFk`,
|
||||
`c`.`activo` AS `isActive`,
|
||||
`c`.`gestdoc_id` AS `gestdocFk`,
|
||||
`c`.`calidad` AS `quality`,
|
||||
`c`.`pay_met_id` AS `payMethodFk`,
|
||||
`c`.`created` AS `created`,
|
||||
`c`.`mail` AS `isToBeMailed`,
|
||||
`c`.`chanel_id` AS `contactChannelFk`,
|
||||
`c`.`sepaVnl` AS `hasSepaVnl`,
|
||||
`c`.`coreVnl` AS `hasCoreVnl`,
|
||||
`c`.`coreVnh` AS `hasCoreVnh`,
|
||||
`c`.`hasLcr` AS `hasLcr`,
|
||||
`c`.`default_address` AS `defaultAddressFk`,
|
||||
`c`.`risk_calculated` AS `riskCalculated`,
|
||||
`c`.`clientes_tipo_id` AS `clientTypeFk`,
|
||||
`c`.`mail_address` AS `mailAddress`,
|
||||
`c`.`cplusTerIdNifFk` AS `cplusTerIdNifFk`,
|
||||
`c`.`invoiceByAddress` AS `hasToInvoiceByAddress`,
|
||||
`c`.`contabilizado` AS `isTaxDataChecked`,
|
||||
`c`.`congelado` AS `isFreezed`,
|
||||
`c`.`creditInsurance` AS `creditInsurance`,
|
||||
`c`.`isCreatedAsServed` AS `isCreatedAsServed`,
|
||||
`c`.`hasInvoiceSimplified` AS `hasInvoiceSimplified`,
|
||||
`c`.`Id_Trabajador` AS `salesPersonFk`,
|
||||
`c`.`vies` AS `isVies`,
|
||||
`c`.`EYPBC` AS `eypbc`,
|
||||
bankEntityFk
|
||||
FROM
|
||||
`vn2008`.`Clientes` `c`;
|
|
@ -0,0 +1,12 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `clientRisk` AS
|
||||
SELECT
|
||||
`c`.`customer_id` AS `clientFk`,
|
||||
`c`.`company_id` AS `companyFk`,
|
||||
`c`.`amount` AS `amount`
|
||||
FROM
|
||||
`bi`.`customer_risk` `c`;
|
|
@ -33,6 +33,7 @@ module.exports = Self => {
|
|||
|
||||
let data = filterAttributes(params, [
|
||||
'payMethodFk',
|
||||
'bankEntityFk',
|
||||
'dueDay',
|
||||
'iban',
|
||||
'hasLcr',
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "ClaimRatio",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "claimRatio",
|
||||
"database": "vn"
|
||||
}
|
||||
},
|
||||
"validateUpsert": true,
|
||||
"properties": {
|
||||
"yearSale": {
|
||||
"type": "Number"
|
||||
},
|
||||
"claimAmount": {
|
||||
"type": "Number"
|
||||
},
|
||||
"claimingRate": {
|
||||
"type": "Number"
|
||||
},
|
||||
"priceIncreasing": {
|
||||
"type": "Number"
|
||||
},
|
||||
"packingRate": {
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"client": {
|
||||
"type": "belongsTo",
|
||||
"model": "Client",
|
||||
"foreignKey": "clientFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -84,6 +84,7 @@ module.exports = Self => {
|
|||
Self.validate('payMethod', hasSalesMan, {
|
||||
message: 'Cannot change the payment method if no salesperson'
|
||||
});
|
||||
|
||||
function hasSalesMan(err) {
|
||||
if (this.payMethod && !this.salesPerson)
|
||||
err();
|
||||
|
@ -92,9 +93,10 @@ module.exports = Self => {
|
|||
Self.validateAsync('payMethodFk', hasIban, {
|
||||
message: 'That payment method requires an IBAN'
|
||||
});
|
||||
|
||||
function hasIban(err, done) {
|
||||
Self.app.models.PayMethod.findById(this.payMethodFk, (_, instance) => {
|
||||
if (instance && instance.ibanRequired && !this.iban)
|
||||
if (instance && instance.ibanRequired && (!this.iban || !this.bankEntityFk))
|
||||
err();
|
||||
done();
|
||||
});
|
||||
|
|
|
@ -133,17 +133,17 @@
|
|||
"model": "Worker",
|
||||
"foreignKey": "salesPersonFk"
|
||||
},
|
||||
"province":{
|
||||
"province": {
|
||||
"type": "belongsTo",
|
||||
"model": "Province",
|
||||
"foreignKey": "provinceFk"
|
||||
},
|
||||
"country":{
|
||||
"country": {
|
||||
"type": "belongsTo",
|
||||
"model": "Country",
|
||||
"foreignKey": "countryFk"
|
||||
},
|
||||
"contactChannel":{
|
||||
"contactChannel": {
|
||||
"type": "belongsTo",
|
||||
"model": "ContactChannel",
|
||||
"foreignKey": "contactChannelFk"
|
||||
|
@ -172,6 +172,11 @@
|
|||
"type": "hasMany",
|
||||
"model": "ClientContact",
|
||||
"foreignKey": "clientFk"
|
||||
},
|
||||
"bank": {
|
||||
"type": "belongsTo",
|
||||
"model": "BankEntity",
|
||||
"foreignKey": "bankEntityFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -134,5 +134,8 @@
|
|||
},
|
||||
"UserConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ClaimRatio": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue