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

View File

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

View File

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

View File

@ -3,7 +3,11 @@ import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard { class Controller extends ModuleCard {
reload() { reload() {
const filter = {}; const filter = {
include: {
relation: 'supplier'
}
};
this.$http.get(`InvoiceIns/${this.$params.id}`, {filter}) this.$http.get(`InvoiceIns/${this.$params.id}`, {filter})
.then(res => this.invoiceIn = res.data); .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; 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() { loadData() {
const filter = { const filter = {
include: [ 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-tr>
</vn-thead> </vn-thead>
<vn-tbody> <vn-tbody>
<a ng-repeat="invoiceIn in model.data" <a
class="clickable vn-tr search-result"> 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>{{::invoiceIn.id}}</vn-td>
<vn-td> <vn-td>
<span <span
@ -68,7 +70,7 @@
invoice-in="$ctrl.selectedinvoiceIn"> invoice-in="$ctrl.selectedinvoiceIn">
</vn-invoice-in-summary> </vn-invoice-in-summary>
</vn-popup> </vn-popup>
<vn-supplier-descriptor-popover <!-- <vn-supplier-descriptor-popover
vn-id="supplierDescriptor"> vn-id="supplierDescriptor">
</vn-supplier-descriptor-popover> </vn-supplier-descriptor-popover>
<vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model" <vn-contextmenu vn-id="contextmenu" targets="['vn-data-viewer']" model="model"
@ -99,4 +101,4 @@
Copy value Copy value
</vn-item> </vn-item>
</slot-menu> </slot-menu>
</vn-contextmenu> </vn-contextmenu> -->