ionic-vhframeworks 10.10.6 → 10.10.7

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.
@@ -2957,20 +2957,24 @@ export declare class VhQueryCafeMenu {
2957
2957
  private hwinfo;
2958
2958
  private branchs;
2959
2959
  private tables;
2960
+ private areas;
2961
+ private categorys;
2960
2962
  private products;
2961
2963
  private detailproducts;
2962
2964
  private rawproducts;
2965
+ private appsettingbranchs;
2966
+ private sync_code;
2963
2967
  constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_paymentVNPAY: VhMGDB_paymentVNPAY, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm, vhDisplayLEDService: VhDisplayLEDService, vhIDDB_database: VhIDDB_database);
2964
2968
  /**
2965
2969
  * @example:
2966
- this.vhQueryCafeMenu.syncCollections_Sales365_Desktop().then((bool:any)=>{
2970
+ this.vhQueryCafeMenu.syncCollections_Sales365_Web().then((bool:any)=>{
2967
2971
  if(bool){
2968
2972
  do something...
2969
2973
  }
2970
2974
  })
2971
2975
  * @returns Promise bool = true or false
2972
2976
  */
2973
- private syncCollections_Sales365_Web;
2977
+ syncCollections_Sales365_Web(): Promise<unknown>;
2974
2978
  private getLocalLiveIndexDB;
2975
2979
  /**
2976
2980
  * Khi lấy obj từ database về, hàm syncRaw_Detail_ProductInsert sẽ đồng bộ obj vào 3 loại local rawproducts, detailproducts và products
@@ -3003,16 +3007,294 @@ export declare class VhQueryCafeMenu {
3003
3007
  * vcode === 1: Đăng nhập thất bại vì Token không tồn tại trên hệ thống
3004
3008
  */
3005
3009
  signInWithEmailAndPassword_Sales365_byTokenTable(token: string): Promise<any>;
3010
+ /**
3011
+ * @example:
3012
+ * let table = this.vhQueryCafeMenu.getlocalArea();
3013
+ * @return Object => obj = {} or null
3014
+ */
3015
+ getlocalArea(): any;
3016
+ /**
3017
+ * @example:
3018
+ * let table = this.vhQueryCafeMenu.getlocalTable();
3019
+ * @return Object => obj = {} or null
3020
+ */
3021
+ getlocalTable(): any;
3006
3022
  /**
3007
3023
  * @example:
3008
- * let table = this.vhQueryCafeMenu.getlocalTable('5fb6780ca2148e09806c5b01');
3009
- * @param id_table
3010
- * @return Object => obj = {} or null
3024
+ * let categorys = this.vhQueryCafeMenu.getlocalCategorys(1234);
3025
+ * @param type =1 là danh mục món, =2 là danh mục dịch vụ, =3 là danh mục nguyên liệu, =4 là topping, =5 là combo,
3026
+ * = 1234 danh mục món, dịch vụ, nguyên liệu và topping, ko truyền vào hoặc giá trị khác là cả 5
3027
+ * @return Array(object) => array = [{},{},...]
3011
3028
  */
3012
- getlocalTable(): any;
3029
+ getlocalCategorys(type?: any): any[];
3030
+ /**
3031
+ * @example:
3032
+ * let branch = this.vhQueryCafeMenu.getlocalBranch();
3033
+ * @return Object => obj = {} or null
3034
+ */
3035
+ getlocalBranch(): any;
3013
3036
  setDefaultBranch(id_branch: any): void;
3014
3037
  getDefaultBranch(): any;
3015
3038
  clearDefaultBranch(): void;
