ionic-vhframeworks 4.0.0 → 4.0.2

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.
@@ -29,6 +29,19 @@ export declare class VhAlgorithm {
29
29
  private papa;
30
30
  private dom;
31
31
  constructor(platform: Platform, file: File, socialSharing: SocialSharing, papa: Papa, dom: DomSanitizer);
32
+ /**
33
+ * Hàm này so sanh sâu 2 object bằng nhau
34
+ * @param object1
35
+ * @param object2
36
+ * @returns
37
+ */
38
+ deepObjectEqual(object1: any, object2: any): boolean;
39
+ /**
40
+ * Hàm này kiểm tra có phải là object không
41
+ * @param object
42
+ * @returns
43
+ */
44
+ isObject(object: any): boolean;
32
45
  ObjectId(length?: number): string;
33
46
  /**
34
47
  * @example:
@@ -1097,6 +1110,8 @@ export declare class VhQueryCafe {
1097
1110
  private subjecttables;
1098
1111
  private subjectdiscount_bills;
1099
1112
  private callbackdispatcher;
1113
+ private callbacksyncopeningbill;
1114
+ private sync_code;
1100
1115
  /**
1101
1116
  * @Nghiệp vụ tạo (bill_type 5->1), hủy đơn hàng bán món ăn (dùng hàm)
1102
1117
  * {createBill, getBill} -> {createBill_detail, updateBill_detail, deleteBill_detail} -> {saveBill_Billdetail, deleteBill_Billdetail}
@@ -3325,15 +3340,56 @@ export declare class VhQueryCafe {
3325
3340
  * @notice : hàm này chỉ dùng xóa những bill_type(7,8,11,12) mà không có phát sinh bill_detail
3326
3341
  */
3327
3342
  deleteBill(id_bill: any): Promise<unknown>;
3343
+ /**
3344
+ * Hàm này dùng để đồng bộ hóa đơn đang mở ở 2 giao diện hoặc 2 thiết bị khác nhau
3345
+ * @example:
3346
+ * this.vhQueryCafe.observableSyncOpeningBill('5fb6780ca2148e09806c5b01', 5)
3347
+ .subscribe((bill)=> {
3348
+ console.log('observableSyncOpeningBill', bill);
3349
+ },(error:any) => {
3350
+ console.log(error);
3351
+ })
3352
+ * @param id_bill
3353
+ * @param bill_type
3354
+ * @returns Observable => bill hoặc null;
3355
+ * + trả về bill là hóa đơn đó đang được sử ở thiết bị khác;
3356
+ * + trả về null là hóa đơn đó đã bị xóa hoặc đã chuyển sang trạng thái bill_type khác
3357
+ * @notice : nhớ đóng closeSyncOpeningBill() khi thoát trang hiện tại
3358
+ */
3359
+ observableSyncOpeningBill(id_bill: string, bill_type: number): Observable<unknown>;
3360
+ /**
3361
+ * @example:
3362
+ * this.vhQueryCafe.closeSyncOpeningBill();
3363
+ * @returns void
3364
+ */
3365
+ closeSyncOpeningBill(): void;
3328
3366
  /**
3329
3367
  * @example:
3330
3368
  * this.vhQueryCafe.createPaymentVnpay(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/')
3331
3369
  * @param amount
3332
3370
  * @param orderDescription (lưu ý chữ không dấu)
3333
- * @param id_payment
3371
+ * @param id_payment : id của hóa đơn khách hàng cần thanh toán
3334
3372
  * @param backHref : lấy link mà chạy khởi động lại trang
3373
+ * @Return void
3335
3374
  */
3336
3375
  createPaymentVnpay(amount: number, orderDescription: string, id_payment: string, backHref: string): any;
3376
+ /**
3377
+ * @example:
3378
+ * this.vhQueryCafe.createPaymentVnpay(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/')
3379
+ .then(link=>{
3380
+ //Nếu Desktop chạy luôn link này: window.location = response.data;
3381
+ // Nếu Mobile chạy link link này trong tag frame html
3382
+ },error=>{
3383
+ console.log('error', error);
3384
+ })
3385
+ * @param platform : "mobile"/"desktop"
3386
+ * @param amount
3387
+ * @param orderDescription (lưu ý chữ không dấu)
3388
+ * @param id_payment : id của hóa đơn khách hàng cần thanh toán
3389
+ * @param backHref : lấy link mà chạy khởi động lại trang
3390
+ * @Return Promise => trả về link thanh toán vnpay
3391
+ */
3392
+ createPaymentVnpay_Mobile(amount: number, orderDescription: string, id_payment: string, backHref: string, platform: string): any;
3337
3393
  /**
3338
3394
  * @example:
3339
3395
  * let data = {
@@ -7553,6 +7609,8 @@ export declare class VhQuerySales {
7553
7609
  private subjecttaxs;
7554
7610
  private subjectwarrantys;
7555
7611
  private subjectdiscount_bills;
7612
+ private callbacksyncopeningbill;
7613
+ private sync_code;
7556
7614
  constructor(vhmongo_firebase: Vhmongo_firebase, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm, iap2: InAppPurchase2, platform: Platform);
7557
7615
  /**
7558
7616
  * @description: hàm này lấy về những hạn chế của gói main_package (khách trả phí mua gói sử dụng các chức năng CHÍNH, mỗi gói sẽ có nhưng hạn chế khác nhau về user_number, show_report_duration)
@@ -10320,6 +10378,104 @@ export declare class VhQuerySales {
10320
10378
  * @return array(object) = [{},{},..]
10321
10379
  */
10322
10380
  getPrinters(): Promise<unknown>;
10381
+ /**
10382
+ * Hàm này dùng để thực hiện trừ hàng hóa trong Payment_Card
10383
+ * 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
10384
+ * @example
10385
+ let bill = {
10386
+ bill_type: 51,
10387
+ id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83',
10388
+ id_branch: 'ADGNX9HFzffJ59yRtqNd',
10389
+ id_customer: 'cus001',
10390
+ id_wallet: 'wallet001',
10391
+ note: '',
10392
+ date: new Date(),
10393
+ bill_code: 'L46K0502'
10394
+ }
10395
+ let bill_details =[{
10396
+ id_payment_card: '7Q5BZVRlyySrhShngMDv',
10397
+ id_payment_card_code: '33cTgnd2xZo3OW9tsu1d',
10398
+ pctype: 1,
10399
+ id_product:'9tg6UxzK26DDVEVHsvq5'
10400
+ quantity: 2
10401
+ price: 200000
10402
+ ptype: 1
10403
+ },{
10404
+ id_payment_card: '7Q5BZVRlyySrhShngMDv',
10405
+ id_payment_card_code: '33cTgnd2xZo3OW9tsu1d',
10406
+ pctype: 1,
10407
+ id_product:'jUqd5bE6y2JhX0aCd5TF',
10408
+ quantity: 1
10409
+ price: 100000
10410
+ ptype: 2
10411
+ }]
10412
+ this.vhQuerySales.createBill_Billdetail_51(bill, bill_details)
10413
+ .then((bill:any)=>{
10414
+ console.log(bill._id);
10415
+ },(error:any)=>{
10416
+ console.log('error ', error);
10417
+ })
10418
+ * @param bill
10419
+ * @param bill_details
10420
+ * @returns Promise => object = {} or null
10421
+ */
10422
+ createBill_Billdetail_51(bill: any, bill_details: any): any;
10423
+ /**
10424
+ * Hàm này dùng để thực hiện đổi voucher lấy hàng hóa
10425
+ * @example
10426
+ let bill = {
10427
+ bill_type: 41,
10428
+ id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83',
10429
+ id_branch: '2rVieBQTubQ2hjUnpwU4w7qSlD83',
10430
+ id_customer: 'cus001',
10431
+ id_wallet: 'wallet001',
10432
+ note: '',
10433
+ date: new Date(),
10434
+ bill_code: ''
10435
+ }
10436
+ let bill_details =[{
10437
+ id_voucher: 'voucher006',
10438
+ id_voucher_code: 'MHRD9N0531',
10439
+ vtype: 1,
10440
+ quantity: 2
10441
+ vouchers:[{
10442
+ id_product:'9tg6UxzK26DDVEVHsvq5'
10443
+ quantity: 5
10444
+ price: 100000
10445
+ ptype: 1
10446
+ },{
10447
+ id_product:'jUqd5bE6y2JhX0aCd5TF',
10448
+ quantity: 1
10449
+ price: 50000
10450
+ ptype: 2
10451
+ },{
10452
+ id_product,
10453
+ quantity,
10454
+ price,
10455
+ ptype: 5// bây giờ phần mềm chưa dùng voucher có combo
10456
+ combos:[{
10457
+ id_product,
10458
+ quantity,
10459
+ price,
10460
+ ptype: 1
10461
+ },{
10462
+ id_product,
10463
+ quantity,
10464
+ price,
10465
+ ptype: 2
10466
+ }]
10467
+ }]
10468
+ this.vhQuerySales.createBill_Billdetail_41(bill, bill_details)
10469
+ .then((bill:any)=>{
10470
+ console.log(bill._id);
10471
+ },(error:any)=>{
10472
+ console.log('error ', error);
10473
+ })
10474
+ * @param bill
10475
+ * @param bill_details
10476
+ * @returns Promise => object = {} or null
10477
+ */
10478
+ createBill_Billdetail_41(bill: any, bill_details: any): any;
10323
10479
  /**
10324
10480
  * * Hàm này dùng cho những bill nào được tao ra thêm bill_detail vào và lưu lên database luôn
10325
10481
  * @example
@@ -10495,15 +10651,56 @@ export declare class VhQuerySales {
10495
10651
  * @notice : hàm này chỉ dùng xóa những bill_type (7,8,11,12) mà không có phát sinh bill_detail
10496
10652
  */
10497
10653
  deleteBill(id_bill: any): Promise<unknown>;
10654
+ /**
10655
+ * Hàm này dùng để đồng bộ hóa đơn đang mở ở 2 giao diện hoặc 2 thiết bị khác nhau
10656
+ * @example:
10657
+ * this.vhQuerySales.observableSyncOpeningBill('5fb6780ca2148e09806c5b01', 5)
10658
+ .subscribe((bill)=> {
10659
+ console.log('observableSyncOpeningBill', bill);
10660
+ },(error:any) => {
10661
+ console.log(error);
10662
+ })
10663
+ * @param id_bill
10664
+ * @param bill_type
10665
+ * @returns Observable => bill hoặc null;
10666
+ * + trả về bill là hóa đơn đó đang được sử ở thiết bị khác;
10667
+ * + trả về null là hóa đơn đó đã bị xóa hoặc đã chuyển sang trạng thái bill_type khác
10668
+ * @notice : nhớ đóng closeSyncOpeningBill() khi thoát trang hiện tại
10669
+ */
10670
+ observableSyncOpeningBill(id_bill: string, bill_type: number): Observable<unknown>;
10671
+ /**
10672
+ * @example:
10673
+ * this.vhQuerySales.closeSyncOpeningBill();
10674
+ * @returns void
10675
+ */
10676
+ closeSyncOpeningBill(): void;
10498
10677
  /**
10499
10678
  * @example:
10500
10679
  * this.vhQuerySales.createPaymentVnpay(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/')
10501
10680
  * @param amount
10502
10681
  * @param orderDescription (lưu ý chữ không dấu)
10503
- * @param id_payment
10682
+ * @param id_payment : id của hóa đơn khách hàng cần thanh toán
10504
10683
  * @param backHref : lấy link mà chạy khởi động lại trang
10684
+ * @Return void
10505
10685
  */
10506
10686
  createPaymentVnpay(amount: number, orderDescription: string, id_payment: string, backHref: string): any;
10687
+ /**
10688
+ * Hàm này dùng trong trường hợp dùng iFrame chạy ulr của vnpay, hoặc có nhiều thanh toán như vnpay, momo... cho khách chọn trước khi thanh toán
10689
+ * @example:
10690
+ * this.vhQuerySales.createPaymentVnpay_iFrame(10000, 'Thanh toan hoa don so A7TG2004', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/')
10691
+ .then(link=>{
10692
+ //Nếu Desktop chạy luôn link này: window.location = response.data;
10693
+ // Nếu Mobile chạy link link này trong tag frame html
10694
+ },error=>{
10695
+ console.log('error', error);
10696
+ })
10697
+ * @param amount
10698
+ * @param orderDescription (lưu ý chữ không dấu)
10699
+ * @param id_payment : id của hóa đơn khách hàng cần thanh toán
10700
+ * @param backHref : lấy link mà chạy khởi động lại trang
10701
+ * @Return Promise => trả về link thanh toán vnpay
10702
+ */
10703
+ createPaymentVnpay_iFrame(amount: number, orderDescription: string, id_payment: string, backHref: string): any;
10507
10704
  /**
10508
10705
  * @example:
10509
10706
  * let data = {
@@ -11372,6 +11569,7 @@ export declare class VhQuerySales {
11372
11569
  * @Notice bill_type = [1,10,15,30,2,3,9,31]
11373
11570
  */
11374
11571
  getReportInputOutputInventory_byTime_byIDProduct(starttime: any, endtime: any, IDproduct: any, IDbranch?: any): Promise<any>;
11572
+ private makeCorrectStock1stDayOfMonth;
11375
11573
  /**
11376
11574
  * Hàm này dùng trong page Tồn kho, giá trị tồn kho, doanh số, chi phí nhập hàng tại một thời điểm endtime nào đó
11377
11575
  * @example:
@@ -11466,15 +11664,18 @@ export declare class VhQuerySales {
11466
11664
  private getReportInputOutputInventory_byTime_byIDProduct1;
11467
11665
  syncInventoryEveryDay_StockBeginning(): Promise<any>;
11468
11666
  /**
11667
+ * Hàm này kiểm tra, tính toán tồn kho cho sản phẩm theo thuật toán 60days lúc khởi động Desktop hoặc Mobile:
11668
+ * + Nếu sản phẩm nào mà tháng gần nhất chưa tính thì hàm sẽ tính
11669
+ * + Nếu sản phẩm mới thêm vào thì hàm sẽ tính
11469
11670
  * vhQuerySales
11470
11671
  * @returns
11471
11672
  */
11472
11673
  private syncInventoryEveryDay_Stock1stDayOfMonth;
11473
11674
  private syncInventoryEveryDay1;
11474
11675
  /**
11475
- * Hàm này dùng trong page XUẤT-NHẬP-TỒN -> Xuất nhập tồn
11676
+ * Hàm này dùng động bộ dữ liệu theo thuật toán 60day
11476
11677
  * @example:
11477
- * this.vhQuerySales.getReportInputOutputInventory_byTime_byIDProduct(starttime , endtime, 'all', 'tj1iYodbVoShwtEetACx')
11678
+ * this.vhQuerySales.makeCorrectQuantityProducts_60days()
11478
11679
  .then((json)=>{
11479
11680
  console.log('json', json);
11480
11681
  })
@@ -11767,6 +11968,1252 @@ export declare class VhQuerySales {
11767
11968
  * @param id_product
11768
11969
  */
11769
11970
  getReportProduct_byID(starttime: any, endtime: any, id_product: any): Promise<any>;
11971
+ /*****************************************************************************************************
11972
+ ******************************* CHƯƠNG TRÌNH BÁN HÀNG ***********************************************
11973
+ *****************************************************************************************************/
11974
+ /******************************************TÍCH ĐIỂM THEO HÓA ĐƠN*************************************/
11975
+ /**
11976
+ * @example:
11977
+ * let data ={
11978
+ name : 'chương trình tích điểm hóa đơn',
11979
+ exchange :{
11980
+ money : 100000,
11981
+ points : 1
11982
+ },
11983
+ bill_total_minimum :0,
11984
+ payment :{
11985
+ enable : true,
11986
+ money : 100000,
11987
+ points : 1
11988
+ },
11989
+ include_discount: false,
11990
+ include_promotion_product : false,
11991
+ include_paid_points : false,
11992
+ include_tax : false,
11993
+ include_fee : false,
11994
+ id_branch : '5fb6780ca2148e09806c5b01',
11995
+ earned_points_clear_auto:{
11996
+ enable,
11997
+ months_of_year: 1
11998
+ }
11999
+ }
12000
+ this.vhQuerySales.addEarningPointsBill(data)
12001
+ .then((earningpoint)=>{
12002
+ console.log('addEarningPointsBill', earningpoint);
12003
+ },error=>{
12004
+ console.log('error', error);
12005
+ })
12006
+ * @param data
12007
+ * @return Promise => obj = {}
12008
+ */
12009
+ addEarningPointsBill(data: any): Promise<unknown>;
12010
+ /**
12011
+ * @example:
12012
+ let data ={
12013
+ name : 'chương trình tích điểm hóa đơn',
12014
+ exchange :{
12015
+ money : 100000,
12016
+ points : 1
12017
+ },
12018
+ bill_total_minimum :0,
12019
+ payment :{
12020
+ enable : true,
12021
+ money : 100000,
12022
+ points : 1
12023
+ },
12024
+ include_discount: false,
12025
+ include_promotion_product : false,
12026
+ include_paid_points : false,
12027
+ include_tax : false,
12028
+ include_fee : false,
12029
+ id_branch : '5fb6780ca2148e09806c5b01'
12030
+ }
12031
+ * @param id_earning_points_bill
12032
+ * @param data
12033
+ * @return Promise => bool = true or false
12034
+ */
12035
+ updateEarningPointsBill(id_earning_points_bill: string, data: object): Promise<unknown>;
12036
+ /**
12037
+ * @example:
12038
+ * this.vhQuerySales.deleteEarningPointsBill('5fb67fda87c0f21d484cbdf3')
12039
+ .then((bool)=>{
12040
+ console.log('deleteEarningPointsBill', bool);
12041
+ })
12042
+ * @param id_earning_points_bill
12043
+ * @return Promise => bool = true or false
12044
+ */
12045
+ deleteEarningPointsBill(id_earning_points_bill: string): Promise<unknown>;
12046
+ /**
12047
+ * @example
12048
+ * this.vhQuerySales.getEarningPointsBill('5fb67fda87c0f21d484cbdf3')
12049
+ .then((earning_points_bill)=>{
12050
+ console.log('getEarningPointsBill', earning_points_bills);
12051
+ },error=>{
12052
+ reject(error);
12053
+ })
12054
+ * @param id_earning_points_bill
12055
+ * @return Promise => obj ={} or null
12056
+ */
12057
+ getEarningPointsBill(id_earning_points_bill: string): Promise<unknown>;
12058
+ /**
12059
+ * @example
12060
+ * this.vhQuerySales.getEarningPointsBills()
12061
+ .then((earning_points_bills)=>{
12062
+ console.log('getEarningPointsBills', earning_points_bills);
12063
+ })
12064
+ * @return Promise => array(object) = [{},{},..]
12065
+ */
12066
+ getEarningPointsBills(): Promise<unknown>;
12067
+ /**
12068
+ * @example:
12069
+ * let data ={
12070
+ name : 'chương trình tích điểm sản phẩm',
12071
+ exchange :{
12072
+ money : 100000,
12073
+ points : 1
12074
+ },
12075
+ payment :{
12076
+ enable : true,
12077
+ money : 100000,
12078
+ points : 1
12079
+ },
12080
+ include_promotion_product : false,
12081
+ include_paid_points : false,
12082
+ id_branch : '5fb6780ca2148e09806c5b01'
12083
+ }
12084
+ this.vhQuerySales.addEarningPointsProduct(data)
12085
+ .then((res)=>{
12086
+ console.log('addEarningPointsProduct', res);
12087
+ }, error=>{
12088
+ console.log('error', error);
12089
+ })
12090
+ * @param data
12091
+ * @return Promise => object or error
12092
+ */
12093
+ addEarningPointsProduct(data: any): Promise<unknown>;
12094
+ /**
12095
+ * @example:
12096
+ let data ={
12097
+ name : 'chương trình tích điểm sản phẩm',
12098
+ exchange :{
12099
+ money : 100000,
12100
+ points : 1
12101
+ },
12102
+ payment :{
12103
+ enable : true,
12104
+ money : 100000,
12105
+ points : 1
12106
+ },
12107
+ include_promotion_product : false,
12108
+ include_paid_points : false,
12109
+ id_branch : '5fb6780ca2148e09806c5b01'
12110
+ }
12111
+ * this.vhQuerySales.updateEarningPointsProduct(id_earning_points_product,data)
12112
+ .then((bool)=>{
12113
+ console.log('updateEarningPointsProduct', bool);
12114
+ }, error=>{
12115
+ console.log('error', error);
12116
+ })
12117
+ * @param id_earning_points_product
12118
+ * @param data
12119
+ * @return Promise => bool = true or false
12120
+ */
12121
+ updateEarningPointsProduct(id_earning_points_product: any, data: any): Promise<unknown>;
12122
+ /**
12123
+ * @example:
12124
+ * this.vhQuerySales.deleteEarningPointsProduct('654QFNMOIYUENC321')
12125
+ .then((bool)=>{
12126
+ console.log('deleteEarningPointsProduct', bool);
12127
+ }, error=>{
12128
+ console.log('error', error);
12129
+ })
12130
+ * @param id_earning_points_product
12131
+ * @return Promise => bool = true or false
12132
+ */
12133
+ deleteEarningPointsProduct(id_earning_points_product: any): Promise<unknown>;
12134
+ /**
12135
+ * @example:
12136
+ * this.vhQuerySales.getEarningPointsProduct('654QFNMOIYUENC321')
12137
+ .then((res)=>{
12138
+ console.log('getEarningPointsProduct', res);
12139
+ }, error=>{
12140
+ console.log('error', error);
12141
+ })
12142
+ * @param id_earning_points_product
12143
+ * @return Promise => object or null
12144
+ */
12145
+ getEarningPointsProduct(id_earning_points_product: any): Promise<unknown>;
12146
+ /**
12147
+ * @example:
12148
+ * this.vhQuerySales.getEarningPointsProducts()
12149
+ .then((arr)=>{
12150
+ console.log('getEarningPointsProducts', arr);
12151
+ }, error=>{
12152
+ console.log('error', error);
12153
+ })
12154
+ * @return Promise => Array<object>
12155
+ */
12156
+ getEarningPointsProducts(): Promise<unknown>;
12157
+ /**
12158
+ * @example:
12159
+ * this.vhQuerySales.addCustomerClass({name : "Gold"})
12160
+ .then((res)=>{
12161
+ console.log('addCustomerClass', res);
12162
+ }, error=>{
12163
+ console.log('error', error);
12164
+ })
12165
+ * @param data
12166
+ * @return Promise => bool = object or error
12167
+ */
12168
+ addCustomerClass(data: any): Promise<unknown>;
12169
+ /**
12170
+ * @example:
12171
+ * this.vhQuerySales.updateCustomerClass('KNOVIYWKN135468',{name : "Gold"})
12172
+ .then((bool)=>{
12173
+ console.log('updateCustomerClass', bool);
12174
+ }, error=>{
12175
+ console.log('error', error);
12176
+ })
12177
+ * @param id_customer_class
12178
+ * @return Promise => bool = true or false
12179
+ */
12180
+ updateCustomerClass(id_customer_class: any, data: any): Promise<unknown>;
12181
+ /**
12182
+ * @example:
12183
+ * this.vhQuerySales.deleteCustomerClass('KNOVIYWKN135468')
12184
+ .then((bool)=>{
12185
+ console.log('deleteCustomerClass', bool);
12186
+ }, error=>{
12187
+ console.log('error', error);
12188
+ })
12189
+ * @param id_customer_class
12190
+ * @return Promise => bool = true or false
12191
+ */
12192
+ deleteCustomerClass(id_customer_class: any, data: any): Promise<unknown>;
12193
+ /**
12194
+ * @example:
12195
+ * this.vhQuerySales.getCustomerClass('KNOVIYWKN135468DWS')
12196
+ .then((res)=>{
12197
+ console.log('getCustomerClass', res);
12198
+ }, error=>{
12199
+ console.log('error', error);
12200
+ })
12201
+ * @param id_customer_class
12202
+ * @return Promise => object or null
12203
+ */
12204
+ getCustomerClass(id_customer_class: any): Promise<unknown>;
12205
+ /**
12206
+ * @example:
12207
+ * this.vhQuerySales.getCustomerClasss()
12208
+ .then((array)=>{
12209
+ console.log('getCustomerClasss', array);
12210
+ }, error=>{
12211
+ console.log('error', error);
12212
+ })
12213
+ * @param data
12214
+ * @return Promise => Array<object>
12215
+ */
12216
+ getCustomerClasss(): Promise<unknown>;
12217
+ /**
12218
+ * trong local chưa có
12219
+ * @example:
12220
+ * let customer_class = this.vhQuerySales.getCustomerClasss()
12221
+ * @param data
12222
+ * @return Array<object>
12223
+ */
12224
+ getlocalCustomerClasss(): void;
12225
+ /**
12226
+ * trong local chưa có
12227
+ * @example:
12228
+ * let customer_class = this.vhQuerySales.getCustomerClass('321987965DOIUEHN')
12229
+ * @param id_customer_class
12230
+ * @return object or null
12231
+ */
12232
+ getlocalCustomerClass(id_customer_class: any): void;
12233
+ /**
12234
+ * @example:
12235
+ * this.vhQuerySales.addEmployeeClass({name : "Gold"})
12236
+ .then((res)=>{
12237
+ console.log('addEmployeeClass', res);
12238
+ }, error=>{
12239
+ console.log('error', error);
12240
+ })
12241
+ * @param data
12242
+ * @return Promise => object or error
12243
+ */
12244
+ addEmployeeClass(data: any): Promise<unknown>;
12245
+ /**
12246
+ * @example:
12247
+ * this.vhQuerySales.updateEmployeeClass('KNOVIYWKN135468',{id_commission : "321SDWC65DWSVDFS"})
12248
+ .then((bool)=>{
12249
+ console.log('updateEmployeeClass', bool);
12250
+ }, error=>{
12251
+ console.log('error', error);
12252
+ })
12253
+ * @param id_employee_class
12254
+ * @param data
12255
+ * @return Promise => bool = true or false
12256
+ */
12257
+ updateEmployeeClass(id_employee_class: any, data: any): Promise<unknown>;
12258
+ /**
12259
+ * @example:
12260
+ * this.vhQuerySales.deleteEmployeeClass('KNOVIYWKN135468')
12261
+ .then((bool)=>{
12262
+ console.log('deleteEmployeeClass', bool);
12263
+ }, error=>{
12264
+ console.log('error', error);
12265
+ })
12266
+ * @param id_employee_class
12267
+ * @return Promise => bool = true or false
12268
+ */
12269
+ deleteEmployeeClass(id_employee_class: any): Promise<unknown>;
12270
+ /**
12271
+ * @example:
12272
+ * this.vhQuerySales.getEmployeeClass('KNOVIYWKN135468')
12273
+ .then((res)=>{
12274
+ console.log('getEmployeeClass', res);
12275
+ }, error=>{
12276
+ console.log('error', error);
12277
+ })
12278
+ * @param id_employee_class
12279
+ * @return Promise => object or null
12280
+ */
12281
+ getEmployeeClass(id_employee_class: any): Promise<unknown>;
12282
+ /**
12283
+ * @example:
12284
+ * this.vhQuerySales.getEmployeeClasss()
12285
+ .then((array)=>{
12286
+ console.log('getEmployeeClasss', array);
12287
+ }, error=>{
12288
+ console.log('error', error);
12289
+ })
12290
+ * @param id_employee_class
12291
+ * @return Promise => Array<object>
12292
+ */
12293
+ getEmployeeClasss(): Promise<unknown>;
12294
+ /**
12295
+ * trong local chưa có
12296
+ * @example:
12297
+ * let employee_classs = this.vhQuerySales.getlocalEmployeeClasss()
12298
+ * @param data
12299
+ * @return Array<object>
12300
+ */
12301
+ getlocalEmployeeClasss(): void;
12302
+ /**
12303
+ * trong local chưa có
12304
+ * @example:
12305
+ * let employee_class = this.vhQuerySales.getlocalEmployeeClass('321987965DOIUEHN')
12306
+ * @param id_employee_class
12307
+ * @return object or null
12308
+ */
12309
+ getlocalEmployeeClass(id_customer_class: any): void;
12310
+ /**
12311
+ * @example:
12312
+ * let data = {
12313
+ * name:"Phiếu thanh toán 100k",
12314
+ * value : 100000,
12315
+ * point : 1000,
12316
+ * id_design_barcode : "",
12317
+ * id_branch :" 316OIUHLKMLSDYW235"
12318
+ * }
12319
+ * this.vhQuerySales.addCoupon(data)
12320
+ .then((res)=>{
12321
+ console.log('addCoupon', res);
12322
+ }, error=>{
12323
+ console.log('error', error);
12324
+ })
12325
+ * @param data
12326
+ * @return Promise => object or error
12327
+ */
12328
+ addCoupon(data: any): Promise<unknown>;
12329
+ /**
12330
+ * @example:
12331
+ * let data = {
12332
+ * name:"Phiếu thanh toán 100k",
12333
+ * value : 100000,
12334
+ * point : 1000,
12335
+ * id_design_barcode : "",
12336
+ * }
12337
+ * this.vhQuerySales.updateCoupon('FBHYWIBDNIUH1321687',data)
12338
+ .then((bool)=>{
12339
+ console.log('updateCoupon', bool);
12340
+ }, error=>{
12341
+ console.log('error', error);
12342
+ })
12343
+ * @param data
12344
+ * @param id_coupon
12345
+ * @return Promise => bool = true or false
12346
+ */
12347
+ updateCoupon(id_coupon: any, data: any): Promise<unknown>;
12348
+ /**
12349
+ * @example:
12350
+ *
12351
+ * this.vhQuerySales.deleteCoupon('FBHYWIBDNIUH1321687')
12352
+ .then((bool)=>{
12353
+ console.log('deleteCoupon', bool);
12354
+ }, error=>{
12355
+ console.log('error', error);
12356
+ })
12357
+ * @param id_coupon
12358
+ * @return Promise => bool = true or false
12359
+ */
12360
+ deleteCoupon(id_coupon: any): Promise<unknown>;
12361
+ /**
12362
+ * @example:
12363
+ *
12364
+ * this.vhQuerySales.getCoupon('FBHYWIBDNIUH1321687')
12365
+ .then((res)=>{
12366
+ console.log('getCoupon', res);
12367
+ }, error=>{
12368
+ console.log('error', error);
12369
+ })
12370
+ * @param id_coupon
12371
+ * @return Promise => object or null
12372
+ */
12373
+ getCoupon(id_coupon: any): Promise<unknown>;
12374
+ /**
12375
+ * @example:
12376
+ * this.vhQuerySales.getCoupons()
12377
+ .then((res)=>{
12378
+ console.log('getCoupons', res);
12379
+ }, error=>{
12380
+ console.log('error', error);
12381
+ })
12382
+ * @return Promise => Array<object>
12383
+ */
12384
+ getCoupons(): Promise<unknown>;
12385
+ /**
12386
+ * @example:
12387
+ * this.vhQuerySales.addCouponRelease({name : "Đợt phát hành phiếu thanh toán 100k",id_branch :'OHFNEIOUH6549846'})
12388
+ .then((res)=>{
12389
+ console.log('addCouponRelease', res);
12390
+ }, error=>{
12391
+ console.log('error', error);
12392
+ })
12393
+ * @param data
12394
+ * @return Promise => object or error
12395
+ */
12396
+ addCouponRelease(data: any): Promise<unknown>;
12397
+ /**
12398
+ * @example:
12399
+ * this.vhQuerySales.updateCouponRelease('ANOFIEUPOIUJ49861',{name : "Đợt phát hành phiếu thanh toán 100k"})
12400
+ .then((bool)=>{
12401
+ console.log('updateCouponRelease', bool);
12402
+ }, error=>{
12403
+ console.log('error', error);
12404
+ })
12405
+ * @param data
12406
+ * @param id_coupon_release
12407
+ * @return Promise => bool = true or false
12408
+ */
12409
+ updateCouponRelease(id_coupon_release: any, data: any): Promise<unknown>;
12410
+ /**
12411
+ * @example:
12412
+ * this.vhQuerySales.deleteCouponRelease('ANOFIEUPOIUJ49861')
12413
+ .then((bool)=>{
12414
+ console.log('deleteCouponRelease', bool);
12415
+ }, error=>{
12416
+ console.log('error', error);
12417
+ })
12418
+ * @param id_coupon_release
12419
+ * @return Promise => bool = true or false
12420
+ */
12421
+ deleteCouponRelease(id_coupon_release: any): Promise<unknown>;
12422
+ /**
12423
+ * @example:
12424
+ *
12425
+ * this.vhQuerySales.getCouponRelease('FBHYWIBDNIUH1321687')
12426
+ .then((res)=>{
12427
+ console.log('getCouponRelease', res);
12428
+ }, error=>{
12429
+ console.log('error', error);
12430
+ })
12431
+ * @param id_coupon_release
12432
+ * @return Promise => object or null
12433
+ */
12434
+ getCouponRelease(id_coupon_release: any): Promise<unknown>;
12435
+ /**
12436
+ * @example:
12437
+ *
12438
+ * this.vhQuerySales.getCouponReleases()
12439
+ .then((arr)=>{
12440
+ console.log('getCouponReleases', arr);
12441
+ }, error=>{
12442
+ console.log('error', error);
12443
+ })
12444
+ * @return Promise => Array< object >
12445
+ */
12446
+ getCouponReleases(): Promise<unknown>;
12447
+ /**
12448
+ * @example:
12449
+ let data = {
12450
+ id_coupon : "9841654DOIWSDYW235",
12451
+ id_coupon_release :" 316OIUHLKMLSDYW235"
12452
+ }
12453
+ this.vhQuerySales.addCouponReleaseDetail(data)
12454
+ .then((res)=>{
12455
+ console.log('addCouponReleaseDetail', res);
12456
+ }, error=>{
12457
+ console.log('error', error);
12458
+ })
12459
+ * @param data
12460
+ * @param id_coupon
12461
+ * @return Promise => bool = true or false
12462
+ */
12463
+ addCouponReleaseDetail(data: any): Promise<unknown>;
12464
+ /**
12465
+ * @example:
12466
+ * this.vhQuerySales.deleteCouponReleaseDetail("9841654DOIWSDYW235")
12467
+ .then((bool)=>{
12468
+ console.log('deleteCouponReleaseDetail', bool);
12469
+ }, error=>{
12470
+ console.log('error', error);
12471
+ })
12472
+ * @param id_coupon_release_detail
12473
+ * @return Promise => bool = true or false
12474
+ */
12475
+ deleteCouponReleaseDetail(id_coupon_release_detail: any): Promise<unknown>;
12476
+ /**
12477
+ * hàm này trả về những Coupon Release Detail của đợt coupon đó
12478
+ * @example:
12479
+ * this.vhQuerySales.getCouponRelaseDetail_byIdCouponRelease("9841654DOIWSDYW235")
12480
+ .then((array)=>{
12481
+ console.log('getCouponRelaseDetail_byIdCouponRelease', array);
12482
+ }, error=>{
12483
+ console.log('error', error);
12484
+ })
12485
+ * @param id_coupon_release
12486
+ * @return Promise => Array<any> = [{id_coupon_relase, id_coupon, coupon_name, coupon_value, coupon_code_numbers}]
12487
+ */
12488
+ getCouponRelaseDetail_byIdCouponRelease(id_coupon_release: any): Promise<unknown>;
12489
+ /**
12490
+ * hàm này để phát hành 1 coupon_code
12491
+ * @example:
12492
+ let data = {
12493
+ status :1,
12494
+ date_validity: new Date(),
12495
+ date_expire : new Date(),
12496
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12497
+ date_used : '',
12498
+ date_sold : '',
12499
+ id_branch :"OIIOUHDWU1654984NQYUH",
12500
+ }
12501
+ * this.vhQuerySales.createCouponCode(data)
12502
+ .then((coupon_code)=>{
12503
+ console.log('createCouponCode', coupon_code);
12504
+ }, error=>{
12505
+ console.log('error', error);
12506
+ })
12507
+ * @param data
12508
+ * @return Promise => Object
12509
+ */
12510
+ private createCouponCode;
12511
+ /**
12512
+ * hàm này để phát hành nhiều coupon_code theo số lượng truyền vào
12513
+ * @example:
12514
+ let data = {
12515
+ status :1,
12516
+ date_validity: new Date(),
12517
+ date_expire : new Date(),
12518
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12519
+ date_used : '',
12520
+ date_sold : '',
12521
+ id_branch :"OIIOUHDWU1654984NQYUH",
12522
+ }
12523
+ * this.vhQuerySales.createCouponCodes(data, 10)
12524
+ .then((coupon_codes)=>{
12525
+ console.log('createCouponCodes', coupon_codes);
12526
+ }, error=>{
12527
+ console.log('error', error);
12528
+ })
12529
+ * @param data
12530
+ * @return Promise => Array(object)
12531
+ */
12532
+ createCouponCodes(data: object, quantity: number): Promise<unknown>;
12533
+ /**
12534
+ * @example:
12535
+ *
12536
+ * this.vhQuerySales.updateCouponCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()})
12537
+ .then((bool)=>{
12538
+ console.log('updateCouponCode', bool);
12539
+ }, error=>{
12540
+ console.log('error', error);
12541
+ })
12542
+ * @param id_coupon_code
12543
+ * @param data
12544
+ * @return Promise => boolean = true or false
12545
+ */
12546
+ updateCouponCode(id_coupon_code: any, data: any): Promise<unknown>;
12547
+ /**
12548
+ * @example:
12549
+ *
12550
+ * this.vhQuerySales.deleteCouponCode('OUHEOIWUYGHIQNIDOUW1359478'})
12551
+ .then((bool)=>{
12552
+ console.log('deleteCouponCode', bool);
12553
+ }, error=>{
12554
+ console.log('error', error);
12555
+ })
12556
+ * @param id_coupon_code
12557
+ * @return Promise => boolean = true or false
12558
+ */
12559
+ deleteCouponCode(id_coupon_code: any): Promise<unknown>;
12560
+ /**
12561
+ * hàm này trả về danh sách coupon code đã phát hành theo mỗi đợt
12562
+ * @example:
12563
+ *
12564
+ * this.vhQuerySales.getCouponCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'})
12565
+ .then((array)=>{
12566
+ console.log('getCouponCodes_byIdCouponReleaseDetail', array);
12567
+ }, error=>{
12568
+ console.log('error', error);
12569
+ })
12570
+ * @param id_coupon_release_detail
12571
+ * @return Promise => Array<any>
12572
+ */
12573
+ getCouponCodes_byIdCouponReleaseDetail(id_coupon_release_detail: any): Promise<unknown>;
12574
+ /**
12575
+ * hàm này trả về coupon code đã phát hành theo trường code của Coupon code. dùng trong trang bán hàng để đổi phiếu
12576
+ * @example:
12577
+ *
12578
+ * this.vhQuerySales.getCouponCode('OUHEDW0512'})
12579
+ .then((res)=>{
12580
+ console.log('getCouponCode', res);
12581
+ }, error=>{
12582
+ console.log('error', error);
12583
+ })
12584
+ * @param id_coupon_code: cũng chính là code
12585
+ * @return Promise => Array<any>
12586
+ */
12587
+ getCouponCode(id_coupon_code: any): Promise<unknown>;
12588
+ /**
12589
+ * 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
12590
+ * @example:
12591
+ * this.vhQuerySales.exchangeCouponCode_byEarningPoints(['OUIYWGUDBYWUHEDW0512','1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000})
12592
+ .then((bool)=>{
12593
+ console.log('exchangeCouponCode_byEarningPoints', bool);
12594
+ }, error=>{
12595
+ console.log('error', error);
12596
+ })
12597
+ * @param array_id_coupon_code
12598
+ * @param id_customer
12599
+ * @param earning_points
12600
+ * @return Promise => boolean = true or false
12601
+ */
12602
+ exchangeCouponCode_byEarningPoints(array_id_coupon_code: any, id_customer: any, points: any): Promise<unknown>;
12603
+ /**
12604
+ * @example:
12605
+ * let data = {
12606
+ name : "Siêu khuyến mãi",
12607
+ id_design_barcode :"316OIUHLKMLSDYW235",
12608
+ products: [{
12609
+ id_product : "NIDOUHWIOLDNOIU1142748",
12610
+ price : 1000000,
12611
+ quantity: 1,
12612
+ ptype: 1
12613
+ }],
12614
+ point: 10,
12615
+ price_origin: 9300000,
12616
+ price: 9200000,
12617
+ id_branch: 4zFGhVUAZyj5d09r01xZ
12618
+ }
12619
+ * this.vhQuerySales.addVoucher(data)
12620
+ .then((res)=>{
12621
+ console.log('addVoucher', res);
12622
+ }, error=>{
12623
+ console.log('error', error);
12624
+ })
12625
+ * @param data
12626
+ * @return object or error
12627
+ */
12628
+ addVoucher(data: any): Promise<unknown>;
12629
+ /**
12630
+ * @example:
12631
+ * let data = {
12632
+ point: 23,
12633
+ price_origin: 9400000,
12634
+ id_branch: 4zFGhVUAZyj5d09r01xZ
12635
+ }
12636
+ * this.vhQuerySales.updateVoucher("fuMS21I6othUm34385WV", data)
12637
+ .then((bool)=>{
12638
+ console.log('updateVoucher', bool);
12639
+ }, error=>{
12640
+ console.log('error', error);
12641
+ })
12642
+ * @param id_voucher
12643
+ * @param data
12644
+ * @return Promise Boolean => true or false
12645
+ */
12646
+ updateVoucher(id_voucher: any, data: any): Promise<unknown>;
12647
+ /**
12648
+ * @example:
12649
+ * this.vhQuerySales.deleteVoucher("fuMS21I6othUm34385WV")
12650
+ .then((bool)=>{
12651
+ console.log('deleteVoucher', bool);
12652
+ }, error=>{
12653
+ console.log('error', error);
12654
+ })
12655
+ * @param id_voucher
12656
+ * @return Promise Boolean => true or false
12657
+ */
12658
+ deleteVoucher(id_voucher: any): Promise<unknown>;
12659
+ /**
12660
+ * @example:
12661
+ * this.vhQuerySales.getVoucher(id_voucher)
12662
+ .then((res)=>{
12663
+ console.log('addVoucher', res);
12664
+ }, error=>{
12665
+ console.log('error', error);
12666
+ })
12667
+ * @param id_voucher
12668
+ * @return Promise => object or null
12669
+ */
12670
+ getVoucher(id_voucher: any): Promise<unknown>;
12671
+ /**
12672
+ * @example:
12673
+ * this.vhQuerySales.getVouchers()
12674
+ .then((arr)=>{
12675
+ console.log('getVouchers', arr);
12676
+ }, error=>{
12677
+ console.log('error', error);
12678
+ })
12679
+ * @return Promise => array(object) =[{},{},...]
12680
+ */
12681
+ getVouchers(): Promise<unknown>;
12682
+ /**
12683
+ * @example:
12684
+ * let data = {
12685
+ name : "Tháng 6 bùng nổ",
12686
+ id_branch: 4zFGhVUAZyj5d09r01xZ
12687
+ }
12688
+ * this.vhQuerySales.addVoucherRelease(data)
12689
+ .then((res)=>{
12690
+ console.log('addVoucherRelease', res);
12691
+ }, error=>{
12692
+ console.log('error', error);
12693
+ })
12694
+ * @param data
12695
+ * @return object or error
12696
+ */
12697
+ addVoucherRelease(data: any): Promise<unknown>;
12698
+ /**
12699
+ * @example:
12700
+ * let data = {
12701
+ name : "Tháng 6 bùng nổ"
12702
+ }
12703
+ * this.vhQuerySales.updateVoucherRelease("fuMS21I6othUm34385WV", data)
12704
+ .then((bool)=>{
12705
+ console.log('updateVoucherRelease', bool);
12706
+ }, error=>{
12707
+ console.log('error', error);
12708
+ })
12709
+ * @param id_voucher_release
12710
+ * @param data
12711
+ * @return Promise Boolean => true or false
12712
+ */
12713
+ updateVoucherRelease(id_voucher_release: any, data: any): Promise<unknown>;
12714
+ /**
12715
+ * @example:
12716
+ * this.vhQuerySales.deleteVoucherRelease("fuMS21I6othUm34385WV")
12717
+ .then((bool)=>{
12718
+ console.log('deleteVoucherRelease', bool);
12719
+ }, error=>{
12720
+ console.log('error', error);
12721
+ })
12722
+ * @param id_voucher_release
12723
+ * @return Promise Boolean => true or false
12724
+ */
12725
+ deleteVoucherRelease(id_voucher_release: any): Promise<unknown>;
12726
+ /**
12727
+ * @example:
12728
+ * this.vhQuerySales.getVoucherRelease("fuMS21I6othUm34385WV")
12729
+ .then((res)=>{
12730
+ console.log('getVoucherRelease', res);
12731
+ }, error=>{
12732
+ console.log('error', error);
12733
+ })
12734
+ * @param id_voucher_release
12735
+ * @return Promise => object or null
12736
+ */
12737
+ getVoucherRelease(id_voucher_release: any): Promise<unknown>;
12738
+ /**
12739
+ * @example:
12740
+ * this.vhQuerySales.getVoucherRelases()
12741
+ .then((res)=>{
12742
+ console.log('getVoucherRelases', res);
12743
+ }, error=>{
12744
+ console.log('error', error);
12745
+ })
12746
+ * @return Promise => array(object) =[{},{},...]
12747
+ */
12748
+ getVoucherRelases(): Promise<unknown>;
12749
+ /**
12750
+ * @example:
12751
+ * let data = {
12752
+ id_voucher : "fuMS21I6othUm34385WV",
12753
+ id_voucher_release: "4zFGhVUAZyj5d09r01xZ"
12754
+ }
12755
+ * this.vhQuerySales.addVoucherReleaseDetail(data)
12756
+ .then((res)=>{
12757
+ console.log('addVoucherReleaseDetail', res);
12758
+ }, error=>{
12759
+ console.log('error', error);
12760
+ })
12761
+ * @param data
12762
+ * @return object or error
12763
+ */
12764
+ addVoucherReleaseDetail(data: any): Promise<unknown>;
12765
+ /**
12766
+ * @example:
12767
+ * this.vhQuerySales.deleteVoucherReleaseDetail("fuMS21I6othUm34385WV")
12768
+ .then((bool)=>{
12769
+ console.log('deleteVoucherReleaseDetail', bool);
12770
+ }, error=>{
12771
+ console.log('error', error);
12772
+ })
12773
+ * @param id_voucher_release_detail
12774
+ * @return Promise Boolean => true or false
12775
+ */
12776
+ deleteVoucherReleaseDetail(id_voucher_release_detail: any): Promise<unknown>;
12777
+ /**
12778
+ * @example:
12779
+ * this.vhQuerySales.getVoucherRelaseDetail_byFields( {id_voucher:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0)
12780
+ .then((res)=>{
12781
+ console.log('getVoucherRelaseDetail_byFields', res);
12782
+ }, error=>{
12783
+ console.log('error', error);
12784
+ })
12785
+ * @param query
12786
+ * @param projection
12787
+ * @param sort
12788
+ * @param limit
12789
+ * @return Promise => array(object) = [{},{},..]
12790
+ */
12791
+ getVoucherRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
12792
+ /**
12793
+ * hàm này để phát hành 1 voucher_code
12794
+ * @example:
12795
+ let data = {
12796
+ code: '3VU4JW0517',
12797
+ date_validity: new Date(),
12798
+ date_expire: new Date(),
12799
+ status: 1,
12800
+ id_voucher_release_detail: "fuMS21I6othUm34385WV",
12801
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
12802
+ }
12803
+ * this.vhQuerySales.createVoucherCode(data)
12804
+ .then((coupon_code)=>{
12805
+ console.log('createVoucherCode', coupon_code);
12806
+ }, error=>{
12807
+ console.log('error', error);
12808
+ })
12809
+ * @param data
12810
+ * @return Promise => Object
12811
+ */
12812
+ private createVoucherCode;
12813
+ /**
12814
+ * hàm này để phát hành nhiều voucher_code theo số lượng truyền vào
12815
+ * @example:
12816
+ let data = {
12817
+ code: '3VU4JW0517',
12818
+ date_validity: new Date(),
12819
+ date_expire: new Date(),
12820
+ status: 1,
12821
+ id_voucher_release_detail: "fuMS21I6othUm34385WV",
12822
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
12823
+ }
12824
+ * this.vhQuerySales.createVoucherCodes(data, 10)
12825
+ .then((voucher_codes)=>{
12826
+ console.log('createVoucherCodes', voucher_codes);
12827
+ }, error=>{
12828
+ console.log('error', error);
12829
+ })
12830
+ * @param data
12831
+ * @param quantity
12832
+ * @return Promise => Array(object)
12833
+ */
12834
+ createVoucherCodes(data: object, quantity: number): Promise<unknown>;
12835
+ /**
12836
+ * @example:
12837
+ *
12838
+ * this.vhQuerySales.updateVoucherCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()})
12839
+ .then((bool)=>{
12840
+ console.log('updateCouponCode', bool);
12841
+ }, error=>{
12842
+ console.log('error', error);
12843
+ })
12844
+ * @param id_voucher_code
12845
+ * @param data
12846
+ * @return Promise => boolean = true or false
12847
+ */
12848
+ updateVoucherCode(id_voucher_code: any, data: any): Promise<unknown>;
12849
+ /**
12850
+ * @example:
12851
+ *
12852
+ * this.vhQuerySales.deleteVoucherCode('OUHEOIWUYGHIQNIDOUW1359478'})
12853
+ .then((bool)=>{
12854
+ console.log('deleteVoucherCode', bool);
12855
+ }, error=>{
12856
+ console.log('error', error);
12857
+ })
12858
+ * @param id_voucher_code
12859
+ * @return Promise => boolean = true or false
12860
+ */
12861
+ deleteVoucherCode(id_voucher_code: any): Promise<unknown>;
12862
+ /**
12863
+ * hàm này trả về danh sách voucher_codes đã phát hành theo mỗi đợt
12864
+ * @example:
12865
+ *
12866
+ * this.vhQuerySales.getVoucherCode_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'})
12867
+ .then((array)=>{
12868
+ console.log('getVoucherCode_byIdCouponReleaseDetail', array);
12869
+ }, error=>{
12870
+ console.log('error', error);
12871
+ })
12872
+ * @param id_voucher_release_detail
12873
+ * @return Promise => Array<any>
12874
+ */
12875
+ getVoucherCode_byIdCouponReleaseDetail(id_voucher_release_detail: any): Promise<unknown>;
12876
+ /**
12877
+ * 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
12878
+ * @example:
12879
+ *
12880
+ * this.vhQuerySales.getVoucherCode('OUHEDW0512'})
12881
+ .then((res)=>{
12882
+ console.log('getVoucherCode', res);
12883
+ }, error=>{
12884
+ console.log('error', error);
12885
+ })
12886
+ * @param id_voucher_code: cũng chính là code
12887
+ * @return Promise => Array<any>
12888
+ */
12889
+ getVoucherCode(id_voucher_code: any): Promise<unknown>;
12890
+ /** Hàm này để đổi voucher 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
12891
+ * @example:
12892
+ * let data = [id_voucher_code]
12893
+ * this.vhQuerySales.exchangeVoucherCode_byEarningPoints(data, "fuMS21I6othUm34385WV", 10)
12894
+ .then((bool)=>{
12895
+ console.log('exchangeVoucherCode_byEarningPoints', bool);
12896
+ }, error=>{
12897
+ console.log('error', error);
12898
+ })
12899
+ * @param array_id_voucher_code
12900
+ * @param id_customer
12901
+ * @param points
12902
+ * @return Promise Boolean => true or false
12903
+ */
12904
+ exchangeVoucherCode_byEarningPoints(array_id_voucher_code: any, id_customer: any, points: any): Promise<unknown>;
12905
+ /**
12906
+ * @example:
12907
+ * let data = {
12908
+ * name :"Thẻ trả trước",
12909
+ * price :1000000,
12910
+ * products : [
12911
+ * {
12912
+ * id_product : 'MOIUHWDWIUHG1345674',
12913
+ * price : 100000,
12914
+ * quantity: 5,
12915
+ * quantity_valid : 5,
12916
+ * type : 1
12917
+ * },{
12918
+ * id_product : 'NJIDUEWNBIJUWGHD135',
12919
+ * price : 100000,
12920
+ * quantity: 5,
12921
+ * quantity_valid : 5,
12922
+ * type : 2
12923
+ * }]
12924
+ * }
12925
+ * this.vhQuerySales.addPaymentCard(data)
12926
+ .then((res)=>{
12927
+ console.log('addPaymentCard', res);
12928
+ }, error=>{
12929
+ console.log('error', error);
12930
+ })
12931
+ * @param data
12932
+ * @return Promise => Array<any>
12933
+ */
12934
+ addPaymentCard(data: any): Promise<unknown>;
12935
+ /**
12936
+ * @example:
12937
+ * let data = {
12938
+ * name :"Thẻ trả trước",
12939
+ * price :1000000,
12940
+ * products : [
12941
+ * {
12942
+ * id_product : 'MOIUHWDWIUHG1345674',
12943
+ * price : 100000,
12944
+ * quantity: 5,
12945
+ * quantity_valid : 5,
12946
+ * type : 1
12947
+ * },{
12948
+ * id_product : 'NJIDUEWNBIJUWGHD135',
12949
+ * price : 100000,
12950
+ * quantity: 5,
12951
+ * quantity_valid : 5,
12952
+ * type : 2
12953
+ * }]
12954
+ * }
12955
+ * this.vhQuerySales.updatePaymentCard(data)
12956
+ .then((bool)=>{
12957
+ console.log('updatePaymentCard', bool);
12958
+ }, error=>{
12959
+ console.log('error', error);
12960
+ })
12961
+ * @param data
12962
+ * @param id_payment_card
12963
+ * @return Promise => bool = true or false
12964
+ */
12965
+ updatePaymentCard(id_payment_card: any, data: any): Promise<unknown>;
12966
+ /**
12967
+ * @example:
12968
+ * this.vhQuerySales.deletePaymentCard('FDNOIUWDHIWH21564DWQ')
12969
+ .then((bool)=>{
12970
+ console.log('deletePaymentCard', bool);
12971
+ }, error=>{
12972
+ console.log('error', error);
12973
+ })
12974
+ * @param id_payment_card
12975
+ * @return Promise => bool = true or false
12976
+ */
12977
+ deletePaymentCard(id_payment_card: any): Promise<unknown>;
12978
+ /**
12979
+ * @example:
12980
+ * this.vhQuerySales.getPaymentCard('FDNOIUWDHIWH21564DWQ')
12981
+ .then((res)=>{
12982
+ console.log('getPaymentCard', res);
12983
+ }, error=>{
12984
+ console.log('error', error);
12985
+ })
12986
+ * @param id_payment_card
12987
+ * @return Promise => object or null
12988
+ */
12989
+ getPaymentCard(id_payment_card: any): Promise<unknown>;
12990
+ /**
12991
+ * @example:
12992
+ * this.vhQuerySales.getPaymentCards()
12993
+ .then((res)=>{
12994
+ console.log('getPaymentCards', res);
12995
+ }, error=>{
12996
+ console.log('error', error);
12997
+ })
12998
+ * @return Promise => Array<any>
12999
+ */
13000
+ getPaymentCards(): Promise<unknown>;
13001
+ /**
13002
+ * @example:
13003
+ * this.vhQuerySales.addPaymentCardRelease({name : "Đợt phát hành thẻ 1", id_branch :"NIOUHDWLJUNBHIU16549"})
13004
+ .then((res)=>{
13005
+ console.log('addPaymentCardRelease', res);
13006
+ }, error=>{
13007
+ console.log('error', error);
13008
+ })
13009
+ * @param data
13010
+ * @return Promise => object or error
13011
+ */
13012
+ addPaymentCardRelease(data: any): Promise<unknown>;
13013
+ /**
13014
+ * @example:
13015
+ * this.vhQuerySales.updatePaymentCardRelease({name : "Đợt phát hành thẻ 1"})
13016
+ .then((bool)=>{
13017
+ console.log('updatePaymentCardRelease', bool);
13018
+ }, error=>{
13019
+ console.log('error', error);
13020
+ })
13021
+ * @param id_payment_card_release
13022
+ * @param data
13023
+ * @return Promise => object or error
13024
+ */
13025
+ updatePaymentCardRelease(id_payment_card_release: any, data: any): Promise<unknown>;
13026
+ /**
13027
+ * @example:
13028
+ * this.vhQuerySales.deletePaymentCardRelease("OIHIDUWNIDOLW123456")
13029
+ .then((bool)=>{
13030
+ console.log('deletePaymentCardRelease', bool);
13031
+ }, error=>{
13032
+ console.log('error', error);
13033
+ })
13034
+ * @param id_payment_card_release
13035
+ * @param data
13036
+ * @return Promise => boolean = true or false
13037
+ */
13038
+ deletePaymentCardRelease(id_payment_card_release: any): Promise<unknown>;
13039
+ /**
13040
+ * @example:
13041
+ * this.vhQuerySales.getPaymentCardRelease("OIHIDUWNIDOLW123456")
13042
+ .then((res)=>{
13043
+ console.log('getPaymentCardRelease', res);
13044
+ }, error=>{
13045
+ console.log('error', error);
13046
+ })
13047
+ * @param id_payment_card_release
13048
+ * @return Promise => object or null
13049
+ */
13050
+ getPaymentCardRelease(id_payment_card_release: any): Promise<unknown>;
13051
+ /**
13052
+ * @example:
13053
+ * this.vhQuerySales.getPaymentCardReleases()
13054
+ .then((res)=>{
13055
+ console.log('getPaymentCardReleases', res);
13056
+ }, error=>{
13057
+ console.log('error', error);
13058
+ })
13059
+ * @return Promise => Array<any>
13060
+ */
13061
+ getPaymentCardReleases(): Promise<unknown>;
13062
+ /**
13063
+ * @example:
13064
+ * this.vhQuerySales.addPaymentCardReleaseDetail({id_payment_card : "OIUHFIUWHGGU41698496", id_payment_card_release :"NIOUHDWLJUNBHIU16549"})
13065
+ .then((res)=>{
13066
+ console.log('addPaymentCardReleaseDetail', res);
13067
+ }, error=>{
13068
+ console.log('error', error);
13069
+ })
13070
+ * @param data
13071
+ * @return Promise => object or error
13072
+ */
13073
+ addPaymentCardReleaseDetail(data: any): Promise<unknown>;
13074
+ /**
13075
+ * @example:
13076
+ * this.vhQuerySales.deletePaymentCardReleaseDetail("OIUHFIUWHGGU41698496")
13077
+ .then((bool)=>{
13078
+ console.log('deletePaymentCardReleaseDetail', bool);
13079
+ }, error=>{
13080
+ console.log('error', error);
13081
+ })
13082
+ * @param id_payment_card_release_detail
13083
+ * @return Promise => bool = true or false
13084
+ */
13085
+ deletePaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13086
+ /**
13087
+ * @example:
13088
+ * this.vhQuerySales.getVoucherRelaseDetail_byFields( {id_payment_card:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0)
13089
+ .then((res)=>{
13090
+ console.log('getVoucherRelaseDetail_byFields', res);
13091
+ }, error=>{
13092
+ console.log('error', error);
13093
+ })
13094
+ * @param query
13095
+ * @param projection
13096
+ * @param sort
13097
+ * @param limit
13098
+ * @return Promise => array(object) = [{},{},..]
13099
+ */
13100
+ getPaymentCardRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
13101
+ /**
13102
+ * hàm này để phát hành 1 payment_card_code
13103
+ * @example:
13104
+ let data = {
13105
+ date_validity: new Date(),
13106
+ date_expire: new Date(),
13107
+ status: 1,
13108
+ id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13109
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
13110
+ }
13111
+ * this.vhQuerySales.createPaymentCardCode(data)
13112
+ .then((coupon_code)=>{
13113
+ console.log('createPaymentCardCode', coupon_code);
13114
+ }, error=>{
13115
+ console.log('error', error);
13116
+ })
13117
+ * @param data
13118
+ * @return Promise => Object
13119
+ */
13120
+ private createPaymentCardCode;
13121
+ /**
13122
+ * hàm này để phát hành nhiều payment_card_code theo số lượng truyền vào
13123
+ * @example:
13124
+ let data = {
13125
+ date_validity: new Date(),
13126
+ date_expire: new Date(),
13127
+ status: 1,
13128
+ id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13129
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
13130
+ }
13131
+ * this.vhQuerySales.createPaymentCardCodes(data, 10)
13132
+ .then((voucher_codes)=>{
13133
+ console.log('createPaymentCardCodes', voucher_codes);
13134
+ }, error=>{
13135
+ console.log('error', error);
13136
+ })
13137
+ * @param data
13138
+ * @param quantity
13139
+ * @return Promise => Array(object)
13140
+ */
13141
+ createPaymentCardCodes(data: object, quantity: number): Promise<unknown>;
13142
+ /**
13143
+ * @example:
13144
+ * let data = {
13145
+ date_validity: new Date(),
13146
+ date_expire: new Date(),
13147
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
13148
+ }
13149
+ * this.vhQuerySales.updatePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478',data)
13150
+ .then((bool)=>{
13151
+ console.log('updateCouponCode', bool);
13152
+ }, error=>{
13153
+ console.log('error', error);
13154
+ })
13155
+ * @param id_payment_card_code
13156
+ * @param data
13157
+ * @return Promise => boolean = true or false
13158
+ */
13159
+ updatePaymentCardCode(id_payment_card_code: any, data: any): Promise<unknown>;
13160
+ /**
13161
+ * @example:
13162
+ *
13163
+ * this.vhQuerySales.deletePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478'})
13164
+ .then((bool)=>{
13165
+ console.log('deletePaymentCardCode', bool);
13166
+ }, error=>{
13167
+ console.log('error', error);
13168
+ })
13169
+ * @param id_payment_card_code
13170
+ * @return Promise => boolean = true or false
13171
+ */
13172
+ deletePaymentCardCode(id_payment_card_code: any): Promise<unknown>;
13173
+ /**
13174
+ * hàm này trả về danh sách payment_card_codes đã phát hành theo mỗi đợt
13175
+ * @example:
13176
+ *
13177
+ * this.vhQuerySales.getPaymentCardCode_byIdPaymentCardReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'})
13178
+ .then((array)=>{
13179
+ console.log('getPaymentCardCode_byIdPaymentCardReleaseDetail', array);
13180
+ }, error=>{
13181
+ console.log('error', error);
13182
+ })
13183
+ * @param id_payment_card_release_detail
13184
+ * @return Promise => Array<any>
13185
+ */
13186
+ getPaymentCardCode_byIdPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13187
+ /**
13188
+ * 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 trang bán hàng để đổi phiếu
13189
+ * @example:
13190
+ *
13191
+ * this.vhQuerySales.getPaymentCardCode('OUHEDW0512'})
13192
+ .then((res)=>{
13193
+ console.log('getPaymentCardCode', res);
13194
+ }, error=>{
13195
+ console.log('error', error);
13196
+ })
13197
+ * @param id_payment_card_code: cũng chính là code
13198
+ * @return Promise => Array<any>
13199
+ */
13200
+ getPaymentCardCode(id_payment_card_code: any): Promise<unknown>;
13201
+ /**
13202
+ * không cần hàm này vì khi tạo phiếu bill_type51 đã được cập nhật
13203
+ * hàm này dùng để cập nhật số lượng sản phẩm trong Payment Card khi đổi thẻ
13204
+ * @example:
13205
+ * this.vhQuerySales.getPaymentCardCode_byCode("ONHDIWUHIODUWN","NDPIUWUHIOUYEW",{quantity_valid: 0})
13206
+ .then((res)=>{
13207
+ console.log('getPaymentCardCode_byCode', res);
13208
+ }, error=>{
13209
+ console.log('error', error);
13210
+ })
13211
+ * @param id_payment_card
13212
+ * @param id_comboproduct
13213
+ * @param data
13214
+ * @return Promise object or null
13215
+ */
13216
+ updateComboPaymentCard(id_payment_card: any, id_comboproduct: any, data: any): void;
11770
13217
  }
11771
13218
  export declare class VhQuerySCclient {
11772
13219
  private vhmongo_firebase;