Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2590-client_descriptor_invoices
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2020-11-19 10:52:19 +01:00
commit 0465a38684
18 changed files with 175 additions and 76 deletions

View File

@ -940,7 +940,7 @@ export default {
}, },
supplierBasicData: { supplierBasicData: {
alias: 'vn-supplier-basic-data vn-textfield[ng-model="$ctrl.supplier.nickname"]', alias: 'vn-supplier-basic-data vn-textfield[ng-model="$ctrl.supplier.nickname"]',
isOfficial: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isOfficial"]', isSerious: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isSerious"]',
isActive: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isActive"]', isActive: 'vn-supplier-basic-data vn-check[ng-model="$ctrl.supplier.isActive"]',
notes: 'vn-supplier-basic-data vn-textarea[ng-model="$ctrl.supplier.note"]', notes: 'vn-supplier-basic-data vn-textarea[ng-model="$ctrl.supplier.note"]',
saveButton: 'vn-supplier-basic-data button[type="submit"]', saveButton: 'vn-supplier-basic-data button[type="submit"]',

View File

@ -20,7 +20,7 @@ describe('Supplier basic data path', () => {
it('should edit the basic data', async() => { it('should edit the basic data', async() => {
await page.clearInput(selectors.supplierBasicData.alias); await page.clearInput(selectors.supplierBasicData.alias);
await page.write(selectors.supplierBasicData.alias, 'Plants Nick SL'); await page.write(selectors.supplierBasicData.alias, 'Plants Nick SL');
await page.waitToClick(selectors.supplierBasicData.isOfficial); await page.waitToClick(selectors.supplierBasicData.isSerious);
await page.waitToClick(selectors.supplierBasicData.isActive); await page.waitToClick(selectors.supplierBasicData.isActive);
await page.write(selectors.supplierBasicData.notes, 'Some notes'); await page.write(selectors.supplierBasicData.notes, 'Some notes');
@ -40,8 +40,8 @@ describe('Supplier basic data path', () => {
expect(result).toEqual('Plants Nick SL'); expect(result).toEqual('Plants Nick SL');
}); });
it('should check the isOffical checkbox is now unchecked', async() => { it('should check the isSerious checkbox is now unchecked', async() => {
const result = await page.checkboxState(selectors.supplierBasicData.isOfficial); const result = await page.checkboxState(selectors.supplierBasicData.isSerious);
expect(result).toBe('unchecked'); expect(result).toBe('unchecked');
}); });

View File

@ -25,7 +25,7 @@ module.exports = Self => {
'id', 'id',
'name', 'name',
'nickname', 'nickname',
'isOfficial', 'isSerious',
'isActive', 'isActive',
'note', 'note',
'nif', 'nif',
@ -39,6 +39,9 @@ module.exports = Self => {
'payDay', 'payDay',
'account', 'account',
'isFarmer', 'isFarmer',
'sageTaxTypeFk',
'sageTransactionTypeFk',
'sageWithholdingFk',
], ],
include: [ include: [
{ {
@ -64,10 +67,27 @@ module.exports = Self => {
scope: { scope: {
fields: ['id', 'payDem'] fields: ['id', 'payDem']
} }
},
{
relation: 'sageTaxType',
scope: {
fields: ['id', 'vat']
}
},
{
relation: 'sageTransactionType',
scope: {
fields: ['id', 'transaction']
}
},
{
relation: 'sageWithholding',
scope: {
fields: ['id', 'withholding']
}
} }
] ]
}; };
let supplier = await Self.app.models.Supplier.findOne(filter); let supplier = await Self.app.models.Supplier.findOne(filter);
return supplier; return supplier;
}; };

View File

@ -1,6 +1,10 @@
{ {
"name": "SupplierContact", "name": "SupplierContact",
"base": "VnModel", "base": "Loggable",
"log": {
"model":"SupplierLog",
"relation": "supplier"
},
"options": { "options": {
"mysql": { "mysql": {
"table": "supplierContact" "table": "supplierContact"

View File

@ -51,6 +51,9 @@
"isOfficial": { "isOfficial": {
"type": "Boolean" "type": "Boolean"
}, },
"isSerious": {
"type": "Boolean"
},
"note": { "note": {
"type": "String" "type": "String"
}, },
@ -123,6 +126,21 @@
"model": "Client", "model": "Client",
"foreignKey": "nif", "foreignKey": "nif",
"primaryKey": "fi" "primaryKey": "fi"
},
"sageTaxType": {
"type": "belongsTo",
"model": "SageTaxType",
"foreignKey": "sageTaxTypeFk"
},
"sageTransactionType": {
"type": "belongsTo",
"model": "SageTransactionType",
"foreignKey": "sageTransactionTypeFk"
},
"sageWithholding": {
"type": "belongsTo",
"model": "SageWithholding",
"foreignKey": "sageWithholdingFk"
} }
}, },
"acls": [ "acls": [

View File

@ -18,8 +18,8 @@
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-check <vn-check
label="Official" label="Verified"
ng-model="$ctrl.supplier.isOfficial"> ng-model="$ctrl.supplier.isSerious">
</vn-check> </vn-check>
<vn-check <vn-check
label="Active" label="Active"

View File

@ -1,3 +1,3 @@
Notes: Notas Notes: Notas
Active: Activo Active: Activo
Official: Oficial Verified: Verificado

View File

@ -34,7 +34,7 @@
rule="SupplierContact"> rule="SupplierContact">
</vn-textfield> </vn-textfield>
<vn-textfield <vn-textfield
vn-one vn-two
label="Email" label="Email"
ng-model="contact.email" ng-model="contact.email"
rule="SupplierContact"> rule="SupplierContact">

View File

@ -29,9 +29,9 @@
ng-class="{bright: $ctrl.supplier.isActive == false}"> ng-class="{bright: $ctrl.supplier.isActive == false}">
</vn-icon> </vn-icon>
<vn-icon <vn-icon
vn-tooltip="Official supplier" vn-tooltip="Verified supplier"
icon="icon-net" icon="verified_user"
ng-class="{bright: $ctrl.supplier.isOfficial == false}"> ng-class="{bright: $ctrl.supplier.isSerious == true}">
</vn-icon> </vn-icon>
</div> </div>
<div class="quicklinks"> <div class="quicklinks">

View File

@ -40,7 +40,7 @@ class Controller extends Descriptor {
'payDemFk', 'payDemFk',
'payDay', 'payDay',
'isActive', 'isActive',
'isOfficial', 'isSerious',
'account' 'account'
], ],
include: [ include: [

View File

@ -26,7 +26,7 @@ describe('Supplier Component vnSupplierDescriptor', () => {
'payDemFk', 'payDemFk',
'payDay', 'payDay',
'isActive', 'isActive',
'isOfficial', 'isSerious',
'account' 'account'
], ],
include: [ include: [

View File

@ -1,5 +1,5 @@
Tax number: NIF / CIF Tax number: NIF / CIF
All entries with current supplier: Todas las entradas con el proveedor actual All entries with current supplier: Todas las entradas con el proveedor actual
Go to client: Ir al cliente Go to client: Ir al cliente
Official supplier: Proveedor oficial Verified supplier: Proveedor verificado
Inactive supplier: Proveedor inactivo Inactive supplier: Proveedor inactivo

View File

@ -90,6 +90,15 @@
rule> rule>
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Street"
ng-model="$ctrl.supplier.street"
rule
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-datalist vn-one <vn-datalist vn-one
label="Postcode" label="Postcode"

View File

@ -54,7 +54,7 @@
</div> </div>
</vn-card> </vn-card>
</vn-data-viewer> </vn-data-viewer>
<vn-popup vn-id="dialog-summary-client"> <vn-popup vn-id="dialog-summary-supplier">
<vn-supplier-summary <vn-supplier-summary
supplier="$ctrl.supplierSelected"> supplier="$ctrl.supplierSelected">
</vn-supplier-summary> </vn-supplier-summary>

View File

@ -1,7 +1,16 @@
import ngModule from '../module'; import ngModule from '../module';
import Section from 'salix/components/section'; import Section from 'salix/components/section';
export default class Controller extends Section {} export default class Controller extends Section {
openSummary(supplier, event) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.supplierSelected = supplier;
this.$.dialogSummarySupplier.show();
}
}
ngModule.vnComponent('vnSupplierIndex', { ngModule.vnComponent('vnSupplierIndex', {
template: require('./index.html'), template: require('./index.html'),

View File

@ -1,8 +1,7 @@
<vn-crud-model <vn-crud-model
vn-id="model" vn-id="model"
url="Suppliers/filter" url="Suppliers/filter"
limit="20" limit="20">
auto-load="true">
</vn-crud-model> </vn-crud-model>
<vn-portal slot="topbar"> <vn-portal slot="topbar">
<vn-searchbar <vn-searchbar

View File

@ -1,17 +1,20 @@
<vn-card class="summary"> <vn-card class="summary">
<h5>{{$ctrl.summary.name}} - {{$ctrl.summary.id}}</h5> <h5>{{::$ctrl.summary.name}} - {{::$ctrl.summary.id}}</h5>
<vn-horizontal> <vn-horizontal>
<vn-one> <vn-one>
<h4 translate>Basic data</h4> <h4 translate>Basic data</h4>
<vn-label-value label="Id" <vn-vertical>
value="{{$ctrl.summary.id}}"> <vn-label-value
label="Id"
value="{{::$ctrl.summary.id}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Alias" <vn-label-value
value="{{$ctrl.summary.nickname}}"> label="Alias"
value="{{::$ctrl.summary.nickname}}">
</vn-label-value> </vn-label-value>
<vn-check <vn-check
label="Is official" label="Verified"
ng-model="$ctrl.summary.isOfficial" ng-model="$ctrl.summary.isSerious"
disabled="true"> disabled="true">
</vn-check> </vn-check>
<vn-check <vn-check
@ -19,47 +22,29 @@
ng-model="$ctrl.summary.isActive" ng-model="$ctrl.summary.isActive"
disabled="true"> disabled="true">
</vn-check> </vn-check>
<vn-label-value label="Notes" <vn-label-value
value="{{$ctrl.summary.note}}"> label="Notes"
</vn-label-value> value="{{::$ctrl.summary.note}}">
</vn-one>
<vn-one>
<h4 translate>Fiscal address</h4>
<vn-label-value label="Social name"
value="{{$ctrl.summary.name}}">
</vn-label-value>
<vn-label-value label="Tax number"
value="{{$ctrl.summary.nif}}">
</vn-label-value>
<vn-label-value label="Street" ellipsize="false"
value="{{$ctrl.summary.street}}">
</vn-label-value>
<vn-label-value label="City"
value="{{$ctrl.summary.city}}">
</vn-label-value>
<vn-label-value label="Postcode"
value="{{$ctrl.summary.postCode}}">
</vn-label-value>
<vn-label-value label="Province"
value="{{$ctrl.summary.province.name}}">
</vn-label-value>
<vn-label-value label="Country"
value="{{$ctrl.summary.country.country}}">
</vn-label-value> </vn-label-value>
</vn-vertical>
</vn-one> </vn-one>
<vn-one> <vn-one>
<h4 translate>Billing data</h4> <h4 translate>Billing data</h4>
<vn-label-value label="Pay method" <vn-label-value
value="{{$ctrl.summary.payMethod.name}}"> label="Pay method"
value="{{::$ctrl.summary.payMethod.name}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Payment deadline" <vn-label-value
value="{{$ctrl.summary.payDem.payDem}}"> label="Payment deadline"
value="{{::$ctrl.summary.payDem.payDem}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Pay day" <vn-label-value
value="{{$ctrl.summary.payDay}}"> label="Pay day"
value="{{::$ctrl.summary.payDay}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Account" <vn-label-value
value="{{$ctrl.summary.account}}"> label="Account"
value="{{::$ctrl.summary.account}}">
</vn-label-value> </vn-label-value>
<vn-check <vn-check
label="Is Farmer" label="Is Farmer"
@ -68,6 +53,58 @@
</vn-check> </vn-check>
</vn-one> </vn-one>
</vn-horizontal> </vn-horizontal>
<vn-horizontal>
<vn-one>
<h4 translate>Fiscal data</h4>
<vn-label-value
label="Sage tax type"
value="{{::$ctrl.summary.sageTaxType.vat}}">
</vn-label-value>
<vn-label-value
title="{{::$ctrl.summary.sageTransactionType.transaction}}"
label="Sage transaction type"
value="{{::$ctrl.summary.sageTransactionType.transaction}}">
</vn-label-value>
<vn-label-value
title="{{::$ctrl.summary.sageWithholding.withholding}}"
label="Sage withholding"
value="{{::$ctrl.summary.sageWithholding.withholding}}">
</vn-label-value>
</vn-one>
</vn-horizontal>
<vn-horizontal>
<vn-one>
<h4 translate>Fiscal address</h4>
<vn-label-value
label="Social name"
value="{{::$ctrl.summary.name}}">
</vn-label-value>
<vn-label-value
label="Tax number"
value="{{::$ctrl.summary.nif}}">
</vn-label-value>
<vn-label-value
label="Street"
value="{{::$ctrl.summary.street}}">
</vn-label-value>
<vn-label-value
label="City"
value="{{::$ctrl.summary.city}}">
</vn-label-value>
<vn-label-value
label="Postcode"
value="{{::$ctrl.summary.postCode}}">
</vn-label-value>
<vn-label-value
label="Province"
value="{{::$ctrl.summary.province.name}}">
</vn-label-value>
<vn-label-value
label="Country"
value="{{::$ctrl.summary.country.country}}">
</vn-label-value>
</vn-one>
</vn-horizontal>
</vn-card> </vn-card>
<vn-worker-descriptor-popover <vn-worker-descriptor-popover
vn-id="workerDescriptor"> vn-id="workerDescriptor">

View File

@ -1,5 +1,8 @@
Is official: Es oficial Verified: Verificado
Country: País Country: País
Tax number: NIF / CIF Tax number: NIF / CIF
Search suppliers by id, name or alias: Busca proveedores por id, nombre o alias Search suppliers by id, name or alias: Busca proveedores por id, nombre o alias
Is Farmer: Es agrícola Is Farmer: Es agrícola
Sage tax type: Tipo de impuesto Sage
Sage transaction type: Tipo de transacción Sage
Sage withholding: Retencion Sage