3039
+ /**
3040
+ * Hàm này lấy về 1 detailproduct theo tham số truyền vào, hoặc là id_product hoặc cả id_subproduct
3041
+ * @example
3042
+ * let id_sub_or_product = id_subproduct?id_subproduct:id_product;
3043
+ * let detailproduct = this.vhQueryCafeMenu.getlocalDetailProduct('ETxNu8exrvGtXFjkIhnc');
3044
+ * @param id_sub_or_product : id_subproduct hoặc id_product
3045
+ * @return Object => obj = {} hoặc null
3046
+ */
3047
+ getlocalDetailProduct(id_sub_or_product: string): any;
3048
+ /**
3049
+ * @example new
3050
+ * let products = this.vhQueryCafe.getlocalProducts();
3051
+ * @param type = 1 là sản phẩm, = 2 là dịch vụ, = 3 nguyên liệu, = 5 là combo, =12 là sản phẩm và dịch vụ, giá trị khác là cả 3
3052
+ * @return Array(object) => array = [{},{},...]
3053
+ */
3054
+ getlocalProducts(type?: any): any[];
3055
+ /**
3056
+ * Hàm này lấy về 1 unit của sản phẩm theo ratio truyền vào
3057
+ * @example
3058
+ * let unit = this.vhQueryCafe.getUnit_byRatio(1);
3059
+ * @param units
3060
+ * @param ratio
3061
+ * @return Object => obj = {} hoặc null
3062
+ */
3063
+ getUnit_byRatio(units: any, ratio: number): any;
3064
+ /**
3065
+ * Hàm này dùng lấy về phân quyền ở cấp độ chi nhánh
3066
+ * @example:
3067
+ let appsetting = this.vhQueryCafe.getLocalAppSettingNameBranch('info_header_footer_bill');
3068
+ console.log(appsetting);
3069
+ * @param appsetting_name
3070
+ * @return object => {title:'title',name:'name', quantity: 10}
3071
+ */
3072
+ getLocalAppSettingNameBranch(appsetting_name: any): any;
3073
+ /**
3074
+ * 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
3075
+ * @example
3076
+ let bill ={
3077
+ id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83',
3078
+ id_cashier: '2rVieBQTubQ2hjUnpwU4w7qSlD83',
3079
+ id_customer: 'cus001',
3080
+ total: 10000000,
3081
+ bill_type: 1,
3082
+ tax_value: 0,
3083
+ fee: 0,
3084
+ date: new Date()
3085
+ }
3086
+ let bill_details =[{
3087
+ id_product: 'pro006',
3088
+ price: 10000000,
3089
+ quantity: 1
3090
+ },{
3091
+ id_product: 'pro007',
3092
+ price: 12000000,
3093
+ quantity: 1
3094
+ }]
3095
+ this.vhQueryCafe.createBill_Billdetail(bill, bill_details)
3096
+ .then((bill:any)=>{
3097
+ console.log(bill._id);
3098
+ },(error:any)=>{
3099
+ console.log('error ', error);
3100
+ })
3101
+ * @param bill
3102
+ * @param bill_details
3103
+ * @return Promise => object = {} or null
3104
+ */
3105
+ createBill_Billdetail(bill: any, bill_details: any): any;
3106
+ /**
3107
+ * Hàm này tạo bill_code theo số thứ tự (trong ngày) của từng loại bill_type
3108
+ * @example:
3109
+ * this.vhQueryCafe.createBillCode(new Date(), 7)
3110
+ .then((bill_code)=>{
3111
+ console.log('createBillCode', bill_code);
3112
+ })
3113
+ * @param billdate
3114
+ * @param bill_type
3115
+ */
3116
+ private createBillCode;
3117
+ /**
3118
+ * Hàm trả về năm của billdate
3119
+ * @param billdate
3120
+ * @returns
3121
+ */
3122
+ private getYear;
3123
+ /**
3124
+ * Hảm trả về mảng năm liên tiếp tương ứng trường date có trong tham số query truyền vào,
3125
+ * nếu trong query không có trường date thì lấy từ hàm getYearsArray()
3126
+ * @param query
3127
+ * @returns
3128
+ */
3129
+ private getYearsArray_fromQuery;
3130
+ /**
3131
+ * Hàm trả về mảng (năm), gồm những năm từ năm tạo shop (thời điểm khách dùng phần mềm) đến năm hiện tại
3132
+ * @returns
3133
+ */
3134
+ private getYearsArray;
3135
+ /**
3136
+ * @example:
3137
+ * let time = new Date();
3138
+ * time.setDate(time.getDate()-7);
3139
+ * this.vhQueryCafe.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0)
3140
+ .then((bills)=>{
3141
+ console.log('getBills', bills);
3142
+ })
3143
+ * @param query
3144
+ * @param projection — đang tìm hiểu, tạm thời để giá trị là {}
3145
+ * @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
3146
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
3147
+ * @return — Array -> array = [{},{},...]
3148
+ */
3149
+ getBills_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise<unknown>;
3150
+ /**
3151
+ * vhQueryCafe
3152
+ * @param bill_details
3153
+ * @returns
3154
+ */
3155
+ private changeBillDetails_withPromotions_toRaw;
3156
+ /**
3157
+ * Hàm này cập nhật lại giá nhập, dùng trong trường hợp createbill_billdetail và updatebill_billdetail với bill_type2
3158
+ * @example
3159
+ this.vhQueryCafe.calculateUpdateImportPrice(bill_details,'SzyEYNN39Mq90NkzUFpz')
3160
+ .then(()=>{
3161
+ console.log("success");
3162
+ })
3163
+ */
3164
+ private calculateUpdateImportPrice;
3165
+ /**
3166
+ * @example:
3167
+ * let data = {
3168
+ date_validity: new Date(),
3169
+ date_expire: new Date(),
3170
+ id_branch: "4zFGhVUAZyj5d09r01xZ"
3171
+ }
3172
+ * this.vhQueryCafe.updatePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478',data)
3173
+ .then((bool:any)=>{
3174
+ console.log('updateCouponCode', bool);
3175
+ }, error=>{
3176
+ console.log('error', error);
3177
+ })
3178
+ * @param id_payment_card_code
3179
+ * @param data
3180
+ * @return Promise => boolean = true or false
3181
+ */
3182
+ private updatePaymentCardCode;
3183
+ /**
3184
+ * @example:
3185
+ *
3186
+ * this.vhQueryCafe.updateVoucherCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()})
3187
+ .then((bool:any)=>{
3188
+ console.log('updateCouponCode', bool);
3189
+ }, error=>{
3190
+ console.log('error', error);
3191
+ })
3192
+ * @param id_voucher_code
3193
+ * @param data
3194
+ * @return Promise => boolean = true or false
3195
+ */
3196
+ private updateVoucherCode;
3197
+ /**
3198
+ * 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)
3199
+ * @example:
3200
+ *
3201
+ * this.vhQueryCafe.getPaymentCardCode('OUHEDW0512'})
3202
+ .then((res)=>{
3203
+ console.log('getPaymentCardCode', res);
3204
+ }, error=>{
3205
+ console.log('error', error);
3206
+ })
3207
+ * @param id_payment_card_code: cũng chính là code
3208
+ * @return Promise => obj = {} or null
3209
+ */
3210
+ private getPaymentCardCode;
3211
+ /**
3212
+ * Hàm lấy về các có kèm chương trình khuyến mãi
3213
+ * @example
3214
+ this.vhQueryCafeMenu.getBill_details_byId_bill('RcECbNgU9BdYQo37s30p')
3215
+ .then((bill_details:any)=>{
3216
+ console.log('getBill_details_byId_bill', bill_details);
3217
+ },(error:any)=>{
3218
+ console.log('error ', error);
3219
+ })
3220
+ * @param id_bill
3221
+ * @return Promise => array / orror
3222
+ */
3223
+ getBill_details_byId_bill(id_bill: any): any;
3224
+ /**
3225
+ * @example:
3226
+ * this.vhQueryCafeMenu.getBill('5fb67fda87c0f21d484cbdf3')
3227
+ .then((bill)=>{
3228
+ console.log('getBill', bill);
3229
+ })
3230
+ * @param id_bill
3231
+ */
3232
+ private getBill;
3233
+ /**
3234
+ * @example:
3235
+ * this.vhQueryCafe.getBill_details_byID({id_bill:{$eq:id_bill}, bill_type:{$eq:5}}, {},{date:1},0)
3236
+ .then((bill_details)=>{
3237
+ console.log('bill_details', bill_details);
3238
+ })
3239
+ * @param query : trong query phải có query id_bill or id_product or id_subproduct....
3240
+ * @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
3241
+ * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record
3242
+ * @return — Array -> array = [{},{},...]
3243
+ */
3244
+ private getBill_details_byID;
3245
+ private changeBillDetails_withRaw_toPromotions;
3246
+ /**
3247
+ * hàm này trả về voucher code đã phát hành theo trường _id của voucher code.
3248
+ * trả về có cả code, name_voucher, name_voucher_release
3249
+ * @example:
3250
+ *
3251
+ * this.vhQueryCafeMenu.getVoucher_Code_Name_Release('OUHEDW0512'})
3252
+ .then((res)=>{
3253
+ console.log('getVoucher_Code_Name_Release', res);
3254
+ }, error=>{
3255
+ console.log('error', error);
3256
+ })
3257
+ * @param id_voucher_code: cũng chính là code
3258
+ * @return Promise => obj ={} or null
3259
+ */
3260
+ private getVoucher_Code_Name_Release;
3261
+ /**
3262
+ * vhQueryCafeMenu
3263
+ * @example:
3264
+ * let _bill_details = this.vhQueryCafeMenu.changeBillDetails_withNameUnitsLots(bill_details);
3265
+ * @param bill_details
3266
+ * @return Promise => array = [{},{},...]
3267
+ * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
3268
+ */
3269
+ private changeBillDetails_withNameUnitsLots;
3270
+ /**
3271
+ * hàm này trả về payment_card code đã phát hành theo trường _id của payment_card code
3272
+ * trả về có cả code, name_payment_card, name_payment_card_release
3273
+ * @example:
3274
+ *
3275
+ * this.vhQueryCafeMenu.getPaymentCard_Code_Name_Release('OUHEDW0512'})
3276
+ .then((res)=>{
3277
+ console.log('getPaymentCard_Code_Name_Release', res);
3278
+ }, error=>{
3279
+ console.log('error', error);
3280
+ })
3281
+ * @param id_payment_card_code: cũng chính là code
3282
+ * @return Promise => obj ={} or null
3283
+ */
3284
+ private getPaymentCard_Code_Name_Release;
3285
+ /**
3286
+ * @example:
3287
+ * this.vhQueryCafeMenu.getBillDetails_withName({name:'promition 1'})
3288
+ .then((bill_details:any)=>{
3289
+ console.log('getBillDetails_withName', bill_details);
3290
+ },(error:any)=>{
3291
+ console.log('error', error);
3292
+ })
3293
+ * @param bill_details
3294
+ * @return Promise => array = [{},{},...]
3295
+ * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là báo lỗi error
3296
+ */
3297
+ private changeBillDetails_withPromotionNameUnitsLots;
3016
3298
  static ɵfac: i0.ɵɵFactoryDeclaration<VhQueryCafeMenu, never>;
3017
3299
  static ɵprov: i0.ɵɵInjectableDeclaration<VhQueryCafeMenu>;
3018
3300
  }
@@ -4159,9 +4441,9 @@ export declare class VhQueryCafe {
4159
4441
  /**
4160
4442
  * Hàm này cập nhật lại những thay đổi trong sub (cỡ) của sản phẩm
4161
4443
  * @example:
4162
- * this.vhQueryCafe.updateSubProduct('5fb6780ca2148e09806c5b01', {quantity:400})
4444
+ * this.vhQueryCafe.updateSubProduct_Cafe('5fb6780ca2148e09806c5b01', {quantity:400})
4163
4445
  .then((bool:any)=>{
4164
- console.log('updateSubProduct', bool);
4446
+ console.log('updateSubProduct_Cafe', bool);
4165
4447
  }, error=>{
4166
4448
  console.log('error', error);
4167
4449
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ionic-vhframeworks",
3
- "version": "10.10.6",
3
+ "version": "10.10.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^12.2.0",
6
6
  "@angular/core": "^12.2.0"