geer-builder 1.2.488 → 1.2.489
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GRequestProduct.vue +63 -14
- package/package.json +1 -1
package/GRequestProduct.vue
CHANGED
|
@@ -90,7 +90,15 @@
|
|
|
90
90
|
</tr>
|
|
91
91
|
<tr>
|
|
92
92
|
<td>COMMISSION FEE</td>
|
|
93
|
-
<td>{{this.product_details.commission_margin ? this.product_details.commission_margin+"%" : "0%"}}</td>
|
|
93
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(computedCommision, { decimal: 2 }) : "0" }}({{this.product_details.commission_margin ? this.product_details.commission_margin+"%" : "0%"}})</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr v-if="product_deductions">
|
|
96
|
+
<td>VAT</td>
|
|
97
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(computedVat, { decimal: 2 }) : "0" }}</td>
|
|
98
|
+
</tr>
|
|
99
|
+
<tr v-if="product_deductions">
|
|
100
|
+
<td>TRANSACTION FEE</td>
|
|
101
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(computedTransaction, { decimal: 2 }) : "0" }}</td>
|
|
94
102
|
</tr>
|
|
95
103
|
<tr>
|
|
96
104
|
<td>MERCHANT GROSS</td>
|
|
@@ -235,13 +243,22 @@
|
|
|
235
243
|
<td>{{ main_currency }} {{this.product_details.selling_price ? $_formatNumber(this.product_details.selling_price, { decimal: 2 }) : "0" }}</td>
|
|
236
244
|
</tr>
|
|
237
245
|
<tr>
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
</
|
|
246
|
+
<tr>
|
|
247
|
+
<td>COMMISSION FEE</td>
|
|
248
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(computedCommision, { decimal: 2 }) : "0" }}({{this.product_details.commission_margin ? this.product_details.commission_margin+"%" : "0%"}})</td>
|
|
249
|
+
</tr>
|
|
250
|
+
<tr v-if="product_deductions">
|
|
251
|
+
<td>VAT</td>
|
|
252
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(computedVat, { decimal: 2 }) : "0" }}</td>
|
|
253
|
+
</tr>
|
|
254
|
+
<tr v-if="product_deductions">
|
|
255
|
+
<td>TRANSACTION FEE</td>
|
|
256
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(computedTransaction, { decimal: 2 }) : "0" }}</td>
|
|
257
|
+
</tr>
|
|
258
|
+
<tr>
|
|
259
|
+
<td>MERCHANT GROSS</td>
|
|
260
|
+
<td>{{ main_currency }} {{sale_price ? $_formatNumber(sale_price, { decimal: 2 }) : "0" }}</td>
|
|
261
|
+
</tr>
|
|
245
262
|
</tbody>
|
|
246
263
|
</table>
|
|
247
264
|
</div>
|
|
@@ -332,6 +349,8 @@
|
|
|
332
349
|
selling_price : 0,
|
|
333
350
|
original_price : 0,
|
|
334
351
|
commission_margin : 0,
|
|
352
|
+
vat : 0,
|
|
353
|
+
transaction_fee : 0,
|
|
335
354
|
category : "",
|
|
336
355
|
product_pictures : "",
|
|
337
356
|
description : "",
|
|
@@ -349,16 +368,34 @@
|
|
|
349
368
|
page : 1,
|
|
350
369
|
categories_list : [],
|
|
351
370
|
product_keywords: [],
|
|
352
|
-
|
|
371
|
+
computed_vat:0,
|
|
372
|
+
computed_transaction_fee:0,
|
|
373
|
+
computed_commission:0,
|
|
374
|
+
settings:{},
|
|
375
|
+
vat:0,
|
|
376
|
+
transaction_fee:0,
|
|
377
|
+
product_deductions:false,
|
|
353
378
|
}),
|
|
354
379
|
computed:
|
|
355
380
|
{
|
|
381
|
+
|
|
382
|
+
computedCommision()
|
|
383
|
+
{
|
|
384
|
+
return this.computed_commission = parseFloat((this.product_details.commission_margin / 100) * this.product_details.selling_price);
|
|
385
|
+
},
|
|
386
|
+
computedTransaction()
|
|
387
|
+
{
|
|
388
|
+
return this.computed_transaction_fee = parseFloat((this.transaction_fee / 100) * this.product_details.selling_price);
|
|
389
|
+
},
|
|
390
|
+
computedVat()
|
|
391
|
+
{
|
|
392
|
+
return this.computed_vat = parseFloat((this.vat / 100) * this.computed_commission);
|
|
393
|
+
},
|
|
356
394
|
sale_price()
|
|
357
395
|
{
|
|
358
|
-
|
|
359
|
-
return Number(this.product_details.selling_price) - Number(
|
|
360
|
-
|
|
361
|
-
}
|
|
396
|
+
let total_deduction = this.computed_commission + this.computed_transaction_fee + this.computed_vat;
|
|
397
|
+
return Number(this.product_details.selling_price) - Number(total_deduction);
|
|
398
|
+
},
|
|
362
399
|
},
|
|
363
400
|
|
|
364
401
|
async mounted()
|
|
@@ -367,9 +404,20 @@
|
|
|
367
404
|
await this.$_getSlotInfo();
|
|
368
405
|
this.getMainCurrency();
|
|
369
406
|
this.getCategoriesList();
|
|
407
|
+
this.getSettings();
|
|
370
408
|
},
|
|
371
409
|
|
|
372
410
|
methods:{
|
|
411
|
+
async getSettings()
|
|
412
|
+
{
|
|
413
|
+
this.settings = await this.$_getData('public_settings');
|
|
414
|
+
if(this.settings && this.settings.hasOwnProperty('product_deductions') && this.settings.product_deductions.active)
|
|
415
|
+
{
|
|
416
|
+
this.transaction_fee = this.settings.product_deductions.transaction_fee;
|
|
417
|
+
this.vat= this.settings.product_deductions.vat;
|
|
418
|
+
this.product_deductions = true;
|
|
419
|
+
}
|
|
420
|
+
},
|
|
373
421
|
async getCategoriesList()
|
|
374
422
|
{
|
|
375
423
|
let getCategories = await new DB_CATEGORIES().collection().get();
|
|
@@ -401,7 +449,8 @@
|
|
|
401
449
|
// console.log(this.product_details)
|
|
402
450
|
try
|
|
403
451
|
{
|
|
404
|
-
|
|
452
|
+
this.product_details.vat = this.vat;
|
|
453
|
+
this.product_details.transaction_fee = this.transaction_fee;
|
|
405
454
|
this.product_details.stockist = this.current_slot_info.slot_code;
|
|
406
455
|
this.product_details.user_info_uid = this.user_info.uid;
|
|
407
456
|
this.product_details.primary_picture=this.product_details.product_pictures[0];
|