ionic-vhframeworks 9.5.2 → 9.5.4

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:
@@ -5791,6 +5812,58 @@ export declare class VhQueryCafe {
5791
5812
  * @return Promise => package ={} or null / error
5792
5813
  */
5793
5814
  getPackage(id_package: any): Promise<unknown>;
5815
+ /**
5816
+ * @example:
5817
+ * this.vhQueryCafe.updateLicenseKEY('5fb6780ca2148e09806c5b01', {total:990000})
5818
+ .then((response)=>{
5819
+ console.log('updateLicenseKEY', response);
5820
+ }, error=>{
5821
+ console.log('error', error);
5822
+ })
5823
+ * @param id_licenseKEY
5824
+ * @param value
5825
+ * @return Promise => response = undefined / error
5826
+ */
5827
+ updateLicenseKEY(id_licenseKEY: string, value: any): Promise<unknown>;
5828
+ /**
5829
+ * @example:
5830
+ * let time = new Date();
5831
+ * time.setDate(time.getDate()-7);
5832
+ * this.vhQueryCafe.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0)
5833
+ .then((payments)=>{
5834
+ console.log('getLicenseKEYs', payments);
5835
+ })
5836
+ * @param query
5837
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
5838
+ * @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
5839
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
5840
+ * @return — Array -> array = [{},{},...]
5841
+ */
5842
+ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
5843
+ /**
5844
+ * Tạo mã QR cho Shop quét thanh toán
5845
+ * @example:
5846
+ * this.vhQueryCafe.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
5847
+ .then((rsp:any)=>{
5848
+ if(rsp.vcode === 0){
5849
+ }
5850
+ }, error=>{
5851
+ console.log(error)
5852
+ })
5853
+ * @param accountNo: số tài khoản ngân hàng
5854
+ * @param accountName: tên chủ tài khoản
5855
+ * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
5856
+ * @param template: compact2, compact, qr_only, print
5857
+ + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
5858
+ + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
5859
+ + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
5860
+ + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
5861
+ * @param id_bill: _id của đơn hàng
5862
+ * @param amount: tổng tiền khách phải thanh toán
5863
+ * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
5864
+ * vcode == 0: success
5865
+ */
5866
+ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
5794
5867
  private publishObservableEventPromotions;
5795
5868
  private observableLocalPromotions;
5796
5869
  /**
@@ -25644,441 +25717,153 @@ export declare class VhQuerySales {
25644
25717
  */
25645
25718
  getPackage(id_package: any): Promise<unknown>;
25646
25719
  /**
25647
- * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR
25648
25720
  * @example:
25649
- * this.vhQuerySales.vietqr_getBanks()
25650
- .then((rsp:any)=>{
25651
- if(rsp.vcode === 0){
25652
- }
25721
+ * this.vhQuerySales.updateLicenseKEY('5fb6780ca2148e09806c5b01', {total:990000})
25722
+ .then((response)=>{
25723
+ console.log('updateLicenseKEY', response);
25653
25724
  }, error=>{
25654
- console.log(error)
25725
+ console.log('error', error);
25655
25726
  })
25656
- * @returns Promise => rsp ={vcode, msg, data(array)} / error
25657
- * vcode == 0: success
25658
- */
25659
- vietqr_getBanks(): Promise<unknown>;
25727
+ * @param id_licenseKEY
25728
+ * @param value
25729
+ * @return Promise => response = undefined / error
25730
+ */
25731
+ updateLicenseKEY(id_licenseKEY: string, value: any): Promise<unknown>;
25660
25732
  /**
25661
- * Tạo mã QR cho Đại lý quét thanh toán
25662
- * @example:
25663
- * this.vhQuerySales.vietqr_generateQR_byDealer('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
25664
- .then((rsp:any)=>{
25665
- if(rsp.vcode === 0){
25666
- }
25667
- }, error=>{
25668
- console.log(error)
25669
- })
25670
- * @param accountNo: số tài khoản ngân hàng
25671
- * @param accountName: tên chủ tài khoản
25672
- * @param acqId: bin của ngân hàng (lấy từ hàm vietqr_getBanks())
25673
- * @param template: compact2, compact, qr_only, print
25674
- + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
25675
- + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
25676
- + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
25677
- + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
25678
- * @param id_bill: _id của đơn hàng
25679
- * @param amount: tổng tiền khách phải thanh toán
25680
- * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
25681
- * vcode == 0: success
25682
- */
25683
- vietqr_generateQR_byDealer(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
25733
+ * @example:
25734
+ * let time = new Date();
25735
+ * time.setDate(time.getDate()-7);
25736
+ * this.vhQuerySales.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0)
25737
+ .then((payments)=>{
25738
+ console.log('getLicenseKEYs', payments);
25739
+ })
25740
+ * @param query
25741
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25742
+ * @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
25743
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25744
+ * @return Array -> array = [{},{},...]
25745
+ */
25746
+ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25684
25747
  /**
25685
25748
  * Tạo mã QR cho Shop quét thanh toán
25686
25749
  * @example:
25687
- * this.vhQuerySales.vietqr_generateQR_byShop('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
25688
- .then((rsp:any)=>{
25750
+ * this.vhQuerySales.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
25751
+ .then((rsp:any)=>{
25689
25752
  if(rsp.vcode === 0){
25690
25753
  }
25691
25754
  }, error=>{
25692
25755
  console.log(error)
25693
25756
  })
25694
- * @param accountNo: số tài khoản ngân hàng
25695
- * @param accountName: tên chủ tài khoản
25696
- * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
25697
- * @param template: compact2, compact, qr_only, print
25757
+ * @param accountNo: số tài khoản ngân hàng
25758
+ * @param accountName: tên chủ tài khoản
25759
+ * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
25760
+ * @param template: compact2, compact, qr_only, print
25698
25761
  + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
25699
25762
  + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
25700
25763
  + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
25701
25764
  + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
25702
- * @param id_bill: _id của đơn hàng
25703
- * @param amount: tổng tiền khách phải thanh toán
25704
- * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
25705
- * vcode == 0: success
25706
- */
25707
- vietqr_generateQR_byShop(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
25765
+ * @param id_bill: _id của đơn hàng
25766
+ * @param amount: tổng tiền khách phải thanh toán
25767
+ * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
25768
+ * vcode == 0: success
25769
+ */
25770
+ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
25771
+ private publishObservableEventPromotions;
25772
+ private observableLocalPromotions;
25708
25773
  /**
25709
- * @example:
25710
- * let data = {
25711
- date: new Date(),
25712
- 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
25713
- payment: 990.000,
25714
- tax: 0,
25715
- total: 990.000
25716
- }
25717
- * this.vhQuerySales.createPayment_byDealer(data)
25718
- .then((payment)=>{
25719
- console.log('createPayment_byDealer', payment);
25720
- },(error:any)=>{
25721
- console.log('error', error);
25722
- })
25723
- * payment = {
25724
- _id,
25725
- payment_code,
25726
- id_dealer,
25727
-
25728
- date
25729
- payment_type,
25730
- payment,
25731
- tax,
25732
- total
25733
- }
25734
- * @param payment : object
25735
- * @return Promise => payment = {} / error
25736
- * 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
25737
- * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail
25774
+ * @example:
25775
+ * this.observablePromotion = this.vhQuerySales.getObservableLocalPromotions().subscribe((localPromotions:any) => {
25776
+ do something...
25777
+ })
25778
+
25779
+ ngOnDestroy(){
25780
+ this.observablePromotion.unsubscribe();
25781
+ }
25782
+ * @returns Observerble (Array) => Array(object) => array = [{},{},...]
25783
+ */
25784
+ private getObservableLocalPromotions;
25785
+ /**
25786
+ * @example:
25787
+ * let promotion = this.vhQuerySales.getlocalPromotion('5fb6780ca2148e09806c5b01');
25788
+ * @param id_promotion
25789
+ * @return Object => obj = {} or null
25790
+ */
25791
+ getlocalPromotion(id_promotion: any): null;
25792
+ /**
25793
+ * @example:
25794
+ * let promotions = this.vhQuerySales.getlocalPromotions();
25795
+ * @return Array(object) => array = [{},{},...]
25796
+ */
25797
+ getlocalPromotions(): never[];
25798
+ /**
25799
+ * @example:
25800
+ * let date = new Date();
25801
+ * this.vhQuerySales.refreshLocalPromotions(date)
25802
+ .then(()=>{
25803
+ do something.....
25804
+ }, error=>{
25805
+ console.log('error', error);
25806
+ })
25807
+ * Hàm này refresh giá trị mới nhất cho hàm getlocalPromotion(), getlocalPromotions() trong localstorage
25808
+ * @return Promise => null
25738
25809
  */
25739
- createPayment_byDealer(data: any): Promise<unknown>;
25810
+ private refreshLocalPromotions;
25740
25811
  /**
25741
25812
  * @example:
25742
- * this.vhQuerySales.updatePayment_byDealer('5fb6780ca2148e09806c5b01', {total:990000})
25743
- .then((response)=>{
25744
- console.log('updatePayment_byDealer', response);
25813
+ * this.vhQuerySales.addPromotion({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
25814
+ .then((promotion)=>{
25815
+ console.log('addPromotion', promotion);
25816
+ },(error:any)=>{
25817
+ console.log('error', error);
25818
+ })
25819
+ * @param colname
25820
+ * @param data
25821
+ * @return Promise => obj = {}
25822
+ * 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
25823
+ */
25824
+ addPromotion(data: any): Promise<unknown>;
25825
+ /**
25826
+ * @example:
25827
+ * this.vhQuerySales.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
25828
+ .then((bool:any)=>{
25829
+ console.log('updatePromotion', bool);
25745
25830
  }, error=>{
25746
25831
  console.log('error', error);
25747
25832
  })
25748
- * @param id_payment
25749
- * @param value
25750
- * @return Promise => response = undefined / error
25751
- */
25752
- updatePayment_byDealer(id_payment: string, value: any): Promise<unknown>;
25833
+ * @param id_promotion
25834
+ * @param data
25835
+ * @return Promise => bool = true or false
25836
+ */
25837
+ updatePromotion(id_promotion: string, data: object): Promise<unknown>;
25753
25838
  /**
25754
25839
  * @example:
25755
- * this.vhQuerySales.deletePayment_byDealer('5fb67fda87c0f21d484cbdf3')
25756
- .then((response)=>{
25757
- console.log('deletePayment_byDealer', response);
25758
- }, error=>{
25759
- console.log(error, error);
25840
+ * this.vhQuerySales.deletePromotion('5fb67fda87c0f21d484cbdf3')
25841
+ .then((bool:any)=>{
25842
+ console.log('deletePromotion', bool);
25760
25843
  })
25761
- * @param id_payment
25762
- * @return Promise => response = undefined / error
25763
- */
25764
- deletePayment_byDealer(id_payment: any): Promise<unknown>;
25844
+ * @param id_promotion
25845
+ * @return Promise => bool = true or false
25846
+ */
25847
+ deletePromotion(id_promotion: any): Promise<unknown>;
25765
25848
  /**
25766
- * @example:
25767
- * let time = new Date();
25768
- * time.setDate(time.getDate()-7);
25769
- * this.vhQuerySales.getPayments_byDealer({payment_type:{$eq:5}}, {},{},0)
25770
- .then((payments)=>{
25771
- console.log('getPayments_byDealer', payments);
25772
- })
25773
- * @param query
25774
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25775
- * @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
25776
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25777
- * @return — Array -> array = [{},{},...]
25778
- */
25779
- getPayments_byDealer(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25849
+ * @example
25850
+ * this.vhQuerySales.getPromotion('5fb67fda87c0f21d484cbdf3')
25851
+ .then((promotion)=>{
25852
+ console.log('getPromotion', promotion);
25853
+ })
25854
+ * @param id_promotion
25855
+ * @return false or object
25856
+ */
25857
+ getPromotion(id_promotion: string): Promise<unknown>;
25780
25858
  /**
25781
- * @example:
25782
- * this.vhQuerySales.getPayment_byDealer('5fb67fda87c0f21d484cbdf3')
25783
- .then((payment)=>{
25784
- console.log('getPayment_byDealer', payment);
25785
- })
25786
- * @param id_payment
25787
- * @return Promise => payment ={} or null / error
25859
+ * @example
25860
+ * this.vhQuerySales.getPromotions()
25861
+ .then((response)=>{
25862
+ console.log('getPromotions', response);
25863
+ })
25864
+ * @return array(object) = [{},{},..]
25788
25865
  */
25789
- getPayment_byDealer(id_payment: any): Promise<unknown>;
25790
- /**
25791
- * @example:
25792
- let payment_detail_main = {
25793
- id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn
25794
- id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id
25795
- id_restriction: 'main_package_advanced', //package.id_restriction
25796
- id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua
25797
- package_type: 1, //gói chinh, gói tmđt hay gói facebook...
25798
- day: 31, //package.day,
25799
- tax: 0, package.tax,
25800
- price: 99000, package.price,
25801
- quantity: 1, //khách chọn
25802
- 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
25803
- }
25804
- this.vhQuerySales.createPayment_Detail_byDealer({})
25805
- .then((payment_detail)=>{
25806
- console.log('createPayment_Detail_byDealer', payment_detail);
25807
- },(error:any)=>{
25808
- console.log('error', error);
25809
- })
25810
- payment_detail = {
25811
- _id,
25812
- id_dealer,
25813
- payment_type,
25814
- activating,
25815
- invalid,
25816
- date,
25817
-
25818
- id_branch,
25819
- id_payment,
25820
- id_restriction,
25821
- id_package,
25822
- package_type,
25823
- payment_type,
25824
- payment_detail_type,
25825
- day,
25826
- tax,
25827
- price,
25828
- quantity
25829
- }
25830
- * @param data
25831
- * @return Promise => response = {} / error
25832
- * 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
25833
- */
25834
- createPayment_Detail_byDealer(data: any): any;
25835
- /**
25836
- * @example:
25837
- * this.vhQuerySales.updatePayment_Detail_byDealer('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
25838
- .then((response)=>{
25839
- console.log('updatePayment_Detail_byDealer', response);
25840
- },(error:any)=>{
25841
- reject(error);
25842
- })
25843
- * @param id_payment_detail
25844
- * @param value
25845
- * @return Promise => response = undefined / error
25846
- */
25847
- updatePayment_Detail_byDealer(id_payment_detail: string, value: object): Promise<unknown>;
25848
- /**
25849
- * @example:
25850
- * let time = new Date();
25851
- * time.setDate(time.getDate()-7);
25852
- * this.vhQuerySales.getPayment_details_byDealer({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0)
25853
- .then((payment_details)=>{
25854
- console.log('getPayment_details_byDealer', payment_details);
25855
- })
25856
- * @param query
25857
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25858
- * @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
25859
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25860
- * @return Promise Array => array = [{},{},...] / error
25861
- */
25862
- getPayment_details_byDealer(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25863
- /**
25864
- * @example:
25865
- * this.vhQuerySales.getPayment_detail_byDealer('5fb67fda87c0f21d484cbdf3')
25866
- .then((payment_detail)=>{
25867
- console.log('getPayment_detail_byDealer', payment_detail);
25868
- })
25869
- * @param id_payment_detail
25870
- * @return Promise => payment_detail ={} or null / error
25871
- */
25872
- getPayment_detail_byDealer(id_payment_detail: any): Promise<unknown>;
25873
- /**
25874
- * @example:
25875
- * this.vhQuerySales.deletePayment_Detail_byDealer('5fb67fda87c0f21d484cbdf3')
25876
- .then((response)=>{
25877
- console.log('deletePayment_Detail_byDealer', response);
25878
- },(error:any)=>{
25879
- reject(error);
25880
- })
25881
- * @param id_payment_detail
25882
- * @return Promise => Promise => response = undefined / error
25883
- */
25884
- deletePayment_Detail_byDealer(id_payment_detail: string): Promise<unknown>;
25885
- /**
25886
- * @example:
25887
- * this.vhQuerySales.getPackage_byDealer('5fb67fda87c0f21d484cbdf3')
25888
- .then((package)=>{
25889
- console.log('getPackage_byDealer', package);
25890
- })
25891
- * @param id_package
25892
- * @return Promise => package ={} or null / error
25893
- */
25894
- getPackage_byDealer(id_package: any): Promise<unknown>;
25895
- /**
25896
- * @example:
25897
- * this.vhQuerySales.updateLicenseKEY_byDealer('5fb6780ca2148e09806c5b01', {total:990000})
25898
- .then((response)=>{
25899
- console.log('updateLicenseKEY_byDealer', response);
25900
- }, error=>{
25901
- console.log('error', error);
25902
- })
25903
- * @param id_dealer
25904
- * @param id_licenseKEY
25905
- * @param value
25906
- * @return Promise => response = undefined / error
25907
- */
25908
- updateLicenseKEY_byDealer(id_dealer: string, id_licenseKEY: string, value: any): Promise<unknown>;
25909
- /**
25910
- * @example:
25911
- * let time = new Date();
25912
- * time.setDate(time.getDate()-7);
25913
- * this.vhQuerySales.getLicenseKEYs_byDealer({payment_type:{$eq:5}}, {},{},0)
25914
- .then((payments)=>{
25915
- console.log('getLicenseKEYs_byDealer', payments);
25916
- })
25917
- * @param query
25918
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25919
- * @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
25920
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25921
- * @return — Array -> array = [{},{},...]
25922
- */
25923
- getLicenseKEYs_byDealer(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25924
- /**
25925
- * @example:
25926
- * this.vhQuerySales.updateLicenseKEY_byStore('5fb6780ca2148e09806c5b01', {total:990000})
25927
- .then((response)=>{
25928
- console.log('updateLicenseKEY_byStore', response);
25929
- }, error=>{
25930
- console.log('error', error);
25931
- })
25932
- * @param id_store
25933
- * @param id_licenseKEY
25934
- * @param value
25935
- * @return Promise => response = undefined / error
25936
- */
25937
- updateLicenseKEY_byStore(id_store: string, id_licenseKEY: string, value: any): Promise<unknown>;
25938
- /**
25939
- * @example:
25940
- * let time = new Date();
25941
- * time.setDate(time.getDate()-7);
25942
- * this.vhQuerySales.getLicenseKEYs_byStore({payment_type:{$eq:5}}, {},{},0)
25943
- .then((payments)=>{
25944
- console.log('getLicenseKEYs_byStore', payments);
25945
- })
25946
- * @param query
25947
- * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
25948
- * @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
25949
- * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
25950
- * @return — Array -> array = [{},{},...]
25951
- */
25952
- getLicenseKEYs_byStore(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
25953
- /**
25954
- * Lấy về thông tin Đại lý từ mã đại lý (dealercode)
25955
- * @example:
25956
- * this.vhQuerySales.getDealer_byDealerCode()
25957
- .then((dealer)=>{
25958
- if(dealer){
25959
- console.log('getDealer_byDealerCode', dealer);
25960
- }
25961
- }, error=>{
25962
- console.log(error);
25963
- })
25964
- * @param dealercode
25965
- * @returns object or null
25966
- */
25967
- getDealer_byDealerCode(dealercode: any): Promise<unknown>;
25968
- /**
25969
- * Lấy về tất cả các Shop đăng ký dùng APP thuộc quản lý của Đại lý (IDdealer)
25970
- * @param starttime
25971
- * @param endtime
25972
- * @param IDdealer
25973
- * @returns Array
25974
- */
25975
- getStoresAPP_byTime_byDealer(starttime: any, endtime: any, IDdealer: any): Promise<unknown>;
25976
- /**
25977
- * @example:
25978
- * this.vhQuerySales.getBranchs_byIDstore('5fb67fda87c0f21d484cbdf3')
25979
- .then((branchs)=>{
25980
- console.log('getBranchs_byIDstore', branchs);
25981
- })
25982
- * @param id_store
25983
- * @return Promise => Array -> array = [{},{},...]
25984
- */
25985
- getBranchs_byIDstore(id_store: any): Promise<unknown>;
25986
- private publishObservableEventPromotions;
25987
- private observableLocalPromotions;
25988
- /**
25989
- * @example:
25990
- * this.observablePromotion = this.vhQuerySales.getObservableLocalPromotions().subscribe((localPromotions:any) => {
25991
- do something...
25992
- })
25993
-
25994
- ngOnDestroy(){
25995
- this.observablePromotion.unsubscribe();
25996
- }
25997
- * @returns Observerble (Array) => Array(object) => array = [{},{},...]
25998
- */
25999
- private getObservableLocalPromotions;
26000
- /**
26001
- * @example:
26002
- * let promotion = this.vhQuerySales.getlocalPromotion('5fb6780ca2148e09806c5b01');
26003
- * @param id_promotion
26004
- * @return Object => obj = {} or null
26005
- */
26006
- getlocalPromotion(id_promotion: any): null;
26007
- /**
26008
- * @example:
26009
- * let promotions = this.vhQuerySales.getlocalPromotions();
26010
- * @return Array(object) => array = [{},{},...]
26011
- */
26012
- getlocalPromotions(): never[];
26013
- /**
26014
- * @example:
26015
- * let date = new Date();
26016
- * this.vhQuerySales.refreshLocalPromotions(date)
26017
- .then(()=>{
26018
- do something.....
26019
- }, error=>{
26020
- console.log('error', error);
26021
- })
26022
- * Hàm này refresh giá trị mới nhất cho hàm getlocalPromotion(), getlocalPromotions() trong localstorage
26023
- * @return Promise => null
26024
- */
26025
- private refreshLocalPromotions;
26026
- /**
26027
- * @example:
26028
- * this.vhQuerySales.addPromotion({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
26029
- .then((promotion)=>{
26030
- console.log('addPromotion', promotion);
26031
- },(error:any)=>{
26032
- console.log('error', error);
26033
- })
26034
- * @param colname
26035
- * @param data
26036
- * @return Promise => obj = {}
26037
- * 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
26038
- */
26039
- addPromotion(data: any): Promise<unknown>;
26040
- /**
26041
- * @example:
26042
- * this.vhQuerySales.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
26043
- .then((bool:any)=>{
26044
- console.log('updatePromotion', bool);
26045
- }, error=>{
26046
- console.log('error', error);
26047
- })
26048
- * @param id_promotion
26049
- * @param data
26050
- * @return Promise => bool = true or false
26051
- */
26052
- updatePromotion(id_promotion: string, data: object): Promise<unknown>;
26053
- /**
26054
- * @example:
26055
- * this.vhQuerySales.deletePromotion('5fb67fda87c0f21d484cbdf3')
26056
- .then((bool:any)=>{
26057
- console.log('deletePromotion', bool);
26058
- })
26059
- * @param id_promotion
26060
- * @return Promise => bool = true or false
26061
- */
26062
- deletePromotion(id_promotion: any): Promise<unknown>;
26063
- /**
26064
- * @example
26065
- * this.vhQuerySales.getPromotion('5fb67fda87c0f21d484cbdf3')
26066
- .then((promotion)=>{
26067
- console.log('getPromotion', promotion);
26068
- })
26069
- * @param id_promotion
26070
- * @return false or object
26071
- */
26072
- getPromotion(id_promotion: string): Promise<unknown>;
26073
- /**
26074
- * @example
26075
- * this.vhQuerySales.getPromotions()
26076
- .then((response)=>{
26077
- console.log('getPromotions', response);
26078
- })
26079
- * @return array(object) = [{},{},..]
26080
- */
26081
- private getPromotions;
25866
+ private getPromotions;
26082
25867
  /**
26083
25868
  * 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
26084
25869
  * @example:
@@ -28907,6 +28692,307 @@ export declare class VhQuerySales {
28907
28692
  static ɵfac: i0.ɵɵFactoryDeclaration<VhQuerySales, never>;
28908
28693
  static ɵprov: i0.ɵɵInjectableDeclaration<VhQuerySales>;
28909
28694
  }
28695
+ export declare class VhQueryDealer {
28696
+ private vhMGDB_auth;
28697
+ private vhMGDB_database;
28698
+ private vhMGDB_rootdatabase;
28699
+ private vhAuth;
28700
+ private vhAlgorithm;
28701
+ constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm);
28702
+ /**
28703
+ * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR
28704
+ * @example:
28705
+ * this.vhQueryDealer.vietqr_getBanks()
28706
+ .then((rsp:any)=>{
28707
+ if(rsp.vcode === 0){
28708
+ }
28709
+ }, error=>{
28710
+ console.log(error)
28711
+ })
28712
+ * @returns Promise => rsp ={vcode, msg, data(array)} / error
28713
+ * vcode == 0: success
28714
+ */
28715
+ vietqr_getBanks(): Promise<unknown>;
28716
+ /**
28717
+ * Tạo mã QR cho Đại lý quét thanh toán
28718
+ * @example:
28719
+ * this.vhQueryDealer.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000)
28720
+ .then((rsp:any)=>{
28721
+ if(rsp.vcode === 0){
28722
+ }
28723
+ }, error=>{
28724
+ console.log(error)
28725
+ })
28726
+ * @param accountNo: số tài khoản ngân hàng
28727
+ * @param accountName: tên chủ tài khoản
28728
+ * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks())
28729
+ * @param template: compact2, compact, qr_only, print
28730
+ + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản
28731
+ + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng
28732
+ + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR
28733
+ + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản
28734
+ * @param id_bill: _id của đơn hàng
28735
+ * @param amount: tổng tiền khách phải thanh toán
28736
+ * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error
28737
+ * vcode == 0: success
28738
+ */
28739
+ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise<unknown>;
28740
+ /**
28741
+ * @example:
28742
+ * let data = {
28743
+ date: new Date(),
28744
+ 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
28745
+ payment: 990.000,
28746
+ tax: 0,
28747
+ total: 990.000
28748
+ }
28749
+ * this.vhQueryDealer.createPayment(data)
28750
+ .then((payment)=>{
28751
+ console.log('createPayment', payment);
28752
+ },(error:any)=>{
28753
+ console.log('error', error);
28754
+ })
28755
+ * payment = {
28756
+ _id,
28757
+ payment_code,
28758
+ id_dealer,
28759
+
28760
+ date
28761
+ payment_type,
28762
+ payment,
28763
+ tax,
28764
+ total
28765
+ }
28766
+ * @param payment : object
28767
+ * @return Promise => payment = {} / error
28768
+ * 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
28769
+ * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail
28770
+ */
28771
+ createPayment(data: any): Promise<unknown>;
28772
+ /**
28773
+ * @example:
28774
+ * this.vhQueryDealer.updatePayment('5fb6780ca2148e09806c5b01', {total:990000})
28775
+ .then((response)=>{
28776
+ console.log('updatePayment', response);
28777
+ }, error=>{
28778
+ console.log('error', error);
28779
+ })
28780
+ * @param id_payment
28781
+ * @param value
28782
+ * @return Promise => response = undefined / error
28783
+ */
28784
+ updatePayment(id_payment: string, value: any): Promise<unknown>;
28785
+ /**
28786
+ * @example:
28787
+ * this.vhQueryDealer.deletePayment('5fb67fda87c0f21d484cbdf3')
28788
+ .then((response)=>{
28789
+ console.log('deletePayment', response);
28790
+ }, error=>{
28791
+ console.log(error, error);
28792
+ })
28793
+ * @param id_payment
28794
+ * @return Promise => response = undefined / error
28795
+ */
28796
+ deletePayment(id_payment: any): Promise<unknown>;
28797
+ /**
28798
+ * @example:
28799
+ * let time = new Date();
28800
+ * time.setDate(time.getDate()-7);
28801
+ * this.vhQueryDealer.getPayments({payment_type:{$eq:5}}, {},{},0)
28802
+ .then((payments)=>{
28803
+ console.log('getPayments', payments);
28804
+ })
28805
+ * @param query
28806
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
28807
+ * @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
28808
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
28809
+ * @return — Array -> array = [{},{},...]
28810
+ */
28811
+ getPayments(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
28812
+ /**
28813
+ * @example:
28814
+ * this.vhQueryDealer.getPayment('5fb67fda87c0f21d484cbdf3')
28815
+ .then((payment)=>{
28816
+ console.log('getPayment', payment);
28817
+ })
28818
+ * @param id_payment
28819
+ * @return Promise => payment ={} or null / error
28820
+ */
28821
+ getPayment(id_payment: any): Promise<unknown>;
28822
+ /**
28823
+ * @example:
28824
+ let payment_detail_main = {
28825
+ id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn
28826
+ id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id
28827
+ id_restriction: 'main_package_advanced', //package.id_restriction
28828
+ id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua
28829
+ package_type: 1, //gói chinh, gói tmđt hay gói facebook...
28830
+ day: 31, //package.day,
28831
+ tax: 0, package.tax,
28832
+ price: 99000, package.price,
28833
+ quantity: 1, //khách chọn
28834
+ 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
28835
+ }
28836
+ this.vhQueryDealer.createPayment_Detail({})
28837
+ .then((payment_detail)=>{
28838
+ console.log('createPayment_Detail', payment_detail);
28839
+ },(error:any)=>{
28840
+ console.log('error', error);
28841
+ })
28842
+ payment_detail = {
28843
+ _id,
28844
+ id_dealer,
28845
+ payment_type,
28846
+ activating,
28847
+ invalid,
28848
+ date,
28849
+
28850
+ id_branch,
28851
+ id_payment,
28852
+ id_restriction,
28853
+ id_package,
28854
+ package_type,
28855
+ payment_type,
28856
+ payment_detail_type,
28857
+ day,
28858
+ tax,
28859
+ price,
28860
+ quantity
28861
+ }
28862
+ * @param data
28863
+ * @return Promise => response = {} / error
28864
+ * 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
28865
+ */
28866
+ createPayment_Detail(data: any): any;
28867
+ /**
28868
+ * @example:
28869
+ * this.vhQueryDealer.updatePayment_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'})
28870
+ .then((response)=>{
28871
+ console.log('updatePayment_Detail', response);
28872
+ },(error:any)=>{
28873
+ reject(error);
28874
+ })
28875
+ * @param id_payment_detail
28876
+ * @param value
28877
+ * @return Promise => response = undefined / error
28878
+ */
28879
+ updatePayment_Detail(id_payment_detail: string, value: object): Promise<unknown>;
28880
+ /**
28881
+ * @example:
28882
+ * let time = new Date();
28883
+ * time.setDate(time.getDate()-7);
28884
+ * this.vhQueryDealer.getPayment_details({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0)
28885
+ .then((payment_details)=>{
28886
+ console.log('getPayment_details', payment_details);
28887
+ })
28888
+ * @param query
28889
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
28890
+ * @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
28891
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
28892
+ * @return Promise Array => array = [{},{},...] / error
28893
+ */
28894
+ getPayment_details(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
28895
+ /**
28896
+ * @example:
28897
+ * this.vhQueryDealer.getPayment_detail('5fb67fda87c0f21d484cbdf3')
28898
+ .then((payment_detail)=>{
28899
+ console.log('getPayment_detail', payment_detail);
28900
+ })
28901
+ * @param id_payment_detail
28902
+ * @return Promise => payment_detail ={} or null / error
28903
+ */
28904
+ getPayment_detail(id_payment_detail: any): Promise<unknown>;
28905
+ /**
28906
+ * @example:
28907
+ * this.vhQueryDealer.deletePayment_Detail('5fb67fda87c0f21d484cbdf3')
28908
+ .then((response)=>{
28909
+ console.log('deletePayment_Detail', response);
28910
+ },(error:any)=>{
28911
+ reject(error);
28912
+ })
28913
+ * @param id_payment_detail
28914
+ * @return Promise => Promise => response = undefined / error
28915
+ */
28916
+ deletePayment_Detail(id_payment_detail: string): Promise<unknown>;
28917
+ /**
28918
+ * @example:
28919
+ * this.vhQueryDealer.getPackage('5fb67fda87c0f21d484cbdf3')
28920
+ .then((package)=>{
28921
+ console.log('getPackage', package);
28922
+ })
28923
+ * @param id_package
28924
+ * @return Promise => package ={} or null / error
28925
+ */
28926
+ getPackage(id_package: any): Promise<unknown>;
28927
+ /**
28928
+ * @example:
28929
+ * this.vhQueryDealer.updateLicenseKEY('5fb6780ca2148e09806c5b01', {total:990000})
28930
+ .then((response)=>{
28931
+ console.log('updateLicenseKEY', response);
28932
+ }, error=>{
28933
+ console.log('error', error);
28934
+ })
28935
+ * @param id_licenseKEY
28936
+ * @param value
28937
+ * @return Promise => response = undefined / error
28938
+ */
28939
+ updateLicenseKEY(id_licenseKEY: string, value: any): Promise<unknown>;
28940
+ /**
28941
+ * @example:
28942
+ * let time = new Date();
28943
+ * time.setDate(time.getDate()-7);
28944
+ * this.vhQueryDealer.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0)
28945
+ .then((payments)=>{
28946
+ console.log('getLicenseKEYs', payments);
28947
+ })
28948
+ * @param query
28949
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
28950
+ * @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
28951
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
28952
+ * @return — Array -> array = [{},{},...]
28953
+ */
28954
+ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
28955
+ /**
28956
+ * Lấy về thông tin Đại lý từ mã đại lý (dealercode)
28957
+ * @example:
28958
+ * this.vhQueryDealer.getDealer_byDealerCode()
28959
+ .then((dealer)=>{
28960
+ if(dealer){
28961
+ console.log('getDealer_byDealerCode', dealer);
28962
+ }
28963
+ }, error=>{
28964
+ console.log(error);
28965
+ })
28966
+ * @param dealercode
28967
+ * @returns object or null
28968
+ */
28969
+ getDealer_byDealerCode(dealercode: any): Promise<unknown>;
28970
+ /**
28971
+ * @example:
28972
+ * this.vhQueryDealer.getStoresAPP_byTime(starttime, endtime, '5fb67fda87c0f21d484cbdf3')
28973
+ .then((stores)=>{
28974
+ console.log('getStoresAPP_byTime', stores);
28975
+ })
28976
+ * Lấy về tất cả các Shop đăng ký dùng APP thuộc quản lý của Đại lý (IDdealer)
28977
+ * @param starttime
28978
+ * @param endtime
28979
+ * @param IDdealer
28980
+ * @returns Promise => Array -> array = [{},{},...]
28981
+ */
28982
+ getStoresAPP_byTime(starttime: any, endtime: any, IDdealer: any): Promise<unknown>;
28983
+ /**
28984
+ * @example:
28985
+ * this.vhQueryDealer.getBranchs_byIDstore('5fb67fda87c0f21d484cbdf3')
28986
+ .then((branchs)=>{
28987
+ console.log('getBranchs_byIDstore', branchs);
28988
+ })
28989
+ * @param id_store
28990
+ * @return Promise => Array -> array = [{},{},...]
28991
+ */
28992
+ getBranchs_byIDstore(id_store: any): Promise<unknown>;
28993
+ static ɵfac: i0.ɵɵFactoryDeclaration<VhQueryDealer, never>;
28994
+ static ɵprov: i0.ɵɵInjectableDeclaration<VhQueryDealer>;
28995
+ }
28910
28996
  export declare class VhQuerySCclient {
28911
28997
  private vhMGDB_auth;
28912
28998
  private vhMGDB_database;