2744-invoiceIn-module_rdy_n_summary #602

Merged
joan merged 10 commits from 2744-invoiceIn-module_rdy_n_summary into dev 2021-04-15 10:06:35 +00:00
8 changed files with 121 additions and 28 deletions
Showing only changes of commit b6f31d7d44 - Show all commits

View File

@ -10,76 +10,81 @@ module.exports = Self => {
accepts: [
{
arg: 'filter',
type: 'Object',
type: 'object',
description: 'Filter defining where, order, offset, and limit - must be a JSON-encoded string',
http: {source: 'query'}
}, {
arg: 'search',
type: 'String',
type: 'string',
description: 'Searchs the entry by id',
http: {source: 'query'}
}, {
arg: 'id',
type: 'Integer',
type: 'integer',
description: 'The entry id',
http: {source: 'query'}
}, {
arg: 'created',
type: 'Date',
type: 'date',
description: 'The created date to filter',
http: {source: 'query'}
}, {
arg: 'travelFk',
type: 'Number',
type: 'number',
description: 'The travel id to filter',
http: {source: 'query'}
}, {
arg: 'companyFk',
type: 'Number',
type: 'number',
description: 'The company to filter',
http: {source: 'query'}
}, {
arg: 'isBooked',
type: 'Boolean',
type: 'boolean',
description: 'The isBokked filter',
http: {source: 'query'}
}, {
arg: 'isConfirmed',
type: 'Boolean',
type: 'boolean',
description: 'The isConfirmed filter',
http: {source: 'query'}
}, {
arg: 'isOrdered',
type: 'Boolean',
type: 'boolean',
description: 'The isOrdered filter',
http: {source: 'query'}
}, {
arg: 'ref',
type: 'String',
type: 'string',
description: 'The ref filter',
http: {source: 'query'}
}, {
arg: 'supplierFk',
type: 'Number',
type: 'number',
description: 'The supplier id to filter',
http: {source: 'query'}
}, {
arg: 'invoiceInFk',
type: 'number',
description: 'The invoiceIn id to filter',
http: {source: 'query'}
}, {
arg: 'currencyFk',
type: 'Number',
type: 'number',
description: 'The currency id to filter',
http: {source: 'query'}
}, {
arg: 'from',
type: 'Date',
type: 'date',
description: `The from date filter`
}, {
arg: 'to',
type: 'Date',
type: 'date',
description: `The to date filter`
}
],
returns: {
type: ['Object'],
type: ['object'],
root: true
},
http: {
@ -116,6 +121,7 @@ module.exports = Self => {
case 'travelFk':
case 'currencyFk':
case 'supplierFk':
case 'invoiceInFk':
param = `e.${param}`;
return {[param]: value};
}

View File

@ -17,7 +17,7 @@ module.exports = Self => {
{
arg: 'search',
type: 'string',
description: 'Searchs the invoiceOut by id',
description: 'Searchs the invoiceIn by id',
http: {source: 'query'}
},
{
@ -25,6 +25,11 @@ module.exports = Self => {
type: 'string',
description: 'The supplier reference'
},
{
arg: 'supplierFk',
type: 'number',
description: 'The supplier id'
},
{
arg: 'fi',
type: 'string',
@ -108,6 +113,7 @@ module.exports = Self => {
case 'fi':
return {[`s.${param}`]: value};
case 'supplierRef':
case 'supplierFk':
case 'serialNumber':
case 'serial':
case 'issued':
@ -132,7 +138,7 @@ module.exports = Self => {
ii.isBooked,
ii.supplierRef,
ii.docFk AS dmsFk,
s.id AS supplierFk,
ii.supplierFk,
s.name AS supplierName,
s.account,
SUM(iid.amount) AS amount,

View File

@ -18,6 +18,9 @@
"serial": {
"type": "string"
},
"supplierRef": {
"type": "string"
},
"issued": {
"type": "date"
},

View File

@ -3,7 +3,11 @@ import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {};
const filter = {
include: {
relation: 'supplier'
}
};
this.$http.get(`InvoiceIns/${this.$params.id}`, {filter})
.then(res => this.invoiceIn = res.data);

View File

@ -0,0 +1,49 @@
<vn-descriptor-content module="invoiceIn" description="$ctrl.invoiceIn.supplierRef">
<slot-menu>
<vn-item
ng-click="deleteConfirmation.show()"
vn-acl="invoicing"
vn-acl-action="remove"
name="deleteInvoice"
translate>
Delete Invoice
</vn-item>
</slot-menu>
<slot-body>
<div class="attributes">
<vn-label-value label="Date" value="{{$ctrl.invoiceIn.issued | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Booked" value="{{$ctrl.invoiceIn.booked | date: 'dd/MM/yyyy'}}">
</vn-label-value>
<vn-label-value label="Import" value="{{$ctrl.invoiceIn.amount | currency: 'EUR': 2}}">
</vn-label-value>
<vn-label-value label="Supplier">
<span ng-click="supplierDescriptor.show($event, $ctrl.invoiceIn.supplier.id)" class="link">
{{$ctrl.invoiceIn.supplier.nickname}}
</span>
</vn-label-value>
</div>
<div class="quicklinks">
<div ng-transclude="btnOne">
<vn-quick-link tooltip="Supplier" state="['supplier.card.summary', {id: $ctrl.invoiceIn.supplier.id}]"
icon="icon-supplier">
</vn-quick-link>
</div>
<div ng-transclude="btnTwo">
<vn-quick-link tooltip="Entries list" state="['entry.index', {q: $ctrl.entryFilter}]"
icon="icon-entry">
</vn-quick-link>
</div>
<div ng-transclude="btnThree">
<vn-quick-link tooltip="Invoice list" state="['invoiceIn.index', {q: $ctrl.invoiceInFilter}]"
icon="icon-invoiceIn">
</vn-quick-link>
</div>
</div>
</slot-body>
</vn-descriptor-content>
<vn-confirm vn-id="deleteConfirmation" on-accept="$ctrl.deleteInvoiceIn()"
question="Are you sure you want to delete this invoice?">
</vn-confirm>
<vn-supplier-descriptor-popover vn-id="supplierDescriptor">
</vn-supplier-descriptor-popover>

View File

@ -10,6 +10,26 @@ class Controller extends Descriptor {
this.entity = value;
}
get entryFilter() {
if (this.invoiceIn)
return JSON.stringify({invoiceInFk: this.invoiceIn.id});
return null;
}
get invoiceInFilter() {
if (this.invoiceIn)
return JSON.stringify({supplierFk: this.invoiceIn.supplierFk});
return null;
}
deleteInvoiceIn() {
return this.$http.delete(`InvoiceIns/${this.id}`)
.then(() => this.$state.go('invoiceIn.index'))
.then(() => this.vnApp.showSuccess(this.$t('InvoiceIn deleted')));
}
loadData() {
const filter = {
include: [

View File

@ -0,0 +1,3 @@
Entries list: Listado de entradas
Invoice list: Listado de facturas
InvoiceIn deleted: Factura eliminada

View File

@ -22,8 +22,10 @@
</vn-tr>
</vn-thead>
<vn-tbody>
<a ng-repeat="invoiceIn in model.data"
class="clickable vn-tr search-result">
<a
ng-repeat="invoiceIn in model.data"
class="clickable vn-tr search-result"
ui-sref="invoiceIn.card.summary({id: {{::invoiceIn.id}}})">
<vn-td>{{::invoiceIn.id}}</vn-td>
<vn-td>
<span
@ -68,7 +70,7 @@
invoice-in="$ctrl.selectedinvoiceIn">
</vn-invoice-in-summary>
</vn-popup>
<vn-supplier-descriptor-popover
<!-- <vn-supplier-descriptor-popover
vn-id="supplierDescriptor">
</vn-supplier-descriptor-popover>
<vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model"
@ -99,4 +101,4 @@
Copy value
</vn-item>
</slot-menu>
</vn-contextmenu>
</vn-contextmenu> -->