ionic-vhframeworks 4.2.0 → 4.2.3

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.
@@ -10764,7 +10764,7 @@ export declare class VhQuerySales {
10764
10764
  */
10765
10765
  getPrinters(): Promise<unknown>;
10766
10766
  /**
10767
- * Hàm này dùng để thực hiện trừ hàng hóa trong Payment_Card
10767
+ * Hàm này dùng để thực hiện trừ hàng hóa trong nhiều Payment_Card
10768
10768
  * Hàm chạy ổn định anh sẽ thêm phần trừ số lượng hàng hóa đã sử dụng trong payment_card_code
10769
10769
  * @example
10770
10770
  let bill = {
@@ -10777,6 +10777,33 @@ export declare class VhQuerySales {
10777
10777
  date: new Date(),
10778
10778
  bill_code: 'L46K0502'
10779
10779
  }
10780
+ let bill_details =[{
10781
+ id_payment_card: '7Q5BZVRlyySrhShngMDv',
10782
+ id_payment_card_code: '33cTgnd2xZo3OW9tsu1d',
10783
+ pctype: 1,
10784
+ products:[{
10785
+ id_product:'9tg6UxzK26DDVEVHsvq5'
10786
+ quantity: 5
10787
+ price: 100000
10788
+ ptype: 1,
10789
+ unit: 'cái',
10790
+ ratio:1
10791
+ },{
10792
+ id_product:'jUqd5bE6y2JhX0aCd5TF',
10793
+ quantity: 1
10794
+ price: 50000
10795
+ ptype: 2,
10796
+ unit: 'cái',
10797
+ ratio:1
10798
+ },{
10799
+ id_product,
10800
+ quantity,
10801
+ price,
10802
+ ptype: 1,
10803
+ unit: 'cái',
10804
+ ratio:1
10805
+ }]
10806
+ //dưới là cái cũ, sẽ bỏ đi
10780
10807
  let bill_details =[{
10781
10808
  id_payment_card: '7Q5BZVRlyySrhShngMDv',
10782
10809
  id_payment_card_code: '33cTgnd2xZo3OW9tsu1d',
@@ -10822,17 +10849,21 @@ export declare class VhQuerySales {
10822
10849
  id_voucher: 'voucher006',
10823
10850
  id_voucher_code: 'MHRD9N0531',
10824
10851
  vtype: 1,
10825
- quantity: 2
10826
- vouchers:[{
10852
+ quantity: 2//bỏ đi
10853
+ products:[{
10827
10854
  id_product:'9tg6UxzK26DDVEVHsvq5'
10828
10855
  quantity: 5
10829
10856
  price: 100000
10830
- ptype: 1
10857
+ ptype: 1,
10858
+ unit: 'cái',
10859
+ ratio:1
10831
10860
  },{
10832
10861
  id_product:'jUqd5bE6y2JhX0aCd5TF',
10833
10862
  quantity: 1
10834
10863
  price: 50000
10835
- ptype: 2
10864
+ ptype: 2,
10865
+ unit: 'cái',
10866
+ ratio:1
10836
10867
  },{
10837
10868
  id_product,
10838
10869
  quantity,
@@ -10842,12 +10873,16 @@ export declare class VhQuerySales {
10842
10873
  id_product,
10843
10874
  quantity,
10844
10875
  price,
10845
- ptype: 1
10876
+ ptype: 1,
10877
+ unit: 'cái',
10878
+ ratio:1
10846
10879
  },{
10847
10880
  id_product,
10848
10881
  quantity,
10849
10882
  price,
10850
- ptype: 2
10883
+ ptype: 2,
10884
+ unit: 'cái',
10885
+ ratio:1
10851
10886
  }]
10852
10887
  }]
10853
10888
  this.vhQuerySales.createBill_Billdetail_41(bill, bill_details)
@@ -10968,9 +11003,22 @@ export declare class VhQuerySales {
10968
11003
  * @return Promise => null or orror
10969
11004
  */
10970
11005
  deleteBill_Billdetail(id_bill: any): any;
11006
+ private _getBill_details_byId_bill;
11007
+ /**
11008
+ * VhQuerySales:
11009
+ * @example
11010
+ this.vhQuerySales.getBill_details_byId_bill('RcECbNgU9BdYQo37s30p')
11011
+ .then((bill_details)=>{
11012
+ console.log('getBill_details_byId_bill', bill_details);
11013
+ },(error:any)=>{
11014
+ console.log('error ', error);
11015
+ })
11016
+ * @param id_bill
11017
+ * @return Promise => array / orror
11018
+ */
10971
11019
  getBill_details_byId_bill(id_bill: any): any;
10972
11020
  getBill_detail(id_bill_detail: any): any;
10973
- getBill_details(): any;
11021
+ private getBill_details;
10974
11022
  /**
10975
11023
  * @example:
10976
11024
  * this.vhQuerySales.getBill('5fb67fda87c0f21d484cbdf3')
@@ -10994,7 +11042,7 @@ export declare class VhQuerySales {
10994
11042
  * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
10995
11043
  * @return — Array -> array = [{},{},...]
10996
11044
  */
10997
- getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
11045
+ private getBills;
10998
11046
  /**
10999
11047
  * @example:
11000
11048
  * let time = new Date();
@@ -12709,15 +12757,21 @@ export declare class VhQuerySales {
12709
12757
  updateCoupon(id_coupon: any, data: any): Promise<unknown>;
12710
12758
  /**
12711
12759
  * @example:
12712
- *
12713
- * this.vhQuerySales.deleteCoupon('FBHYWIBDNIUH1321687')
12714
- .then((bool)=>{
12715
- console.log('deleteCoupon', bool);
12760
+ * this.vhQuerySales.deleteCoupon("9841654DOIWSDYW235")
12761
+ .then((rsp)=>{
12762
+ console.log('deleteCoupon', rsp);
12763
+ if(rsp.vcode == 0){
12764
+ //phát thông báo xóa thành công
12765
+ }else if(rsp.vcode == 1){
12766
+ //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)
12767
+ }
12716
12768
  }, error=>{
12717
12769
  console.log('error', error);
12718
12770
  })
12719
12771
  * @param id_coupon
12720
- * @return Promise => bool = true or false
12772
+ * @return Promise => rsp = {vcode, message} / error
12773
+ * vcode == 0 : xóa thành công
12774
+ * 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
12721
12775
  */
12722
12776
  deleteCoupon(id_coupon: any): Promise<unknown>;
12723
12777
  /**
@@ -12771,14 +12825,21 @@ export declare class VhQuerySales {
12771
12825
  updateCouponRelease(id_coupon_release: any, data: any): Promise<unknown>;
12772
12826
  /**
12773
12827
  * @example:
12774
- * this.vhQuerySales.deleteCouponRelease('ANOFIEUPOIUJ49861')
12775
- .then((bool)=>{
12776
- console.log('deleteCouponRelease', bool);
12828
+ * this.vhQuerySales.deleteCouponRelease("9841654DOIWSDYW235")
12829
+ .then((rsp)=>{
12830
+ console.log('deleteCouponRelease', rsp);
12831
+ if(rsp.vcode == 0){
12832
+ //phát thông báo xóa thành công
12833
+ }else if(rsp.vcode == 1){
12834
+ //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)
12835
+ }
12777
12836
  }, error=>{
12778
12837
  console.log('error', error);
12779
12838
  })
12780
12839
  * @param id_coupon_release
12781
- * @return Promise => bool = true or false
12840
+ * @return Promise => rsp = {vcode, message} / error
12841
+ * vcode == 0 : xóa thành công
12842
+ * 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
12782
12843
  */
12783
12844
  deleteCouponRelease(id_coupon_release: any): Promise<unknown>;
12784
12845
  /**
@@ -12826,13 +12887,20 @@ export declare class VhQuerySales {
12826
12887
  /**
12827
12888
  * @example:
12828
12889
  * this.vhQuerySales.deleteCouponReleaseDetail("9841654DOIWSDYW235")
12829
- .then((bool)=>{
12830
- console.log('deleteCouponReleaseDetail', bool);
12890
+ .then((rsp)=>{
12891
+ console.log('deleteCouponReleaseDetail', rsp);
12892
+ if(rsp.vcode == 0){
12893
+ //phát thông báo xóa thành công
12894
+ }else if(rsp.vcode == 1){
12895
+ //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)
12896
+ }
12831
12897
  }, error=>{
12832
12898
  console.log('error', error);
12833
12899
  })
12834
12900
  * @param id_coupon_release_detail
12835
- * @return Promise => bool = true or false
12901
+ * @return Promise => rsp = {vcode, message} / error
12902
+ * vcode == 0 : xóa thành công
12903
+ * 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)
12836
12904
  */
12837
12905
  deleteCouponReleaseDetail(id_coupon_release_detail: any): Promise<unknown>;
12838
12906
  /**
@@ -12864,6 +12932,7 @@ export declare class VhQuerySales {
12864
12932
  /**
12865
12933
  * hàm này để phát hành 1 coupon_code
12866
12934
  * @example:
12935
+ //truyền vào
12867
12936
  let data = {
12868
12937
  date_validity: new Date(),
12869
12938
  date_expire : new Date(),
@@ -12876,6 +12945,17 @@ export declare class VhQuerySales {
12876
12945
  }, error=>{
12877
12946
  console.log('error', error);
12878
12947
  })
12948
+ //trả về
12949
+ let data = {
12950
+ _id:'9841654DOIWSDYW235'
12951
+ status: 1,
12952
+ id_branch,
12953
+
12954
+ date_validity: new Date(),
12955
+ date_expire : new Date(),
12956
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12957
+ id_coupon: '9841654DOIWSDYW235'
12958
+ }
12879
12959
  * @param data
12880
12960
  * @return Promise => Object
12881
12961
  */
@@ -12884,6 +12964,7 @@ export declare class VhQuerySales {
12884
12964
  * 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
12885
12965
  * trong collection coupon_release_details
12886
12966
  * @example:
12967
+ //truyền vào
12887
12968
  let data = {
12888
12969
  date_validity: new Date(),
12889
12970
  date_expire : new Date(),
@@ -12896,7 +12977,19 @@ export declare class VhQuerySales {
12896
12977
  }, error=>{
12897
12978
  console.log('error', error);
12898
12979
  })
12980
+ //trả về
12981
+ let data = {
12982
+ _id:'9841654DOIWSDYW235'
12983
+ status: 1,
12984
+ id_branch,
12985
+
12986
+ date_validity: new Date(),
12987
+ date_expire : new Date(),
12988
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12989
+ id_coupon: '9841654DOIWSDYW235'
12990
+ }
12899
12991
  * @param data
12992
+ * @param quantity <=20 : Dev kiểm tra trường quantity nhập vào không được lớn hơn 20
12900
12993
  * @return Promise => Array(object)
12901
12994
  */
12902
12995
  createCouponCodes(data: any, quantity: number): Promise<unknown>;
@@ -12916,7 +13009,7 @@ export declare class VhQuerySales {
12916
13009
  updateCouponCode(id_coupon_code: any, data: any): Promise<unknown>;
12917
13010
  /**
12918
13011
  * Hàm này chỉ cho phép xóa coupon_code đang ở trạng thái đã phát hành (status ==1),
12919
- * và cập nhật giảm trường số lượng quantity_released bớt một trong collection coupon_release_details
13012
+ * và cập nhật giảm trường số lượng quantity_released bớt 1 trong collection coupon_release_details
12920
13013
  * @example:
12921
13014
  * this.vhQuerySales.deleteCouponCode('OUHEOIWUYGHIQNIDOUW1359478'})
12922
13015
  .then((bool)=>{
@@ -12960,7 +13053,7 @@ export declare class VhQuerySales {
12960
13053
  */
12961
13054
  getCouponCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
12962
13055
  /**
12963
- * hàm này trả về coupon code đã phát hành theo trường _id của Coupon code. dùng trong trang bán hàng thanh toán bằng phiếu
13056
+ * hàm này trả về coupon_code đã phát hành theo trường _id của Coupon_code
12964
13057
  * @example:
12965
13058
  *
12966
13059
  * this.vhQuerySales.getCouponCode('OUHEDW0512'})
@@ -12974,8 +13067,21 @@ export declare class VhQuerySales {
12974
13067
  */
12975
13068
  getCouponCode(id_coupon_code: any): Promise<unknown>;
12976
13069
  /**
12977
- * hàm này trả về coupon code đã phát hành theo trường _id của voucher code. dùng trong thanh toán bằng phiếu,
12978
- * trả về có cả code, name_coupon, name_coupon_release
13070
+ * hàm này trả về coupon_code đã phát hành theo trường code của Coupon_code.
13071
+ * @example:
13072
+ *
13073
+ * this.vhQuerySales.getCouponCode('OUHEDW0512'})
13074
+ .then((res)=>{
13075
+ console.log('getCouponCode', res);
13076
+ }, error=>{
13077
+ console.log('error', error);
13078
+ })
13079
+ * @param id_coupon_code: cũng chính là code
13080
+ * @return Promise => obj ={} or null
13081
+ */
13082
+ getCouponCode_byCode(code: any): Promise<unknown>;
13083
+ /**
13084
+ * hàm này trả về coupon_code đã phát hành theo trường _id của voucher_code.
12979
13085
  * @example:
12980
13086
  *
12981
13087
  * this.vhQuerySales.getCoupon_Code_Name_Release('OUHEDW0512'})
@@ -12989,6 +13095,21 @@ export declare class VhQuerySales {
12989
13095
  */
12990
13096
  getCoupon_Code_Name_Release(id_coupon_code: any): Promise<unknown>;
12991
13097
  /**
13098
+ * hàm này trả về coupon_code đã phát hành theo trường code của voucher_code. dùng trong thanh toán bằng phiếu,
13099
+ * trả về có cả code, name_coupon, name_coupon_release
13100
+ * @example:
13101
+ *
13102
+ * this.vhQuerySales.getCoupon_Code_Name_Release_byCode('OUHEDW0512'})
13103
+ .then((res)=>{
13104
+ console.log('getCoupon_Code_Name_Release_byCode', res);
13105
+ }, error=>{
13106
+ console.log('error', error);
13107
+ })
13108
+ * @param id_coupon_code: cũng chính là code
13109
+ * @return Promise => obj ={} or null
13110
+ */
13111
+ getCoupon_Code_Name_Release_byCode(code: any): Promise<unknown>;
13112
+ /**
12992
13113
  * hàm này để đổi phiếu từ điểm của khách hàng. Đổi thành công tự động tạo lịch sử đổi điểm của khách hàng
12993
13114
  * hàm này đã cập nhật lại trường status, id_customer, date_points_exchanged cho coupon_codes
12994
13115
  * hàm này đã cập nhật lại trường earned_points, id_customer, branch_earned_points cho customers
@@ -13052,14 +13173,21 @@ export declare class VhQuerySales {
13052
13173
  updateVoucher(id_voucher: any, data: any): Promise<unknown>;
13053
13174
  /**
13054
13175
  * @example:
13055
- * this.vhQuerySales.deleteVoucher("fuMS21I6othUm34385WV")
13056
- .then((bool)=>{
13057
- console.log('deleteVoucher', bool);
13176
+ * this.vhQuerySales.deleteVoucher("9841654DOIWSDYW235")
13177
+ .then((rsp)=>{
13178
+ console.log('deleteVoucher', rsp);
13179
+ if(rsp.vcode == 0){
13180
+ //phát thông báo xóa thành công
13181
+ }else if(rsp.vcode == 1){
13182
+ //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)
13183
+ }
13058
13184
  }, error=>{
13059
13185
  console.log('error', error);
13060
13186
  })
13061
13187
  * @param id_voucher
13062
- * @return Promise Boolean => true or false
13188
+ * @return Promise => rsp = {vcode, message} / error
13189
+ * vcode == 0 : xóa thành công
13190
+ * 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
13063
13191
  */
13064
13192
  deleteVoucher(id_voucher: any): Promise<unknown>;
13065
13193
  /**
@@ -13119,14 +13247,21 @@ export declare class VhQuerySales {
13119
13247
  updateVoucherRelease(id_voucher_release: any, data: any): Promise<unknown>;
13120
13248
  /**
13121
13249
  * @example:
13122
- * this.vhQuerySales.deleteVoucherRelease("fuMS21I6othUm34385WV")
13123
- .then((bool)=>{
13124
- console.log('deleteVoucherRelease', bool);
13250
+ * this.vhQuerySales.deleteVoucherRelease("9841654DOIWSDYW235")
13251
+ .then((rsp)=>{
13252
+ console.log('deleteVoucherRelease', rsp);
13253
+ if(rsp.vcode == 0){
13254
+ //phát thông báo xóa thành công
13255
+ }else if(rsp.vcode == 1){
13256
+ //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)
13257
+ }
13125
13258
  }, error=>{
13126
13259
  console.log('error', error);
13127
13260
  })
13128
13261
  * @param id_voucher_release
13129
- * @return Promise Boolean => true or false
13262
+ * @return Promise => rsp = {vcode, message} / error
13263
+ * vcode == 0 : xóa thành công
13264
+ * 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
13130
13265
  */
13131
13266
  deleteVoucherRelease(id_voucher_release: any): Promise<unknown>;
13132
13267
  /**
@@ -13170,14 +13305,21 @@ export declare class VhQuerySales {
13170
13305
  addVoucherReleaseDetail(data: any): Promise<unknown>;
13171
13306
  /**
13172
13307
  * @example:
13173
- * this.vhQuerySales.deleteVoucherReleaseDetail("fuMS21I6othUm34385WV")
13174
- .then((bool)=>{
13175
- console.log('deleteVoucherReleaseDetail', bool);
13308
+ * this.vhQuerySales.deleteVoucherReleaseDetail("9841654DOIWSDYW235")
13309
+ .then((rsp)=>{
13310
+ console.log('deleteVoucherReleaseDetail', rsp);
13311
+ if(rsp.vcode == 0){
13312
+ //phát thông báo xóa thành công
13313
+ }else if(rsp.vcode == 1){
13314
+ //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)
13315
+ }
13176
13316
  }, error=>{
13177
13317
  console.log('error', error);
13178
13318
  })
13179
13319
  * @param id_voucher_release_detail
13180
- * @return Promise Boolean => true or false
13320
+ * @return Promise => rsp = {vcode, message} / error
13321
+ * vcode == 0 : xóa thành công
13322
+ * 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)
13181
13323
  */
13182
13324
  deleteVoucherReleaseDetail(id_voucher_release_detail: any): Promise<unknown>;
13183
13325
  /**
@@ -13217,15 +13359,15 @@ export declare class VhQuerySales {
13217
13359
  id_voucher: '9841654DOIWSDYW235'
13218
13360
  }
13219
13361
  * this.vhQuerySales.createVoucherCode(data)
13220
- .then((coupon_code)=>{
13221
- console.log('createVoucherCode', coupon_code);
13362
+ .then((voucher_code)=>{
13363
+ console.log('createVoucherCode', voucher_code);
13222
13364
  }, error=>{
13223
13365
  console.log('error', error);
13224
13366
  })
13225
13367
  * @param data
13226
13368
  * @return Promise => Object
13227
13369
  */
13228
- private createVoucherCode;
13370
+ createVoucherCode(data: any): Promise<unknown>;
13229
13371
  /**
13230
13372
  * hàm này để phát hành nhiều voucher_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
13231
13373
  * trong collection voucher_release_details
@@ -13320,7 +13462,7 @@ export declare class VhQuerySales {
13320
13462
  */
13321
13463
  getVoucherCode(id_voucher_code: any): Promise<unknown>;
13322
13464
  /**
13323
- * hàm này trả về voucher code đã phát hành theo trường _id của voucher code. dùng trong trang bán hàng để đổi phiếu,
13465
+ * hàm này trả về voucher code đã phát hành theo trường _id của voucher code.
13324
13466
  * trả về có cả code, name_voucher, name_voucher_release
13325
13467
  * @example:
13326
13468
  *
@@ -13334,6 +13476,21 @@ export declare class VhQuerySales {
13334
13476
  * @return Promise => obj ={} or null
13335
13477
  */
13336
13478
  getVoucher_Code_Name_Release(id_voucher_code: any): Promise<unknown>;
13479
+ /**
13480
+ * hàm này trả về voucher code đã phát hành theo trường code của voucher code. dùng trong trang bán hàng để đổi phiếu,
13481
+ * trả về có cả code, name_voucher, name_voucher_release
13482
+ * @example:
13483
+ *
13484
+ * this.vhQuerySales.getVoucher_Code_Name_Release_byCode('OUHEDW0512'})
13485
+ .then((res)=>{
13486
+ console.log('getVoucher_Code_Name_Release_byCode', res);
13487
+ }, error=>{
13488
+ console.log('error', error);
13489
+ })
13490
+ * @param code: cũng chính là code
13491
+ * @return Promise => obj ={} or null
13492
+ */
13493
+ getVoucher_Code_Name_Release_byCode(code: any): Promise<unknown>;
13337
13494
  exchangeVoucherCode_byEarningPoints(array_id_voucher_code_and_points_and_products: any, id_customer: any, points: any): Promise<unknown>;
13338
13495
  /**
13339
13496
  * @example:
@@ -13398,14 +13555,21 @@ export declare class VhQuerySales {
13398
13555
  updatePaymentCard(id_payment_card: any, data: any): Promise<unknown>;
13399
13556
  /**
13400
13557
  * @example:
13401
- * this.vhQuerySales.deletePaymentCard('FDNOIUWDHIWH21564DWQ')
13402
- .then((bool)=>{
13403
- console.log('deletePaymentCard', bool);
13558
+ * this.vhQuerySales.deletePaymentCard("9841654DOIWSDYW235")
13559
+ .then((rsp)=>{
13560
+ console.log('deletePaymentCard', rsp);
13561
+ if(rsp.vcode == 0){
13562
+ //phát thông báo xóa thành công
13563
+ }else if(rsp.vcode == 1){
13564
+ //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)
13565
+ }
13404
13566
  }, error=>{
13405
13567
  console.log('error', error);
13406
13568
  })
13407
13569
  * @param id_payment_card
13408
- * @return Promise => bool = true or false
13570
+ * @return Promise => rsp = {vcode, message} / error
13571
+ * vcode == 0 : xóa thành công
13572
+ * 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
13409
13573
  */
13410
13574
  deletePaymentCard(id_payment_card: any): Promise<unknown>;
13411
13575
  /**
@@ -13458,15 +13622,21 @@ export declare class VhQuerySales {
13458
13622
  updatePaymentCardRelease(id_payment_card_release: any, data: any): Promise<unknown>;
13459
13623
  /**
13460
13624
  * @example:
13461
- * this.vhQuerySales.deletePaymentCardRelease("OIHIDUWNIDOLW123456")
13462
- .then((bool)=>{
13463
- console.log('deletePaymentCardRelease', bool);
13625
+ * this.vhQuerySales.deletePaymentCardRelease("9841654DOIWSDYW235")
13626
+ .then((rsp)=>{
13627
+ console.log('deletePaymentCardRelease', rsp);
13628
+ if(rsp.vcode == 0){
13629
+ //phát thông báo xóa thành công
13630
+ }else if(rsp.vcode == 1){
13631
+ //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)
13632
+ }
13464
13633
  }, error=>{
13465
13634
  console.log('error', error);
13466
13635
  })
13467
13636
  * @param id_payment_card_release
13468
- * @param data
13469
- * @return Promise => boolean = true or false
13637
+ * @return Promise => rsp = {vcode, message} / error
13638
+ * vcode == 0 : xóa thành công
13639
+ * 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
13470
13640
  */
13471
13641
  deletePaymentCardRelease(id_payment_card_release: any): Promise<unknown>;
13472
13642
  /**
@@ -13506,14 +13676,21 @@ export declare class VhQuerySales {
13506
13676
  addPaymentCardReleaseDetail(data: any): Promise<unknown>;
13507
13677
  /**
13508
13678
  * @example:
13509
- * this.vhQuerySales.deletePaymentCardReleaseDetail("OIUHFIUWHGGU41698496")
13510
- .then((bool)=>{
13511
- console.log('deletePaymentCardReleaseDetail', bool);
13679
+ * this.vhQuerySales.deletePaymentCardReleaseDetail("9841654DOIWSDYW235")
13680
+ .then((rsp)=>{
13681
+ console.log('deletePaymentCardReleaseDetail', rsp);
13682
+ if(rsp.vcode == 0){
13683
+ //phát thông báo xóa thành công
13684
+ }else if(rsp.vcode == 1){
13685
+ //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)
13686
+ }
13512
13687
  }, error=>{
13513
13688
  console.log('error', error);
13514
13689
  })
13515
13690
  * @param id_payment_card_release_detail
13516
- * @return Promise => bool = true or false
13691
+ * @return Promise => rsp = {vcode, message} / error
13692
+ * vcode == 0 : xóa thành công
13693
+ * 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)
13517
13694
  */
13518
13695
  deletePaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13519
13696
  /**
@@ -13662,7 +13839,7 @@ export declare class VhQuerySales {
13662
13839
  */
13663
13840
  getPaymentCardCode(id_payment_card_code: any): Promise<unknown>;
13664
13841
  /**
13665
- * hàm này trả về payment_card code đã phát hành theo trường _id của payment_card code. dùng trong đưa thẻ mua trước lấy sản phẩm
13842
+ * hàm này trả về payment_card code đã phát hành theo trường _id của payment_card code
13666
13843
  * trả về có cả code, name_payment_card, name_payment_card_release
13667
13844
  * @example:
13668
13845
  *
@@ -13676,6 +13853,22 @@ export declare class VhQuerySales {
13676
13853
  * @return Promise => obj ={} or null
13677
13854
  */
13678
13855
  getPaymentCard_Code_Name_Release(id_payment_card_code: any): Promise<unknown>;
13856
+ /**
13857
+ * hàm này trả về payment_card code đã phát hành theo trường code của payment_card code. dùng trong đưa thẻ mua trước lấy sản phẩm
13858
+ * trả về có cả code, name_payment_card, name_payment_card_release
13859
+ * @example:
13860
+ *
13861
+ * this.vhQuerySales.getPaymentCard_Code_Name_Release_byCode('OUHEDW0512'})
13862
+ .then((res)=>{
13863
+ console.log('getPaymentCard_Code_Name_Release_byCode', res);
13864
+ }, error=>{
13865
+ console.log('error', error);
13866
+ })
13867
+ * @param code: cũng chính là code
13868
+ * @return Promise => obj ={} or null
13869
+ */
13870
+ getPaymentCard_Code_Name_Release_byCode(code: any): Promise<unknown>;
13871
+ exchangePaymentCardCode_byEarningPoints(array_id_payment_card_code_and_points_and_products: any, id_customer: any, points: any): Promise<unknown>;
13679
13872
  /**
13680
13873
  * không cần hàm này vì khi tạo phiếu bill_type51 đã được cập nhật
13681
13874
  * hàm này dùng để cập nhật số lượng sản phẩm trong Payment Card khi đổi thẻ
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ionic-vhframeworks",
3
- "version": "4.2.0",
3
+ "version": "4.2.3",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
6
  "tslib": "^2.0.0"