geer-builder 1.2.607 → 1.2.610

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/GCashOut.vue CHANGED
@@ -119,7 +119,7 @@ import DB_CASHOUT from './models/DB_MEMBER_CASHOUT';
119
119
  import DB_USER from './models/DB_USER';
120
120
  import CashoutStatusDialog from './dialogs/CashoutStatusDialog'
121
121
  import TinRegistrationDialog from './dialogs/TinRegistrationDialog'
122
- import {QSpinnerFacebook } from 'quasar'
122
+ import {QSpinnerFacebook } from 'quasar'
123
123
 
124
124
  export default {
125
125
  data: () =>
package/GEcomChat.vue CHANGED
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div class="g-ecom-chat">
2
+ <div class="g-ecom-chat" :style="is_popup == true ? 'width:20%' : '' ">
3
3
  <div v-if="this.user_info" class="body-grid">
4
4
  <template >
5
- <div class="conversations">
5
+ <div class="conversations" :style="is_popup == true ? 'height:90vh' : '' ">
6
6
  <q-bar class="bg-primary text-white q-pa-lg">
7
7
  <q-btn v-if="$q.platform.is.mobile" dense flat color="white" size="sm" icon="fas fa-chevron-left" v-close-popup>
8
8
  <q-tooltip content-class="bg-white text-white">Close</q-tooltip>
@@ -308,6 +308,7 @@ export default {
308
308
  components:{ GCard, GLoader, ChatAttachCode, ConfirmPasswordDialog, GSlotCreation, AddChatFloat, UpgradeSlotDialog, useBatchProductCodeDialog, UseProductCodeDialog},
309
309
  props:
310
310
  {
311
+ is_popup: Boolean,
311
312
  user_id: String,
312
313
  product_id: String,
313
314
  slot_code : String,
@@ -827,7 +828,7 @@ export default {
827
828
  .g-ecom-chat{
828
829
  // height: 381px;
829
830
  // display: inline-block;
830
- // width:40%;
831
+ // width:20%;
831
832
  // margin: auto;
832
833
  z-index: 2002;
833
834
  .body-grid{
@@ -9,10 +9,10 @@
9
9
  <div class="circle_pic" :style="this.merchant_info.profile_picture ? `background-image: url(${ this.merchant_info.profile_picture }); background-size: cover; background-position: center;` : ``"></div>
10
10
  <div class="merchant__name">
11
11
  <div class="profile_name" style="">{{this.merchant_info.full_name}}</div>
12
- <div class="active__status">Active {{timeSince( new Date(this.merchant_info.last_login_date.seconds * 1000 + this.merchant_info.last_login_date.nanoseconds/1000000))+" ago"}}</div>
12
+ <div class="active__status" v-if="merchant_info.last_login_date">Active {{timeSince( new Date(this.merchant_info.last_login_date.seconds * 1000 + this.merchant_info.last_login_date.nanoseconds/1000000))+" ago"}}</div>
13
13
  </div>
14
14
  </div>
15
- <div class="button-holder" v-if="user_info && !(this.user_info.active_slot)">
15
+ <div class="button-holder" v-if="user_info && !user_info.hasOwnProperty('active_slot')">
16
16
  <q-btn class="q-mr-sm hidden open-merchant-btn btn-color" @click="openMerchantPage()">
17
17
  <q-icon size="14px" color="gray" class="q-mr-sm" name="fa fa-store"></q-icon>
18
18
  View Page
@@ -81,6 +81,10 @@
81
81
  </q-card-section>
82
82
  </q-card>
83
83
  </q-dialog>
84
+
85
+ <q-dialog :maximized="$q.platform.is.mobile" transition-show="slide-up" transition-hide="slide-down" v-model="is_open_merchant_chat">
86
+ <g-ecom-chat v-if="current_slot_info && merchant_info" :is_popup="true" :user_id="merchant_info.uid" :product_id="productid" :slot_code="current_slot_info.slot_code" @closeDialog="is_open_merchant_chat = false"></g-ecom-chat>
87
+ </q-dialog>
84
88
  <!-- <div class="product-list-container">
85
89
  <div class="filter" style=""><q-select v-model="category_choice" dense :options="categories_list" option-label="category_identifier" map-options emit-value option-value="category_identifier" outlined></q-select>
86
90
  <q-select class="q-ml-sm" dense v-model="sort_choice" :options="['Price: High to Low', 'Price: Low to High']" @input="sortby" option-label="category_identifier" map-options emit-value option-value="category_identifier" outlined></q-select></div>
@@ -109,10 +113,11 @@ import DB_USER from './models/DB_USER';
109
113
  import DB_SLOT from './models/DB_SLOT';
110
114
  import GProductList from './GProductList';
111
115
  import GProductPage from './GProductPage';
116
+ import GEcomChat from './GEcomChat';
112
117
 
113
118
  export default {
114
119
 
115
- components: { GProductList,GProductPage },
120
+ components: { GProductList,GProductPage, GEcomChat },
116
121
  mixins: [GlobalMixins],
117
122
  props:
118
123
  {
@@ -121,6 +126,7 @@ export default {
121
126
  data: () =>
122
127
  ({
123
128
  is_rating_dialog: false,
129
+ is_open_merchant_chat: false,
124
130
  rate: 0,
125
131
  product_list:"",
126
132
  categories_list: [],
@@ -140,6 +146,8 @@ export default {
140
146
  }),
141
147
  async mounted()
142
148
  {
149
+ await this.$_getSlotInfo();
150
+ // alert(this.current_slot_info.slot_code);
143
151
  if(this.slot_code)
144
152
  await this.$bind('product_list', new DB_PRODUCTS().collection().where("type", "in", ["Product", "Membership Kit", "Exclusive"]).where("stockist", "==", this.slot_code).orderBy('created_date', 'desc'));
145
153
  await this.getCategories();
@@ -153,7 +161,7 @@ export default {
153
161
  },
154
162
  async openMerchantChat()
155
163
  {
156
-
164
+ this.is_open_merchant_chat = true;
157
165
  },
158
166
  async getUserInfo()
159
167
  {
@@ -174,9 +182,9 @@ export default {
174
182
  if(this.merchant_slot.follower_list.includes(this.user_info.uid)) this.is_following = true;
175
183
  }
176
184
  }
177
- if (this.merchant_slot.rate_list)
185
+ if (this.user_info && !this.user_info.hasOwnProperty('active_slot'))
178
186
  {
179
- if (this.user_info && !(this.user_info.active_slot))
187
+ if (this.merchant_slot.hasOwnProperty('rate_list'))
180
188
  {
181
189
  let check_user_on_list = this.merchant_slot.rate_list.includes(this.user_info.uid)
182
190
  if (!check_user_on_list)
@@ -184,14 +192,14 @@ export default {
184
192
  this.is_rating_dialog = true;
185
193
  }
186
194
  }
187
- else
195
+ else
188
196
  {
189
- this.is_rating_dialog = false;
197
+ this.is_rating_dialog = true;
190
198
  }
191
199
  }
192
- else
200
+ else
193
201
  {
194
- this.is_rating_dialog = true;
202
+ this.is_rating_dialog = false;
195
203
  }
196
204
  },
197
205
  timeSince(date) {
@@ -375,7 +383,7 @@ export default {
375
383
  ignoreRating(user_response)
376
384
  {
377
385
  this.is_rating_dialog = false;
378
- if (user_response === later)
386
+ if (user_response === "later")
379
387
  {
380
388
  setTimeout(() =>
381
389
  {
package/GProcessSale.vue CHANGED
@@ -154,10 +154,14 @@
154
154
  </tr>
155
155
  <tr v-for="(payment, index) in payment_list" :key="index">
156
156
  <td>{{payment.payment_type.method_name}}</td>
157
- <td>
157
+ <td v-if="!up_coin_pay">
158
158
  {{payment.payment_amount}} {{public_settings.cashier_currency ? public_settings.cashier_currency : ''}}
159
159
  <q-icon name="fa fa-times" size="14px" class="q-mr-sm" style="color:red" @click="removePayment(index)"></q-icon>
160
160
  </td>
161
+ <td v-else>
162
+ {{payment.payment_amount}}
163
+ <q-icon name="fa fa-times" size="14px" class="q-mr-sm" style="color:red" @click="removePayment(index)"></q-icon>
164
+ </td>
161
165
  </tr>
162
166
  <tr style="border-top:solid 1.5px black">
163
167
  <td class="subheader">Balance</td>
@@ -168,6 +172,10 @@
168
172
  </div>
169
173
 
170
174
  <div class="buttons text-right">
175
+ <q-btn v-if="up_coin_button" color="primary" @click="upcoinPay()" unelevated style="margin-right:5px">
176
+ <q-icon name="fas fa-coins" size="14px" class="q-mr-sm"></q-icon>
177
+ UPCoin Pay
178
+ </q-btn>
171
179
  <q-btn color="primary" v-if="!hide_manage_discount" @click=openDiscount unelevated style="margin-right:5px">
172
180
  <q-icon name="fa fa-percent" size="14px" class="q-mr-sm"></q-icon>
173
181
  Add Discount
@@ -176,7 +184,7 @@
176
184
  <q-icon name="fas fa-paper-plane" size="14px" class="q-mr-sm"></q-icon>
177
185
  Add Batch/Lot
178
186
  </q-btn>
179
- <q-btn color="primary" @click=addPayment unelevated style="margin-right:5px">
187
+ <q-btn v-if="!hide_receive_payment_button" color="primary" @click=addPayment unelevated style="margin-right:5px">
180
188
  <q-icon name="fa fa-credit-card" size="14px" class="q-mr-sm"></q-icon>
181
189
  Receive Payment
182
190
  </q-btn>
@@ -207,6 +215,11 @@
207
215
  <discount-dialog @closePopup="is_discount_dialog_open = false; sample($event)"></discount-dialog>
208
216
  </q-dialog>
209
217
 
218
+ <q-dialog v-model="is_change_payment_dialog_open">
219
+ <change-payment-method @closePopup="is_discount_dialog_open = false; sample($event)"></change-payment-method>
220
+ </q-dialog>
221
+
222
+
210
223
  <q-dialog v-model="is_sale_choose_slot_dialog_open">
211
224
  <sale-choose-slot-dialog :customer_email="field.email" @closePopup="is_sale_choose_slot_dialog_open = false; $emit('closePopup')" @slotSelect="getSelectedSlot"></sale-choose-slot-dialog>
212
225
  </q-dialog>
@@ -231,6 +244,7 @@ import DB_INVENTORY from "./models/DB_INVENTORY";
231
244
  import DB_COUNTER from "./models/DB_COUNTER";
232
245
  import ProcessSaleConfirmDialog from "./components/ProcessSaleConfirmDialog";
233
246
  import AddPaymentDialog from "./dialogs/AddPaymentDialog";
247
+ import ChangePaymentMethod from "./dialogs/ChangePaymentMethod";
234
248
  import ManagerOverrideDialog from "./dialogs/ManagerOverrideDialog";
235
249
  import DiscountDialog from "./components/DiscountDialog";
236
250
  import AddBatchDialog from "./components/AddBatchDialog";
@@ -246,6 +260,10 @@ export default
246
260
  mixins: [GlobalMixins],
247
261
  data: () =>
248
262
  ({
263
+ hide_receive_payment_button:false,
264
+ is_change_payment_dialog_open:false,
265
+ up_coin_pay:false,
266
+ up_coin_button:false,
249
267
  hide_manage_discount:true,
250
268
  show_batch:false,
251
269
  is_batch_number_dialog_open:false,
@@ -292,13 +310,14 @@ export default
292
310
  auto_fill_address:'',
293
311
  auto_fill_contact:'',
294
312
  all_address:[],
313
+ check_up_coin:false,
295
314
  }),
296
315
  props: ['stockist'],
297
- components: { AddBatchDialog, GProduct, ProcessSaleConfirmDialog, DiscountDialog, AddPaymentDialog, SaleChooseSlotDialog,ManagerOverrideDialog },
298
- mounted()
316
+ components: { ChangePaymentMethod,AddBatchDialog, GProduct, ProcessSaleConfirmDialog, DiscountDialog, AddPaymentDialog, SaleChooseSlotDialog,ManagerOverrideDialog },
317
+ async mounted()
299
318
  {
300
- this.getCount();
301
- this.getDiscountData();
319
+ await this.getCount();
320
+ await this.getDiscountData();
302
321
  if(this.stockist)
303
322
  {
304
323
  this.field.stockist = this.stockist;
@@ -337,6 +356,37 @@ export default
337
356
  },
338
357
  methods:
339
358
  {
359
+ async upcoinPay()
360
+ {
361
+ this.up_coin_pay = true;
362
+ await this.updateTable();
363
+
364
+ if(!this.chosen_slot_info.points.hasOwnProperty('up_coin'))
365
+ {
366
+ this.$q.dialog({ title: "Something's not quite right", html:true , message: `${this.chosen_slot_info.slot_code} doesnt have enough UPCoin` });
367
+ }
368
+ if(this.chosen_slot_info.points.up_coin < this.grandTotal)
369
+ {
370
+ this.$q.dialog({ title: "Something's not quite right", html:true , message: `${this.chosen_slot_info.slot_code} UPCoin is not enough to continue this transaction` });
371
+ }
372
+ else
373
+ {
374
+ this.hide_receive_payment_button = true;
375
+ let payment =
376
+ {
377
+ method_key:'up_coin',
378
+ method_name:'UPCoin'
379
+ };
380
+ let field =
381
+ {
382
+ payment_amount:this.grandTotal,
383
+ remarks:"UPCoin Payment",
384
+ payment_type:payment
385
+ };
386
+ this.payment_list.push(field);
387
+ this.up_coin_button = false;
388
+ }
389
+ },
340
390
  addBatch(batch)
341
391
  {
342
392
  if(Object.keys(batch).length === 0)
@@ -350,6 +400,7 @@ export default
350
400
  },
351
401
  unsetSlot()
352
402
  {
403
+ this.payment_list = [];
353
404
  this.slot_choose = false;
354
405
  this.slot_reference = null;
355
406
  },
@@ -363,6 +414,11 @@ export default
363
414
  {
364
415
  this.show_batch = true
365
416
  }
417
+ if(this.public_settings.hasOwnProperty('up_coin') && this.public_settings.up_coin.active)
418
+ {
419
+ this.check_up_coin = true;
420
+ }
421
+ console.log(this.check_up_coin, 'check');
366
422
  },
367
423
  resetData()
368
424
  {
@@ -468,6 +524,7 @@ export default
468
524
  },
469
525
  async getPayment(field)
470
526
  {
527
+ console.log(field, 'field');
471
528
  this.payment_list.push(field)
472
529
  },
473
530
  async getCount()
@@ -478,7 +535,6 @@ export default
478
535
  {
479
536
  if(this.public_settings.hasOwnProperty('cashier_auto_fill_address') && this.public_settings.cashier_auto_fill_address)
480
537
  {
481
-
482
538
  let customer_info = await new DB_USER().collection().where("email", "==", this.field.email).get();
483
539
  await this.$bind('all_address', new DB_USER_SHIPPING_ADDRESS(customer_info.docs[0].data().uid).collection().orderBy("default","desc"));
484
540
  if(this.all_address.length > 0)
@@ -686,6 +742,25 @@ export default
686
742
  }
687
743
 
688
744
  },
745
+ async checkUpCoin(product_list)
746
+ {
747
+ console.log(this.check_up_coin);
748
+ for(let element of product_list)
749
+ {
750
+ if(!element.product.hasOwnProperty('up_coin_price'))
751
+ {
752
+ this.up_coin_button = false;
753
+ }
754
+ else if(element.product.hasOwnProperty('up_coin_price') && element.product.up_coin_price < 1)
755
+ {
756
+ this.up_coin_button = false;
757
+ }
758
+ else
759
+ {
760
+ this.up_coin_button = true;
761
+ }
762
+ }
763
+ },
689
764
  async getSelectedSlot(chosen_slot)
690
765
  {
691
766
  this.slot_reference = chosen_slot.slot_code;
@@ -693,6 +768,13 @@ export default
693
768
  {
694
769
  this.chosen_slot_info = await this.db_slot.get(chosen_slot.slot_code)
695
770
  this.updateTable();
771
+ if(this.field.product_list.length > 0)
772
+ {
773
+ if(this.check_up_coin)
774
+ {
775
+ await this.checkUpCoin(this.field.product_list);
776
+ }
777
+ }
696
778
  }
697
779
 
698
780
  },
@@ -787,6 +869,10 @@ export default
787
869
  {
788
870
  if(this.field.product_list.length > 0)
789
871
  {
872
+ if(this.check_up_coin)
873
+ {
874
+ await this.checkUpCoin(this.field.product_list);
875
+ }
790
876
  let key = 'product_id'
791
877
  let holder = [...new Map(this.field.product_list.map(item =>
792
878
  [item[key], item])).values()];
@@ -812,9 +898,23 @@ export default
812
898
  // item_discount = await this.getDiscount(element)
813
899
  item_discount = new ProductClass().getProductDiscount( this.membership_list ,this.rank_list, this.chosen_slot_info, this.stockist_list, temp_var);
814
900
  }
815
- amount_holder = amount_holder + ((Number((element.product.selling_price - ((element.product.selling_price * item_discount) / 100))) * Number(element.quantity)))
816
- discount_holder = discount_holder + ((((element.product.selling_price * item_discount) / 100))) * Number(element.quantity);
817
- srp_holder = srp_holder + ((Number((element.product.selling_price * Number(element.quantity)))));
901
+
902
+ if(this.up_coin_pay)
903
+ {
904
+ amount_holder = amount_holder + Number((element.product.up_coin_price )* Number(element.quantity))
905
+ discount_holder = discount_holder + 0;
906
+ srp_holder = srp_holder + ((Number((element.product.up_coin_price * Number(element.quantity)))));
907
+
908
+ console.log(amount_holder, 'amount_holder');
909
+ console.log(discount_holder, 'discount_holder');
910
+ console.log(srp_holder, 'srp_holder');
911
+ }
912
+ else
913
+ {
914
+ amount_holder = amount_holder + ((Number((element.product.selling_price - ((element.product.selling_price * item_discount) / 100))) * Number(element.quantity)))
915
+ discount_holder = discount_holder + ((((element.product.selling_price * item_discount) / 100))) * Number(element.quantity);
916
+ srp_holder = srp_holder + ((Number((element.product.selling_price * Number(element.quantity)))));
917
+ }
818
918
  }
819
919
  };
820
920
  this.subTotal = amount_holder
package/GProductList.vue CHANGED
@@ -21,6 +21,12 @@
21
21
  <div class="commission-value">{{$_formatNumber((field.referral_commission), { decimal: 2})}} </div>
22
22
  </div>
23
23
  </template>
24
+ <template v-if="show_reseller_commission && field.referral_commission < 0">
25
+ <div class="commission-badge">
26
+ <div class="commission-label">rc: </div>
27
+ <div class="commission-value">none</div>
28
+ </div>
29
+ </template>
24
30
  <div v-if="show_description" class="product-desc" v-html="field.description"></div>
25
31
  <div class="product-list-detail" v-if="sort_by!='gc_price'">
26
32
  <div class="product-list-row">
package/GTransaction.vue CHANGED
@@ -148,6 +148,15 @@ export default
148
148
  format: val => `${val}`,
149
149
  sortable: true,
150
150
  },
151
+ {
152
+ name : 'customer_name',
153
+ label : 'Customer Name',
154
+ field : row => row.customer.name.toUpperCase(),
155
+ align : 'left',
156
+ required: true,
157
+ format: val => `${val}`,
158
+ sortable: true,
159
+ },
151
160
  {
152
161
  name : 'date',
153
162
  label : 'Date',
@@ -230,7 +239,7 @@ export default
230
239
  async getTransactionHistory()
231
240
  {
232
241
  await this.$bind('transaction_history', this.db_sale.collection().where("stockist", "==", this.user_info.branch_slot).where("status", "in", ["for pick up", "pending","completed","void", "transaction refill"]).orderBy('created_date', 'desc'));
233
- },
242
+ },
234
243
  open_dialog()
235
244
  {
236
245
  this.is_sale_history_dialog_open=true;
@@ -80,7 +80,7 @@
80
80
  <!-- <div style="color:black;">Tracking Number:</div> <div style="color:black;font-weight:600">{{list.tracking_number}}</div> -->
81
81
  <!-- <div>Status: {{list.status == "cancelled" ? "Cancelled" : ""}}</div> -->
82
82
  <div class="methods">Payment Method: {{list.payment_method.payment_method_label }}</div>
83
- <div class="methods" v-if="list.hasOwnProperty('reject_reason')">Reject Reason: {{list.reject_reason}}</div>
83
+ <div class="methods" v-if="list.hasOwnProperty('cancel_reason')">Cancellation Reason: {{list.cancel_reason}}</div>
84
84
 
85
85
  <!-- <div style="margin-left:auto;padding-left:10px;margin-right:10px;">Shipping Fee: {{main_currency}} {{$_formatNumber(list.orders.shipping_fee, { decimal: 2})}}</div>
86
86
  <div style="padding-left:10px;margin-right:10px;border-left: 1px solid rgb(194, 189, 189);" v-if="public_settings.hasOwnProperty('custom_ecommerce_fee')">{{public_settings.custom_ecommerce_fee.label}}: {{main_currency}} {{$_formatNumber(list.orders[public_settings.custom_ecommerce_fee.id], { decimal: 2})}}</div>
@@ -77,7 +77,7 @@
77
77
  </div>
78
78
  <div class="order-total">
79
79
  <div class="methods">Payment Method: {{list.payment_method.payment_method_label }}</div>
80
- <div class="methods" v-if="list.hasOwnProperty('reject_reason')">Reject Reason: {{list.reject_reason}}</div>
80
+ <div class="methods" v-if="list.hasOwnProperty('cancel_reason')">Cancellation Reason: {{list.cancel_reason}}</div>
81
81
  <!-- <div>Order Total ({{product_list[i].quantity}} Item): {{main_currency}} {{order_total}}</div> -->
82
82
  <!-- <div style="color:black;">Tracking Number:</div> <div style="color:black;font-weight:600">{{list.tracking_number}}</div> -->
83
83
  <!-- <div style="margin-left:auto;margin-right:10px;">Shipping Fee: {{main_currency}} {{$_formatNumber(list.orders.shipping_fee, { decimal: 2})}}</div>
@@ -153,11 +153,11 @@
153
153
  </div>
154
154
  <div class="row">
155
155
  <div class="col-7 label">Total Payment</div>
156
- <div class="col-5 value text-bold">{{payment_method =='gc' ? "GC" : settings.cashier_currency ? settings.cashier_currency : settings.main_currency }} {{ $_formatNumber(total_payment, { decimal: 2}) }}</div>
156
+ <div class="col-5 value text-bold">{{payment_method =='up_coin' ? 'UPCoin': payment_method =='gc' ? "GC" : settings.cashier_currency ? settings.cashier_currency : settings.main_currency }} {{ $_formatNumber(total_payment, { decimal: 2}) }}</div>
157
157
  </div>
158
158
  <div class="row">
159
159
  <div class="col-7 label">Grand Total</div>
160
- <div class="col-5 value text-primary text-bold">{{payment_method =='gc' ? "GC" : settings.main_currency ? settings.cashier_currency : settings.main_currency}} {{ $_formatNumber(grand_total, { decimal: 2}) }}</div>
160
+ <div class="col-5 value text-primary text-bold">{{ payment_method =='up_coin' ? 'UPCoin': payment_method =='gc' ? "GC" : settings.main_currency ? settings.cashier_currency : settings.main_currency}} {{ $_formatNumber(grand_total, { decimal: 2}) }}</div>
161
161
  </div>
162
162
  <div v-if="balance" class="row">
163
163
  <div class="col-7 label">Outstanding Balance</div>
@@ -58,17 +58,17 @@
58
58
  <div class="bottom-grid">
59
59
  <div class="flex-discount">
60
60
  <div class="discount-title">Subtotal</div>
61
- <div class="discount-value">{{settings.cashier_currency ? settings.cashier_currency : '' }} {{ $_formatNumber(sub_total, { decimal: 2}) }}</div>
61
+ <div class="discount-value">{{payment_method =='up_coin' ? 'UPCoin': settings.cashier_currency ? settings.cashier_currency : '' }} {{ $_formatNumber(sub_total, { decimal: 2}) }}</div>
62
62
  </div>
63
63
  <div class="flex-discount" v-if="gc_discount || payment_method != 'gc' ">
64
64
  <div class="discount-title">Total Discount</div>
65
- <div class="discount-value">{{settings.cashier_currency ? settings.cashier_currency : '' }} {{ $_formatNumber(total_discount, { decimal: 2}) }}</div>
65
+ <div class="discount-value">{{ payment_method =='up_coin' ? 'UPCoin': settings.cashier_currency ? settings.cashier_currency : '' }} {{ $_formatNumber(total_discount, { decimal: 2}) }}</div>
66
66
  </div>
67
67
  <div class="flex-total">
68
68
  <div class="total-title"><b>Grand Total</b></div>
69
- <div class="total-value"><b>{{settings.cashier_currency ? settings.cashier_currency : '' }} {{ $_formatNumber(grand_total, { decimal: 2}) }}</b></div>
69
+ <div class="total-value"><b>{{ payment_method =='up_coin' ? 'UPCoin': settings.cashier_currency ? settings.cashier_currency : '' }} {{ $_formatNumber(grand_total, { decimal: 2}) }}</b></div>
70
70
  </div>
71
- <div class="flex-change" v-if="payment_method != 'gc'">
71
+ <div class="flex-change" v-if="payment_method != 'gc' && payment_method != 'up_coin'">
72
72
  <div class="change-title">Change</div>
73
73
  <div class="change-value">{{settings.cashier_currency ? settings.cashier_currency : '' }} {{this.change}}</div>
74
74
  </div>
@@ -109,7 +109,6 @@ export default {
109
109
  {
110
110
  await this.$bind('sale', this.db_sale.doc(this.sale_id));
111
111
  await this.$bind('user', this.db_user.doc(this.sale.customer.uid));
112
-
113
112
  },
114
113
  methods:
115
114
  {
@@ -1,19 +1,36 @@
1
1
  <template>
2
2
  <q-card class="discount-dialog" style="width: 500px; max-width: 500px; padding: 20px">
3
3
  <q-form @submit="receivePayment()">
4
- <div class="fields row">
5
- <div v-if="selected_slot" class="field col-6 text-center text-bold">
6
- Current Wallet:
4
+ <div class="fields payment-wallet">
5
+ <div class="slot-holder">
6
+ {{selected_slot_info.slot_code}}
7
+ </div>
8
+ <div class="wallet-holder-grid">
9
+ <div class="wallet-holder">
10
+ <div v-if="selected_slot" class="field col-6 text-center text-bold">
11
+ Current Wallet:
12
+ </div>
13
+ <div v-if="selected_slot" class="field col-6 text-center">
14
+ {{selected_slot_info.hasOwnProperty('wallet') ? selected_slot_info.wallet : 0}}
15
+ </div>
7
16
  </div>
8
- <div v-if="selected_slot" class="field col-6 text-center text-bold">
9
- Current GC:
17
+ <div class="gc-holder">
18
+ <div v-if="selected_slot" class="field col-6 text-center text-bold">
19
+ Current GC:
20
+ </div>
21
+ <div v-if="selected_slot" class="field col-6 text-center">
22
+ {{selected_slot_info.hasOwnProperty('points') ? selected_slot_info.points.gc : 0}}
23
+ </div>
10
24
  </div>
11
- <div v-if="selected_slot" class="field col-6 text-center">
12
- {{selected_slot_info.hasOwnProperty('wallet') ? selected_slot_info.wallet : 0}}
13
- </div>
14
- <div v-if="selected_slot" class="field col-6 text-center">
15
- {{selected_slot_info.hasOwnProperty('points') ? selected_slot_info.points.gc : 0}}
25
+ <div class="up-coin-holder" v-if="!hide_up_coin">
26
+ <div v-if="selected_slot" class="field col-6 text-center text-bold">
27
+ Current UPCoin:
28
+ </div>
29
+ <div v-if="selected_slot" class="field col-6 text-center">
30
+ {{selected_slot_info.hasOwnProperty('points') ? selected_slot_info.points.up_coin : 0}}
31
+ </div>
16
32
  </div>
33
+ </div>
17
34
  <div class="field col-12 q-mt-sm" style="margin-right:20px">
18
35
  <q-select :option-label="(method) => method.hasOwnProperty('method_name') ? method.method_name : `Payment Type` " label="Payment Type" option-value="method_key" :options="payment_options" v-model="field.payment_type" stack-label></q-select>
19
36
  </div>
@@ -50,10 +67,19 @@ export default
50
67
  },
51
68
  payment_options : [],
52
69
  selected_slot_info : {wallet:0,points:{gc:0}},
70
+ public_setting:null,
71
+ hide_up_coin:true
53
72
  }),
54
73
  props: ['selected_slot', 'gc'],
55
- mounted()
74
+ async mounted()
56
75
  {
76
+ this.public_settings = await this.$_getData('public_settings');
77
+ if(this.public_settings.hasOwnProperty('up_coin') && this.public_settings.up_coin.active == true)
78
+ {
79
+ this.hide_up_coin = false;
80
+ }
81
+ console.log(this.public_settings.up_coin);
82
+ console.log(this.hide_up_coin);
57
83
  this.getPaymentMethods()
58
84
  },
59
85
  methods:
@@ -124,8 +150,18 @@ export default
124
150
  <style lang="scss">
125
151
  .discount-dialog{
126
152
  .fields {
153
+ .slot-holder{
154
+ font-size:1rem;
155
+ font-weight: bold;
156
+ text-align: center;
157
+ color: $primary;
158
+ margin: 10px auto;
159
+ }
160
+ .wallet-holder-grid{
161
+ display: grid;
162
+ grid-template-columns: 1fr 1fr;
163
+ }
127
164
  padding: 20px;
128
-
129
165
  .label {
130
166
  font-weight: bold;
131
167
  font-size: 12px;
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <div class="payment-dialog">
3
+ <div class="payment-holder">
4
+ <div class="field col-12 q-mt-sm" style="margin-right:20px">
5
+ <q-select :option-label="(method) => method.hasOwnProperty('method_name') ? method.method_name : `Payment Type` " label="Payment Type" option-value="method_key" :options="payment_options" v-model="field.payment_type" stack-label></q-select>
6
+ </div>
7
+ <div class="buttons text-right">
8
+ <q-btn @click="applyPayment" color="primary" class="full-width" unelevated>
9
+ <q-icon name="fa fa-check" size="14px" class="q-mr-sm"></q-icon>
10
+ Appy Payment Type
11
+ </q-btn>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ export default
19
+ {
20
+ filters: { },
21
+ data:() =>(
22
+ {
23
+ payment_options : [],
24
+ field: {
25
+ payment_amount:"",
26
+ remarks:""
27
+ },
28
+ payment_options : [],
29
+ }),
30
+ async mounted()
31
+ {
32
+ await this.getPaymentMethods();
33
+ },
34
+ methods:
35
+ {
36
+ applyPayment()
37
+ {
38
+ console.log(this.field.payment_type);
39
+ },
40
+ async getPaymentMethods()
41
+ {
42
+ let value_holder = []
43
+ let option_holder = await this.$_getData('cashier_payment_methods');
44
+ option_holder.forEach( (res,index) =>
45
+ {
46
+ if(res.method_key == 'wallet' || res.method_key =='gc')
47
+ {
48
+ if(this.selected_slot)
49
+ {
50
+ value_holder.push(res)
51
+ }
52
+ }
53
+ else
54
+ {
55
+ value_holder.push(res)
56
+
57
+ }
58
+
59
+ })
60
+ this.payment_options = value_holder;
61
+
62
+ // if(this.gc == true)
63
+ // {
64
+ // this.payment_options = [{method_key: "gc", method_name:"GC"}];
65
+ // }
66
+ // let slot_code = await this.$_getSlotBySlotCode(this.selected_slot)
67
+ // this.selected_slot_info = slot_code != undefined ? slot_code : {}
68
+
69
+ },
70
+ },
71
+ computed: { }
72
+ }
73
+ </script>
74
+ <style lang="scss">
75
+ .payment-dialog{
76
+ padding: 20px;
77
+ background: #fff;
78
+ width: 500px;
79
+ height: 500px;
80
+ }
81
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.607",
3
+ "version": "1.2.610",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {