Merge branch 'dev' into 4159-tableQ_filter
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-11-03 07:39:47 +00:00
commit d100ab4112
18 changed files with 99 additions and 36 deletions

View File

@ -1115,7 +1115,8 @@ export default {
anyBuyLine: 'vn-entry-summary tr.dark-row' anyBuyLine: 'vn-entry-summary tr.dark-row'
}, },
entryBasicData: { entryBasicData: {
reference: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.ref"]', reference: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.reference"]',
invoiceNumber: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.invoiceNumber"]',
notes: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.notes"]', notes: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.notes"]',
observations: 'vn-entry-basic-data vn-textarea[ng-model="$ctrl.entry.observation"]', observations: 'vn-entry-basic-data vn-textarea[ng-model="$ctrl.entry.observation"]',
supplier: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.supplierFk"]', supplier: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.supplierFk"]',

View File

@ -19,6 +19,7 @@ describe('Entry basic data path', () => {
it('should edit the basic data', async() => { it('should edit the basic data', async() => {
await page.write(selectors.entryBasicData.reference, 'new movement 8'); await page.write(selectors.entryBasicData.reference, 'new movement 8');
await page.write(selectors.entryBasicData.invoiceNumber, 'new movement 8');
await page.write(selectors.entryBasicData.notes, 'new notes'); await page.write(selectors.entryBasicData.notes, 'new notes');
await page.write(selectors.entryBasicData.observations, ' edited'); await page.write(selectors.entryBasicData.observations, ' edited');
await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick'); await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick');
@ -45,6 +46,13 @@ describe('Entry basic data path', () => {
expect(result).toEqual('new movement 8'); expect(result).toEqual('new movement 8');
}); });
it('should confirm the invoiceNumber was edited', async() => {
await page.reloadSection('entry.card.basicData');
const result = await page.waitToGetProperty(selectors.entryBasicData.invoiceNumber, 'value');
expect(result).toEqual('new movement 8');
});
it('should confirm the note was edited', async() => { it('should confirm the note was edited', async() => {
const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value'); const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value');

View File

@ -154,7 +154,8 @@ module.exports = Self => {
e.id, e.id,
e.supplierFk, e.supplierFk,
e.dated, e.dated,
e.ref, e.ref reference,
e.ref invoiceNumber,
e.isBooked, e.isBooked,
e.isExcludedFromAvailable, e.isExcludedFromAvailable,
e.notes, e.notes,

View File

@ -12,10 +12,15 @@ module.exports = Self => {
http: {source: 'path'} http: {source: 'path'}
}, },
{ {
arg: 'ref', arg: 'reference',
type: 'string', type: 'string',
description: 'The buyed boxes ids', description: 'The buyed boxes ids',
}, },
{
arg: 'invoiceNumber',
type: 'string',
description: 'The registered invoice number',
},
{ {
arg: 'observation', arg: 'observation',
type: 'string', type: 'string',
@ -63,7 +68,8 @@ module.exports = Self => {
await entry.updateAttributes({ await entry.updateAttributes({
observation: args.observation, observation: args.observation,
ref: args.ref reference: args.reference,
invoiceNumber: args.invoiceNumber
}, myOptions); }, myOptions);
const travel = entry.travel(); const travel = entry.travel();

View File

@ -15,13 +15,15 @@ describe('entry import()', () => {
}); });
it('should import the buy rows', async() => { it('should import the buy rows', async() => {
const expectedRef = '1, 2'; const expectedReference = '1, 2';
const expectedInvoiceNumber = '1, 2';
const expectedObservation = '123456'; const expectedObservation = '123456';
const ctx = { const ctx = {
req: activeCtx, req: activeCtx,
args: { args: {
observation: expectedObservation, observation: expectedObservation,
ref: expectedRef, reference: expectedReference,
invoiceNumber: expectedInvoiceNumber,
buys: [ buys: [
{ {
itemFk: 1, itemFk: 1,
@ -58,7 +60,8 @@ describe('entry import()', () => {
}, options); }, options);
expect(updatedEntry.observation).toEqual(expectedObservation); expect(updatedEntry.observation).toEqual(expectedObservation);
expect(updatedEntry.ref).toEqual(expectedRef); expect(updatedEntry.reference).toEqual(expectedReference);
expect(updatedEntry.invoiceNumber).toEqual(expectedInvoiceNumber);
expect(entryBuys.length).toEqual(4); expect(entryBuys.length).toEqual(4);
await tx.rollback(); await tx.rollback();

View File

@ -18,8 +18,17 @@
"dated": { "dated": {
"type": "date" "type": "date"
}, },
"ref": { "reference": {
"type": "string" "type": "string",
"mysql": {
"columnName": "ref"
}
},
"invoiceNumber": {
"type": "string",
"mysql": {
"columnName": "ref"
}
}, },
"isBooked": { "isBooked": {
"type": "boolean" "type": "boolean"

View File

@ -48,7 +48,7 @@
<vn-textfield <vn-textfield
vn-one vn-one
label="Reference" label="Reference"
ng-model="$ctrl.entry.ref" ng-model="$ctrl.entry.reference"
rule rule
vn-focus> vn-focus>
</vn-textfield> </vn-textfield>
@ -61,12 +61,20 @@
</vn-textfield> </vn-textfield>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-textarea <vn-textfield
vn-one vn-one
label="Observation" label="Invoice number"
ng-model="$ctrl.entry.observation" ng-model="$ctrl.entry.invoiceNumber"
rule> rule
</vn-textarea> vn-focus>
</vn-textfield>
<vn-autocomplete
url="Companies"
label="Company"
show-field="code"
value-field="id"
ng-model="$ctrl.entry.companyFk">
</vn-autocomplete>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-autocomplete <vn-autocomplete
@ -84,13 +92,14 @@
ng-model="$ctrl.entry.commission" ng-model="$ctrl.entry.commission"
rule> rule>
</vn-input-number> </vn-input-number>
<vn-autocomplete </vn-horizontal>
url="Companies" <vn-horizontal>
label="Company" <vn-textarea
show-field="code" vn-one
value-field="id" label="Observation"
ng-model="$ctrl.entry.companyFk"> ng-model="$ctrl.entry.observation"
</vn-autocomplete> rule>
</vn-textarea>
</vn-horizontal> </vn-horizontal>
<vn-horizontal> <vn-horizontal>
<vn-check <vn-check

View File

@ -12,6 +12,7 @@
<vn-th field="id" number>Id</vn-th> <vn-th field="id" number>Id</vn-th>
<vn-th field="landed" center expand>Landed</vn-th> <vn-th field="landed" center expand>Landed</vn-th>
<vn-th>Reference</vn-th> <vn-th>Reference</vn-th>
<vn-th>Invoice number</vn-th>
<vn-th field="supplierFk">Supplier</vn-th> <vn-th field="supplierFk">Supplier</vn-th>
<vn-th field="isBooked" center>Booked</vn-th> <vn-th field="isBooked" center>Booked</vn-th>
<vn-th field="isConfirmed" center>Confirmed</vn-th> <vn-th field="isConfirmed" center>Confirmed</vn-th>
@ -45,7 +46,8 @@
{{::entry.landed | date:'dd/MM/yyyy'}} {{::entry.landed | date:'dd/MM/yyyy'}}
</span> </span>
</vn-td> </vn-td>
<vn-td expand>{{::entry.ref}}</vn-td> <vn-td expand>{{::entry.reference}}</vn-td>
<vn-td expand>{{::entry.invoiceNumber}}</vn-td>
<vn-td expand>{{::entry.supplierName}}</vn-td> <vn-td expand>{{::entry.supplierName}}</vn-td>
<vn-td center><vn-check ng-model="entry.isBooked" disabled="true"></vn-check></vn-td> <vn-td center><vn-check ng-model="entry.isBooked" disabled="true"></vn-check></vn-td>
<vn-td center><vn-check ng-model="entry.isConfirmed" disabled="true"></vn-check></vn-td> <vn-td center><vn-check ng-model="entry.isConfirmed" disabled="true"></vn-check></vn-td>

View File

@ -15,3 +15,4 @@ Is inventory: Inventario
Notes: Notas Notes: Notas
Status: Estado Status: Estado
Selection: Selección Selection: Selección
Invoice number: Núm. factura

View File

@ -13,8 +13,15 @@
<vn-textfield <vn-textfield
vn-one vn-one
label="Reference" label="Reference"
ng-model="filter.ref"> ng-model="filter.reference">
</vn-textfield> </vn-textfield>
<vn-textfield
vn-one
label="Invoice number"
ng-model="filter.invoiceNumber">
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield <vn-textfield
vn-one vn-one
label="Travel" label="Travel"

View File

@ -6,3 +6,4 @@ To: Hasta
Agency: Agencia Agency: Agencia
Warehouse: Almacén Warehouse: Almacén
Search entry by id or a suppliers by name or alias: Buscar entrada por id o proveedores por nombre y alias Search entry by id or a suppliers by name or alias: Buscar entrada por id o proveedores por nombre y alias
Invoice number: Núm. factura

View File

@ -27,7 +27,10 @@
value="{{$ctrl.entryData.company.code}}"> value="{{$ctrl.entryData.company.code}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Reference" <vn-label-value label="Reference"
value="{{$ctrl.entryData.ref}}"> value="{{$ctrl.entryData.reference}}">
</vn-label-value>
<vn-label-value label="Invoice number"
value="{{$ctrl.entryData.invoiceNumber}}">
</vn-label-value> </vn-label-value>
<vn-label-value label="Notes" <vn-label-value label="Notes"
value="{{$ctrl.entryData.notes}}"> value="{{$ctrl.entryData.notes}}">

View File

@ -8,4 +8,4 @@ Minimum price: Precio mínimo
Buys: Compras Buys: Compras
Travel: Envio Travel: Envio
Go to the entry: Ir a la entrada Go to the entry: Ir a la entrada
Invoice number: Núm. factura

View File

@ -264,7 +264,7 @@
<tbody> <tbody>
<tr v-for="row in intrastat"> <tr v-for="row in intrastat">
<td>{{row.code}}</td> <td>{{row.code}}</td>
<td width="50%">{{row.description}}</td> <td width="50%">{{row.description || $t('services') }}</td>
<td class="number">{{row.stems | number($i18n.locale)}}</td> <td class="number">{{row.stems | number($i18n.locale)}}</td>
<td class="number">{{row.netKg | number($i18n.locale)}}</td> <td class="number">{{row.netKg | number($i18n.locale)}}</td>
<td class="number">{{row.subtotal | currency('EUR', $i18n.locale)}}</td> <td class="number">{{row.subtotal | currency('EUR', $i18n.locale)}}</td>

View File

@ -81,7 +81,7 @@ module.exports = {
return this.rawSqlFromDef(`taxes`, [reference]); return this.rawSqlFromDef(`taxes`, [reference]);
}, },
fetchIntrastat(reference) { fetchIntrastat(reference) {
return this.rawSqlFromDef(`intrastat`, [reference, reference, reference]); return this.rawSqlFromDef(`intrastat`, [reference, reference, reference, reference]);
}, },
fetchRectified(reference) { fetchRectified(reference) {
return this.rawSqlFromDef(`rectified`, [reference]); return this.rawSqlFromDef(`rectified`, [reference]);

View File

@ -34,3 +34,4 @@ plantPassport: Plant passport
observations: Observations observations: Observations
wireTransfer: "Pay method: Transferencia" wireTransfer: "Pay method: Transferencia"
accountNumber: "Account number: {0}" accountNumber: "Account number: {0}"
services: Services

View File

@ -34,3 +34,4 @@ plantPassport: Pasaporte fitosanitario
observations: Observaciones observations: Observaciones
wireTransfer: "Forma de pago: Transferencia" wireTransfer: "Forma de pago: Transferencia"
accountNumber: "Número de cuenta: {0}" accountNumber: "Número de cuenta: {0}"
services: Servicios

View File

@ -1,4 +1,4 @@
SELECT (SELECT
ir.id code, ir.id code,
ir.description description, ir.description description,
CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems, CAST(SUM(IFNULL(i.stems, 1) * s.quantity) AS DECIMAL(10,2)) stems,
@ -19,4 +19,14 @@ SELECT
WHERE t.refFk = ? WHERE t.refFk = ?
AND i.intrastatFk AND i.intrastatFk
GROUP BY i.intrastatFk GROUP BY i.intrastatFk
ORDER BY i.intrastatFk; ORDER BY i.intrastatFk)
UNION ALL
(SELECT
NULL AS code,
NULL AS description,
0 AS stems,
0 AS netKg,
CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)) AS subtotal
FROM vn.ticketService ts
JOIN vn.ticket t ON ts.ticketFk = t.id
WHERE t.refFk = ?);