ticket line basico
This commit is contained in:
parent
ee6137c8e0
commit
46a6b0fb70
|
@ -10,15 +10,19 @@
|
|||
<vn-card pad-large>
|
||||
<vn-title>Create client</vn-title>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Name" field="$ctrl.client.name" vn-focus></vn-textfield>
|
||||
<vn-textfield vn-two label="Business name" field="$ctrl.client.socialName"></vn-textfield>
|
||||
<vn-textfield vn-one label="Tax number" field="$ctrl.client.fi"></vn-textfield>
|
||||
|
||||
<vn-check
|
||||
vn-one
|
||||
label="Is equalizated"
|
||||
field="$ctrl.client.isEqualizated">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Business name" field="$ctrl.client.socialName"></vn-textfield>
|
||||
<vn-textfield vn-two label="Comercial Name" field="$ctrl.client.name" vn-focus></vn-textfield>
|
||||
<vn-textfield vn-one label="Web user" field="$ctrl.client.userName"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Email" field="$ctrl.client.email" info="You can save multiple emails"></vn-textfield>
|
||||
<vn-textfield vn-two label="Email" field="$ctrl.client.email" info="You can save multiple emails"></vn-textfield>
|
||||
<vn-autocomplete vn-one
|
||||
field="$ctrl.client.salesPersonFk"
|
||||
url="/client/api/Clients/activeSalesPerson"
|
||||
|
@ -29,6 +33,32 @@
|
|||
where="{or: [{firstName: {regexp: 'search'}}, {name: {regexp: 'search'}}]}">
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Postcode"
|
||||
field="$ctrl.client.postcode">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-two
|
||||
label="Street"
|
||||
field="$ctrl.client.street">
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-two
|
||||
label="City"
|
||||
field="$ctrl.client.city">
|
||||
</vn-textfield>
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
initial-data="$ctrl.client.province"
|
||||
field="$ctrl.client.provinceFk"
|
||||
url="/client/api/Provinces"
|
||||
show-field="name"
|
||||
value-field="id"
|
||||
label="Province">
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit label="Create"></vn-submit>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
import './style.scss';
|
|
@ -0,0 +1,16 @@
|
|||
.vn-grid {
|
||||
border-collapse: collapse;
|
||||
td, th{
|
||||
text-align: left;
|
||||
padding: 10px;
|
||||
}
|
||||
& > thead, & > tbody {
|
||||
border-bottom: 3px solid #9D9D9D;
|
||||
}
|
||||
& > tbody > tr{
|
||||
border-bottom: 1px solid #9D9D9D;
|
||||
}
|
||||
td[number], th[number]{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
|
@ -16,6 +16,7 @@ import './drop-down/drop-down';
|
|||
import './menu/menu';
|
||||
import './column-header/column-header';
|
||||
import './grid-header/grid-header';
|
||||
import './grid/grid';
|
||||
import './multi-check/multi-check';
|
||||
import './date-picker/date-picker';
|
||||
import './button/button';
|
||||
|
|
|
@ -23,14 +23,14 @@
|
|||
<tpl-item>{{code}} : {{name}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
url="/item/api/Intrastats"
|
||||
label="Intrastat"
|
||||
show-field="description"
|
||||
value-field="id"
|
||||
field="$ctrl.item.intrastatFk"
|
||||
where="{or: [{id: {regexp: 'search'}}, {description: {regexp: 'search'}}]}">
|
||||
url="/item/api/Intrastats"
|
||||
label="Intrastat"
|
||||
show-field="description"
|
||||
value-field="id"
|
||||
field="$ctrl.item.intrastatFk"
|
||||
where="{or: [{id: {regexp: 'search'}}, {description: {regexp: 'search'}}]}">
|
||||
<tpl-item>{{id}} : {{description}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete vn-one
|
||||
|
@ -40,12 +40,6 @@
|
|||
value-field="id"
|
||||
field="$ctrl.item.originFk">
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
url="/item/api/Expences"
|
||||
label="Expence"
|
||||
field="$ctrl.item.expenceFk"
|
||||
initial-data="$ctrl.item.expence">
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-button-bar>
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<mg-ajax path="/ticket/api/sales/filter" options="vnIndex"></mg-ajax>
|
||||
<vn-vertical>
|
||||
<vn-card pad-large>
|
||||
<vn-vertical>
|
||||
<vn-title>Sale</vn-title>
|
||||
<table class="vn-grid">
|
||||
<thead>
|
||||
<tr>
|
||||
<th number translate>Item</th>
|
||||
<th translate style="text-align:center">Description</th>
|
||||
<th number translate>Quantity</th>
|
||||
<th number translate>Price</th>
|
||||
<th number translate>Discount</th>
|
||||
<th number translate>Amount</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="sale in index.model.instances track by sale.id">
|
||||
<td number>{{::sale.itemFk}}</td>
|
||||
<td>
|
||||
<vn-vertical style="text-align:center">
|
||||
<vn-one>{{::sale.concept}}</vn-one>
|
||||
<vn-one>
|
||||
<vn-one ng-repeat="fetchedTag in sale.itemTag track by $index">
|
||||
<vn-label>{{::fetchedTag.tag.name}} </vn-label>{{::fetchedTag.value}}
|
||||
</vn-one>
|
||||
</vn-one>
|
||||
</vn-vertical>
|
||||
</td>
|
||||
<td number>{{::sale.quantity}}</td>
|
||||
<td number>{{::sale.price | currency:'€':2}}</td>
|
||||
<td number>{{::sale.discount}} %</td>
|
||||
<td number>{{::sale.quantity * sale.price | currency:'€':2}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</vn-vertical>
|
||||
</vn-card>
|
||||
</vn-vertical>
|
|
@ -0,0 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
import FilterTicketList from '../filter-ticket-list';
|
||||
|
||||
ngModule.component('vnTicketSale', {
|
||||
template: require('./sale.html'),
|
||||
controller: FilterTicketList
|
||||
});
|
|
@ -10,5 +10,7 @@
|
|||
"Ya existe un usuario con ese nombre": "Ya existe un usuario con ese nombre",
|
||||
"ValidationError: The `Item` instance is not valid. Details: `originFk` Cannot be blank (value: undefined).": "ValidationError: The `Item` instance is not valid. Details: `originFk` Cannot be blank (value: undefined).",
|
||||
"Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`vn2008`.`Articles`, CONSTRAINT `Articles_ibfk_5` FOREIGN KEY (`tipo_id`) REFERENCES `Tipos` (`tipo_id`) ON UPDATE CASCADE)": "Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`vn2008`.`Articles`, CONSTRAINT `Articles_ibfk_5` FOREIGN KEY (`tipo_id`) REFERENCES `Tipos` (`tipo_id`) ON UPDATE CASCADE)",
|
||||
"Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`vn2008`.`Articles`, CONSTRAINT `expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `Gastos` (`Id_Gasto`) ON UPDATE CASCADE)": "Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`vn2008`.`Articles`, CONSTRAINT `expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `Gastos` (`Id_Gasto`) ON UPDATE CASCADE)"
|
||||
"Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`vn2008`.`Articles`, CONSTRAINT `expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `Gastos` (`Id_Gasto`) ON UPDATE CASCADE)": "Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (`vn2008`.`Articles`, CONSTRAINT `expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `Gastos` (`Id_Gasto`) ON UPDATE CASCADE)",
|
||||
"INVALID_USER_NAME": "INVALID_USER_NAME",
|
||||
"La razón social debe ser única": "La razón social debe ser única"
|
||||
}
|
|
@ -35,7 +35,12 @@ module.exports = function(Self) {
|
|||
fi: data.fi,
|
||||
socialName: data.socialName,
|
||||
email: data.email,
|
||||
salesPersonFk: data.salesPersonFk
|
||||
salesPersonFk: data.salesPersonFk,
|
||||
postcode: data.postcode,
|
||||
street: data.street,
|
||||
city: data.city,
|
||||
provinceFk: data.provinceFk,
|
||||
isEqualizated: data.isEqualizated
|
||||
};
|
||||
newClient = await Self.create(client, {transaction});
|
||||
await transaction.commit();
|
||||
|
|
Loading…
Reference in New Issue