ionic-vhframeworks 9.5.1 → 9.5.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.
@@ -2439,6 +2439,27 @@ export declare class VhQueryCafe {
2439
2439
  */
2440
2440
  syncCollections_Desktop(): Promise<unknown>;
2441
2441
  private checkExpireBranch_Cafe;
2442
+ /**
2443
+ * @example:
2444
+ this.vhQueryCafe.syncCollections_Sales365_Mobile().then((bool:any)=>{
2445
+ if(bool){
2446
+ do something...
2447
+ }
2448
+ })
2449
+ * @returns Promise bool = true or false
2450
+ */
2451
+ syncCollections_Sales365_Mobile(): Promise<unknown>;
2452
+ /**
2453
+ * @example:
2454
+ this.vhQueryCafe.syncCollections_Sales365_Desktop().then((bool:any)=>{
2455
+ if(bool){
2456
+ do something...
2457
+ }
2458
+ })
2459
+ * @returns Promise bool = true or false
2460
+ */
2461
+ syncCollections_Sales365_Desktop(): Promise<unknown>;
2462
+ private checkExpireBranch_Sales365;
2442
2463
  private initSyncCollections;
2443
2464
  /**
2444
2465
  * @example:
@@ -21613,29 +21634,6 @@ export declare class VhQuerySales {
21613
21634
  })
21614
21635
  */
21615
21636
  fix_mot_lan_duy_nhat_inventory_null(): Promise<unknown>;
21616
- /**
21617
- * Lấy về thông tin Đại lý từ mã đại lý (dealercode)
21618
- * @example:
21619
- * this.vhQuerySales.getDealer_byDealerCode()
21620
- .then((dealer)=>{
21621
- if(dealer){
21622
- console.log('getDealer_byDealerCode', dealer);
21623
- }
21624
- }, error=>{
21625
- console.log(error);
21626
- })
21627
- * @param dealercode
21628
- * @returns object or null
21629
- */
21630
- getDealer_byDealerCode(dealercode: any): Promise<unknown>;
21631
- /**
21632
- * Lấy về tất cả các người đă đăng ký dùng APP thuộc quản lý của Đại lý (IDdealer)
21633
- * @param starttime
21634
- * @param endtime
21635
- * @param IDdealer
21636
- * @returns Array
21637
- */
21638
- getEndUsersAPP_byTime_byDealer(starttime: any, endtime: any, IDdealer: any): Promise<unknown>;
21639
21637
  private getYear;
21640
21638
  private getYearsArray;
21641
21639
  private getYearsArray_fromQuery;
@@ -25667,441 +25665,186 @@ export declare class VhQuerySales {
25667
25665
  */
25668
25666
  getPackage(id_package: any): Promise<unknown>;
25669
25667
  /**
25670
- * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR
25671
25668
  * @example:
25672
- * this.vhQuerySales.vietqr_getBanks()
25673
- .then((rsp:any)=>{
25674
- if(rsp.vcode === 0){
25675
- }
25669
+ * this.vhQuerySales.updateLicenseKEY('5fb6780ca2148e09806c5b01', {total:990000})
25670
+ .then((response)=>{
25671
+ console.log('updateLicenseKEY', response);
25676
25672
  }, error=>{
25677
- console.log(error)
25673
+ console.log('error', error);
25678
25674
  })
25679
- * @returns Promise => rsp ={vcode, msg, data(array)} / error
25680
- * vcode == 0: success
25681
- */
25682
- vietqr_getBanks(): Promise<unknown>;
25675
+ * @param id_licenseKEY
25676
+ * @param value
25677
+ * @return Promise => response = undefined / error
25678
+ */
25679
+ updateLicenseKEY(id_licenseKEY: string, value: any): Promise<unknown>;
25683
25680
  /**
25684
- * Tạo mã QR cho Đại lý quét thanh toán
25685
- * @example:
25686
- * this.vhQuerySales.vietqr_generateQR_byDealer('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
25687
- .then((rsp:any)=>{
25688
- if(rsp.vcode === 0){
25689
- }
25690
- }, error=>{
25691
- console.log(error)
25692
- })
25693
- * @param accountNo: số tài khoản ngân hàng
25694
- * @param accountName: tên chủ tài khoản
25695
- * @param acqId: bin của ngân hàng (lấy từ hàm vietqr_getBanks())
25696
- * @param template: compact2, compact, qr_only, print
25697
- + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
25698
- + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
25699
- + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
25700
- + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
25701
- * @param id_bill: _id của đơn hàng
25702
- * @param amount: tổng tiền khách phải thanh toán
25703
- * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
25704
- * vcode == 0: success
25705
- */
25706
- vietqr_generateQR_byDealer(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
25681
+ * @example:
25682
+ * let time = new Date();
25683
+ * time.setDate(time.getDate()-7);
25684
+ * this.vhQuerySales.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0)
25685
+ .then((payments)=>{
25686
+ console.log('getLicenseKEYs', payments);
25687
+ })
25688
+ * @param query
25689
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25690
+ * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
25691
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25692
+ * @return Array -> array = [{},{},...]
25693
+ */
25694
+ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25707
25695
  /**
25708
25696
  * Tạo mã QR cho Shop quét thanh toán
25709
25697
  * @example:
25710
- * this.vhQuerySales.vietqr_generateQR_byShop('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
25711
- .then((rsp:any)=>{
25698
+ * this.vhQuerySales.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
25699
+ .then((rsp:any)=>{
25712
25700
  if(rsp.vcode === 0){
25713
25701
  }
25714
25702
  }, error=>{
25715
25703
  console.log(error)
25716
25704
  })
25717
- * @param accountNo: số tài khoản ngân hàng
25718
- * @param accountName: tên chủ tài khoản
25719
- * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
25720
- * @param template: compact2, compact, qr_only, print
25705
+ * @param accountNo: số tài khoản ngân hàng
25706
+ * @param accountName: tên chủ tài khoản
25707
+ * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
25708
+ * @param template: compact2, compact, qr_only, print
25721
25709
  + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
25722
25710
  + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
25723
25711
  + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
25724
25712
  + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
25725
- * @param id_bill: _id của đơn hàng
25726
- * @param amount: tổng tiền khách phải thanh toán
25727
- * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
25728
- * vcode == 0: success
25729
- */
25730
- vietqr_generateQR_byShop(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
25713
+ * @param id_bill: _id của đơn hàng
25714
+ * @param amount: tổng tiền khách phải thanh toán
25715
+ * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
25716
+ * vcode == 0: success
25717
+ */
25718
+ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
25719
+ private publishObservableEventPromotions;
25720
+ private observableLocalPromotions;
25731
25721
  /**
25732
- * @example:
25733
- * let data = {
25734
- date: new Date(),
25735
- 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
25736
- payment: 990.000,
25737
- tax: 0,
25738
- total: 990.000
25739
- }
25740
- * this.vhQuerySales.createPayment_byDealer(data)
25741
- .then((payment)=>{
25742
- console.log('createPayment_byDealer', payment);
25743
- },(error:any)=>{
25744
- console.log('error', error);
25745
- })
25746
- * payment = {
25747
- _id,
25748
- payment_code,
25749
- id_dealer,
25750
-
25751
- date
25752
- payment_type,
25753
- payment,
25754
- tax,
25755
- total
25756
- }
25757
- * @param payment : object
25758
- * @return Promise => payment = {} / error
25759
- * 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
25760
- * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail
25722
+ * @example:
25723
+ * this.observablePromotion = this.vhQuerySales.getObservableLocalPromotions().subscribe((localPromotions:any) => {
25724
+ do something...
25725
+ })
25726
+
25727
+ ngOnDestroy(){
25728
+ this.observablePromotion.unsubscribe();
25729
+ }
25730
+ * @returns Observerble (Array) => Array(object) => array = [{},{},...]
25731
+ */
25732
+ private getObservableLocalPromotions;
25733
+ /**
25734
+ * @example:
25735
+ * let promotion = this.vhQuerySales.getlocalPromotion('5fb6780ca2148e09806c5b01');
25736
+ * @param id_promotion
25737
+ * @return Object => obj = {} or null
25738
+ */
25739
+ getlocalPromotion(id_promotion: any): null;
25740
+ /**
25741
+ * @example:
25742
+ * let promotions = this.vhQuerySales.getlocalPromotions();
25743
+ * @return Array(object) => array = [{},{},...]
25761
25744
  */
25762
- createPayment_byDealer(data: any): Promise<unknown>;
25745
+ getlocalPromotions(): never[];
25746
+ /**
25747
+ * @example:
25748
+ * let date = new Date();
25749
+ * this.vhQuerySales.refreshLocalPromotions(date)
25750
+ .then(()=>{
25751
+ do something.....
25752
+ }, error=>{
25753
+ console.log('error', error);
25754
+ })
25755
+ * Hàm này refresh giá trị mới nhất cho hàm getlocalPromotion(), getlocalPromotions() trong localstorage
25756
+ * @return Promise => null
25757
+ */
25758
+ private refreshLocalPromotions;
25763
25759
  /**
25764
25760
  * @example:
25765
- * this.vhQuerySales.updatePayment_byDealer('5fb6780ca2148e09806c5b01', {total:990000})
25766
- .then((response)=>{
25767
- console.log('updatePayment_byDealer', response);
25761
+ * this.vhQuerySales.addPromotion({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
25762
+ .then((promotion)=>{
25763
+ console.log('addPromotion', promotion);
25764
+ },(error:any)=>{
25765
+ console.log('error', error);
25766
+ })
25767
+ * @param colname
25768
+ * @param data
25769
+ * @return Promise => obj = {}
25770
+ * 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
25771
+ */
25772
+ addPromotion(data: any): Promise<unknown>;
25773
+ /**
25774
+ * @example:
25775
+ * this.vhQuerySales.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
25776
+ .then((bool:any)=>{
25777
+ console.log('updatePromotion', bool);
25768
25778
  }, error=>{
25769
25779
  console.log('error', error);
25770
25780
  })
25771
- * @param id_payment
25772
- * @param value
25773
- * @return Promise => response = undefined / error
25774
- */
25775
- updatePayment_byDealer(id_payment: string, value: any): Promise<unknown>;
25781
+ * @param id_promotion
25782
+ * @param data
25783
+ * @return Promise => bool = true or false
25784
+ */
25785
+ updatePromotion(id_promotion: string, data: object): Promise<unknown>;
25776
25786
  /**
25777
25787
  * @example:
25778
- * this.vhQuerySales.deletePayment_byDealer('5fb67fda87c0f21d484cbdf3')
25779
- .then((response)=>{
25780
- console.log('deletePayment_byDealer', response);
25781
- }, error=>{
25782
- console.log(error, error);
25788
+ * this.vhQuerySales.deletePromotion('5fb67fda87c0f21d484cbdf3')
25789
+ .then((bool:any)=>{
25790
+ console.log('deletePromotion', bool);
25783
25791
  })
25784
- * @param id_payment
25785
- * @return Promise => response = undefined / error
25786
- */
25787
- deletePayment_byDealer(id_payment: any): Promise<unknown>;
25792
+ * @param id_promotion
25793
+ * @return Promise => bool = true or false
25794
+ */
25795
+ deletePromotion(id_promotion: any): Promise<unknown>;
25788
25796
  /**
25789
- * @example:
25790
- * let time = new Date();
25791
- * time.setDate(time.getDate()-7);
25792
- * this.vhQuerySales.getPayments_byDealer({payment_type:{$eq:5}}, {},{},0)
25793
- .then((payments)=>{
25794
- console.log('getPayments_byDealer', payments);
25797
+ * @example
25798
+ * this.vhQuerySales.getPromotion('5fb67fda87c0f21d484cbdf3')
25799
+ .then((promotion)=>{
25800
+ console.log('getPromotion', promotion);
25801
+ })
25802
+ * @param id_promotion
25803
+ * @return false or object
25804
+ */
25805
+ getPromotion(id_promotion: string): Promise<unknown>;
25806
+ /**
25807
+ * @example
25808
+ * this.vhQuerySales.getPromotions()
25809
+ .then((response)=>{
25810
+ console.log('getPromotions', response);
25811
+ })
25812
+ * @return array(object) = [{},{},..]
25813
+ */
25814
+ private getPromotions;
25815
+ /**
25816
+ * hàm này trả về danh sách chương trình khuyến mãi diễn ra từ thời gian fromTime đến thời gian toTime
25817
+ * @example:
25818
+ * let fromTime = new Date();
25819
+ * let toTime = new Date('2020-07-01T05:24:00');
25820
+ * this.vhQuerySales.getPromotions_fromTime_toTime(fromTime, toTime, 'all')
25821
+ .then((res)=>{
25822
+ console.log('getPromotions_fromTime_toTime', res);
25823
+ }, error=>{
25824
+ console.log('error', error);
25795
25825
  })
25796
- * @param query
25797
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25798
- * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
25799
- * @param limit null hoặc 0: không giới hạn record get về; 2: get về 2 record
25800
- * @return — Array -> array = [{},{},...]
25826
+ * @param fromTime
25827
+ * @param toTime
25828
+ * @param type: 'all' or 1->8
25829
+ * @return Promise => array(object) = [{},{},..]
25830
+ */
25831
+ getPromotions_fromTime_toTime(fromTime: any, toTime: any, type: any): Promise<unknown>;
25832
+ /**
25833
+ * hàm này trả về danh sách chương trình khuyến mãi diễn ra tại thời điểm tạo hóa đơn => mỗi lần chỉnh lại thời gian tạo hóa đơn phải gọi hàm này
25834
+ * @example:
25835
+ * let date = new Date();
25836
+ * this.vhQuerySales.getPromotions_byDate(date)
25837
+ .then((res)=>{
25838
+ console.log('getPromotions_byDate', res);
25839
+ }, error=>{
25840
+ console.log('error', error);
25841
+ })
25842
+ * @param date : thơi gian tạo hóa đơn
25843
+ * @return Promise => array(object) = [{},{},..]
25801
25844
  */
25802
- getPayments_byDealer(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25845
+ private getPromotions_byDate;
25803
25846
  /**
25804
- * @example:
25805
- * this.vhQuerySales.getPayment_byDealer('5fb67fda87c0f21d484cbdf3')
25806
- .then((payment)=>{
25807
- console.log('getPayment_byDealer', payment);
25808
- })
25809
- * @param id_payment
25810
- * @return Promise => payment ={} or null / error
25811
- */
25812
- getPayment_byDealer(id_payment: any): Promise<unknown>;
25813
- /**
25814
- * @example:
25815
- let payment_detail_main = {
25816
- id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn
25817
- id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id
25818
- id_restriction: 'main_package_advanced', //package.id_restriction
25819
- id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua
25820
- package_type: 1, //gói chinh, gói tmđt hay gói facebook...
25821
- day: 31, //package.day,
25822
- tax: 0, package.tax,
25823
- price: 99000, package.price,
25824
- quantity: 1, //khách chọn
25825
- payment_detail_type: 1, //1: gói gia hạng mới, 2: gói nâng cấp, 3: gói kéo dài thêm thời gian
25826
- }
25827
- this.vhQuerySales.createPayment_Detail_byDealer({})
25828
- .then((payment_detail)=>{
25829
- console.log('createPayment_Detail_byDealer', payment_detail);
25830
- },(error:any)=>{
25831
- console.log('error', error);
25832
- })
25833
- payment_detail = {
25834
- _id,
25835
- id_dealer,
25836
- payment_type,
25837
- activating,
25838
- invalid,
25839
- date,
25840
-
25841
- id_branch,
25842
- id_payment,
25843
- id_restriction,
25844
- id_package,
25845
- package_type,
25846
- payment_type,
25847
- payment_detail_type,
25848
- day,
25849
- tax,
25850
- price,
25851
- quantity
25852
- }
25853
- * @param data
25854
- * @return Promise => response = {} / error
25855
- * 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
25856
- */
25857
- createPayment_Detail_byDealer(data: any): any;
25858
- /**
25859
- * @example:
25860
- * this.vhQuerySales.updatePayment_Detail_byDealer('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
25861
- .then((response)=>{
25862
- console.log('updatePayment_Detail_byDealer', response);
25863
- },(error:any)=>{
25864
- reject(error);
25865
- })
25866
- * @param id_payment_detail
25867
- * @param value
25868
- * @return Promise => response = undefined / error
25869
- */
25870
- updatePayment_Detail_byDealer(id_payment_detail: string, value: object): Promise<unknown>;
25871
- /**
25872
- * @example:
25873
- * let time = new Date();
25874
- * time.setDate(time.getDate()-7);
25875
- * this.vhQuerySales.getPayment_details_byDealer({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0)
25876
- .then((payment_details)=>{
25877
- console.log('getPayment_details_byDealer', payment_details);
25878
- })
25879
- * @param query
25880
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25881
- * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
25882
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25883
- * @return Promise Array => array = [{},{},...] / error
25884
- */
25885
- getPayment_details_byDealer(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25886
- /**
25887
- * @example:
25888
- * this.vhQuerySales.getPayment_detail_byDealer('5fb67fda87c0f21d484cbdf3')
25889
- .then((payment_detail)=>{
25890
- console.log('getPayment_detail_byDealer', payment_detail);
25891
- })
25892
- * @param id_payment_detail
25893
- * @return Promise => payment_detail ={} or null / error
25894
- */
25895
- getPayment_detail_byDealer(id_payment_detail: any): Promise<unknown>;
25896
- /**
25897
- * @example:
25898
- * this.vhQuerySales.deletePayment_Detail_byDealer('5fb67fda87c0f21d484cbdf3')
25899
- .then((response)=>{
25900
- console.log('deletePayment_Detail_byDealer', response);
25901
- },(error:any)=>{
25902
- reject(error);
25903
- })
25904
- * @param id_payment_detail
25905
- * @return Promise => Promise => response = undefined / error
25906
- */
25907
- deletePayment_Detail_byDealer(id_payment_detail: string): Promise<unknown>;
25908
- /**
25909
- * @example:
25910
- * this.vhQuerySales.getPackage_byDealer('5fb67fda87c0f21d484cbdf3')
25911
- .then((package)=>{
25912
- console.log('getPackage_byDealer', package);
25913
- })
25914
- * @param id_package
25915
- * @return Promise => package ={} or null / error
25916
- */
25917
- getPackage_byDealer(id_package: any): Promise<unknown>;
25918
- /**
25919
- * @example:
25920
- * this.vhQuerySales.updateLiceseKEY_byDealer('5fb6780ca2148e09806c5b01', {total:990000})
25921
- .then((response)=>{
25922
- console.log('updateLiceseKEY_byDealer', response);
25923
- }, error=>{
25924
- console.log('error', error);
25925
- })
25926
- * @param id_dealer
25927
- * @param id_licenseKEY
25928
- * @param value
25929
- * @return Promise => response = undefined / error
25930
- */
25931
- updateLiceseKEY_byDealer(id_dealer: string, id_licenseKEY: string, value: any): Promise<unknown>;
25932
- /**
25933
- * @example:
25934
- * let time = new Date();
25935
- * time.setDate(time.getDate()-7);
25936
- * this.vhQuerySales.getPayments_byDealer({payment_type:{$eq:5}}, {},{},0)
25937
- .then((payments)=>{
25938
- console.log('getPayments_byDealer', payments);
25939
- })
25940
- * @param query
25941
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25942
- * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
25943
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25944
- * @return — Array -> array = [{},{},...]
25945
- */
25946
- getLiceseKEYs_byDealer(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25947
- /**
25948
- * @example:
25949
- * this.vhQuerySales.updateLiceseKEY_byStote('5fb6780ca2148e09806c5b01', {total:990000})
25950
- .then((response)=>{
25951
- console.log('updateLiceseKEY_byStote', response);
25952
- }, error=>{
25953
- console.log('error', error);
25954
- })
25955
- * @param id_dealer
25956
- * @param id_licenseKEY
25957
- * @param value
25958
- * @return Promise => response = undefined / error
25959
- */
25960
- updateLiceseKEY_byStote(id_store: string, id_licenseKEY: string, value: any): Promise<unknown>;
25961
- /**
25962
- * @example:
25963
- * let time = new Date();
25964
- * time.setDate(time.getDate()-7);
25965
- * this.vhQuerySales.getLiceseKEYs_byStote({payment_type:{$eq:5}}, {},{},0)
25966
- .then((payments)=>{
25967
- console.log('getLiceseKEYs_byStote', payments);
25968
- })
25969
- * @param query
25970
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25971
- * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
25972
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25973
- * @return — Array -> array = [{},{},...]
25974
- */
25975
- getLiceseKEYs_byStote(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25976
- private publishObservableEventPromotions;
25977
- private observableLocalPromotions;
25978
- /**
25979
- * @example:
25980
- * this.observablePromotion = this.vhQuerySales.getObservableLocalPromotions().subscribe((localPromotions:any) => {
25981
- do something...
25982
- })
25983
-
25984
- ngOnDestroy(){
25985
- this.observablePromotion.unsubscribe();
25986
- }
25987
- * @returns Observerble (Array) => Array(object) => array = [{},{},...]
25988
- */
25989
- private getObservableLocalPromotions;
25990
- /**
25991
- * @example:
25992
- * let promotion = this.vhQuerySales.getlocalPromotion('5fb6780ca2148e09806c5b01');
25993
- * @param id_promotion
25994
- * @return Object => obj = {} or null
25995
- */
25996
- getlocalPromotion(id_promotion: any): null;
25997
- /**
25998
- * @example:
25999
- * let promotions = this.vhQuerySales.getlocalPromotions();
26000
- * @return Array(object) => array = [{},{},...]
26001
- */
26002
- getlocalPromotions(): never[];
26003
- /**
26004
- * @example:
26005
- * let date = new Date();
26006
- * this.vhQuerySales.refreshLocalPromotions(date)
26007
- .then(()=>{
26008
- do something.....
26009
- }, error=>{
26010
- console.log('error', error);
26011
- })
26012
- * Hàm này refresh giá trị mới nhất cho hàm getlocalPromotion(), getlocalPromotions() trong localstorage
26013
- * @return Promise => null
26014
- */
26015
- private refreshLocalPromotions;
26016
- /**
26017
- * @example:
26018
- * this.vhQuerySales.addPromotion({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
26019
- .then((promotion)=>{
26020
- console.log('addPromotion', promotion);
26021
- },(error:any)=>{
26022
- console.log('error', error);
26023
- })
26024
- * @param colname
26025
- * @param data
26026
- * @return Promise => obj = {}
26027
- * 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
26028
- */
26029
- addPromotion(data: any): Promise<unknown>;
26030
- /**
26031
- * @example:
26032
- * this.vhQuerySales.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
26033
- .then((bool:any)=>{
26034
- console.log('updatePromotion', bool);
26035
- }, error=>{
26036
- console.log('error', error);
26037
- })
26038
- * @param id_promotion
26039
- * @param data
26040
- * @return Promise => bool = true or false
26041
- */
26042
- updatePromotion(id_promotion: string, data: object): Promise<unknown>;
26043
- /**
26044
- * @example:
26045
- * this.vhQuerySales.deletePromotion('5fb67fda87c0f21d484cbdf3')
26046
- .then((bool:any)=>{
26047
- console.log('deletePromotion', bool);
26048
- })
26049
- * @param id_promotion
26050
- * @return Promise => bool = true or false
26051
- */
26052
- deletePromotion(id_promotion: any): Promise<unknown>;
26053
- /**
26054
- * @example
26055
- * this.vhQuerySales.getPromotion('5fb67fda87c0f21d484cbdf3')
26056
- .then((promotion)=>{
26057
- console.log('getPromotion', promotion);
26058
- })
26059
- * @param id_promotion
26060
- * @return false or object
26061
- */
26062
- getPromotion(id_promotion: string): Promise<unknown>;
26063
- /**
26064
- * @example
26065
- * this.vhQuerySales.getPromotions()
26066
- .then((response)=>{
26067
- console.log('getPromotions', response);
26068
- })
26069
- * @return array(object) = [{},{},..]
26070
- */
26071
- private getPromotions;
26072
- /**
26073
- * hàm này trả về danh sách chương trình khuyến mãi diễn ra từ thời gian fromTime đến thời gian toTime
26074
- * @example:
26075
- * let fromTime = new Date();
26076
- * let toTime = new Date('2020-07-01T05:24:00');
26077
- * this.vhQuerySales.getPromotions_fromTime_toTime(fromTime, toTime, 'all')
26078
- .then((res)=>{
26079
- console.log('getPromotions_fromTime_toTime', res);
26080
- }, error=>{
26081
- console.log('error', error);
26082
- })
26083
- * @param fromTime
26084
- * @param toTime
26085
- * @param type: 'all' or 1->8
26086
- * @return Promise => array(object) = [{},{},..]
26087
- */
26088
- getPromotions_fromTime_toTime(fromTime: any, toTime: any, type: any): Promise<unknown>;
26089
- /**
26090
- * hàm này trả về danh sách chương trình khuyến mãi diễn ra tại thời điểm tạo hóa đơn => mỗi lần chỉnh lại thời gian tạo hóa đơn phải gọi hàm này
26091
- * @example:
26092
- * let date = new Date();
26093
- * this.vhQuerySales.getPromotions_byDate(date)
26094
- .then((res)=>{
26095
- console.log('getPromotions_byDate', res);
26096
- }, error=>{
26097
- console.log('error', error);
26098
- })
26099
- * @param date : thơi gian tạo hóa đơn
26100
- * @return Promise => array(object) = [{},{},..]
26101
- */
26102
- private getPromotions_byDate;
26103
- /**
26104
- * Hàm này lấy về tất cả các chương trình khuyến mãi mà có id_product tham gia
25847
+ * Hàm này lấy về tất cả các chương trình khuyến mãi mà có id_product tham gia
26105
25848
  * @example:
26106
25849
  * let date = new Date();
26107
25850
  * this.vhQuerySales.getPromotions_byIDproduct_byDate(id_product, date)
@@ -28897,6 +28640,307 @@ export declare class VhQuerySales {
28897
28640
  static ɵfac: i0.ɵɵFactoryDeclaration<VhQuerySales, never>;
28898
28641
  static ɵprov: i0.ɵɵInjectableDeclaration<VhQuerySales>;
28899
28642
  }
28643
+ export declare class VhQueryDealer {
28644
+ private vhMGDB_auth;
28645
+ private vhMGDB_database;
28646
+ private vhMGDB_rootdatabase;
28647
+ private vhAuth;
28648
+ private vhAlgorithm;
28649
+ constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm);
28650
+ /**
28651
+ * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR
28652
+ * @example:
28653
+ * this.vhQueryDealer.vietqr_getBanks()
28654
+ .then((rsp:any)=>{
28655
+ if(rsp.vcode === 0){
28656
+ }
28657
+ }, error=>{
28658
+ console.log(error)
28659
+ })
28660
+ * @returns Promise => rsp ={vcode, msg, data(array)} / error
28661
+ * vcode == 0: success
28662
+ */
28663
+ vietqr_getBanks(): Promise<unknown>;
28664
+ /**
28665
+ * Tạo mã QR cho Đại lý quét thanh toán
28666
+ * @example:
28667
+ * this.vhQueryDealer.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
28668
+ .then((rsp:any)=>{
28669
+ if(rsp.vcode === 0){
28670
+ }
28671
+ }, error=>{
28672
+ console.log(error)
28673
+ })
28674
+ * @param accountNo: số tài khoản ngân hàng
28675
+ * @param accountName: tên chủ tài khoản
28676
+ * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
28677
+ * @param template: compact2, compact, qr_only, print
28678
+ + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
28679
+ + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
28680
+ + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
28681
+ + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
28682
+ * @param id_bill: _id của đơn hàng
28683
+ * @param amount: tổng tiền khách phải thanh toán
28684
+ * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
28685
+ * vcode == 0: success
28686
+ */
28687
+ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
28688
+ /**
28689
+ * @example:
28690
+ * let data = {
28691
+ date: new Date(),
28692
+ 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
28693
+ payment: 990.000,
28694
+ tax: 0,
28695
+ total: 990.000
28696
+ }
28697
+ * this.vhQueryDealer.createPayment(data)
28698
+ .then((payment)=>{
28699
+ console.log('createPayment', payment);
28700
+ },(error:any)=>{
28701
+ console.log('error', error);
28702
+ })
28703
+ * payment = {
28704
+ _id,
28705
+ payment_code,
28706
+ id_dealer,
28707
+
28708
+ date
28709
+ payment_type,
28710
+ payment,
28711
+ tax,
28712
+ total
28713
+ }
28714
+ * @param payment : object
28715
+ * @return Promise => payment = {} / error
28716
+ * 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
28717
+ * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail
28718
+ */
28719
+ createPayment(data: any): Promise<unknown>;
28720
+ /**
28721
+ * @example:
28722
+ * this.vhQueryDealer.updatePayment('5fb6780ca2148e09806c5b01', {total:990000})
28723
+ .then((response)=>{
28724
+ console.log('updatePayment', response);
28725
+ }, error=>{
28726
+ console.log('error', error);
28727
+ })
28728
+ * @param id_payment
28729
+ * @param value
28730
+ * @return Promise => response = undefined / error
28731
+ */
28732
+ updatePayment(id_payment: string, value: any): Promise<unknown>;
28733
+ /**
28734
+ * @example:
28735
+ * this.vhQueryDealer.deletePayment('5fb67fda87c0f21d484cbdf3')
28736
+ .then((response)=>{
28737
+ console.log('deletePayment', response);
28738
+ }, error=>{
28739
+ console.log(error, error);
28740
+ })
28741
+ * @param id_payment
28742
+ * @return Promise => response = undefined / error
28743
+ */
28744
+ deletePayment(id_payment: any): Promise<unknown>;
28745
+ /**
28746
+ * @example:
28747
+ * let time = new Date();
28748
+ * time.setDate(time.getDate()-7);
28749
+ * this.vhQueryDealer.getPayments({payment_type:{$eq:5}}, {},{},0)
28750
+ .then((payments)=>{
28751
+ console.log('getPayments', payments);
28752
+ })
28753
+ * @param query
28754
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
28755
+ * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
28756
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
28757
+ * @return — Array -> array = [{},{},...]
28758
+ */
28759
+ getPayments(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
28760
+ /**
28761
+ * @example:
28762
+ * this.vhQueryDealer.getPayment('5fb67fda87c0f21d484cbdf3')
28763
+ .then((payment)=>{
28764
+ console.log('getPayment', payment);
28765
+ })
28766
+ * @param id_payment
28767
+ * @return Promise => payment ={} or null / error
28768
+ */
28769
+ getPayment(id_payment: any): Promise<unknown>;
28770
+ /**
28771
+ * @example:
28772
+ let payment_detail_main = {
28773
+ id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn
28774
+ id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id
28775
+ id_restriction: 'main_package_advanced', //package.id_restriction
28776
+ id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua
28777
+ package_type: 1, //gói chinh, gói tmđt hay gói facebook...
28778
+ day: 31, //package.day,
28779
+ tax: 0, package.tax,
28780
+ price: 99000, package.price,
28781
+ quantity: 1, //khách chọn
28782
+ payment_detail_type: 1, //1: gói gia hạng mới, 2: gói nâng cấp, 3: gói kéo dài thêm thời gian
28783
+ }
28784
+ this.vhQueryDealer.createPayment_Detail({})
28785
+ .then((payment_detail)=>{
28786
+ console.log('createPayment_Detail', payment_detail);
28787
+ },(error:any)=>{
28788
+ console.log('error', error);
28789
+ })
28790
+ payment_detail = {
28791
+ _id,
28792
+ id_dealer,
28793
+ payment_type,
28794
+ activating,
28795
+ invalid,
28796
+ date,
28797
+
28798
+ id_branch,
28799
+ id_payment,
28800
+ id_restriction,
28801
+ id_package,
28802
+ package_type,
28803
+ payment_type,
28804
+ payment_detail_type,
28805
+ day,
28806
+ tax,
28807
+ price,
28808
+ quantity
28809
+ }
28810
+ * @param data
28811
+ * @return Promise => response = {} / error
28812
+ * 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
28813
+ */
28814
+ createPayment_Detail(data: any): any;
28815
+ /**
28816
+ * @example:
28817
+ * this.vhQueryDealer.updatePayment_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
28818
+ .then((response)=>{
28819
+ console.log('updatePayment_Detail', response);
28820
+ },(error:any)=>{
28821
+ reject(error);
28822
+ })
28823
+ * @param id_payment_detail
28824
+ * @param value
28825
+ * @return Promise => response = undefined / error
28826
+ */
28827
+ updatePayment_Detail(id_payment_detail: string, value: object): Promise<unknown>;
28828
+ /**
28829
+ * @example:
28830
+ * let time = new Date();
28831
+ * time.setDate(time.getDate()-7);
28832
+ * this.vhQueryDealer.getPayment_details({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0)
28833
+ .then((payment_details)=>{
28834
+ console.log('getPayment_details', payment_details);
28835
+ })
28836
+ * @param query
28837
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
28838
+ * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
28839
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
28840
+ * @return Promise Array => array = [{},{},...] / error
28841
+ */
28842
+ getPayment_details(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
28843
+ /**
28844
+ * @example:
28845
+ * this.vhQueryDealer.getPayment_detail('5fb67fda87c0f21d484cbdf3')
28846
+ .then((payment_detail)=>{
28847
+ console.log('getPayment_detail', payment_detail);
28848
+ })
28849
+ * @param id_payment_detail
28850
+ * @return Promise => payment_detail ={} or null / error
28851
+ */
28852
+ getPayment_detail(id_payment_detail: any): Promise<unknown>;
28853
+ /**
28854
+ * @example:
28855
+ * this.vhQueryDealer.deletePayment_Detail('5fb67fda87c0f21d484cbdf3')
28856
+ .then((response)=>{
28857
+ console.log('deletePayment_Detail', response);
28858
+ },(error:any)=>{
28859
+ reject(error);
28860
+ })
28861
+ * @param id_payment_detail
28862
+ * @return Promise => Promise => response = undefined / error
28863
+ */
28864
+ deletePayment_Detail(id_payment_detail: string): Promise<unknown>;
28865
+ /**
28866
+ * @example:
28867
+ * this.vhQueryDealer.getPackage('5fb67fda87c0f21d484cbdf3')
28868
+ .then((package)=>{
28869
+ console.log('getPackage', package);
28870
+ })
28871
+ * @param id_package
28872
+ * @return Promise => package ={} or null / error
28873
+ */
28874
+ getPackage(id_package: any): Promise<unknown>;
28875
+ /**
28876
+ * @example:
28877
+ * this.vhQueryDealer.updateLicenseKEY('5fb6780ca2148e09806c5b01', {total:990000})
28878
+ .then((response)=>{
28879
+ console.log('updateLicenseKEY', response);
28880
+ }, error=>{
28881
+ console.log('error', error);
28882
+ })
28883
+ * @param id_licenseKEY
28884
+ * @param value
28885
+ * @return Promise => response = undefined / error
28886
+ */
28887
+ updateLicenseKEY(id_licenseKEY: string, value: any): Promise<unknown>;
28888
+ /**
28889
+ * @example:
28890
+ * let time = new Date();
28891
+ * time.setDate(time.getDate()-7);
28892
+ * this.vhQueryDealer.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0)
28893
+ .then((payments)=>{
28894
+ console.log('getLicenseKEYs', payments);
28895
+ })
28896
+ * @param query
28897
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
28898
+ * @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
28899
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
28900
+ * @return — Array -> array = [{},{},...]
28901
+ */
28902
+ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
28903
+ /**
28904
+ * Lấy về thông tin Đại lý từ mã đại lý (dealercode)
28905
+ * @example:
28906
+ * this.vhQueryDealer.getDealer_byDealerCode()
28907
+ .then((dealer)=>{
28908
+ if(dealer){
28909
+ console.log('getDealer_byDealerCode', dealer);
28910
+ }
28911
+ }, error=>{
28912
+ console.log(error);
28913
+ })
28914
+ * @param dealercode
28915
+ * @returns object or null
28916
+ */
28917
+ getDealer_byDealerCode(dealercode: any): Promise<unknown>;
28918
+ /**
28919
+ * @example:
28920
+ * this.vhQueryDealer.getStoresAPP_byTime(starttime, endtime, '5fb67fda87c0f21d484cbdf3')
28921
+ .then((stores)=>{
28922
+ console.log('getStoresAPP_byTime', stores);
28923
+ })
28924
+ * Lấy về tất cả các Shop đăng ký dùng APP thuộc quản lý của Đại lý (IDdealer)
28925
+ * @param starttime
28926
+ * @param endtime
28927
+ * @param IDdealer
28928
+ * @returns Promise => Array -> array = [{},{},...]
28929
+ */
28930
+ getStoresAPP_byTime(starttime: any, endtime: any, IDdealer: any): Promise<unknown>;
28931
+ /**
28932
+ * @example:
28933
+ * this.vhQueryDealer.getBranchs_byIDstore('5fb67fda87c0f21d484cbdf3')
28934
+ .then((branchs)=>{
28935
+ console.log('getBranchs_byIDstore', branchs);
28936
+ })
28937
+ * @param id_store
28938
+ * @return Promise => Array -> array = [{},{},...]
28939
+ */
28940
+ getBranchs_byIDstore(id_store: any): Promise<unknown>;
28941
+ static ɵfac: i0.ɵɵFactoryDeclaration<VhQueryDealer, never>;
28942
+ static ɵprov: i0.ɵɵInjectableDeclaration<VhQueryDealer>;
28943
+ }
28900
28944
  export declare class VhQuerySCclient {
28901
28945
  private vhMGDB_auth;
28902
28946
  private vhMGDB_database;