separda la facturación en 2 modulos

This commit is contained in:
Dani Herrero 2017-05-23 10:58:17 +02:00
parent bda48488fc
commit 434002b308
6 changed files with 88 additions and 53 deletions

View File

@ -26,6 +26,15 @@
"params": {
"client": "card.client"
},
"description": "Datos fiscales",
"icon": "account_balance"
}, {
"url": "/billing-data",
"state": "clientCard.billingData",
"component": "vn-client-billing-data",
"params": {
"client": "card.client"
},
"description": "Datos facturación",
"icon": "assignment"
}, {

View File

@ -0,0 +1,41 @@
<mg-ajax path="/client/api/Clients/{{put.params.id}}" options="vnPut"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="bill.client"
form="form"
save="put"
>
</vn-watcher>
<form name="form" ng-submit="watcher.submit()" pad-medium>
<vn-card margin-small-bottom>
<vn-vertical pad-large>
<vn-title>Información de facturación</vn-title>
<vn-horizontal>
<vn-autocomplete vn-two initial-value="bill.client.payMethod" field="bill.client.payMethodFk" url="/client/api/PayMethods"
show-field="name" value-field="id" label="Forma de pago">
</vn-autocomplete>
<vn-textfield vn-two label="IBAN" field="bill.client.iban"></vn-textfield>
<vn-textfield vn-one label="Vencimiento" field="bill.client.dueDay"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Crédito" field="bill.client.credit"></vn-textfield>
<vn-textfield vn-one label="Crédito asegurado" field="bill.client.creditInsurance"></vn-textfield>
<vn-check vn-three label="Recargo de equivalencia" field="bill.client.surcharge"></vn-check>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-card margin-small-bottom>
<vn-vertical pad-large>
<vn-title>Documentación</vn-title>
<vn-horizontal>
<vn-check vn-one label="Recibido core VNH" field="bill.client.coreVnh"></vn-check>
<vn-check vn-one label="Recibido core VNL" field="bill.client.coreVnl"></vn-check>
<vn-check vn-one label="Recibido B2B VNL" field="bill.client.sepaVnl"></vn-check>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit label="Guardar"></vn-submit>
</vn-button-bar>
</form>

View File

@ -0,0 +1,11 @@
import {module} from '../module';
export const NAME = 'vnClientBillingData';
export const COMPONENT = {
template: require('./index.html'),
controllerAs: 'bill',
bindings: {
client: '<'
}
};
module.component(NAME, COMPONENT);

View File

@ -2,25 +2,28 @@ import {module} from '../module';
import './style.css';
export const NAME = 'vnClientCard';
export const COMPONENT = {
template: require('./index.html'),
controllerAs: 'card',
controller: function() {
var self = this;
self.client = null;
self.items = [];
self.$onInit = function() {
export default class vnClientCard {
constructor() {
this.client = null;
this.items = [];
this.init();
}
init() {
routes.client.routes.forEach(i => {
if (i.description)
self.items.push({
this.items.push({
description: i.description,
icon: i.icon,
href: i.state
});
});
};
}
};
}
module.component(NAME, COMPONENT);
module.component(NAME, {
template: require('./index.html'),
controllerAs: 'card',
controller: vnClientCard
});

View File

@ -6,6 +6,8 @@ export {NAME as CLIENTS,
COMPONENT as CLIENTS_COMPONENT} from './index/index';
export {NAME as CLIENT_FISCAL_DATA_INDEX,
COMPONENT as CLIENT_FISCAL_DATA_INDEX_COMPONENT} from './fiscal-data/index';
export {NAME as CLIENT_BILLING_DATA_INDEX,
COMPONENT as CLIENT_BILLINGL_DATA_INDEX_COMPONENT} from './billing-data/index';
export {NAME as CLIENT_DESCRIPTOR,
COMPONENT as CLIENT_DESCRIPTOR_COMPONENT} from './descriptor/index';
export {NAME as CLIENT_NOTES,

View File

@ -38,38 +38,7 @@
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-card margin-small-bottom>
<vn-vertical pad-large>
<vn-title>Información de facturación</vn-title>
<vn-horizontal>
<vn-autocomplete vn-two
initial-value="fiscal.client.payMethod"
field="fiscal.client.payMethodFk"
url="/client/api/PayMethods"
show-field="name"
value-field="id"
label="Forma de pago">
</vn-autocomplete>
<vn-textfield vn-two label="IBAN" field="fiscal.client.iban"></vn-textfield>
<vn-textfield vn-one label="Vencimiento" field="fiscal.client.dueDay"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Crédito" field="fiscal.client.credit"></vn-textfield>
<vn-textfield vn-one label="Crédito asegurado" field="fiscal.client.creditInsurance"></vn-textfield>
<vn-check vn-three label="Recargo de equivalencia" field="fiscal.client.surcharge"></vn-check>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-card margin-small-bottom>
<vn-vertical pad-large>
<vn-title>Documentación</vn-title>
<vn-horizontal>
<vn-check vn-one label="Recibido core VNH" field="fiscal.client.coreVnh"></vn-check>
<vn-check vn-one label="Recibido core VNL" field="fiscal.client.coreVnl"></vn-check>
<vn-check vn-one label="Recibido B2B VNL" field="fiscal.client.sepaVnl"></vn-check>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit label="Guardar"></vn-submit>
</vn-button-bar>