diff --git a/front/core/components/chip/style.scss b/front/core/components/chip/style.scss
index c89cf2b828..f6e4a388f9 100644
--- a/front/core/components/chip/style.scss
+++ b/front/core/components/chip/style.scss
@@ -21,8 +21,8 @@ vn-chip {
}
}
- &.white {
- background-color: $color-bg-panel;
+ &.transparent {
+ background-color: transparent;
}
&.colored {
background-color: $color-main;
diff --git a/modules/entry/back/methods/entry/addBuy.js b/modules/entry/back/methods/entry/addBuy.js
index 015a6fc23a..a7d2f46461 100644
--- a/modules/entry/back/methods/entry/addBuy.js
+++ b/modules/entry/back/methods/entry/addBuy.js
@@ -3,7 +3,7 @@ const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
module.exports = Self => {
Self.remoteMethodCtx('addBuy', {
- description: 'Inserts or updates buy for the current entry',
+ description: 'Inserts a new buy for the current entry',
accessType: 'WRITE',
accepts: [{
arg: 'id',
@@ -26,6 +26,34 @@ module.exports = Self => {
arg: 'packageFk',
type: 'string',
required: true
+ },
+ {
+ arg: 'packing',
+ type: 'number',
+ },
+ {
+ arg: 'grouping',
+ type: 'number'
+ },
+ {
+ arg: 'weight',
+ type: 'number',
+ },
+ {
+ arg: 'stickers',
+ type: 'number',
+ },
+ {
+ arg: 'price2',
+ type: 'number',
+ },
+ {
+ arg: 'price3',
+ type: 'number',
+ },
+ {
+ arg: 'buyingValue',
+ type: 'number'
}],
returns: {
type: 'object',
@@ -53,12 +81,13 @@ module.exports = Self => {
try {
const models = Self.app.models;
- const newBuy = await models.Buy.create({
- itemFk: ctx.args.itemFk,
- entryFk: ctx.args.id,
- packageFk: ctx.args.packageFk,
- quantity: ctx.args.quantity
- }, myOptions);
+ ctx.args.entryFk = ctx.args.id;
+
+ // remove unwanted properties
+ delete ctx.args.id;
+ delete ctx.args.ctx;
+
+ const newBuy = await models.Buy.create(ctx.args, myOptions);
let filter = {
fields: [
diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html
index a8fac79609..277b1b3475 100644
--- a/modules/entry/front/latest-buys/index.html
+++ b/modules/entry/front/latest-buys/index.html
@@ -83,12 +83,12 @@