diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index dabb4c0cd..f507d43de 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -1107,7 +1107,8 @@ export default {
anyBuyLine: 'vn-entry-summary tr.dark-row'
},
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"]',
observations: 'vn-entry-basic-data vn-textarea[ng-model="$ctrl.entry.observation"]',
supplier: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.supplierFk"]',
diff --git a/e2e/paths/12-entry/05_basicData.spec.js b/e2e/paths/12-entry/05_basicData.spec.js
index c1aa14019..3b5f40c35 100644
--- a/e2e/paths/12-entry/05_basicData.spec.js
+++ b/e2e/paths/12-entry/05_basicData.spec.js
@@ -19,6 +19,7 @@ describe('Entry basic data path', () => {
it('should edit the basic data', async() => {
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.observations, ' edited');
await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick');
@@ -45,6 +46,13 @@ describe('Entry basic data path', () => {
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() => {
const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value');
diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js
index 1ba4166dc..3a08bffff 100644
--- a/modules/entry/back/methods/entry/filter.js
+++ b/modules/entry/back/methods/entry/filter.js
@@ -154,7 +154,8 @@ module.exports = Self => {
e.id,
e.supplierFk,
e.dated,
- e.ref,
+ e.ref reference,
+ e.ref invoiceNumber,
e.isBooked,
e.isExcludedFromAvailable,
e.notes,
diff --git a/modules/entry/back/methods/entry/importBuys.js b/modules/entry/back/methods/entry/importBuys.js
index fb2f5f452..fdc6b058e 100644
--- a/modules/entry/back/methods/entry/importBuys.js
+++ b/modules/entry/back/methods/entry/importBuys.js
@@ -12,10 +12,15 @@ module.exports = Self => {
http: {source: 'path'}
},
{
- arg: 'ref',
+ arg: 'reference',
type: 'string',
description: 'The buyed boxes ids',
},
+ {
+ arg: 'invoiceNumber',
+ type: 'string',
+ description: 'The registered invoice number',
+ },
{
arg: 'observation',
type: 'string',
@@ -63,7 +68,8 @@ module.exports = Self => {
await entry.updateAttributes({
observation: args.observation,
- ref: args.ref
+ reference: args.reference,
+ invoiceNumber: args.invoiceNumber
}, myOptions);
const travel = entry.travel();
diff --git a/modules/entry/back/methods/entry/specs/importBuys.spec.js b/modules/entry/back/methods/entry/specs/importBuys.spec.js
index 9cf6f4300..4f9204c6a 100644
--- a/modules/entry/back/methods/entry/specs/importBuys.spec.js
+++ b/modules/entry/back/methods/entry/specs/importBuys.spec.js
@@ -15,13 +15,15 @@ describe('entry import()', () => {
});
it('should import the buy rows', async() => {
- const expectedRef = '1, 2';
+ const expectedReference = '1, 2';
+ const expectedInvoiceNumber = '1, 2';
const expectedObservation = '123456';
const ctx = {
req: activeCtx,
args: {
observation: expectedObservation,
- ref: expectedRef,
+ reference: expectedReference,
+ invoiceNumber: expectedInvoiceNumber,
buys: [
{
itemFk: 1,
@@ -58,7 +60,8 @@ describe('entry import()', () => {
}, options);
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);
await tx.rollback();
diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json
index c456859a5..d3c802ad2 100644
--- a/modules/entry/back/models/entry.json
+++ b/modules/entry/back/models/entry.json
@@ -18,8 +18,17 @@
"dated": {
"type": "date"
},
- "ref": {
- "type": "string"
+ "reference": {
+ "type": "string",
+ "mysql": {
+ "columnName": "ref"
+ }
+ },
+ "invoiceNumber": {
+ "type": "string",
+ "mysql": {
+ "columnName": "ref"
+ }
},
"isBooked": {
"type": "boolean"
diff --git a/modules/entry/front/basic-data/index.html b/modules/entry/front/basic-data/index.html
index 423e9d70d..68a65e890 100644
--- a/modules/entry/front/basic-data/index.html
+++ b/modules/entry/front/basic-data/index.html
@@ -48,7 +48,7 @@
@@ -61,17 +61,25 @@
-
-
+ label="Invoice number"
+ ng-model="$ctrl.entry.invoiceNumber"
+ rule
+ vn-focus>
+
+
+
-
-
+
+
+
+
Id
Landed
Reference
+ Invoice number
Supplier
Booked
Confirmed
@@ -45,7 +46,8 @@
{{::entry.landed | date:'dd/MM/yyyy'}}
- {{::entry.ref}}
+ {{::entry.reference}}
+ {{::entry.invoiceNumber}}
{{::entry.supplierName}}
diff --git a/modules/entry/front/index/locale/es.yml b/modules/entry/front/index/locale/es.yml
index 519f8e39a..4f12fc7bb 100644
--- a/modules/entry/front/index/locale/es.yml
+++ b/modules/entry/front/index/locale/es.yml
@@ -14,4 +14,5 @@ Booked: Contabilizada
Is inventory: Inventario
Notes: Notas
Status: Estado
-Selection: Selección
\ No newline at end of file
+Selection: Selección
+Invoice number: Núm. factura
\ No newline at end of file
diff --git a/modules/entry/front/search-panel/index.html b/modules/entry/front/search-panel/index.html
index 38acdf77d..adcb9d6d4 100644
--- a/modules/entry/front/search-panel/index.html
+++ b/modules/entry/front/search-panel/index.html
@@ -13,9 +13,16 @@
+ ng-model="filter.reference">
+
+
+
+
diff --git a/modules/entry/front/search-panel/locale/es.yml b/modules/entry/front/search-panel/locale/es.yml
index 88f164145..05b71da99 100644
--- a/modules/entry/front/search-panel/locale/es.yml
+++ b/modules/entry/front/search-panel/locale/es.yml
@@ -5,4 +5,5 @@ From: Desde
To: Hasta
Agency: Agencia
Warehouse: Almacén
-Search entry by id or a suppliers by name or alias: Buscar entrada por id o proveedores por nombre y alias
\ No newline at end of file
+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
\ No newline at end of file
diff --git a/modules/entry/front/summary/index.html b/modules/entry/front/summary/index.html
index ffd8aafab..04844ab99 100644
--- a/modules/entry/front/summary/index.html
+++ b/modules/entry/front/summary/index.html
@@ -27,7 +27,10 @@
value="{{$ctrl.entryData.company.code}}">
+ value="{{$ctrl.entryData.reference}}">
+
+
diff --git a/modules/entry/front/summary/locale/es.yml b/modules/entry/front/summary/locale/es.yml
index a141ce56c..1761561ed 100644
--- a/modules/entry/front/summary/locale/es.yml
+++ b/modules/entry/front/summary/locale/es.yml
@@ -8,4 +8,4 @@ Minimum price: Precio mínimo
Buys: Compras
Travel: Envio
Go to the entry: Ir a la entrada
-
+Invoice number: Núm. factura