ionic-vhframeworks 4.1.5 → 4.1.8
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.
- package/bundles/ionic-vhframeworks.umd.js +1 -1
- package/bundles/ionic-vhframeworks.umd.js.map +1 -1
- package/bundles/ionic-vhframeworks.umd.min.js +1 -1
- package/bundles/ionic-vhframeworks.umd.min.js.map +1 -1
- package/fesm2015/ionic-vhframeworks.js.map +1 -1
- package/ionic-vhframeworks.metadata.json +1 -1
- package/lib/ionic-vhframeworks.service.d.ts +141 -16
- package/package.json +1 -1
|
@@ -29,6 +29,16 @@ 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 kiểm tra ngày trên bill có phải là ngày hiện tại của thiết bị không
|
|
34
|
+
* @Example :
|
|
35
|
+
* if(this.vhAlgorithm.isToday(date)){
|
|
36
|
+
* //Your code
|
|
37
|
+
* }
|
|
38
|
+
* @param date : ngày trên bill
|
|
39
|
+
* @returns true: nếu ngày trên bill trùng với ngày của thiết bị; false: nếu ngày trên bill khác với ngày của thiết bị
|
|
40
|
+
*/
|
|
41
|
+
isToday(date: any): boolean;
|
|
32
42
|
/**
|
|
33
43
|
* Hàm này so sanh sâu 2 object bằng nhau
|
|
34
44
|
* @param object1
|
|
@@ -42,6 +52,11 @@ export declare class VhAlgorithm {
|
|
|
42
52
|
* @returns
|
|
43
53
|
*/
|
|
44
54
|
isObject(object: any): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Hàm này tạo chuỗi số, ký tự ngẫy nhiên có chiều dài là length
|
|
57
|
+
* @param length
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
45
60
|
ObjectId(length?: number): string;
|
|
46
61
|
/**
|
|
47
62
|
* @example:
|
|
@@ -85,7 +100,17 @@ export declare class VhAlgorithm {
|
|
|
85
100
|
*/
|
|
86
101
|
exportCSV(headerRow: any, csvData: any, filename: any): void;
|
|
87
102
|
waitingStack(): Promise<unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* Hàm trả về mảng có đối tượng trong array_list thỏa điều kiện tìm kiếm
|
|
105
|
+
* @param value : giá trị cần search
|
|
106
|
+
* @param array_list : mảng các đối tượng
|
|
107
|
+
* @param array_field : mảng các trường của đối tượng sẽ đc search
|
|
108
|
+
* @returns Array
|
|
109
|
+
*/
|
|
88
110
|
searchList(value: any, array_list: any, array_field: any): any[];
|
|
111
|
+
/**
|
|
112
|
+
* Ham đổi chuỗi alias có dấu thành không dấu
|
|
113
|
+
*/
|
|
89
114
|
changeAlias(alias: any): any;
|
|
90
115
|
/**
|
|
91
116
|
* @example
|
|
@@ -139,13 +164,14 @@ export declare class VhAlgorithm {
|
|
|
139
164
|
sortNumberbyASC(array: any, field: any): any;
|
|
140
165
|
sortNumberbyDESC(array: any, field: any): any;
|
|
141
166
|
/**
|
|
142
|
-
*
|
|
167
|
+
* Hàm trả về số ngày trong tháng của một thời gian
|
|
143
168
|
* @param year
|
|
144
169
|
* @param month
|
|
145
170
|
*/
|
|
146
171
|
getNumberOfDaysInMonth(year: number, month: number): 31 | 29 | 28 | 30;
|
|
147
172
|
Compare(field: any, condition: any, value: any): boolean;
|
|
148
173
|
/**
|
|
174
|
+
* Hàm đổi chuỗi sang object
|
|
149
175
|
* @example: data = "{"field":1, "field2": "val"}";
|
|
150
176
|
* => data = {
|
|
151
177
|
* field1: 1,
|
|
@@ -156,6 +182,7 @@ export declare class VhAlgorithm {
|
|
|
156
182
|
*/
|
|
157
183
|
convert_STRING2OBJECT(string: any): any;
|
|
158
184
|
/**
|
|
185
|
+
* Hàm đổi object sang chuỗi
|
|
159
186
|
* @example:
|
|
160
187
|
* data = {
|
|
161
188
|
* field1: 1,
|
|
@@ -407,7 +434,7 @@ export declare class VhAuth {
|
|
|
407
434
|
private initializeDB;
|
|
408
435
|
/**
|
|
409
436
|
* @example:
|
|
410
|
-
* this.vhAuth.initializeProject('vhsales','firebase-mongo','research','research',
|
|
437
|
+
* this.vhAuth.initializeProject('vhsales','firebase-mongo','research','research', 324852, 'all');
|
|
411
438
|
* @param projectname
|
|
412
439
|
* @param dbstorage
|
|
413
440
|
* @param dbserverversion
|
|
@@ -419,7 +446,7 @@ export declare class VhAuth {
|
|
|
419
446
|
initializeProject(projectname: string, dbstorage: string, dbserverversion: string, camserverversion: string, fwcode: number, database: string): any;
|
|
420
447
|
/**
|
|
421
448
|
* @example:
|
|
422
|
-
* this.vhAuth.initializeWebAppProject('vhsales',
|
|
449
|
+
* this.vhAuth.initializeWebAppProject('vhsales', 356842, 'all');
|
|
423
450
|
* @param projectname
|
|
424
451
|
* @param fwcode
|
|
425
452
|
* @param database : tất cả database 'all' hoặc một database nào đó '4wk3JMSwSjh4kOLWOMbLbWt0Rdk2'
|
|
@@ -502,6 +529,8 @@ export declare class VhAuth {
|
|
|
502
529
|
*/
|
|
503
530
|
refreshLocalMyPermission(): Promise<unknown>;
|
|
504
531
|
/**
|
|
532
|
+
* Hàm này chỉ trả về kết quả chính xác khi mà các permission_name có giá trị trả về là kiểu boolean
|
|
533
|
+
* Hàm checkMyPermission tương đương hàm checkLocalMyPermissionName, sau này sẽ bỏ hàm checkMyPermission
|
|
505
534
|
* @example:
|
|
506
535
|
if(this.VhQuerySales.checkMyPermission('login_enable_login')){
|
|
507
536
|
this.login();
|
|
@@ -530,6 +559,17 @@ export declare class VhAuth {
|
|
|
530
559
|
* @return number/string/object
|
|
531
560
|
*/
|
|
532
561
|
getLocalMyPermissionName(permission_name: any): any;
|
|
562
|
+
/**
|
|
563
|
+
* @example:
|
|
564
|
+
this.VhQuerySales.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false, default_display_page: 'admin_display_page'})
|
|
565
|
+
.then((result)=>{
|
|
566
|
+
console.log(result);
|
|
567
|
+
})
|
|
568
|
+
* @format value = {login_enable_login:true} or value = {login_reset_password:true}
|
|
569
|
+
* @param value
|
|
570
|
+
* @return Promise Boolean => true or false
|
|
571
|
+
*/
|
|
572
|
+
updateMyPermission(value: object): Promise<unknown>;
|
|
533
573
|
/**
|
|
534
574
|
* @example:
|
|
535
575
|
this.VhQuerySales.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false})
|
|
@@ -540,7 +580,7 @@ export declare class VhAuth {
|
|
|
540
580
|
* @param value
|
|
541
581
|
* @return Promise Boolean => true or false
|
|
542
582
|
*/
|
|
543
|
-
updatePermission(id_employee:
|
|
583
|
+
updatePermission(id_employee: string, value: object): Promise<unknown>;
|
|
544
584
|
/**
|
|
545
585
|
* Hàm này lấy về phân quyền của nhân viên
|
|
546
586
|
* Lưu ý không dùng hàm này cho Boss, vì Boss không bị giới hạn phân quyền
|
|
@@ -3425,6 +3465,21 @@ export declare class VhQueryCafe {
|
|
|
3425
3465
|
* @return — Array -> array = [{},{},...]
|
|
3426
3466
|
*/
|
|
3427
3467
|
getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
3468
|
+
/**
|
|
3469
|
+
* @example:
|
|
3470
|
+
* let time = new Date();
|
|
3471
|
+
* time.setDate(time.getDate()-7);
|
|
3472
|
+
* this.vhQueryCafe.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
|
|
3473
|
+
.then((bills)=>{
|
|
3474
|
+
console.log('getBills', bills);
|
|
3475
|
+
})
|
|
3476
|
+
* @param query
|
|
3477
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
3478
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
3479
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
3480
|
+
* @return — Array -> array = [{},{},...]
|
|
3481
|
+
*/
|
|
3482
|
+
getBills_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
3428
3483
|
/**
|
|
3429
3484
|
* @example:
|
|
3430
3485
|
* this.vhQueryCafe.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
|
|
@@ -7784,6 +7839,28 @@ export declare class VhQuerySales {
|
|
|
7784
7839
|
private callbacksyncopeningbill;
|
|
7785
7840
|
private sync_code;
|
|
7786
7841
|
constructor(vhmongo_firebase: Vhmongo_firebase, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm, iap2: InAppPurchase2, platform: Platform);
|
|
7842
|
+
/**
|
|
7843
|
+
* Hàm này lấy về các trường trong phạm vi quản lý bán hàng trong cài đặt
|
|
7844
|
+
* @example:
|
|
7845
|
+
* let sales_management_scope = this.vhQuerySales.getSales_Management_Scope();
|
|
7846
|
+
* @return Object = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope}
|
|
7847
|
+
* => 1 áp dụng cho toàn chi nhánh, 2 áp dụng riêng cho từng chi nhánh
|
|
7848
|
+
*/
|
|
7849
|
+
getSales_Management_Scope(): any;
|
|
7850
|
+
/**
|
|
7851
|
+
* Hàm này cấp nhật lại các trường trong phạm vi quản lý bán hàng trong cài đặt
|
|
7852
|
+
* @example:
|
|
7853
|
+
* this.vhQuerySales.updateSales_Management_Scope({product_scope:1, employee_scope:1, customer_scope:1, supplier_scope:1, sales_program_scope:2})
|
|
7854
|
+
.then(()=>{
|
|
7855
|
+
console.log('updateSales_Management_Scope');
|
|
7856
|
+
}, error=>{
|
|
7857
|
+
reject(error);
|
|
7858
|
+
})
|
|
7859
|
+
* @param value = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope}
|
|
7860
|
+
* 1 áp dụng cho toàn chi nhánh, 2 áp dụng riêng cho từng chi nhánh
|
|
7861
|
+
* @return Promise => udefined/error
|
|
7862
|
+
*/
|
|
7863
|
+
updateSales_Management_Scope(value: any): Promise<unknown>;
|
|
7787
7864
|
/**
|
|
7788
7865
|
* @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)
|
|
7789
7866
|
* @example
|
|
@@ -9163,6 +9240,39 @@ export declare class VhQuerySales {
|
|
|
9163
9240
|
* @return Promise => array(object) = [{},{},..]
|
|
9164
9241
|
*/
|
|
9165
9242
|
getCustomers(): Promise<unknown>;
|
|
9243
|
+
/**
|
|
9244
|
+
* Hàm này dùng để xóa hoặc đặt lại điểm mới cho khách hàng
|
|
9245
|
+
* @example:
|
|
9246
|
+
* this.vhQuerySales.updateCustomer_byEarnedPoints('5fb6780ca2148e09806c5b01', 1000)
|
|
9247
|
+
.then((bool)=>{
|
|
9248
|
+
console.log('updateCustomer_byEarnedPoints', bool);
|
|
9249
|
+
})
|
|
9250
|
+
* @param _id
|
|
9251
|
+
* @param points
|
|
9252
|
+
* @return Promise => bool = true or false
|
|
9253
|
+
*/
|
|
9254
|
+
updateCustomer_byPoints(_id: string, points: number): Promise<unknown>;
|
|
9255
|
+
/**
|
|
9256
|
+
* Hàm này thêm điểm mới kiếm được vào quỹ điểm khách hàng đang có
|
|
9257
|
+
* points = points(tích được trên bill) - point (sử dụng thanh toán trên bill)
|
|
9258
|
+
* @example:
|
|
9259
|
+
* this.vhQuerySales.updateCustomer_byEarnedPoints('5fb6780ca2148e09806c5b01', 200)
|
|
9260
|
+
.then((bool)=>{
|
|
9261
|
+
console.log('updateCustomer_byEarnedPoints', bool);
|
|
9262
|
+
})
|
|
9263
|
+
* @param _id
|
|
9264
|
+
* @param points
|
|
9265
|
+
* @return Promise => bool = true or false
|
|
9266
|
+
*/
|
|
9267
|
+
updateCustomer_byEarnedPoints(_id: string, points: number): Promise<unknown>;
|
|
9268
|
+
/**
|
|
9269
|
+
* Hàm này trả về điểm của khách hàng theo phạm vị chương trình bán hàng là toàn chi nhánh hay là từng chi nhánh
|
|
9270
|
+
* @example:
|
|
9271
|
+
* let customer = this.vhQuerySales.getlocalCustomer_byPoints('5fb6780ca2148e09806c5b01');
|
|
9272
|
+
* @param id_customer
|
|
9273
|
+
* @return Object => obj = {} or null
|
|
9274
|
+
*/
|
|
9275
|
+
getlocalCustomerPoints(id_customer: any): any;
|
|
9166
9276
|
private publishObservableEventSuppliers;
|
|
9167
9277
|
private observableLocalSuppliers;
|
|
9168
9278
|
/**
|
|
@@ -10884,6 +10994,21 @@ export declare class VhQuerySales {
|
|
|
10884
10994
|
* @return — Array -> array = [{},{},...]
|
|
10885
10995
|
*/
|
|
10886
10996
|
getBills(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
10997
|
+
/**
|
|
10998
|
+
* @example:
|
|
10999
|
+
* let time = new Date();
|
|
11000
|
+
* time.setDate(time.getDate()-7);
|
|
11001
|
+
* this.vhQuerySales.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
|
|
11002
|
+
.then((bills)=>{
|
|
11003
|
+
console.log('getBills', bills);
|
|
11004
|
+
})
|
|
11005
|
+
* @param query
|
|
11006
|
+
* @param projection — đang tìm hiểu, tạm thời để giá trị là {}
|
|
11007
|
+
* @param sort — null hoặc {}:không sắp xếp; {date:1}: sắp xếp theo ASC; {date:-1}: sắp xếp theo DESC
|
|
11008
|
+
* @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
|
|
11009
|
+
* @return — Array -> array = [{},{},...]
|
|
11010
|
+
*/
|
|
11011
|
+
getBills_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise<unknown>;
|
|
10887
11012
|
/**
|
|
10888
11013
|
* @example:
|
|
10889
11014
|
* this.vhQuerySales.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()})
|
|
@@ -11429,7 +11554,7 @@ export declare class VhQuerySales {
|
|
|
11429
11554
|
getLocalAppSettingNameStations(): any[];
|
|
11430
11555
|
/**
|
|
11431
11556
|
* @example:
|
|
11432
|
-
let appsetting = this.vhQuerySales.getLocalAppSettingNameStation('info_header_footer_bill');
|
|
11557
|
+
let appsetting = this.vhQuerySales.getLocalAppSettingNameStation('info_header_footer_bill'); //printer_config_selling_page
|
|
11433
11558
|
console.log(appsetting);
|
|
11434
11559
|
* @param appsetting_name
|
|
11435
11560
|
* @return object => {title:'title',name:'name', quantity: 10}
|
|
@@ -11481,17 +11606,17 @@ export declare class VhQuerySales {
|
|
|
11481
11606
|
private publishObservableEventAppSettingNameBranchs;
|
|
11482
11607
|
private observableLocalAppSettingNameBranchs;
|
|
11483
11608
|
/**
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
11609
|
+
* Các hàm AppSettingNameBranchs thêm, xóa, sửa thông tin (dạng object) riêng giữa các chi nhánh, như: thông tin cửa hang
|
|
11610
|
+
* @example:
|
|
11611
|
+
* this.observableAppSettingName = this.vhQuerySales.getObservableLocalAppSettingNameBranchs().subscribe(() => {
|
|
11612
|
+
let store_info = this.vhQuerySales.getLocalAppSettingNameBranch('store_info');
|
|
11613
|
+
console.log(store_info);
|
|
11614
|
+
})
|
|
11615
|
+
ngOnDestroy(){
|
|
11616
|
+
this.observableAppSettingName.unsubscribe();
|
|
11617
|
+
}
|
|
11618
|
+
* @returns Observerble (Array) => Array(object) => array = [{},{},...]
|
|
11619
|
+
*/
|
|
11495
11620
|
getObservableLocalAppSettingNameBranchs(): Observable<unknown>;
|
|
11496
11621
|
/**
|
|
11497
11622
|
*@example:
|