ionic-vhframeworks 4.0.0 → 4.0.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.
@@ -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,1347 @@ 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): 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
+ * @example:
12478
+ *
12479
+ * this.vhQuerySales.getCouponReleaseDetail('FBHYWIBDNIUH1321687')
12480
+ .then((res)=>{
12481
+ console.log('getCouponReleaseDetail', res);
12482
+ }, error=>{
12483
+ console.log('error', error);
12484
+ })
12485
+ * @param id_coupon_release_detail
12486
+ * @return Promise => object or null
12487
+ */
12488
+ getCouponReleaseDetail(id_coupon_release_detail: any): Promise<unknown>;
12489
+ /**
12490
+ * hàm này trả về những Coupon Release Detail của đợt coupon đó
12491
+ * @example:
12492
+ * this.vhQuerySales.getCouponRelaseDetail_byIdCouponRelease("9841654DOIWSDYW235")
12493
+ .then((array)=>{
12494
+ console.log('getCouponRelaseDetail_byIdCouponRelease', array);
12495
+ }, error=>{
12496
+ console.log('error', error);
12497
+ })
12498
+ * @param id_coupon_release
12499
+ * @return Promise => Array<any> = [{id_coupon_relase, id_coupon, coupon_name, coupon_value, coupon_code_numbers}]
12500
+ */
12501
+ getCouponRelaseDetail_byIdCouponRelease(id_coupon_release: any): Promise<unknown>;
12502
+ /**
12503
+ * hàm này để phát hành 1 coupon_code
12504
+ * @example:
12505
+ let data = {
12506
+ status :1,
12507
+ date_validity: new Date(),
12508
+ date_expire : new Date(),
12509
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12510
+ date_used : '',
12511
+ date_sold : '',
12512
+ id_branch :"OIIOUHDWU1654984NQYUH",
12513
+ }
12514
+ * this.vhQuerySales.createCouponCode(data)
12515
+ .then((coupon_code)=>{
12516
+ console.log('createCouponCode', coupon_code);
12517
+ }, error=>{
12518
+ console.log('error', error);
12519
+ })
12520
+ * @param data
12521
+ * @return Promise => Object
12522
+ */
12523
+ private createCouponCode;
12524
+ /**
12525
+ * hàm này để phát hành nhiều coupon_code theo số lượng truyền vào, và tự động cập nhật trường số lượng đã phát hành (quantity_released) tăng lên
12526
+ * trong collection coupon_release_details
12527
+ * @example:
12528
+ let data = {
12529
+ status :1,
12530
+ date_validity: new Date(),
12531
+ date_expire : new Date(),
12532
+ id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187",
12533
+ date_used : '',
12534
+ date_sold : '',
12535
+ id_branch :"OIIOUHDWU1654984NQYUH",
12536
+ }
12537
+ * this.vhQuerySales.createCouponCodes(data, 10)
12538
+ .then((coupon_codes)=>{
12539
+ console.log('createCouponCodes', coupon_codes);
12540
+ }, error=>{
12541
+ console.log('error', error);
12542
+ })
12543
+ * @param data
12544
+ * @return Promise => Array(object)
12545
+ */
12546
+ createCouponCodes(data: any, quantity: number): Promise<unknown>;
12547
+ /**
12548
+ * @example:
12549
+ *
12550
+ * this.vhQuerySales.updateCouponCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()})
12551
+ .then((bool)=>{
12552
+ console.log('updateCouponCode', bool);
12553
+ }, error=>{
12554
+ console.log('error', error);
12555
+ })
12556
+ * @param id_coupon_code
12557
+ * @param data
12558
+ * @return Promise => boolean = true or false
12559
+ */
12560
+ updateCouponCode(id_coupon_code: any, data: any): Promise<unknown>;
12561
+ /**
12562
+ * Hàm này chỉ cho phép xóa coupon_code đang ở trạng thái đã phát hành (status ==1),
12563
+ * và cập nhật giảm trường số lượng quantity_released bớt một trong collection coupon_release_details
12564
+ * @example:
12565
+ * this.vhQuerySales.deleteCouponCode('OUHEOIWUYGHIQNIDOUW1359478'})
12566
+ .then((bool)=>{
12567
+ console.log('deleteCouponCode', bool);
12568
+ }, error=>{
12569
+ console.log('error', error);
12570
+ })
12571
+ * @param id_coupon_code
12572
+ * @param id_coupon_release_detail
12573
+ * @return Promise => boolean = true or false
12574
+ */
12575
+ deleteCouponCode(id_coupon_code: string, id_coupon_release_detail: string): Promise<unknown>;
12576
+ /**
12577
+ * hàm này trả về danh sách coupon code đã phát hành theo mỗi đợt
12578
+ * @example:
12579
+ *
12580
+ * this.vhQuerySales.getCouponCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'})
12581
+ .then((array)=>{
12582
+ console.log('getCouponCodes_byIdCouponReleaseDetail', array);
12583
+ }, error=>{
12584
+ console.log('error', error);
12585
+ })
12586
+ * @param id_coupon_release_detail
12587
+ * @return Promise => Array<any>
12588
+ */
12589
+ getCouponCodes_byIdCouponReleaseDetail(id_coupon_release_detail: any): Promise<unknown>;
12590
+ /**
12591
+ * hàm này trả về danh sách coupon code đã phát hành theo điều kiện query
12592
+ * @example:
12593
+ * this.vhQuerySales.getCouponCodes_byFields({status:{$eq: 1}}, {}, {}, 0)
12594
+ .then((res)=>{
12595
+ console.log('getCouponCodes_byFields', res);
12596
+ }, error=>{
12597
+ console.log('error', error);
12598
+ })
12599
+ * @param query
12600
+ * @param projection
12601
+ * @param sort
12602
+ * @param limit
12603
+ * @return Promise => array(object) = [{},{},..]
12604
+ */
12605
+ getCouponCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
12606
+ /**
12607
+ * hàm này trả về coupon code đã phát hành theo trường _id của Coupon code. dùng trong trang bán hàng thanh toán bằng phiếu
12608
+ * @example:
12609
+ *
12610
+ * this.vhQuerySales.getCouponCode('OUHEDW0512'})
12611
+ .then((res)=>{
12612
+ console.log('getCouponCode', res);
12613
+ }, error=>{
12614
+ console.log('error', error);
12615
+ })
12616
+ * @param id_coupon_code: cũng chính là code
12617
+ * @return Promise => obj ={} or null
12618
+ */
12619
+ getCouponCode(id_coupon_code: any): Promise<unknown>;
12620
+ /**
12621
+ * 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
12622
+ * @example:
12623
+ * this.vhQuerySales.exchangeCouponCode_byEarningPoints(['OUIYWGUDBYWUHEDW0512','1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000})
12624
+ .then((bool)=>{
12625
+ console.log('exchangeCouponCode_byEarningPoints', bool);
12626
+ }, error=>{
12627
+ console.log('error', error);
12628
+ })
12629
+ * @param array_id_coupon_code
12630
+ * @param id_customer
12631
+ * @param earning_points
12632
+ * @return Promise => boolean = true or false
12633
+ */
12634
+ exchangeCouponCode_byEarningPoints(array_id_coupon_code: any, id_customer: any, points: any): Promise<unknown>;
12635
+ /**
12636
+ * @example:
12637
+ * let data = {
12638
+ name : "Siêu khuyến mãi",
12639
+ id_design_barcode :"316OIUHLKMLSDYW235",
12640
+ products: [{
12641
+ id_product : "NIDOUHWIOLDNOIU1142748",
12642
+ price : 1000000,
12643
+ quantity: 1,
12644
+ ptype: 1
12645
+ }],
12646
+ point: 10,
12647
+ price_origin: 9300000,
12648
+ price: 9200000,
12649
+ id_branch: 4zFGhVUAZyj5d09r01xZ
12650
+ }
12651
+ * this.vhQuerySales.addVoucher(data)
12652
+ .then((res)=>{
12653
+ console.log('addVoucher', res);
12654
+ }, error=>{
12655
+ console.log('error', error);
12656
+ })
12657
+ * @param data
12658
+ * @return object or error
12659
+ */
12660
+ addVoucher(data: any): Promise<unknown>;
12661
+ /**
12662
+ * @example:
12663
+ * let data = {
12664
+ point: 23,
12665
+ price_origin: 9400000,
12666
+ id_branch: 4zFGhVUAZyj5d09r01xZ
12667
+ }
12668
+ * this.vhQuerySales.updateVoucher("fuMS21I6othUm34385WV", data)
12669
+ .then((bool)=>{
12670
+ console.log('updateVoucher', bool);
12671
+ }, error=>{
12672
+ console.log('error', error);
12673
+ })
12674
+ * @param id_voucher
12675
+ * @param data
12676
+ * @return Promise Boolean => true or false
12677
+ */
12678
+ updateVoucher(id_voucher: any, data: any): Promise<unknown>;
12679
+ /**
12680
+ * @example:
12681
+ * this.vhQuerySales.deleteVoucher("fuMS21I6othUm34385WV")
12682
+ .then((bool)=>{
12683
+ console.log('deleteVoucher', bool);
12684
+ }, error=>{
12685
+ console.log('error', error);
12686
+ })
12687
+ * @param id_voucher
12688
+ * @return Promise Boolean => true or false
12689
+ */
12690
+ deleteVoucher(id_voucher: any): Promise<unknown>;
12691
+ /**
12692
+ * @example:
12693
+ * this.vhQuerySales.getVoucher(id_voucher)
12694
+ .then((res)=>{
12695
+ console.log('addVoucher', res);
12696
+ }, error=>{
12697
+ console.log('error', error);
12698
+ })
12699
+ * @param id_voucher
12700
+ * @return Promise => object or null
12701
+ */
12702
+ getVoucher(id_voucher: any): Promise<unknown>;
12703
+ /**
12704
+ * @example:
12705
+ * this.vhQuerySales.getVouchers()
12706
+ .then((arr)=>{
12707
+ console.log('getVouchers', arr);
12708
+ }, error=>{
12709
+ console.log('error', error);
12710
+ })
12711
+ * @return Promise => array(object) =[{},{},...]
12712
+ */
12713
+ getVouchers(): Promise<unknown>;
12714
+ /**
12715
+ * @example:
12716
+ * let data = {
12717
+ name : "Tháng 6 bùng nổ",
12718
+ id_branch: 4zFGhVUAZyj5d09r01xZ
12719
+ }
12720
+ * this.vhQuerySales.addVoucherRelease(data)
12721
+ .then((res)=>{
12722
+ console.log('addVoucherRelease', res);
12723
+ }, error=>{
12724
+ console.log('error', error);
12725
+ })
12726
+ * @param data
12727
+ * @return object or error
12728
+ */
12729
+ addVoucherRelease(data: any): Promise<unknown>;
12730
+ /**
12731
+ * @example:
12732
+ * let data = {
12733
+ name : "Tháng 6 bùng nổ"
12734
+ }
12735
+ * this.vhQuerySales.updateVoucherRelease("fuMS21I6othUm34385WV", data)
12736
+ .then((bool)=>{
12737
+ console.log('updateVoucherRelease', bool);
12738
+ }, error=>{
12739
+ console.log('error', error);
12740
+ })
12741
+ * @param id_voucher_release
12742
+ * @param data
12743
+ * @return Promise Boolean => true or false
12744
+ */
12745
+ updateVoucherRelease(id_voucher_release: any, data: any): Promise<unknown>;
12746
+ /**
12747
+ * @example:
12748
+ * this.vhQuerySales.deleteVoucherRelease("fuMS21I6othUm34385WV")
12749
+ .then((bool)=>{
12750
+ console.log('deleteVoucherRelease', bool);
12751
+ }, error=>{
12752
+ console.log('error', error);
12753
+ })
12754
+ * @param id_voucher_release
12755
+ * @return Promise Boolean => true or false
12756
+ */
12757
+ deleteVoucherRelease(id_voucher_release: any): Promise<unknown>;
12758
+ /**
12759
+ * @example:
12760
+ * this.vhQuerySales.getVoucherRelease("fuMS21I6othUm34385WV")
12761
+ .then((res)=>{
12762
+ console.log('getVoucherRelease', res);
12763
+ }, error=>{
12764
+ console.log('error', error);
12765
+ })
12766
+ * @param id_voucher_release
12767
+ * @return Promise => object or null
12768
+ */
12769
+ getVoucherRelease(id_voucher_release: any): Promise<unknown>;
12770
+ /**
12771
+ * @example:
12772
+ * this.vhQuerySales.getVoucherRelases()
12773
+ .then((res)=>{
12774
+ console.log('getVoucherRelases', res);
12775
+ }, error=>{
12776
+ console.log('error', error);
12777
+ })
12778
+ * @return Promise => array(object) =[{},{},...]
12779
+ */
12780
+ getVoucherRelases(): Promise<unknown>;
12781
+ /**
12782
+ * @example:
12783
+ * let data = {
12784
+ id_voucher : "fuMS21I6othUm34385WV",
12785
+ id_voucher_release: "4zFGhVUAZyj5d09r01xZ"
12786
+ }
12787
+ * this.vhQuerySales.addVoucherReleaseDetail(data)
12788
+ .then((res)=>{
12789
+ console.log('addVoucherReleaseDetail', res);
12790
+ }, error=>{
12791
+ console.log('error', error);
12792
+ })
12793
+ * @param data
12794
+ * @return object or error
12795
+ */
12796
+ addVoucherReleaseDetail(data: any): Promise<unknown>;
12797
+ /**
12798
+ * @example:
12799
+ * this.vhQuerySales.deleteVoucherReleaseDetail("fuMS21I6othUm34385WV")
12800
+ .then((bool)=>{
12801
+ console.log('deleteVoucherReleaseDetail', bool);
12802
+ }, error=>{
12803
+ console.log('error', error);
12804
+ })
12805
+ * @param id_voucher_release_detail
12806
+ * @return Promise Boolean => true or false
12807
+ */
12808
+ deleteVoucherReleaseDetail(id_voucher_release_detail: any): Promise<unknown>;
12809
+ /**
12810
+ * @example:
12811
+ * this.vhQuerySales.getVoucherReleaseDetail("fuMS21I6othUm34385WV")
12812
+ .then((res)=>{
12813
+ console.log('getVoucherReleaseDetail', res);
12814
+ }, error=>{
12815
+ console.log('error', error);
12816
+ })
12817
+ * @param (id_voucher_release_detail)
12818
+ * @return Promise => object or null
12819
+ */
12820
+ getVoucherReleaseDetail(id_voucher_release_detail: string): Promise<unknown>;
12821
+ /**
12822
+ * @example:
12823
+ * this.vhQuerySales.getVoucherRelaseDetail_byFields( {id_voucher:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0)
12824
+ .then((res)=>{
12825
+ console.log('getVoucherRelaseDetail_byFields', res);
12826
+ }, error=>{
12827
+ console.log('error', error);
12828
+ })
12829
+ * @param query
12830
+ * @param projection
12831
+ * @param sort
12832
+ * @param limit
12833
+ * @return Promise => array(object) = [{},{},..]
12834
+ */
12835
+ getVoucherRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
12836
+ /**
12837
+ * hàm này để phát hành 1 voucher_code
12838
+ * @example:
12839
+ let data = {
12840
+ code: '3VU4JW0517',
12841
+ date_validity: new Date(),
12842
+ date_expire: new Date(),
12843
+ status: 1,
12844
+ id_voucher_release_detail: "fuMS21I6othUm34385WV",
12845
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
12846
+ }
12847
+ * this.vhQuerySales.createVoucherCode(data)
12848
+ .then((coupon_code)=>{
12849
+ console.log('createVoucherCode', coupon_code);
12850
+ }, error=>{
12851
+ console.log('error', error);
12852
+ })
12853
+ * @param data
12854
+ * @return Promise => Object
12855
+ */
12856
+ private createVoucherCode;
12857
+ /**
12858
+ * hàm này để phát hành nhiều voucher_code theo số lượng truyền vào, và tự động cập nhật trường số lượng đã phát hành (quantity_released) tăng lên
12859
+ * trong collection voucher_release_details
12860
+ * @example:
12861
+ let data = {
12862
+ code: '3VU4JW0517',
12863
+ date_validity: new Date(),
12864
+ date_expire: new Date(),
12865
+ status: 1,
12866
+ id_voucher_release_detail: "fuMS21I6othUm34385WV",
12867
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
12868
+ }
12869
+ * this.vhQuerySales.createVoucherCodes(data, 10)
12870
+ .then((voucher_codes)=>{
12871
+ console.log('createVoucherCodes', voucher_codes);
12872
+ }, error=>{
12873
+ console.log('error', error);
12874
+ })
12875
+ * @param data
12876
+ * @param quantity
12877
+ * @return Promise => Array(object)
12878
+ */
12879
+ createVoucherCodes(data: any, quantity: number): Promise<unknown>;
12880
+ /**
12881
+ * @example:
12882
+ *
12883
+ * this.vhQuerySales.updateVoucherCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()})
12884
+ .then((bool)=>{
12885
+ console.log('updateCouponCode', bool);
12886
+ }, error=>{
12887
+ console.log('error', error);
12888
+ })
12889
+ * @param id_voucher_code
12890
+ * @param data
12891
+ * @return Promise => boolean = true or false
12892
+ */
12893
+ updateVoucherCode(id_voucher_code: any, data: any): Promise<unknown>;
12894
+ /**
12895
+ * Hàm này chỉ cho phép xóa voucher_code đang ở trạng thái đã phát hành (status ==1),
12896
+ * và cập nhật giảm trường số lượng quantity_released bớt một trong collection voucher_release_details
12897
+ * @example:
12898
+ * this.vhQuerySales.deleteVoucherCode('BjHxEYPWrB0rPwfj2L9R', 'CBrcRQIL11lwcHBljliW'})
12899
+ .then((bool)=>{
12900
+ console.log('deleteVoucherCode', bool);
12901
+ }, error=>{
12902
+ console.log('error', error);
12903
+ })
12904
+ * @param id_voucher_code
12905
+ * @param id_voucher_release_detail
12906
+ * @return Promise => boolean = true or false
12907
+ */
12908
+ deleteVoucherCode(id_voucher_code: string, id_voucher_release_detail: string): Promise<unknown>;
12909
+ /**
12910
+ * hàm này trả về danh sách voucher_codes đã phát hành theo mỗi đợt
12911
+ * @example:
12912
+ * this.vhQuerySales.getVoucherCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'})
12913
+ .then((array)=>{
12914
+ console.log('getVoucherCodes_byIdCouponReleaseDetail', array);
12915
+ }, error=>{
12916
+ console.log('error', error);
12917
+ })
12918
+ * @param id_voucher_release_detail
12919
+ * @return Promise => Array<any>
12920
+ */
12921
+ getVoucherCodes_byIdCouponReleaseDetail(id_voucher_release_detail: any): Promise<unknown>;
12922
+ /**
12923
+ * hàm này trả về danh sách voucher code đã phát hành theo điều kiện query
12924
+ * @example:
12925
+ * this.vhQuerySales.getVoucherCodes_byFields({status:{$eq: 1}}, {}, {}, 0)
12926
+ .then((res)=>{
12927
+ console.log('getVoucherCodes_byFields', res);
12928
+ }, error=>{
12929
+ console.log('error', error);
12930
+ })
12931
+ * @param query
12932
+ * @param projection
12933
+ * @param sort
12934
+ * @param limit
12935
+ * @return Promise => array(object) = [{},{},..]
12936
+ */
12937
+ getVoucherCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
12938
+ /**
12939
+ * hàm này trả về voucher code đã phát hành theo trường _id của voucher code. dùng trong trang bán hàng để đổi phiếu
12940
+ * @example:
12941
+ *
12942
+ * this.vhQuerySales.getVoucherCode('OUHEDW0512'})
12943
+ .then((res)=>{
12944
+ console.log('getVoucherCode', res);
12945
+ }, error=>{
12946
+ console.log('error', error);
12947
+ })
12948
+ * @param id_voucher_code: cũng chính là code
12949
+ * @return Promise => obj ={} or null
12950
+ */
12951
+ getVoucherCode(id_voucher_code: any): Promise<unknown>;
12952
+ /** 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
12953
+ * @example:
12954
+ * let data = [id_voucher_code]
12955
+ * this.vhQuerySales.exchangeVoucherCode_byEarningPoints(data, "fuMS21I6othUm34385WV", 10)
12956
+ .then((bool)=>{
12957
+ console.log('exchangeVoucherCode_byEarningPoints', bool);
12958
+ }, error=>{
12959
+ console.log('error', error);
12960
+ })
12961
+ * @param array_id_voucher_code
12962
+ * @param id_customer
12963
+ * @param points
12964
+ * @return Promise Boolean => true or false
12965
+ */
12966
+ exchangeVoucherCode_byEarningPoints(array_id_voucher_code: any, id_customer: any, points: any): Promise<unknown>;
12967
+ /**
12968
+ * @example:
12969
+ * let data = {
12970
+ * name :"Thẻ trả trước",
12971
+ * price :1000000,
12972
+ * products : [
12973
+ * {
12974
+ * id_product : 'MOIUHWDWIUHG1345674',
12975
+ * price : 100000,
12976
+ * quantity: 5,
12977
+ * quantity_valid : 5,
12978
+ * type : 1
12979
+ * },{
12980
+ * id_product : 'NJIDUEWNBIJUWGHD135',
12981
+ * price : 100000,
12982
+ * quantity: 5,
12983
+ * quantity_valid : 5,
12984
+ * type : 2
12985
+ * }]
12986
+ * }
12987
+ * this.vhQuerySales.addPaymentCard(data)
12988
+ .then((res)=>{
12989
+ console.log('addPaymentCard', res);
12990
+ }, error=>{
12991
+ console.log('error', error);
12992
+ })
12993
+ * @param data
12994
+ * @return Promise => Array<any>
12995
+ */
12996
+ addPaymentCard(data: any): Promise<unknown>;
12997
+ /**
12998
+ * @example:
12999
+ * let data = {
13000
+ * name :"Thẻ trả trước",
13001
+ * price :1000000,
13002
+ * products : [
13003
+ * {
13004
+ * id_product : 'MOIUHWDWIUHG1345674',
13005
+ * price : 100000,
13006
+ * quantity: 5,
13007
+ * quantity_valid : 5,
13008
+ * type : 1
13009
+ * },{
13010
+ * id_product : 'NJIDUEWNBIJUWGHD135',
13011
+ * price : 100000,
13012
+ * quantity: 5,
13013
+ * quantity_valid : 5,
13014
+ * type : 2
13015
+ * }]
13016
+ * }
13017
+ * this.vhQuerySales.updatePaymentCard(data)
13018
+ .then((bool)=>{
13019
+ console.log('updatePaymentCard', bool);
13020
+ }, error=>{
13021
+ console.log('error', error);
13022
+ })
13023
+ * @param data
13024
+ * @param id_payment_card
13025
+ * @return Promise => bool = true or false
13026
+ */
13027
+ updatePaymentCard(id_payment_card: any, data: any): Promise<unknown>;
13028
+ /**
13029
+ * @example:
13030
+ * this.vhQuerySales.deletePaymentCard('FDNOIUWDHIWH21564DWQ')
13031
+ .then((bool)=>{
13032
+ console.log('deletePaymentCard', bool);
13033
+ }, error=>{
13034
+ console.log('error', error);
13035
+ })
13036
+ * @param id_payment_card
13037
+ * @return Promise => bool = true or false
13038
+ */
13039
+ deletePaymentCard(id_payment_card: any): Promise<unknown>;
13040
+ /**
13041
+ * @example:
13042
+ * this.vhQuerySales.getPaymentCard('FDNOIUWDHIWH21564DWQ')
13043
+ .then((res)=>{
13044
+ console.log('getPaymentCard', res);
13045
+ }, error=>{
13046
+ console.log('error', error);
13047
+ })
13048
+ * @param id_payment_card
13049
+ * @return Promise => object or null
13050
+ */
13051
+ getPaymentCard(id_payment_card: any): Promise<unknown>;
13052
+ /**
13053
+ * @example:
13054
+ * this.vhQuerySales.getPaymentCards()
13055
+ .then((res)=>{
13056
+ console.log('getPaymentCards', res);
13057
+ }, error=>{
13058
+ console.log('error', error);
13059
+ })
13060
+ * @return Promise => Array<any>
13061
+ */
13062
+ getPaymentCards(): Promise<unknown>;
13063
+ /**
13064
+ * @example:
13065
+ * this.vhQuerySales.addPaymentCardRelease({name : "Đợt phát hành thẻ 1", id_branch :"NIOUHDWLJUNBHIU16549"})
13066
+ .then((res)=>{
13067
+ console.log('addPaymentCardRelease', res);
13068
+ }, error=>{
13069
+ console.log('error', error);
13070
+ })
13071
+ * @param data
13072
+ * @return Promise => object or error
13073
+ */
13074
+ addPaymentCardRelease(data: any): Promise<unknown>;
13075
+ /**
13076
+ * @example:
13077
+ * this.vhQuerySales.updatePaymentCardRelease({name : "Đợt phát hành thẻ 1"})
13078
+ .then((bool)=>{
13079
+ console.log('updatePaymentCardRelease', bool);
13080
+ }, error=>{
13081
+ console.log('error', error);
13082
+ })
13083
+ * @param id_payment_card_release
13084
+ * @param data
13085
+ * @return Promise => object or error
13086
+ */
13087
+ updatePaymentCardRelease(id_payment_card_release: any, data: any): Promise<unknown>;
13088
+ /**
13089
+ * @example:
13090
+ * this.vhQuerySales.deletePaymentCardRelease("OIHIDUWNIDOLW123456")
13091
+ .then((bool)=>{
13092
+ console.log('deletePaymentCardRelease', bool);
13093
+ }, error=>{
13094
+ console.log('error', error);
13095
+ })
13096
+ * @param id_payment_card_release
13097
+ * @param data
13098
+ * @return Promise => boolean = true or false
13099
+ */
13100
+ deletePaymentCardRelease(id_payment_card_release: any): Promise<unknown>;
13101
+ /**
13102
+ * @example:
13103
+ * this.vhQuerySales.getPaymentCardRelease("OIHIDUWNIDOLW123456")
13104
+ .then((res)=>{
13105
+ console.log('getPaymentCardRelease', res);
13106
+ }, error=>{
13107
+ console.log('error', error);
13108
+ })
13109
+ * @param id_payment_card_release
13110
+ * @return Promise => object or null
13111
+ */
13112
+ getPaymentCardRelease(id_payment_card_release: any): Promise<unknown>;
13113
+ /**
13114
+ * @example:
13115
+ * this.vhQuerySales.getPaymentCardReleases()
13116
+ .then((res)=>{
13117
+ console.log('getPaymentCardReleases', res);
13118
+ }, error=>{
13119
+ console.log('error', error);
13120
+ })
13121
+ * @return Promise => Array<any>
13122
+ */
13123
+ getPaymentCardReleases(): Promise<unknown>;
13124
+ /**
13125
+ * @example:
13126
+ * this.vhQuerySales.addPaymentCardReleaseDetail({id_payment_card : "OIUHFIUWHGGU41698496", id_payment_card_release :"NIOUHDWLJUNBHIU16549"})
13127
+ .then((res)=>{
13128
+ console.log('addPaymentCardReleaseDetail', res);
13129
+ }, error=>{
13130
+ console.log('error', error);
13131
+ })
13132
+ * @param data
13133
+ * @return Promise => object or error
13134
+ */
13135
+ addPaymentCardReleaseDetail(data: any): Promise<unknown>;
13136
+ /**
13137
+ * @example:
13138
+ * this.vhQuerySales.deletePaymentCardReleaseDetail("OIUHFIUWHGGU41698496")
13139
+ .then((bool)=>{
13140
+ console.log('deletePaymentCardReleaseDetail', bool);
13141
+ }, error=>{
13142
+ console.log('error', error);
13143
+ })
13144
+ * @param id_payment_card_release_detail
13145
+ * @return Promise => bool = true or false
13146
+ */
13147
+ deletePaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13148
+ /**
13149
+ * @example:
13150
+ *
13151
+ * this.vhQuerySales.getPaymentCardReleaseDetail('FBHYWIBDNIUH1321687')
13152
+ .then((res)=>{
13153
+ console.log('getPaymentCardReleaseDetail', res);
13154
+ }, error=>{
13155
+ console.log('error', error);
13156
+ })
13157
+ * @param id_payment_card_release_detail
13158
+ * @return Promise => object or null
13159
+ */
13160
+ getPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13161
+ /**
13162
+ * @example:
13163
+ * this.vhQuerySales.getVoucherRelaseDetail_byFields( {id_payment_card:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0)
13164
+ .then((res)=>{
13165
+ console.log('getVoucherRelaseDetail_byFields', res);
13166
+ }, error=>{
13167
+ console.log('error', error);
13168
+ })
13169
+ * @param query
13170
+ * @param projection
13171
+ * @param sort
13172
+ * @param limit
13173
+ * @return Promise => array(object) = [{},{},..]
13174
+ */
13175
+ getPaymentCardRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
13176
+ /**
13177
+ * hàm này để phát hành 1 payment_card_code
13178
+ * @example:
13179
+ let data = {
13180
+ date_validity: new Date(),
13181
+ date_expire: new Date(),
13182
+ status: 1,
13183
+ id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13184
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
13185
+ }
13186
+ * this.vhQuerySales.createPaymentCardCode(data)
13187
+ .then((coupon_code)=>{
13188
+ console.log('createPaymentCardCode', coupon_code);
13189
+ }, error=>{
13190
+ console.log('error', error);
13191
+ })
13192
+ * @param data
13193
+ * @return Promise => Object
13194
+ */
13195
+ private createPaymentCardCode;
13196
+ /**
13197
+ * hàm này để phát hành nhiều payment_card_code theo số lượng truyền vào, và tự động cập nhật trường số lượng đã phát hành (quantity_released) tăng lên
13198
+ * trong collection payment_card_release_details
13199
+ * @example:
13200
+ let data = {
13201
+ date_validity: new Date(),
13202
+ date_expire: new Date(),
13203
+ status: 1,
13204
+ id_payment_card_release_detail: "fuMS21I6othUm34385WV",
13205
+ id_branch: "4zFGhVUAZyj5d09r01xZ",
13206
+ products:[{id_product, price, ptype, quantity, outquantity:0}, {id_product, price, ptype, quantity, outquantity:0}]
13207
+ }
13208
+ * this.vhQuerySales.createPaymentCardCodes(data, 10)
13209
+ .then((voucher_codes)=>{
13210
+ console.log('createPaymentCardCodes', voucher_codes);
13211
+ }, error=>{
13212
+ console.log('error', error);
13213
+ })
13214
+ * @param data
13215
+ * @param quantity
13216
+ * @return Promise => Array(object)
13217
+ */
13218
+ createPaymentCardCodes(data: any, quantity: number): Promise<unknown>;
13219
+ /**
13220
+ * @example:
13221
+ * let data = {
13222
+ date_validity: new Date(),
13223
+ date_expire: new Date(),
13224
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
13225
+ }
13226
+ * this.vhQuerySales.updatePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478',data)
13227
+ .then((bool)=>{
13228
+ console.log('updateCouponCode', bool);
13229
+ }, error=>{
13230
+ console.log('error', error);
13231
+ })
13232
+ * @param id_payment_card_code
13233
+ * @param data
13234
+ * @return Promise => boolean = true or false
13235
+ */
13236
+ updatePaymentCardCode(id_payment_card_code: any, data: any): Promise<unknown>;
13237
+ /**
13238
+ * Hàm này chỉ cho phép xóa payment_card đang ở trạng thái đã phát hành (status ==1),
13239
+ * và cập nhật giảm trường số lượng quantity_released bớt một trong collection payment_card_release_details
13240
+ * @example:
13241
+ * this.vhQuerySales.deletePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478', 'qKgt3cRPRXtw75JV9URp'})
13242
+ .then((bool)=>{
13243
+ console.log('deletePaymentCardCode', bool);
13244
+ }, error=>{
13245
+ console.log('error', error);
13246
+ })
13247
+ * @param id_payment_card_code
13248
+ * @param id_payment_card_release_detail
13249
+ * @return Promise => boolean = true or false
13250
+ */
13251
+ deletePaymentCardCode(id_payment_card_code: string, id_payment_card_release_detail: string): Promise<unknown>;
13252
+ /**
13253
+ * hàm này trả về danh sách payment_card_codes đã phát hành theo mỗi đợt
13254
+ * @example:
13255
+ *
13256
+ * this.vhQuerySales.getPaymentCardCodes_byIdPaymentCardReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'})
13257
+ .then((array)=>{
13258
+ console.log('getPaymentCardCodes_byIdPaymentCardReleaseDetail', array);
13259
+ }, error=>{
13260
+ console.log('error', error);
13261
+ })
13262
+ * @param id_payment_card_release_detail
13263
+ * @return Promise => Array<any>
13264
+ */
13265
+ getPaymentCardCodes_byIdPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise<unknown>;
13266
+ /**
13267
+ * hàm này trả về danh sách payment_card code đã phát hành theo điều kiện query
13268
+ * @example:
13269
+ * this.vhQuerySales.getPaymentCardCodes_byFields({status:{$eq: 1}}, {}, {}, 0)
13270
+ .then((res)=>{
13271
+ console.log('getPaymentCardCodes_byFields', res);
13272
+ }, error=>{
13273
+ console.log('error', error);
13274
+ })
13275
+ * @param query
13276
+ * @param projection
13277
+ * @param sort
13278
+ * @param limit
13279
+ * @return Promise => array(object) = [{},{},..]
13280
+ */
13281
+ getPaymentCardCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise<unknown>;
13282
+ /**
13283
+ * 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 thanh toán bằng payment_card (chỉ lấy được hàng hóa có và còn trong card)
13284
+ * @example:
13285
+ *
13286
+ * this.vhQuerySales.getPaymentCardCode('OUHEDW0512'})
13287
+ .then((res)=>{
13288
+ console.log('getPaymentCardCode', res);
13289
+ }, error=>{
13290
+ console.log('error', error);
13291
+ })
13292
+ * @param id_payment_card_code: cũng chính là code
13293
+ * @return Promise => obj = {} or null
13294
+ */
13295
+ getPaymentCardCode(id_payment_card_code: any): Promise<unknown>;
13296
+ /**
13297
+ * không cần hàm này vì khi tạo phiếu bill_type51 đã được cập nhật
13298
+ * hàm này dùng để cập nhật số lượng sản phẩm trong Payment Card khi đổi thẻ
13299
+ * @example:
13300
+ * this.vhQuerySales.getPaymentCardCode_byCode("ONHDIWUHIODUWN","NDPIUWUHIOUYEW",{quantity_valid: 0})
13301
+ .then((res)=>{
13302
+ console.log('getPaymentCardCode_byCode', res);
13303
+ }, error=>{
13304
+ console.log('error', error);
13305
+ })
13306
+ * @param id_payment_card
13307
+ * @param id_comboproduct
13308
+ * @param data
13309
+ * @return Promise object or null
13310
+ */
13311
+ updateComboPaymentCard(id_payment_card: any, id_comboproduct: any, data: any): void;
11770
13312
  }
11771
13313
  export declare class VhQuerySCclient {
11772
13314
  private vhmongo_firebase;