2433 - Added sage fields
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
2e3402b0cd
commit
ca7601a9f2
|
@ -29,7 +29,6 @@ describe('Client updateFiscalData', () => {
|
|||
const ctx = {req: {accessToken: {userId: 5}}};
|
||||
ctx.args = {postcode: 46680};
|
||||
|
||||
|
||||
const client = await app.models.Client.findById(clientId);
|
||||
|
||||
expect(client.postcode).toEqual('46460');
|
||||
|
|
|
@ -43,6 +43,18 @@ module.exports = Self => {
|
|||
arg: 'provinceFk',
|
||||
type: 'number'
|
||||
},
|
||||
{
|
||||
arg: 'sageTaxTypeFk',
|
||||
type: 'number'
|
||||
},
|
||||
{
|
||||
arg: 'sageTransactionTypeFk',
|
||||
type: 'number'
|
||||
},
|
||||
{
|
||||
arg: 'transferorFk',
|
||||
type: 'number'
|
||||
},
|
||||
{
|
||||
arg: 'hasToInvoiceByAddress',
|
||||
type: 'boolean'
|
||||
|
|
|
@ -83,6 +83,12 @@
|
|||
"SmsConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SageTaxType": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SageTransactionType": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"TpvError": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -118,6 +118,18 @@
|
|||
},
|
||||
"created": {
|
||||
"type": "Date"
|
||||
},
|
||||
"sageTaxTypeFk": {
|
||||
"type": "number",
|
||||
"mysql": {
|
||||
"columnName": "taxTypeSageFk"
|
||||
}
|
||||
},
|
||||
"sageTransactionTypeFk": {
|
||||
"type": "number",
|
||||
"mysql": {
|
||||
"columnName": "transactionTypeSageFk"
|
||||
}
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
@ -200,6 +212,20 @@
|
|||
"type": "hasOne",
|
||||
"model": "ClaimRatio",
|
||||
"foreignKey": "clientFk"
|
||||
},
|
||||
"transferor": {
|
||||
"type": "belongsTo",
|
||||
"model": "Client",
|
||||
"foreignKey": "transferorFk"
|
||||
}
|
||||
},
|
||||
"scopes": {
|
||||
"isActive": {
|
||||
"where": {
|
||||
"isActive": {
|
||||
"neq": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "SageTaxType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "sage.TiposIva"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier",
|
||||
"mysql": {
|
||||
"columnName": "CodigoIva"
|
||||
}
|
||||
},
|
||||
"vat": {
|
||||
"type": "string",
|
||||
"mysql": {
|
||||
"columnName": "Iva"
|
||||
}
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"name": "SageTransactionType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "sage.TiposTransacciones"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier",
|
||||
"mysql": {
|
||||
"columnName": "CodigoTransaccion"
|
||||
}
|
||||
},
|
||||
"transaction": {
|
||||
"type": "string",
|
||||
"mysql": {
|
||||
"columnName": "Transaccion"
|
||||
}
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -18,6 +18,18 @@
|
|||
data="countries"
|
||||
order="country">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="SageTaxTypes"
|
||||
data="sageTaxTypes"
|
||||
order="vat">
|
||||
</vn-crud-model>
|
||||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="SageTransactionTypes"
|
||||
data="sageTransactionTypes"
|
||||
order="transaction">
|
||||
</vn-crud-model>
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-horizontal>
|
||||
|
@ -44,6 +56,35 @@
|
|||
rule>
|
||||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete vn-one
|
||||
ng-model="$ctrl.client.sageTaxTypeFk"
|
||||
data="sageTaxTypes"
|
||||
show-field="vat"
|
||||
value-field="id"
|
||||
label="Sage tax type"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
ng-model="$ctrl.client.sageTransactionTypeFk"
|
||||
data="sageTransactionTypes"
|
||||
show-field="transaction"
|
||||
value-field="id"
|
||||
label="Sage transaction type"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
ng-model="$ctrl.client.transferorFk"
|
||||
url="Clients/isActive"
|
||||
search-function="$ctrl.transferorSearchFunction($search)"
|
||||
where="{id: {neq: $ctrl.client.id}}"
|
||||
show-field="name"
|
||||
value-field="id"
|
||||
label="Previous client"
|
||||
info="In case of a company succession, specify the grantor company"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-datalist vn-one
|
||||
label="Postcode"
|
||||
|
|
|
@ -160,6 +160,12 @@ export default class Controller extends Section {
|
|||
onResponse(response) {
|
||||
this.client.postcode = response.code;
|
||||
}
|
||||
|
||||
transferorSearchFunction($search) {
|
||||
return /^\d+$/.test($search)
|
||||
? {id: $search}
|
||||
: {name: {like: '%' + $search + '%'}};
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnClientFiscalData', {
|
||||
|
|
|
@ -6,3 +6,7 @@ In order to invoice, this field is not consulted, but the consignee's ET. When m
|
|||
You can use letters and spaces: Se pueden utilizar letras y espacios
|
||||
Found a client with this data: Se ha encontrado un cliente con estos datos
|
||||
Found a client with this phone or email: El cliente con id <a href="#!/client/{{clientId}}/summary" target="_blank">{{clientId}}</a> ya tiene este teléfono o email. <br/> ¿Quieres continuar?
|
||||
Sage tax type: Tipo de impuesto Sage
|
||||
Sage transaction type: Tipo de transacción Sage
|
||||
Previous client: Cliente anterior
|
||||
In case of a company succession, specify the grantor company: En el caso de que haya habido una sucesión de empresa, indicar la empresa cedente
|
Loading…
Reference in New Issue