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