- {{::component.componentRate.componentType.type}}
+ {{::saleComponent.component.componentType.type}}
|
- {{::component.componentRate.name}}
+ {{::saleComponent.component.name}}
|
- {{::component.value | currency: 'EUR':3}}
+ {{::saleComponent.value | currency: 'EUR':3}}
|
- {{::sale.quantity * component.value | currency: 'EUR':3}}
+ {{::sale.quantity * saleComponent.value | currency: 'EUR':3}}
|
diff --git a/modules/ticket/front/component/index.js b/modules/ticket/front/component/index.js
index 9854305f6..027fdad77 100644
--- a/modules/ticket/front/component/index.js
+++ b/modules/ticket/front/component/index.js
@@ -15,7 +15,7 @@ class Controller {
scope: {
fields: ['componentFk', 'value'],
include: {
- relation: 'componentRate',
+ relation: 'component',
scope: {
fields: ['typeFk', 'name'],
include: {
@@ -38,9 +38,9 @@ class Controller {
if (!sales) return;
for (let sale of sales) {
- for (let component of sale.components) {
- if (component.componentRate.componentType.isBase)
- sum += sale.quantity * component.value;
+ for (let saleComponent of sale.components) {
+ if (saleComponent.component.componentType.isBase)
+ sum += sale.quantity * saleComponent.value;
}
}
diff --git a/modules/ticket/front/component/index.spec.js b/modules/ticket/front/component/index.spec.js
index e75bf2bdb..4dd361b27 100644
--- a/modules/ticket/front/component/index.spec.js
+++ b/modules/ticket/front/component/index.spec.js
@@ -14,7 +14,7 @@ describe('ticket', () => {
$scope.model.data = [{
components: [
{
- componentRate: {
+ component: {
name: 'valor de compra',
componentType: {
isBase: 1
@@ -23,7 +23,7 @@ describe('ticket', () => {
value: 5
},
{
- componentRate: {
+ component: {
name: 'reparto',
componentType: {
isBase: 0
@@ -32,7 +32,7 @@ describe('ticket', () => {
value: 5
},
{
- componentRate: {
+ component: {
name: 'recobro',
componentType: {
isBase: 0
@@ -46,7 +46,7 @@ describe('ticket', () => {
{
components: [
{
- componentRate: {
+ component: {
name: 'valor de compra',
componentType: {
isBase: 1
@@ -55,7 +55,7 @@ describe('ticket', () => {
value: 1
},
{
- componentRate: {
+ component: {
name: 'reparto',
componentType: {
isBase: 0
@@ -64,7 +64,7 @@ describe('ticket', () => {
value: 1
},
{
- componentRate: {
+ component: {
name: 'recobro',
componentType: {
isBase: 0
diff --git a/modules/ticket/front/create/card.html b/modules/ticket/front/create/card.html
index cd26f21e7..6e6b5de62 100644
--- a/modules/ticket/front/create/card.html
+++ b/modules/ticket/front/create/card.html
@@ -1,20 +1,19 @@
-