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: {
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"]',
notes: 'vn-supplier-basic-data vn-textarea[ng-model="$ctrl.supplier.note"]',
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() => {
await page.clearInput(selectors.supplierBasicData.alias);
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.write(selectors.supplierBasicData.notes, 'Some notes');
@ -40,8 +40,8 @@ describe('Supplier basic data path', () => {
expect(result).toEqual('Plants Nick SL');
});
it('should check the isOffical checkbox is now unchecked', async() => {
const result = await page.checkboxState(selectors.supplierBasicData.isOfficial);
it('should check the isSerious checkbox is now unchecked', async() => {
const result = await page.checkboxState(selectors.supplierBasicData.isSerious);
expect(result).toBe('unchecked');
});

View File

@ -25,7 +25,7 @@ module.exports = Self => {
'id',
'name',
'nickname',
'isOfficial',
'isSerious',
'isActive',
'note',
'nif',
@ -39,6 +39,9 @@ module.exports = Self => {
'payDay',
'account',
'isFarmer',
'sageTaxTypeFk',
'sageTransactionTypeFk',
'sageWithholdingFk',
],
include: [
{
@ -64,10 +67,27 @@ module.exports = Self => {
scope: {
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);
return supplier;
};

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -90,6 +90,15 @@
rule>
</vn-autocomplete>
</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-datalist vn-one
label="Postcode"

View File

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

View File

@ -1,7 +1,16 @@
import ngModule from '../module';
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', {
template: require('./index.html'),

View File

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

View File

@ -1,17 +1,20 @@
<vn-card class="summary">
<h5>{{$ctrl.summary.name}} - {{$ctrl.summary.id}}</h5>
<h5>{{::$ctrl.summary.name}} - {{::$ctrl.summary.id}}</h5>
<vn-horizontal>
<vn-one>
<h4 translate>Basic data</h4>
<vn-label-value label="Id"
value="{{$ctrl.summary.id}}">
<vn-vertical>
<vn-label-value
label="Id"
value="{{::$ctrl.summary.id}}">
</vn-label-value>
<vn-label-value label="Alias"
value="{{$ctrl.summary.nickname}}">
<vn-label-value
label="Alias"
value="{{::$ctrl.summary.nickname}}">
</vn-label-value>
<vn-check
label="Is official"
ng-model="$ctrl.summary.isOfficial"
label="Verified"
ng-model="$ctrl.summary.isSerious"
disabled="true">
</vn-check>
<vn-check
@ -19,47 +22,29 @@
ng-model="$ctrl.summary.isActive"
disabled="true">
</vn-check>
<vn-label-value label="Notes"
value="{{$ctrl.summary.note}}">
</vn-label-value>
</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
label="Notes"
value="{{::$ctrl.summary.note}}">
</vn-label-value>
</vn-vertical>
</vn-one>
<vn-one>
<h4 translate>Billing data</h4>
<vn-label-value label="Pay method"
value="{{$ctrl.summary.payMethod.name}}">
<vn-label-value
label="Pay method"
value="{{::$ctrl.summary.payMethod.name}}">
</vn-label-value>
<vn-label-value label="Payment deadline"
value="{{$ctrl.summary.payDem.payDem}}">
<vn-label-value
label="Payment deadline"
value="{{::$ctrl.summary.payDem.payDem}}">
</vn-label-value>
<vn-label-value label="Pay day"
value="{{$ctrl.summary.payDay}}">
<vn-label-value
label="Pay day"
value="{{::$ctrl.summary.payDay}}">
</vn-label-value>
<vn-label-value label="Account"
value="{{$ctrl.summary.account}}">
<vn-label-value
label="Account"
value="{{::$ctrl.summary.account}}">
</vn-label-value>
<vn-check
label="Is Farmer"
@ -68,6 +53,58 @@
</vn-check>
</vn-one>
</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-worker-descriptor-popover
vn-id="workerDescriptor">

View File

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