diff --git a/client/client/routes.json b/client/client/routes.json
index c5c930d22..b1901402e 100644
--- a/client/client/routes.json
+++ b/client/client/routes.json
@@ -129,6 +129,17 @@
"params": {
"client": "$ctrl.client"
}
+ }, {
+ "url": "/greuge",
+ "state": "clientCard.greuge",
+ "component": "vn-client-greuge",
+ "params": {
+ "client": "$ctrl.client"
+ },
+ "menu": {
+ "description": "Greuge",
+ "icon": "work"
+ }
}
]
}
diff --git a/client/client/src/client.js b/client/client/src/client.js
index a6128bc5f..966ff40a8 100644
--- a/client/client/src/client.js
+++ b/client/client/src/client.js
@@ -16,3 +16,4 @@ import './note-create/note-create';
import './web-access/web-access';
import './credit-list/credit-list';
import './credit-create/credit-create';
+import './greuge/greuge';
diff --git a/client/client/src/credit-list/credit-list.html b/client/client/src/credit-list/credit-list.html
index 6d9a3bb76..9ad0d1101 100644
--- a/client/client/src/credit-list/credit-list.html
+++ b/client/client/src/credit-list/credit-list.html
@@ -10,12 +10,12 @@
-
+
- {{::credit.amount | number:2}}
+ {{::credit.amount | number:2}} €
{{::credit.created | date:'dd/MM/yyyy HH:mm' }}
diff --git a/client/client/src/credit-list/credit-list.js b/client/client/src/credit-list/credit-list.js
index a18de64aa..4c802cc9b 100644
--- a/client/client/src/credit-list/credit-list.js
+++ b/client/client/src/credit-list/credit-list.js
@@ -11,7 +11,7 @@ class ClientCreditList {
this.filter(`${field} ${order}`);
}
filter(order) {
- if (this.$.index) {
+ if (this.$.index && this.client && this.client.id) {
this.waitingMgCrud = 0;
this.$.index.filter = {
page: 1,
@@ -30,7 +30,7 @@ class ClientCreditList {
this.waitingMgCrud++;
this.$timeout(() => {
this.filter(order);
- });
+ }, 250);
}
}
diff --git a/client/client/src/greuge/greuge.html b/client/client/src/greuge/greuge.html
new file mode 100644
index 000000000..e69de29bb
diff --git a/client/client/src/greuge/greuge.js b/client/client/src/greuge/greuge.js
new file mode 100644
index 000000000..1dca71ab8
--- /dev/null
+++ b/client/client/src/greuge/greuge.js
@@ -0,0 +1,8 @@
+import ngModule from '../module';
+
+ngModule.component('vnClientGreuge', {
+ template: require('./greuge.html'),
+ bindings: {
+ client: '<'
+ }
+});
diff --git a/services/client/common/models/greuge-type.json b/services/client/common/models/greuge-type.json
new file mode 100644
index 000000000..151aea5a6
--- /dev/null
+++ b/services/client/common/models/greuge-type.json
@@ -0,0 +1,14 @@
+{
+ "name": "greugeType",
+ "base": "VnModel",
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "Number",
+ "description": "Identifier"
+ },
+ "name": {
+ "type": "String"
+ }
+ }
+ }
\ No newline at end of file
diff --git a/services/client/common/models/greuge.json b/services/client/common/models/greuge.json
new file mode 100644
index 000000000..2c00f9f73
--- /dev/null
+++ b/services/client/common/models/greuge.json
@@ -0,0 +1,35 @@
+{
+ "name": "greuge",
+ "base": "VnModel",
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "Number",
+ "description": "Identifier"
+ },
+ "description": {
+ "type": "String"
+ },
+ "amount": {
+ "type": "Number"
+ },
+ "shipped": {
+ "type": "date"
+ },
+ "created": {
+ "type": "date"
+ }
+ },
+ "relations": {
+ "client": {
+ "type": "belongsTo",
+ "model": "Client",
+ "foreignKey": "clientFk"
+ },
+ "greugeType": {
+ "type": "belongsTo",
+ "model": "greugeType",
+ "foreignKey": "greugeTypeFk"
+ }
+ }
+ }
\ No newline at end of file
diff --git a/services/client/server/model-config.json b/services/client/server/model-config.json
index 710141a87..c95fb15c7 100644
--- a/services/client/server/model-config.json
+++ b/services/client/server/model-config.json
@@ -59,5 +59,11 @@
},
"CreditClassification": {
"dataSource": "salix"
+ },
+ "greuge": {
+ "dataSource": "vn"
+ },
+ "greugeType": {
+ "dataSource": "vn"
}
}