ionic-vhframeworks 4.1.8 → 4.2.1

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.
@@ -3582,7 +3582,7 @@ export declare class VhQueryCafe {
3582
3582
  createPaymentVnpay_Mobile(amount: number, orderDescription: string, id_payment: string, backHref: string, platform: string): any;
3583
3583
  /**
3584
3584
  * @example:
3585
- * let data = {
3585
+ * let data = {//truyền vào
3586
3586
  date: new Date(),
3587
3587
  payment_type: 5, //1 lưu (khách đã thanh toán cho vnpay); 5 lưu tạm (khách chưa thanh toán vnpay), hệ thống sẽ tự động xóa những payment này hoặc trên giao diện hiện ra cho khách tự xóa
3588
3588
  payment: 990.000,
@@ -3595,7 +3595,7 @@ export declare class VhQueryCafe {
3595
3595
  },error=>{
3596
3596
  console.log('error', error);
3597
3597
  })
3598
- * payment = {
3598
+ * payment = {//trả về
3599
3599
  _id,
3600
3600
  payment_code,
3601
3601
  id_store,
@@ -3610,7 +3610,7 @@ export declare class VhQueryCafe {
3610
3610
  * @param payment : object
3611
3611
  * @return Promise => payment = {} / error
3612
3612
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
3613
- * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail
3613
+ * @notice : hàm này chỉ dùng tạo những payment_type mà không có phát sinh payment_detail
3614
3614
  */
3615
3615
  createPayment(data: any): Promise<unknown>;
3616
3616
  /**
@@ -7842,25 +7842,25 @@ export declare class VhQuerySales {
7842
7842
  /**
7843
7843
  * Hàm này lấy về các trường trong phạm vi quản lý bán hàng trong cài đặt
7844
7844
  * @example:
7845
- * let sales_management_scope = this.vhQuerySales.getSales_Management_Scope();
7845
+ * let branch_management_scope = this.vhQuerySales.getBranch_Management_Scope();
7846
7846
  * @return Object = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope}
7847
- * => 1 áp dụng cho toàn chi nhánh, 2 áp dụng riêng cho từng chi nhánh
7847
+ * => true áp dụng cho toàn chi nhánh, false áp dụng riêng cho từng chi nhánh
7848
7848
  */
7849
- getSales_Management_Scope(): any;
7849
+ getBranch_Management_Scope(): any;
7850
7850
  /**
7851
7851
  * Hàm này cấp nhật lại các trường trong phạm vi quản lý bán hàng trong cài đặt
7852
7852
  * @example:
7853
- * this.vhQuerySales.updateSales_Management_Scope({product_scope:1, employee_scope:1, customer_scope:1, supplier_scope:1, sales_program_scope:2})
7853
+ * this.vhQuerySales.updateBranch_Management_Scope({product_scope:1, employee_scope:1, customer_scope:1, supplier_scope:1, sales_program_scope:2})
7854
7854
  .then(()=>{
7855
- console.log('updateSales_Management_Scope');
7855
+ console.log('updateBranch_Management_Scope');
7856
7856
  }, error=>{
7857
7857
  reject(error);
7858
7858
  })
7859
7859
  * @param value = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope}
7860
- * 1 áp dụng cho toàn chi nhánh, 2 áp dụng riêng cho từng chi nhánh
7860
+ * true áp dụng cho toàn chi nhánh, false áp dụng riêng cho từng chi nhánh
7861
7861
  * @return Promise => udefined/error
7862
7862
  */
7863
- updateSales_Management_Scope(value: any): Promise<unknown>;
7863
+ updateBranch_Management_Scope(value: any): Promise<unknown>;
7864
7864
  /**
7865
7865
  * @description: hàm này lấy về những hạn chế của gói main_package (khách trả phí mua gói sử dụng các chức năng CHÍNH, mỗi gói sẽ có nhưng hạn chế khác nhau về user_number, show_report_duration)
7866
7866
  * @example
@@ -9186,7 +9186,7 @@ export declare class VhQuerySales {
9186
9186
  * @return Promise => object ={}
9187
9187
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9188
9188
  */
9189
- addCustomer(data: object): Promise<unknown>;
9189
+ addCustomer(data: any): Promise<unknown>;
9190
9190
  /**
9191
9191
  * @example:
9192
9192
  * this.vhQuerySales.addCustomers([{name:'Khách hàng 1', address: 'HCM'},{},...])
@@ -9243,9 +9243,9 @@ export declare class VhQuerySales {
9243
9243
  /**
9244
9244
  * Hàm này dùng để xóa hoặc đặt lại điểm mới cho khách hàng
9245
9245
  * @example:
9246
- * this.vhQuerySales.updateCustomer_byEarnedPoints('5fb6780ca2148e09806c5b01', 1000)
9246
+ * this.vhQuerySales.updateCustomer_byPoints('5fb6780ca2148e09806c5b01', 1000)
9247
9247
  .then((bool)=>{
9248
- console.log('updateCustomer_byEarnedPoints', bool);
9248
+ console.log('updateCustomer_byPoints', bool);
9249
9249
  })
9250
9250
  * @param _id
9251
9251
  * @param points
@@ -9322,7 +9322,7 @@ export declare class VhQuerySales {
9322
9322
  * @return Promise => obj = {}
9323
9323
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9324
9324
  */
9325
- addSupplier(data: object): Promise<unknown>;
9325
+ addSupplier(data: any): Promise<unknown>;
9326
9326
  /**
9327
9327
  * @example:
9328
9328
  * this.vhQuerySales.addSuppliers([{name:'Nhà cung cấp 1', address: 'HCM'},{},...])
@@ -9441,7 +9441,7 @@ export declare class VhQuerySales {
9441
9441
  * @return Promise => obj = {}
9442
9442
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9443
9443
  */
9444
- addWallet(data: object): Promise<unknown>;
9444
+ addWallet(data: any): Promise<unknown>;
9445
9445
  /**
9446
9446
  * @example:
9447
9447
  * this.vhQuerySales.updateWallet('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -9532,7 +9532,7 @@ export declare class VhQuerySales {
9532
9532
  * @return Promise => obj = {}
9533
9533
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9534
9534
  */
9535
- addTax(data: object): Promise<unknown>;
9535
+ addTax(data: any): Promise<unknown>;
9536
9536
  /**
9537
9537
  * @example:
9538
9538
  * this.vhQuerySales.updateTax('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -9625,7 +9625,7 @@ export declare class VhQuerySales {
9625
9625
  * @return Promise => obj = {}
9626
9626
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9627
9627
  */
9628
- addCategory(data: object): Promise<unknown>;
9628
+ addCategory(data: any): Promise<unknown>;
9629
9629
  /**
9630
9630
  * @example:
9631
9631
  * this.vhQuerySales.addCategorys([{name:'Danh mục 1'},{},...])
@@ -9678,7 +9678,7 @@ export declare class VhQuerySales {
9678
9678
  })
9679
9679
  * @return Promise => array(object) = [{},{},..]
9680
9680
  */
9681
- getCategorys(): Promise<unknown>;
9681
+ private getCategorys;
9682
9682
  private publishObservableEventInventorytimes;
9683
9683
  private observableLocalInventorytimes;
9684
9684
  /**
@@ -9729,7 +9729,7 @@ export declare class VhQuerySales {
9729
9729
  * @return Promise => obj = {}
9730
9730
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9731
9731
  */
9732
- addInventorytime(data: object): Promise<unknown>;
9732
+ addInventorytime(data: any): Promise<unknown>;
9733
9733
  /**
9734
9734
  * @example:
9735
9735
  * this.vhQuerySales.updateInventorytime('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -9820,7 +9820,7 @@ export declare class VhQuerySales {
9820
9820
  * @return Promise => obj = {}
9821
9821
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9822
9822
  */
9823
- addWarranty(data: object): Promise<unknown>;
9823
+ addWarranty(data: any): Promise<unknown>;
9824
9824
  /**
9825
9825
  * @example:
9826
9826
  * this.vhQuerySales.updateWarranty('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -9907,7 +9907,7 @@ export declare class VhQuerySales {
9907
9907
  * @return Promise => obj = {}
9908
9908
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9909
9909
  */
9910
- addCustomerClass(data: object): Promise<unknown>;
9910
+ addCustomerClass(data: any): Promise<unknown>;
9911
9911
  /**
9912
9912
  * @example:
9913
9913
  * this.vhQuerySales.updateCustomerClass('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -9975,7 +9975,7 @@ export declare class VhQuerySales {
9975
9975
  * @return Promise => obj = {}
9976
9976
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
9977
9977
  */
9978
- addDiscount_bill(data: object): Promise<unknown>;
9978
+ addDiscount_bill(data: any): Promise<unknown>;
9979
9979
  /**
9980
9980
  * @example:
9981
9981
  * this.vhQuerySales.updateDiscount_bill('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -10010,7 +10010,7 @@ export declare class VhQuerySales {
10010
10010
  * @return Promise => obj = {}
10011
10011
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
10012
10012
  */
10013
- addDiscount_sales(data: object): Promise<unknown>;
10013
+ addDiscount_sales(data: any): Promise<unknown>;
10014
10014
  /**
10015
10015
  * @example:
10016
10016
  * this.vhQuerySales.updateDiscount_sales('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -10064,7 +10064,7 @@ export declare class VhQuerySales {
10064
10064
  * @return Promise => obj = {}
10065
10065
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
10066
10066
  */
10067
- addCommission(data: object): Promise<unknown>;
10067
+ addCommission(data: any): Promise<unknown>;
10068
10068
  /**
10069
10069
  * @example:
10070
10070
  * this.vhQuerySales.updateCommission('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -10141,7 +10141,7 @@ export declare class VhQuerySales {
10141
10141
  * @return Promise => obj = {}
10142
10142
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
10143
10143
  */
10144
- addDelivery(data: object): Promise<unknown>;
10144
+ addDelivery(data: any): Promise<unknown>;
10145
10145
  /**
10146
10146
  * @example:
10147
10147
  * this.vhQuerySales.updateDelivery('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -10376,7 +10376,7 @@ export declare class VhQuerySales {
10376
10376
  * @return Promise => obj = {}
10377
10377
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
10378
10378
  */
10379
- addIncoming_group(data: object): Promise<unknown>;
10379
+ addIncoming_group(data: any): Promise<unknown>;
10380
10380
  /**
10381
10381
  * @example:
10382
10382
  * this.vhQuerySales.updateIncoming_group('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -10442,7 +10442,7 @@ export declare class VhQuerySales {
10442
10442
  * @return Promise => obj = {}
10443
10443
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
10444
10444
  */
10445
- addSpending_group(data: object): Promise<unknown>;
10445
+ addSpending_group(data: any): Promise<unknown>;
10446
10446
  /**
10447
10447
  * @example:
10448
10448
  * this.vhQuerySales.updateSpending_group('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -10516,13 +10516,14 @@ export declare class VhQuerySales {
10516
10516
  */
10517
10517
  private getDebtAtBeginningCustomers_byIDcustomer_byIDbranch;
10518
10518
  /**
10519
- * @example
10520
- * this.vhQuerySales.getDebtAtBeginningCustomers()
10521
- .then((debtatbeginnings)=>{
10522
- console.log('getDebtAtBeginningCustomers', debtatbeginnings);
10523
- })
10524
- * @return Promise => array(object) = [{},{},..]
10525
- */
10519
+ * Hàm lấy về những khách hàng có công nợ đầu kỳ
10520
+ * @example
10521
+ * this.vhQuerySales.getDebtAtBeginningCustomers()
10522
+ .then((debtatbeginnings)=>{
10523
+ console.log('getDebtAtBeginningCustomers', debtatbeginnings);
10524
+ })
10525
+ * @return Promise => array(object) = [{},{},..]
10526
+ */
10526
10527
  private getDebtAtBeginningCustomers;
10527
10528
  /**
10528
10529
  * @example:
@@ -10719,7 +10720,7 @@ export declare class VhQuerySales {
10719
10720
  * @param data
10720
10721
  * Promise => object = {} Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
10721
10722
  */
10722
- addPrinter(data: object): Promise<unknown>;
10723
+ addPrinter(data: any): Promise<unknown>;
10723
10724
  /**
10724
10725
  * @example:
10725
10726
  * this.vhQuerySales.updatePrinter('5fb6780ca2148e09806c5b01', {quantity:400})
@@ -11348,7 +11349,7 @@ export declare class VhQuerySales {
11348
11349
  * @return Promise => obj = {}
11349
11350
  * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
11350
11351
  */
11351
- addPromotion(data: object): Promise<unknown>;
11352
+ addPromotion(data: any): Promise<unknown>;
11352
11353
  /**
11353
11354
  * @example:
11354
11355
  * this.vhQuerySales.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
@@ -12288,9 +12289,23 @@ export declare class VhQuerySales {
12288
12289
  * @notice : ở giao diện APP, chọn IDbranch rồi mới hiện ra những IDwallet của chi nhánh đó để chọn tiếp. Nếu IDbranch = 'all' thì IDwallet phải là 'all'
12289
12290
  */
12290
12291
  getReportCashBook(starttime: any, endtime: any, IDwallet: any, IDbranch?: string): Promise<unknown>;
12292
+ /**
12293
+ * VhQuerySales:
12294
+ * @param starttime
12295
+ * @param endtime
12296
+ * @param IDwallet
12297
+ * @param IDbranch
12298
+ * @returns
12299
+ */
12291
12300
  private getReportCashBook_old;
12301
+ /**
12302
+ * VhQuerySales:
12303
+ * @param id_branch
12304
+ * @returns
12305
+ */
12292
12306
  private syncCashBook;
12293
12307
  /**
12308
+ * VhQuerySales:
12294
12309
  * Hàm này chỉ chạy trên giao diện Desktop
12295
12310
  * @returns Promise
12296
12311
  */
@@ -12413,7 +12428,7 @@ export declare class VhQuerySales {
12413
12428
  include_paid_points : false,
12414
12429
  include_tax : false,
12415
12430
  include_fee : false,
12416
- id_branch : '5fb6780ca2148e09806c5b01',
12431
+ //id_branch : '5fb6780ca2148e09806c5b01', //trong hàm đã thêm vào
12417
12432
  earned_points_clear_auto:{
12418
12433
  enable,
12419
12434
  months_of_year: 1
@@ -12499,9 +12514,10 @@ export declare class VhQuerySales {
12499
12514
  money : 100000,
12500
12515
  points : 1
12501
12516
  },
12517
+ products:['05ztAR5h3UslYo70Amut','0S8NOcG8wEUYWVo1weHV','0tmbM5SyGe5O1mvuh61l',...],
12502
12518
  include_promotion_product : false,
12503
12519
  include_paid_points : false,
12504
- id_branch : '5fb6780ca2148e09806c5b01'
12520
+ //id_branch : '5fb6780ca2148e09806c5b01' //trong hàm đã thêm vào
12505
12521
  }
12506
12522
  this.vhQuerySales.addEarningPointsProduct(data)
12507
12523
  .then((res)=>{
@@ -12660,7 +12676,7 @@ export declare class VhQuerySales {
12660
12676
  * value : 100000,
12661
12677
  * point : 1000,
12662
12678
  * id_design_barcode : "",
12663
- * id_branch :" 316OIUHLKMLSDYW235"
12679
+ * //id_branch :" 316OIUHLKMLSDYW235" //trong hàm đã có thêm vào
12664
12680
  * }
12665
12681
  * this.vhQuerySales.addCoupon(data)
12666
12682
  .then((res)=>{
@@ -12693,15 +12709,21 @@ export declare class VhQuerySales {
12693
12709
  updateCoupon(id_coupon: any, data: any): Promise<unknown>;
12694
12710
  /**
12695
12711
  * @example:
12696
- *
12697
- * this.vhQuerySales.deleteCoupon('FBHYWIBDNIUH1321687')
12698
- .then((bool)=>{
12699
- console.log('deleteCoupon', bool);
12712
+ * this.vhQuerySales.deleteCoupon("9841654DOIWSDYW235")
12713
+ .then((rsp)=>{
12714
+ console.log('deleteCoupon', rsp);
12715
+ if(rsp.vcode == 0){
12716
+ //phát thông báo xóa thành công
12717
+ }else if(rsp.vcode == 1){
12718
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
12719
+ }
12700
12720
  }, error=>{
12701
12721
  console.log('error', error);
12702
12722
  })
12703
12723
  * @param id_coupon
12704
- * @return Promise => bool = true or false
12724
+ * @return Promise => rsp = {vcode, message} / error
12725
+ * vcode == 0 : xóa thành công
12726
+ * vcode == 1 : xóa không thành công, do coupon đã được phát hành, vui lòng xóa đợt phát hành liên quan
12705
12727
  */
12706
12728
  deleteCoupon(id_coupon: any): Promise<unknown>;
12707
12729
  /**
@@ -12755,14 +12777,21 @@ export declare class VhQuerySales {
12755
12777
  updateCouponRelease(id_coupon_release: any, data: any): Promise<unknown>;
12756
12778
  /**
12757
12779
  * @example:
12758
- * this.vhQuerySales.deleteCouponRelease('ANOFIEUPOIUJ49861')
12759
- .then((bool)=>{
12760
- console.log('deleteCouponRelease', bool);
12780
+ * this.vhQuerySales.deleteCouponRelease("9841654DOIWSDYW235")
12781
+ .then((rsp)=>{
12782
+ console.log('deleteCouponRelease', rsp);
12783
+ if(rsp.vcode == 0){
12784
+ //phát thông báo xóa thành công
12785
+ }else if(rsp.vcode == 1){
12786
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
12787
+ }
12761
12788
  }, error=>{
12762
12789
  console.log('error', error);
12763
12790
  })
12764
12791
  * @param id_coupon_release
12765
- * @return Promise => bool = true or false
12792
+ * @return Promise => rsp = {vcode, message} / error
12793
+ * vcode == 0 : xóa thành công
12794
+ * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có coupon cần phát hành, vui lòng xóa coupon khỏi đợt phát hành
12766
12795
  */
12767
12796
  deleteCouponRelease(id_coupon_release: any): Promise<unknown>;
12768
12797
  /**
@@ -12810,13 +12839,20 @@ export declare class VhQuerySales {
12810
12839
  /**
12811
12840
  * @example:
12812
12841
  * this.vhQuerySales.deleteCouponReleaseDetail("9841654DOIWSDYW235")
12813
- .then((bool)=>{
12814
- console.log('deleteCouponReleaseDetail', bool);
12842
+ .then((rsp)=>{
12843
+ console.log('deleteCouponReleaseDetail', rsp);
12844
+ if(rsp.vcode == 0){
12845
+ //phát thông báo xóa thành công
12846
+ }else if(rsp.vcode == 1){
12847
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
12848
+ }
12815
12849
  }, error=>{
12816
12850
  console.log('error', error);
12817
12851
  })
12818
12852
  * @param id_coupon_release_detail
12819
- * @return Promise => bool = true or false
12853
+ * @return Promise => rsp = {vcode, message} / error
12854
+ * vcode == 0 : xóa thành công
12855
+ * vcode == 1 : xóa không thành công, do coupon_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng)
12820
12856
  */
12821
12857
  deleteCouponReleaseDetail(id_coupon_release_detail: any): Promise<unknown>;
12822
12858
  /**
@@ -12848,14 +12884,12 @@ export declare class VhQuerySales {
12848
12884
  /**
12849
12885
  * hàm này để phát hành 1 coupon_code
12850
12886
  * @example:
12887
+ //truyền vào
12851
12888
  let data = {
12852
- status :1,
12853
12889
  date_validity: new Date(),
12854
12890
  date_expire : new Date(),
12855
12891
  id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12856
- date_used : '',
12857
- date_sold : '',
12858
- id_branch :"OIIOUHDWU1654984NQYUH",
12892
+ id_coupon: '9841654DOIWSDYW235'
12859
12893
  }
12860
12894
  * this.vhQuerySales.createCouponCode(data)
12861
12895
  .then((coupon_code)=>{
@@ -12863,6 +12897,17 @@ export declare class VhQuerySales {
12863
12897
  }, error=>{
12864
12898
  console.log('error', error);
12865
12899
  })
12900
+ //trả về
12901
+ let data = {
12902
+ _id:'9841654DOIWSDYW235'
12903
+ status: 1,
12904
+ id_branch,
12905
+
12906
+ date_validity: new Date(),
12907
+ date_expire : new Date(),
12908
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12909
+ id_coupon: '9841654DOIWSDYW235'
12910
+ }
12866
12911
  * @param data
12867
12912
  * @return Promise => Object
12868
12913
  */
@@ -12871,14 +12916,12 @@ export declare class VhQuerySales {
12871
12916
  * hàm này để phát hành nhiều coupon_code theo số lượng truyền vào, và tự động cập nhật trường số lượng đã phát hành (quantity_released) tăng lên
12872
12917
  * trong collection coupon_release_details
12873
12918
  * @example:
12919
+ //truyền vào
12874
12920
  let data = {
12875
- status :1,
12876
12921
  date_validity: new Date(),
12877
12922
  date_expire : new Date(),
12878
12923
  id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12879
- date_used : '',
12880
- date_sold : '',
12881
- id_branch :"OIIOUHDWU1654984NQYUH",
12924
+ id_coupon: '9841654DOIWSDYW235'
12882
12925
  }
12883
12926
  * this.vhQuerySales.createCouponCodes(data, 10)
12884
12927
  .then((coupon_codes)=>{
@@ -12886,7 +12929,19 @@ export declare class VhQuerySales {
12886
12929
  }, error=>{
12887
12930
  console.log('error', error);
12888
12931
  })
12932
+ //trả về
12933
+ let data = {
12934
+ _id:'9841654DOIWSDYW235'
12935
+ status: 1,
12936
+ id_branch,
12937
+
12938
+ date_validity: new Date(),
12939
+ date_expire : new Date(),
12940
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12941
+ id_coupon: '9841654DOIWSDYW235'
12942
+ }
12889
12943
  * @param data
12944
+ * @param quantity <=20 : Dev kiểm tra trường quantity nhập vào không được lớn hơn 20
12890
12945
  * @return Promise => Array(object)
12891
12946
  */
12892
12947
  createCouponCodes(data: any, quantity: number): Promise<unknown>;
@@ -12906,7 +12961,7 @@ export declare class VhQuerySales {
12906
12961
  updateCouponCode(id_coupon_code: any, data: any): Promise<unknown>;
12907
12962
  /**
12908
12963
  * Hàm này chỉ cho phép xóa coupon_code đang ở trạng thái đã phát hành (status ==1),
12909
- * và cập nhật giảm trường số lượng quantity_released bớt một trong collection coupon_release_details
12964
+ * và cập nhật giảm trường số lượng quantity_released bớt 1 trong collection coupon_release_details
12910
12965
  * @example:
12911
12966
  * this.vhQuerySales.deleteCouponCode('OUHEOIWUYGHIQNIDOUW1359478'})
12912
12967
  .then((bool)=>{
@@ -12983,18 +13038,19 @@ export declare class VhQuerySales {
12983
13038
  * hàm này đã cập nhật lại trường status, id_customer, date_points_exchanged cho coupon_codes
12984
13039
  * hàm này đã cập nhật lại trường earned_points, id_customer, branch_earned_points cho customers
12985
13040
  * @example:
12986
- * this.vhQuerySales.exchangeCouponCode_byEarningPoints(['OUIYWGUDBYWUHEDW0512','1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000})
13041
+ * let array = [{id_coupon_code, points, value},{}...]
13042
+ * this.vhQuerySales.exchangeCouponCode_byEarningPoints([array,'1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000})
12987
13043
  .then((bool)=>{
12988
13044
  console.log('exchangeCouponCode_byEarningPoints', bool);
12989
13045
  }, error=>{
12990
13046
  console.log('error', error);
12991
13047
  })
12992
- * @param array_id_coupon_code
13048
+ * @param array_id_coupon_code_and_points_and_value : [{id_coupon_code, points, value}]
12993
13049
  * @param id_customer
12994
- * @param earning_points
13050
+ * @param total_points_exchanged: tổng điểm của các phiếu đã quy đổi
12995
13051
  * @return Promise => boolean = true or false
12996
13052
  */
12997
- exchangeCouponCode_byEarningPoints(array_id_coupon_code: any, id_customer: any, points: any): Promise<unknown>;
13053
+ exchangeCouponCode_byEarningPoints(array_id_coupon_code_and_points_and_value: any, id_customer: any, total_points_exchanged: any): Promise<unknown>;
12998
13054
  /**
12999
13055
  * @example:
13000
13056
  * let data = {
@@ -13041,14 +13097,21 @@ export declare class VhQuerySales {
13041
13097
  updateVoucher(id_voucher: any, data: any): Promise<unknown>;
13042
13098
  /**
13043
13099
  * @example:
13044
- * this.vhQuerySales.deleteVoucher("fuMS21I6othUm34385WV")
13045
- .then((bool)=>{
13046
- console.log('deleteVoucher', bool);
13100
+ * this.vhQuerySales.deleteVoucher("9841654DOIWSDYW235")
13101
+ .then((rsp)=>{
13102
+ console.log('deleteVoucher', rsp);
13103
+ if(rsp.vcode == 0){
13104
+ //phát thông báo xóa thành công
13105
+ }else if(rsp.vcode == 1){
13106
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
13107
+ }
13047
13108
  }, error=>{
13048
13109
  console.log('error', error);
13049
13110
  })
13050
13111
  * @param id_voucher
13051
- * @return Promise Boolean => true or false
13112
+ * @return Promise => rsp = {vcode, message} / error
13113
+ * vcode == 0 : xóa thành công
13114
+ * vcode == 1 : xóa không thành công, do voucher đã được phát hành, vui lòng xóa đợt phát hành liên quan
13052
13115
  */
13053
13116
  deleteVoucher(id_voucher: any): Promise<unknown>;
13054
13117
  /**
@@ -13108,14 +13171,21 @@ export declare class VhQuerySales {
13108
13171
  updateVoucherRelease(id_voucher_release: any, data: any): Promise<unknown>;
13109
13172
  /**
13110
13173
  * @example:
13111
- * this.vhQuerySales.deleteVoucherRelease("fuMS21I6othUm34385WV")
13112
- .then((bool)=>{
13113
- console.log('deleteVoucherRelease', bool);
13174
+ * this.vhQuerySales.deleteVoucherRelease("9841654DOIWSDYW235")
13175
+ .then((rsp)=>{
13176
+ console.log('deleteVoucherRelease', rsp);
13177
+ if(rsp.vcode == 0){
13178
+ //phát thông báo xóa thành công
13179
+ }else if(rsp.vcode == 1){
13180
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
13181
+ }
13114
13182
  }, error=>{
13115
13183
  console.log('error', error);
13116
13184
  })
13117
13185
  * @param id_voucher_release
13118
- * @return Promise Boolean => true or false
13186
+ * @return Promise => rsp = {vcode, message} / error
13187
+ * vcode == 0 : xóa thành công
13188
+ * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có voucher cần phát hành, vui lòng xóa voucher khỏi đợt phát hành
13119
13189
  */
13120
13190
  deleteVoucherRelease(id_voucher_release: any): Promise<unknown>;
13121
13191
  /**
@@ -13159,14 +13229,21 @@ export declare class VhQuerySales {
13159
13229
  addVoucherReleaseDetail(data: any): Promise<unknown>;
13160
13230
  /**
13161
13231
  * @example:
13162
- * this.vhQuerySales.deleteVoucherReleaseDetail("fuMS21I6othUm34385WV")
13163
- .then((bool)=>{
13164
- console.log('deleteVoucherReleaseDetail', bool);
13232
+ * this.vhQuerySales.deleteVoucherReleaseDetail("9841654DOIWSDYW235")
13233
+ .then((rsp)=>{
13234
+ console.log('deleteVoucherReleaseDetail', rsp);
13235
+ if(rsp.vcode == 0){
13236
+ //phát thông báo xóa thành công
13237
+ }else if(rsp.vcode == 1){
13238
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
13239
+ }
13165
13240
  }, error=>{
13166
13241
  console.log('error', error);
13167
13242
  })
13168
13243
  * @param id_voucher_release_detail
13169
- * @return Promise Boolean => true or false
13244
+ * @return Promise => rsp = {vcode, message} / error
13245
+ * vcode == 0 : xóa thành công
13246
+ * vcode == 1 : xóa không thành công, do voucher_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng)
13170
13247
  */
13171
13248
  deleteVoucherReleaseDetail(id_voucher_release_detail: any): Promise<unknown>;
13172
13249
  /**
@@ -13200,12 +13277,10 @@ export declare class VhQuerySales {
13200
13277
  * hàm này để phát hành 1 voucher_code
13201
13278
  * @example:
13202
13279
  let data = {
13203
- code: '3VU4JW0517',
13204
13280
  date_validity: new Date(),
13205
13281
  date_expire: new Date(),
13206
- status: 1,
13207
13282
  id_voucher_release_detail: "fuMS21I6othUm34385WV",
13208
- id_branch: "4zFGhVUAZyj5d09r01xZ"
13283
+ id_voucher: '9841654DOIWSDYW235'
13209
13284
  }
13210
13285
  * this.vhQuerySales.createVoucherCode(data)
13211
13286
  .then((coupon_code)=>{
@@ -13222,12 +13297,10 @@ export declare class VhQuerySales {
13222
13297
  * trong collection voucher_release_details
13223
13298
  * @example:
13224
13299
  let data = {
13225
- code: '3VU4JW0517',
13226
- date_validity: new Date(),
13227
- date_expire: new Date(),
13228
- status: 1,
13229
- id_voucher_release_detail: "fuMS21I6othUm34385WV",
13230
- id_branch: "4zFGhVUAZyj5d09r01xZ"
13300
+ date_validity: new Date(),
13301
+ date_expire: new Date(),
13302
+ id_voucher_release_detail: "fuMS21I6othUm34385WV",
13303
+ id_voucher: '9841654DOIWSDYW235'
13231
13304
  }
13232
13305
  * this.vhQuerySales.createVoucherCodes(data, 10)
13233
13306
  .then((voucher_codes)=>{
@@ -13327,7 +13400,7 @@ export declare class VhQuerySales {
13327
13400
  * @return Promise => obj ={} or null
13328
13401
  */
13329
13402
  getVoucher_Code_Name_Release(id_voucher_code: any): Promise<unknown>;
13330
- exchangeVoucherCode_byEarningPoints(array_id_voucher_code: any, id_customer: any, points: any): Promise<unknown>;
13403
+ exchangeVoucherCode_byEarningPoints(array_id_voucher_code_and_points_and_products: any, id_customer: any, points: any): Promise<unknown>;
13331
13404
  /**
13332
13405
  * @example:
13333
13406
  * let data = {
@@ -13391,14 +13464,21 @@ export declare class VhQuerySales {
13391
13464
  updatePaymentCard(id_payment_card: any, data: any): Promise<unknown>;
13392
13465
  /**
13393
13466
  * @example:
13394
- * this.vhQuerySales.deletePaymentCard('FDNOIUWDHIWH21564DWQ')
13395
- .then((bool)=>{
13396
- console.log('deletePaymentCard', bool);
13467
+ * this.vhQuerySales.deletePaymentCard("9841654DOIWSDYW235")
13468
+ .then((rsp)=>{
13469
+ console.log('deletePaymentCard', rsp);
13470
+ if(rsp.vcode == 0){
13471
+ //phát thông báo xóa thành công
13472
+ }else if(rsp.vcode == 1){
13473
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
13474
+ }
13397
13475
  }, error=>{
13398
13476
  console.log('error', error);
13399
13477
  })
13400
13478
  * @param id_payment_card
13401
- * @return Promise => bool = true or false
13479
+ * @return Promise => rsp = {vcode, message} / error
13480
+ * vcode == 0 : xóa thành công
13481
+ * vcode == 1 : xóa không thành công, do payment_card đã được phát hành, vui lòng xóa đợt phát hành liên quan
13402
13482
  */
13403
13483
  deletePaymentCard(id_payment_card: any): Promise<unknown>;
13404
13484
  /**
@@ -13451,15 +13531,21 @@ export declare class VhQuerySales {
13451
13531
  updatePaymentCardRelease(id_payment_card_release: any, data: any): Promise<unknown>;
13452
13532
  /**
13453
13533
  * @example:
13454
- * this.vhQuerySales.deletePaymentCardRelease("OIHIDUWNIDOLW123456")
13455
- .then((bool)=>{
13456
- console.log('deletePaymentCardRelease', bool);
13534
+ * this.vhQuerySales.deletePaymentCardRelease("9841654DOIWSDYW235")
13535
+ .then((rsp)=>{
13536
+ console.log('deletePaymentCardRelease', rsp);
13537
+ if(rsp.vcode == 0){
13538
+ //phát thông báo xóa thành công
13539
+ }else if(rsp.vcode == 1){
13540
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
13541
+ }
13457
13542
  }, error=>{
13458
13543
  console.log('error', error);
13459
13544
  })
13460
13545
  * @param id_payment_card_release
13461
- * @param data
13462
- * @return Promise => boolean = true or false
13546
+ * @return Promise => rsp = {vcode, message} / error
13547
+ * vcode == 0 : xóa thành công
13548
+ * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có payment_card cần phát hành, vui lòng xóa payment_card khỏi đợt phát hành
13463
13549
  */
13464
13550
  deletePaymentCardRelease(id_payment_card_release: any): Promise<unknown>;
13465
13551
  /**
@@ -13499,14 +13585,21 @@ export declare class VhQuerySales {
13499
13585
  addPaymentCardReleaseDetail(data: any): Promise<unknown>;
13500
13586
  /**
13501
13587
  * @example:
13502
- * this.vhQuerySales.deletePaymentCardReleaseDetail("OIUHFIUWHGGU41698496")
13503
- .then((bool)=>{
13504
- console.log('deletePaymentCardReleaseDetail', bool);
13588
+ * this.vhQuerySales.deletePaymentCardReleaseDetail("9841654DOIWSDYW235")
13589
+ .then((rsp)=>{
13590
+ console.log('deletePaymentCardReleaseDetail', rsp);
13591
+ if(rsp.vcode == 0){
13592
+ //phát thông báo xóa thành công
13593
+ }else if(rsp.vcode == 1){
13594
+ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng)
13595
+ }
13505
13596
  }, error=>{
13506
13597
  console.log('error', error);
13507
13598
  })
13508
13599
  * @param id_payment_card_release_detail
13509
- * @return Promise => bool = true or false
13600
+ * @return Promise => rsp = {vcode, message} / error
13601
+ * vcode == 0 : xóa thành công
13602
+ * vcode == 1 : xóa không thành công, do payment_card_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng)
13510
13603
  */
13511
13604
  deletePaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13512
13605
  /**
@@ -13541,11 +13634,10 @@ export declare class VhQuerySales {
13541
13634
  * hàm này để phát hành 1 payment_card_code
13542
13635
  * @example:
13543
13636
  let data = {
13544
- date_validity: new Date(),
13545
- date_expire: new Date(),
13546
- status: 1,
13547
- id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13548
- id_branch: "4zFGhVUAZyj5d09r01xZ"
13637
+ date_validity: new Date(),
13638
+ date_expire: new Date(),
13639
+ id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13640
+ id_payment_card: '9841654DOIWSDYW235'
13549
13641
  }
13550
13642
  * this.vhQuerySales.createPaymentCardCode(data)
13551
13643
  .then((coupon_code)=>{
@@ -13564,10 +13656,8 @@ export declare class VhQuerySales {
13564
13656
  let data = {
13565
13657
  date_validity: new Date(),
13566
13658
  date_expire: new Date(),
13567
- status: 1,
13568
13659
  id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13569
- id_branch: "4zFGhVUAZyj5d09r01xZ",
13570
- products:[{id_product, price, ptype, quantity, outquantity:0}, {id_product, price, ptype, quantity, outquantity:0}]
13660
+ id_payment_card: '9841654DOIWSDYW235'
13571
13661
  }
13572
13662
  * this.vhQuerySales.createPaymentCardCodes(data, 10)
13573
13663
  .then((voucher_codes)=>{