/** * bill_type = 38 : hủy hàng trong kho * bill_type = 39 : bù hàng trong kho */ /** * ng build --prod * Bản thương mại (hoàn thiện code) bỏ các hàm này ra makeCorrectQuantity */ import { OnInit, EventEmitter, PipeTransform, RendererFactory2 } from "@angular/core"; import { Router } from "@angular/router"; import { VhMGDB_auth, VhMGDB_database, VhMGDB_rootdatabase, VhMGDB_f3rdclouds, VhMGDB_image, VhMGDB_socketMongoDB, VhMGDB_paymentVNPAY, VhMGDB_clouds, VhMGDB_shopee, VhMGDB_tiki, VhMGDB_sendo, VhMGDB_lazada, VhMGDB_tiktok, VhMGDB_socketFacebook, VhFB_OTP } from 'vhmongo-new'; import { ImagePicker } from "@ionic-native/image-picker/ngx"; import { WebView } from "@ionic-native/ionic-webview/ngx"; import { Camera } from "@ionic-native/camera/ngx"; import { Observable } from 'rxjs'; import { InAppPurchase2 } from '@ionic-native/in-app-purchase-2/ngx'; import { Platform } from "@ionic/angular"; import { DomSanitizer } from '@angular/platform-browser'; import { Papa } from "ngx-papaparse"; import { SocialSharing } from '@ionic-native/social-sharing/ngx'; import { File } from '@ionic-native/file/ngx'; import Cleave from "cleave.js"; import "cleave.js/dist/addons/cleave-phone.i18n"; import { MqttService, IMqttMessage } from "ngx-mqtt"; import { WifiWizard2 } from '@ionic-native/wifi-wizard-2/ngx'; import { BluetoothSerial } from '@ionic-native/bluetooth-serial/ngx'; import { TranslateLoader, TranslateService } from '@ngx-translate/core'; import { HttpClient } from '@angular/common/http'; import { MyUploadImageAdapter } from "./my-class"; import "cordova-plugin-purchase"; import * as i0 from "@angular/core"; export declare class VhIDB { private db; constructor(database: string); /** * @example: * this.vhQuery.addDoc('products', {name:'camera 2', quantity:20, price:200000}) .then((response)=>{ console.log('addDoc', response); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => object = {} * 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 */ addDoc(colname: string, data: object): Promise; /** * @example: * this.vhQuery.addDocbyID('products', 'nvliw974854hf848ugrgh3498', {name:'camera 2', quantity:20, price:200000}) .then((response)=>{ console.log('addDocbyID', response); }, error=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * Luu y: truong hop trung _id nó sẽ báo lỗi error */ addDocbyID(colname: string, _id: string, data: object): Promise; /** * @example: * this.vhQuery.updateDoc('products', '5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDoc', bool); }, error=>{ console.log('error', error); }) * @param colname * @param _id * @param data * @return Promise => bool = true or false */ updateDoc(colname: string, _id: string, data: object): Promise; /** * @example: * this.vhQuery.deleteDoc('products', '5fb67fda87c0f21d484cbdf3') .then(bool=>{ console.log('deleteDoc', bool); }) * @param colname * @param _id * @return Promise => bool = true or false */ deleteDoc(colname: string, _id: string): Promise; /** * @example * this.vhQuery.getDoc('products', '5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getDoc', product); },(error:any)=>{ console.log('error', error); }) * @param colname * @param _id * @return Promise => obj ={} or null */ getDoc(colname: string, _id: string): Promise; /** * @example * this.vhQuery.getDoc('products', '5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('getDoc', response); }) * @param colname * @param _id * @return array(object) = [{},{},..] */ getDocs(colname: string): Promise; /** * @example: * this.vhQuery.getDocsByFields('products', {name:{$eq:'name abc'}}, {},{},0) .then((products)=>{ console.log('getDocsByFields', products); }) * @param colname * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getDocsByFields(colname: string, query: object, projection?: object, sort?: object, limit?: number): Promise; } export declare function vhDate(value: any, format: string, locate?: string): string; export declare class VhEventMediator { /** * configChanged event */ private configChangedSubject$; /** * this.vhEventMediator.configChanged.subscribe((msg: any) => { if(msg.status === 'update-gap'){ if(msg.code === this.blockChoosing._id){ //code thêm ở đây }else{ //code thêm ở đây } } }) */ configChanged: Observable; /** * this.vhEventMediator.notifyOnConfigChanged({ status: 'update-gap', code: this.blockChoosing._id }); * @param configData */ notifyOnConfigChanged(configData: any): void; /** * configSelected event */ private configSelectedSubject$; /** * this.vhEventMediator.configSelected.subscribe((msg: any) => { if(msg.status === 'choose-object-selected-ruler'){ if(msg.code === this.object._id){ //code thêm ở đây }else{ //code thêm ở đây } } }) */ configSelected: Observable; /** * this.vhEventMediator.notifyOnConfigSelected({ status: 'choose-object-selected-ruler', code: this.object._id }); * @param configData */ notifyOnConfigSelected(configData: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * 🧩 Iap2Service * ------------------------- * Service quản lý toàn bộ luồng In-App Purchase (IAP) * Sử dụng plugin: `cordova-plugin-purchase` * * 👉 Hỗ trợ cả: * - Android (Google Play) * - iOS (App Store) * * Các nhiệm vụ chính: * - Khởi tạo store * - Đăng ký danh sách sản phẩm * - Theo dõi sự kiện mua hàng * - Xử lý các trạng thái giao dịch (approved, verified, expired, ...) * - Cho phép refresh / restore / purchase thủ công */ /*************************** CÁCH DÙNG FW Iap2Service ******************************************* import { Component, OnInit, OnDestroy } from '@angular/core'; import { Iap2Service } from '../services/iap2.service'; import { Subscription } from 'rxjs'; @Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scss'], }) export class HomePage implements OnInit, OnDestroy { private PRODUCT_IDS: string[] = [ "inapp_xprinterpos_main_standard_1day, "inapp_xprinterpos_main_standard_1month", "inapp_xprinterpos_main_standard_12month", "inapp_xprinterpos_main_pro_1month", "inapp_xprinterpos_main_pro_12month", "inapp_xprinterpos_main_super_pro_1month", "inapp_xprinterpos_main_super_pro_12month", ]; products: Array<{ id: string; title: string; desc: string; price: string; saveTag?: string }> = []; selectedPlanIndex: number = 0; private productsSub?: Subscription; constructor(private iap2Service: Iap2Service) {} ngOnInit(): void { this.iap2Service.initPurchase(this.PRODUCT_IDS); this.productsSub = this.iap2Service.products$.subscribe((tmp: any[]) => { this.products = (tmp || []).map((item: any) => { let price: string = ''; if (Array.isArray(item.offers) && item.offers.length > 0 && Array.isArray(item.offers[0].pricingPhases) && item.offers[0].pricingPhases.length > 0) { price = item.offers[0].pricingPhases[0].price; } return { id: item.id as string, title: item.title as string, desc: item.description as string, price: price, }; }); }); } ngOnDestroy(): void { this.productsSub?.unsubscribe(); } selectPlan(i: number): void { this.selectedPlanIndex = i; } purchaseSelectedPlan(): void { const selectedProduct = this.products[this.selectedPlanIndex]; if (selectedProduct) { console.log("==> product id", selectedProduct.id); this.iap2Service.purchase(selectedProduct.id, 'oIpCK6jgMxLHOPrwV1Sm'); } } } */ export declare class Iap2Service { private platform; private vhMGDB_auth; /** * 🔸 Danh sách ID sản phẩm trên Store (Google / Apple) * * 👉 Các ID này phải trùng với phần bạn cấu hình trên Google Play Console hoặc App Store Connect. * 👉 Nếu sai, store sẽ không nhận diện được sản phẩm. */ private PRODUCT_IDS; private app_product; private id_branch; /** * 🔹 Biến lưu instance store (được plugin quản lý) * - Là trung tâm quản lý mọi giao dịch mua hàng */ private store?; /** Observable phát danh sách sản phẩm đã load */ private productsSubject; products$: Observable; constructor(platform: Platform, vhMGDB_auth: VhMGDB_auth); /** * 🚀 Khởi tạo hệ thống In-App Purchase * ----------------------------------- * Thực hiện tuần tự: * 1️⃣ Chờ thiết bị sẵn sàng (Platform Ready) * 2️⃣ Lấy instance `CdvPurchase.store` * 3️⃣ Xác định nền tảng (Android hoặc iOS) * 4️⃣ Đăng ký sản phẩm vào store * 5️⃣ Gắn các event handler xử lý giao dịch * 6️⃣ Khởi tạo và làm mới store * 7️⃣ Chờ store sẵn sàng hoàn toàn (store.ready()) * PRODUCT_IDS: string[] = [ "store_main_package_standard_1month", "store_main_package_standard_12month", "store_main_package_standard_24month", "store_main_package_standard_60month", ]; */ initPurchase(PRODUCT_IDS: any): void; /** * 🧠 Gắn các event handler xử lý luồng mua hàng * --------------------------------------------- * Mỗi bước của giao dịch (approved, verified, refunded, expired, rejected, error) * đều được log ra console để dev theo dõi và xử lý nghiệp vụ phía backend nếu cần. */ private registerHandlersForPurchase; /** * Thực hiện mua sản phẩm * @param app_product - sản phẩm trên chplay, appstore cần mua */ purchase(app_product: any, id_branch: string): void; /** * Refresh thông tin sản phẩm từ store * Cập nhật giá cả và thông tin sản phẩm mới nhất */ refreshPurchase(): void; /** * Lấy danh sách các sản phẩm đã được đăng ký * @returns Mảng các sản phẩm đã được load thành công */ getRegisteredProducts(): any[]; /** * Khôi phục các giao dịch đã mua trước đó * Hữu ích khi user cài đặt lại app hoặc chuyển thiết bị */ restorePurchase(): void; private create_Payment_Apple_Google_Pay; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhAlgorithm { private platform; private file; private socialSharing; private papa; private dom; private platformId; constructor(platform: Platform, file: File, socialSharing: SocialSharing, papa: Papa, dom: DomSanitizer, platformId: Object); private _keyStr; encodeString(e: any): string; decodeString(e: any): any; private _utf8_encode; private _utf8_decode; /** * Hàm dùng xác định biến, trường dữ liệu nào đó có phải là stringify (JSON) hay ko (stringify là loại dữ liệu * mà có thể thể parse thành mảng hoặc object) * @example: * obj = this.vhAlgorithm.isJSON(stringify) * @param stringify * @returns true/false */ isJSON(stringify: any): boolean; /** * Do mysql ko lưu đc kiểu dữ liệu array, object nên khi lưu các trường này phải chuyển sang json(string), * do đó khi lấy về phải chuyển các trường này lại thành array, object * @example: * obj = this.vhAlgorithm.normalizationData_fromMySQL(data) * @param array_or_obj * @returns */ normalizationData_fromMySQL(array_or_obj: any): void; /** * Chuyển kiểu dữ liệu obj là contructor thành object * @example: * obj = this.vhAlgorithm.stringify(obj) * @param obj * @returns */ stringify(obj: any): string; /** * 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 * @Example : * if(this.vhAlgorithm.isToday(date)){ * //Your code * } * @param date : ngày trên bill * @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ị */ isToday(date: any): boolean; /** * Hàm lấy thời điểm bắt đầu (00:00:00.000) của một ngày bất kỳ như sau * @param date * @returns */ getStartOfDay(date: Date | string): Date; /** * Hàm lấy thời điểm kết thúc của một ngày bất kỳ (tức là 23:59:59.999) * @param date * @returns */ getEndOfDay(date: Date | string): Date; /** * @example SET: * localStorageSET('local_name', {a=1, b='hai'}); * localStorageSET('local_name', 15000); * localStorageSET('local_name', 'muoi lam nghin dong'); * @returns */ localStorageSET(name: string, value: any): void; /** * @example GET: * let object = localStorageGET('local_name'); * @returns */ localStorageGET(name: string): any; /** * Hàm này so sanh sâu 2 object bằng nhau * @param object1 * @param object2 * @returns */ deepObjectEqual(object1: any, object2: any): boolean; /** * Hàm này kiểm tra có phải là object không * @param object * @returns */ isObject(object: any): boolean; /** * Hàm này tạo chuỗi số, ký tự ngẫy nhiên có chiều dài là length * @param length * @returns */ ObjectId(length?: number): string; /** * Đọc dữ liệu từ file excel và ghi vào mảng danh sách, dùng để hiển thị lên báo cáo hoặc lưu trữ * @example:
const file = event.target.files[0]; this.vhAlgorithm.importXLSX(file) .then(obj=>{ console.log('obj', obj); }) * @param file * @return Promise (Array): import .xlsx/.xls/.csv file => arraylist */ importXLSX(file: any): Promise; /** * @example: * this.vhAlgorithm.exportXLSX(arrayData, name).then(() => this.status = false).catch(err => this.status = false); * @param arrayData => format [{field_a1: val_a1, field_a2: val_a2, field_a3: val_a3} * {field_b1: val_b1, field_b2: val_b2, field_b3: val_b3} * {field_c1: val_c1, field_c2: val_c2, field_c3: val_c3}] * @param excelFileName * @return Promise => export .xlsx/.xls/.csv file */ exportXLSX(arrayData: any, excelFileName: any): Promise; /** * @example: const file = e.target.files[0]; this.vhAlgorithm.importCSV(file) .then(obj=>{ console.log('obj', obj); }) * @param file => import .csv file */ importCSV(file: any): Promise; /** * @example: * this.vhAlgorithmexportCSV(headerRow, csvData, 'data1'); * @param headerRow * @param csvData => export .csv file */ exportCSV(headerRow: any, csvData: any, filename: any): void; waitingStack(): Promise; searchList(value: any, array_list: any, array_field: any): any[]; /** * Ham đổi chuỗi alias có dấu thành không dấu * @example: * this.vhAlgorithm.changeAlias(alias); * @alias: chuỗi có dấu và các ký tự đặc biệt * @return string */ changeAlias(alias: string): string; /** * Ham đổi chuỗi alias có dấu thành không dấu, giữ lại ký tự đặc biệt * @example: * this.vhAlgorithm.changeAlias_withCharacter(alias); * @alias: chuỗi có dấu và các ký tự đặc biệt */ changeAlias_withCharacter(alias: any): any; /** * Hàm trả về mảng gồm các phần tử là chuỗi con liên tiếp có m, m+1, m+2,... ký tự thỏa điều kiện m>-4 và m<=n * let keywords = this.vhAlgorithm.getSequentialSubstrings('+84909925354, 6); */ getSequentialSubstrings(str: string, m: number): string[]; /** * Hàm trả về số đt mã đã bỏ đi mã quốc gia (nếu có) * console.log(removeCountryCode("+84901234567", "+84")); // "0901234567" * console.log(removeCountryCode("0084901234567", "+84")); // "0901234567" * console.log(removeCountryCode("84901234567", "+84")); // "0901234567" * console.log(removeCountryCode("0901234567", "+84")); // "0901234567" (không đổi) * @example: * let phone = this.vhAlgorithm.removeCountryCode(phoneNumber, countryCode) */ removeCountryCode(phoneNumber: string, countryCode: string): string; /** * Kiểm tra 1 chuỗi str bất kỳ với tất cả các ký tự trong chuỗi đều phải là số * @example: * let bool = this.vhAlgorithm.isNumericString('123345083') * @param str * @returns true/false */ isNumericString(str: string): boolean; /** * Chuẩn hóa chuỗi str, nếu có nhiều hơn 1 khoảng trống liên tiếp thì chỉ giữ lại 1 khoảng trống, bỏ cả khoảng trống đầu và cuối chuỗi * @example: * str = this.vhAlgorithm.normalizeSpaces(str) * @param str * @returns string */ normalizeSpaces(str: string): string; /** * Hàm bỏ tất cả các ký tự trống trong chuỗi */ removeAllSpaces(str: string): string; /** * Hàm trả ra tất cả chuỗi con liên tiếp từ 2 từ trở lên * @param str * @returns array */ getWordSubstrings(str: string): string[]; /** * Hàm này lấy về 1 unit của sản phẩm theo ratio truyền vào * @example * let unit = this.vhAlgorithm.getUnit_byRatio(units, 1, 1); * @param units * @param ratio * @param type * type = 1 : unit của sản phẩm * type = 2 : unit của dịch vụ * type = 3 : unit của combo * type = 4 : unit của coupon * type = 5 : unit của voucher * type = 6 : unit của payment_card * @return Object => obj = {} hoặc null */ getUnit_byRatio(units: any, ratio: number, type?: number): any; /** * Hàm này tạo chuỗi số, ký tự ngẫy nhiên có chiều dài là length * @param length: không truyền length vào mặc định chuỗi tạo ra có chiều dài 24 * @returns */ createObjectID(length?: number): string; /** * Hàm này tạo chuỗi ký tự (ID) từ bí danh truyền vào (alias) * @param alias * @param length chiều dài chuỗi ký tự ID được tạo ra; ko truyền vào chiều dãi ID = chiều dài chuỗi alias * @returns */ createObjectID_fromAlias(alias: string, length?: number): string; /** * @example let bill_code = this.vhAlgorithm.createBillCode(); console.log(bill_code); * @return String -----> "3YU0409" */ createBillCode(billdate?: any): any; /** * @example let payment_code = this.vhAlgorithmcreatePaymentCode(); console.log(payment_code); * @return String -----> "R3YU0409" */ createPaymentCode(paymentdate?: any): any; /** * @example let card_code = this.vhAlgorithmcreateCardCode(); console.log(card_code); * @return String -----> "1KR3YU0409" */ createCardCode(carddate?: any): any; /** * @example: * 0 -> 0 * 1 -> 1.0 * 2 -> 2.00 * 3 -> 3.000 * @param money */ vhcurrencyunit(money: any): any; vhcurrencyunit_symbol(money: any): any; vhpercent(number: any): string; /** * @example: * 123456.78 ->123456.78 * 123456.78 ->123,456.78 * 123456.78 ->12,3456.78 * 123456.78 ->1,23,456.78 * @param classname */ vhnumeral(classname: any): Cleave; vhphoneNumber(classname: any): Cleave; vhYoutubeLink(value: any): import("@angular/platform-browser").SafeResourceUrl; /** * @example array = this.sortVietnamesebyASC(array, 'name'); * @return array */ sortVietnamesebyASC(array: any, field: any): any; /** * @example array = this.sortVietnamesebyDESC(array, 'name'); * @return array */ sortVietnamesebyDESC(array: any, field: any): any; sortDatebyASC(array: any, field: any): any; sortDatebyDESC(array: any, field: any): any; sortStringbyASC(array: any, field: any): any; sortStringbyDESC(array: any, field: any): any; sortNumberbyASC(array: any, field: any): any; sortNumberbyDESC(array: any, field: any): any; /** * Hàm trả về số ngày trong tháng của một thời gian * @param year * @param month */ getNumberOfDaysInMonth(year: number, month: number): 31 | 29 | 28 | 30; Compare(field: any, condition: any, value: any): boolean; /** * Hàm đổi chuỗi sang object * @example: data = "{"field":1, "field2": "val"}"; * => data = { * field1: 1, * field2: "val", * } * * @param data */ convert_STRING2OBJECT(string: any): any; /** * Hàm đổi object sang chuỗi * @example: * data = { * field1: 1, * field2: "val", * } * => data = "{"field":1, "field2": "val"}"; * @param data */ convert_OBJECT2STRING(obj: any): string; formatDateToString(date: any): string | null; roundTo3Decimals(value: any): number; /** * @example let dotmoney = this.vhAlgorithm.changeMoneyToDotMoney(money:string, 20); console.log(dotmoney); * @return "1234567890" -----> "1.234.567.890" */ changeMoneyToDotMoney(money: string, length: number): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhForFirstTime { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_f3rdclouds; private http; private vhAlgorithm; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_f3rdclouds: VhMGDB_f3rdclouds, http: HttpClient, vhAlgorithm: VhAlgorithm); addAPPdatabase_forFirstTime(): Promise; addAPPdatabase_forFirstTime_Sales_Cafe(): Promise; addAPPdatabase_forFirstTime_Sales365(main_sector: string): Promise; private addSales_id_retail; private addSales_tax; private addSales_category_product; private addSales_supplier; private addSales_customer; private addSales_wallet_Cash; private addSales_incoming_group; private addSales_spending_group; private addSales_wallet; /** * Hàm này khởi tạo tạm ở đây, vài bữa cho khởi tạo lúc tạo tài khoản * @returns */ private addSales_StoreInfo; private addCafe_category_product; private addCafe_area_table_GoHome; private addCafe_area_table; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhOTP { private platform; private vhFB_OTP; constructor(platform: Platform, vhFB_OTP: VhFB_OTP); /** * Khởi động, kết nối vào Server đang chạy dịch vụ OTP * @example: * this.vhOTP.initializeProject('Youtube'); * @param projectname: tên dự án được đăng ký trước đó trên firebase, xác thực OTP sẽ đc chạy trên dự án này * @returns */ initializeProject(projectname: string): void; /** * QUY TRÌNH KHÁCH GỬI YÊU CẦU XÁC THỰC QUA OTP * 1. Khách điện đầy đủ thông tin vào FORM mẫu, sau đó nhấn nút "Submit" để gửi đi * 2. FORM sẽ kiểm tra tính đúng đắn các trường dữ liệu khách nhập vào, nếu sai phản hồi để khách nhập lại * 3. FORM gọi hàm initReCaptchaVerifier để yêu cầu server gửi mã otp đến số điện thoại của mình; * 4. Nếu server trả về vcode 1 thì số đt bị sai, * 5. FORM yêu cầu người dùng nhập lại; * 6. Nếu server trả về vcode 0 thì server đã gửi mã otp cho số điện thoại trên * 7. FORM sẽ gọi 1 FORM khác để cho khách nhập mã opt vào, sau đó chạy hàm verificationOTP * 8. Nếu server trả về false thì mã otp nhập sai; Nếu server trả về true thì mã otp nhập đúng, lúc đó gửi yêu cầu của khách lên server để lưu lại * Initialize the reCAPTCHA verifier. * @example: * this.vhOTP.initReCaptchaVerifier(phoneNumber) .then((rsp)=>{ if(rsp.vcode==0){ //Gọi hộp thoại nhập mã OTP đã gửi đến điện thoại }else{ //thông báo người dùng đã nhập sai số điện thoại } },error=>{ }); * @param phoneNumber * @return Promise => rsp = {vcode, message} * vcode = 0: 'Please enter the verification code that was sent to your mobile device' * vcode = 1: 'The format of the phone number provided is incorrect' */ initReCaptchaVerifier(phoneNumber: any): Promise; /** * @example: * this.vhOTP.verificationOTP(verificationCode) .then((bool)=>{ if(bool){ console.log('verificationOTP', bool); }else{ //thông báo người dùng đã nhập sai mã otp } },error=>{ }); * @param verificationCode: mã otp được viethas gửi đến số điện thoại của bạn * @returns Promise => owner = true: mã verificationCode nhập vào đúng; owner = null: mã verificationCode nhập vào sai; */ verificationOTP(verificationCode: string): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhAuth { private platform; private vhMGDB_rootdatabase; private vhMGDB_auth; private vhMGDB_database; private vhForFirstTime; private renderFactory; private platformId; private mypermission; private employees; private endusers; private appsetting_stations; private hwinfo; private renderer; private subjectemployees; constructor(platform: Platform, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhForFirstTime: VhForFirstTime, renderFactory: RendererFactory2, platformId: Object); /** * Hàm lấy thông tin thiết bị đang dùng phần mềm: ngôn ngữ, nước nào, vị trí địa lý, IP.... * @example: * this.vhAuth.getDVinfo() .then((str)=>{ }, error=>{ console.log(error) }) * @returns Promise => rsp =string / error */ getDVinfo(): Promise; /** * Hàm lấy thông tin banner muốn hiển thị ở giao diện đầu tiên của phần mềm (giao diện signin) * @example: * this.vhAuth.getViethasPOS_Banner_Signin() .then((str)=>{ }, error=>{ console.log(error) }) * @returns Promise => rsp =string / error */ getViethasPOS_Banner_Signin(): Promise; /** * Nếu paymentIOS == true : cho phép hiển thị các chức năng liên quan đến thanh toán trên iphone, ipad. Ngược lại thì ko * lưu ý: hàm này chỉ dùng cho iphone và ipad * @example: * this.vhAuth.checkPaymentIOS() .then((bool:any)=>{ console.log('bool', bool); },(error:any)=>{ console.log('error', error); }) * @returns Promise => boolean */ checkPaymentIOS(): Promise; /** * @example: * this.vhAuth.checkPaymentIOS2() .then((bool:any)=>{ console.log('bool', bool); },(error:any)=>{ console.log('error', error); }) * @returns Promise => boolean */ checkPaymentIOS2(): Promise; /** * @example: * this.vhAuth.checkPaymentIOS3() .then((bool:any)=>{ console.log('bool', bool); },(error:any)=>{ console.log('error', error); }) * @returns Promise => boolean */ checkPaymentIOS3(): Promise; /** * @example: * let data = { created_at: new Date(), suggestion: "Lỗi đăng xuất", img:"", id_store: "5fb6780ca2148e09806c5b01" } * this.vhAuth.createSuggestion(data) .then((suggestion)=>{ console.log('createSuggestion', suggestion); },(error:any)=>{ console.log('error', error); }) * @param data : object * @return Promise => suggestion = {} / error * 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 */ createSuggestion(data: any): Promise; /** * @example: * this.vhAuth.getSuggestion('5fb67fda87c0f21d484cbdf3') .then((suggestion)=>{ console.log('getSuggestion', suggestion); }) * @param id_suggestion * @return Promise => suggestion ={} or null / error */ getSuggestion(id_suggestion: any): Promise; /** * @example: * this.vhAuth.updateSuggestion('5fb6780ca2148e09806c5b01', {feedback: "đã xử lý" }) .then((response)=>{ console.log('updateSuggestion', response); }, error=>{ console.log('error', error); }) * @param id_suggestion * @param value * @return Promise => response = undefined / error */ updateSuggestion(id_suggestion: string, value: any): Promise; /** * @example: * this.vhAuth.deleteSuggestion('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deleteSuggestion', response); }, error=>{ console.log(error, error); }) * @param id_suggestion * @return Promise => response = undefined / error */ deleteSuggestion(id_suggestion: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhAuth.getSuggestion_byFields({payment_type:{$eq:5}}, {},{},0) .then((suggestions)=>{ console.log('getSuggestion_byFields', suggestions); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getSuggestion_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPasswordOfEndUser('emp11@gmail.com', '123456') .then((res)=>{ console.log('res', res); },(error:any)=>{ console.log('error', error); }) * @param email * @param password */ signInWithEmailAndPasswordOfEndUser(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChangedOfEndUser() .then((user)=>{ console.log('onAuthStateChanged', user); },(error:any)=>{ console.log('onAuthStateChanged', error); }) * @return Promise => user = {} */ onAuthStateChangedOfEndUser(): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword('emp11@gmail.com', '123456') .then((user)=>{ console.log('user', user); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged() .then((user)=>{ console.log('onAuthStateChanged', user); },(error:any)=>{ console.log('onAuthStateChanged', error); }) * @return Promise => user = {} */ onAuthStateChanged(): Promise; /** * Hàm này dành cho Designer đăng ký * @example: * this.vhAuth.signUpOwner_AutoWeb_Designer('huyleduc92@gmail.com', 'Vh123456', '+84909925359',{}) .then((rsp:any)=>{ if(rsp.vcode === 0){ let owner = rsp.data; }else if(rsp.vcode === 1){ //thông báo trùng số đt }else if(rsp.vcode === 2){ //thông báo trùng email }else if(rsp.vcode === 3){ //thông báo số điện thoại sai định dạng } }) * @param email * @param pwd: password * @param phoneNumber * @param info * @return Promise object => rsp = {vcode, message} * vcode === 0: phoneNumber, email trước đây chưa ký trên hệ thông nên bây giờ có thể dùng để đăng ký * mã opt gửi về điện thoại người dùng * vcode === 1: Hiện thị ra thông báo cho người dùng biết rằng số điện thoại của họ đã được đăng ký sử dụng trước đây, nên giờ ko dùng đc nữa, phải dùng số đt khác * vcode === 2: Hiện thị ra thông báo cho người dùng biết rằng email của họ đã được đăng ký sử dụng trước đây, nên giờ ko dùng đc nữa, phải dùng email khác * vcode === 3: Hiện thị ra thông báo cho người dùng biết rằng số điện thoại của họ nhập vào không đúng với định dạng của nhà mạng * @notice : nhớ kiểm tra email đúng cú pháp và chuỗi trước @gmail.com có chiều dài lớn hơn bằng 6 thì nút "Đồng ý" mới sáng lên */ signUpOwner_AutoWeb_Designer(email: string, pwd: string, phoneNumber: string, info: object): Promise; /** * Hàm này dành cho Developer đăng ký * @example: * this.vhAuth.signUpOwner_AutoWeb_Developer('huyleduc92@gmail.com', 'Vh123456', '+84909925359',{}) .then((rsp:any)=>{ if(rsp.vcode === 0){ let owner = rsp.data; }else if(rsp.vcode === 1){ //thông báo trùng số đt }else if(rsp.vcode === 2){ //thông báo trùng email }else if(rsp.vcode === 3){ //thông báo số điện thoại sai định dạng } }) * @param email * @param pwd: password * @param phoneNumber * @param info * @return Promise object => rsp = {vcode, message} * vcode === 0: phoneNumber, email trước đây chưa ký trên hệ thông nên bây giờ có thể dùng để đăng ký * mã opt gửi về điện thoại người dùng * vcode === 1: Hiện thị ra thông báo cho người dùng biết rằng số điện thoại của họ đã được đăng ký sử dụng trước đây, nên giờ ko dùng đc nữa, phải dùng số đt khác * vcode === 2: Hiện thị ra thông báo cho người dùng biết rằng email của họ đã được đăng ký sử dụng trước đây, nên giờ ko dùng đc nữa, phải dùng email khác * vcode === 3: Hiện thị ra thông báo cho người dùng biết rằng số điện thoại của họ nhập vào không đúng với định dạng của nhà mạng * @notice : nhớ kiểm tra email đúng cú pháp và chuỗi trước @gmail.com có chiều dài lớn hơn bằng 6 thì nút "Đồng ý" mới sáng lên */ signUpOwner_AutoWeb_Developer(email: string, password: string, phoneNumber: string, info: any): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_AutoWeb_Designer('emp11@gmail.com', '123456') .then((rsp)=>{ if(rsp.vcode===0){ this.vhQueryAutoWeb.syncCollections_Desktop() .then(()=>{ do something..... console.log('user', user); }) }else if(rsp.vcode===5){ console.log('Signin sai LOẠI tài khoản developer'); } },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => rsp ={vcode, message, data(object or null)} / error * vcode === 0: Đăng nhập thành công * vcode === 5: Đăng nhập thất bại vì sai LOẠI tài khoản developer */ signInWithEmailAndPassword_AutoWeb_Designer(email: string, password: string): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_AutoWeb_Developer('emp11@gmail.com', '123456') .then((rsp)=>{ if(rsp.vcode===0){ this.vhQueryAutoWeb.syncCollections_Desktop() .then(()=>{ do something..... console.log('user', user); }) }else if(rsp.vcode===5){ console.log('Signin sai LOẠI tài khoản designer'); } },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => rsp ={vcode, message, data(object or null)} / error * vcode === 0: Đăng nhập thành công * vcode === 5: Đăng nhập thất bại vì sai LOẠI tài khoản designer */ signInWithEmailAndPassword_AutoWeb_Developer(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_AutoWeb_Designer() .then((rsp)=>{ if(rsp.vcode===0){ //Designer this.vhQueryAutoWeb.syncCollections_Desktop() .then(()=>{ do something..... console.log('user', user); }) }else if(rsp.vcode===10){ //Developer this.vhQueryAutoWeb.syncCollections_Desktop() .then(()=>{ do something..... console.log('user', user); }) } },(error:any)=>{ console.log('error', error); }) * @return Promise => rsp ={vcode, message, data(object)} / error * vcode === 0: Designer logged in successfully * vcode === 10: Developer logged in successfully */ onAuthStateChanged_AutoWeb_Designer(): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_AutoWeb_Developer() .then((rsp)=>{ if(rsp.vcode===0){ //Designer this.vhQueryAutoWeb.syncCollections_Desktop() .then(()=>{ do something..... console.log('user', user); }) }else if(rsp.vcode===10){ //Developer this.vhQueryAutoWeb.syncCollections_Desktop() .then(()=>{ do something..... console.log('user', user); }) } },(error:any)=>{ console.log('error', error); }) * @return Promise => rsp ={vcode, message, data(object)} / error * vcode === 0: Designer logged in successfully * vcode === 10: Developer logged in successfully */ onAuthStateChanged_AutoWeb_Developer(): Promise; signUpOwner_Sales365(email: string, password: string, phoneNumber: string, info: any): Promise | null; /** * @example: * this.vhAuth.signUpOwner_Sales('huyleduc92', '123456', '+84909925359',{}) .then((owner)=>{ console.log('signUpOwner_Sales', owner); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @param scode * @param info * @return Promise => owner={} */ signUpOwner_Sales(email: string, password: string, phoneNumber: string, info: any): Promise | null; private tam_email; private tam_pw; private tam_info; /** * @example: * if (this.platform.is('ios')) { //Đăng ký bình thường như cách cũ }else{ this.vhAuth.verificationSignup_byOTP_Sales365('huyleduc92@gmail.com', 'Vh123456', '+84909925359',{}) .then((rsp:any)=>{ if(rsp.vcode === 0){ //Nếu số đt và email trước đây chưa được đăng ký sử dụng thì bây giờ có thể đăng ký //Khởi động hàm xác minh người dùng đúng người đúng số đt const verificationCode = window.prompt( 'Please enter the verification code that was sent to your mobile device.', )!; this.vhAuth.verificationSignup_byOTP_Sales365(verificationCode) .then((owner)=>{ if(owner){ //Thông báo người dùng đã đăng ký thành công và trở về lại trang đăng nhập console.log('verificationSignup_byOTP_Sales365', owner); }else{ //thông báo người dùng đã nhập sai mã otp } },(error:any)=>{ console.log('error', error); }); }else if(rsp.vcode === 1){ //thông báo trùng số đt }else if(rsp.vcode === 2){ //thông báo trùng email }else if(rsp.vcode === 3){ //thông báo số điện thoại sai định dạng } }) } * @param email * @param password * @param phoneNumber * @param info * @return Promise object => rsp = {vcode, message} * vcode === 0: phoneNumber, email trước đây chưa ký trên hệ thông nên bây giờ có thể dùng để đăng ký, tiếp tục dùng hàm verificationSignup_byOTP_Sales để xác minh * mã opt gửi về điện thoại người dùng * vcode === 1: Hiện thị ra thông báo cho người dùng biết rằng số điện thoại của họ đã được đăng ký sử dụng trước đây, nên giờ ko dùng đc nữa, phải dùng số đt khác * vcode === 2: Hiện thị ra thông báo cho người dùng biết rằng email của họ đã được đăng ký sử dụng trước đây, nên giờ ko dùng đc nữa, phải dùng email khác * vcode === 3: Hiện thị ra thông báo cho người dùng biết rằng số điện thoại của họ nhập vào không đúng với định dạng của nhà mạng * @notice : nhớ kiểm tra email đúng cú pháp và chuỗi trước @gmail.com có chiều dài lớn hơn bằng 6 thì nút "Đồng ý" mới sáng lên */ signUpOwner_byOTP_Sales365(email: string, password: string, phoneNumber: string, info: any): Promise | null; /** * @example: * this.vhAuth.verificationSignup_byOTP_Sales365(verificationCode) .then((owner)=>{ if(owner){ console.log('verificationSignup_byOTP_Sales365', owner); }else{ //thông báo người dùng đã nhập sai mã otp } },(error:any)=>{ console.log('error', error); }); * @param verificationCode: mã otp được viethas gửi đến số điện thoại của bạn * @returns Promise => owner = obj: mã verificationCode nhập vào đúng và trả về thông tin người dùng; owner = null: mã verificationCode nhập vào sai; */ verificationSignup_byOTP_Sales365(verificationCode: string): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_Sales('emp11@gmail.com', '123456') .then((user)=>{ this.vhQuerySales.refreshLocalBranchs() .then(()=>{ do something..... console.log('user', user); }) },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword_Sales(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_Sales() .then((user)=>{ this.vhQuerySales.refreshLocalBranchs() .then(()=>{ do something..... console.log('onAuthStateChanged_Sales', user); }) },(error:any)=>{ console.log('onAuthStateChanged_Sales', error); }) * @return Promise => user = {} */ onAuthStateChanged_Sales(): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_Sales365('emp11@gmail.com', '123456') .then((user)=>{ this.vhQuerySales.refreshLocalBranchs() .then(()=>{ do something..... console.log('user', user); }) },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword_Sales365(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_Sales365() .then((user)=>{ this.vhQuerySales.refreshLocalBranchs() .then(()=>{ do something..... console.log('onAuthStateChanged_Sales365', user); }) },(error:any)=>{ console.log('onAuthStateChanged_Sales365', error); }) * @return Promise => user = {} */ onAuthStateChanged_Sales365(): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_Sales365_byAffiliater('emp11@gmail.com', '123456') .then((user)=>{ console.log('signInWithEmailAndPassword_Sales365_byAffiliater', user); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword_Sales365_byAffiliater(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_Sales365_byAffiliater() .then((user)=>{ console.log('onAuthStateChanged_Sales365_byAffiliater', user); },(error:any)=>{ console.log('error', error); }) * @return Promise => user = {} */ onAuthStateChanged_Sales365_byAffiliater(): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_Sales365_byDealer('emp11@gmail.com', '123456') .then((user)=>{ console.log('signInWithEmailAndPassword_Sales365_byDealer', user); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword_Sales365_byDealer(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_Sales365_byDealer() .then((user)=>{ console.log('onAuthStateChanged_Sales365_byDealer', user); },(error:any)=>{ console.log('error', error); }) * @return Promise => user = {} */ onAuthStateChanged_Sales365_byDealer(): Promise; /** * @example: * this.vhAuth.signInWithEmailAndPassword_Sales365_byAdmin('emp11@gmail.com', '123456') .then((user)=>{ console.log('signInWithEmailAndPassword_Sales365_byAdmin', user); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword_Sales365_byAdmin(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_Sales365_byAdmin() .then((user)=>{ console.log('onAuthStateChanged_Sales365_byDealer', user); },(error:any)=>{ console.log('error', error); }) * @return Promise => user = {} */ onAuthStateChanged_Sales365_byAdmin(): Promise; /** * @example: * this.vhAuth.signUpOwner_Cafe('huyleduc92', '123456', '+84909925359',{}) .then((owner)=>{ console.log('signUpOwner_Cafe', owner); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @param scode * @param info * @return Promise => owner={} */ signUpOwner_Cafe(email: string, password: string, phoneNumber: string, info: any): Promise | null; /** * @example: * this.vhAuth.signInWithEmailAndPassword_Cafe('emp11@gmail.com', '123456') .then((user)=>{ console.log('user', user); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @return Promise => user = {} */ signInWithEmailAndPassword_Cafe(email: string, password: string): Promise; /** * @example: * this.vhAuth.onAuthStateChanged_Cafe() .then((user)=>{ console.log('onAuthStateChanged_Cafe', user); },(error:any)=>{ console.log('onAuthStateChanged_Cafe', error); }) * @return Promise => user = {} */ onAuthStateChanged_Cafe(): Promise; /** * @example: * this.vhAuth.signOut() .then((res:any)=>{ console.log('res1', res); },(error:any)=>{ console.log('error1', error); }) * @notice : luôn luôn trả về null * @return: null */ signOut(): Promise; /** * @example: * this.vhAuth.signOut_AutoWeb_Designer() .then((res:any)=>{ console.log('res1', res); },(error:any)=>{ console.log('error1', error); }) * @notice : luôn luôn trả về null * @return: null */ signOut_AutoWeb_Designer(): Promise; /** * @example: * this.vhAuth.signOut_AutoWeb_Developer() .then((res:any)=>{ console.log('res1', res); },(error:any)=>{ console.log('error1', error); }) * @notice : luôn luôn trả về null * @return: null */ signOut_AutoWeb_Developer(): Promise; /** * @example: * this.vhAuth.resetPasswordbyEmail() .then((bool:any)=>{ if(bool){ console.log('Email sent'); }else{ console.log('An error happened'); } }) * @param emailAddress */ resetPasswordbyEmail(emailAddress: any): Promise; /** * Hàm này dùng để đổi email của người dùng * @example: * this.vhAuth.updateUserEmail('5fb6780ca2148e09806c5b01', toilaai@gmail.com, 'member') .then((rsp)=> { if(rsp.vcode === 0){ //-----------your code 0----------- console.log('updateUserEmail', rsp); }else //-----------your code 1----------- } },(error:any) => { console.log(error); }) * @param id_employee * @param email : nhớ kiểm tra chuẩn email trước, và chuỗi trước @ có chiều dài lớn hơn bằng 6 * @param owner : 'boss' or 'member' * @return Promise object => rsp = {vcode, message} * vcode == 0: Successfully updated user * vcode != 1: This email has been registered by someone else * @notice : nhớ kiểm tra email đúng cú pháp và chuỗi trước @ có chiều dài lớn hơn bằng 6 thì nút "Đồng ý" mới sáng lên */ updateUserEmail(id_employee: string, email: string, owner: string): Promise; /** * @example: * let projectname = this.vhAuth.getProjectName(); * @returns */ getProjectName(): string; getUser(): any; getUID(): any; /** * uuid: ID định danh cho platform đang sử dụng APP 'fd40681f-8907-4768-9a12-7a6a05338e51' * @example: * let uuid = this.vhAuth.getUUID(); * @returns */ getUUID(): any; /** * @example: * let token = this.vhAuth.getToken(); */ getToken(): string; /** * @example: * let dbcloudurl = this.vhAuth.getDBCloudURL(); */ getDBCloudURL(): any; /** * @example: * let store = this.vhAuth.getStore(); */ getStore(): any; /** * @example: * let dealer = this.vhAuth.getDealer(); */ getDealer(): any; /** * @example: * let dbstorage = this.vhAuth.getDBstorage(); * @return: nơi lưu trữ dữ liệu 'firebase-mongo' hoặc 'firebase' */ getDBstorage(): any; /** * @example: * let tplstorage = this.vhAuth.getTPLstorage(); * @return: nơi lưu trữ template 'mongo' hoặc 'file' */ getTPLstorage(): any; /** * @example: * let imgstorage = this.vhAuth.getDBstorage(); * @return: nơi lưu trữ dữ liệu 'firebase' hoặc 'viethas' */ getIMGstorage(): any; /** * @example: * let imgserverURL = this.vhAuth.getIMGserverURL(); * @return: đường dẫn (url) nơi server lưu trữ hình ảnh */ getIMGserverURL(): any; /** * @notice : dữ liệu Date query từ mongo về có dạng '2021-06-18T16:27:16.276Z', từ firebase có dạng {nanosecond:42345, second:1840298} * do đó muốn lấy Date về dạng chuẩn 'starttime Thu Jul 01 2021 00:00:00 GMT+0700 (Indochina Time)', thì Date sau khi query về dùng hàm newDate * để chuyển đổi. * @example: * let store = this.vhAuth.newDate(bill[0].date); * @return: nơi lưu trữ dữ liệu 'firebase-mongo' hoặc 'firebase' */ newDate(date: any): any; /** * @example: * this.vhAuth.initializeDB('http://115.78.100.57:8011'); * @param url */ private initializeDB; /** * @example: * this.vhAuth.initializeProject('vhsales','firebase-mongo', 'firebase', 'firebase', 'research', 'research', 324852, 'all'); * @param projectname * @param dbstorage: 'firebase' or 'firebase-mongo' * @param imgstorage: 'firebase' or 'viethas' * @param tplstorage : nơi css sẽ được lưu trữ 'local', 'mongo', or 'file' * @param dbserverversion * @param camserverversion * @param fwcode * @param database : tất cả database 'all' hoặc một database nào đó '4wk3JMSwSjh4kOLWOMbLbWt0Rdk2' * @returns Promise => boolean * - boolean: true cho phép chạy dự án * - boolean: false không cho chạy dự án, thường bị là mở từ 2 tab của 1 trình duyệt trở lên => đề nghị đóng tab đang mở */ initializeProject(projectname: string, dbstorage: string, imgstorage: string, tplstorage: string, dbserverversion: string, camserverversion: string, fwcode: number, database: string): Promise; /** * @example: * this.vhAuth.initializeBuildProject('vhsales','mongo', 'viethas', 'file', 'research', 'research', 324852, 'all') .then(()=>{ resolve(null); },error=>{ reject(error); }) * @param projectname * @param dbstorage: 'firebase', 'firebase-mongo', 'mongo', or 'mysqlphp' * @param imgstorage: 'firebase', 'viethas' or 'hosting' * @param tplstorage : nơi template sẽ được lưu trữ 'mongo', or 'file' * @param dbserverversion * @param camserverversion * @param fwcode * @param database : tất cả database 'all' hoặc một database nào đó '4wk3JMSwSjh4kOLWOMbLbWt0Rdk2' * @returns Promise */ initializeBuildProject(projectname: string, dbstorage: string, imgstorage: string, tplstorage: string, dbserverversion: string, camserverversion: string, fwcode: number, database: string): Promise; /** * @example: * this.vhAuth.initializeDesignProject('vhuserweb','mongo', 'viethas', 'mongo', 'research', 'research', 240...) .then(()=>{ resolve(null); },error=>{ reject(error); }) * @param projectname * @param dbstorage: 'firebase', 'firebase-mongo', or 'mongo' * @param imgstorage: 'firebase' or 'viethas' * @param tplstorage : nơi css sẽ được lưu trữ 'local', 'firebase', 'mongo' or 'file' * @param dbserverversion * @param camserverversion * @param fwcode * @returns Promise */ initializeDesignProject(projectname: string, dbstorage: string, imgstorage: string, tplstorage: string, dbserverversion: string, camserverversion: string, fwcode: number): any; /** * @example: * this.vhAuth.initializeWebAppProject('vhsales', 356842, 'all'); * @param projectname * @param fwcode * @param database : tất cả database 'all' hoặc một database nào đó '4wk3JMSwSjh4kOLWOMbLbWt0Rdk2' * @returns */ initializeWebAppProject(projectname: string, fwcode: number, database: string): any; /** * @example: * this.vhAuth.runOnMGDBServerVersion(); * @param url */ private runOnMGDBServerVersion; /** * @example: * this.vhAuth.runOnCamServerVersion(); * @param url */ private runOnCamServerVersion; /** * @example SET: * localStorageSET('local_name', {a=1, b='hai'}); * localStorageSET('local_name', 15000); * localStorageSET('local_name', 'muoi lam nghin dong'); * @returns */ localStorageSET(name: string, value: any): void; /** * @example GET: * let object = this.vhAuth.localStorageGET('local_name'); * @returns */ localStorageGET(name: string): any; /** * Hàm này dùng xóa tài khoản người dùng đã đăng nhập vào hệ thống * @example: * this.vhAuth.deleteUserAccount('huyleduc92') .then((bool:any)=>{ if(bool){ this.vhAuth.signOut(); }else{ console.log('Mật khẩu không đúng, vui lòng kiểm tra lại'); } },(error:any)=>{ console.log('error', error); }) * @param password * @returns */ deleteUserAccount(password: string): Promise; /** * @example: * this.vhAuth.signUpOwner('huyleduc92', '123456', '+84909925359',{}) .then((owner)=>{ console.log('signUpOwner', owner); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @param scode * @param info * @return Promise => owner={} */ signUpOwner(email: string, password: string, phoneNumber: string, info: object): Promise; /** * @example: * this.vhAuth.signUpMember('huyleduc92', '123456',{}) .then((rsp)=>{ if(rsp.vcode == 0){ //signUpMember thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @param info : Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => member={} * vcode = 0: 'succes' * vcode = 1: 'This phone number is already in use with another employee' */ signUpMember(email: string, password: string, phoneNumber: string, info: any): Promise; /** * @example: * this.vhAuth.signUpEndUser('huyleduc92', '123456',{}) .then(enduser=>{ console.log('signUpEndUser', enduser); },(error:any)=>{ console.log('error', error); }) * @param email * @param password * @param info * @return Promise => member={} */ signUpEndUser(email: string, password: string, phoneNumber: string, info: object): Promise; private getLocalMyPermission; /** * Hàm này chỉ dùng cho FW, Dev không dùng nhé * @returns */ refreshLocalMyPermission(): Promise; /** * 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 * Hàm checkMyPermission tương đương hàm checkLocalMyPermissionName, sau này sẽ bỏ hàm checkMyPermission * @example: if(this.vhAuth.checkMyPermission('login_enable_login')){ this.login(); } * @param permission_name * @param message * @return Boolean => true or false */ checkMyPermission(permission_name: any): boolean; /** * 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 * @example: if(this.vhAuth.checkLocalMyPermissionName('login_enable_login')){ this.login(); } * @param permission_name * @param message * @return Boolean => true or false */ checkLocalMyPermissionName(permission_name: any): boolean; /** * Hàm này chỉ trả về kết quả khi mà permission_name mà có giá trị không phải kiểu boolean, nếu là kiểu boolean hàm sẽ không trả kết quả về * @example: * let mypermissionname = this.vhAuth.getLocalMyPermissionName('default_display_page'); * @param permission_name * @return number/string/object */ getLocalMyPermissionName(permission_name: any): any; /** * @example: this.vhAuth.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false, default_display_page: 'admin_display_page'}) .then((result)=>{ console.log(result); }) * @format value = {login_enable_login:true} or value = {login_reset_password:true} * @param value * @return Promise Boolean => true or false */ updateMyPermission(value: any): Promise; /** * @example: this.vhAuth.updatePermission('2rVieBQTubQ2hjUnpwU4w7qSlD83',{login_enable_login: false}) .then((result)=>{ console.log(result); }) * @format value = {login_enable_login:true} or value = {login_reset_password:true} * @param value * @return Promise Boolean => true or false */ updatePermission(id_employee: string, value: object): Promise; /** * Hàm này lấy về phân quyền của nhân viên * 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 * @example: this.vhAuth.getPermission('5fccf8b675b75a1fc84342e9') .then((permission)=>{ console.log('permission', permission) },error => { console.log('error', error); }); * @return Promise => permission = {} or null */ getPermission(id_employee: any): any; publishObservableEventEmployees(): void; private observableLocalEmployees; /** * @example: * this.observableEmployee = this.vhAuth.getObservableLocalEmployees().subscribe((localEmployees:any) => { do something... }) ngOnDestroy(){ this.observableEmployee.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalEmployees(): Observable; /** * @Notice : hàm này Dev không được dùng * @example: * this.vhAuth.clearLocalEmployeeFromSyncCollection(); * @param id_employee * @return => void */ clearLocalEmployeeFromSyncCollection(): void; /** * @Notice : hàm này Dev không được dùng * @example: * let bool = this.vhAuth.deleteLocalEmployeeFromSyncCollection('5fb6780ca2148e09806c5b01'); * @param id_employee * @return => bool = true or false */ deleteLocalEmployeeFromSyncCollection(id_employee: any): boolean; /** * @Notice : hàm này Dev không được dùng * @example: * let bool = this.vhAuth.updateLocalEmployeeFromSyncCollection('5fb6780ca2148e09806c5b01',{name:'Nguyen Hoang Nam'}); * @param id_employee * @param data * @return => bool = true or false */ updateLocalEmployeeFromSyncCollection(id_employee: any, data: any): boolean; /** * @Notice : hàm này Dev không được dùng * @example: * let employee = this.vhAuth.insertlocalEmployeeFromSyncCollection({_id:'5fb6780ca2148e09806c5b01', name:'LE DUC HUY'}); * @param employee * @return => bool = true or false */ insertlocalEmployeeFromSyncCollection(employee: any): boolean; /** * @example: * let employee = this.vhAuth.getlocalEmployees('5fb6780ca2148e09806c5b01'); * @param id_employee * @return obj = {} or null */ getlocalEmployee(id_employee: any): any; /** * @example: * this.vhAuth.getlocalEmployee_Async('ETxNu8exrvGtXFjkIhnc') .then((employee)=>{ }, error=>{ console.log('error', error); }) * @param id_employee * @return Object => obj = {} or null */ private getlocalEmployee_Async; /** * @example: * let employees = this.vhAuth.getlocalEmployees(); * @return Array(object) => array = [{},{},...] */ getlocalEmployees(): any; /** * Hàm này refresh giá trị mới nhất cho hàm getlocalEmployees() trong localstorage * @return Promise => null */ refreshLocalEmployees(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhAuth.refreshLocalEmployees_Delete_Hidden() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCustomer(), getlocalCustomers() trong localstorage * @param type * @return Promise => null */ refreshLocalEmployees_Delete_Hidden(type: any): any; /** * @example: * this.vhAuth.updateEmployee('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateEmployee', bool); }) * @param id_employee * @param value * @return Promise => bool = true or false */ updateEmployee(id_employee: string, value: any): Promise; /** * @example: * this.vhAuth.deleteEmployee('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteEmployee', bool); }) * @param id_employee * @return Promise => bool = true or false */ deleteEmployee(id_employee: string): Promise; /** * @example * this.vhAuth.getEmployee('5fb67fda87c0f21d484cbdf3') .then((obj)=>{ console.log('getEmployee', obj); }) * @param id_employee * @return Promise => obj ={} or null */ getEmployee(id_employee: string): Promise; /** * @example * this.vhAuth.getEmployees() .then((array:any)=>{ console.log('getEmployees', array); }) * @return Promise => array(object) = [{},{},..] */ getEmployees(): Promise; /** * @example: * let employee = this.vhAuth.updateLocalEndUser('5fb6780ca2148e09806c5b01',{name:'Nguyen Hoang Nam'}); * @param id_enduser * @param data * @return obj = {} or null */ private updateLocalEndUser; /** * @example: * let enduser = this.vhAuth.getlocalEndUser('5fb6780ca2148e09806c5b01'); * @param id_enduser * @return obj = {} or null */ private getlocalEndUser; /** * @example: * let endusers = this.vhAuth.getlocalEndUsers(); * @return Array(object) => array = [{},{},...] */ private getlocalEndUsers; /** * Hàm này refresh giá trị mới nhất cho hàm refreshLocalEndUsers() trong localstorage * @return Promise => null */ private refreshLocalEndUsers; /** * @example: * this.vhAuth.updateEndUser('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateEndUser', bool); }) * @param id_enduser * @param data * @return Promise => bool = true or false */ updateEndUser(id_enduser: string, data: object): Promise; /** * @example: * this.vhAuth.deleteEndUser('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteEndUser', bool); }) * @param id_enduser * @return Promise => bool = true or false */ deleteEndUser(id_enduser: string): Promise; /** * @example * this.vhAuth.getEndUser('5fb67fda87c0f21d484cbdf3') .then((obj)=>{ console.log('getEndUser', obj); }) * @param id_enduser * @return Promise => obj ={} or null */ getEndUser(id_enduser: string): Promise; /** * @example * this.vhAuth.getEndUsers() .then((array:any)=>{ console.log('getEndUsers', array); }) * @return Promise => array(object) = [{},{},..] */ private getEndUsers; /** * @example * this.vhAuth.getEndUsers_byFields({name:{$eq:'name abc'}}, {},{},0) .then((endusers)=>{ console.log('getEndUsers_byFields', endusers); }) this.vhAuth.getEndUsers_byFields({eucode:{$eq:'45876542720'}}, {},{},0) .then((endusers)=>{ console.log('getEndUsers_byFields', endusers); }) * @param query * @param projection : {} * @param sort : {} * @param limit : 0 * @return Promise => array(object) = [{},{},..] */ getEndUsers_byFields(query: any, projection: object, sort: any, limit: number): Promise; /**chưa dùng đến */ private getExistedCurrencyFormat; syncExistedCurrencyFormat(): void; private getExistedTheme; /** * vhAuth * @param color * @returns */ private setTheme; syncExistedTheme(): void; changeThemeIcon(): void; /** * @example: * this.vhAuth.changeTheme(theme, event) * @param theme * @param event */ changeTheme(theme: any, event: any): void; /** * @example: * let theme = this.vhAuth.getThemeValue()) * @returns */ getThemeValue(): string | null; /** * @example: * this.vhAuth.getManualVideos(type:string) .then((manualvideos)=>{ console.log('manualvideos', manualvideos); },(error:any)=>{ console.log('error', error); }) */ getManualVideos(type: string): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhCamPlaybackComponent implements OnInit { private vhMGDB_clouds; private platform; private router; licensecam: any; filename: any; camplaybackURL: any; private _src; private camplayback; private randomId; private oldrandomId; constructor(vhMGDB_clouds: VhMGDB_clouds, platform: Platform, router: Router); ngOnChanges(what: any): void; ngOnInit(): void; playbackVideo(): void; ngOnDestroy(): void; feAdjustVideoPlaybackInFrame(frame: any, playbackRate: any): void; makePlaybackVideoByUser(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class VhCameraMSEVcomponent implements OnInit { private platform; private router; url: string; licensecam: any; camliveURL: any; poster: any; roomid: any; width: any; height: any; play: any; monitor: any; os: any; change: EventEmitter; private list_camera; private _src; private _video; private socket; private _run; private _first_time; private _play; private _count; _poster: any; private config; private mime; private video; private mediaSource; private buffer; private subscription_listenBuffer; private subscription_listenMediaSource; private randomId; private integer; constructor(platform: Platform, router: Router); ngOnInit(): void; ngOnChanges(what: any): void; ngOnDestroy(): void; private loadVideo; private startVideo; private stopVideo; private listenMediaSource; private listenBuffer; private getScreenshot; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class VhCameraH265Ccomponent implements OnInit { private platform; private router; url: string; licensecam: any; camliveURL: any; poster: any; roomid: any; width: any; height: any; play: any; monitor: any; os: any; change: EventEmitter; online: EventEmitter; detection: EventEmitter; private list_camera; private _src; private socket; private _run; _autoplay: any; private _play; private _poster; private config; private randomId; private player; private wsavc; private settimeout; constructor(platform: Platform, router: Router); ngOnInit(): void; ngOnChanges(what: any): void; ngOnDestroy(): void; private loadVideo; private startVideo; private stopVideo; private getScreenshot; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class VhCameraJSMPEGCcomponent implements OnInit { private platform; private router; url: string; licensecam: any; camliveURL: any; poster: any; roomid: any; width: any; height: any; play: any; monitor: any; os: any; change: EventEmitter; private list_camera; private _src; private socket; private _run; _autoplay: any; private _play; private _poster; private config; private randomId; private player; constructor(platform: Platform, router: Router); ngOnInit(): void; ngOnChanges(what: any): void; ngOnDestroy(): void; private loadVideo; private startVideo; private stopVideo; private getScreenshot; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class VhCameraIMGcomponent implements OnInit { private platform; private router; url: string; licensecam: any; camliveURL: any; poster: any; roomid: any; width: any; height: any; play: any; monitor: any; os: any; change: EventEmitter; private list_camera; _src: any; private socket; private _run; _autoplay: any; private _play; private _poster; private config; private randomId; constructor(platform: Platform, router: Router); ngOnInit(): void; ngOnChanges(what: any): void; ngOnDestroy(): void; private loadVideo; private startVideo; private stopVideo; private getScreenshot; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class VhHosting { private vhAlgorithm; private user; private signedin; private hostingURL; constructor(vhAlgorithm: VhAlgorithm); /** * @example: * this.vhHosting.forgotPasswordUser_byEmail('salesf110@gmail.com','h674567') .then(response=>{ console.log('response', response); if(response.vcode === 0){ //-----------your code 0----------- let user = response.data; }else if(response.vcode === 1){ //-----------your code 1----------- } },(error:any)=>{ console.log('error', error) }) * @param email * @param password * @return Promise object => response = {vcode, message} * vcode == 0: Message sent to email address successfully * vcode == 1: Email address does not exist */ forgotPasswordUser_byEmail(email: string, password: string): Promise; /** * @example: * this.vhHosting.changePasswordUser_byEmail('salesf110@gmail.com','h674567', 'V12345678') .then(response=>{ console.log('response', response); if(response.vcode === 0){ //-----------your code 0----------- let user = response.data; }else if(response.vcode === 1){ //-----------your code 1----------- }else if(response.vcode === 2){ //-----------your code 2----------- }else if(response.vcode === 3){ //-----------your code 3----------- } },(error:any)=>{ console.log('error', error) }) * @param email * @param oldpassword * @param newpassword * @return Promise object => response = {vcode, message} * vcode == 0: Message sent to email address successfully * vcode == 1: Email address does not exist * vcode == 2: wrong oldpassword * vcode == 3: please reset your password */ changePasswordUser_byEmail(email: string, oldpassword: string, newpassword: string): Promise; /** * @example: * this.vhHosting.signupEndUser_byEmail('salesf110@gmail.com','h674567',{}) .then(rsp=>{ console.log('signupEndUser_byEmail', rsp); if(rsp.vcode === 0){ //-----------your code 1----------- let enduser = rsp.data; }else if(rsp.vcode === 1){ //-----------your code 2----------- } },(error:any)=>{ console.log('error', error) }) * @param email * @param password * @param info : thông tin của enduser * @return Promise object => rsp = {vcode, message, data} * vcode == 0: User account registered successful * vcode == 1: User Email already exists * @notice : sau khi đăng ký thành công, người dùng phải vào email xác nhận xác nhận việc đăng ký này */ signupUser_byEmail(database: string, email: string, password: string, info: object): Promise; /** * @example: * this.vhHosting.signinUser_byEmail('salesf110@gmail.com','h674567') .then(response=>{ console.log('response', response); if(response.vcode === 0){ //-----------your code 0----------- let user = response.data; }else if(response.vcode === 1){ //-----------your code 1----------- }else if(response.vcode === 2){ //-----------your code 2----------- }else if(response.vcode === 3){ //-----------your code 3----------- }else if(response.vcode === 4){ //-----------your code 4----------- } },(error:any)=>{ console.log('error', error) }) * @param email * @param password * @return Promise object => response = {vcode, message, data} * vcode == 0: Signed in successfully * vcode == 1: Wrong email * vcode == 2: Please login into your email to confirm your account on my website or APP * vcode == 3: Please reset your password * vcode == 4: Wrong password */ signinUser_byEmail(email: string, password: string): Promise; /** * @example: * this.vhHosting.onAuthStateChangedUser() .then(response=>{ console.log('response', response); if(response.vcode === 0){ //-----------your code 0----------- let user = response.data; }else if(response.vcode === 1){ //-----------your code 1----------- }else if(response.vcode === 2){ //-----------your code 2----------- }else if(response.vcode === 3){ //-----------your code 3----------- }else if(response.vcode === 4){ //-----------your code 4----------- } },(error:any)=>{ console.log('error', error) }) * @return Promise object => response = {vcode, message} * vcode == 0: Signed in successfully * vcode == 1: wrong access_token->email * vcode == 2: wrong access_token->password * vcode == 3: Please login into your email to confirm your account on my website or APP * vcode == 4: Please reset your password */ onAuthStateChangedUser(): Promise; /** * @example * this.vhHosting.signoutUser(); * @return void */ signoutUser(database: string): void; /** * @example * let bool = this.vhHosting.checkLocalSigninUser(); * @return Boolean => true or false */ checkLocalSigninUser(): any; /** * @example: * let enduser = this.vhHosting.getLocalUser(); * @return object => obj = {} or null */ getLocalUser(): any; signUpUser(email: string, password: string, phoneNumber: string, info: object): Promise; signInUser(email: string, password: string): Promise; getToken(email: string, password: string): Promise; getProfile(token: string): Promise; getUser(token: string): Promise; /** * @example:Lấy hình file bất kỳ từ Desktop đẩy lên hosting * onUpload(e?) { const file = e.target.files[0]; this.vhHosting.uploadFileFromDesktop(file,"subdomain1.webappgiare.vn", "public_html") .then((rsp:any)=>{ console.log('rsp', rsp); if(rsp.vcode === 0){ }else if(rsp.vcode === 1){ }else if(rsp.vcode === 2){ }else if(rsp.vcode === 3){ } this.vhComponent.showToast(2000, (this.languageService.translate("File was loaded successfully"))); },error => { this.vhComponent.showToast(2000, (this.languageService.translate("File was failed"))); } ); } * @param file * @param hosting * @param oldFipathleURL : String * @notice * @returns Object => obj = {vcode, message, data} * vcode === 0 : upload file thành công * vcode === 1 : * vcode === 2 : * vcode === 3 : */ uploadFileFromDesktop(file: string, hosting: string, path: string): Promise; extractFile(hosting: string, path: string): Promise; reNewHosting(hosting: string): Promise; reSetHosting(hosting: string): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhImage { private vhMGDB_image; private imagePicker; private webview; private camera; constructor(vhMGDB_image: VhMGDB_image, imagePicker: ImagePicker, webview: WebView, camera: Camera); /** * @example:Lấy hình ảnh từ Camera thiết bị * this.vhImage.getThumbnailFromCamera(128, 128, "employees", this.img).then( photoURL => { this.img = photoURL; this.detailEmployee.controls["img"].setValue(photoURL); this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); this.updateEmployee(this.detailEmployee.value); }, () => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); * @param w * @param h * @param path: 'products' or 'data/products' * @param oldthumbnailURL * @returns */ getThumbnailFromCamera(w: any, h: any, path: any, oldthumbnailURL?: any): Promise; /** * @example:Lấy hình ảnh từ Album thiết bị * this.vhImage.getThumbnailFromAlbum(128, 128, "employees", this.img).then( photoURL => { this.img = photoURL; this.detailEmployee.controls["img"].setValue(photoURL); this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); this.updateEmployee(this.detailEmployee.value); }, () => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); * @param w * @param h * @param path: 'products' or 'data/products' * @param oldthumbnailURL * @returns */ getThumbnailFromAlbum(w: any, h: any, path: any, oldthumbnailURL?: any): Promise; /** * @example:Lấy hình ảnh từ Album thiết bị * this.vhImage.getImageFromAlbum("employees", this.img).then( photoURL => { this.img = photoURL; this.detailEmployee.controls["img"].setValue(photoURL); this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); this.updateEmployee(this.detailEmployee.value); }, () => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); * @param path: 'products' or 'data/products' * @param oldthumbnailURL * @returns */ getImageFromAlbum(path: any, oldthumbnailURL?: any): Promise; /** * @example:Lấy hình ảnh từ Desktop với kích thước tùy chỉnh * onUpload(e?) { const file = e.target.files[0]; this.vhImage.getThumbnailFromDesktop(file, 128, 128, "employees", this.img).then( photoURL => { this.img = photoURL; this.detailEmployee.controls["img"].setValue(photoURL); this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); this.updateEmployee(this.detailEmployee.value); } },error => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); } * @param file * @param w * @param h * @param path: 'products' or 'data/products' * @param oldthumbnailURL : String * @returns * @notice: trường hợp cập nhật hình ảnh, phải truyền vào hàm tham số oldthumbnailURL để xóa ảnh cũ đi, tránh làm server bị rác */ getThumbnailFromDesktop(file: any, w: any, h: any, path: any, oldthumbnailURL?: any): Promise; /** * @example:Lấy hình ảnh từ Desktop đẩy lên server với kích thước hình ko thay đổi * onUpload(e?) { const file = e.target.files[0]; this.vhImage.getImageFromDesktop(file,"employees", this.img) .then((rsp:any)=>{ console.log('rsp', rsp); if(rsp.vcode === 0){ this.img = rsp.data; this.detailEmployee.controls["img"].setValue(this.img); this.updateEmployee(this.detailEmployee.value); }else if(rsp.vcode === 1){ }else if(rsp.vcode === 2){ }else if(rsp.vcode === 3){ } this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); },error => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); } * @param file * @param path: 'products' or 'data/products' * @param oldthumbnailURL : String * * @param maxSize : file ảnh có dung lượng tối đa cho phép, đơn vị byte * @notice : trường hợp cập nhật hình ảnh, phải truyền vào hàm tham số oldthumbnailURL để xóa ảnh cũ đi, tránh làm server bị rác * @returns Object => obj = {vcode, message, data, error} * vcode === 0 : upload ảnh thành công * vcode === 1 : lỗi import file ảnh * vcode === 2 : lỗi upload file ảnh * vcode === 3 : không thể upload file ảnh lớn hơn maxSize (byte) * vcode === 4 : import file ảnh không đúng định dạng */ getImageFromDesktop(file: any, path: any, oldthumbnailURL?: any, maxSize?: any): Promise; /** * @example:Lấy hình ảnh từ Desktop đẩy lên server với kích thước hình theo options truyền vào * onUpload(e?) { const file = e.target.files[0]; this.vhImage.getImageFromDesktop_Autoweb(file,"images/database/categories", options) .then((rsp:any)=>{ console.log('rsp', rsp); if(rsp.vcode === 0){ if(options.compress_type == 'no-compress'){ }else if(options.compress_type == 'compress-screen'){ }else if(options.compress_type == 'compress-frame'){ } }else if(rsp.vcode === 1){ }else if(rsp.vcode === 2){ }else if(rsp.vcode === 3){ } this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); },error => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); } * @param file * @param path: 'images/database/categories' or 'images/database/categories/products' * @param options: {compress_type, resolution} * @field compress_type: * + 'no-compress': Không nén ảnh sau khi tải lên * + 'compress-screen': Nén ảnh sau khi tải lên, nén ảnh theo tỉ lệ màn hình của mỗi thiết bị * + 'compress-frame': Nén ảnh sau khi tải lên, nén ảnh theo tỉ lệ màn hình của mỗi khung hình thiết bị * @field resolution: {} hoặc {width, height} của màn hình hoặc {width, height} của khung hình * @returns Object => obj = {vcode, msg, data} hoặc error * vcode === 0 : upload ảnh thành công * vcode === 1 : lỗi import file ảnh * vcode === 2 : lỗi upload file ảnh * vcode === 3 : không thể upload file ảnh lớn hơn maxSize (byte) * vcode === 4 : import file ảnh không đúng định dạng */ getImageFromDesktop_Autoweb(file: any, path: any, options: any): Promise; /** * @example:Lấy hình file bất kỳ từ Desktop đẩy lên server với kích thước ko thay đổi * onUpload(e?) { const file = e.target.files[0]; this.vhImage.uploadFileFromDesktop(file,"employees", this.img) .then((rsp:any)=>{ console.log('rsp', rsp); if(rsp.vcode === 0){ this.img = rsp.data; this.detailEmployee.controls["img"].setValue(this.img); this.updateEmployee(this.detailEmployee.value); }else if(rsp.vcode === 1){ }else if(rsp.vcode === 2){ }else if(rsp.vcode === 3){ } this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); },error => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); } * @param file * @param path: 'documents' or 'data/documents' * @param oldFileURL : String * * @param maxSize : file có dung lượng tối đa cho phép, đơn vị byte * @notice : trường hợp cập nhật file, phải truyền vào hàm tham số oldFileURL để xóa file cũ đi, tránh làm server bị rác * @returns Object => obj = {vcode, message, data, error} * vcode === 0 : upload file thành công * vcode === 1 : lỗi import file * vcode === 2 : lỗi upload file * vcode === 3 : không thể upload file lớn hơn maxSize (byte) */ uploadFileFromDesktop(file: any, path: any, oldFileURL?: any, maxSize?: any): Promise; private uploadfile_danglam; /** * @example:Lấy hình ảnh từ url đẩy lên server với kích thước tùy chỉnh * onUpload(e?) { const file = e.target.files[0]; this.vhImage.getThumbnailFromUrl(file, 128, 128, "employees", this.img).then( photoURL => { this.img = photoURL; this.detailEmployee.controls["img"].setValue(photoURL); this.vhComponent.showToast(2000, (this.languageService.translate("Image was loaded successfully"))); this.updateEmployee(this.detailEmployee.value); } },error => { this.vhComponent.showToast(2000, (this.languageService.translate("Image was failed"))); } ); } * @param file * @param w * @param h * @param path: 'products' or 'data/products' * @param oldthumbnailURL : String * @returns * @notice: trường hợp cập nhật hình ảnh, phải truyền vào hàm tham số oldthumbnailURL để xóa ảnh cũ đi, tránh làm server bị rác */ getThumbnailFromUrl(url: any, w: any, h: any, path: any, oldthumbnailURL?: any): Promise; /** * @example:Lấy hình ảnh từ url đẩy lên server với kích thước hình ko thay đổi this.vhImage.getImageFromURL(url,"images/design/objects") .then((rsp:any)=>{ console.log('rsp', rsp); if(rsp.vcode === 0){ this.img = rsp.data; }else if(rsp.vcode === 1){ }else if(rsp.vcode === 2){ }else if(rsp.vcode === 3){ } },error => { } ); * @param file * @param path: 'images/database/products' or 'images/design/blocks' * @param oldthumbnailURL : String * * @notice : trường hợp cập nhật hình ảnh, phải truyền vào hàm tham số oldthumbnailURL để xóa ảnh cũ đi, tránh làm server bị rác * @returns Object => obj = {vcode, message, data, error} * vcode === 0 : upload ảnh thành công * vcode === 1 : lỗi import file ảnh * vcode === 2 : lỗi upload file ảnh * vcode === 3 : không thể upload file ảnh lớn hơn 1Mb */ getImageFromURL(url: any, path: any, oldthumbnailURL?: any): Promise; /** * Lấy hình ảnh từ url đẩy lên server với kích thước hình theo options truyền vào * @example: this.vhImage.getImageFromURL_Autoweb(url,"images/design/objects") .then((rsp:any)=>{ console.log('rsp', rsp); if(rsp.vcode === 0){ if(options.compress_type == 'no-compress'){ }else if(options.compress_type == 'compress-screen'){ }else if(options.compress_type == 'compress-frame'){ } }else if(rsp.vcode === 1){ }else if(rsp.vcode === 2){ }else if(rsp.vcode === 3){ } },error => { } ); * @param url: đường link ảnh (sống) tồn tại trên mạng internet * @param path: 'images/database/categories' or 'images/database/categories/products' * @param options: {compress_type, resolution} * @field compress_type: * + 'no-compress': Không nén ảnh sau khi tải lên * + 'compress-screen': Nén ảnh sau khi tải lên, nén ảnh theo tỉ lệ màn hình của mỗi thiết bị * + 'compress-frame': Nén ảnh sau khi tải lên, nén ảnh theo tỉ lệ màn hình của mỗi khung hình thiết bị * @field resolution: {} hoặc {width, height} của màn hình hoặc {width, height} của khung hình * @returns Object => obj = {vcode, msg, data} hoặc error * vcode === 0 : upload ảnh thành công * vcode === 1 : lỗi import file ảnh * vcode === 2 : lỗi upload file ảnh * vcode === 3 : không thể upload file ảnh lớn hơn maxSize (byte) * vcode === 4 : import file ảnh không đúng định dạng */ getImageFromURL_Autoweb(url: any, path: any, options: any): Promise; /** * @example:Lấy hình ảnh từ nút insertImange của toolbar của Ckeditor public onReady(editor: any): void { editor.ui .getEditableElement() .parentElement.insertBefore( editor.ui.view.toolbar.element, editor.ui.getEditableElement() ); editor.plugins.get('FileRepository').createUploadAdapter = ( loader: any ) => { return this.vhImage.MyUploadImageAdapter(loader,128, 128, "employees") }; } * @param file * @param w * @param h * @param path: 'products' or 'data/products' * @returns class * @notice: hàm này chỉ insert ảnh, muốn xóa ảnh phải vào trình quản lý ảnh */ MyUploadImageAdapter(loader: any, path?: any, w?: any, h?: any): MyUploadImageAdapter; /** * Lấy về danh sách thư mục, file trong thư mục định vị bởi đường dẫn path, số ảnh mỗi lần lấy về limit, và ở trang ảnh có số tứ tự là page * @example: this.vhImage.getImageFilenames("hinhanh/hinh") .then((rsp)=> { if(rsp.vcode ==0){ //your code here... } },(error:any)=>{ console.log('error', error); }) * @param path : folder gốc (root) truyền vào "", hoặc dạng folder1/folder2/folder2 * @returns Promise Array => array = {vcode, msg, data:[{name, type, path},{name, type, href}, limit, page, totalpages]; type = 0 là folder, type !=0 là file */ getImageFilenames(path: string, limit?: any, page?: any): Promise; /** * Lấy về danh sách thư mục, file trong thư mục định vị bởi đường dẫn path theo mảng số thứ ảnh imgsordinal trong đường dẫn thư mục * @example: this.vhImage.getImageFilenames_byImgsOrdinal("images/database/products", [0,1,2,3,4,5]) .then((rsp)=> { if(rsp.vcode ==0){ //your code here... } },(error:any)=>{ console.log('error', error); }) * @param path : folder gốc (root) truyền vào "", hoặc dạng folder1/folder2/folder2 * @returns Promise Array => array = {vcode, msg, data:[{name, type, path},{name, type, href}, imgsordinal, totalimgs]; type = 0 là folder, type !=0 là file */ getImageFilenames_byImgsOrdinal(path: string, imgsordinal: any): Promise; /** * Tạo thư mục mới trong thư mục định vị bởi đường dẫn path * @example: this.vhImage.createImageFolder("hinhanh", "hinh") .then((child_list)=> { //your code here... },(error:any)=>{ console.log('error', error); }) * @param path : folder gốc (root) truyền vào "", hoặc dạng folder1/folder2/folder2 * @param folder : tên thư mục * @returns Array => array = [{name, type, path},{name, type, href}]; type = 0 là folder, type !=0 là file */ createImageFolder(path: string, folder: string): Promise; /** * Xóa thư mục, file (đang có) trong thư mục định vị bởi đường dẫn path * @example: this.vhImage.deleteImageFolder("hinhanh", "hinh") .then((child_list)=> { //your code here... },(error:any)=>{ console.log('error', error); }) * @param path : folder gốc (root) truyền vào "", hoặc dạng folder1/folder2/folder2 * @param folder : tên thư mục * @returns Array => array = [{name, type, path},{name, type, href}]; type = 0 là folder, type !=0 là file */ deleteImageFolder(path: string, folder: string): Promise; /** * Đổi tên thư mục (đang có) trong thư mục định vị bởi đường dẫn path thành tên khác * @example: this.vhImage.renameImageFolder("hinhanh", "hinh") .then((child_list)=> { //your code here... },(error:any)=>{ console.log('error', error); }) * @param path : folder gốc (root) truyền vào "", hoặc dạng folder1/folder2/folder2 * @param folder : tên thư mục * @returns Array => array = [{name, type, path},{name, type, href}]; type = 0 là folder, type !=0 là file */ renameImageFolder(path: string, oldfolder: string, newfolder: string): Promise; /** * @example: * this.vhImage.deleteImage(thumbnailURL[i]) .then(()=> { //your code here... },(error:any)=>{ console.log('error', error); }) * @param imageURL * @returns */ deleteImage(imageURL: string): Promise; /** *@example this.vhImage.deleteThumbnail([url_img, url_img1]) .then(()=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param thumbnailURL : Array * @returns Promise => true or false : xóa thành công tất cả hình trong mảng về true, xóa không thành công hoặc link một hình sai trả về false */ deleteThumbnail(thumbnailURL: any): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuery { private vhMGDB_database; constructor(vhMGDB_database: VhMGDB_database); /** * @example * this.vhQuery.listener('abc',{}).subscribe((data:any)=>{ console.log('data', data); }) * @param colname * @param condition */ private listener; /** * @example: * this.vhQuery.addDoc('products', {name:'camera 2', quantity:20, price:200000}) .then((response)=>{ console.log('addDoc', response); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => object = {} * 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 */ addDoc(colname: string, data: object): Promise; /** * @example: * this.vhQuery.addDocbyID('products', 'nvliw974854hf848ugrgh3498', {name:'camera 2', quantity:20, price:200000}) .then((response)=>{ console.log('addDocbyID', response); }, error=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * Luu y: truong hop trung _id nó sẽ báo lỗi error */ addDocbyID(colname: string, _id: string, data: object): Promise; /** * @example: * this.vhQuery.updateDoc('products', '5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDoc', bool); }, error=>{ console.log('error', error); }) * @param colname * @param _id * @param data * @return Promise => bool = true or false */ updateDoc(colname: string, _id: string, data: object): Promise; /** * @example: * this.vhQuery.deleteDoc('products', '5fb67fda87c0f21d484cbdf3') .then(bool=>{ console.log('deleteDoc', bool); }) * @param colname * @param _id * @return Promise => bool = true or false */ deleteDoc(colname: string, _id: string): Promise; /** * @example * this.vhQuery.getDoc('products', '5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getDoc', product); },(error:any)=>{ console.log('error', error); }) * @param colname * @param _id * @return Promise => obj ={} or null */ getDoc(colname: string, _id: string): Promise; /** * @example * this.vhQuery.getDoc('products', '5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('getDoc', response); }) * @param colname * @param _id * @return array(object) = [{},{},..] */ getDocs(colname: string): Promise; /** * @example: * this.vhQuery.getDocsByFields('products', {name:{$eq:'name abc'}}, {},{},0) .then((products)=>{ console.log('getDocsByFields', products); }) * @param colname * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getDocsByFields(colname: string, query: object, projection?: object, sort?: object, limit?: number): Promise; /** let promise = new Array(); for(let i=0; i{}); } this.asyncPromiseAll(promise) .then((array:any)=>{ console.log(array); },(error:any)=>{ onsole.log(error); }) * @param array * @return Promise Array_Value => array =[value1, value2,...] */ asyncPromiseAll(array_Promise: any): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryCafe { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_rootdatabase; private vhMGDB_socketMongoDB; private vhMGDB_paymentVNPAY; private vhQuery; private vhAuth; private vhAlgorithm; private vhDisplayLEDService; private paymentIOS; private restriction_main_package; private areas; private tables; private products; private detailproducts; private rawproducts; private customers; private suppliers; private dispatcherzones; private wallets; private taxs; private categorys; private inventorytimes; private deliverys; private addresss; private incoming_groups; private spending_groups; private branchs; private promotions; private patternmenus; private printers; private print_pages; private discount_bills; private discount_saless; private customer_classs; private commissions; private hwinfo; private appsettingstations; private appsettingbranchs; private kitchendispatcherlist; private rawkitchendispatcherlist; private servicedispatcherlist; private warehousedispatcherlist; private subjectwallets; private subjectappsettingstations; private subjectappsettingbranchs; private subjectbranchs; private subjectcategorys; private subjectcustomers; private subjectinventorytimes; private subjectprinters; private subjectproducts; private subjectpromotions; private subjectsuppliers; private subjectdispatcherzones; private subjecttaxs; private subjectareas; private subjecttables; private subjectlistbilltype5; private syncLocalBillType5_start; private subjectdiscount_bills; private subjectcustomer_classs; private callbackdispatcher; private callbacksyncopeningbill; private listbill_bybilltype; private callback1syncbilltype; private callback2syncbilltype; private sync_code; private colname_array; /** * @Nghiệp vụ tạo (bill_type 5->1), hủy đơn hàng bán món ăn (dùng hàm) * {createBill, getBill} -> {createBill_detail, updateBill_detail, deleteBill_detail} -> {saveBill_Billdetail, deleteBill_Billdetail} * @Nghiệp vụ cập nhật hóa đơn bán hàng món ăn (dùng hàm) * {getBill, getBill_Billdetail} -> {updateBill_Billdetail} * @Nghiệp vụ tạo, cập nhật, hủy đơn xuất nhập nguyên liệu (dùng hàm) * {createBill_Billdetail} -> {updateBill_Billdetail, deleteBill_Billdetail} */ 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); /** * Hàm trả về năm của billdate * @param billdate * @returns */ private getYear; /** * 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 * @returns */ private getYearsArray; /** * 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, * nếu trong query không có trường date thì lấy từ hàm getYearsArray() * @param query * @returns */ private getYearsArray_fromQuery; /** * 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 * @example: * let branch_management_scope = this.vhQueryCafe.getBranch_Management_Scope(); * @return Object = {product_scope, employee_scope, customer_scope, supplier_scope, cafe_program_scope} * => true áp dụng cho toàn chi nhánh, false áp dụng riêng cho từng chi nhánh */ getBranch_Management_Scope(): any; /** * 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 * @example: * this.vhQueryCafe.updateBranch_Management_Scope({product_scope:1, employee_scope:1, customer_scope:1, supplier_scope:1, sales_program_scope:2}) .then(()=>{ console.log('updateBranch_Management_Scope'); }, error=>{ reject(error); }) * @param value = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope} * true áp dụng cho toàn chi nhánh, false áp dụng riêng cho từng chi nhánh * @return Promise => udefined/error */ updateBranch_Management_Scope(value: any): Promise; /** * @description: hàm này lấy về những hạn chế của gói main_package trong localstorage * @example * let restriction_main_package = this.vhQueryCafe.getLocalRestrictionMainPackage(); * @return Object => obj ={} or null */ getLocalRestrictionMainPackage(): any; /** * @example: this.vhQueryCafe.syncCollections_Mobile().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Mobile(): Promise; /** * @example: this.vhQueryCafe.syncCollections_Desktop().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Desktop(): Promise; private checkExpireBranch_Cafe; private checkExpireBranch_Sales365; /** * @example: this.vhQueryCafe.syncCollections_Sales365_Mobile().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Sales365_Mobile(): Promise; /** * @example: this.vhQueryCafe.syncCollections_Sales365_Desktop().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Sales365_Desktop(): Promise; /** * vhQueryCafe * Hàm này lấy về tất cả các collections mà firebase lưu trong cache ứng dụng, dữ liệu trong cache này dùng ko mất phí * @returns */ private getLocalLiveIndexDB; private initSyncCollections; /** * @example: * this.vhQueryCafe.closeSyncCollections(); * disconnect collections synchronization in the APP * @returns void */ closeSyncCollections(): void; /** * 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 * (3 loại dữ liệu local đc fw sử dụng để tính toán hoặc trả về cho frontend khi cần), dùng cho type =3 * @example: * this.syncRaw_Detail_ProductInsert(obj); * @param obj */ private syncRaw_Detail_ProductInsert; /** * VhQueryCafe */ private syncRaw_Detail_ProductUpdate; /** * VhQueryCafe * @returns */ private callbackCollectionInsert; /** * VhQueryCafe * @returns */ private callbackCollectionUpdate; /** * VhQueryCafe * @returns */ private callbackCollectionDelete; /** * VhQueryCafe * @returns */ initChatToAppCare(): Promise; /** * VhQueryCafe * @returns */ listeningChatToAppCare_Insert(): Observable; /** * VhQueryCafe * @returns */ listeningChatToAppCare_Update(): Observable; /** * * @param limit VhQueryCafe * @returns */ getOldMessages(limit: number): Promise; /** * @example: this.vhQueryCafe.sendMessageToAppCare('hello' ).then((res:any) => { }); * @param message */ sendMessageToAppCare(message: any): Promise; /** * @example: this.vhQueryCafe.sendMessageToAppCare('hello' ).then((res:any) => { }); * @param message */ sendImageToAppCare(image: string): Promise; startLocalStorage(): Promise; /** * Hàm này dùng để đồng bộ với dữ liệu điều phối ứng với khu vực điều phối id_dispatcherzone * @example: * this.vhQueryCafe.observableDispatcher('5fb6780ca2148e09806c5b01') .subscribe((data)=> { console.log('observableDispatcher', data); },(error:any) => { console.log(error); }) * @param id_dispatcherzone * @returns Observable => data * @notice : nhớ đóng closeDispatcher() khi thoát trang hiện tại this.vhQueryCafe.closeDispatcher(); */ observableDispatcher(id_dispatcherzone: any): Observable; /** * @example: * this.vhQueryCafe.initDispatcher(); * Initialize dispatcher in the APP * @returns Promise => true or false */ private initDispatcher; /** * @example: * this.vhQueryCafe.closeDispatcher(); * disconnect dispatcher in the APP * @returns void */ closeDispatcher(): void; /** * @example: * this.vhQueryCafe.doneDispatcher('5fb6780ca2148e09806c5b01') .then((bool:any)=>{ console.log('doneDispatcher', bool); }, error=>{ console.log('error', error); }) * @param id_billdetail * @param data * @return Promise => bool = true or false */ doneDispatcher(id_billdetail: string): Promise; /** * @example: * this.vhQueryCafe.callbackDispatcher(1) .subscribe((data)=> { console.log('callbackDispatcher', data); },(error:any) => { console.log(error); }) * @param ptype = 1: kitchen; 2: service; 3: warehouse * @returns Observable =>{bills_takeaway: new Array(), bills_table: new Array(), products: new Array()} */ private callbackDispatcher; /** * @example: * this.vhQueryCafe.listeningDispatcher_Insert() .subscribe((data)=> { console.log(data); },(error:any) => { console.log(error); }) * @returns Observable (callback) */ private listeningDispatcher_Insert; /** * @example: * this.vhQueryCafe.listeningDispatcher_Update() .subscribe((data)=> { console.log(data); },(error:any) => { console.log(error); }) * @returns Observable (callback) */ private listeningDispatcher_Update; /** * @example: * this.vhQueryCafe.listeningDispatcher_Delete() .subscribe((data)=> { console.log(data); },(error:any) => { console.log(error); }) * @returns Observable (callback) */ private listeningDispatcher_Delete; private refreshKitchenDispatcherList; private refreshWarehouseDispatcherList; private refreshServiceDispatcherList; private publishObservableEventAreas; private observableLocalAreas; /** * @example: this.observableArea = this.vhQueryCafe.getObservableLocalAreas().subscribe((localAreas:any) => { }) ngOnDestroy(){ this.observableArea.unsubscribe(); } * @returns */ getObservableLocalAreas(): Observable; /** * @example: * let area = this.vhQueryCafe.getlocalArea('5fb6780ca2148e09806c5b01'); * @param id_area * @return Object => obj = {} or null */ getlocalArea(id_area: any): any; /** * @example * let areas = this.vhQueryCafe.getlocalAreas(); * @return Array(object) => array = [{},{},...] */ getlocalAreas(): any; /** * @example: * this.vhQueryCafe.refreshLocalAreas() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalArea(), getlocalAreas() trong localstorage * @return Promise => null */ refreshLocalAreas(): any; /** * @example: * this.vhQueryCafe.addArea({name:'Khu vực 2', id_branch:'j7H8FADQlxQWB0pPq4Qt', status:true}) .then((are)=>{ console.log('addArea', area); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} * 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 */ addArea(data: object): Promise; /** * @example: * this.vhQueryCafe.updateArea('5fb6780ca2148e09806c5b01', {name: 'Khu vực sảnh'}) .then((bool:any)=>{ console.log('updateArea', bool); }, error=>{ console.log('error', error); }) * @param id_area * @param data * @return Promise => bool = true or false */ updateArea(id_area: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteArea('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteArea', bool); }, error=>{ reject(error) }) * @param id_area * @return Promise => bool = true or false */ deleteArea(id_area: string): Promise; /** * @example * this.vhQueryCafe.getArea('5fb67fda87c0f21d484cbdf3') .then((area)=>{ console.log('getArea', area); }) * @param id_area * @return false or object */ getArea(id_area: string): Promise; /** * @example * this.vhQueryCafe.getAreas() .then((response)=>{ console.log('getAreas', response); }) * @return array(object) = [{},{},..] */ getAreas(): Promise; /** * @example: * this.vhQueryCafe.addAdss({name:name: 'Quảng cáo 1'}) .then((ads)=>{ console.log('addAdss', ads); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} * 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 */ addAdss(data: object): Promise; /** * @example: * this.vhQueryCafe.updateAds('5fb6780ca2148e09806c5b01', {name: 'Quảng cáo 1'}) .then((bool:any)=>{ console.log('updateAds', bool); }, error=>{ console.log('error', error); }) * @param id_ads * @param data * @return Promise => bool = true or false */ updateAds(id_ads: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteAds('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteAds', bool); }, error=>{ reject(error) }) * @param id_ads * @return Promise => bool = true or false */ deleteAds(id_ads: string): Promise; /** * @example * this.vhQueryCafe.getAds('5fb67fda87c0f21d484cbdf3') .then((ads)=>{ console.log('getAds', ads); }) * @param id_ads * @return false or object */ getAds(id_ads: string): Promise; /** * @example * this.vhQueryCafe.getAdss() .then((adss)=>{ console.log('getAdss', adss); }) * @return array(object) = [{},{},..] */ getAdss(): Promise; /** * @example * this.vhQueryCafe.getAdss_byFields({quantity:{$gte:10}}, {}, {}, 0) .then((adss)=>{ console.log('getAdss_byFields', adss); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getAdss_byFields(query: any, projection?: object, sort?: any, limit?: number): Promise; private publishObservableEventTables; private observableLocalTables; /** * @example: this.observableTable = this.vhQueryCafe.getObservableLocalTables().subscribe((localTables:any) => { }) ngOnDestroy(){ this.observableTable.unsubscribe(); } * @returns */ getObservableLocalTables(): Observable; /** * @example: * let table = this.vhQueryCafe.getlocalTable('5fb6780ca2148e09806c5b01'); * @param id_table * @return Object => obj = {} or null */ getlocalTable(id_table: any): any; /** * @example * let tables = this.vhQueryCafe.getlocalTables(); * @return Array(object) => array = [{},{},...] */ getlocalTables(): any; /** * @example: * this.vhQueryCafe.refreshLocalTables() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalTable(), getlocalTables() trong localstorage * @return Promise => null */ refreshLocalTables(): any; /** * @example: * this.vhQueryCafe.addTable({name:'Bàn 2', id_area:'hou9080asdfasdfashf', id_branch:'j7H8FADQlxQWB0pPq4Qt', status:false}) .then((table)=>{ console.log('addTable', table); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} * 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 */ addTable(data: object): Promise; /** * @example: * this.vhQueryCafe.updateTable('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateTable', bool); }, error=>{ console.log('error', error); }) * @param id_table * @param data * @return Promise => bool = true or false */ updateTable(id_table: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteTable('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteTable', bool); }, error=>{ reject(error) }) * @param id_table * @return Promise => bool = true or false */ deleteTable(id_table: string): Promise; /** * @example * this.vhQueryCafe.getTable('5fb67fda87c0f21d484cbdf3') .then((table)=>{ console.log('table', table); }) * @param id_table * @return false or object */ getTable(id_table: string): Promise; /** * @example * this.vhQueryCafe.getTables() .then((response)=>{ console.log('getTables', response); }) * @return array(object) = [{},{},..] */ getTables(): Promise; private publishObservableEventProducts; private observableLocalProducts; /** * @example: * this.observableProduct = this.vhQueryCafe.getObservableLocalProducts(1).subscribe((localProducts:any) => { do something... }) ngOnDestroy(){ this.observableProduct.unsubscribe(); } * @param type = 1 là món, = 2 là dịch vụ, = 3 là nguyên liệu, = 4 là topping, = 13 là món và nguyên liệu, ko truyền vào hoặc giá trị khác là cả ba * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalProducts(type?: any): Observable; private getlocalProductAndCombosAndToppings; /** * @example: * let product = this.vhQueryCafe.getlocalProduct('5fb6780ca2148e09806c5b01'); * @param id_product * @return Object => obj = {} or null */ private getlocalProduct1; /** * @example * let products = this.vhQueryCafe.getlocalProducts(); * @param type = 1 là món, = 2 là dịch vụ, = 3 là nguyên liệu, = 4 là topping, = 5 là combo, = 13 là món và nguyên liệu, * = 145 là món, topping và combo, ko truyền vào hoặc giá trị khác là cả ba * @return Array(object) => array = [{},{},...] */ private getlocalProducts1; /** * @example: * this.vhQueryCafe.refreshLocalProduct('5fb6780ca2148e09806c5b01') .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProduct() trong localstorage * @return Promise => null */ refreshLocalProduct(id_product: string): any; /** * @example: * this.vhQueryCafe.refreshLocalProducts() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProduct(), getlocalProducts() trong localstorage * @return Promise => null */ refreshLocalProducts(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhQueryCafe.refreshLocalProducts_Delete_Hidden(3) .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProduct(), getlocalProducts() trong localstorage * @param type * @return Promise => null */ refreshLocalProducts_Delete_Hidden(type: any): any; /** * @example: * this.vhQueryCafe.addProduct({name:'camera 2', quantity:20, price:200000}) .then((product)=>{ console.log('addProduct', product); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} * 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 */ addProduct(data: any): Promise; /** * @example: * this.vhQueryCafe.addProducts([{name:'Nguyên liệu 1', quantity:20, price:200000},{},...]) .then((products)=>{ console.log('addProducts', products); }, error=>{ console.log('error', error); }) * @param data : array(object) * @return Promise => array = [{},{},...] * 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 */ addProducts(data_array: any): Promise; /** * @example: * this.vhQueryCafe.updateProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param value * @return Promise => bool = true or false */ updateProduct(id_product: string, value: object): Promise; /** * @example: * this.vhQueryCafe.deleteProduct('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDoc', bool); }, error=>{ reject(error) }) * @param id_product * @return Promise => bool = true or false */ deleteProduct(id_product: string): Promise; /** * @example * this.vhQueryCafe.getProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getProduct', product); }) * @param id_product * @return false or object */ getProduct(id_product: string): Promise; /** * @example * this.vhQueryCafe.getProducts() .then((response)=>{ console.log('getProducts', response); }) * @return array(object) = [{},{},..] */ getProducts(): Promise; /** * Hàm lấy chi tiết sản phẩm dựa vào id sản phẩm hoặc id sản phẩm con * @example * this.vhQueryCafe.getDetailProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getDetailProduct', product); }) * @param id_product * @return null or object */ private getDetailProduct; /** * Hàm này thêm topping vào món ăn/ thức uống * @example: * let dataArray = [{ id_product: 'DGBzFiK22KgY09UBY7JU', quantity: 1, price: 0, ratio: 1 }] * this.vhQueryCafe.addToppingsProduct('5fb6780ca2148e', data) .then((toppings)=>{ console.log('addToppingProduct', toppings); }, error=>{ console.log('error', error); }) * @param id_product * @param dataArray * @return Promise => object = {id_product, quantity, price, ratio} * 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 */ addToppingsProduct(id_product: any, dataArray: any): Promise; private addToppingsProduct_old; /** * Hàm này cập nhật lại topping trong món ăn/ thức uống * this.vhQueryCafe.updateToppingProduct('kgVZB4OveSOqlKBiDBPV','56s46ww54HFG3H265', {quantity: 2}) .then((bool:any)=>{ console.log('updateToppingProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param id_toppingproduct * @param value * @return Promise => bool = true or false */ updateToppingProduct(id_product: string, id_toppingproduct: string, value: any): Promise; /** * Hàm này xóa topping trong món ăn/ thức uống * @example: * this.vhQueryCafe.deleteToppingProduct('5fb67fda87c0f21d484cbdf3', 'jhit98q2rhfn9q38900913fr') .then((bool:any)=>{ console.log('deleteToppingProduct', bool); }, error=>{ reject(error) }) * @param id_product * @param id_toppingproduct * @return Promise => bool = true or false */ deleteToppingProduct(id_product: string, id_toppingproduct: any): Promise; /** * @example: * this.vhQueryCafe.addCombosProduct('5fb6780ca2148e',[{id_product:'rtw554b5634573456', id_subproduct: 'gty3456ygw454287', quantity:2, price: 20000, type: 1},{},..]) .then((combos)=>{ console.log('addCombosProduct', combos); }, error=>{ console.log('error', error); }) * @param id_product * @param dataArray : array * @return Promise => object = [{id_product, name, price},{},...] hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addCombosProduct(id_product: any, dataArray: any): Promise; /** * @example: * this.vhQueryCafe.updateComboProduct('5fb6780ca2148e', 'rtw554b5634573456', {name:'Cơm chiên (nhỏ)', quantity: 2, price: 20000}) .then((bool:any)=>{ console.log('updateCombo', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateComboProduct(id_product: string, id_comboproduct: string, data: any): Promise; /** * @example: * this.vhQueryCafe.addSubProduct('5fb6780ca2148e09806c5b01',{acive:true, price:0, name:'small'}) .then((subproduct)=>{ console.log('addSubProduct', subproduct); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} or null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ private addSubProduct; /** * @example: * this.vhQueryCafe.addSubsProduct('5fb6780ca2148e09806c5b01',[{price:0, name:'small'},{},...]) .then((subproducts)=>{ console.log('addSubsProduct', subproducts); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addSubsProduct(id_product: any, dataArray: any): Promise; /** * @example: * this.vhQueryCafe.updateProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param id_subproduct * @param data * @return Promise => bool = true or false */ updateSubProduct(id_product: string, id_subproduct: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteSubProduct('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDoc', bool); }, error=>{ reject(error) }) * @param id_product * @param id_subproduct * @return Promise => bool = true or false */ deleteSubProduct(id_product: string, id_subproduct: string): Promise; /** * *************************************** HÀM MỚI CAFE ****************************************** */ /** * Hàm này lấy về 1 unit của sản phẩm theo ratio truyền vào * @example * let unit = this.vhQueryCafe.getUnit_byRatio(1); * @param units * @param ratio * @return Object => obj = {} hoặc null */ getUnit_byRatio(units: any, ratio: number): any; /** * @example: new * let product = this.vhQueryCafe.getlocalProduct('5fb6780ca2148e09806c5b01'); * @param id_product * @return Object => obj = {} or null */ getlocalProduct(id_product: any): any; /** * @example new * let products = this.vhQueryCafe.getlocalProducts(); * @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 * @return Array(object) => array = [{},{},...] */ getlocalProducts(type?: any): any[]; /** * Hàm này lấy về tất cả detailproducts theo type của sản phẩm * @example * let detailproducts = this.vhQueryCafe.getlocalDetailProducts(); * @param type = 1 là sản phẩm, = 2 là dịch vụ, = 5 là combo, =12 là sản phẩm và dịch vụ, giá trị khác hoặc trống là cả 3 (lấy về tất cả sản phẩm) * @return Array(object) => array = [{},{},...] */ getlocalDetailProducts(type?: any): any[]; /** * 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 * @example * let id_sub_or_product = id_subproduct?id_subproduct:id_product; * let detailproduct = this.vhQueryCafe.getlocalDetailProduct('ETxNu8exrvGtXFjkIhnc'); * @param id_sub_or_product : id_subproduct hoặc id_product * @return Object => obj = {} hoặc null */ getlocalDetailProduct(id_sub_or_product: string): any; /** * @example: * this.vhQueryCafe.getlocalDetailProduct_Async('ETxNu8exrvGtXFjkIhnc') .then((detailproduct)=>{ }, error=>{ console.log('error', error); }) * @param data : object * @return Promise => object or null */ private getlocalDetailProduct_Async; /** * Hàm kiểm tra và đồng bộ các sản phẩm trong bill_details (chi tiết hóa đơn) * @example: * this.vhQueryCafe.syncBillDetails_Products(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Products; /** * Hàm kiểm tra và đồng bộ các khách hàng trong bill_details (chi tiết hóa đơn), đảm bảo khách hàng trong bill_detail đã tồn tại trong local * @example: * this.vhQueryCafe.syncBillDetails_Customers(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Customers; /** * Hàm kiểm tra và đồng bộ các nhà cung cấp trong bill_details (chi tiết hóa đơn), đảm bảo nhà cung cấp trong bill_detail đã tồn tại trong local * @example: * this.vhQueryCafe.syncBillDetails_Suppliers(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Suppliers; /** * Hàm kiểm tra và đồng bộ các sản phẩm trong bill_details (chi tiết hóa đơn), đảm bảo nhân viên trong bill_detail đã tồn tại trong local * @example: * this.vhQueryCafe.syncBillDetails_Employees(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Employees; /** * Hàm này tìm, kiểm tra barcode bất kỳ có tồn tại không, nếu có thì trả về 1 detailproduct, nếu ko thì trả về null * Hàm này dùng trong 2 trường hợp: * - Tìm kiếm sản phẩm có mã là barcode (dùng máy quét tìm sản phẩm đưa vào bill_detail) * - Kiểm tra xem đã tồn tại sản phẩm có mã là barcode chưa (khi thêm, sửa sản phẩm) * @example * let detailproduct = this.vhQueryCafe.getlocalDetailProduct_byBarcode('121212'); * @param barcode * @return Object => obj = [{},{},...] hoặc null */ getlocalDetailProduct_byBarcode_Cafe(barcode: string): any; /** * @example: * this.vhQueryCafe.addProduct({name:'camera 2', quantity:20, price:200000}) .then((product)=>{ console.log('addProduct', product); }, error=>{ console.log('error', error); }) * @param data : object * @return Promise => object = {} * 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 */ addProduct_Cafe(data: any): Promise; /** * @example: * this.vhQueryCafe.updateProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateProduct_Cafe(id_product: string, value: any): Promise; /** * @example: * this.vhQueryCafe.deleteProduct_Cafe('5fb67fda87c0f21d484cbdf3') .then((rsp)=>{ if(rsp.vcode === 0){ //-----------your code 0----------- }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } }, error=>{ reject(error) }) * @param id_product * @return Observable object => rsp = {vcode, message} * vcode == 0: xóa thành công * vcode == 1: Bạn không thể xóa, vì sản phẩm đang liên kết với sản phẩm combo khác * vcode == 2: Bạn không thể xóa, vì sản phẩm này đã phát sinh hóa đơn * vcode == 3: Bạn không thể xóa, bạn phải xóa các thuộc tính của sản phẩm trước */ deleteProduct_Cafe(id_product: string): Promise; /** * @example: * this.vhQueryCafe.addCombosProduct('5fb6780ca2148e',[{id_product:'rtw554b5634573456', id_subproduct: 'gty3456ygw454287', quantity:2, price: 20000, type: 1},{},..]) .then((combos)=>{ console.log('addCombosProduct', combos); }, error=>{ console.log('error', error); }) * @param id_product * @param dataArray * @return Promise => object = [{id_product, name, price},{},...] hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addCombosProduct_Cafe(id_product: any, dataArray: any): Promise; /** * @example: * this.vhQueryCafe.updateComboProduct('5fb6780ca2148e', 'rtw554b5634573456', {name:'Cơm chiên (nhỏ)', quantity: 2, price: 20000}) .then((bool:any)=>{ console.log('updateCombo', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateComboProduct_Cafe(id_product: string, id_comboproduct: string, data: any): Promise; /** * hàm này tạo product và thêm subs vào product (lần đầu) * Lưu ý: trong product, subProductArray không có các trường quantity, quantity_branch và subs * @example: * @case 1: manysize (false) * let product = { allow_sell: true, brand: "OEM", tax: 0, id_category: "vTr90aYfhDqSCyuRh4DR", img: "image link", manysize: false, name: "test ko sub 3", selling: true, type: 1, warning_number: 3, item_code: '', units:[{ barcode: "3103", price: 3100, price2: 3101, price_import: 3102, ratio: 1, unit: "Cái" }] * } * @case 2: manysize (true) * let product = { allow_sell: true, brand: "OEM", tax: 0, id_category: "vTr90aYfhDqSCyuRh4DR", img: "image link", manysize: true, name: "test sub 4", selling: true, type: 1, warning_number: 3, item_code: '', units:[{ ratio: 1, unit: "Cái" },{ barcode: "4203", price: 4200, price2: 4101, price_import: 4202, ratio: 10, unit: "Hộp" }] } let subProductArray = [{ barcode: "43004", name: "Lớn", price: 43000, price2: 43002, price_import: 43001, warning_number: 43003, item_code: '' }] * this.vhQueryCafe.addProductAndSubsProduct_Cafe(product,subProductArray) .then(()=>{ console.log('addProductAndSubsProduct'); }, error=>{ console.log('error', error); }) * @param product * @param subProductArray * @return Promise => object(product) * Promise => object = {} Luu ý: chỉ có 2 trường hợp, hoặc là tạo thành công, hoặc là báo lỗi error */ addProductAndSubsProduct_Cafe(product: any, subProductArray: any): Promise; /** * Hàm này cập nhật lại những thay đổi trong sub (cỡ) của sản phẩm * @example: * this.vhQueryCafe.updateSubProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateSubProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param id_subproduct * @param data * @return Promise => bool = true or false */ updateSubProduct_Cafe(id_subproduct: string, value: any): Promise; /** * Hàm này thêm Sub vào Product * @example: * let subProduct ={ allow_sell: true, manylot: true, name: "Lớn", selling: true, type: 1, warning_number: 5, item_code: '', units:[{ barcode: "384807544448", default: true, price: 70000, price2: 60000, price_import: 50000, ratio: 1, unit: "Cái" }], days_exp_warning: 30, days_import_warning: 60, lots:[{ _id: "tgwOaMDVmQaHfaL8FD02SMl9" barcode: "337953449785" date_exp: 'October 7, 2022 at 11:59:59 PM UTC+7' date_mfg: 'March 1, 2022 at 12:00:00 AM UTC+7' hidden: false lot_number: "lo1101" }] } * this.vhQueryCafe.addSubProduct('5fb6780ca2148e09806c5b01',{price:0, name:'small'}) .then((subproduct)=>{ console.log('addSubProduct', subproduct); }, error=>{ console.log('error', error); }) * @param id_product * @param subProduct * @return Promise => null hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về null (resolve), hoặc là thất bại trả về error (reject) */ addSubProduct_Cafe(id_product: string, subProduct: any): Promise; /** * Hàm này thêm Lot vào Product * @example: * let lot:{ barcode: "337953449785", date_exp: new Date('October 7, 2022 at 11:59:59 PM UTC+7'), date_mfg: new Date('March 1, 2022 at 12:00:00 AM UTC+7'), hidden: false, lot_number: "lo1101" } * this.vhQueryCafe.addLotProduct('5fb6780ca2148e09806c5b01',lot) .then(()=>{ console.log('addLotProduct'); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param lot * @return Promise => newlot (lot có _id) hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về newlot (resolve), hoặc là thất bại trả về error (reject) */ addLotProduct_Cafe(id_sub_or_product: string, lot: any): Promise; /** * @example: * this.vhQueryCafe.deleteLotProduct('5fb67fda87c0f21d484cbdf3', 'NdbCy50cz5nNQyFVtITS') .then((rsp)=>{ if(rsp.vcode === 0){ //-----------your code 0----------- }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } }, error=>{ reject(error) }) * @param id_sub_or_product * @param id_lotproduct * @return Promise object => rsp = {vcode, message} * vcode == 0: xóa thành công * vcode == 1: Bạn không thể xóa, vì lô sản phẩm này không tồn tại * vcode == 2: Bạn không thể xóa, vì lô sản phẩm này đã phát sinh hóa đơn */ deleteLotProduct_Cafe(id_sub_or_product: string, id_lotproduct: string): Promise; /** * this.vhQueryCafe.updateLotProduct('5fb6780ca2148e09806c5b01','56s46ww54HFG3H265', {barcode: '13464160156465'}) .then((bool:any)=>{ console.log('updateLotProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param id_lotproduct * @param value * @return Promise => bool = true or false */ updateLotProduct_Cafe(id_sub_or_product: string, id_lotproduct: string, value: any): Promise; /** * Hàm này thêm Subs vào Product * @example: * this.vhQueryCafe.addSubsProduct('5fb6780ca2148e09806c5b01',[{price:0, name:'small'},{},...]) .then((subproducts)=>{ console.log('addSubsProduct', subproducts); }, error=>{ console.log('error', error); }) * @param id_product * @param subProductArray * @return Promise => null hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về null (resolve), hoặc là thất bại trả về error (reject) */ private addSubsProduct_Cafe; /** * @example: * this.vhQueryCafe.deleteSubProduct('5fb67fda87c0f21d484cbdf3') .then((rsp)=>{ if(rsp.vcode === 0){ //-----------your code 0----------- }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } }, error=>{ reject(error) }) * @param id_subproduct * @return Promise object => rsp = {vcode, message} * vcode == 0: xóa thành công * vcode == 1: Bạn không thể xóa, vì sản phẩm con này đang liên kết với sản phẩm combo khác * vcode == 2: Bạn không thể xóa, vì sản phẩm con này đã phát sinh hóa đơn */ deleteSubProduct_Cafe(id_subproduct: string): Promise; private publishObservableEventCustomers; private observableLocalCustomers; /** * @example: * this.observableCustomer = this.vhQueryCafe.getObservableLocalCustomers().subscribe((localCustomers:any) => { do something... }) ngOnDestroy(){ this.observableCustomer.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCustomers(): Observable; /** * @example: * let customer = this.vhQueryCafe.getlocalCustomer('5fb6780ca2148e09806c5b01'); * @param id_customer * @return Object => obj = {} or null */ getlocalCustomer(id_customer: any): any; /** * @example: * this.vhQueryCafe.getlocalCustomer_Async('ETxNu8exrvGtXFjkIhnc') .then((customer)=>{ }, error=>{ console.log('error', error); }) * @param id_customer * @return Object => obj = {} or null */ private getlocalCustomer_Async; /** * @example: * let customers = this.vhQueryCafe.getlocalCustomers(); * @return Array(object) => array = [{},{},...] */ getlocalCustomers(): any; /** * @example: * this.vhQueryCafe.refreshLocalCustomers() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCustomer(), getlocalCustomers() trong localstorage * @return Promise => null */ refreshLocalCustomers(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhQueryCafe.refreshLocalCustomers_Delete_Hidden() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCustomer(), getlocalCustomers() trong localstorage * @param type * @return Promise => null */ refreshLocalCustomers_Delete_Hidden(): any; /** * @example: * this.vhQueryCafe.addCustomer({name:'Khách hàng 1', address: 'HCM'}) .then((rsp)=>{ if(rsp.vcode == 0){ //addCustomer thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param data: Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => rsp ={vcode, msg, data(obj)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another customer' */ addCustomer(data: any): Promise; /** * @example: * this.vhQueryCafe.addCustomers([{name:'Khách hàng 1', address: 'HCM'},{},...]) .then((rsp)=>{ if(rsp.vcode == 0){ //addCustomers thành công }else if(rsp.vcode == 0){ //Phone numbers in the list are duplicated } },(error:any)=>{ console.log('error', error); }) * @param data : array(object), Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => {vcode, msg, data(array)} * vcode = 0: 'success' * vcode = 1: 'Phone numbers in the list are duplicated' */ addCustomers(arr_data: any): Promise; /** * @example: * this.vhQueryCafe.updatePCustomer('5fb6780ca2148e09806c5b01', {name: Nguyễn Thị Nở}) .then((rsp)=>{ if(rsp.vcode == 0){ //updatePCustomer thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param id_customer * @param value : Nếu value hoặc có cả 3 trường countryCode, phone, phoneNumber hoặc ko có * @return Promise => {vcode, msg, data(true/false)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another supplier' */ updateCustomer(id_customer: string, value: any): Promise; private _updateCustomer; /** * @example: * this.vhQueryCafe.deleteCustomer('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCustomer', bool); }) * @param id_customer * @return Promise => bool = true or false */ deleteCustomer(id_customer: string): Promise; /** * @example * this.vhQueryCafe.getCustomer('5fb67fda87c0f21d484cbdf3') .then((customer)=>{ console.log('getCustomer', customer); }) * @param id_customer * @return Promise => obj = {} or null */ getCustomer(id_customer: string): Promise; /** * @example * this.vhQueryCafe.getCustomers() .then((customers)=>{ console.log('getCustomers', customers); }) * @return Promise => array(object) = [{},{},..] */ getCustomers(): Promise; /** * Hàm này dùng để xóa hoặc đặt lại điểm mới cho khách hàng * @example: * this.vhQueryCafe.updateCustomer_byPoints('5fb6780ca2148e09806c5b01', 1000) .then((bool:any)=>{ console.log('updateCustomer_byPoints', bool); }) * @param _id * @param points * @return Promise => bool = true or false */ updateCustomer_byPoints(_id: string, points: number): Promise; /** * Hàm này thêm điểm mới kiếm được vào quỹ điểm khách hàng đang có * points = points(tích được trên bill) - point (sử dụng thanh toán trên bill) * @example: * this.vhQueryCafe.updateCustomer_byEarnedPoints('5fb6780ca2148e09806c5b01', 200) .then((bool:any)=>{ console.log('updateCustomer_byEarnedPoints', bool); }) * @param _id * @param points * @return Promise => bool = true or false */ updateCustomer_byEarnedPoints(_id: string, points: number): Promise; /** * 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 * @example: * let customer = this.vhQueryCafe.getlocalCustomer_byPoints('5fb6780ca2148e09806c5b01'); * @param id_customer * @return Object => obj = {} or null */ getlocalCustomerPoints(id_customer: any): any; /** * Hàm tìm kiếm tên chủ sở hữu và số điện thoại, nghĩa là nhập 1 chuỗi tên (2 từ trở lên) hoặc chuỗi số (6 ký tự trở lên) hàm sẽ * trả về những chủ sở hữu có tên hoặc số điện thoại tương ứng với keyword tìm kiếm * @example: * this.vhQuerySales.searchKeyword_NamePhone({'customers, '925354'}) .then((rsp)=>{ console.log('searchKeyword_NamePhone', rsp); },(error:any)=>{ console.log('error', error); }) * @param name_or_phone * @param countryCode * @returns Promise = > {vcode, msg, data(array)} */ searchKeyword_NamePhone(colname: string, name_or_phone: string, countryCode?: string): Promise; private publishObservableEventSuppliers; private observableLocalSuppliers; /** * @example: * this.observableSupplier = this.vhQueryCafe.getObservableLocalSuppliers().subscribe((localSuppliers:any) => { do something... }) ngOnDestroy(){ this.observableSupplier.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalSuppliers(): Observable; /** * @example: * let supplier = this.vhQueryCafe.getlocalSupplier('5fb6780ca2148e09806c5b01'); * @param id_supplier * @return Object => obj = {} or null */ getlocalSupplier(id_supplier: any): any; /** * @example: * this.vhQueryCafe.getlocalSupplier_Async('ETxNu8exrvGtXFjkIhnc') .then((customer)=>{ }, error=>{ console.log('error', error); }) * @param id_supplier * @return Object => obj = {} or null */ private getlocalSupplier_Async; /** * @example: * let suppliers = this.vhQueryCafe.getlocalWallets(); * @return Array(object) => array = [{},{},...] */ getlocalSuppliers(): any; /** * this.vhQueryCafe.refreshLocalSuppliers() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalSupplier(), getlocalSuppliers() trong localstorage * @return Promise => null */ refreshLocalSuppliers(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhQueryCafe.refreshLocalSuppliers_Delete_Hidden() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalSupplier(), getlocalSuppliers() trong localstorage * @param type * @return Promise => null */ refreshLocalSuppliers_Delete_Hidden(): any; /** * @example: * this.vhQueryCafe.addSupplier({name:'Nhà cung cấp 1', address: 'HCM'}) .then((rsp)=>{ if(rsp.vcode == 0){ //addSupplier thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param data: Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => rsp ={vcode, msg, data(obj)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another supplier' */ addSupplier(data: any): Promise; /** * @example: * this.vhQueryCafe.addSuppliers([{name:'Nhà cung cấp 1', address: 'HCM'},{},...]) .then((rsp)=>{ if(rsp.vcode == 0){ //addSuppliers thành công }else if(rsp.vcode == 0){ //Phone numbers in the list are duplicated } },(error:any)=>{ console.log('error', error); }) * @param data: array(object), Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => {vcode, msg, data(array)} * vcode = 0: 'success' * vcode = 1: 'Phone numbers in the list are duplicated' */ addSuppliers(arr_data: any): Promise; /** * @example: * this.vhQueryCafe.updateSupplier('5fb6780ca2148e09806c5b01', {name: Nguyễn Thị Nở}) .then((rsp)=>{ if(rsp.vcode == 0){ //updateSupplier thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param id_customer * @param value : Nếu value hoặc có cả 3 trường countryCode, phone, phoneNumber hoặc ko có * @return Promise => {vcode, msg, data(true/false)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another supplier' */ updateSupplier(id_supplier: string, value: any): Promise; private _updateSupplier; /** * @example: * this.vhQueryCafe.deleteSupplier('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteSupplier', bool); }) * @param id_supplier * @return Promise => bool = true or false */ deleteSupplier(id_supplier: string): Promise; /** * @example * this.vhQueryCafe.getSupplier('5fb67fda87c0f21d484cbdf3') .then((supplier)=>{ console.log('getSupplier', supplier); }) * @param id_supplier * @return Promise => obj ={} or null */ getSupplier(id_supplier: string): Promise; /** * @example * this.vhQueryCafe.getSuppliers() .then((suppliers)=>{ console.log('getSuppliers', suppliers); }) * @return Promise => array(object) = [{},{},..] */ getSuppliers(): Promise; private publishObservableEventDispatcherZones; private observableLocalDispatcherZones; /** * @example: * this.observableKitchen = this.vhQueryCafe.getObservableLocalDispatcherZones().subscribe((localDispatcherZones:any) => { do something... }) ngOnDestroy(){ this.observableDispatcherZone.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalDispatcherZones(): Observable; /** * @example: * let dispatcherzone = this.vhQueryCafe.getlocalDispatcherZone('5fb6780ca2148e09806c5b01'); * @param id_dispatcherzone * @return Object => obj = {} or null */ getlocalDispatcherZone(id_dispatcherzone: any): any; /** * @example: * let dispatcherzones = this.vhQueryCafe.getlocalDispatcherZones(); * @return Array(object) => array = [{},{},...] */ getlocalDispatcherZones(): any; /** * @example: * this.vhQueryCafe.addDispatcherZone({name:'Nhà cung cấp 1', address: 'HCM'}) .then((dispatcherzone)=>{ console.log('addDispatcherZone', dispatcherzone); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDispatcherZone(data: object): Promise; /** * @example: * this.vhQueryCafe.updateDispatcherZone('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDispatcherZone', bool); }) * @param id_dispatcherzone * @param data * @return Promise => bool = true or false */ updateDispatcherZone(id_dispatcherzone: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteDispatcherZone('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDispatcherZone', bool); }) * @param id_dispatcherzone * @return Promise => bool = true or false */ deleteDispatcherZone(id_dispatcherzone: string): Promise; /** * @example * this.vhQueryCafe.getDispatcherZone('5fb67fda87c0f21d484cbdf3') .then((dispatcherzone)=>{ console.log('getDispatcherZone', dispatcherzone); }) * @param id_dispatcherzone * @return Promise => obj ={} or null */ getDispatcherZone(id_dispatcherzone: string): Promise; /** * @example * this.vhQueryCafe.getDispatcherZones() .then((dispatcherzones)=>{ console.log('getDispatcherZones', dispatcherzones); }) * @return Promise => array(object) = [{},{},..] */ getDispatcherZones(): Promise; private publishObservableEventWallets; private observableLocalWallets; /** * @example: this.observableWallet = this.vhQueryCafe.getObservableLocalWallets().subscribe((localwallets:any) => { }) ngOnDestroy(){ this.observableWallet.unsubscribe(); } * @returns */ getObservableLocalWallets(): Observable; /** * @example: * let wallet = this.vhQueryCafe.getlocalWallet('5fb6780ca2148e09806c5b01'); * @param id_wallet * @return Object => obj = {} or null */ getlocalWallet(id_wallet: any): any; /** * @example: * let wallets = this.vhQueryCafe.getlocalWallets(); * @return Array(object) => array = [{},{},...] */ getlocalWallets(): any; /** * @example: * this.vhQueryCafe.refreshLocalWallets() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalWallet(), getlocalWallets() trong localstorage * @return Promise => null */ refreshLocalWallets(): any; /** * @example: * this.vhQueryCafe.addWallet({name:'camera 2', quantity:20, price:200000}) .then((wallet)=>{ console.log('addWallet', wallet); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addWallet(data: object): Promise; /** * @example: * this.vhQueryCafe.updateWallet('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateWallet', bool); }) * @param id_wallet * @param data * @return Promise => bool = true or false */ updateWallet(id_wallet: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteWallet('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteWallet', bool); }) * @param id_wallet * @return Promise => bool = true or false */ deleteWallet(id_wallet: string): Promise; /** * @example * this.vhQueryCafe.getWallet('5fb67fda87c0f21d484cbdf3') .then((wallet)=>{ console.log('getWallet', wallet); }) * @param id_wallet * @return Promise => obj ={} or null */ getWallet(id_wallet: string): Promise; /** * @example * this.vhQueryCafe.getWallets() .then((wallets)=>{ console.log('getWallets', wallets); }) * @return Promise => array(object) = [{},{},..] */ getWallets(): Promise; private publishObservableEventTaxs; private observableLocalTaxs; /** * @example: * this.observableTax = this.vhQueryCafe.getObservableLocalTaxs().subscribe((localTaxs:any) => { do something... }) ngOnDestroy(){ this.observableTax.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalTaxs(): Observable; /** * @example: * let tax = this.vhQueryCafe.getlocalTax('5fb6780ca2148e09806c5b01'); * @param id_tax * @return Object => obj = {} or null */ getlocalTax(id_tax: any): any; /** * @example: * let taxs = this.vhQueryCafe.getlocalTaxs(); * @return Array(object) => array = [{},{},...] */ getlocalTaxs(): any; /** * @example: * this.vhQueryCafe.refreshLocalTaxs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalTax(), getlocalTaxs() trong localstorage * @return Promise => null */ refreshLocalTaxs(): any; /** * @example: * this.vhQueryCafe.addTax({name:'camera 2', quantity:20, price:200000}) .then((tax)=>{ console.log('addTax', tax); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addTax(data: object): Promise; /** * @example: * this.vhQueryCafe.updateTax('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateTax', bool); }) * @param id_tax * @param data * @return Promise => bool = true or false */ updateTax(id_tax: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteTax('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteTax', bool); }) * @param id_tax * @return Promise => bool = true or false */ deleteTax(id_tax: string): Promise; /** * @example * this.vhQueryCafe.getTax('5fb67fda87c0f21d484cbdf3') .then((tax)=>{ console.log('getTax', tax); }) * @param id_tax * @return Promise => obj ={} or null */ getTax(id_tax: string): Promise; /** * @example * this.vhQueryCafe.getTaxs() .then((taxs)=>{ console.log('getTaxs', taxs); }) * @return Promise => array(object) = [{},{},..] */ getTaxs(): Promise; private publishObservableEventCategorys; private observableLocalCategorys; /** * @example: * this.observableCategory = this.vhQueryCafe.getObservableLocalCategorys(1).subscribe((localCategorys:any) => { do something... }) ngOnDestroy(){ this.observableCategory.unsubscribe(); } * @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, = 13 là danh mục món và nguyên liệu, ko truyền vào hoặc giá trị khác là cả ba * @returns Observable (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCategorys(type?: any): Observable; /** * @example: * let category = this.vhQueryCafe.getlocalCategory('5fb6780ca2148e09806c5b01'); * @param id_category * @return Object => obj = {} or null */ getlocalCategory(id_category: any): any; /** * @example: * let categorys = this.vhQueryCafe.getlocalCategorys(1234); * @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, * = 1234 là 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 * @return Array(object) => array = [{},{},...] */ getlocalCategorys(type?: any): any[]; /** * @example: * let categorys = this.vhQueryCafe.getlocalFoodCategorys(); * @return Array(object) => array = [{},{},...] */ /** * @example: * let categorys = this.vhQueryCafe.getlocalMaterialCategorys(); * @return Array(object) => array = [{},{},...] */ /** * @example: * this.vhQueryCafe.refreshLocalCategory() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCategory(), getlocalCategorys() trong localstorage * @return Promise => null */ refreshLocalCategorys(): any; /** * @example: * this.vhQueryCafe.addCategory({name:'Danh mục 1'}) .then((category)=>{ console.log('addCategory', category); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCategory(data: object): Promise; /** * @example: * this.vhQueryCafe.addCategorys([{name:'Danh mục 1'},{},...]) .then((categorys)=>{ console.log('addCategorys', categorys); }, error=>{ console.log('error', error); }) * @param data : array(object) * @return Promise => array = [{},{},...] * 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 */ addCategorys(data_array: any): Promise; /** * @example: * this.vhQueryCafe.updateCategory('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCategory', bool); }) * @param id_category * @param data * @return Promise => bool = true or false */ updateCategory(id_category: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteCategory('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCategory', bool); }) * @param id_category * @return Promise => bool = true or false */ deleteCategory(id_category: string): Promise; /** * @example * this.vhQueryCafe.getCategory('5fb67fda87c0f21d484cbdf3') .then((category)=>{ console.log('getCategory', category); }) * @param id_category * @return Promise => obj ={} or null */ getCategory(id_category: string): Promise; /** * @example * this.vhQueryCafe.getCategorys() .then((categorys)=>{ console.log('getCategorys', categorys); }) * @return Promise => array(object) = [{},{},..] */ getCategorys(): Promise; private publishObservableEventInventorytimes; private observableLocalInventorytimes; /** * @example: * this.observableInventorytime = this.vhQueryCafe.getObservableLocalInventorytimes().subscribe((localInventorytimes:any) => { do something... }) ngOnDestroy(){ this.observableInventorytime.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalInventorytimes(): Observable; /** * @example: * let inventorytime = this.vhQueryCafe.getlocalInventorytime('5fb6780ca2148e09806c5b01'); * @param id_inventorytime * @return Object => obj = {} or null */ getlocalInventorytime(id_inventorytime: any): any; /** * @example: * let inventorytimes = this.vhQueryCafe.getlocalInventorytimes(); * @return Array(object) => array = [{},{},...] */ getlocalInventorytimes(): any; /** * @example: * this.vhQueryCafe.refreshLocalTaxs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalInventorytime(), getlocalInventorytimes() trong localstorage * @return Promise => null */ refreshLocalInventorytimes(): any; /** * @example: * this.vhQueryCafe.addInventorytime({name:'camera 2', quantity:20, price:200000}) .then((inventorytime)=>{ console.log('addInventorytime', inventorytime); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addInventorytime(data: any): Promise; /** * @example: * this.vhQueryCafe.updateInventorytime('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateInventorytime', bool); }) * @param id_inventorytime * @param data * @return Promise => bool = true or false */ updateInventorytime(id_inventorytime: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteInventorytime('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteInventorytime', bool); }) * @param id_inventorytime * @return Promise => bool = true or false */ deleteInventorytime(id_inventorytime: string): Promise; /** * @example * this.vhQueryCafe.getInventorytime('5fb67fda87c0f21d484cbdf3') .then((inventorytime)=>{ console.log('getInventorytime', inventorytime); }) * @param id_inventorytime * @return Promise => obj ={} or null */ getInventorytime(id_inventorytime: string): Promise; /** * @example * this.vhQueryCafe.getInventorytimes() .then((inventorytimes)=>{ console.log('getInventorytimes', inventorytimes); }) * @return Promise => array(object) = [{},{},..] */ getInventorytimes(): Promise; private publishObservableEventCustomerClasss; private observableLocalCustomerClasss; /** * @example: * this.observableCustomerClasss = this.vhQueryCafe.getObservableLocalCustomerClasss().subscribe((localCustomer_classs:any) => { do something... }) ngOnDestroy(){ this.observableCustomerClasss.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ private getObservableLocalCustomerClasss; /** * @example: * let customer_class = this.vhQueryCafe.getlocalCustomerClass('5fb6780ca2148e09806c5b01'); * @param id_customer_class * @return Object => obj = {} or null */ getlocalCustomerClass(id_customer_class: any): any; /** * @example: * let customer_classs = this.vhQueryCafe.getlocalCustomerClasss(); * @return Array(object) => array = [{},{},...] */ getlocalCustomerClasss(): any; /** * @example: * this.vhQueryCafe.addCustomerClass({name:'camera 2', quantity:20, price:200000}) .then((customer_class)=>{ console.log('addCustomerClass', customer_class); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCustomerClass(data: object): Promise; /** * @example: * this.vhQueryCafe.updateCustomerClass('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCustomerClass', bool); }) * @param id_customer_class * @param data * @return Promise => bool = true or false */ updateCustomerClass(id_customer_class: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteCustomerClass('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCustomerClass', bool); }) * @param id_customer_class * @return Promise => bool = true or false */ deleteCustomerClass(id_customer_class: string): Promise; /** * vhQueryCafe */ private publishObservableEventDiscount_bills; /** * vhQueryCafe * @returns */ private observableLocalDiscount_bills; /** * @example: * this.observableDiscount_bills = this.vhQueryCafe.getObservableLocalDiscount_bills().subscribe((localDiscount_bills:any) => { do something... }) ngOnDestroy(){ this.observableDiscount_bills.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ private getObservableLocalDiscount_bills; /** * @example: * let discount_bill = this.vhQueryCafe.getlocalDiscount_bill('5fb6780ca2148e09806c5b01'); * @param id_discount_bill * @return Object => obj = {} or null */ getlocalDiscount_bill(id_discount_bill: any): any; /** * @example: * let discount_bills = this.vhQueryCafe.getlocalDiscount_bills(); * @return Array(object) => array = [{},{},...] */ getlocalDiscount_bills(): any; /** * @example: * this.vhQueryCafe.addDiscount_bill({name:'camera 2', quantity:20, price:200000}) .then((discount_bill)=>{ console.log('addDiscount_bill', discount_bill); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDiscount_bill(data: object): Promise; /** * @example: * this.vhQueryCafe.updateDiscount_bill('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDiscount_bill', bool); }) * @param id_discount_bill * @param data * @return Promise => bool = true or false */ updateDiscount_bill(id_discount_bill: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteDiscount_bill('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDiscount_bill', bool); }) * @param id_discount_bill * @return Promise => bool = true or false */ deleteDiscount_bill(id_discount_bill: string): Promise; /** * @example: * this.vhQueryCafe.addDiscount_sales({name:'camera 2', quantity:20, price:200000}) .then((discount_saless)=>{ console.log('addDiscount_sales', discount_sales); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDiscount_sales(data: object): Promise; /** * @example: * this.vhQueryCafe.updateDiscount_sales('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDiscount_sales', bool); }) * @param id_discount_sales * @param data * @return Promise => bool = true or false */ updateDiscount_sales(id_discount_sales: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteDiscount_sales('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDiscount_sales', bool); }) * @param id_discount_sales * @return Promise => bool = true or false */ deleteDiscount_sales(id_discount_sales: string): Promise; /** * @example * this.vhQueryCafe.getDiscount_sales('5fb67fda87c0f21d484cbdf3') .then((discount_sales)=>{ console.log('getDiscount_sales', discount_sales); }) * @param id_discount_sales * @return Promise => obj ={} or null */ getDiscount_sales(id_discount_sales: string): Promise; /** * @example * this.vhQueryCafe.getDiscount_saless() .then((discount_saless)=>{ console.log('getDiscount_saless', discount_saless); }) * @return Promise => array(object) = [{},{},..] */ getDiscount_saless(): Promise; /** * @example: * this.vhQueryCafe.addCommission({name:'camera 2', quantity:20, price:200000}) .then((commissions)=>{ console.log('addCommission', commissions); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCommission(data: object): Promise; /** * @example: * this.vhQueryCafe.updateCommission('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCommission', bool); }) * @param id_commission * @param data * @return Promise => bool = true or false */ updateCommission(id_commission: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteCommission('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCommission', bool); }) * @param id_commission * @return Promise => bool = true or false */ deleteCommission(id_commission: string): Promise; /** * @example * this.vhQueryCafe.getCommission('5fb67fda87c0f21d484cbdf3') .then((commission)=>{ console.log('getCommission', commission); }) * @param id_commission * @return Promise => obj ={} or null */ getCommission(id_commission: string): Promise; /** * @example * this.vhQueryCafe.getCommissions() .then((commissions)=>{ console.log('getCommissions', commissions); }) * @return Promise => array(object) = [{},{},..] */ getCommissions(): Promise; /** * @example: * let delivery = this.vhQueryCafe.getlocalDelivery('5fb6780ca2148e09806c5b01'); * @param id_delivery * @return Object => obj = {} or null */ getlocalDelivery(id_delivery: any): any; /** * @example: * let deliverys = this.vhQueryCafe.getlocalDeliverys(); * @return Array(object) => array = [{},{},...] */ getlocalDeliverys(): any; /** * @example: * this.vhQueryCafe.refreshLocalDeliverys() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalDelivery(), getlocalDeliverys() trong localstorage * @return Promise => null */ refreshLocalDeliverys(): any; /** * @example: * this.vhQueryCafe.addDelivery({name:'camera 2', quantity:20, price:200000}) .then((delivery)=>{ console.log('addDelivery', delivery); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDelivery(data: object): Promise; /** * @example: * this.vhQueryCafe.updateDelivery('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDelivery', bool); }) * @param id_delivery * @param data * @return Promise => bool = true or false */ updateDelivery(id_delivery: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteDelivery('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDelivery', bool); }) * @param id_delivery * @return Promise => bool = true or false */ deleteDelivery(id_delivery: string): Promise; /** * @example * this.vhQueryCafe.getDelivery('5fb67fda87c0f21d484cbdf3') .then((delivery)=>{ console.log('getDelivery', delivery); }) * @param id_delivery * @return Promise => obj ={} or null */ getDelivery(id_delivery: string): Promise; /** * @example * this.vhQueryCafe.getDeliverys() .then((deliverys)=>{ console.log('getDeliverys', deliverys); }) * @return Promise => array(object) = [{},{},..] */ getDeliverys(): Promise; /** * @example: * let address = this.vhQueryCafe.getlocalAddress('5fb6780ca2148e09806c5b01'); * @param id_address * @return Object => obj = {} or null */ getlocalAddress(id_address: any): any; /** * @example: * let addresss = this.vhQueryCafe.getlocalAddresss(); * @return Array(object) => array = [{},{},...] */ getlocalAddresss(): any; /** * @example: * this.vhQueryCafe.refreshLocalAddresss() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalAddress(), getlocalAddresss() trong localstorage * @return Promise => null */ refreshLocalAddresss(): any; /** * @example: * this.vhQueryCafe.addAddress({name:'camera 2', quantity:20, price:200000}) .then((address)=>{ console.log('addAddress', address); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addAddress(data: object): Promise; /** * @example: * this.vhQueryCafe.updateAddress('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateAddress', bool); }) * @param id_address * @param data * @return Promise => bool = true or false */ updateAddress(id_address: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteAddress('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteAddress', bool); }) * @param id_address * @return Promise => bool = true or false */ deleteAddress(id_address: string): Promise; /** * @example * this.vhQueryCafe.getAddress('5fb67fda87c0f21d484cbdf3') .then((address)=>{ console.log('getAddress', address); }) * @param id_address * @return Promise => obj ={} or null */ getAddress(id_address: string): Promise; /** * @example * this.vhQueryCafe.getAddresss() .then((addresss)=>{ console.log('getAddresss', addresss); }) * @return Promise => array(object) = [{},{},..] */ getAddresss(): Promise; /** * @example: * let incoming_group = this.vhQueryCafe.getlocalIncoming_group('5fb6780ca2148e09806c5b01'); * @param id_incoming_group * @return Object => obj = {} or null */ getlocalIncoming_group(id_incoming_group: any): any; /** * @example: * let incoming_groups = this.vhQueryCafe.getlocalIncoming_groups(); * @return Array(object) => array = [{},{},...] */ getlocalIncoming_groups(): any[]; /** * @example: * this.vhQueryCafe.refreshLocalIncoming_groups() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIncoming_group(), getlocalIncoming_groups() trong localstorage * @return Promise => null */ refreshLocalIncoming_groups(): any; /** * @example: * this.vhQueryCafe.addIncoming_group({name:'camera 2', quantity:20, price:200000}) .then((incoming_group)=>{ console.log('addIncoming_group', incoming_group); },(error:any)=>{ console.log('error', error); }) * @param data * @return Promise => obj = {} * 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 */ addIncoming_group(data: object): Promise; /** * @example: * this.vhQueryCafe.updateIncoming_group('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIncoming_group', bool); }) * @param id_incoming_group * @param data * @return Promise => bool = true or false */ updateIncoming_group(id_incoming_group: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteIncoming_group('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIncoming_group', bool); }) * @param id_incoming_group * @return Promise => bool = true or false */ deleteIncoming_group(id_incoming_group: string): Promise; /** * @example * this.vhQueryCafe.getIncoming_groups() .then((incoming_groups)=>{ console.log('getIncoming_groups', incoming_groups); }) * @return Promise => array(object) = [{},{},..] */ getIncoming_groups(): Promise; /** * @example: * let spending_group = this.vhQueryCafe.getlocalSpending_group('5fb6780ca2148e09806c5b01'); * @param id_spending_group * @return Object => obj = {} or null */ getlocalSpending_group(id_spending_group: any): any; /** * @example: * let spending_groups = this.vhQueryCafe.getlocalSpending_groups(); * @return Array(object) => array = [{},{},...] */ getlocalSpending_groups(): any[]; /** * @example: * this.vhQueryCafe.refreshLocalSpending_groups() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm refreshLocalSpending_group(), refreshLocalSpending_groups() trong localstorage * @return Promise => null */ refreshLocalSpending_groups(): any; /** * @example: * this.vhQueryCafe.addSpending_group({name:'camera 2', quantity:20, price:200000}) .then((spending_groups)=>{ console.log('addSpending_group', spending_groups); },(error:any)=>{ console.log('error', error); }) * @param data * @return Promise => obj = {} * 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 */ addSpending_group(data: object): Promise; /** * @example: * this.vhQueryCafe.updateSpending_group('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateSpending_group', bool); }) * @param id_spending_group * @param data * @return Promise => bool = true or false */ updateSpending_group(id_spending_group: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteSpending_group('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteSpending_group', bool); }) * @param id_spending_group * @return Promise => bool = true or false */ deleteSpending_group(id_spending_group: string): Promise; /** * @example * this.vhQueryCafe.getSpending_groups() .then((spending_groups)=>{ console.log('getSpending_groups', spending_groups); }) * @return Promise => array(object) = [{},{},..] */ getSpending_groups(): Promise; /** * @example: * this.vhQueryCafe.addPatternMenu({name:'Pattern Menu 1', ...............}) .then((patternmenu)=>{ console.log('addPatternMenu', patternmenus); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPatternMenu(data: object): Promise; /** * @example: * this.vhQueryCafe.updatePatternMenu('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePatternMenu', bool); }) * @param id_patternmenu * @param data * @return Promise => bool = true or false */ updatePatternMenu(id_patternmenu: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deletePatternMenu('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePatternMenu', bool); }) * @param id_patternmenu * @return Promise => bool = true or false */ deletePatternMenu(id_patternmenu: string): Promise; /** * @example * this.vhQueryCafe.getPatternMenu('5fb67fda87c0f21d484cbdf3') .then((patternmenu)=>{ console.log('getPatternMenu', patternmenu); }) * @param id_patternmenu * @return Promise => obj ={} or null */ getPatternMenu(id_patternmenu: string): Promise; /** * @example * this.vhQueryCafe.getPatternMenus() .then((patternmenus)=>{ console.log('getPatternMenus', patternmenus); }) * @return Promise => array(object) = [{},{},..] */ getPatternMenus(): Promise; /** * @example: * this.vhQueryCafe.updateDebtAtBeginningCustomer('5fb6780ca2148e09806c5b01', '56345gy34t12tf12', 2000000) .then((bool:any)=>{ console.log('updateDebtAtBeginningCustomer', bool); }) * @param id_customer * @param id_branch * @param debt_beginning * @return Promise => bool = true or false */ updateDebtAtBeginningCustomer(id_customer: string, id_branch: string, debt_beginning: number): Promise; /** * @example * this.vhQueryCafe.getDebtAtBeginningCustomers_byIDcustomer() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers_byIDcustomer', debtatbeginnings); }) * @param id_customer * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers_byIDcustomer; /** * @example * this.vhQueryCafe.getDebtAtBeginningCustomers_byIDbranch() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers_byIDbranch', debtatbeginnings); }) * @param id_customer * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers_byIDbranch; /** * @example * this.vhQueryCafe.getDebtAtBeginningCustomers_byIDcustomer_byIDbranch('3546235ytrhdghyw465', 'i5455234trgxi8675eg') .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers_byIDcustomer_byIDbranch', debtatbeginnings); }) * @param id_customer * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers_byIDcustomer_byIDbranch; /** * @example * this.vhQueryCafe.getDebtAtBeginningCustomers() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers', debtatbeginnings); }) * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers; /** * @example: * this.vhQueryCafe.updateDebtAtBeginningSupplier('5fb6780ca2148e09806c5b01', '56345gy34t12tf12', 2000000) .then((bool:any)=>{ console.log('updateDebtAtBeginningSupplier', bool); }) * @param id_supplier * @param id_branch * @param debt_beginning * @return Promise => bool = true or false */ updateDebtAtBeginningSupplier(id_supplier: string, id_branch: string, debt_beginning: number): Promise; /** * @example * this.vhQueryCafe.getDebtAtBeginningSuppliers_byIDsupplier() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers_byIDsupplier', debtatbeginnings); }) * @param id_supplier * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers_byIDsupplier; /** * @example * this.vhQueryCafe.getDebtAtBeginningSuppliers_byIDbranch() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers_byIDbranch', debtatbeginnings); }) * @param id_branch * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers_byIDbranch; /** * @example * this.vhQueryCafe.getDebtAtBeginningSuppliers_byIDsupplier_byIDbranch('4ye5r6tyhdfdfaenm', '576dfgbdshdmiret3') .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers_byIDsupplier_byIDbranch', debtatbeginnings); }) * @param id_supplier * @param id_branch * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers_byIDsupplier_byIDbranch; /** * @example * this.vhQueryCafe.getDebtAtBeginningSuppliers() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers', debtatbeginnings); }) * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers; setDefaultBranch(id_branch: any): void; getDefaultBranch(): any; clearDefaultBranch(): void; isChains(): boolean | null; private publishObservableEventBranchs; private observableLocalBranchs; /** * @example: * this.observableBranch = this.vhQueryCafe.getObservableLocalBranchs().subscribe((localBranchs:any) => { do something... }) ngOnDestroy(){ this.observableBranch.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalBranchs(): Observable; /** * @example: * let branch = this.vhQueryCafe.getlocalBranch('5fb6780ca2148e09806c5b01'); * @param id_branch * @return Object => obj = {} or null */ getlocalBranch(id_branch: any): any; /** * @example: * let branchs = this.vhQueryCafe.getlocalBranchs(); * @return Array(object) => array = [{},{},...] */ getlocalBranchs(): any; /** * @example: * this.vhQueryCafe.refreshLocalBranchs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalBranch(), getlocalBranchs() trong localstorage * @return Promise => null */ refreshLocalBranchs(): any; /** * @example: * this.vhQueryCafe.addBranch({name:'Chi nhánh 2'}) .then((branch)=>{ console.log('addBranch', branch); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addBranch(data: any): Promise; private addBranch_old; /** * @example: * this.vhQueryCafe.updateBranch('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateBranch', bool); }) * @param id_branch * @param data * @return Promise => bool = true or false */ updateBranch(id_branch: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteBranch('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBranch', bool); }) * @param id_branch * @return Promise => bool = true or false */ deleteBranch(id_branch: string): Promise; /** * @example * this.vhQueryCafe.getBranch('5fb67fda87c0f21d484cbdf3') .then((branch)=>{ console.log('getBranch', branch); }) * @param id_branch * @return Promise => obj ={} or null */ private getBranch; /** * @example * this.vhQueryCafe.getBranchs() .then((branchs)=>{ console.log('getBranchs', branchs); }) * @return Promise => array(object) = [{},{},..] */ private getBranchs; private publishObservableEventPrinters; private observableLocalPrinters; /** * @example: * this.observablePrinter = this.vhQueryCafe.getObservableLocalPrinters().subscribe((localPrinters:any) => { do something... }) ngOnDestroy(){ this.observablePrinter.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalPrinters(): Observable; /** * @notice : lưu ý các hàm print này nó sẽ chỉ được tạo ra trên 1 máy vật lý (station), qua máy khác phải tạo lại * @example: * let printer = this.vhQueryCafe.getlocalPrinter('5fb6780ca2148e09806c5b01'); * @param id_printer * @return Object => obj = {} or null */ getlocalPrinter(id_printer: any): any; /** * @example * let printers = this.vhQueryCafe.getlocalPrinters(); * @return Array(object) => array = [{},{},...] */ getlocalPrinters(): any; /** * @example: * this.vhQueryCafe.refreshLocalPrinters() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPrinter(), getlocalPrinters() trong localstorage * @return Promise => null */ refreshLocalPrinters(): any; /** * @example: * this.vhQueryCafe.addPrinter({name:'camera 2', quantity:20, price:200000}) .then((printer)=>{ console.log('addPrinter', printer); }, error=>{ console.log('error', error); }) * @param data * Promise => object = {} 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 */ addPrinter(data: object): Promise; /** * @example: * this.vhQueryCafe.updatePrinter('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePrinter', bool); }, error=>{ console.log('error', error); }) * @param id_printer * @param data * @return Promise => bool = true or false */ updatePrinter(id_printer: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deletePrinter('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePrinter', bool); }) * @param id_printer * @return Promise => bool = true or false */ deletePrinter(id_printer: string): Promise; /** * @example * this.vhQueryCafe.getPrinter('5fb67fda87c0f21d484cbdf3') .then((printer)=>{ console.log('getPrinter', printer); }) * @param id_printer * @return false or object */ getPrinter(id_printer: string): Promise; /** * @example * this.vhQueryCafe.getPrinters() .then((printers)=>{ console.log('getDoc', printers); }) * @return array(object) = [{},{},..] */ getPrinters(): Promise; /** * @example: * this.vhQueryCafe.refreshLocalPrintPages() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPrintPage(), getlocalPrintPages() trong localstorage * @return Promise => null */ private refreshLocalPrintPages; /** * @example: * let print_page = this.vhQueryCafe.getLocalPrintPage('page_desktop_sales'); * @param print_page_type * @return Object => obj = {} or null */ getLocalPrintPage(print_page_type: string): any; /** * @example: * let pagesize = this.vhQueryCafe.getLocalDefaultPageSize('page_desktop_sales'); * @param print_page_type * @return Object => obj = {} or null */ getLocalDefaultPageSize(print_page_type: string): any; /** * @example: * this.vhQueryCafe.addPrintPage('page_desktop_sales', {name:'camera 2', quantity:20, price:200000}) .then((print_page)=>{ console.log('addPrintPage', print_page); }, error=>{ console.log('error', error); }) * @param data * Promise => object = {} 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 */ addPrintPage(print_page_type: string, data: any): Promise; /** * @example: * this.vhQueryCafe.updatePrintPage('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePrintPage', bool); }, error=>{ console.log('error', error); }) * @param id_print_page * @param data * @return Promise => bool = true or false */ updatePrintPage(id_print_page: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deletePrintPage('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePrintPage', bool); }) * @param id_print_page * @return Promise => bool = true or false */ deletePrintPage(id_print_page: string): Promise; /** * @example * this.vhQueryCafe.getPrintPages() .then((print_pages)=>{ console.log('getPrintPages', print_pages); }) * @return array(object) = [{},{},..] */ getPrintPages(): Promise; /** * Hàm này dùng để thực hiện trừ hàng hóa trong nhiều Payment_Card * 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 * @example let bill = { bill_type: 51, id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_branch: 'ADGNX9HFzffJ59yRtqNd', id_customer: 'cus001', id_wallet: 'wallet001', note: '', date: new Date(), bill_code: 'L46K0502' } let bill_details =[{ id_payment_card: '7Q5BZVRlyySrhShngMDv', id_payment_card_code: '33cTgnd2xZo3OW9tsu1d', pctype: 1, quantity: 1, ratio: 1, products:[{ id_product:'9tg6UxzK26DDVEVHsvq5' quantity: 5 price: 100000 ptype: 1, unit: 'cái', ratio:1 },{ id_product:'jUqd5bE6y2JhX0aCd5TF', quantity: 1 price: 50000 ptype: 2, unit: 'cái', ratio:1 },{ id_product, quantity, price, ptype: 1, unit: 'cái', ratio:1 }] //dưới là cái cũ, sẽ bỏ đi let bill_details =[{ id_payment_card: '7Q5BZVRlyySrhShngMDv', id_payment_card_code: '33cTgnd2xZo3OW9tsu1d', pctype: 1, id_product:'9tg6UxzK26DDVEVHsvq5' quantity: 2 price: 200000 ptype: 1 },{ id_payment_card: '7Q5BZVRlyySrhShngMDv', id_payment_card_code: '33cTgnd2xZo3OW9tsu1d', pctype: 1, id_product:'jUqd5bE6y2JhX0aCd5TF', quantity: 1 price: 100000 ptype: 2 }] this.vhQueryCafe.createBill_Billdetail_51(bill, bill_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param bill * @param bill_details * @returns Promise => object = {} or null */ createBill_Billdetail_51(bill: any, bill_details: any): any; /** * Hàm này dùng để thực hiện đổi voucher lấy hàng hóa * @example let bill = { bill_type: 41, id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_branch: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_customer: 'cus001', id_wallet: 'wallet001', note: '', date: new Date(), bill_code: '' } let bill_details =[{ id_voucher: 'voucher006', id_voucher_code: 'MHRD9N0531', vtype: 1, quantity: 2//bỏ đi products:[{ id_product:'9tg6UxzK26DDVEVHsvq5' quantity: 5 price: 100000 ptype: 1, unit: 'cái', ratio:1 },{ id_product:'jUqd5bE6y2JhX0aCd5TF', quantity: 1 price: 50000 ptype: 2, unit: 'cái', ratio:1 },{ id_product, quantity, price, ptype: 5// bây giờ phần mềm chưa dùng voucher có combo combos:[{ id_product, quantity, price, ptype: 1, unit: 'cái', ratio:1 },{ id_product, quantity, price, ptype: 2, unit: 'cái', ratio:1 }] }] this.vhQueryCafe.createBill_Billdetail_41(bill, bill_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param bill * @param bill_details * @returns Promise => object = {} or null */ createBill_Billdetail_41(bill: any, bill_details: any): any; /** * 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 * @example let bill ={ id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_cashier: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_customer: 'cus001', total: 10000000, bill_type: 1, tax_value: 0, fee: 0, date: new Date() } let bill_details =[{ id_product: 'pro006', price: 10000000, quantity: 1 },{ id_product: 'pro007', price: 12000000, quantity: 1 }] this.vhQueryCafe.createBill_Billdetail(bill, bill_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param bill * @param bill_details * @return Promise => object = {} or null */ createBill_Billdetail(bill: any, bill_details: any): any; /** * @example * this.vhQueryCafe.changeBill_toInvoice_byMinvoice(id_bill,invoiceSeries) .then((rsp)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param id_bill * @param invoiceSeries * @returns Promise => {vcode, msg, data(array)} */ changeBill_toInvoice_byMinvoice(id_bill: string, invoiceSeries: string): Promise; /** * hàm này chỉ dùng cho trường hợp bill_type 5->1, 29->3031, 36->1, 42->40, 43->41, 52->50, 53->51 * @example this.vhQueryCafe.saveBill_Billdetail('SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) * @param id_bill * @param newbill_type * @return Promise => undefined */ saveBill_Billdetail(id_bill: any, newbill_type: number): any; private saveBill_Billdetail_old; private saveBill_Billdetail1; /** * hàm này chỉ dùng cho trường hợp bill đã lưu rồi mà muốn sửa * @example this.vhQueryCafe.updateBill_Billdetail('SzyEYNN39Mq90NkzUFpz',{},[{},{},...]) .then(()=>{ console.log("success"); }) * @param id_bill * @param bill * @param bill_details * @returns */ updateBill_Billdetail(id_bill: any, bill: any, bill_details: any): any; /** * VhQueryCafe * Lưu ý: xóa tất cả các bill_type(từ 1 đến 28) đều dùng hàm này * @example this.vhQueryCafe.deleteBill_Billdetail('RcECbNgU9BdYQo37s30p') .then(()=>{ console.log('success'); },(error:any)=>{ console.log('error ', error); }) * @param id_bill * @return Promise => true or orror */ deleteBill_Billdetail(id_bill: any): any; /** * Hàm lấy về các có kèm chương trình khuyến mãi * @example this.vhQueryCafe.getBill_details_byId_bill('RcECbNgU9BdYQo37s30p') .then((bill_details:any)=>{ console.log('getBill_details_byId_bill', bill_details); },(error:any)=>{ console.log('error ', error); }) * @param id_bill * @return Promise => array / orror */ getBill_details_byId_bill(id_bill: any): any; /** * @example: * this.vhQueryCafe.getBill_details_byID({id_bill:{$eq:id_bill}, bill_type:{$eq:5}}, {},{date:1},0) .then((bill_details)=>{ console.log('bill_details', bill_details); }) * @param query : trong query phải có query id_bill or id_product or id_subproduct.... * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ private getBill_details_byID; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryCafe.getBill_details_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0) .then((bill_details)=>{ console.log('getBill_details_byFields', bill_details); }) * @param query trong query phải có date * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ private getBill_details_byFields; /** * VhQueryCafe: * @example this.vhQueryCafe.getBill_details('RcECbNgU9BdYQo37s30p') .then((bill_details:any)=>{ console.log('getBill_details', bill_details); },(error:any)=>{ console.log('error ', error); }) * @param id_bill * @return Promise => array / orror */ private getBill_details; private _getBill_details; /** * @example: * this.vhQueryCafe.createBill_Detail({}) .then((vhbill_detail)=>{ console.log('createBill_Detail', vhbill_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ createBill_Detail(data: any): any; /** * Hàm này chỉ áp dụng cho bill_type 1,5 và bill_detail có ptype 5 * @example: * this.vhQueryCafe.createBill_Detail_ptype_5({}) .then((vhbill_detail)=>{ console.log('createBill_Detail_ptype_5', vhbill_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ createBill_Detail_ptype_5(data: any): any; /** * @example: * this.vhQueryCafe.updateBill_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updateBill_Detail', bool); }, error=>{ console.log('error', error); }) * @param id_bill * @param data * @return Promise => bool = true or false */ updateBill_Detail(id_bill_detail: string, value: object): Promise; /** * Hàm này chỉ áp dụng cho bill_type 1,5 và bill_detail có ptype 5 * @example: * this.vhQueryCafe.updateBill_Detail_btype_5('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updateBill_Detail', bool); }, error=>{ console.log('error', error); }) * @param id_bill_detail * @param value * @return Promise => bool = true or false */ updateBill_Detail_btype_5(id_bill_detail: string, value: any): Promise; /** * @example: * this.vhQueryCafe.deleteBill_Detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBill_Detail', bool); }) * @param id_bill_detail * @return Promise => bool = true or false */ deleteBill_Detail(id_bill_detail: any): Promise; /** * Hàm này chỉ áp dụng cho bill_type 1,5 và bill_detail có ptype 5 * @example: * this.vhQueryCafe.deleteBill_Detail_ptype_5('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBill_Detail', bool); }) * @param id_bill_detail * @return Promise => bool = true or false */ deleteBill_Detail_ptype_5(id_bill_detail: any): Promise; /** * @example: * this.vhQueryCafe.getBill('5fb67fda87c0f21d484cbdf3') .then((bill)=>{ console.log('getBill', bill); }) * @param id_bill */ getBill(id_bill: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryCafe.getBills({date:{$gte:time}}, {},{date:1},0)) .then((bills)=>{ console.log('getBills', bills); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getBills(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryCafe.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0) .then((bills)=>{ console.log('getBills', bills); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getBills_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQueryCafe.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()}) .then((bill)=>{ console.log('createBill', bill); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail * 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 */ createBill(data: any): Promise; /** * @example: * this.vhQueryCafe.updateBill('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updateBill', bool); }, error=>{ console.log('error', error); }) * @param id_bill * @param bill * @return Promise => bool = true or false * @notice : hàm này chỉ dùng cập nhật những bill_type mà không có phát sinh bill_detail */ updateBill(id_bill: string, bill: any): Promise; /** * @example: * this.vhQueryCafe.deleteBill('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBill', bool); }) * @param id_bill_detail * @return Promise => bool = true or false * @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 */ deleteBill(id_bill: any): Promise; /** * 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 * @example: * this.vhQueryCafe.observableSyncOpeningBill('5fb6780ca2148e09806c5b01', 5) .subscribe((rsp)=> { if(rsp.vcode === 0){ //-----------your code 0----------- let bill = rsp.data; console.log('observableSyncOpeningBill', bill); }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } },(error:any) => { console.log(error); }) * @param id_bill * @param bill_type * @returns Observable => bill hoặc null; * @return Observable object => rsp = {vcode, message, data} * vcode == 0: repaired bill by another device * vcode == 1: changed bill_type by another device * vcode == 2: deleted bill by unknown device * @notice : nhớ đóng closeSyncOpeningBill() khi thoát trang hiện tại this.vhQueryCafe.closeSyncOpeningBill(); */ observableSyncOpeningBill(id_bill: string, bill_type: number): Observable; /** * @example: * this.vhQueryCafe.closeSyncOpeningBill(); * @returns void */ closeSyncOpeningBill(): void; private publishSyncEventList_BillType5; private _syncLocalList_BillType5; /** * Hàm callback trả về danh sách hóa đơn bill_type5 mới nhất * @example: this.observableList_BillType5 = this.vhQueryCafe.syncLocalList_BillType5() .subscribe((listbill_bybilltype)=> { console.log('syncLocalList_BillType5', listbill_bybilltype); },(error:any) => { console.log(error); }) ngOnDestroy(){ this.observableList_BillType5.unsubscribe(); } * @returns Observable => array */ syncLocalList_BillType5(): Observable; /** * Hàm đóng Observable của syncLocalList_BillType5(), mỗi lần thoát hẳn (ko vào ra thường xuyên) trang, thoát hẳn component nên gọi hàm này * @example: * this.vhQueryCafe.closeSyncLocalList_BillType5(); * @returns void */ private closeSyncLocalList_BillType5; /** * @example: * this.vhQueryCafe.createPaymentVnpay(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang * Nê * @Return void */ private createPaymentVnpay; /** * @example: * this.vhQueryCafe.createPaymentVnpay_web(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang, link này gán trong nút back của trang trả về * @Return Void */ createPaymentVnpay_web(amount: number, orderDescription: string, id_payment: string, backHref: string): any; /** * @example: * this.vhQueryCafe.createPaymentVnpay_soft(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG') .then((payment_url)=>{ //Hiện loading chờ ở đây setTimeout(() => { //Sau 15s đóng loading lại và refresh trang lại window.location = backHref; }, 15000); //Đồng thời mở 1 browser trong 1 window mới vơi ulr là payment_url cho khách hàng thanh toán },(error:any)=>{ console.log('error', error); }) * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @Return Promise => payment_url */ createPaymentVnpay_soft(amount: number, orderDescription: string, id_payment: string): any; /** * @example: * this.vhQueryCafe.createPaymentVnpay_app(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG') .then((payment_url)=>{ //Dùng thư viện chạy browser trong app vơi ulr là payment_url cho khách hàng thanh toán },(error:any)=>{ console.log('error', error); }) * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @Return payment_url */ createPaymentVnpay_app(amount: number, orderDescription: string, id_payment: string): any; /** * @example: * this.vhQueryCafe.createPaymentVnpay(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') .then(link=>{ //Nếu Desktop chạy luôn link này: window.location = response.data; // Nếu Mobile chạy luôn link này trong tag frame html },(error:any)=>{ console.log('error', error); }) * @param platform : "mobile"/"desktop" * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang * @Return Promise => trả về link thanh toán vnpay */ private createPaymentVnpay_Mobile; /** * @example: * let data = {//truyền vào date: new Date(), payment_type: 5, //1 lưu (khách đã thanh toán cho vnpay); 5 lưu tạm (khách chưa thanh toán vnpay), hệ thống sẽ tự động xóa những payment này hoặc trên giao diện hiện ra cho khách tự xóa payment: 990.000, tax: 0, total: 990.000 } * this.vhQueryCafe.createPayment(data) .then((payment)=>{ console.log('createPayment', payment); },(error:any)=>{ console.log('error', error); }) * payment = {//trả về _id, payment_code, id_store, invalid, date payment_type, payment, tax, total } * @param payment : object * @return Promise => payment = {} / error * 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 * @notice : hàm này chỉ dùng tạo những payment_type mà không có phát sinh payment_detail */ createPayment(data: any): Promise; /** * @example: * this.vhQueryCafe.updatePayment('5fb6780ca2148e09806c5b01', {total:990000}) .then((response)=>{ console.log('updatePayment', response); }, error=>{ console.log('error', error); }) * @param id_payment * @param value * @return Promise => response = undefined / error */ updatePayment(id_payment: string, value: any): Promise; /** * @example: * this.vhQueryCafe.deletePayment('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deleteBill', response); }, error=>{ console.log(error, error); }) * @param id_payment * @return Promise => response = undefined / error */ deletePayment(id_payment: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryCafe.getPayments({id_store: {$eq: this.vhAuth.getUser()._id}, payment_type:{$eq:5}}, {},{},0) .then((payments)=>{ console.log('getPayments', payments); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getPayments(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQueryCafe.getPayment('5fb67fda87c0f21d484cbdf3') .then((payment)=>{ console.log('getPayment', payment); }) * @param id_payment * @return Promise => payment ={} or null / error */ getPayment(id_payment: any): Promise; /** * @example: let payment_detail_main = { id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id id_restriction: 'main_package_advanced', //package.id_restriction id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua package_type: 1, //package.package_type, day: 31, //package.day, tax: 0, package.tax, price: 99000, package.price, quantity: 1, //khách chọn payment_detail_type: 1, //1: gói gia hạng mới, 2: gói nâng cấp, 3: gói kéo dài thêm thời gian } this.vhQueryCafe.createPayment_Detail({}) .then((payment_detail)=>{ console.log('createPayment_Detail', payment_detail); },(error:any)=>{ console.log('error', error); }) payment_detail = { _id, id_store, payment_type, activating, invalid, date, id_branch, id_payment, id_restriction, id_package, package_type, payment_type, payment_detail_type, day, tax, price, quantity } * @param data * @return Promise => response = {} / error * 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 */ createPayment_Detail(data: any): any; /** * @example: * this.vhQueryCafe.updatePayment_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((response)=>{ console.log('updatePayment_Detail', response); },(error:any)=>{ reject(error); }) * @param id_payment_detail * @param value * @return Promise => response = undefined / error */ updatePayment_Detail(id_payment_detail: string, value: object): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryCafe.getPayment_details({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0) .then((payment_details)=>{ console.log('getPayment_details', payment_details); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return Promise Array => array = [{},{},...] / error */ getPayment_details(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQueryCafe.getPayment_detail('5fb67fda87c0f21d484cbdf3') .then((payment_detail)=>{ console.log('getPayment_detail', payment_detail); }) * @param id_payment_detail * @return Promise => payment_detail ={} or null / error */ getPayment_detail(id_payment_detail: any): Promise; /** * @example: * this.vhQueryCafe.deletePayment_Detail('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deletePayment_Detail', response); },(error:any)=>{ reject(error); }) * @param id_payment_detail * @return Promise => Promise => response = undefined / error */ deletePayment_Detail(id_payment_detail: string): Promise; /** * @example: * this.vhQueryCafe.getPackage('5fb67fda87c0f21d484cbdf3') .then((package)=>{ console.log('getPackage', package); }) * @param id_package * @return Promise => package ={} or null / error */ getPackage(id_package: any): Promise; /** * @example: * this.vhQueryCafe.extendLicenseValidaty_byLicenseKEY('5fb6780ca2148e09806c5b01', '674fd94a9ace7267deb685fd') .then((response)=>{ console.log('extendLicenseValidaty_byLicenseKEY', response); }, error=>{ console.log('error', error); }) * @param id_branch * @param id_licenseKEY * @return Promise => response = {vcode, msg} * vcode = 0: gia hạn thành công * vcode = 1: id_licenseKEY không thuộc về Store * vcode = 2: id_licenseKEY đã được kích hoạt trước đây * vcode = 3: id_licenseKEY đã bị vô hiệu hóa trước đây */ extendLicenseValidaty_byLicenseKEY(id_branch: string, id_licenseKEY: string): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryCafe.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0) .then((payments)=>{ console.log('getLicenseKEYs', payments); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR * @example: * this.vhQueryCafe.vietqr_getBanks() .then((rsp:any)=>{ if(rsp.vcode === 0){ } }, error=>{ console.log(error) }) * @returns Promise => rsp ={vcode, msg, data(array)} / error * vcode == 0: success */ vietqr_getBanks(): Promise; /** * Tạo mã QR cho Shop quét thanh toán vào tài khoản ngân hàng đã đăng ký Casso * @example: * this.vhQueryCafe.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000) .then((rsp:any)=>{ if(rsp.vcode === 0){ } }, error=>{ console.log(error) }) * @param accountNo: số tài khoản ngân hàng * @param accountName: tên chủ tài khoản * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks()) * @param template: compact2, compact, qr_only, print + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản * @param id_bill: _id của đơn hàng * @param amount: tổng tiền khách phải thanh toán * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error * vcode == 0: success */ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise; private publishObservableEventPromotions; private observableLocalPromotions; /** * @example: * this.observablePromotion = this.vhQueryCafe.getObservableLocalPromotions().subscribe((localPromotions:any) => { do something... }) ngOnDestroy(){ this.observablePromotion.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalPromotions(): Observable; /** * @example: * let promotion = this.vhQueryCafe.getlocalPromotion('5fb6780ca2148e09806c5b01'); * @param id_promotion * @return Object => obj = {} or null */ getlocalPromotion(id_promotion: any): any; /** * @example: * let promotions = this.vhQueryCafe.getlocalPromotions(); * @return Array(object) => array = [{},{},...] */ getlocalPromotions(): any; /** * @example: * this.vhQueryCafe.refreshLocalPromotions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPromotion(), getlocalPromotions() trong localstorage * @return Promise => null */ refreshLocalPromotions(): any; /** * @example: * this.vhQueryCafe.addPromotion({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()}) .then((promotion)=>{ console.log('addPromotion', promotion); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPromotion(data: any): Promise; /** * @example: * this.vhQueryCafe.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updatePromotion', bool); }, error=>{ console.log('error', error); }) * @param id_promotion * @param data * @return Promise => bool = true or false */ updatePromotion(id_promotion: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deletePromotion('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePromotion', bool); }) * @param id_promotion * @return Promise => bool = true or false */ deletePromotion(id_promotion: any): Promise; /** * @example * this.vhQueryCafe.getPromotion('5fb67fda87c0f21d484cbdf3') .then((promotion)=>{ console.log('getPromotion', promotion); }) * @param id_promotion * @return false or object */ getPromotion(id_promotion: string): Promise; /** * @example * this.vhQueryCafe.getPromotions() .then((response)=>{ console.log('getPromotions', response); }) * @return array(object) = [{},{},..] */ getPromotions(): Promise; /** * @example: * this.vhQueryCafe.addPromotion_detail({name:'promition 1'}) .then((promotion_details)=>{ console.log('promotion_details', promotion_details); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPromotion_detail(data: any): Promise; /** * @example: * this.vhQueryCafe.updatePromotion_detail('5fb6780ca2148e09806c5b01', {name:'promoiton 2'}) .then((bool:any)=>{ console.log('updatePromotion_detail', bool); }) * @param id_promotion * @param data * @return Promise => bool = true or false */ updatePromotion_detail(id_promotion: string, data: object): Promise; /** * @example: * this.vhQueryCafe.id_promotion_detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('id_promotion_detail', bool); }) * @param id_promotion_detail * @return Promise => bool = true or false */ deletePromotion_detail(id_promotion_detail: any): Promise; /** * @example * this.vhQueryCafe.getPromotion_detail('5fb67fda87c0f21d484cbdf3') .then((promotion)=>{ console.log('getPromotion_detail', promotion); }) * @param id_promotion * @return false or object */ getPromotion_detail(id_promotion: string): Promise; /** * @example * this.vhQueryCafe.getPromotion_details() .then((response)=>{ console.log('getPromotion_details', response); }) * @return array(object) = [{},{},..] */ getPromotion_details(): Promise; /** * @example let promotion ={ name: "Chuong Trinh Giam Gia 10", date_start: new Date(), date_end: new Date() } let promotion_details =[{ barcode: '01435438426', id_product: 'pro001', id_sub_product: 'pro00105', new_price: 10000, type: 1 },{ barcode: '0989070707786', id_product: 'pro002', id_sub_product: 'pro00201', new_price: 20000, type: 2 }] this.vhQueryCafe.addPromotion_Promotiondetail(promotion, promotion_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param promotion * @param promotion_details * Promise Object => obj = {} * 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 */ addPromotion_Promotiondetail(promotion: any, promotion_details: any): any; /** * @example: * this.vhQueryCafe.updatePromotion_Promotiondetail('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePromotion_Promotiondetail', bool); }, error=>{ console.log('error', error); }) * @param id_promotion * @param promotion * @param promotion_details * @return Promise => bool = true or false */ updatePromotion_Promotiondetail(id_promotion: any, promotion: any, promotion_details: any): any; /** * @example: * this.vhQueryCafe.deletePromotion_Promotiondetail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePromotion_Promotiondetail', bool); }) * @param id_promotion * @return Promise => bool = true or false */ deletePromotion_Promotiondetail(id_promotion: any): Promise; /** * @example * this.vhQueryCafe.getPromotion_details_byId_promotion() .then((promotion_details)=>{ console.log('promotion_details', promotion_details); }) * @return array(object) = [{},{},..] */ getPromotion_details_byId_promotion(id_promotion: any): Promise; /** * * @param starttime * @param endtime * @param array_IDproduct * @return Promise Array => array.length == 0 hợp lệ, được phép tạo promotion; array.length > 0 không hợp lệ, không được phép tạo promotion */ checkNewPromotion(starttime: any, endtime: any, array_IDproduct: any): Promise; /** * * @param starttime * @param endtime * @param array_IDproduct * @param id_promotion * @return Promise Array => array.length == 0 hợp lệ, được phép cập nhật promotion; array.length > 0 không hợp lệ, không được phép cập nhật promotion */ checkOldPromotion(starttime: any, endtime: any, array_IDproduct: any, id_promotion: any): Promise; private publishObservableEventAppSettingNameStations; private observableLocalAppSettingNameStations; /** * Các hàm AppSettingNameStations thêm, xóa, sửa, lấy về thông tin (dạng object) riêng giữa các thiết bi, như: thông tin máy in * @example: * this.observableAppSetting = this.vhQueryCafe.getObservableLocalAppSettingNameStations().subscribe(() => { let info_header_footer_bill = this.vhQueryCafe.getLocalAppSettingNameStation('info_header_footer_bill'); console.log(info_header_footer_bill); }) ngOnDestroy(){ this.observableAppSetting.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameStations(): Observable; /** *@example: this.vhQueryCafe.getLocalAppSettingNameStations() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameStations(): any[]; /** * @example: let appsetting = this.vhQueryCafe.getLocalAppSettingNameStation('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameStation(appsetting_name: any): any; /** * @example: * let appsetting = this.vhQueryCafe.getLocalAppSettingStation('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingStation; /** * Hàm này refresh giá trị mới nhất cho hàm getLocalAppSettingNameStations(), getLocalAppSettingNameStation() trong localstorage * @return Promise => null */ private refreshLocalAppSettingNameStations; /** * @example * this.vhQueryCafe.getAppSettingStations() .then((settings)=>{ console.log('getAppSettings', settings); }) * @return Promise => array(object) = [{},{},..] */ private getAppSettingStations; /** * @example: this.vhQueryCafe.updateAppSettingNameStation('info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameStation(appsetting_name: any, value: any): Promise; /** * @example * this.vhQueryCafe.deleteAppSettingNameStation('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameStation(appsetting_name: any): Promise; private publishObservableEventAppSettingNameBranchs; private observableLocalAppSettingNameBranchs; /** * Các hàm AppSettingNameBranchs thêm, xóa, sửa, lấy vê thông tin (dạng object) riêng giữa các chi nhánh, như: thông tin cửa hàng * @example: * this.observableAppSettingName = this.vhQueryCafe.getObservableLocalAppSettingNameBranchs().subscribe(() => { let store_info = this.vhQueryCafe.getLocalAppSettingNameBranch('store_info'); console.log(store_info); }) ngOnDestroy(){ this.observableAppSettingName.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameBranchs(): Observable; /** * Hàm này dùng lấy về tất cả phân quyền ở cấp độ chi nhánh *@example: this.vhQueryCafe.getLocalAppSettingNameBranchs() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameBranchs(): any[]; /** * Hàm này dùng lấy về phân quyền ở cấp độ chi nhánh * @example: let appsetting = this.vhQueryCafe.getLocalAppSettingNameBranch('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameBranch(appsetting_name: any): any; /** * @example: * let appsetting = this.vhQueryCafe.getLocalAppSettingBranch('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingBranch; /** * Hàm này dùng cập nhật phân quyền ở cấp độ chi nhánh * @example: this.vhQueryCafe.updateAppSettingNameBranch('info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameBranch(appsetting_name: any, value: any): Promise; /** * @example * this.vhQueryCafe.deleteAppSettingNameBranch('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameBranch(appsetting_name: any): Promise; /** * @Usage : Hàm này lấy về tiền chiết khấu trên tổng giá trị hàng hóa bán ra của mỗi đơn hàng theo hạng khách mua hàng * @example : * let discount = this.vhQueryCafe.getDiscount_bill_byCustomer(43000000, '7YLcm0cFKLu2KaQQ8cyv'); * @param total_price : Tổng giá * @param id_customer * @returns Object or null => obj = {discount}, discount là số tiền đc chiết khấu, * trả về null nghĩa là khách hàng này không có chiết khấu theo hóa đơn */ getDiscount_bill_byCustomer(total_price: number, id_customer: any): { discount: number; } | null; /** * @Usage :Hàm này dùng trong page CHIẾT KHẤU KHÁCH HÀNG -> Chọn TẤT CẢ hoặc MỘT khách hàng * @notice : Mỗi công thức chiết khấu có 5 mức (level1, level2, level3, level4, level5), giá trị doanh số (sales) level sau phải lơn hơn level trước * type : 1 chiết khấu %, 2 chiết khấu tiền * method : 1 phương pháp tính theo từng mức, 2 phương pháp tính theo mức cuối * usage: 1 chiết khấu trên hóa đơn, 2 chiết khấu trên doanh số * @example : * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportDiscount_sales_Customers(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((discounts)=>{ console.log('discounts', discounts); console.log('discounts.docs[0]', discounts.docs[0]); }) * @param starttime * @param endtime * @param IDcustomer : 'all' or id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, discount_name,sales_btax, discount_btax, sales_atax, discount_atax} */ getReportDiscount_sales_Customers(starttime: any, endtime: any, IDcustomer: any, IDbranch?: string): Promise; /** * @Usage :Hàm này dùng trong page HOA HỒNG hạng NHÂN VIÊN -> Chọn TẤT CẢ hoặc MỘT nhân viên * @notice : Mỗi công thức chiết khấu có 5 mức (level1, level2, level3, level4, level5), giá trị doanh số (sales) level sau phải lơn hơn level trước * type : 1 chiết khấu %, 2 chiết khấu tiền * method : 1 phương pháp tính theo từng mức, 2 phương pháp tính theo mức cuối * @example : * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportCommission_Employees(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((commissions)=>{ console.log('commissions', commissions); console.log('commissions.docs[0]', commissions.docs[0]); }) * @param starttime * @param endtime * @param IDemployee : 'all' or id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, commission_name, sales_btax, commission_btax, sales_atax, commission_atax} */ getReportCommission_Employees(starttime: any, endtime: any, IDemployee: any, IDbranch?: string): Promise; /** * VhQueryCafe: * cashbook_first: tiền mặt đầu kỳ (starttime), * income: tiền thu trong kỳ * expenditure: tiền chi trong kỳ * cashbook_last: tiền mặt cuối kỳ (endtime) * IDwallet = 'all' hoặc id_wallet của ví nào đó * @param IDbranch : 'all' or id_branch * @notice : ở giao diện APP, chọn IDbranch rồi mới hiện ra những IDwallet của chi nhánh đó để chọn tiếp. Nếu IDbranch = 'all' thì IDwallet phải là 'all' */ getReportCashBook(starttime: any, endtime: any, IDwallet: any, IDbranch?: any): Promise; private getReportCashBook_oldnew; private getReportCashBook_old; /** * vhQueryCafe * Hàm này chỉ chạy trên giao diện Desktop * @returns Promise */ private syncCashBookEveryDay_Stock1stDayOfMonth; /** * Cafe: * @example: * let DayArray = this.get1stDayOfMonthArray(store.registrationdate, serverdate); * @param startdate * @param enddate * @returns */ private get1stDayOfMonthArray; /** * Hàm này kiểm tra ngày tạo bill, sửa bill đã chọn có hợp lệ không * Ngày hợp lệ phải thỏa mãn: * 1. phải sau ngày cửa hàng đăng ký sử dụng phần mềm cafe viethas * 2. thuộc tháng mà trước tháng hiện tại 1 tháng * @example: * this.vhQueryCafe.getValidityDate('2021-06-18T16:27:16.276Z') .then((validitydate)=>{ if(validitydate) console.log('Bạn chỉ có thể tạo/chỉnh sửa hóa đơn này từ ngày', validitydate); }) * @param date (String or Date): ngày tạo bill, sửa bill * @returns Promise => validitydate = null nếu hợp lệ; validitydate != null nếu không hợp lệ, và từ ngày validitydate trở đi là có thể tạo bill và sửa bill */ getValidityDate(date: any): Promise; /** * VhQueryCafe: đã check * @param starttime * @param endtime * @param id_wallet là 'all' hoặc id của ví nào đó * @param id_cashier là 'all' hoặc id của thu ngân nào đó * @param array_bill_type * array_bill_type (all) = [1,7,10,11,34,2,8,12,33]; thu:1,7,10,11,34 - chi: 2,8,12,33 * */ getReportIncomeExpenditureDiary(starttime: any, endtime: any, id_wallet: any, id_employee: any, array_bill_type: any, IDbranch?: string): Promise; /** * @example: * let endtime = new Date(); * let starttime = new Date('2020-07-01T05:24:00'); * this.vhQueryCafe.getDebtSuppliers(starttime, endtime, 'yewwg44667njdt443s', 'gtrtyery56646577456') .then((debts)=>{ console.log('getDebtSuppliers', debts); }) * @param starttime * @param endtime * @param IDsuppiler: id_supplier hoặc 'all' * @param IDbranch: id_branch hoặc 'all' * @return JSON(Array) => json.docs = [{id, name, index, debt, payment, rest,...},{},....] * Lưu ý: giá trị này trả về dạng array */ getDebtSuppliers(starttime: any, endtime: any, IDsuppiler: string, IDbranch?: string): Promise; /** * CÔNG NỢ KHÁCH HÀNG * @example: * let endtime = new Date(); * let starttime = new Date('2020-07-01T05:24:00'); * this.vhQueryCafe.getDebtCustomers(starttime, endtime, 'yewwg44667njdt443s', 'gtrtyery56646577456') .then((debts)=>{ console.log('getDebtCustomers', debts); }) * @param starttime * @param endtime * @param IDcustomer: id_customer hoặc 'all' * @param IDbranch: id_branch hoặc 'all' * @return JSON(Array) => json.docs = [{id, name, index, debt, payment, rest,...},{},....] * Lưu ý: giá trị này trả về dạng array */ getDebtCustomers(starttime: any, endtime: any, IDcustomer: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC (layer 1) -> Chọn TẤT CẢ hoặc MỘT danh mục * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Categorys_byCategorys(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDcategory = 'all' or id_category * @param IDbranch : 'all' or id_branch * @param type = 1 là món, = 2 là dịch vụ, = 3 là nguyên liệu, = 4 là topping, = 5 combo, =1234 món - dịch vụ - nguyên liệu - topping * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, id_category, quantity, sales_btax, sales_atax} */ getReportSales_Categorys_byCategorys(starttime: any, endtime: any, IDcategory: any, type?: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC (layer 2) -> Chọn TẤT CẢ hoặc MỘT sản phẩm -> Chọn một danh mục trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Categorys_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_category * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_product, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Categorys_byProducts(starttime: any, endtime: any, id_category: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC (layer 3) -> Chọn TẤT CẢ hoặc MỘT danh mục -> Chọn một danh mục trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Categorys_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Categorys_byProduct(starttime: any, endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHU VỰC (layer 1) -> Chọn TẤT CẢ hoặc MỘT khu vực * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Areas_byAreas(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDarea = 'all' or id_area * @param IDbranch = 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, id_category, quantity, sales_btax, sales_atax} */ getReportSales_Areas_byAreas(starttime: any, endtime: any, IDarea: any, IDbranch?: string): Promise; private getReportSales_Areas_byAreas_old; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC KHU VỰC (layer 2) -> Chọn TẤT CẢ hoặc MỘT khu vực -> Chọn một khu vực món trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Areas_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_area * @param IDbranch = 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_product, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ private getReportSales_Areas_byProducts; /** * @Usage Hàm này dùng trong page DOANH SỐ KHU VỰC (layer 2) -> Chọn TẤT CẢ hoặc MỘT khu vực -> Chọn một khu vực trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Areas_byProducts_Vouchers_PaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_area * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, ptype, hoặc id_voucher, vtype, hoặc id_payment_card, pctype, index, name, barcode, unit, img, id_area, quantity, sales_btax, sales_atax} */ getReportSales_Areas_byProducts_Vouchers_PaymentCards(starttime: any, endtime: any, id_area: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một voucher trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Areas_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_area * @param id_voucher: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_voucher, vtype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Areas_byVoucher(starttime: any, endtime: any, id_area: string, id_voucher: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một payment_card trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Areas_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_area * @param id_payment_card: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_payment_card, pctype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Areas_byPaymentCard(starttime: any, endtime: any, id_area: string, id_payment_card: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHU VỰC (layer 3) -> Chọn TẤT CẢ hoặc MỘT khu vực -> Chọn một khu vực trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Areas_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_area * @param id_product * @param IDbranch = 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, id_subproduct, salesman} */ getReportSales_Areas_byProduct(starttime: any, endtime: any, id_area: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ MÓN, DỊCH VỤ, NGUYÊN LIỆU, TOPPING, COMBO (layer 1) -> Chọn tất cả hoặc một MÓN, DỊCH VỤ, NGUYÊN LIỆU, TOPPING, COMBO * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Products_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all'/id_subproduct/id_product * @param type = 1 là món, = 2 là dịch vụ, = 3 là nguyên liệu, = 4 là topping, = 5 combo, =1234 món - dịch vụ - nguyên liệu - topping * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Products_byProducts(starttime: any, endtime: any, IDsub_or_product: any, type: number, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ MÓN, DỊCH VỤ, NGUYÊN LIỆU, TOPPING, COMBO (layer 2) -> Chọn tất cả hoặc một MÓN, DỊCH VỤ, NGUYÊN LIỆU, TOPPING, COMBO -> Chọn một MÓN, DỊCH VỤ, NGUYÊN LIỆU, TOPPING, COMBO trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Products_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_sub_or_product : id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Products_byProduct(starttime: any, endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ COMBO (layer 1) -> Chọn TẤT CẢ hoặc MỘT combo * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Combos_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDproduct : 'all'/id_product (của combo) * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Combos_byProducts(starttime: any, endtime: any, IDproduct: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ COMBO (layer 2) -> Chọn TẤT CẢ hoặc MỘT combo -> Chọn MỘT combo trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Combos_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Combos_byProduct(starttime: any, endtime: any, id_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ VOUCHER (layer 1) -> Chọn TẤT CẢ hoặc MỘT voucher * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Vouchers_byVouchers(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDvoucher : 'all'/id_voucher * @param vtype = 1 là voucher * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Vouchers_byVouchers(starttime: any, endtime: any, IDvoucher: any, vtype: number, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ PAYMENT_CARD (layer 1) -> Chọn TẤT CẢ hoặc MỘT payment_card * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_PaymentCards_byPaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDpayment_card : 'all'/id_payment_card * @param pctype = 1 là payment_card * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_PaymentCards_byPaymentCards(starttime: any, endtime: any, IDpayment_card: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ VOUCHER (layer 2) -> Chọn TẤT CẢ hoặc MỘT voucher -> Chọn MỘT sản phẩm trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Vouchers_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_voucher * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Vouchers_byVoucher(starttime: any, endtime: any, id_voucher: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ PAYMENT_CARD (layer 2) -> Chọn TẤT CẢ hoặc MỘT payment_card -> Chọn MỘT payment_card trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_PaymentCards_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_payment_card * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_PaymentCards_byPaymentCard(starttime: any, endtime: any, id_payment_card: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 1) -> Chọn TẤT CẢ hoặc MỘT khách hàng * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Customers_byCustomers(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDcustomer : 'all' or id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, id_customer, quantity, sales_btax, sales_atax} */ getReportSales_Customers_byCustomers(starttime: any, endtime: any, IDcustomer: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 2) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Customers_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_customer, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ private getReportSales_Customers_byProducts; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Customers_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman, customer} */ getReportSales_Customers_byProduct(starttime: any, endtime: any, id_customer: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 2) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Customers_byProducts_Vouchers_PaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, ptype, hoặc id_voucher, vtype, hoặc id_payment_card, pctype, index, name, barcode, unit, img, id_customer, quantity, sales_btax, sales_atax} */ getReportSales_Customers_byProducts_Vouchers_PaymentCards(starttime: any, endtime: any, id_customer: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một voucher trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Customers_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_voucher: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_voucher, vtype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Customers_byVoucher(starttime: any, endtime: any, id_customer: string, id_voucher: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một payment_card trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Customers_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_payment_card: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_payment_card, pctype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Customers_byPaymentCard(starttime: any, endtime: any, id_customer: string, id_payment_card: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 1) -> Chọn TẤT CẢ hoặc MỘT nhân viên * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Employees_byEmployees(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDemployee = 'all' or id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, id_employee, quantity, sales_btax, sales_atax} */ getReportSales_Employees_byEmployees(starttime: any, endtime: any, IDemployee: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH KHÁCH NHÂN VIÊN (layer 2) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Employees_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_employee, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ private getReportSales_Employees_byProducts; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 3) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Employees_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param id_sub_or_product : id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, type, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Employees_byProduct(starttime: any, endtime: any, id_employee: string, id_sub_or_product: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 3) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra -> Chọn một voucher trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Employees_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param id_voucher: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_voucher, vtype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Employees_byVoucher(starttime: any, endtime: any, id_employee: string, id_voucher: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 3) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra -> Chọn một payment_card trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Employees_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param id_payment_card: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_payment_card, pctype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Employees_byPaymentCard(starttime: any, endtime: any, id_employee: string, id_payment_card: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 2) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra * Hàm đã bao gồm doanh số bán voucher và payment_card * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Employees_byProducts_Vouchers_PaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, ptype, hoặc id_voucher, vtype, hoặc id_payment_card, pctype, index, name, barcode, unit, img, id_employee, quantity, sales_btax, sales_atax} */ getReportSales_Employees_byProducts_Vouchers_PaymentCards(starttime: any, endtime: any, id_employee: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ BÀN (layer 1) -> Chọn TẤT CẢ hoặc MỘT bàn * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Tables_byTables(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDtable = 'all' or id_table * @param IDbranch : 'all' or id_branch * @param type = 1 là sản phẩm, = 2 là dịch vụ, = 3 là nguyên liêu, ko truyền vào hoặc giá trị khác là cả ba * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, id_product, quantity, sales_btax, sales_atax} */ getReportSales_Tables_byTables(starttime: any, endtime: any, IDtable: any, IDbranch?: string): Promise; private getReportSales_Tables_byTables_old; /** * @Usage Hàm này dùng trong page DOANH KHÁCH HÀNG (layer 2) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một sản phẩm trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Tables_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_table * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_table, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ private getReportSales_Tables_byProducts; /** * @Usage Hàm này dùng trong page DOANH SỐ BÀN (layer 3) -> Chọn TẤT CẢ hoặc MỘT bàn -> Chọn một bàn trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Tables_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_table * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, id_subproduct, salesman} */ getReportSales_Tables_byProduct(starttime: any, endtime: any, id_table: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ BÀN (layer 2) -> Chọn tất cả hoặc một BÀN -> Chọn một BÀN trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Tables_byProducts_Vouchers_PaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_table * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, ptype, hoặc id_voucher, vtype, hoặc id_payment_card, pctype, index, name, barcode, unit, img, id_table, quantity, sales_btax, sales_atax} */ getReportSales_Tables_byProducts_Vouchers_PaymentCards(starttime: any, endtime: any, id_table: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ BÀN (layer 3) -> Chọn tất cả hoặc một BÀN -> Chọn một BÀN trong list hiện ra -> Chọn một voucher trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Tables_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_table * @param id_voucher: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_voucher, vtype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Tables_byVoucher(starttime: any, endtime: any, id_table: string, id_voucher: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ BÀN (layer 3) -> Chọn tất cả hoặc một BÀN -> Chọn một BÀN trong list hiện ra -> Chọn một payment_card trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Tables_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_table * @param id_payment_card: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_payment_card, pctype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Tables_byPaymentCard(starttime: any, endtime: any, id_table: string, id_payment_card: string, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TRẢ -> tất cả các trường hợp * @example: * let starttime = new Date('2020-12-10T05:24:00'); let endtime = new Date(); this.vhQueryCafe.getReportInputOutputReturns_byTime_byIDProduct_byBillTypeArray(starttime, endtime, 'all', 1, [1]) .then((products)=>{ console.log('products', products); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all' or id_subproduct or id_product (type 3) * @param IDbranch : 'all' or id_branch * @param ptype * @param array_bill_type * @return Promise Array * @Notice array_bill_type = [bill_types];[1,3,10,30,38,41,51,2,9,16,31,39] */ getReportInputOutputReturns_byTime_byIDMaterial_byBillTypeArray(starttime: any, endtime: any, IDsub_or_product: string, array_bill_type: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TRẢ NGUYÊN LIỆU (xem từng loại bill_type một) -> tất cả các trường hợp * @example: * let starttime = new Date('2020-12-10T05:24:00'); let endtime = new Date(); this.vhQueryCafe.getReportInputOutputReturns_byTime_byIDMaterial_byBillTypeArray(starttime, endtime, 'all', 1, [1]) .then((materials)=>{ console.log('materials', materials); }) * @param starttime * @param endtime * @param IDmaterial : id_material = 'all' or id_material; * @param ptype * @param array_bill_type * @param IDbranch * @return Promise Array * @Notice array_bill_type = [bill_type], 1,3,10,30,2,9,16,31 */ private getReportInputOutputReturns_byTime_byIDMaterial_byBillTypeArray_old; /** * Hàm này dùng trong page XUẤT-NHẬP-TRẢ NGUYÊN LIỆU (xem từng loại bill_type một) -> tất cả các trường hợp -> chi tiết * @example: * this.vhQueryCafe.getReportInputOutputReturns_Detail_byTime_byIDMaterial_byBillTypeArray(time['startTime'], time['endTime'], 'UTWXdaU3UDq3xq7aK77p', [1]) .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param id_material * @param array_bill_type * @return Promise Array * @Notice array_bill_type = [bill_type], 1,3,10,30,2,9,16,31 */ getReportInputOutputReturns_Detail_byTime_byIDMaterial_byBillTypeArray(starttime: any, endtime: any, IDsub_or_product: any, array_bill_type: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN -> Xuất nhập tồn * @example: * this.vhQueryCafe.getReportInputOutputInventory_byTime_byIDMaterial(starttime , endtime, 'all', 'tj1iYodbVoShwtEetACx') .then((json)=>{ console.log('json', json); }) * @param starttime * @param endtime * @param IDsub_or_product: 'all' or id_subproduct or id_product; * @param IDbranch: 'all' or id_branch; * @return Promise Array * * @Notice bill_type = [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportInputOutputInventory_byTime_byIDMaterial(starttime: any, endtime: any, IDsub_or_product: any, IDbranch: any): Promise; /** * Hàm này kiểm tra các detailproducts (type=1) nào đã thỏa mãn 60days mà chưa có ký sinh inventory trong sản phẩm thì sẽ gọi hàm * syncInventoryEveryDay_Stock1stDayOfMonth để tính lại * @example: * this.vhQueryCafe.checkAndsyncInventoryOfMaterials(endtime, 'all') .then(()=>{ }) */ private checkAndsyncInventoryOfMaterials; private getReportInputOutputInventory_byTime_byIDMaterial1; /** * Hàm này kiểm tra, tính toán tồn kho cho nguyên liệu theo thuật toán 60days lúc khởi động Desktop hoặc Mobile: * + Nếu nguyên liệu nào mà tháng gần nhất chưa tính thì hàm sẽ tính * + Nếu nguyên liệu mới thêm vào thì hàm sẽ tính * vhQueryCafe * @returns */ private syncInventoryEveryDay_Stock1stDayOfMonth; private syncInventoryEveryDay_Stock1stDayOfMonth_old; /** * Hàm này dùng trong page Tồn kho, giá trị tồn kho NGUYÊN LIỆU (type=3), doanh số, chi phí nhập hàng tại một thời điểm endtime nào đó * @example: * this.vhQueryCafe.getReportInputOutputInventory_byEndTime_byIDMaterial(endtime, 'all') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all' or id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @return Promise Array * @Notice bill_type = [1,10,30,2,9,16,31] */ getReportInputOutputInventory_byEndTime_byIDMaterial(endtime: any, IDsub_or_product: any, IDbranch: string): Promise; /** * 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 đó -> chi tiết của một nguyên liệu nào đó * Lấy về chi tiết xuất nhập của 1 nguyên liệu nào đó trong từ 0h ngày 1 đến thời điểm endtime * @example: * this.vhQueryCafe.getReportInputOutputInventory_Detail_byEndTime_byIDMaterial(endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @Notice bill_type = [1,3,10,30,38,41,51,2,9,16,31,39] */ getReportInputOutputInventory_Detail_byEndTime_byIDMaterial(endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page Tồn kho, giá trị tồn kho NGUYÊN LIỆU (type=3), doanh số, chi phí nhập hàng tại một thời điểm endtime nào đó -> chi tiết của một sản phẩm nào đó * @example: * this.vhQueryCafe.getReportInputOutputInventory_Detail_byEndTime_byIDMaterial(endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param id_material * @param IDbranch : 'all' or id_branch * @Notice bill_type = [1,3,10,30,2,9,16,31] */ private getReportInputOutputInventory_Detail_byEndTime_byIDMaterial_old; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN NGUYÊN LIỆU (type=3) -> Xuất nhập tồn -> chi tiết * @example: * this.vhQueryCafe.getReportInputOutputInventory_Detail_byTime_byIDMaterial(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param id_material * @param IDbranch = 'all' or id_branch * @Notice bill_type = [1,3,10,30,2,9,16,31] */ getReportInputOutputInventory_Detail_byTime_byIDMaterial(starttime: any, endtime: any, id_material: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN NGUYÊN LIỆU (type=3)-> Xuất nhập hàng * @example: * this.vhQueryCafe.getReportInputOutput_byTime_byIDMaterial(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all' or id_subproduct or id_product; * @param IDbranch * @return Promise Array * @Notice id_product = 'all' or id_product; * @Notice IDbranch = 'all' or id_branch; * @Notice bill_type = [1,3,10,30,38,41,51,2,16,31,39] */ getReportInputOutput_byTime_byIDMaterial(starttime: any, endtime: any, IDsub_or_product: string, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN NGUYÊN LIỆU (type=3)-> Xuất nhập hàng * @example: * this.vhQueryCafe.getReportInputOutput_byTime_byIDMaterial(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param IDmaterial = 'all' or id_material; * @param IDbranch = 'all' or id_branch * @return Promise Array * @Notice bill_type = [1,3,10,30,2,9,16,31] */ private getReportInputOutput_byTime_byIDMaterial_old; /** * Hàm này chỉ dùng cho NGUYÊN LIỆU (type=3) * Hàm này dùng trong page XUẤT-NHẬP-TỒN NGUYÊN LIỆU -> Xuất nhập hàng -> chi tiết * @example: * this.vhQueryCafe.getReportInputOutput_Detail_byTime_byIDMaterial(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p','sdfwe23qw245234t3') .then((bill_details:any)=>{ console.log('vhs_bill_details_', bill_details); }) * @param starttime * @param endtime * @param id_sub_or_product: id_subproduct or id_product; * @param IDbranch = 'all' or id_branch; * @Notice bill_type = [1,3,10,30,2,9,16,31] */ getReportInputOutput_Detail_byTime_byIDMaterial(starttime: any, endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @example: * let hour_array: Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportRevenue_byHoursOut_hourArray(starttime, endtime, hour_array) .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportRevenue_byHoursOut_hourArray(starttime: any, endtime: any, hour_array: any, IDbranch?: string): Promise; /** * @example: * let day_array: Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportRevenue_byDaysOut_dayArray(starttime, endtime, day_array) .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param day_array * @param IDbranch : 'all' or id_branch * @notice Doanh thu thì ko có thuế */ getReportRevenue_byDaysOut_dayArray(starttime: any, endtime: any, day_array: any, IDbranch?: string): Promise; /** * VhQuerySales: đã check * @example: * let month_array: Array = [0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportRevenue_byMonthsOut_monthArray(starttime, endtime, month_array) .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param month_array * @param IDbranch : 'all' or id_branch */ getReportRevenue_byMonthsOut_monthArray(starttime: any, endtime: any, month_array: any, IDbranch?: string): Promise; /** * lấy về mảng json.docs(array) doanh thu theo một hoặc tất cả các chi nhánh * @example: this.vhQueryCafe.getReportRevenue_byIDbranch(starttime, endtime, 'dfs3fw3tr3g2a1rgmfg2h1') .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param IDbranch : 'all' or id_branch * @return : * json = {docs(array), empty(boolean), size(number), revenue(number)} * trong đó docs = [{name(string), id_branch(string), revenue(number)}] */ getReportRevenue_byIDbranch(starttime: any, endtime: any, IDbranch?: string): Promise; /** * @example: * let hour_array: Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_byHoursOut_hourArray(starttime, endtime, hour_array) .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportSales_byHoursOut_hourArray(starttime: any, endtime: any, hour_array: any, IDbranch?: string): Promise; /** * @example: * let day_array: Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_byDaysOut_dayArray(starttime, endtime, day_array) .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportSales_byDaysOut_dayArray(starttime: any, endtime: any, day_array: any, IDbranch?: string): Promise; /** * lấy về mảng json.docs(array) doanh số theo 12 tháng trong năm * @example: * let month_array: Array = [0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_byMonthsOut_monthArray(starttime, endtime, month_array) .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportSales_byMonthsOut_monthArray(starttime: any, endtime: any, month_array: any, IDbranch?: string): Promise; /** * lấy về mảng json.docs(array) doanh số theo một hoặc tất cả các chi nhánh * @example: this.vhQueryCafe.getReportSales_byIDbranch(starttime, endtime, 'fda3s2fd1a3sgghdfg1h') .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param IDbranch : 'all' or id_branch * @return : * json = {docs(array), empty(boolean), size(number), sales_btax(number), sales_atax(number)} * trong đó docs = [{name(string), id_branch(string), sales_btax(number), sales_atax(number)}] */ getReportSales_byIDbranch(starttime: any, endtime: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page SẢN PHẨM CÓ DOANH SỐ BÁN GIẢM DẦN * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Products_byTime_DESC(starttime, endtime) .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Products_byTime_DESC(starttime: any, endtime: any): Promise; /** * @Usage Hàm này dùng trong page DANH MỤC CÓ DOANH SỐ BÁN GIẢM DẦN * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQueryCafe.getReportSales_Categorys_byTime_DESC(starttime, endtime) .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, id_category, quantity, sales_btax, sales_atax} */ getReportSales_Categorys_byTime_DESC(starttime: any, endtime: any): Promise; /** * lấy về danh sách sản phẩm đã hết hàng * @example: * this.vhQueryCafe.getReportMaterials_byOutOfStock() .then((products)=>{ console.log(products); }) * @param IDbranch: 'all' or id_branch; */ getReportMaterials_byOutOfStock(id_branch: string): Promise; private getReportMaterials_byOutOfStock_old; /** * lấy về danh sách sản phẩm sắp hết hàng * @example: * this.vhQueryCafe.getReportMaterials_byLowInStock() .then((products)=>{ console.log(products); }) * @param IDbranch: 'all' or id_branch; */ getReportMaterials_byLowInStock(id_branch: any): Promise; private getReportMaterials_byLowInStock_old; private makeCorrectQuantityMaterials; /** * lấy về 1 bảng báo cáo kiểm kho (report) theo cấu trúc json ở dưới, nếu có cân bằng kho thì lấy về chung luôn * @example: * this.vhQueryCafe.getReportInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((reports)=>{ console.log('getReportInventoryTime_byTimes',reports); }) * @param id_inventorytime * @return Promise json = {docs(array), empty(boolean), size(number), total_stock(number), realstock, total_inventorynotes(array)} * docs(array) --> {id_product(string), id_subproduct(string), lots(array), name(string), img(string), ratio(number), barcode(string), unit(string), stock(number), inventorynotes(array), deviation(number), note(string), balance_quantity(number), balance_cause(string)} * inventorynotes(array) --> [{bill_code(string), quantity(number)},{},...] */ getReportInventoryTime_byTimes(id_inventorytime: any): Promise; /** * lấy về 1 bảng báo cáo (report) theo cấu trúc json ở dưới * @example: * this.vhQueryCafe.getReportInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((reports)=>{ console.log('reports',reports); }) * @param id_inventorytime * @return Promise json = {docs(array), empty(boolean), size(number), total_stock(number), total_inventorynotes(array)} * docs(array) --> {id(string), data()(object), stock(number), inventorynotes(array)} * inventorynotes(array) --> [{bill_code(string), quantity(number)},{},...] */ private getReportInventoryTime_byTimes_old; /** * Tạo cân bằng kho * @example: * this.vhQueryCafe.createBalanceInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((bool:any)=>{ console.log('createBalanceInventoryTime_byTimes',bool); }) * @param id_inventorytime * @return Promise boolean => true or false */ createBalanceInventoryTime_byTimes(id_inventorytime: any): Promise; /** * Xóa cân bằng kho * @example: * this.vhQueryCafe.deleteBalanceInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((bool:any)=>{ console.log('deleteBalanceInventoryTime_byTimes',bool); }) * @param id_inventorytime * @return Promise boolean => true or false */ deleteBalanceInventoryTime_byTimes(id_inventorytime: any): Promise; /***************************************************************************************************** ******************************* CHƯƠNG TRÌNH BÁN HÀNG CAFE VIETHAS*********************************************** *****************************************************************************************************/ /******************************************TÍCH ĐIỂM THEO HÓA ĐƠN*************************************/ /** * @example: * let data ={ name : 'chương trình tích điểm hóa đơn', exchange :{ money : 100000, points : 1 }, bill_total_minimum :0, payment :{ enable : true, money : 100000, points : 1 }, include_discount: false, include_promotion_product : false, include_paid_points : false, include_tax : false, include_fee : false, //id_branch : '5fb6780ca2148e09806c5b01', //trong hàm đã thêm vào earned_points_clear_auto:{ enable, months_of_year: 1 } } this.vhQueryCafe.addEarningPointsBill(data) .then((earningpoint)=>{ console.log('addEarningPointsBill', earningpoint); },(error:any)=>{ console.log('error', error); }) * @param data * @return Promise => obj = {} */ addEarningPointsBill(data: any): Promise; /** * @example: let data ={ name : 'chương trình tích điểm hóa đơn', exchange :{ money : 100000, points : 1 }, bill_total_minimum :0, payment :{ enable : true, money : 100000, points : 1 }, include_discount: false, include_promotion_product : false, include_paid_points : false, include_tax : false, include_fee : false, id_branch : '5fb6780ca2148e09806c5b01' } * @param id_earning_points_bill * @param data * @return Promise => bool = true or false */ updateEarningPointsBill(id_earning_points_bill: string, data: object): Promise; /** * @example: * this.vhQueryCafe.deleteEarningPointsBill('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteEarningPointsBill', bool); }) * @param id_earning_points_bill * @return Promise => bool = true or false */ deleteEarningPointsBill(id_earning_points_bill: string): Promise; /** * @example * this.vhQueryCafe.getEarningPointsBill('5fb67fda87c0f21d484cbdf3') .then((earning_points_bill)=>{ console.log('getEarningPointsBill', earning_points_bills); },(error:any)=>{ reject(error); }) * @param id_earning_points_bill * @return Promise => obj ={} or null */ getEarningPointsBill(id_earning_points_bill: string): Promise; /** * @example * this.vhQueryCafe.getEarningPointsBills() .then((earning_points_bills)=>{ console.log('getEarningPointsBills', earning_points_bills); }) * @return Promise => array(object) = [{},{},..] */ getEarningPointsBills(): Promise; /** * @example: * let data ={ name : 'chương trình tích điểm sản phẩm', exchange :{ money : 100000, points : 1 }, payment :{ enable : true, money : 100000, points : 1 }, products:['05ztAR5h3UslYo70Amut','0S8NOcG8wEUYWVo1weHV','0tmbM5SyGe5O1mvuh61l',...], include_promotion_product : false, include_paid_points : false, //id_branch : '5fb6780ca2148e09806c5b01' //trong hàm đã thêm vào } this.vhQueryCafe.addEarningPointsProduct(data) .then((res)=>{ console.log('addEarningPointsProduct', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addEarningPointsProduct(data: any): Promise; /** * @example: let data ={ name : 'chương trình tích điểm sản phẩm', exchange :{ money : 100000, points : 1 }, payment :{ enable : true, money : 100000, points : 1 }, include_promotion_product : false, include_paid_points : false, id_branch : '5fb6780ca2148e09806c5b01' } * this.vhQueryCafe.updateEarningPointsProduct(id_earning_points_product,data) .then((bool:any)=>{ console.log('updateEarningPointsProduct', bool); }, error=>{ console.log('error', error); }) * @param id_earning_points_product * @param data * @return Promise => bool = true or false */ updateEarningPointsProduct(id_earning_points_product: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deleteEarningPointsProduct('654QFNMOIYUENC321') .then((bool:any)=>{ console.log('deleteEarningPointsProduct', bool); }, error=>{ console.log('error', error); }) * @param id_earning_points_product * @return Promise => bool = true or false */ deleteEarningPointsProduct(id_earning_points_product: any): Promise; /** * @example: * this.vhQueryCafe.getEarningPointsProduct('654QFNMOIYUENC321') .then((res)=>{ console.log('getEarningPointsProduct', res); }, error=>{ console.log('error', error); }) * @param id_earning_points_product * @return Promise => object or null */ getEarningPointsProduct(id_earning_points_product: any): Promise; /** * @example: * this.vhQueryCafe.getEarningPointsProducts() .then((arr)=>{ console.log('getEarningPointsProducts', arr); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getEarningPointsProducts(): Promise; /** * @example: * this.vhQueryCafe.addEmployeeClass({name : "Gold"}) .then((res)=>{ console.log('addEmployeeClass', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addEmployeeClass(data: any): Promise; /** * @example: * this.vhQueryCafe.updateEmployeeClass('KNOVIYWKN135468',{id_commission : "321SDWC65DWSVDFS"}) .then((bool:any)=>{ console.log('updateEmployeeClass', bool); }, error=>{ console.log('error', error); }) * @param id_employee_class * @param data * @return Promise => bool = true or false */ updateEmployeeClass(id_employee_class: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deleteEmployeeClass('KNOVIYWKN135468') .then((bool:any)=>{ console.log('deleteEmployeeClass', bool); }, error=>{ console.log('error', error); }) * @param id_employee_class * @return Promise => bool = true or false */ deleteEmployeeClass(id_employee_class: any): Promise; /** * @example: * this.vhQueryCafe.getEmployeeClass('KNOVIYWKN135468') .then((res)=>{ console.log('getEmployeeClass', res); }, error=>{ console.log('error', error); }) * @param id_employee_class * @return Promise => object or null */ getEmployeeClass(id_employee_class: any): Promise; /** * @example: * this.vhQueryCafe.getEmployeeClasss() .then((array:any)=>{ console.log('getEmployeeClasss', array); }, error=>{ console.log('error', error); }) * @param id_employee_class * @return Promise => Array */ getEmployeeClasss(): Promise; /** * trong local chưa có * @example: * let employee_classs = this.vhQueryCafe.getlocalEmployeeClasss() * @param data * @return Array */ getlocalEmployeeClasss(): void; /** * trong local chưa có * @example: * let employee_class = this.vhQueryCafe.getlocalEmployeeClass('321987965DOIUEHN') * @param id_employee_class * @return object or null */ getlocalEmployeeClass(id_customer_class: any): void; /** * @example: * let data = { * name:"Phiếu thanh toán 100k", * value : 100000, * point : 1000, * id_design_barcode : "", * //id_branch :" 316OIUHLKMLSDYW235" //trong hàm đã có thêm vào * } * this.vhQueryCafe.addCoupon(data) .then((res)=>{ console.log('addCoupon', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addCoupon(data: any): Promise; /** * @example: * let data = { * name:"Phiếu thanh toán 100k", * value : 100000, * point : 1000, * id_design_barcode : "", * } * this.vhQueryCafe.updateCoupon('FBHYWIBDNIUH1321687',data) .then((bool:any)=>{ console.log('updateCoupon', bool); }, error=>{ console.log('error', error); }) * @param data * @param id_coupon * @return Promise => bool = true or false */ updateCoupon(id_coupon: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deleteCoupon("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteCoupon', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_coupon * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do coupon đã được phát hành, vui lòng xóa đợt phát hành liên quan */ deleteCoupon(id_coupon: any): Promise; /** * @example: * * this.vhQueryCafe.getCoupon('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getCoupon', res); }, error=>{ console.log('error', error); }) * @param id_coupon * @return Promise => object or null */ getCoupon(id_coupon: any): Promise; /** * @example: * this.vhQueryCafe.getCoupons() .then((res)=>{ console.log('getCoupons', res); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getCoupons(): Promise; /** * @example: * this.vhQueryCafe.addCouponRelease({name : "Đợt phát hành phiếu thanh toán 100k",id_branch :'OHFNEIOUH6549846'}) .then((res)=>{ console.log('addCouponRelease', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addCouponRelease(data: any): Promise; /** * @example: * this.vhQueryCafe.updateCouponRelease('ANOFIEUPOIUJ49861',{name : "Đợt phát hành phiếu thanh toán 100k"}) .then((bool:any)=>{ console.log('updateCouponRelease', bool); }, error=>{ console.log('error', error); }) * @param data * @param id_coupon_release * @return Promise => bool = true or false */ updateCouponRelease(id_coupon_release: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deleteCouponRelease("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteCouponRelease', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_coupon_release * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có coupon cần phát hành, vui lòng xóa coupon khỏi đợt phát hành */ deleteCouponRelease(id_coupon_release: any): Promise; /** * @example: * * this.vhQueryCafe.getCouponRelease('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getCouponRelease', res); }, error=>{ console.log('error', error); }) * @param id_coupon_release * @return Promise => object or null */ getCouponRelease(id_coupon_release: any): Promise; /** * @example: * * this.vhQueryCafe.getCouponReleases() .then((arr)=>{ console.log('getCouponReleases', arr); }, error=>{ console.log('error', error); }) * @return Promise => Array< object > */ getCouponReleases(): Promise; /** * @example: let data = { id_coupon : "9841654DOIWSDYW235", id_coupon_release :" 316OIUHLKMLSDYW235" } this.vhQueryCafe.addCouponReleaseDetail(data) .then((res)=>{ console.log('addCouponReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param data * @param id_coupon * @return Promise => bool = true or false */ addCouponReleaseDetail(data: any): Promise; /** * @example: * this.vhQueryCafe.deleteCouponReleaseDetail("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteCouponReleaseDetail', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_coupon_release_detail * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do coupon_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng) */ deleteCouponReleaseDetail(id_coupon_release_detail: any): Promise; /** * @example: * * this.vhQueryCafe.getCouponReleaseDetail('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getCouponReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param id_coupon_release_detail * @return Promise => object or null */ getCouponReleaseDetail(id_coupon_release_detail: any): Promise; /** * hàm này trả về những Coupon Release Detail của đợt coupon đó * @example: * this.vhQueryCafe.getCouponRelaseDetail_byIdCouponRelease("9841654DOIWSDYW235") .then((array:any)=>{ console.log('getCouponRelaseDetail_byIdCouponRelease', array); }, error=>{ console.log('error', error); }) * @param id_coupon_release * @return Promise => Array = [{id_coupon_relase, id_coupon, coupon_name, coupon_value, coupon_code_numbers}] */ getCouponRelaseDetail_byIdCouponRelease(id_coupon_release: any): Promise; /** * hàm này để phát hành 1 coupon_code * @example: //truyền vào let data = { date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * this.vhQueryCafe.createCouponCode(data) .then((coupon_code)=>{ console.log('createCouponCode', coupon_code); }, error=>{ console.log('error', error); }) //trả về let data = { _id:'9841654DOIWSDYW235' status: 1, id_branch, date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * @param data * @return Promise => Object */ private createCouponCode; /** * 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 * trong collection coupon_release_details * @example: //truyền vào let data = { date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * this.vhQueryCafe.createCouponCodes(data, 10) .then((coupon_codes)=>{ console.log('createCouponCodes', coupon_codes); }, error=>{ console.log('error', error); }) //trả về let data = { _id:'9841654DOIWSDYW235' status: 1, id_branch, date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * @param data * @param quantity <=20 : Dev kiểm tra trường quantity nhập vào không được lớn hơn 20 * @return Promise => Array(object) */ createCouponCodes(data: any, quantity: number): Promise; /** * @example: * * this.vhQueryCafe.updateCouponCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()}) .then((bool:any)=>{ console.log('updateCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_coupon_code * @param data * @return Promise => boolean = true or false */ updateCouponCode(id_coupon_code: any, data: any): Promise; /** * Hàm này chỉ cho phép xóa coupon_code đang ở trạng thái đã phát hành (status ==1), * và cập nhật giảm trường số lượng quantity_released bớt 1 trong collection coupon_release_details * @example: * this.vhQueryCafe.deleteCouponCode('OUHEOIWUYGHIQNIDOUW1359478'}) .then((bool:any)=>{ console.log('deleteCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_coupon_code * @param id_coupon_release_detail * @return Promise => boolean = true or false */ deleteCouponCode(id_coupon_code: string, id_coupon_release_detail: string): Promise; /** * hàm này trả về danh sách coupon code đã phát hành theo mỗi đợt * @example: * * this.vhQueryCafe.getCouponCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'}) .then((array:any)=>{ console.log('getCouponCodes_byIdCouponReleaseDetail', array); }, error=>{ console.log('error', error); }) * @param id_coupon_release_detail * @return Promise => Array */ getCouponCodes_byIdCouponReleaseDetail(id_coupon_release_detail: any): Promise; /** * hàm này trả về danh sách coupon code đã phát hành theo điều kiện query * @example: * this.vhQueryCafe.getCouponCodes_byFields({status:{$eq: 1}}, {}, {}, 0) .then((res)=>{ console.log('getCouponCodes_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getCouponCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * hàm này trả về coupon_code đã phát hành theo trường _id của Coupon_code * @example: * * this.vhQueryCafe.getCouponCode('OUHEDW0512'}) .then((res)=>{ console.log('getCouponCode', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCouponCode(id_coupon_code: any): Promise; /** * hàm này trả về coupon_code đã phát hành theo trường code của Coupon_code. * @example: * * this.vhQueryCafe.getCouponCode('OUHEDW0512'}) .then((res)=>{ console.log('getCouponCode', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCouponCode_byCode(code: any): Promise; /** * hàm này trả về coupon_code đã phát hành theo trường _id của voucher_code. * @example: * * this.vhQueryCafe.getCoupon_Code_Name_Release('OUHEDW0512'}) .then((res)=>{ console.log('getCoupon_Code_Name_Release', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCoupon_Code_Name_Release(id_coupon_code: any): Promise; /** * hàm này trả về coupon đã phát hành theo trường code của coupon_code. dùng trong thanh toán bằng phiếu, đổi điểm lấy coupon, * trả về có cả code, name_coupon, name_coupon_release * @example: * * this.vhQueryCafe.getCoupon_Code_Name_Release_byCode('OUHEDW0512'}) .then((res)=>{ console.log('getCoupon_Code_Name_Release_byCode', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCoupon_Code_Name_Release_byCode(code: any): Promise; /** * 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 * hàm này đã cập nhật lại trường status, id_customer, date_points_exchanged cho coupon_codes * hàm này đã cập nhật lại trường earned_points, id_customer, branch_earned_points cho customers * @example: * let array = [{id_coupon_code, points, value},{}...] * this.vhQueryCafe.exchangeCouponCode_byEarningPoints([array,'1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000}) .then((bool:any)=>{ console.log('exchangeCouponCode_byEarningPoints', bool); }, error=>{ console.log('error', error); }) * @param array_id_coupon_code_and_points_and_value : [{id_coupon_code, points, value}] * @param id_customer * @param total_points_exchanged: tổng điểm của các phiếu đã quy đổi * @return Promise => boolean = true or false */ exchangeCouponCode_byEarningPoints(array_id_coupon_code_and_points_and_value: any, id_customer: any, total_points_exchanged: any): Promise; /** * @example: * let data = { name : "Siêu khuyến mãi", id_design_barcode :"316OIUHLKMLSDYW235", products: [{ id_product : "NIDOUHWIOLDNOIU1142748", price : 1000000, quantity: 1, ptype: 1 }], point: 10, price_origin: 9300000, price: 9200000, id_branch: 4zFGhVUAZyj5d09r01xZ } * this.vhQueryCafe.addVoucher(data) .then((res)=>{ console.log('addVoucher', res); }, error=>{ console.log('error', error); }) * @param data * @return object or error */ addVoucher(data: any): Promise; /** * @example: * let data = { point: 23, price_origin: 9400000, id_branch: 4zFGhVUAZyj5d09r01xZ } * this.vhQueryCafe.updateVoucher("fuMS21I6othUm34385WV", data) .then((bool:any)=>{ console.log('updateVoucher', bool); }, error=>{ console.log('error', error); }) * @param id_voucher * @param data * @return Promise Boolean => true or false */ updateVoucher(id_voucher: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deleteVoucher("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteVoucher', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_voucher * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do voucher đã được phát hành, vui lòng xóa đợt phát hành liên quan */ deleteVoucher(id_voucher: any): Promise; /** * @example: * this.vhQueryCafe.getVoucher(id_voucher) .then((res)=>{ console.log('addVoucher', res); }, error=>{ console.log('error', error); }) * @param id_voucher * @return Promise => object or null */ getVoucher(id_voucher: any): Promise; /** * @example: * this.vhQueryCafe.getVouchers() .then((arr)=>{ console.log('getVouchers', arr); }, error=>{ console.log('error', error); }) * @return Promise => array(object) =[{},{},...] */ getVouchers(): Promise; /** * @example: * let data = { name : "Tháng 6 bùng nổ", id_branch: 4zFGhVUAZyj5d09r01xZ } * this.vhQueryCafe.addVoucherRelease(data) .then((res)=>{ console.log('addVoucherRelease', res); }, error=>{ console.log('error', error); }) * @param data * @return object or error */ addVoucherRelease(data: any): Promise; /** * @example: * let data = { name : "Tháng 6 bùng nổ" } * this.vhQueryCafe.updateVoucherRelease("fuMS21I6othUm34385WV", data) .then((bool:any)=>{ console.log('updateVoucherRelease', bool); }, error=>{ console.log('error', error); }) * @param id_voucher_release * @param data * @return Promise Boolean => true or false */ updateVoucherRelease(id_voucher_release: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deleteVoucherRelease("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteVoucherRelease', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_voucher_release * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có voucher cần phát hành, vui lòng xóa voucher khỏi đợt phát hành */ deleteVoucherRelease(id_voucher_release: any): Promise; /** * @example: * this.vhQueryCafe.getVoucherRelease("fuMS21I6othUm34385WV") .then((res)=>{ console.log('getVoucherRelease', res); }, error=>{ console.log('error', error); }) * @param id_voucher_release * @return Promise => object or null */ getVoucherRelease(id_voucher_release: any): Promise; /** * @example: * this.vhQueryCafe.getVoucherRelases() .then((res)=>{ console.log('getVoucherRelases', res); }, error=>{ console.log('error', error); }) * @return Promise => array(object) =[{},{},...] */ getVoucherRelases(): Promise; /** * @example: * let data = { id_voucher : "fuMS21I6othUm34385WV", id_voucher_release: "4zFGhVUAZyj5d09r01xZ" } * this.vhQueryCafe.addVoucherReleaseDetail(data) .then((res)=>{ console.log('addVoucherReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param data * @return object or error */ addVoucherReleaseDetail(data: any): Promise; /** * @example: * this.vhQueryCafe.deleteVoucherReleaseDetail("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteVoucherReleaseDetail', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_voucher_release_detail * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do voucher_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng) */ deleteVoucherReleaseDetail(id_voucher_release_detail: any): Promise; /** * @example: * this.vhQueryCafe.getVoucherReleaseDetail("fuMS21I6othUm34385WV") .then((res)=>{ console.log('getVoucherReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param (id_voucher_release_detail) * @return Promise => object or null */ getVoucherReleaseDetail(id_voucher_release_detail: string): Promise; /** * @example: * this.vhQueryCafe.getVoucherRelaseDetail_byFields({id_voucher:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0) .then((res)=>{ console.log('getVoucherRelaseDetail_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getVoucherRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * hàm này để phát hành 1 voucher_code * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_voucher_release_detail: "fuMS21I6othUm34385WV", id_voucher: '9841654DOIWSDYW235' } * this.vhQueryCafe.createVoucherCode(data) .then((voucher_code)=>{ console.log('createVoucherCode', voucher_code); }, error=>{ console.log('error', error); }) * @param data * @return Promise => Object */ createVoucherCode(data: any): Promise; /** * 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 * trong collection voucher_release_details * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_voucher_release_detail: "fuMS21I6othUm34385WV", id_voucher: '9841654DOIWSDYW235' } * this.vhQueryCafe.createVoucherCodes(data, 10) .then((voucher_codes)=>{ console.log('createVoucherCodes', voucher_codes); }, error=>{ console.log('error', error); }) * @param data * @param quantity * @return Promise => Array(object) */ createVoucherCodes(data: any, quantity: number): Promise; /** * @example: * * this.vhQueryCafe.updateVoucherCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()}) .then((bool:any)=>{ console.log('updateCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_voucher_code * @param data * @return Promise => boolean = true or false */ updateVoucherCode(id_voucher_code: any, data: any): Promise; /** * Hàm này chỉ cho phép xóa voucher_code đang ở trạng thái đã phát hành (status ==1), * và cập nhật giảm trường số lượng quantity_released bớt một trong collection voucher_release_details * @example: * this.vhQueryCafe.deleteVoucherCode('BjHxEYPWrB0rPwfj2L9R', 'CBrcRQIL11lwcHBljliW'}) .then((bool:any)=>{ console.log('deleteVoucherCode', bool); }, error=>{ console.log('error', error); }) * @param id_voucher_code * @param id_voucher_release_detail * @return Promise => boolean = true or false */ deleteVoucherCode(id_voucher_code: string, id_voucher_release_detail: string): Promise; /** * hàm này trả về danh sách voucher_codes đã phát hành theo mỗi đợt * @example: * this.vhQueryCafe.getVoucherCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'}) .then((array:any)=>{ console.log('getVoucherCodes_byIdCouponReleaseDetail', array); }, error=>{ console.log('error', error); }) * @param id_voucher_release_detail * @return Promise => Array */ getVoucherCodes_byIdCouponReleaseDetail(id_voucher_release_detail: any): Promise; /** * hàm này trả về danh sách voucher code đã phát hành theo điều kiện query * @example: * this.vhQueryCafe.getVoucherCodes_byFields({status:{$eq: 1}}, {}, {}, 0) .then((res)=>{ console.log('getVoucherCodes_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getVoucherCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * 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 * @example: * * this.vhQueryCafe.getVoucherCode('OUHEDW0512'}) .then((res)=>{ console.log('getVoucherCode', res); }, error=>{ console.log('error', error); }) * @param id_voucher_code: cũng chính là code * @return Promise => obj ={} or null */ getVoucherCode(id_voucher_code: any): Promise; /** * hàm này trả về voucher code đã phát hành theo trường _id của voucher code. * trả về có cả code, name_voucher, name_voucher_release * @example: * * this.vhQueryCafe.getVoucher_Code_Name_Release('OUHEDW0512'}) .then((res)=>{ console.log('getVoucher_Code_Name_Release', res); }, error=>{ console.log('error', error); }) * @param id_voucher_code: cũng chính là code * @return Promise => obj ={} or null */ getVoucher_Code_Name_Release(id_voucher_code: any): Promise; /** * hàm này trả về voucher đã phát hành theo trường code của voucher_code. dùng trong trang đổi điểm lấy voucher và bán voucher, đổi voucher lấy hàng hóa, * trả về có cả code, name_voucher, name_voucher_release * @example: * * this.vhQueryCafe.getVoucher_Code_Name_Release_byCode('OUHEDW0512'}) .then((res)=>{ console.log('getVoucher_Code_Name_Release_byCode', res); }, error=>{ console.log('error', error); }) * @param code: cũng chính là code * @return Promise => obj ={} or null */ getVoucher_Code_Name_Release_byCode(code: any): Promise; exchangeVoucherCode_byEarningPoints(array_id_voucher_code_and_points_and_products: any, id_customer: any, points: any): Promise; /** * @example: * let data = { * name :"Thẻ trả trước", * price :1000000, * products : [ * { * id_product : 'MOIUHWDWIUHG1345674', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 1 * },{ * id_product : 'NJIDUEWNBIJUWGHD135', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 2 * }] * } * this.vhQueryCafe.addPaymentCard(data) .then((res)=>{ console.log('addPaymentCard', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => Array */ addPaymentCard(data: any): Promise; /** * @example: * let data = { * name :"Thẻ trả trước", * price :1000000, * products : [ * { * id_product : 'MOIUHWDWIUHG1345674', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 1 * },{ * id_product : 'NJIDUEWNBIJUWGHD135', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 2 * }] * } * this.vhQueryCafe.updatePaymentCard(data) .then((bool:any)=>{ console.log('updatePaymentCard', bool); }, error=>{ console.log('error', error); }) * @param data * @param id_payment_card * @return Promise => bool = true or false */ updatePaymentCard(id_payment_card: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deletePaymentCard("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deletePaymentCard', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_payment_card * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do payment_card đã được phát hành, vui lòng xóa đợt phát hành liên quan */ deletePaymentCard(id_payment_card: any): Promise; /** * @example: * this.vhQueryCafe.getPaymentCard('FDNOIUWDHIWH21564DWQ') .then((res)=>{ console.log('getPaymentCard', res); }, error=>{ console.log('error', error); }) * @param id_payment_card * @return Promise => object or null */ getPaymentCard(id_payment_card: any): Promise; /** * @example: * this.vhQueryCafe.getPaymentCards() .then((res)=>{ console.log('getPaymentCards', res); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getPaymentCards(): Promise; /** * @example: * this.vhQueryCafe.addPaymentCardRelease({name : "Đợt phát hành thẻ 1", id_branch :"NIOUHDWLJUNBHIU16549"}) .then((res)=>{ console.log('addPaymentCardRelease', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addPaymentCardRelease(data: any): Promise; /** * @example: * this.vhQueryCafe.updatePaymentCardRelease({name : "Đợt phát hành thẻ 1"}) .then((bool:any)=>{ console.log('updatePaymentCardRelease', bool); }, error=>{ console.log('error', error); }) * @param id_payment_card_release * @param data * @return Promise => object or error */ updatePaymentCardRelease(id_payment_card_release: any, data: any): Promise; /** * @example: * this.vhQueryCafe.deletePaymentCardRelease("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deletePaymentCardRelease', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_payment_card_release * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có payment_card cần phát hành, vui lòng xóa payment_card khỏi đợt phát hành */ deletePaymentCardRelease(id_payment_card_release: any): Promise; /** * @example: * this.vhQueryCafe.getPaymentCardRelease("OIHIDUWNIDOLW123456") .then((res)=>{ console.log('getPaymentCardRelease', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_release * @return Promise => object or null */ getPaymentCardRelease(id_payment_card_release: any): Promise; /** * @example: * this.vhQueryCafe.getPaymentCardReleases() .then((res)=>{ console.log('getPaymentCardReleases', res); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getPaymentCardReleases(): Promise; /** * @example: * this.vhQueryCafe.addPaymentCardReleaseDetail({id_payment_card : "OIUHFIUWHGGU41698496", id_payment_card_release :"NIOUHDWLJUNBHIU16549"}) .then((res)=>{ console.log('addPaymentCardReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addPaymentCardReleaseDetail(data: any): Promise; /** * @example: * this.vhQueryCafe.deletePaymentCardReleaseDetail("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deletePaymentCardReleaseDetail', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_payment_card_release_detail * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do payment_card_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng) */ deletePaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise; /** * @example: * * this.vhQueryCafe.getPaymentCardReleaseDetail('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getPaymentCardReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_release_detail * @return Promise => object or null */ getPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise; /** * @example: * this.vhQueryCafe.getVoucherRelaseDetail_byFields({id_payment_card:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0) .then((res)=>{ console.log('getVoucherRelaseDetail_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getPaymentCardRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * hàm này để phát hành 1 payment_card_code * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_payment_card_release_detail: "fuMS21I6othUm34385WV", id_payment_card: '9841654DOIWSDYW235' } * this.vhQueryCafe.createPaymentCardCode(data) .then((coupon_code)=>{ console.log('createPaymentCardCode', coupon_code); }, error=>{ console.log('error', error); }) * @param data * @return Promise => Object */ private createPaymentCardCode; /** * 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 * trong collection payment_card_release_details * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_payment_card_release_detail: "fuMS21I6othUm34385WV", id_payment_card: '9841654DOIWSDYW235' } * this.vhQueryCafe.createPaymentCardCodes(data, 10) .then((voucher_codes)=>{ console.log('createPaymentCardCodes', voucher_codes); }, error=>{ console.log('error', error); }) * @param data * @param quantity * @return Promise => Array(object) */ createPaymentCardCodes(data: any, quantity: number): Promise; /** * @example: * let data = { date_validity: new Date(), date_expire: new Date(), id_branch: "4zFGhVUAZyj5d09r01xZ" } * this.vhQueryCafe.updatePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478',data) .then((bool:any)=>{ console.log('updateCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_payment_card_code * @param data * @return Promise => boolean = true or false */ updatePaymentCardCode(id_payment_card_code: any, data: any): Promise; /** * Hàm này chỉ cho phép xóa payment_card đang ở trạng thái đã phát hành (status ==1), * và cập nhật giảm trường số lượng quantity_released bớt một trong collection payment_card_release_details * @example: * this.vhQueryCafe.deletePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478', 'qKgt3cRPRXtw75JV9URp'}) .then((bool:any)=>{ console.log('deletePaymentCardCode', bool); }, error=>{ console.log('error', error); }) * @param id_payment_card_code * @param id_payment_card_release_detail * @return Promise => boolean = true or false */ deletePaymentCardCode(id_payment_card_code: string, id_payment_card_release_detail: string): Promise; /** * hàm này trả về danh sách payment_card_codes đã phát hành theo mỗi đợt * @example: * * this.vhQueryCafe.getPaymentCardCodes_byIdPaymentCardReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'}) .then((array:any)=>{ console.log('getPaymentCardCodes_byIdPaymentCardReleaseDetail', array); }, error=>{ console.log('error', error); }) * @param id_payment_card_release_detail * @return Promise => Array */ getPaymentCardCodes_byIdPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise; /** * hàm này trả về danh sách payment_card code đã phát hành theo điều kiện query * @example: * this.vhQueryCafe.getPaymentCardCodes_byFields({status:{$eq: 1}}, {}, {}, 0) .then((res)=>{ console.log('getPaymentCardCodes_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getPaymentCardCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * 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) * @example: * * this.vhQueryCafe.getPaymentCardCode('OUHEDW0512'}) .then((res)=>{ console.log('getPaymentCardCode', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_code: cũng chính là code * @return Promise => obj = {} or null */ getPaymentCardCode(id_payment_card_code: any): Promise; /** * hàm này trả về payment_card code đã phát hành theo trường _id của payment_card code * trả về có cả code, name_payment_card, name_payment_card_release * @example: * * this.vhQueryCafe.getPaymentCard_Code_Name_Release('OUHEDW0512'}) .then((res)=>{ console.log('getPaymentCard_Code_Name_Release', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_code: cũng chính là code * @return Promise => obj ={} or null */ getPaymentCard_Code_Name_Release(id_payment_card_code: any): Promise; /** * hàm này trả về payment_card đã phát hành theo trường code của payment_card_code. dùng trong trang đổi điểm lấy thẻ payment_card và bán payment_card, đổi payment_card lấy hàng hóa, * trả về có cả code, name_payment_card, name_payment_card_release * @example: * * this.vhQueryCafe.getPaymentCard_Code_Name_Release_byCode('OUHEDW0512'}) .then((res)=>{ console.log('getPaymentCard_Code_Name_Release_byCode', res); }, error=>{ console.log('error', error); }) * @param code: cũng chính là code * @return Promise => obj ={} or null */ getPaymentCard_Code_Name_Release_byCode(code: any): Promise; exchangePaymentCardCode_byEarningPoints(array_id_payment_card_code_and_points_and_products: any, id_customer: any, points: any): Promise; /** * không cần hàm này vì khi tạo phiếu bill_type51 đã được cập nhật * hàm này dùng để cập nhật số lượng sản phẩm trong Payment Card khi đổi thẻ * @example: * this.vhQueryCafe.getPaymentCardCode_byCode("ONHDIWUHIODUWN","NDPIUWUHIOUYEW",{quantity_valid: 0}) .then((res)=>{ console.log('getPaymentCardCode_byCode', res); }, error=>{ console.log('error', error); }) * @param id_payment_card * @param id_comboproduct * @param data * @return Promise object or null */ updateComboPaymentCard(id_payment_card: any, id_comboproduct: any, data: any): void; /** * Hàm này MÁY ĐANG DÙNG PHẦN MỀM sẽ mở kết nối với tất cả các thiết bị giao tiếp RS232 đã khai báo trong Cài đặt/Cấu hình/Bảng LED hiển thị giá * @example: * this.vhQueryCafe.connectDisplayLEDScreens(); */ connectDisplayLEDScreens(): void; /** * Hàm này MÁY ĐANG DÙNG PHẦN MỀM sẽ đóng kết nối với tất cả các thiết bị giao tiếp RS232 đã khai báo trong Cài đặt/Cấu hình/Bảng LED hiển thị giá * @example: * this.vhQueryCafe.connectDisplayLEDScreens(); */ disconnectDisplayLEDScreens(): void; /** * Hàm này PHẦN MỀM sẽ gửi bill và bill_details xuống bảng LED hiển thị giá để hiển thị giá trị lên. * Lưu ý bắt sự kiện giá trị tổng hóa đơn (total) thay đổi và gọi lại hàm này. * @example: * this.vhQueryCafe.writeBill_BillDetails_toDisplayLEDScreens(bill, bill_details); */ writeBill_BillDetails_toDisplayLEDScreens(bill: any, bill_details: any): void; /** * vhQueryCafe * @param bill_details * @returns */ private changeBillDetails_withPromotions_toRaw; private changeBillDetails_withRaw_toPromotions; /** * @example: * this.vhQueryCafe.getBillDetails_withName({name:'promition 1'}) .then((bill_details:any)=>{ console.log('getBillDetails_withName', bill_details); },(error:any)=>{ console.log('error', error); }) * @param bill_details * @return Promise => array = [{},{},...] * 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 */ private changeBillDetails_withPromotionNameUnitsLots; /** * vhQueryCafe * @example: * let _bill_details = this.vhQueryCafe.changeBillDetails_withNameUnitsLots(bill_details); * @param bill_details * @return Promise => array = [{},{},...] * 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 */ private changeBillDetails_withNameUnitsLots; /** * Hàm này đổi mảng Bill_Details sang mảng Bill_Details có chương trình khuyến mãi (nếu có) * @example: * let date = new Date(); * this.vhQueryCafe.changeBillDetails_withPromotions(bill_details, date) .then((bill_details_promotions)=>{ console.log('bill_details_promotions', res); bill_details = [...bill_details_promotions]; }, error=>{ console.log('error', error); }) * @param bill_details * @param date : thơi gian tạo hóa đơn * @return Oject => obj = {bill_details_pmtype_0to6: Array, bill_details_pmtype_7: Array}}; (bill_details_pmtype_0 là bill_details ko có khuyến mãi) */ changeBillDetails_withPromotions(bill_details: any, date: any): Promise; /** * Hàm này đổi mảng Bill_Details có chương trình khuyến mãi (nếu có) sang mảng Bill_Details thường * @example: * bill_details = this.vhQueryCafe.destroyBillDetails_withPromotions(bill_details_promotions) * @param bill_details * @return Array => array = [{},{},..] */ destroyBillDetails_withPromotions(bill_details: any): any[]; private sumBill_Details; /** * hàm này trả về danh sách chương trình khuyến mãi diễn ra tại thời điểm tạo hóa đơn => mỗi lần chỉnh lại thời gian tạo hóa đơn phải gọi hàm này * @example: * let date = new Date(); * this.vhQueryCafe.getPromotions_byDate(date) .then((res)=>{ console.log('getPromotions_byDate', res); }, error=>{ console.log('error', error); }) * @param date : thơi gian tạo hóa đơn * @return Promise => array(object) = [{},{},..] */ private getPromotions_byDate; /** * Hàm này tạo bill_code theo số thứ tự (trong ngày) của từng loại bill_type * @example: * this.vhQueryCafe.createBillCode(new Date(), 7) .then((bill_code)=>{ console.log('createBillCode', bill_code); }) * @param billdate * @param bill_type */ createBillCode(billdate: any, bill_type: number): Promise; /** * 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 * @example this.vhQueryCafe.calculateUpdateImportPrice(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateUpdateImportPrice; /** * @example this.vhQueryCafe.calculateQuantityProduct_UP(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_UP; /** * @example this.vhQueryCafe.calculateQuantityProduct_UP_9(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_UP_9; /** * @example this.vhQueryCafe.calculateQuantityProduct_DOWN(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_DOWN; /** * @example this.vhQueryCafe.calculateQuantityProduct_DOWN(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_DOWN_9; /** * hàm này trả về danh sách chương trình khuyến mãi diễn ra từ thời gian fromTime đến thời gian toTime * @example: * let fromTime = new Date(); * let toTime = new Date('2020-07-01T05:24:00'); * this.vhQueryCafe.getPromotions_fromTime_toTime(fromTime, toTime, 'all') .then((res)=>{ console.log('getPromotions_fromTime_toTime', res); }, error=>{ console.log('error', error); }) * @param fromTime * @param toTime * @param type: 'all' or 1->8 * @return Promise => array(object) = [{},{},..] */ getPromotions_fromTime_toTime(fromTime: any, toTime: any, type: any): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryCare { constructor(); startLocalStorage(): Promise; /** * Hàm này trả về nội dung chat giữa nhân viên AppCare và Chater trên các App, * sau khi hàm connectChatStore hoàn thành việc tạo kết nối giữa AppCare và Chater * lưu ý: phải chạy hàm connectChatStore trước * Lưu ý: hàm này trả về tối đa 100 message trước đó * @example: this.VhQueryCare.callbackMessagesFromChatStores() .subscribe((data)=> { data.docs.forEach(doc => { console.log(doc); }); },(error:any) => { console.log(error); }) * @return callback */ callbackMessagesFromChatStores(): any; removeAllCallback(): void; connect(): void; /** * Hàm này trả về (Realtime) danh sách những store đã đưa ra cầu hỏi và đang chờ AppCare trở lời * @example: this.VhQueryCare.callbackChatStoreList() .subscribe((array)=> { console.log('array', array); array.forEach(json => { json.docs.forEach(doc => { console.log('doc', doc); console.log(doc.data()); }) }) }) * @param callback * @return callback Array JSONs => array = [json{}, json{},...]; json = {database, size, empty, docs[]}; json.docs = [{id, data()},{},...] */ callbackChatStoreList(): any; private callbackChatStore; private getchatStoreList; /** * Nhân viên AppCare dùng hàm này chọn Store cần chat, thì Store này sẽ đc đưa vào getMyChatStore, và nhân viên khác ko chọn đc nữa * @example: this.VhQueryCare.selectChatStore("2rVieBQTubQ2hjUnpwU4w7qSlD83") .then((result)=>{ console.log(result); }) * @param id_store * @return Promise Boolean => true or false */ selectChatStore(id_store: any): Promise; /** * Nhân viên Appcare dùng hàm này thì Store này sẽ đc đưa ra khỏi getMyChatStore, và nhân viên khác chọn để Chat đc * @example: this.VhQueryCare.unselectChatStore("2rVieBQTubQ2hjUnpwU4w7qSlD83") .then((result)=>{ console.log(result); }) * @param id_store * @return Promise Boolean => true or false */ unselectChatStore(id_store: any): Promise; /** * Sau khi hỗ trợ khách hàng xong, dùng hàm này * @example: this.VhQueryCare.finishChatStore("2rVieBQTubQ2hjUnpwU4w7qSlD83") .then((result)=>{ console.log(result); }) * @param id_store * @return Promise Boolean => true or false */ finishChatStore(id_store: any): Promise; /** * sau khi chạy hàm connectChatStore, nội dung chat của Store có id la sid, sẽ được trả về qua hàm callbackMessagesFromChatStores * @example: this.VhQueryCare.connectChatStore('2rVieBQTubQ2hjUnpwU4w7qSlD83'); * @param id_store * @return void */ connectChatStore(id_store: any): void; /** * sau khi chạy hàm connectChatStore, hàm này gửi tin nhắn và tiếp tục chat với store có id là sid * @example: this.VhQueryCare.sendMessageToChatStore('2rVieBQTubQ2hjUnpwU4w7qSlD83', 'Xin chao ban'); * @param id_store * @param message * @return void */ sendMessageToChatStore(id_store: any, message: any): void; sendImageToChatStore(id_store: any, image: any): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryCloudCam { private vhMGDB_auth; private vhMGDB_f3rdclouds; private vhMGDB_clouds; private vhMGDB_database; private vhMGDB_socketMongoDB; private vhQuery; private vhAuth; private vhAlgorithm; private utoken; private cameras; private cloudcams; private rooms; private mainboards; private functions; private components; private icons; private appsettingstations; private scripts; private script_details; private logs; private hwinfo; private subjectcameras; private subjectappsettingstations; private subjectrooms; private subjectmainboards; private subjectfunctions; private subjecticons; private subjectcomponents; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_f3rdclouds: VhMGDB_f3rdclouds, vhMGDB_clouds: VhMGDB_clouds, vhMGDB_database: VhMGDB_database, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @example: this.VhQuerySmhome.syncCollections().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections(): Promise; private initSyncCollections; /** * @example: * this.vhQuerySmhome.closeSyncCollections(); * disconnect collections synchronization in the APP * @returns void */ closeSyncCollections(): void; /** * vhQuerySmhome * @returns */ private callbackCollectionInsert; /** * vhQuerySmhome * @returns */ private callbackCollectionUpdate; /** * vhQuerySmhome * @returns */ private callbackCollectionDelete; /** * vhQuerySmhome * @returns */ startLocalStorage(): Promise; /** * lấy về recordserverURL, APP gửi recordserverURL cho Cloudcam Box, Box dùng kiểm recordedfile với RecordServer và upload recordedfile chưa có lên RecordServer * lấy về clientRTSPURL cộng với rtspID nhận từ Cloudcam Box, APP sẽ đăng ký camera này lên Clouds, nếu thành công sẽ nhận đc licensecam * lấy về serverRTSPURL, APP gửi serverRTSPURL cho Cloudcam Box, Box dùng send video của từng camera lên RTSP Server * lấy về _id truyền vô hàm addCloudCamBoxByEndUser để đăng ký camera này lên Clouds * mỗi lần đăng ký một camera lên Clouds là dùng hàm getCloudCamServer() để lấy thông tin đăng ký lại * @returns Promise Object => obj = {clientRTSPURL, serverRTSPURL, _id} */ getCloudCamServer(): Promise; createPaymentVnpay(amount: number, bankCode: string, data: any, backHref: string, fee: object, fee_details: object): any; /** * @example: * this.vhQueryCloudCam.getDiscountFromCode('VIETHAS') .then((discount)=>{ console.log('getDiscountFromCode', discount); },(error:any)=>{ console.log('error', error); }) * @returns */ getDiscountFromCode(code: string): any; /** * @example: * this.vhQueryCloudCam.getPriceList_Records() .then((pricelist)=>{ console.log('getPriceList_Records', pricelist); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_Records(): any; /** * @example: * this.vhQueryCloudCam.getPriceList_Detectors() .then((pricelist)=>{ console.log('getPriceList_Detectors', pricelist); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_Detectors(): any; /** * @example: * this.vhQueryCloudCam.getPriceList_rLPRs() .then((pricelist_detectors)=>{ console.log('getPriceList_rLPRs', pricelist_detectors); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_rLPRs(): any; /** * @example: * this.vhQueryCloudCam.getPriceList_cLPRs() .then((getPriceList_cLPRs)=>{ console.log('getPriceList_cLPRs', getPriceList_cLPRs); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_cLPRs(): any; private publishObservableEventCameras; private observableLocalCameras; /** * @example: * this.observableCamera = this.vhQueryCloudCam.getObservableLocalCameras().subscribe((localCameras:any) => { do something... }) ngOnDestroy(){ this.observableCamera.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCameras(): Observable; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalCamera('5fb6780ca2148e09806c5b01'); * @param id_camera * @return Object => obj = {} or null */ getlocalCamera(id_camera: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalCameras(); * @return Array(object) => array = [{},{},...] */ getlocalCameras(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalCameras() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCamera(), getlocalCameras() trong localstorage * @return Promise => null */ refreshLocalCameras(): any; /** * @example: * this.vhQueryCloudCam.createLicenseCam() .then((licensecam)=>{ console.log('licensecam', licensecam); }) * @return Promise => licensecam */ createLicenseCam(): Promise; /** * @example: * this.vhQueryCloudCam.addCamera({name:'camera 2', url:'rtsp://admin:admin@115.78.100.57:1020/av_stream/ch0', licensecam:'pTqOFsJEndPrg7AImFxV'}) .then((camera)=>{ console.log('addCamera', camera); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 * Trường hợp không thành công: * code = 0 : licensecam không đúng * code = 1 : licensecam đã và đang được sử dụng */ addCamera(data: any): Promise; /** * @example: * this.vhQueryCloudCam.updateCamera('5fb6780ca2148e09806c5b01', {name:camera 3}) .then((bool:any)=>{ console.log('updateCamera', bool); }) * @param id_camera * @param data * @return Promise => bool = true or false */ updateCamera(id_camera: string, data: any): Promise; /** * @example: * this.vhQueryCloudCam.deleteCamera('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCamera', bool); }) * @param id_camera * @return Promise => bool = true or false */ deleteCamera(id_camera: string): Promise; /** * @example * this.vhQueryCloudCam.getCamera('5fb67fda87c0f21d484cbdf3') .then((camera)=>{ console.log('getCamera', camera); }) * @param id_camera * @return Promise => obj ={} or null */ getCamera(id_camera: string): Promise; /** * @example * this.vhQueryCloudCam.getCameras() .then((cameras)=>{ console.log('getCameras', cameras); }) * @return Promise => array(object) = [{},{},..] */ getCameras(): Promise; /** * @example * this.vhQueryCloudCam.getFee_detailsByFields({date:{$gte:starttime, $lte:endtime}}, {}, {date:1},0) .then((fee_details)=>{ console.log('getFee_detailsByFields', fee_details); }) * @return Promise => array(object) = [{},{},..] */ private getFee_detailsByFields; /** * @example * this.vhQueryCloudCam.getFeesByFields({date:{$gte:starttime, $lte:endtime}}, {}, {date:1},0) .then((fees)=>{ console.log('getFees', fees); }) * @return Promise => array(object) = [{},{},..] */ getFeesByFields(query: any, projection?: object, sort?: any, limit?: number): Promise; /** * @example * this.vhQueryCloudCam.getFee(id_fee) .then((fee)=>{ console.log('getFee', fee); }) * @return Promise => obj ={} or null */ getFee(id_fee: string): Promise; /** * @example * this.vhQueryCloudCam.getFee_Details(id_fee:string) .then((fee_details)=>{ console.log('getFee_Details', fee_details); }) * @return Promise => array(object) = [{},{},..] */ getFee_Details(id_fee: string): Promise; /** * this.vhQueryCloudCam.importUtoken('fasofu9afu0aw9etuf9wierrq973r89y239t82yewfuifw7ewfyuw9') * @param utoken * @return Void */ importUtoken(utoken: string): void; getLocalEUtoken(): any; private getEUtokenfromDatabase; /** * @example: * this.vhQueryCloudCam.checkExpiredUtoken() .then((bool:any)=>{ if(bool){ do something.... } }) * @param utoken * @returns Promise => true or false */ checkExpiredUtoken(): Promise; /** * @example: * let cloudcam = this.vhQueryCloudCam.getlocalCloudCam('5fb6780ca2148e09806c5b01'); * @param licensecam * @return Object => obj = {} or null */ getlocalCloudCam(licensecam: any): any; /** * @example: * let cloudcams = this.vhQueryCloudCam.getlocalCloudCams(); * @return Array(object) => array = [{},{},...] */ getlocalCloudCams(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalCloudCams() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCloudCam(), getlocalCloudCams() trong localstorage * @return Promise => null */ refreshLocalCloudCams(): any; /** * @example: * this.vhQueryCloudCam.changeCloudCamEnableCLPRbyEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableCLPRbyEndUser', bool); }) * @param licensecam * @param cLPR_enable * @return Promise => bool = true or false */ changeCloudCamEnableCLPRbyEndUser(licensecam: string, cLPR_enable: boolean): Promise; /** * @example: * this.vhQueryCloudCam.changeCloudCamEnableRLPRbyEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableRLPRbyEndUser', bool); }) * @param licensecam * @param rLPR_enable * @return Promise => bool = true or false */ changeCloudCamEnableRLPRbyEndUser(licensecam: string, rLPR_enable: boolean): Promise; /** * @example: * this.vhQueryCloudCam.changeCloudCamEnableDetectorByEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableDetectorByEndUser', bool); }) * @param licensecam * @param detector_enable * @return Promise => bool = true or false */ changeCloudCamEnableDetectorByEndUser(licensecam: string, detector_enable: boolean): Promise; /** * @example: * this.vhQueryCloudCam.changeCloudCamEnableRecordByEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableRecordByEndUser', bool); }) * @param licensecam * @param record_enable * @return Promise => bool = true or false */ changeCloudCamEnableRecordByEndUser(licensecam: string, record_enable: boolean): Promise; /** * @example: * this.vhQueryCloudCam.changeCloudCamEnableActiveByEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableActiveByEndUser', bool); }) * @param licensecam * @param active * @return Promise => bool = true or false */ changeCloudCamEnableActiveByEndUser(licensecam: string, active: boolean): Promise; /** * @example: * this.vhQueryCloudCam.changeCloudCamURLbyEndUser('5fb6780ca2148e09806c5b01', 'rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream', 'udp') .then((bool:any)=>{ console.log('changeCloudCamURLbyEndUser', bool); }) * @param licensecam * @param url * @return Promise => bool = true or false */ changeCloudCamURLbyEndUser(licensecam: string, url: string): Promise; /** * @example: * this.vhQueryCloudCam.addCloudCamByEndUser('rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream', {name:camera 3}) .then((cloudcam:any)=>{ console.log('addCloudCamByEndUser', cloudcam); }) * @param url * @param data * @return Promise => {} or null */ addCloudCamByEndUser(url: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.addCloudCamBoxByEndUser('rtsp://127.0.0.1:20306/hessdalen03.stream', {name:camera 3}, 'jlsdjfoasi09asf0u90') .then((cloudcam:any)=>{ console.log('addCloudCamBoxByEndUser', cloudcam); }) * @param url * @param data * @return Promise => {} or null */ addCloudCamBoxByEndUser(url: string, data: object, id_cloudcamserver: string): Promise; /** * @example: * this.vhQueryCloudCam.updateCloudCamDataByEndUser('5fb6780ca2148e09806c5b01', {name:'camera 3'}) .then((bool:any)=>{ console.log('updateCloudCamDataByEndUser', bool); }) * @param licensecam * @param data * @return Promise => bool = true or false */ updateCloudCamDataByEndUser(licensecam: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteCloudCamByEndUser('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCloudCamByEndUser', bool); }) * @param licensecam * @return Promise => bool = true or false */ deleteCloudCamByEndUser(licensecam: string): Promise; /** * @example * this.vhQueryCloudCam.getCloudCamByEndUser('5fb67fda87c0f21d484cbdf3') .then((cloudcam:any)=>{ console.log('getCloudCamByEndUser', cloudcam); }) * @param licensecam:string * @return Promise => obj ={} or null */ getCloudCamByEndUser(licensecam: string): Promise; /** * @example * this.vhQueryCloudCam.getCloudCamsByEndUser() .then((cloudcams)=>{ console.log('getCloudCamsByEndUser', cloudcams); }) * @return Promise => array(object) = [{},{},..] */ getCloudCamsByEndUser(): Promise; /** * * @param licensecam * @param camplaybackURL * @param starttime * @param endtime * @return Promise => array(string) = [,,..] */ getPlaybackListCamByEndUser(licensecam: string, camplaybackURL: string, starttime: any, endtime: any): Promise; private publishObservableEventRooms; private observableLocalRooms; /** * @example: * this.observableRoom = this.vhQueryCloudCam.getObservableLocalRooms().subscribe((localRooms:any) => { do something... }) ngOnDestroy(){ this.observableRoom.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalRooms(): Observable; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalRoom('5fb6780ca2148e09806c5b01'); * @param id_room * @return Object => obj = {} or null */ getlocalRoom(id_room: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalRooms(); * @return Array(object) => array = [{},{},...] */ getlocalRooms(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalRooms() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalRoom(), getlocalRooms() trong localstorage * @return Promise => null */ refreshLocalRooms(): any; /** * @example: * this.vhQueryCloudCam.addRoom({name:'camera 2', quantity:20, price:200000}) .then((room)=>{ console.log('addRoom', room); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addRoom(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateRoom('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateRoom', bool); }) * @param id_room * @param data * @return Promise => bool = true or false */ updateRoom(id_room: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteRoom('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteRoom', bool); }) * @param id_room * @return Promise => bool = true or false */ deleteRoom(id_room: string): Promise; /** * @example * this.vhQueryCloudCam.getRoom('5fb67fda87c0f21d484cbdf3') .then((room)=>{ console.log('getRoom', room); }) * @param id_room * @return Promise => obj ={} or null */ getRoom(id_room: string): Promise; /** * @example * this.vhQueryCloudCam.getRooms() .then((rooms)=>{ console.log('getRooms', rooms); }) * @return Promise => array(object) = [{},{},..] */ getRooms(): Promise; /** * @example: * let log = this.vhQueryCloudCam.getlocalLog('5fb6780ca2148e09806c5b01'); * @param id_log * @return Object => obj = {} or null */ getlocalLog(id_log: any): any; /** * @example: * let logs = this.vhQueryCloudCam.getlocalLogs(); * @return Array(object) => array = [{},{},...] */ getlocalLogs(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalLogs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalLog(), getlocalLogs() trong localstorage * @return Promise => null */ refreshLocalLogs(): any; /** * @example: * this.vhQueryCloudCam.addLog({name:'camera 2', quantity:20, price:200000}) .then((log)=>{ console.log('addLog', log); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addLog(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateLog('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateLog', bool); }) * @param id_log * @param data * @return Promise => bool = true or false */ updateLog(id_log: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteLog('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteLog', bool); }) * @param id_log * @return Promise => bool = true or false */ deleteLog(id_log: string): Promise; /** * @example * this.vhQueryCloudCam.getLog('5fb67fda87c0f21d484cbdf3') .then((log)=>{ console.log('getLog', log); }) * @param id_log * @return Promise => obj ={} or null */ getLog(id_log: string): Promise; /** * @example * this.vhQueryCloudCam.getLogs() .then((logs)=>{ console.log('getLogs', logs); }) * @return Promise => array(object) = [{},{},..] */ getLogs(): Promise; private publishObservableEventMainboards; private observableLocalMainboards; /** * @example: * this.observableMainboard = this.vhQueryCloudCam.observableLocalMainboards().subscribe((localMainboards:any) => { do something... }) ngOnDestroy(){ this.observableMainboard.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalMainboards(): Observable; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalMainboard('5fb6780ca2148e09806c5b01'); * @param id_mainboard * @return Object => obj = {} or null */ getlocalMainboard(id_mainboard: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalMainboards(); * @return Array(object) => array = [{},{},...] */ getlocalMainboards(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalMainboards() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalMainboard(), getlocalMainboards() trong localstorage * @return Promise => null */ refreshLocalMainboards(): any; /** * @example: * this.vhQueryCloudCam.addMainboard({name:'camera 2', quantity:20, price:200000}) .then((mainboard)=>{ console.log('addMainboard', mainboard); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMainboard(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateMainboard('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMainboard', bool); }) * @param id_mainboard * @param data * @return Promise => bool = true or false */ updateMainboard(id_mainboard: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteMainboard('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMainboard', bool); }) * @param id_mainboard * @return Promise => bool = true or false */ deleteMainboard(id_mainboard: string): Promise; /** * @example * this.vhQueryCloudCam.getMainboard('5fb67fda87c0f21d484cbdf3') .then((mainboard)=>{ console.log('getMainboard', mainboard); }) * @param id_mainboard * @return Promise => obj ={} or null */ getMainboard(id_mainboard: string): Promise; /** * @example * this.vhQueryCloudCam.getMainboards() .then((mainboards)=>{ console.log('getMainboards', mainboards); }) * @return Promise => array(object) = [{},{},..] */ getMainboards(): Promise; private publishObservableEventFunctions; private observableLocalFunctions; /** * @example: * this.observableFunction = this.vhQueryCloudCam.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalFunctions(): Observable; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalFunction('5fb6780ca2148e09806c5b01'); * @param id_function * @return Object => obj = {} or null */ getlocalFunction(id_function: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalFunctions(); * @return Array(object) => array = [{},{},...] */ getlocalFunctions(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalFunctions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalFunction(), getlocalFunctions() trong localstorage * @return Promise => null */ refreshLocalFunctions(): any; /** * @example: * this.vhQueryCloudCam.addFunction({name:'camera 2', quantity:20, price:200000}) .then((func)=>{ console.log('addFunction', func); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addFunction(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateFunction('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateFunction', bool); }) * @param id_function * @param data * @return Promise => bool = true or false */ updateFunction(id_function: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteFunction('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteFunction', bool); }) * @param id_function * @return Promise => bool = true or false */ deleteFunction(id_function: string): Promise; /** * @example * this.vhQueryCloudCam.getFunction('5fb67fda87c0f21d484cbdf3') .then((func)=>{ console.log('getFunction', func); }) * @param id_function * @return Promise => obj ={} or null */ getFunction(id_function: string): Promise; /** * @example * this.vhQueryCloudCam.getFunctions() .then((functions)=>{ console.log('getFunctions', functions); }) * @return Promise => array(object) = [{},{},..] */ getFunctions(): Promise; private publishObservableEventComponents; private observableLocalComponents; /** * @example: * this.observableFunction = this.vhQueryCloudCam.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalComponents(): Observable; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalComponent('5fb6780ca2148e09806c5b01'); * @param id_component * @return Object => obj = {} or null */ getlocalComponent(id_component: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalComponents(); * @return Array(object) => array = [{},{},...] */ getlocalComponents(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalComponents() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalComponent(), getlocalComponents() trong localstorage * @return Promise => null */ refreshLocalComponents(): any; /** * @example: * this.vhQueryCloudCam.addComponent({name:'camera 2', quantity:20, price:200000}) .then((component)=>{ console.log('addComponent', component); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addComponent(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateComponent('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateComponent', bool); }) * @param id_component * @param data * @return Promise => bool = true or false */ updateComponent(id_component: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteComponent('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteComponent', bool); }) * @param id_component * @return Promise => bool = true or false */ deleteComponent(id_component: string): Promise; /** * @example * this.vhQueryCloudCam.getComponent('5fb67fda87c0f21d484cbdf3') .then((component)=>{ console.log('getComponent', component); }) * @param id_component * @return Promise => obj ={} or null */ getComponent(id_component: string): Promise; /** * @example * this.vhQueryCloudCam.getComponents() .then((components)=>{ console.log('getComponents', components); }) * @return Promise => array(object) = [{},{},..] */ getComponents(): Promise; private publishObservableEventIcons; private observableLocalIcons; /** * @example: * this.observableIcon = this.vhQueryCloudCam.getObservableLocalIcons().subscribe((localIcons:any) => { do something... }) ngOnDestroy(){ this.observableIcon.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalIcons(): Observable; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalIcon('5fb6780ca2148e09806c5b01'); * @param id_icon * @return Object => obj = {} or null */ getlocalIcon(id_icon: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalIcons(); * @return Array(object) => array = [{},{},...] */ getlocalIcons(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalIcons() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIcon(), getlocalIcons() trong localstorage * @return Promise => null */ refreshLocalIcons(): any; /** * @example: * this.vhQueryCloudCam.addIcon({name:'camera 2', quantity:20, price:200000}) .then((icon)=>{ console.log('addIcon', icon); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addIcon(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateIcon('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIcon', bool); }) * @param id_icon * @param data * @return Promise => bool = true or false */ updateIcon(id_icon: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteIcon('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIcon', bool); }) * @param id_icon * @return Promise => bool = true or false */ deleteIcon(id_icon: string): Promise; /** * @example * this.vhQueryCloudCam.getIcon('5fb67fda87c0f21d484cbdf3') .then((icon)=>{ console.log('getIcon', icon); }) * @param id_icon * @return Promise => obj ={} or null */ getIcon(id_icon: string): Promise; /** * @example * this.vhQueryCloudCam.getIcons() .then((icons)=>{ console.log('getIcons', icons); }) * @return Promise => array(object) = [{},{},..] */ getIcons(): Promise; private publishObservableEventAppSettingNameStations; private observableLocalAppSettingNameStations; /** * @example: * this.observableAppSetting = this.vhQueryCloudCam.getObservableLocalAppSettingNameStations().subscribe((localAppSettings:any) => { do something... }) ngOnDestroy(){ this.observableAppSetting.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameStations(): Observable; /** *@example: this.vhQueryCloudCam.getLocalAppSettingNameStations() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameStations(): any[]; /** * @example: let appsetting = this.vhQueryCloudCam.getLocalAppSettingNameStation('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameStation(appsetting_name: any): any; /** * @example: * let appsetting = this.vhQueryCloudCam.getLocalAppSettingStation('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingStation; /** * Hàm này refresh giá trị mới nhất cho hàm getLocalAppSettingNameStations(), getLocalAppSettingNameStation() trong localstorage * @return Promise => null */ refreshLocalAppSettingNameStations(): any; /** * @example * this.vhQueryCloudCam.getAppSettingStations() .then((settings)=>{ console.log('getAppSettings', settings); }) * @return Promise => array(object) = [{},{},..] */ private getAppSettingStations; /** * @example: this.vhQueryCloudCam.updateAppSettingNameStation('info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameStation(appsetting_name: any, value: any): Promise; /** * @example * this.vhQueryCloudCam.deleteAppSettingNameStation('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameStation(appsetting_name: any): Promise; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalScript('5fb6780ca2148e09806c5b01'); * @param id_script * @return Object => obj = {} or null */ getlocalScript(id_script: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalScripts(); * @return Array(object) => array = [{},{},...] */ getlocalScripts(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalScripts() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript(), getlocalScripts() trong localstorage * @return Promise => null */ refreshLocalScripts(): any; /** * @example: * this.vhQueryCloudCam.addScript({name:'camera 2', quantity:20, price:200000}) .then((script)=>{ console.log('addScript', script); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateScript('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript', bool); }) * @param id_script * @param data * @return Promise => bool = true or false */ updateScript(id_script: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteScript('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript', bool); }) * @param id_script * @return Promise => bool = true or false */ deleteScript(id_script: string): Promise; /** * @example * this.vhQueryCloudCam.getScript('5fb67fda87c0f21d484cbdf3') .then((script)=>{ console.log('getScript', script); }) * @param id_script * @return Promise => obj ={} or null */ getScript(id_script: string): Promise; /** * @example * this.vhQueryCloudCam.getScripts() .then((scripts)=>{ console.log('getScripts', scripts); }) * @return Promise => array(object) = [{},{},..] */ getScripts(): Promise; /** * @example: * let wallet = this.vhQueryCloudCam.getlocalScript_detail('5fb6780ca2148e09806c5b01'); * @param id_script_detail * @return Object => obj = {} or null */ getlocalScript_detail(id_script_detail: any): any; /** * @example: * let wallets = this.vhQueryCloudCam.getlocalScript_details(); * @return Array(object) => array = [{},{},...] */ getlocalScript_details(): any; /** * @example: * this.vhQueryCloudCam.refreshLocalScript_details() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript_detail(), getlocalScript_details() trong localstorage * @return Promise => null */ refreshLocalScript_details(): any; /** * @example: * this.vhQueryCloudCam.addScript_detail({name:'camera 2', quantity:20, price:200000}) .then((script_detail)=>{ console.log('addScript_detail', script_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript_detail(data: object): Promise; /** * @example: * this.vhQueryCloudCam.updateScript_detail('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript_detail', bool); }) * @param id_script_detail * @param data * @return Promise => bool = true or false */ updateScript_detail(id_script_detail: string, data: object): Promise; /** * @example: * this.vhQueryCloudCam.deleteScript_detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript_detail', bool); }) * @param id_script_detail * @return Promise => bool = true or false */ deleteScript_detail(id_script_detail: string): Promise; /** * @example * this.vhQueryCloudCam.getScript_detail('5fb67fda87c0f21d484cbdf3') .then((script_detail)=>{ console.log('getScript_detail', script_detail); }) * @param id_script_detail * @return Promise => obj ={} or null */ getScript_detail(id_script_detail: string): Promise; /** * @example * this.vhQueryCloudCam.getScript_details() .then((script_details)=>{ console.log('getScript_details', script_details); }) * @return Promise => array(object) = [{},{},..] */ getScript_details(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryClouds { private vhMGDB_auth; private vhMGDB_socketMongoDB; private vhMGDB_clouds; private vhMGDB_database; private vhQuery; private vhAuth; private vhAlgorithm; private designs; private cameras; private cloudcams; private rooms; private mainboards; private functions; private components; private icons; private appsettingstations; private scripts; private script_details; private logs; private hwinfo; private subjectcameras; private subjectappsettingstations; private subjectrooms; private subjectmainboards; private subjectfunctions; private subjecticons; private subjectcomponents; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_clouds: VhMGDB_clouds, vhMGDB_database: VhMGDB_database, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @example: this.vhQueryClouds.syncCollections().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections(): Promise; private initSyncCollections; /** * @example: * this.vhQueryClouds.closeSyncCollections(); * disconnect collections synchronization in the APP * @returns void */ closeSyncCollections(): void; /** * vhQueryClouds * @returns */ private callbackCollectionInsert; /** * vhQueryClouds * @returns */ private callbackCollectionUpdate; /** * vhQueryClouds * @returns */ private callbackCollectionDelete; /** * vhQueryClouds * @returns */ startLocalStorage(): Promise; createPaymentVnpay(amount: number, bankCode: string, data: any, backHref: string, fee: object, fee_details: object): any; /** * @example: * this.vhQueryClouds.getDiscountFromCode('VIETHAS') .then((discount)=>{ console.log('getDiscountFromCode', discount); },(error:any)=>{ console.log('error', error); }) * @returns */ getDiscountFromCode(code: string): any; /** * @example: * this.vhQueryClouds.getPriceList_Records() .then((pricelist)=>{ console.log('getPriceList_Records', pricelist); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_Records(): any; /** * @example: * this.vhQueryClouds.getPriceList_Detectors() .then((pricelist)=>{ console.log('getPriceList_Detectors', pricelist); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_Detectors(): any; /** * @example: * this.vhQueryClouds.getPriceList_rLPRs() .then((pricelist_detectors)=>{ console.log('getPriceList_rLPRs', pricelist_detectors); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_rLPRs(): any; /** * @example: * this.vhQueryClouds.getPriceList_cLPRs() .then((getPriceList_cLPRs)=>{ console.log('getPriceList_cLPRs', getPriceList_cLPRs); },(error:any)=>{ console.log('error', error); }) * @returns */ getPriceList_cLPRs(): any; private publishObservableEventCameras; private observableLocalCameras; /** * @example: * this.observableCamera = this.vhQueryClouds.getObservableLocalCameras().subscribe((localCameras:any) => { do something... }) ngOnDestroy(){ this.observableCamera.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCameras(): Observable; /** * @example: * let wallet = this.vhQueryClouds.getlocalCamera('5fb6780ca2148e09806c5b01'); * @param id_camera * @return Object => obj = {} or null */ getlocalCamera(id_camera: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalCameras(); * @return Array(object) => array = [{},{},...] */ getlocalCameras(): any; /** * @example: * this.vhQueryClouds.refreshLocalCameras() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCamera(), getlocalCameras() trong localstorage * @return Promise => null */ refreshLocalCameras(): any; /** * @example: * this.vhQueryClouds.createLicenseCam() .then((licensecam)=>{ console.log('licensecam', licensecam); }) * @return Promise => licensecam */ createLicenseCam(): Promise; /** * @example: * this.vhQueryClouds.addCamera({name:'camera 2', url:'rtsp://admin:admin@115.78.100.57:1020/av_stream/ch0', licensecam:'pTqOFsJEndPrg7AImFxV'}) .then((camera)=>{ console.log('addCamera', camera); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 * Trường hợp không thành công: * code = 0 : licensecam không đúng * code = 1 : licensecam đã và đang được sử dụng */ addCamera(data: any): Promise; /** * @example: * this.vhQueryClouds.updateCamera('5fb6780ca2148e09806c5b01', {name:camera 3}) .then((bool:any)=>{ console.log('updateCamera', bool); }) * @param id_camera * @param data * @return Promise => bool = true or false */ updateCamera(id_camera: string, data: any): Promise; /** * @example: * this.vhQueryClouds.deleteCamera('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCamera', bool); }) * @param id_camera * @return Promise => bool = true or false */ deleteCamera(id_camera: string): Promise; /** * @example * this.vhQueryClouds.getCamera('5fb67fda87c0f21d484cbdf3') .then((camera)=>{ console.log('getCamera', camera); }) * @param id_camera * @return Promise => obj ={} or null */ getCamera(id_camera: string): Promise; /** * @example * this.vhQueryClouds.getCameras() .then((cameras)=>{ console.log('getCameras', cameras); }) * @return Promise => array(object) = [{},{},..] */ getCameras(): Promise; /** * @example: * let cloudcam = this.vhQueryClouds.getlocalCloudCam('5fb6780ca2148e09806c5b01'); * @param licensecam * @return Object => obj = {} or null */ getlocalCloudCam(licensecam: any): any; /** * @example: * let cloudcams = this.vhQueryClouds.getlocalCloudCams(); * @return Array(object) => array = [{},{},...] */ getlocalCloudCams(): any; /** * @example: * this.vhQueryClouds.refreshLocalCloudCams() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCloudCam(), getlocalCloudCams() trong localstorage * @return Promise => null */ refreshLocalCloudCams(): any; /** * @example: * this.vhQueryClouds.changeCloudCamEnableCLPRbyUser('5fb6780ca2148e09806c5b01', false,'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('changeCloudCamEnableCLPRbyUser', bool); }) * @param licensecam * @param cLPR_enable * @return Promise => bool = true or false */ changeCloudCamEnableCLPRbyUser(licensecam: string, cLPR_enable: boolean, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.changeCloudCamEnableRLPRbyUser('5fb6780ca2148e09806c5b01', false,'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('changeCloudCamEnableRLPRbyUser', bool); }) * @param licensecam * @param rLPR_enable * @return Promise => bool = true or false */ changeCloudCamEnableRLPRbyUser(licensecam: string, rLPR_enable: boolean, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.changeCloudCamEnableDetectorByUser('5fb6780ca2148e09806c5b01', false,'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('changeCloudCamEnableDetectorByUser', bool); }) * @param licensecam * @param detector_enable * @return Promise => bool = true or false */ changeCloudCamEnableDetectorByUser(licensecam: string, detector_enable: boolean, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.changeCloudCamEnableRecordByUser('5fb6780ca2148e09806c5b01', false,'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('changeCloudCamEnableRecordByUser', bool); }) * @param licensecam * @param record_enable * @return Promise => bool = true or false */ changeCloudCamEnableRecordByUser(licensecam: string, record_enable: boolean, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.changeCloudCamEnableActiveByUser('5fb6780ca2148e09806c5b01', false,'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('changeCloudCamEnableActiveByUser', bool); }) * @param licensecam * @param active * @return Promise => bool = true or false */ changeCloudCamEnableActiveByUser(licensecam: string, active: boolean, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.changeCloudCamURLbyUser('5fb6780ca2148e09806c5b01', 'rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream','udp', 'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('changeCloudCamURLbyUser', bool); }) * @param licensecam * @param url * @return Promise => bool = true or false */ changeCloudCamURLbyUser(licensecam: string, url: string, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.addCloudCamByUser('rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream', 'udp', {name:camera 3},'fgsdge5etw45tw34w3w34t3') .then((cloudcam:any)=>{ console.log('addCloudCamByUser', cloudcam); }) * @param url * @param data * @param eutoken * @return Promise => {} or null */ addCloudCamByUser(url: string, data: object, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.updateCloudCamDataByUser('5fb6780ca2148e09806c5b01', {name:'camera 3'},'fgsdge5etw45tw34w3w34t3) .then((bool:any)=>{ console.log('updateCloudCamDataByUser', bool); }) * @param licensecam * @param data * @return Promise => bool = true or false */ updateCloudCamDataByUser(licensecam: string, data: object, eutoken: string): Promise; /** * @example: * this.vhQueryClouds.createEUtokenByUser() .then((bool:any)=>{ console.log('createEUtokenByUser', bool); }) * @return String => eutoken = 'fgsdge5etw45tw34w3w34t3' */ createEUtokenByUser(): Promise; /** * @example: * this.vhQueryClouds.getUtokenByUser() .then((eutoken)=>{ console.log('getUtokenByUser', eutoken); }) * @return String => eutoken = 'fgsdge5etw45tw34w3w34t3' */ getUtokenByUser(): Promise; /** * @example: * this.vhQueryClouds.deleteCloudCamByUser('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCloudCam', bool); }) * @param licensecam * @return Promise => bool = true or false */ deleteCloudCamByUser(licensecam: string): Promise; /** * @example * this.vhQueryClouds.getCloudCamByUser('5fb67fda87c0f21d484cbdf3') .then((cloudcam:any)=>{ console.log('getCloudCamByUser', cloudcam); }) * @param licensecam:string * @return Promise => obj ={} or null */ getCloudCamByUser(licensecam: string): Promise; /** * @example * this.vhQueryClouds.getCloudCamsbyUser() .then((cloudcams)=>{ console.log('getCloudCams', cloudcams); }) * @return Promise => array(object) = [{},{},..] */ getCloudCamsbyUser(): Promise; /** * * @param licensecam * @param starttime * @param endtime * @return Promise => array(string) = [,,..] */ getPlaybackListCamByUser(licensecam: string, camplaybackURL: string, starttime: any, endtime: any, eutoken: string): Promise; private publishObservableEventRooms; private observableLocalRooms; /** * @example: * this.observableRoom = this.vhQueryClouds.getObservableLocalRooms().subscribe((localRooms:any) => { do something... }) ngOnDestroy(){ this.observableRoom.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalRooms(): Observable; /** * @example: * let wallet = this.vhQueryClouds.getlocalRoom('5fb6780ca2148e09806c5b01'); * @param id_room * @return Object => obj = {} or null */ getlocalRoom(id_room: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalRooms(); * @return Array(object) => array = [{},{},...] */ getlocalRooms(): any; /** * @example: * this.vhQueryClouds.refreshLocalRooms() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalRoom(), getlocalRooms() trong localstorage * @return Promise => null */ refreshLocalRooms(): any; /** * @example: * this.vhQueryClouds.addRoom({name:'camera 2', quantity:20, price:200000}) .then((room)=>{ console.log('addRoom', room); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addRoom(data: object): Promise; /** * @example: * this.vhQueryClouds.updateRoom('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateRoom', bool); }) * @param id_room * @param data * @return Promise => bool = true or false */ updateRoom(id_room: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteRoom('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteRoom', bool); }) * @param id_room * @return Promise => bool = true or false */ deleteRoom(id_room: string): Promise; /** * @example * this.vhQueryClouds.getRoom('5fb67fda87c0f21d484cbdf3') .then((room)=>{ console.log('getRoom', room); }) * @param id_room * @return Promise => obj ={} or null */ getRoom(id_room: string): Promise; /** * @example * this.vhQueryClouds.getRooms() .then((rooms)=>{ console.log('getRooms', rooms); }) * @return Promise => array(object) = [{},{},..] */ getRooms(): Promise; /** * @example: * let log = this.vhQueryClouds.getlocalLog('5fb6780ca2148e09806c5b01'); * @param id_log * @return Object => obj = {} or null */ getlocalLog(id_log: any): any; /** * @example: * let logs = this.vhQueryClouds.getlocalLogs(); * @return Array(object) => array = [{},{},...] */ getlocalLogs(): any; /** * @example: * this.vhQueryClouds.refreshLocalLogs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalLog(), getlocalLogs() trong localstorage * @return Promise => null */ refreshLocalLogs(): any; /** * @example: * this.vhQueryClouds.addLog({name:'camera 2', quantity:20, price:200000}) .then((log)=>{ console.log('addLog', log); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addLog(data: object): Promise; /** * @example: * this.vhQueryClouds.updateLog('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateLog', bool); }) * @param id_log * @param data * @return Promise => bool = true or false */ updateLog(id_log: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteLog('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteLog', bool); }) * @param id_log * @return Promise => bool = true or false */ deleteLog(id_log: string): Promise; /** * @example * this.vhQueryClouds.getLog('5fb67fda87c0f21d484cbdf3') .then((log)=>{ console.log('getLog', log); }) * @param id_log * @return Promise => obj ={} or null */ getLog(id_log: string): Promise; /** * @example * this.vhQueryClouds.getLogs() .then((logs)=>{ console.log('getLogs', logs); }) * @return Promise => array(object) = [{},{},..] */ getLogs(): Promise; private publishObservableEventMainboards; private observableLocalMainboards; /** * @example: * this.observableMainboard = this.vhQueryClouds.observableLocalMainboards().subscribe((localMainboards:any) => { do something... }) ngOnDestroy(){ this.observableMainboard.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalMainboards(): Observable; /** * @example: * let wallet = this.vhQueryClouds.getlocalMainboard('5fb6780ca2148e09806c5b01'); * @param id_mainboard * @return Object => obj = {} or null */ getlocalMainboard(id_mainboard: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalMainboards(); * @return Array(object) => array = [{},{},...] */ getlocalMainboards(): any; /** * @example: * this.vhQueryClouds.refreshLocalMainboards() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalMainboard(), getlocalMainboards() trong localstorage * @return Promise => null */ refreshLocalMainboards(): any; /** * @example: * this.vhQueryClouds.addMainboard({name:'camera 2', quantity:20, price:200000}) .then((mainboard)=>{ console.log('addMainboard', mainboard); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMainboard(data: object): Promise; /** * @example: * this.vhQueryClouds.updateMainboard('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMainboard', bool); }) * @param id_mainboard * @param data * @return Promise => bool = true or false */ updateMainboard(id_mainboard: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteMainboard('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMainboard', bool); }) * @param id_mainboard * @return Promise => bool = true or false */ deleteMainboard(id_mainboard: string): Promise; /** * @example * this.vhQueryClouds.getMainboard('5fb67fda87c0f21d484cbdf3') .then((mainboard)=>{ console.log('getMainboard', mainboard); }) * @param id_mainboard * @return Promise => obj ={} or null */ getMainboard(id_mainboard: string): Promise; /** * @example * this.vhQueryClouds.getMainboards() .then((mainboards)=>{ console.log('getMainboards', mainboards); }) * @return Promise => array(object) = [{},{},..] */ getMainboards(): Promise; private publishObservableEventFunctions; private observableLocalFunctions; /** * @example: * this.observableFunction = this.vhQueryClouds.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalFunctions(): Observable; /** * @example: * let wallet = this.vhQueryClouds.getlocalFunction('5fb6780ca2148e09806c5b01'); * @param id_function * @return Object => obj = {} or null */ getlocalFunction(id_function: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalFunctions(); * @return Array(object) => array = [{},{},...] */ getlocalFunctions(): any; /** * @example: * this.vhQueryClouds.refreshLocalFunctions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalFunction(), getlocalFunctions() trong localstorage * @return Promise => null */ refreshLocalFunctions(): any; /** * @example: * this.vhQueryClouds.addFunction({name:'camera 2', quantity:20, price:200000}) .then((func)=>{ console.log('addFunction', func); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addFunction(data: object): Promise; /** * @example: * this.vhQueryClouds.updateFunction('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateFunction', bool); }) * @param id_function * @param data * @return Promise => bool = true or false */ updateFunction(id_function: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteFunction('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteFunction', bool); }) * @param id_function * @return Promise => bool = true or false */ deleteFunction(id_function: string): Promise; /** * @example * this.vhQueryClouds.getFunction('5fb67fda87c0f21d484cbdf3') .then((func)=>{ console.log('getFunction', func); }) * @param id_function * @return Promise => obj ={} or null */ getFunction(id_function: string): Promise; /** * @example * this.vhQueryClouds.getFunctions() .then((functions)=>{ console.log('getFunctions', functions); }) * @return Promise => array(object) = [{},{},..] */ getFunctions(): Promise; private publishObservableEventComponents; private observableLocalComponents; /** * @example: * this.observableFunction = this.vhQueryClouds.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalComponents(): Observable; /** * @example: * let wallet = this.vhQueryClouds.getlocalComponent('5fb6780ca2148e09806c5b01'); * @param id_component * @return Object => obj = {} or null */ getlocalComponent(id_component: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalComponents(); * @return Array(object) => array = [{},{},...] */ getlocalComponents(): any; /** * @example: * this.vhQueryClouds.refreshLocalComponents() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalComponent(), getlocalComponents() trong localstorage * @return Promise => null */ refreshLocalComponents(): any; /** * @example: * this.vhQueryClouds.addComponent({name:'camera 2', quantity:20, price:200000}) .then((component)=>{ console.log('addComponent', component); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addComponent(data: object): Promise; /** * @example: * this.vhQueryClouds.updateComponent('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateComponent', bool); }) * @param id_component * @param data * @return Promise => bool = true or false */ updateComponent(id_component: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteComponent('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteComponent', bool); }) * @param id_component * @return Promise => bool = true or false */ deleteComponent(id_component: string): Promise; /** * @example * this.vhQueryClouds.getComponent('5fb67fda87c0f21d484cbdf3') .then((component)=>{ console.log('getComponent', component); }) * @param id_component * @return Promise => obj ={} or null */ getComponent(id_component: string): Promise; /** * @example * this.vhQueryClouds.getComponents() .then((components)=>{ console.log('getComponents', components); }) * @return Promise => array(object) = [{},{},..] */ getComponents(): Promise; private publishObservableEventIcons; private observableLocalIcons; /** * @example: * this.observableIcon = this.vhQueryClouds.getObservableLocalIcons().subscribe((localIcons:any) => { do something... }) ngOnDestroy(){ this.observableIcon.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalIcons(): Observable; /** * @example: * let wallet = this.vhQueryClouds.getlocalIcon('5fb6780ca2148e09806c5b01'); * @param id_icon * @return Object => obj = {} or null */ getlocalIcon(id_icon: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalIcons(); * @return Array(object) => array = [{},{},...] */ getlocalIcons(): any; /** * @example: * this.vhQueryClouds.refreshLocalIcons() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIcon(), getlocalIcons() trong localstorage * @return Promise => null */ refreshLocalIcons(): any; /** * @example: * this.vhQueryClouds.addIcon({name:'camera 2', quantity:20, price:200000}) .then((icon)=>{ console.log('addIcon', icon); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addIcon(data: object): Promise; /** * @example: * this.vhQueryClouds.updateIcon('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIcon', bool); }) * @param id_icon * @param data * @return Promise => bool = true or false */ updateIcon(id_icon: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteIcon('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIcon', bool); }) * @param id_icon * @return Promise => bool = true or false */ deleteIcon(id_icon: string): Promise; /** * @example * this.vhQueryClouds.getIcon('5fb67fda87c0f21d484cbdf3') .then((icon)=>{ console.log('getIcon', icon); }) * @param id_icon * @return Promise => obj ={} or null */ getIcon(id_icon: string): Promise; /** * @example * this.vhQueryClouds.getIcons() .then((icons)=>{ console.log('getIcons', icons); }) * @return Promise => array(object) = [{},{},..] */ getIcons(): Promise; private publishObservableEventAppSettingNameStations; private observableLocalAppSettingNameStations; /** * @example: * this.observableAppSetting = this.vhQueryClouds.getObservableLocalAppSettingNameStations().subscribe((localAppSettings:any) => { do something... }) ngOnDestroy(){ this.observableAppSetting.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameStations(): Observable; /** *@example: this.vhQueryClouds.getLocalAppSettingNameStations() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameStations(): any[]; /** * @example: let appsetting = this.vhQueryClouds.getLocalAppSettingNameStation('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameStation(appsetting_name: any): any; /** * @example: * let appsetting = this.vhQueryClouds.getLocalAppSettingStation('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingStation; /** * Hàm này refresh giá trị mới nhất cho hàm getLocalAppSettingNameStations(), getLocalAppSettingNameStation() trong localstorage * @return Promise => null */ refreshLocalAppSettingNameStations(): any; /** * @example * this.vhQueryClouds.getAppSettingStations() .then((settings)=>{ console.log('getAppSettings', settings); }) * @return Promise => array(object) = [{},{},..] */ private getAppSettingStations; /** * @example: this.vhQueryClouds.updateAppSettingNameStation('info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameStation(appsetting_name: any, value: any): Promise; /** * @example * this.vhQueryClouds.deleteAppSettingNameStation('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameStation(appsetting_name: any): Promise; /** * @example: * let wallet = this.vhQueryClouds.getlocalScript('5fb6780ca2148e09806c5b01'); * @param id_script * @return Object => obj = {} or null */ getlocalScript(id_script: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalScripts(); * @return Array(object) => array = [{},{},...] */ getlocalScripts(): any; /** * @example: * this.vhQueryClouds.refreshLocalScripts() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript(), getlocalScripts() trong localstorage * @return Promise => null */ refreshLocalScripts(): any; /** * @example: * this.vhQueryClouds.addScript({name:'camera 2', quantity:20, price:200000}) .then((script)=>{ console.log('addScript', script); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript(data: object): Promise; /** * @example: * this.vhQueryClouds.updateScript('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript', bool); }) * @param id_script * @param data * @return Promise => bool = true or false */ updateScript(id_script: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteScript('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript', bool); }) * @param id_script * @return Promise => bool = true or false */ deleteScript(id_script: string): Promise; /** * @example * this.vhQueryClouds.getScript('5fb67fda87c0f21d484cbdf3') .then((script)=>{ console.log('getScript', script); }) * @param id_script * @return Promise => obj ={} or null */ getScript(id_script: string): Promise; /** * @example * this.vhQueryClouds.getScripts() .then((scripts)=>{ console.log('getScripts', scripts); }) * @return Promise => array(object) = [{},{},..] */ getScripts(): Promise; /** * @example: * let wallet = this.vhQueryClouds.getlocalScript_detail('5fb6780ca2148e09806c5b01'); * @param id_script_detail * @return Object => obj = {} or null */ getlocalScript_detail(id_script_detail: any): any; /** * @example: * let wallets = this.vhQueryClouds.getlocalScript_details(); * @return Array(object) => array = [{},{},...] */ getlocalScript_details(): any; /** * @example: * this.vhQueryClouds.refreshLocalScript_details() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript_detail(), getlocalScript_details() trong localstorage * @return Promise => null */ refreshLocalScript_details(): any; /** * @example: * this.vhQueryClouds.addScript_detail({name:'camera 2', quantity:20, price:200000}) .then((script_detail)=>{ console.log('addScript_detail', script_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript_detail(data: object): Promise; /** * @example: * this.vhQueryClouds.updateScript_detail('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript_detail', bool); }) * @param id_script_detail * @param data * @return Promise => bool = true or false */ updateScript_detail(id_script_detail: string, data: object): Promise; /** * @example: * this.vhQueryClouds.deleteScript_detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript_detail', bool); }) * @param id_script_detail * @return Promise => bool = true or false */ deleteScript_detail(id_script_detail: string): Promise; /** * @example * this.vhQueryClouds.getScript_detail('5fb67fda87c0f21d484cbdf3') .then((script_detail)=>{ console.log('getScript_detail', script_detail); }) * @param id_script_detail * @return Promise => obj ={} or null */ getScript_detail(id_script_detail: string): Promise; /** * @example * this.vhQueryClouds.getScript_details() .then((script_details)=>{ console.log('getScript_details', script_details); }) * @return Promise => array(object) = [{},{},..] */ getScript_details(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhEcommerce { private vhMGDB_auth; private vhMGDB_socketMongoDB; private vhMGDB_database; private vhMGDB_shopee; private vhMGDB_tiktok; private productlisttiktoks; private shoplisttiktok; private productlistshopees; private shoplistshopee; private lazadapricecomparinglist; private tikipricecomparinglist; private sendopricecomparinglist; private shopeepricecomparinglist; private tiktokpricecomparinglist; private callbacklazadapricecomparing; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_database: VhMGDB_database, vhMGDB_shopee: VhMGDB_shopee, vhMGDB_tiktok: VhMGDB_tiktok); /** * @example: * let backHref = http://localhost:4200/dashboard/overview'; this.vhEcommerce.signInTiktok(id_branch, backHref).then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @returns Promise => true or false */ signInTiktok(id_branch: string, backHref: string): Promise; /** * @example: this.vhEcommerce.signOutTiktok('938476838whsofis').then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @param id_shop * @returns Promise => true or false */ signOutTiktok(id_shop: string): Promise; /** * @example: * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.getProductListTiktok(id_branch).then(()=>{ do something... },(error:any)=>{ }) * @returns */ private getProductListTiktok; private getProductListTiktoks; /** * @example: * let productlistlazada = this.vhEcommerce.getlocalProductListTiktok('ư0e4tuiwe98rhvqw9vtqw9t7rq987r9qvwn98et98'); * @param id_shop * @returns Promise => Array */ getlocalProductListTiktok(id_shop: any): any; /** * @example: * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.refreshLocalProductListTiktok(id_branch) .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getProductListTiktok() trong localstorage * @return Promise => null */ refreshLocalProductListTiktok(id_branch: string, shop_id?: string): any; /** * let localshoplisttiktok = this.vhEcommerce.getlocalShopListTiktok(); * @returns */ getlocalShopListTiktok(): any; /** * Cập nhật giá * @example: * this.vhEcommerce.updatePriceTiktok(shop_cipher, app_key, access_token, product_id, json, id_shop).then((order)=>{ do something... },(error:any)=>{ }) * @param shop_cipher * @param app_key * @param access_token * @param product_id * @param json * @param id_shop * @returns */ updatePriceTiktok(shop_cipher: string, app_key: string, access_token: string, product_id: string, json: any, id_shop: string): Promise; /** * Cập nhật tồn kho * @example: * this.vhEcommerce.updateStockTiktok(shop_cipher, app_key, access_token, product_id, json, id_shop).then((order)=>{ do something... },(error:any)=>{ }) * @param shop_cipher * @param app_key * @param access_token * @param product_id * @param json * @param id_shop * @returns */ updateStockTiktok(shop_cipher: string, app_key: string, access_token: string, product_id: string, json: any, id_shop: string): Promise; /** * Lấy số lượng tồn kho * @example: * this.vhEcommerce.searchInventoryTiktok(shop_cipher, app_key, access_token, json).then((order)=>{ do something... },(error:any)=>{ }) * @param shop_cipher * @param app_key * @param access_token * @param json * @returns */ searchInventoryTiktok(shop_cipher: string, app_key: string, access_token: string, json: any): Promise; /** * Lấy về giao dịch sao kê * @example: * this.vhEcommerce.getOrderStatementTransactionsTiktok(shop_cipher, app_key, access_token, order_id).then((order)=>{ do something... },(error:any)=>{ }) * @param shop_cipher * @param app_key * @param access_token * @param order_id * @returns */ getOrderStatementTransactionsTiktok(shop_cipher: string, app_key: string, access_token: string, order_id: string): Promise; /** * @example: *let time_from = new Date('2021-10-28'); * let time_to = new Date('2021-10-30'); * this.vhEcommerce.getSalesOrderListTiktok(time_from, time_to, shop_cipher, app_key, access_token, id_shop) .then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param time_from * @param time_to * @param shop_cipher * @param app_key * @param access_token * @param id_shop * @returns */ getSalesOrderListTiktok(time_from: any, time_to: any, shop_cipher: string, app_key: string, access_token: string, id_shop: string): Promise; /** * Hàm này lấy về chi tiết của một hóa đơn * @example * this.vhEcommerce.getSalesOrderDetailTiktok('14424213387', '403754acaafc4564a16c19faa32d73c8', 'gsdr3454u54w34tfq') .then((salesorderdetail)=>{ console.log('getSalesOrderDetailTiktok', salesorderdetail); },(error:any)=>{ console.log('error', error); }) * @param id * @param shop_cipher * @param app_key * @param access_token * @param id_shop * @returns Promise => obj ={} or null */ getSalesOrderDetailTiktok(id: string, shop_cipher: string, app_key: string, access_token: string, id_shop: any): Promise; /** * Hàm này lấy về mảng các đơn hàng (salesorder) được lưu trong database viethas (ko phải database tiktok) * @example * this.vhEcommerce.getSalesOrderTiktok_fromViethas( ['14424213387','14424273835'], '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('array', array); },(error:any)=>{ console.log('error', error); }) * @param ids : là mảng các id của các order * @param id_shop * @returns Promise => Array(object or null) */ getSalesOrderTiktok_fromViethas(ids: any, id_shop: string): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database tiktok), lưu ý các order_sn đc lấy từ tiktok server về * @example: * this.vhEcommerce.updateSalesOrderTiktok('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', {check:true}) .then((bool:any)=>{ console.log('updateSalesOrderTiktok', bool); }, error=>{ reject(error) }) * @param id_shop * @param id * @param data * @return Promise => bool = true or false */ updateSalesOrderTiktok(id_shop: string, id: string, data: object): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database tiktok), lưu ý các order_sn đc import từ file ngoài vào (excel, csv...) * @example: * this.vhEcommerce.updateSalesOrderTiktok_byFile(['144242133871', '14424213387'], {check:true}, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzODE3MzIwLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.9S18n7EuG7XxbZVm9kjUBozJVjx2_EZRNAn38wBUaDs', '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('updateSalesOrderTiktok_byFile', array); }, error=>{ console.log(error) }) * @param ids : là mảng các id của các order * @param data * @param access_token * @param id_shop * @return Promise => Array(bool) = [true or false,,...] */ updateSalesOrderTiktok_byFile(ids: any, data: object, shop_cipher: string, app_key: string, access_token: string, id_shop: string): Promise; /** * Tạo liên kết sản phẩm trên phần mềm quản lý bán hàng sales viethas và sản phẩm trên sàn tiktok * @example: * let product = this.vhQuerySales.getlocalDetailProduct(id_sub_or_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.addMergeTiktokProduct_skus(product,'tf3452345234', [{},{}], 'hjhjrtyur56u53') .then((bool:any)=>{ console.log('addMergeTiktokProduct_skus', bool); }, error=>{ console.log('error', error); }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param id : trường id (cha) trong sản phẩm tiktok * @param skusArray : [{id,..},{id,..}] * @param id_shop * @return Promise => boolean true or false */ addMergeTiktokProduct_skus(product: any, id: string, skusArray: any, id_shop: string, id_branch: string): Promise; /** * @example: * let product = this.vhQuerySales.getlocalProduct(id_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.updateMergeTiktokProduct('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', {hidden:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeTiktokProduct', bool); }, error=>{ console.log('error', error); }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param id: trường id (cha) trong sản phẩm tiki * @param data : {hidden:true} * @returns Promise => bool = true or false */ updateMergeTiktokProduct(product: any, id: string, data: any, id_shop: string, id_branch: string): Promise; /** * @example: * let product = this.vhQuerySales.getlocalProduct(id_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.updateMergeTiktokProduct_skus('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', '13123135654', {xyz:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeTiktokProduct_skus', bool); }, error=>{ console.log('error', error); }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param id * @param sku_id : là trường id trong skus * @param data : object => data = {xyz:true} * @param id_shop * @returns Promise => bool = true or false */ updateMergeTiktokProduct_skus(product: any, id: number, sku_id: number, data: any, id_shop: string, id_branch: string): Promise; /** * @example: * let product = this.vhQuerySales.getlocalProduct(id_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.deleteMergeTiktokProduct_skus('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', 'sdfgsdfgererasds3563') .then((bool:any)=>{ console.log('deleteMergeTiktokProduct_skus', bool); }, error=>{ reject(error) }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param id * @param sku_id: là trường id trong skus * @param id_shop * @return Promise => bool = true or false */ deleteMergeTiktokProduct_skus(product: any, id: string, sku_id: number, id_shop: string, id_branch: string): Promise; /** * @notice : lấy thông tin vận đơn (mã code người gửi , mã code người nhận, địa chỉ người nhận...) * @example: let order_sn = '2112156RC1JN5Y'; let access_token = '98efa569a4731bb67a8f76fed8808d66'; let shop_id = '894793475932'; this.vhEcommerce.getShippingDocumentShopee( order_sn, access_token, shop_id).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_sn * @param access_token * @param shop_id * @returns Promise */ getShippingDocumentShopee(order_sn: string, access_token: string, shop_id: string): Promise; /** * @notice : Lấy địa chỉ + thời gian lấy hàng * @example: let order_sn = '2112156RC1JN5Y'; let access_token = '98efa569a4731bb67a8f76fed8808d66'; let shop_id = '894793475932'; this.vhEcommerce.getShippingParameterShopee( order_sn, access_token, shop_id).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_sn * @param access_token * @param shop_id * @returns Promise */ getShippingParameterShopee(order_sn: string, access_token: string, shop_id: string): Promise; /** * @notice : Xác nhận đã đóng gói xong * @example: * let json = { order_sn: "2112156RC1JN5Y", pickup: { address_id: 51363234, pickup_time_id: "1639731600" } } let access_token = '98efa569a4731bb67a8f76fed8808d66' let shop_id = '894793475932'; this.vhEcommerce.confirmShippingByJSONShopee( json, access_token, shop_id).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param access_token * @param shop_id * @returns Promise */ confirmShippingByJSONShopee(json: any, access_token: string, shop_id: string): Promise; /** * @example: * this.vhEcommerce.observableLazadaPriceComparing('5fb6780ca2148e09806c5b01') .subscribe((data)=> { console.log('observableLazadaPriceComparing', data); },(error:any) => { console.log(error); }) * @param id_branch * @returns Observable => */ observableLazadaPriceComparing(id_branch: string): Observable; /** * @example: * this.vhEcommerce.closeLazadaPriceComparing(); * disconnect LazadaPriceComparing in the APP * @returns void */ closeLazadaPriceComparing(): void; /** * let lazadapricecomparinglist = this.vhEcommerce.getLocalLazadaPriceComparing(); * @returns Array */ getLocalLazadaPriceComparing(): any; /** * @example: * this.vhEcommerce.restartEcommercePriceComparingMACHINE('5fb6780ca2148e09806c5b01') .then((bool:any)=>{ console.log('restartEcommercePriceComparingMACHINE', bool); }, error=>{ console.log('error', error); }) * @param id_billdetail * @param data * @return Promise => bool = true or false */ restartEcommercePriceComparingMACHINE(): Promise; /** * Lấy về tất cả các shops lazada, sendo, tiki, shopee, dùng trong cấu hình gian hàng * @example: this.vhEcommerce.getAllShops(id_branch).then((shops)=>{ if(shops.length>0){ console.log('shops', shops) } }) * @param id_branch * @returns Promise Array */ getAllShops(id_branch: string): Promise; /** * Hàm này dùng update thông tin cho các shop * this.vhEcommerce.updateShop('5fb6780ca2148e09806c5b01', {name:lazadashop, id_customer: 'soidfja9wfhwa'}) .then((bool:any)=>{ console.log(bool); }, error=>{ console.log(error); }) * @param id_shop * @param data * @return Promise => bool = true or false */ updateShop(id_shop: string, data: object): Promise; /** * @example: * let backHref = http://localhost:4200/dashboard/overview'; this.vhEcommerce.signInShopee(id_branch, backHref).then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @returns Promise => true or false */ signInShopee(id_branch: string, backHref?: any): Promise; /** * @example: this.vhEcommerce.signOutShopee('938476838whsofis').then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @param id_shop * @returns Promise => true or false */ signOutShopee(id_shop: string): Promise; /** * @example: * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.refreshLocalProductListShopee(id_branch) .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getProductListShopee() trong localstorage * @return Promise => null */ refreshLocalProductListShopee(id_branch: string, shop_id?: string): any; /** * let localshoplistshopee = this.vhEcommerce.getlocalShopListShopee(); * @returns */ getlocalShopListShopee(): any; /** * @example: * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.getProductListShopee(id_branch).then(()=>{ do something... },(error:any)=>{ }) * @returns */ private getProductListShopee; private getProductListShopees; /** * @example: * let productlistlazada = this.vhEcommerce.getlocalProductListShopee('ư0e4tuiwe98rhvqw9vtqw9t7rq987r9qvwn98et98'); * @param id_shop * @returns Promise => Array */ getlocalProductListShopee(id_shop: any): any; /** * @example: this.vhEcommerce.getProductByItem_idShopee(access_token, product_id, id_shop).then((productshopee)=>{ console.log('productshopee', productshopee); }) * @returns Promise => object ={} or null */ getProductByItem_idShopee(access_token: string, item_id: number, id_shop: string): Promise; /** * @example: *let time_from = new Date('2021-10-28'); let time_to = new Date('2021-10-30'); let access_token = '4675cdb029b82eccb4a2a7e00b766a10'; let id_shop = '29976825'; this.vhEcommerce.getSalesOrderListShopee(time_from, time_to, access_token, id_shop) .then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param created_after * @param created_before * @param access_token * @returns */ getSalesOrderListShopee(time_from: any, time_to: any, access_token: string, id_shop: string): Promise; /** * Hàm này lấy về chi tiết của một hóa đơn * @example * this.vhEcommerce.getSalesOrderDetailShopee('14424213387', '403754acaafc4564a16c19faa32d73c8', 'gsdr3454u54w34tfq') .then((salesorderdetail)=>{ console.log('getSalesOrderDetailShopee', salesorderdetail); },(error:any)=>{ console.log('error', error); }) * @param order_sn * @param access_token * @param id_shop * @returns Promise => obj ={} or null */ getSalesOrderDetailShopee(order_sn: string, access_token: string, id_shop: any): Promise; /** * Hàm này lấy về tracking_number của một hóa đơn khi đơn chuyển sang trạng thái chờ lấy hàng * @example * this.vhEcommerce.getTrackingNumberShopee('14424213387', '403754acaafc4564a16c19faa32d73c8', 'gsdr3454u54w34tfq') .then((result)=>{ console.log('getTrackingNumberShopee', result); },(error:any)=>{ console.log('error', error); }) * @param order_sn * @param access_token * @param id_shop * @returns Promise => obj ={} */ getTrackingNumberShopee(order_sn: string, access_token: string, id_shop: any): Promise; /** * Tạo liên kết sản phẩm trên phần mềm quản lý bán hàng sales viethas và sản phẩm trên sàn shopee * @example: * let product = this.vhQuerySales.getlocalDetailProduct(id_sub_or_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.addMergeShopeesProduct_model(product,'tf3452345234', [{},{}], 'hjhjrtyur56u53') .then((bool:any)=>{ console.log('addMergeShopeesProduct_model', bool); }, error=>{ console.log('error', error); }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param item_id : trường item_id trong sản phẩm shopee * @param modelArray : [{SkuId1,..},{SkuId2,..}] * @param id_shop * @return Promise => boolean true or false */ addMergeShopeesProduct_model(product: any, item_id: string, modelArray: any, id_shop: string, id_branch: string): Promise; /** * @example: * let product = this.vhQuerySales.getlocalProduct(id_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.updateMergeShopeesProduct('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', {hidden:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeShopeesProduct', bool); }, error=>{ console.log('error', error); }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param item_id: trường item_id trong sản phẩm lazada * @param SkuId: trường SkuId trong sản phẩm lazada * @param data : {hidden:true} * @returns Promise => bool = true or false */ updateMergeShopeesProduct(product: any, item_id: string, data: any, id_shop: string, id_branch: string): Promise; /** * @example: * let product = this.vhQuerySales.getlocalProduct(id_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.updateMergeShopeesProduct_model('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', '13123135654', {xyz:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeShopeesProduct_model', bool); }, error=>{ console.log('error', error); }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param item_id * @param model_id : khác null, nếu null dùng hàm updateMergeShopeesProduct * @param data : object => data = {xyz:true} * @param id_shop * @returns Promise => bool = true or false */ updateMergeShopeesProduct_model(product: any, item_id: number, model_id: number, data: any, id_shop: string, id_branch: string): Promise; /** * @example: * let product = this.vhQuerySales.getlocalProduct(id_product); * let id_branch = this.vhQuerySales.getDefaultBranch()._id; * this.vhEcommerce.deleteMergeShopeeProduct_model('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', 'sdfgsdfgererasds3563') .then((bool:any)=>{ console.log('deleteMergeShopeeProduct_model', bool); }, error=>{ reject(error) }) * @param product : sản phẩm detailproduct trên phần mềm bán hàng * @param item_id * @param model_id * @param id_shop * @return Promise => bool = true or false */ deleteMergeShopeeProduct_model(product: any, item_id: number, model_id: number, id_shop: string, id_branch: string): Promise; /** * @notic : hàm này không thể cập nhật vô getlocalProductListShopee, do đó sau khi dùng hàm updateProductInfoByJSONshopee xong thì dùng thêm hàm getProductByIdShopee * với các sản phẩm vừa cập nhật, lúc đó những gì vừa thay đổi mới đc cập nhật vô getlocalProductListShopee * @example: * let json = { item_id : 3883480181, weight : 0.1 } let access_token = '98efa569a4731bb67a8f76fed8808d66' let shop_id = '894793475932'; this.vhEcommerce.updateProductInfoByJSONshopee( json, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param access_token * @param shop_id * @returns */ updateProductInfoByJSONshopee(json: any, access_token: string, shop_id: string): Promise; /** * @notic : hàm này không thể cập nhật vô getlocalProductListShopee, do đó sau khi dùng hàm updateProductStockByJSONshopee xong thì dùng thêm hàm getProductByIdShopee * với các sản phẩm vừa cập nhật, lúc đó những gì vừa thay đổi mới đc cập nhật vô getlocalProductListShopee * @example: * let json = { item_id: 4109868889, stock_list: [{ model_id : 0, normal_stock : 48 }] } let access_token = '98efa569a4731bb67a8f76fed8808d66' let shop_id = '894793475932'; this.vhEcommerce.updateProductStockByJSONshopee( json, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param access_token * @param shop_id * @returns */ updateProductStockByJSONshopee(json: any, access_token: string, shop_id: string): Promise; /** * @notic : hàm này không thể cập nhật vô getlocalProductListShopee, do đó sau khi dùng hàm updateProductPriceByJSONshopee xong thì dùng thêm hàm getProductByIdShopee * với các sản phẩm vừa cập nhật, lúc đó những gì vừa thay đổi mới đc cập nhật vô getlocalProductListShopee * @example: * let json = { item_id: 9157723000, price_list: [{ model_id : 75539801030, original_price : 7200000 }] } let access_token = '98efa569a4731bb67a8f76fed8808d66' let shop_id = '894793475932'; this.vhEcommerce.updateProductPriceByJSONshopee( json, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param access_token * @param shop_id * @returns */ updateProductPriceByJSONshopee(json: any, access_token: string, shop_id: string): Promise; /** * Hàm này lấy về mảng các đơn hàng (salesorder) được lưu trong database viethas (ko phải database shopee) * @example * this.vhEcommerce.getSalesOrderShopee_fromViethas( ['14424213387','14424273835'], '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('array', array); },(error:any)=>{ console.log('error', error); }) * @param order_snArray * @param id_shop * @returns Promise => Array(object or null) */ getSalesOrderShopee_fromViethas(order_snArray: any, id_shop: string): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database shopee), lưu ý các order_sn đc lấy từ shopee server về * @example: * this.vhEcommerce.updateSalesOrderShopee('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', {check:true}) .then((bool:any)=>{ console.log('updateSalesOrderShopee', bool); }, error=>{ reject(error) }) * @param id_shop * @param order_sn * @param data * @return Promise => bool = true or false */ updateSalesOrderShopee(id_shop: string, order_sn: string, data: object): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database shopee), lưu ý các order_sn đc import từ file ngoài vào (excel, csv...) * @example: * this.vhEcommerce.updateSalesOrderShopee_byFile(['144242133871', '14424213387'], {check:true}, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzODE3MzIwLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.9S18n7EuG7XxbZVm9kjUBozJVjx2_EZRNAn38wBUaDs', '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('updateSalesOrderShopee_byFile', array); }, error=>{ console.log(error) }) * @param order_snArray * @param data * @param access_token * @param id_shop * @return Promise => Array(bool) = [true or false,,...] */ updateSalesOrderShopee_byFile(order_snArray: any, data: object, access_token: string, id_shop: string): Promise; /** * Hàm này lấy về chi tiết thanh toán của hóa đơn * @param order_sn: id của hóa đơn shopee * @param access_token * @param id_shop */ getEscrowShopee(order_sn: any, access_token: string, shop_id: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhEinvoice { private vhAlgorithm; private vhMGDB_auth; constructor(vhAlgorithm: VhAlgorithm, vhMGDB_auth: VhMGDB_auth); /** * Hàm đăng nhập vào M-invoice để lấy token * @example * this.vhEinvoice.signin_byMinvoice(taxcode, username, password) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param username * @param password * @returns Promise => obj * {"code": "00", "message": "Thành công", "ok": true, "token": "O87316arj5......."} * {"code": "99", "message": "Tên đăng nhập hoặc mật khẩu không đúng", "ok": false, "error": "Tên đăng nhập hoặc mật khẩu không đúng"} */ signin_byMinvoice(taxcode: string, username: string, password: string): Promise; /** * Hàm lấy về danh sách các ký tự hóa đơn đẵ đăng ký với thuế * @example * this.vhEinvoice.getTypeInvoiceSeries_byMinvoice(taxcode, token, Type) .then(()=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param Type * Ý nghĩa Type: * 1: Hóa đơn giá trị gia tăng * 2: Hóa đơn bán hàng * 5: Tem vé thẻ * 6: Phiếu xuất kho (Kiêm vận chuyển nội bộ, gửi bán đại lý) * @returns Promise => obj * {"code": "00", "message": “Thành công”, "ok": true, "data": [{"id": "3a08d649-2284-2577-7b7d-91a284f25eb3", "quanlykyhieu68_id": "6252b95a-b64e-4ccf-b76b-ac812ae1efc0", "khhdon": "6C23NYY", "value": "6C23NYY", "invoiceForm": "6", "invoiceYear": 23, "number": null, "orders": null, "invoiceTypeName": "Phiếu xuất kho kiêm vận chuyển nội bộ"}] * {"code": "3", "message": "Token hết hạn hoặc không đúng vui lòng kiểm tra lại!", "error": "Token hết hạn hoặc không đúng vui lòng kiểm tra lại!", "ok": false} */ getTypeInvoiceSeries_byMinvoice(taxcode: string, token: string, Type?: number): Promise; /** * Xem in hoá đơn thông qua id của hoá đơn và keyApi tích hợp từ đối tác * @example * this.vhEinvoice.getPrintInvoice_byMinvoice(taxcode, token, params) .then(()=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param params: * Ý nghĩa params: * {id: '3a06a343-ff4d-21cd-fe31-2c5a0824636f'} : Xem in hoá đơn thông qua id của hoá đơn * id: ID hóa đơn do M-Invoice trả về * {keyApi: '720rv2222Q'} : Xem in hoá đơn thông qua thông qua keyApi tích hợp từ đối tác * keyApi: Key tích hợp từ đối tác truyền sang * @returns Promise => {"code": "00", "message": "Thành công"} */ getPrintInvoice_byMinvoice(taxcode: string, token: string, params: any): Promise; /** * Hàm tra cứu mã số thuế * @example * this.vhEinvoice.searchTaxCodeV2_byMinvoice(tax) .then(()=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param tax * @returns Promise => obj */ searchTaxCodeV2_byMinvoice(tax: string): Promise; /** * Lấy thông tin hoá đơn thông qua id hóa đơn hoặc keyApi tích hợp từ đối tác * @example * this.vhEinvoice.getInfoInvoice_byMinvoice(taxcode, token, params) .then(()=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param params: * Ý nghĩa params: * {number: 2, seri: '1C22TMX'} : Lấy thông tin hoá đơn thông qua Ký hiệu và Số hoá đơn * seri: Ký hiệu hóa đơn theo nghị định 123 cần lấy thông tin ('1C22TMX') * number: Số hóa đơn cần lấy thông tin (1,2,3...) * {id: '3a06a343-ff4d-21cd-fe31-2c5a0824636f'} : Lấy thông tin hoá đơn thông qua id tích hợp từ đối tác * id: ID hóa đơn do M-Invoice trả về * {keyApi: '720rv2222Q'} : Lấy thông tin hoá đơn thông qua keyApi tích hợp từ đối tác * keyApi: Key tích hợp từ đối tác truyền sang * @returns Promise => {"code": "00", "message": "Thành công"} */ getInfoInvoice_byMinvoice(taxcode: string, token: string, params: any): Promise; /** * Hàm lấy file xml thông qua id của hoá đơn * @example * this.vhEinvoice.exportXml_byMinvoice(taxcode, token, params) .then(()=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param params: * Ý nghĩa params: * {id: '3a06a343-ff4d-21cd-fe31-2c5a0824636f'} : Lấy thông tin hoá đơn thông qua id tích hợp từ đối tác * id: ID hóa đơn do M-Invoice trả về * @returns Promise => {"code": "00", "message": "Thành công"} */ exportXml_byMinvoice(taxcode: string, token: string, params: any): Promise; /** * Hàm lấy thông tin hóa đơn từ ngày - đến ngày và ký hiệu * @example * this.vhEinvoice.getInvoices_byMinvoice(taxcode, token, query) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param editmode * @param query: { "tuNgay": "2024-01-01", "denngay": "2024-01-29", "khieu": "1K24TDN", "start": 0, "count": 20, "coChiTiet": true } * @returns Promise => {"code": "00", "message": null, "ok": true, "total": 4, "data": [{},{}...]} */ getInvoices_byMinvoice(taxcode: string, token: string, query: any): Promise; /** * Hàm Thêm mới, sửa, xóa hóa đơn Chờ ký * @example * this.vhEinvoice.saveInvoice_noSign_byMinvoice(taxcode, token, editmode, data) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param editmode * @param data * @returns Promise => {code, message, ok, data} * {code: "00", message: null, ok: true, data: {}} //Gửi CQT thành công * {code: "88", error: "Trùng key tích hợp", message: "Trùng key tích hợp", ok: false} //Hóa đơn này đã được gửi trước đây * {code: "29442", message: "Delete invoice error because the number invoice is sequential", ok: false, error: "Delete invoice error because the number invoice is sequential"}} */ saveInvoice_noSign_byMinvoice(taxcode: string, token: string, editmode: number, data: any): Promise; /** * Hàm Thêm mới, sửa, xóa hóa đơn Chờ ký * @example * this.vhEinvoice.saveInvoice_Sign_byMinvoice(taxcode, token, editmode, data) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param editmode * @param data * @returns Promise => {"code": "00", "message": null, "ok": true, "data": {}} * {code: "29442", message: "Delete invoice error because the number invoice is sequential", ok: false, error: "Delete invoice error because the number invoice is sequential"}} */ saveInvoice_Sign_byMinvoice(taxcode: string, token: string, editmode: number, data: any): Promise; /** * Hàm ký hóa đơn * @example * this.vhEinvoice.signInvoice_byMinvoice(taxcode, token, editmode, data) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param hoadon68_id : "5fc578a6-1ca1-46f9-ab4f-6a0de4b54c32" * @returns Promise => {"code": "00", "message": null, "ok": true, "data": {}} * {code: "00", message: null, ok: true, data: {}} //Gửi thành công */ signInvoice_byMinvoice(taxcode: string, token: string, hoadon68_id: string): Promise; /** * Hàm hủy hóa đơn * @example * this.vhEinvoice.deleteInvoice_byMinvoice(taxcode, token, inv_InvoiceAuth_id, ngayvb, ghi_chu) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param inv_InvoiceAuth_id : "26da72ec-a3c4-49d0-90de-2d6a9fb2bdab" * @param ngayvb : "2022-09-11" * @param ghi_chu : "Sai thông tin tổng tiền hóa đơn, chưa gửi cho khách hàng" * @returns Promise => {"code": "00", "message": "Thành công"} */ deleteInvoice_byMinvoice(taxcode: string, token: string, inv_InvoiceAuth_id: string, ngayvb: string, ghi_chu: string): Promise; /** * Hàm điều chỉnh hóa đơn * @example * this.vhEinvoice.updateInvoice_byMinvoice(taxcode, token, inv_InvoiceAuth_id, inv_invoiceIssuedDate, data) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param inv_InvoiceAuth_id : "26da72ec-a3c4-49d0-90de-2d6a9fb2bdab" * @param inv_invoiceIssuedDate : "2022-09-11" * @param data * @returns Promise => {"code": "00", "message": "Thành công"} */ updateInvoice_byMinvoice(taxcode: string, token: string, inv_InvoiceAuth_id: string, inv_invoiceIssuedDate: string, data: any): Promise; /** * Hàm thay thế hóa đơn * @example * this.vhEinvoice.replaceInvoice_byMinvoice(taxcode, token, data) .then((data)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param taxcode * @param token * @param data * @returns Promise => {"code": "00", "message": "Thành công"} */ replaceInvoice_byMinvoice(taxcode: string, token: string, data: any): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuerySales { private vhEinvoice; private vhMGDB_auth; private vhMGDB_rootdatabase; private vhMGDB_database; private vhMGDB_socketMongoDB; private vhMGDB_tiki; private vhMGDB_sendo; private vhMGDB_lazada; private vhMGDB_socketFacebook; private vhMGDB_paymentVNPAY; private vhQuery; private vhAuth; private vhAlgorithm; private vhDisplayLEDService; private iap2; private platform; private paymentIOS; private restriction_main_package; private restriction_ecommerce_package; private restriction_facebook_package; private restriction_warranty_package; private productlistsendo; private shoplistsendo; private productlistlazada; private shoplistlazada; private productlisttikis; private shoplisttiki; private products; private detailproducts; private rawproducts; private customers; private suppliers; private wallets; private taxs; private categorys; private inventorytimes; private warrantys; private discount_bills; private discount_saless; private customer_classs; private commissions; private deliverys; private addresss; private incoming_groups; private spending_groups; private branchs; private promotions; private print_pages; private printers; private hwinfo; private appsettingstations; private appsettingbranchs; private subjectwallets; private subjectappsettingstations; private subjectappsettingbranchs; private subjectbranchs; private subjectcategorys; private subjectcustomers; private subjectinventorytimes; private subjectprinters; private subjectproducts; private subjectpromotions; private subjectsuppliers; private subjecttaxs; private subjectwarrantys; private subjectdiscount_bills; private subjectcustomer_classs; private callbacksyncopeningbill; private listbill_bybilltype; private callback1syncbilltype; private callback2syncbilltype; private sync_code; private colname_array; constructor(vhEinvoice: VhEinvoice, vhMGDB_auth: VhMGDB_auth, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhMGDB_database: VhMGDB_database, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_tiki: VhMGDB_tiki, vhMGDB_sendo: VhMGDB_sendo, vhMGDB_lazada: VhMGDB_lazada, vhMGDB_socketFacebook: VhMGDB_socketFacebook, vhMGDB_paymentVNPAY: VhMGDB_paymentVNPAY, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm, vhDisplayLEDService: VhDisplayLEDService, iap2: InAppPurchase2, platform: Platform); fix_loi_kieu_du_lieu_barcode(): Promise; /** * this.vhQuerySales.fix_mot_lan_duy_nhat_inventory_null() .then(()=>{ console.log('fix_mot_lan_duy_nhat_inventory_null'); }, error=>{ console.log(error); }) */ fix_mot_lan_duy_nhat_inventory_null(): Promise; /** * Hàm trả về năm của billdate * @param billdate * @returns */ private getYear; /** * 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 * @returns */ private getYearsArray; /** * 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 * @param query * @returns */ private getYearsArray_fromQuery; /** * 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 * @example: * let branch_management_scope = this.vhQuerySales.getBranch_Management_Scope(); * @return Object = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope} * => true áp dụng cho toàn chi nhánh, false áp dụng riêng cho từng chi nhánh */ getBranch_Management_Scope(): any; /** * 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 * @example: * this.vhQuerySales.updateBranch_Management_Scope({product_scope:1, employee_scope:1, customer_scope:1, supplier_scope:1, sales_program_scope:2}) .then(()=>{ console.log('updateBranch_Management_Scope'); }, error=>{ reject(error); }) * @param value = {product_scope, employee_scope, customer_scope, supplier_scope, sales_program_scope} * true áp dụng cho toàn chi nhánh, false áp dụng riêng cho từng chi nhánh * @return Promise => udefined/error */ updateBranch_Management_Scope(value: any): Promise; /** * @description: hàm này lấy về những hạn chế của gói main_package trong localstorage * @example * let restriction_main_package = this.vhQuerySales.getLocalRestrictionMainPackage(); * @return Object => obj ={} or null */ getLocalRestrictionMainPackage(): any; /** * @description: hàm này lấy về những hạn chế của gói ecommerce_package trong localstorage * @example * let restriction_ecommerce_package = this.vhQuerySales.getLocalRestrictionEcommercePackage(); * @return Object => obj ={} or null */ getLocalRestrictionEcommercePackage(): any; /** * @description: hàm này lấy về những hạn chế của gói facebook_package trong localstorage * @example * let restriction_facebook_package = this.vhQuerySales.getLocalRestrictionFacebookPackage(); * @return Object => obj ={} or null */ getLocalRestrictionFacebookPackage(): any; /** * @description: hàm này lấy về những hạn chế của gói warranty_package trong localstorage * @example * let restriction_warranty_package = this.vhQuerySales.getLocalRestrictionWarrantyPackage(); * @return Object => obj ={} or null */ getLocalRestrictionWarrantyPackage(): any; /** * Hàm callback BÌNH LUẬN trên fanpage có id là id_fanpage * @example: * this.vhQuerySales.observableWebhookFeedFacebook('102622138931525').subscribe((entry:any) => { console.log('entry', entry); }) ngOnDestroy(){ this.vhQuerySales.unsubscribeWebhookFeedFacebook('102622138931525'); } * @returns Observerble (Object) => obj = {id, time, changes} */ observableWebhookFeedFacebook(id_fanpage: string): Observable; /** * hàm disable calback BÌNH LUẬN * @example: * this.vhQuerySales.unsubscribeWebhookFeedFacebook('102622138931525'); */ unsubscribeWebhookFeedFacebook(id_fanpage: string): void; /** * Hàm callback TIN NHẮN trên fanpage có id là id_fanpage * @example: * this.vhQuerySales.observableWebhookMessagesFacebook('102622138931525').subscribe((entry:any) => { console.log('entry', entry); }) ngOnDestroy(){ this.vhQuerySales.unsubscribeWebhookMessagesFacebook('102622138931525'); } * @returns Observerble (Object) => obj = {id, time, messaging} */ observableWebhookMessagesFacebook(id_fanpage: string): Observable; /** * hàm disable calback TÍN NHẮN * @example: * this.vhQuerySales.unsubscribeWebhookMessagesFacebook('102622138931525'); */ unsubscribeWebhookMessagesFacebook(id_fanpage: string): void; /**------------------------TIKI Ecommerce-------------------------- */ /** * @example: * this.vhQuerySales.GetShippingStampForDropshipTiki('243842207, 'B6', access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param code :string * @param access_token :string * @returns Promise */ GetShippingStampForDropshipTiki(code: string, size: string, access_token: string): Promise; /** * @example: * this.vhQuerySales.getSellerInventoriesForConfirmationTiki(access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param access_token :string * @returns Promise */ getSellerInventoriesForConfirmationTiki(access_token: string): Promise; /** * @example: * this.vhQuerySales.getExpectedPickupTimesTiki(access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param access_token :string * @returns Promise */ getExpectedPickupTimesTiki(access_token: string): Promise; /** * @example: * let json = { confirmation_status: 'seller_confirmed', seller_inventory_id: 237188, expected_pickup_time: '2021-12-10 09:00:00 } * this.vhQuerySales.ConfirmEnoughStockForDropShippingByJSONTiki(code, json, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param code :string * @param json :object * @param access_token :string * @returns Promise */ ConfirmEnoughStockForDropShippingByJSONTiki(code: string, json: any, access_token: string): Promise; /** * Hàm này lấy về mảng các đơn hàng (salesorder) được lưu trong database viethas (ko phải database tiki) * @example * this.vhQuerySales.getSalesOrderTiki_fromViethas( ['14424213387','14424273835'], '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('array', array); },(error:any)=>{ console.log('error', error); }) * @param codeArray * @param id_shop * @returns Promise => Array(object or null) */ getSalesOrderTiki_fromViethas(codeArray: any, id_shop: string): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database tiki), lưu ý các id đc lấy từ lazada server về * @example: * this.vhQuerySales.updateSalesOrderTiki('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', {check:true}) .then((bool:any)=>{ console.log('updateSalesOrderTiki', bool); }, error=>{ reject(error) }) * @param id_shop * @param code * @param data * @return Promise => bool = true or false */ updateSalesOrderTiki(id_shop: string, code: string, data: object): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database tiki), lưu ý các order_id đc import từ file ngoài vào (excel, csv...) * @example: * this.vhQuerySales.updateSalesOrderTiki_byFile(['144242133871', '14424213387'], {check:true}, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzODE3MzIwLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.9S18n7EuG7XxbZVm9kjUBozJVjx2_EZRNAn38wBUaDs', '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('updateSalesOrderTiki_byFile', array); }, error=>{ console.log(error) }) * @param codeArray * @param data * @param token * @param id_shop * @return Promise => Array(bool) = [true or false,,...] */ updateSalesOrderTiki_byFile(codeArray: any, data: object, token: string, id_shop: string): Promise; /** * @notic : hàm này không thể cập nhật vô getlocalProductListTiki, do đó sau khi dùng hàm updateProductByJSONTiki xong thì dùng thêm hàm getProductByIdTiki * với các sản phẩm vừa cập nhật, lúc đó những gì vừa thay đổi mới đc cập nhật vô getlocalProductListTiki * @example: * let json = { "product_id" : "51509850", "quantity":123 } let json = { "product_id" : "51509850", "price": 16000000 } let access_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiODUyMjU5IiwiVXNlck5hbWUiOiIiLCJTdG9yZVN0YXR1cyI6IjIiLCJTaG9wVHlwZSI6IjEiLCJTdG9yZUxldmVsIjoiMCIsImV4cCI6MTYzMDAxMzM1NCwiaXNzIjoiODUyMjU5IiwiYXVkIjoiODUyMjU5In0.CYoBo-4tMOFrQXBZyw4ZvxKz0YOPU9IsWoRjIQtslis' this.vhQuerySales.updateProductByJSONTiki( json, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param access_token * @returns */ updateProductByJSONTiki(json: any, access_token: string): Promise; /** * Cập nhập hàng loạt sản phẩm * @example: * let json ={ data: [ { product_id: 112059614, status: 3 } ] } let access_token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiODUyMjU5IiwiVXNlck5hbWUiOiIiLCJTdG9yZVN0YXR1cyI6IjIiLCJTaG9wVHlwZSI6IjEiLCJTdG9yZUxldmVsIjoiMCIsImV4cCI6MTYzMDAxMzM1NCwiaXNzIjoiODUyMjU5IiwiYXVkIjoiODUyMjU5In0.CYoBo-4tMOFrQXBZyw4ZvxKz0YOPU9IsWoRjIQtslis' this.vhQuerySales.updateProductsByJSONTiki( json, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param access_token * @returns */ updateProductsByJSONTiki(json: any, access_token: string): Promise; /** * @example: *let created_from_date = new Date('2021-01-25'); let created_to_date = new Date('2021-06-30'); let access_token = '50000601506bKRvdjv16d01472hspFZdjp3qWxFJdNhveuVAezlxvCMt08WkxBrr'; let id_shop = '100035896'; this.vhQuerySales.getSalesOrderListTiki( created_from_date, created_to_date, access_token, id_shop) .then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param created_from_date * @param created_to_date * @param access_token * @param id_shop * @returns */ getSalesOrderListTiki(created_from_date: any, created_to_date: any, access_token: string, id_shop: string): Promise; /** * Hàm này lấy về chi tiết của một hóa đơn * @example * this.vhQuerySales.getSalesOrderDetailTiki('14424213387', '403754acaafc4564a16c19faa32d73c8', 'gsdr3454u54w34tfq') .then((salesorderdetail)=>{ console.log('salesorderdetail', salesorderdetail); },(error:any)=>{ console.log('error', error); }) * @param order_id * @param access_token * @param id_shop * @returns Promise => obj ={} or null */ getSalesOrderDetailTiki(code: string, access_token: string, id_shop: any): Promise; /** * @example: * let productlisttiki = this.vhQuerySales.getlocalProductListTiki('ư0e4tuiwe98rhvqw9vtqw9t7rq987r9qvwn98et98'); * @param id_shop * @returns */ getlocalProductListTiki(id_shop: any): any; /** * @example: * this.vhQuerySales.refreshLocalProductListTikis() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProductListTiki() trong localstorage * @return Promise => null */ refreshLocalProductListTikis(shop_id?: string): any; /** * @example: this.vhQuerySales.getProductListTikis().then((list)=>{ console.log('list', list); }) * @returns Promise => array =[{},{},...] */ private getProductListTiki; private getProductListTikis; /** * @example: this.vhQuerySales.getProductByIdTiki(access_token, product_id, id_shop).then((producttiki)=>{ console.log('producttiki', producttiki); }) * @returns Promise => object ={} or null */ getProductByIdTiki(access_token: string, product_id: string, id_shop: string): Promise; /** * @example: this.vhQuerySales.getHiddenProductListTiki(access_token).then((list)=>{ console.log('list', list); }) * @returns Promise => array =[{},{},...] */ getHiddenProductListTiki(access_token: string): Promise; /** * let localshoplisttiki = this.vhQuerySales.getlocalShopListTiki(); * @returns */ getlocalShopListTiki(): any; /** * @example: this.vhQuerySales.getShopListTiki().then((array:any)=>{ console.log('array', array); }) * @returns Promise => array =[{},{},...] */ private getShopListTiki; /** * @example: let backHref = http://localhost:4200/dashboard/overview'; this.vhQuerySales.signInTiki(backHref).then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @returns Promise => true or false */ signInTiki(backHref?: any): Promise; /** * @example: this.vhQuerySales.signOutTiki('938476838whsofis').then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @param id_shop * @returns Promise => true or false */ signOutTiki(id_shop: string): Promise; /** * Tạo liên kết sản phẩm trên phần mềm quản lý bán hàng sales viethas và sản phẩm trên sàn tiki * @example: * this.vhQuerySales.addMergeTikiProduct('5fb6780ca2148e09806c5b01','tf3452345234', ['tf3452345234','35twtw45y3g6'], 'hjhjrtyur56u53') .then((bool:any)=>{ console.log('addMergeTikiProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param product_idArray * @param id_shop * @return Promise => boolean true or false */ addMergeTikiProduct(id_sub_or_product: string, product_idArray: any, id_shop: string): Promise; /** * @example: * this.vhQuerySales.updateMergeTikiProduct('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', {xyz:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeTikiProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param product_id: trường id trong sản phẩm tiki * @param SkuId: trường SkuId trong sản phẩm tiki * @param data : {xyz:true} * @returns Promise => bool = true or false */ updateMergeTikiProduct(id_sub_or_product: string, product_id: number, data: any, id_shop: string): Promise; /** * * @param product_id : trường id trong sản phẩm Tiki * @param hidden * @param id_shop * @returns */ updateMergeTikiProduct_hidden(product_id: number, hidden: boolean, id_shop: string): Promise; /** * @example: * this.vhQuerySales.deleteMergeTikiProduct('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', 'sdfgsdfgererasds3563') .then((bool:any)=>{ console.log('deleteMergeTikiProduct', bool); }, error=>{ reject(error) }) * @param id_sub_or_product * @param product_id : trường id trong sản phẩm tiki * @param id_shop * @return Promise => bool = true or false */ deleteMergeTikiProduct(id_sub_or_product: string, product_id: number, id_shop: string): Promise; /**----------------------LAZADA ECOMMERCE--------------- */ /** * @example: * let xml = ` 383144083 647304827 ThietBiBaoDongChongTromHongNgoaiHT1AS 268000 `; let access_token = '50000601506bKRvdjv16d01472hspFZdjp3qWxFJdNhveuVAezlxvCMt08WkxBrr' this.vhQuerySales.updateProductByXMLLazada( xml, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param payload * @param access_token * @returns Bool => true or false */ updateProductByXMLLazada(xml: any, access_token: string): Promise; /** * @example: * this.vhQuerySales.setStatusPackedLazada( order_item_ids, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_item_ids : array * @param access_token :string * @returns Promise */ setStatusPackedLazada(order_item_ids: any, access_token: string): Promise; /** * @example: * this.vhQuerySales.setStatusReadyToShipLazada( order_item_ids, access_token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_item_ids : array * @param access_token :string * @returns Promise */ setStatusReadyToShipLazada(order_item_ids: any, tracking_number: string, access_token: string): Promise; /** * @example: * let productlistlazada = this.vhQuerySales.getlocalProductListLazada('ư0e4tuiwe98rhvqw9vtqw9t7rq987r9qvwn98et98'); * @param id_shop * @returns Promise => Array */ getlocalProductListLazada(id_shop: any): any; /** * @example: * this.vhQuerySales.refreshLocalProductListLazadas() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProductListLazada() trong localstorage * @return Promise => null */ refreshLocalProductListLazadas(shop_id?: string): any; /** * @example: this.vhQuerySales.getProductListLazadas().then((list)=>{ console.log('list', list); }) * @returns Promise => array =[{},{},...] */ private getProductListLazada; private getProductListLazadas; /** * @example: * this.vhQuerySales.getProductDetailLazada(['13857630'], 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzNjU1ODMxLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.qM6gqpf3758JrSsTL2JlDOoD-TFS1VVaGkL6ixaI_lw', '403754acaafc4564a16c19faa32d73c8').then((productdetail)=>{ console.log('productdetail', productdetail); },(error:any)=>{ }) * @param item_idArray * @param access_token * @param id_shop * @returns */ getProductDetailLazada(item_idArray: any, access_token: string, id_shop: any): Promise; /** * let localshoplistlazada = this.vhQuerySales.getlocalShopListLazada(); * @returns */ getlocalShopListLazada(): any; /** * @example: this.vhQuerySales.getShopListLazada().then((array:any)=>{ console.log('array', array); }) * @returns Promise => array =[{},{},...] */ private getShopListLazada; /** * @example: let backHref = http://localhost:4200/dashboard/overview'; this.vhQuerySales.signInLazada(backHref).then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @returns Promise => true or false */ signInLazada(backHref?: any): Promise; /** * @example: this.vhQuerySales.signOutLazada('938476838whsofis').then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @param id_shop * @returns Promise => true or false */ signOutLazada(id_shop: string): Promise; /** * Tạo liên kết sản phẩm trên phần mềm quản lý bán hàng sales viethas và sản phẩm trên sàn lazada * @example: * this.vhQuerySales.addMergeLazadasProduct_skus('5fb6780ca2148e09806c5b01','tf3452345234', [{},{}], 'hjhjrtyur56u53') .then((bool:any)=>{ console.log('addMergeLazadasProduct_skus', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param item_id * @param skuArray : [{SkuId1,..},{SkuId2,..}] * @param id_shop * @return Promise => boolean true or false */ addMergeLazadasProduct_skus(id_sub_or_product: string, item_id: string, skuArray: any, id_shop: string): Promise; /** * @example: * this.vhQuerySales.updateMergeLazadasProduct('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', {xyz:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeLazadasProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param item_id: trường item_id trong sản phẩm lazada * @param SkuId: trường SkuId trong sản phẩm lazada * @param data : {xyz:true} * @returns Promise => bool = true or false */ updateMergeLazadasProduct(id_sub_or_product: string, item_id: string, data: any, id_shop: string): Promise; /** * */ updateMergeLazadasProduct_hidden(item_id: string, hidden: boolean, id_shop: string): Promise; /** * @example: * this.vhQuerySales.updateMergeLazadasProduct_skus('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', '13123135654', {hidden:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeLazadasProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param item_id : trường item_id trong sản phẩm lazada * @param SkuId : trường SkuId trong sản phẩm lazada * @param data : object => data = {hidden:true} * @param id_shop * @returns Promise => bool = true or false */ updateMergeLazadasProduct_skus(id_sub_or_product: string, item_id: string, SkuId: string, data: any, id_shop: string): Promise; /** * @example: * this.vhQuerySales.deleteMergeLazadaProduct('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', 'sdfgsdfgererasds3563') .then((bool:any)=>{ console.log('deleteMergeLazadaProduct', bool); }, error=>{ reject(error) }) * @param id_sub_or_product * @param item_id : trường item_id trong sản phẩm lazada * @param SkuId : trường SkuId trong sản phẩm lazada * @param id_shop * @return Promise => bool = true or false */ deleteMergeLazadaProduct_skus(id_sub_or_product: string, item_id: number, SkuId: number, id_shop: string): Promise; /** * @example: *let created_after = new Date('2021-01-25'); let created_before = new Date('2021-06-30'); let access_token = '50000601506bKRvdjv16d01472hspFZdjp3qWxFJdNhveuVAezlxvCMt08WkxBrr'; let id_shop = '100035896'; this.vhQuerySales.getSalesOrderListLazada( created_after.toISOString(), created_before.toISOString(), access_token, id_shop) .then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param created_after * @param created_before * @param access_token * @returns */ private getSalesOrderListLazada; /** * @example: *let created_after = new Date('2021-01-25'); let created_before = new Date('2021-06-30'); let access_token = '50000601506bKRvdjv16d01472hspFZdjp3qWxFJdNhveuVAezlxvCMt08WkxBrr'; let id_shop = '100035896'; this.vhQuerySales.getSalesOrderDetailListLazada( created_after.toISOString(), created_before.toISOString(), access_token, id_shop) .then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param created_after * @param created_before * @param access_token * @returns */ getSalesOrderDetailListLazada(created_after: string, created_before: string, access_token: string, id_shop: string): Promise; /** * Hàm này lấy về chi tiết của một hóa đơn * @example * this.vhQuerySales.getSalesOrderDetailLazada('14424213387', '403754acaafc4564a16c19faa32d73c8', 'gsdr3454u54w34tfq') .then((salesorderdetail)=>{ console.log('salesorderdetail', salesorderdetail); },(error:any)=>{ console.log('error', error); }) * @param order_id * @param access_token * @param id_shop * @returns Promise => obj ={} or null */ getSalesOrderDetailLazada(order_id: string, access_token: string, id_shop: any): Promise; /** * Hàm này lấy về mảng các đơn hàng (salesorder) được lưu trong database viethas (ko phải database sendo) * @example * this.vhQuerySales.getSalesOrderLazada_fromViethas( ['14424213387','14424273835'], '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('array', array); },(error:any)=>{ console.log('error', error); }) * @param order_idArray * @param id_shop * @returns Promise => Array(object or null) */ getSalesOrderLazada_fromViethas(order_idArray: any, id_shop: string): Promise; /** * @example: * let order_date_from = new Date('2021-01-1'); let order_date_to = new Date('2021-06-30'); let id_shop = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'; this.vhQuerySales.getSalesOrderDetailListLazada_fromViethas( order_date_from, order_date_to, id_shop).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_date_from * @param order_date_to * @param id_shop * @returns Promise Array */ getSalesOrderDetailListLazada_fromViethas(order_date_from: string, order_date_to: string, id_shop: string): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database lazada), lưu ý các order_id đc lấy từ lazada server về * @example: * this.vhQuerySales.updateSalesOrderLazada('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', {check:true}) .then((bool:any)=>{ console.log('updateSalesOrderLazada', bool); }, error=>{ reject(error) }) * @param id_shop * @param order_id * @param data * @return Promise => bool = true or false */ updateSalesOrderLazada(id_shop: string, order_id: string, data: object): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database lazada), lưu ý các order_id đc import từ file ngoài vào (excel, csv...) * @example: * this.vhQuerySales.updateSalesOrderLazada_byFile(['144242133871', '14424213387'], {check:true}, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzODE3MzIwLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.9S18n7EuG7XxbZVm9kjUBozJVjx2_EZRNAn38wBUaDs', '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('updateSalesOrderLazada_byFile', array); }, error=>{ console.log(error) }) * @param order_idArray * @param data * @param token * @param id_shop * @return Promise => Array(bool) = [true or false,,...] */ updateSalesOrderLazada_byFile(order_idArray: any, data: object, token: string, id_shop: string): Promise; /** * Hàm truy vấn thông tin chi tiết giao dịch của người bán trong phạm vi ngày cụ thể * @example: * this.vhQuerySales.getTransactionDetailsLazada(json, access_token) .then((array)=>{ }, error=>{ reject(error) }) * @param json : {start_time, end_time, limit, offset, trade_order_id, trade_order_line_id, trans_type} * @param access_token * @returns Promise => Array */ getTransactionDetailsLazada(json: any, access_token: string): Promise; /** * Hàm này lấy về khách hàng đã được gán cho mỗi shop(id_shop) trước đây, nếu trước đây chưa gán thì lấy về giá trị null * @example: * this.vhQuerySales.getShopPartner('5fb67fda87c0f21d484cbdf3') .then((customer)=>{ console.log('getShopPartner', customer); }, error=>{ reject(error) }) * @param id_shop * @returns Promise => object(customer) or null */ getShopPartner(id_shop: string): Promise; /** * Hàm này dùng update thông tin cho các shop * this.vhQuerySales.updateShop('5fb6780ca2148e09806c5b01', {name:lazadashop, id_customer: 'soidfja9wfhwa'}) .then((bool:any)=>{ console.log(bool); }, error=>{ console.log(error); }) * @param id_shop * @param data * @return Promise => bool = true or false */ updateShop(id_shop: string, data: object): Promise; /** * @example: * let json = [{ "id": 48431726, "stock_quantity" : 69, "Field_Mask": [ "quantity" ], "variants": [] }] let token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiODUyMjU5IiwiVXNlck5hbWUiOiIiLCJTdG9yZVN0YXR1cyI6IjIiLCJTaG9wVHlwZSI6IjEiLCJTdG9yZUxldmVsIjoiMCIsImV4cCI6MTYzMDAxMzM1NCwiaXNzIjoiODUyMjU5IiwiYXVkIjoiODUyMjU5In0.CYoBo-4tMOFrQXBZyw4ZvxKz0YOPU9IsWoRjIQtslis' this.vhQuerySales.updateByJSONSendo( json, token).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param json * @param token * @returns */ updateByJSONSendo(json: any, token: string): Promise; /** * @example: * this.vhQuerySales.updateOrderStatusSendo(order_number, order_status, cancel_order_reason, token) .then((bool:any)=>{ console.log(bool); }, error=>{ console.log(error); }) * @param order_number * @param order_status * @param cancel_order_reason * @param token * @returns Promise => bool = true or false */ updateOrderStatusSendo(order_number: string, order_status: number, cancel_order_reason: string, token: string): Promise; /** * @example: * let order_date_from = new Date('2021-01-1'); let order_date_to = new Date('2021-06-30'); let token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiODUyMjU5IiwiVXNlck5hbWUiOiIiLCJTdG9yZVN0YXR1cyI6IjIiLCJTaG9wVHlwZSI6IjEiLCJTdG9yZUxldmVsIjoiMCIsImV4cCI6MTYzMDAxMzM1NCwiaXNzIjoiODUyMjU5IiwiYXVkIjoiODUyMjU5In0.CYoBo-4tMOFrQXBZyw4ZvxKz0YOPU9IsWoRjIQtslis' let id_shop = '403754acaafc4564a16c19faa32d73c8'; this.vhQuerySales.getSalesOrderDetailListSendo( order_date_from.toISOString(), order_date_to.toISOString(), token, id_shop).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_date_from * @param order_date_to * @param token * @returns Promise Array */ getSalesOrderDetailListSendo(order_date_from: string, order_date_to: string, token: string, id_shop: string): Promise; /** * Hàm này lấy về chi tiết của một hóa đơn * @param order_number * @param token * @param id_shop * @returns Promise => obj ={} or null */ getSalesOrderDetailSendo(order_number: any, token: string, id_shop: any): Promise; /** * Hàm này lấy về mảng các đơn hàng (salesorder) được lưu trong database viethas (ko phải database sendo) * @example * this.vhQuerySales.getSalesOrderListSendo_fromViethas( ['14424213387','14424273835'], '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('array', array); },(error:any)=>{ console.log('error', error); }) * @param order_numberArray * @param id_shop * @returns Promise => Array(object or null) */ getSalesOrderSendo_fromViethas(order_numberArray: any, id_shop: string): Promise; /** * @example: * let order_date_from = new Date('2021-01-1'); let order_date_to = new Date('2021-06-30'); let id_shop = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'; this.vhQuerySales.getSalesOrderDetailListSendo_fromViethas( order_date_from, order_date_to, id_shop).then((result)=>{ console.log('result', result); },(error:any)=>{ console.log('error', error); }) * @param order_date_from * @param order_date_to * @param id_shop * @returns Promise Array */ getSalesOrderDetailListSendo_fromViethas(order_date_from: string, order_date_to: string, id_shop: string): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database sendo), lưu ý các order_number đc lấy từ sendo server về * @example: * this.vhQuerySales.updateSalesOrderSendo('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', {check:true}) .then((bool:any)=>{ console.log('updateSalesOrderSendo', bool); }, error=>{ reject(error) }) * @param id_shop * @param order_number * @param data * @return Promise => bool = true or false */ updateSalesOrderSendo(id_shop: string, order_number: string, data: object): Promise; /** * Hàm này cập nhật các đơn hàng (salesorder) được lưu trong database viethas (ko phải database sendo), lưu ý các order_number đc import từ file ngoài vào (excel, csv...) * @example: * this.vhQuerySales.updateSalesOrderListSendo_byFile(['144242133871', '14424213387'], {check:true}, 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzODE3MzIwLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.9S18n7EuG7XxbZVm9kjUBozJVjx2_EZRNAn38wBUaDs', '403754acaafc4564a16c19faa32d73c8') .then((array:any)=>{ console.log('updateSalesOrderListSendo_byFile', array); }, error=>{ console.log(error) }) * @param order_numberArray * @param data * @param token * @param id_shop * @return Promise => Array(bool) = [true or false,,...] */ updateSalesOrderSendo_byFile(order_numberArray: any, data: object, token: string, id_shop: string): Promise; /** * let localshoplistsendo = this.vhQuerySales.getlocalShopListSendo(); * @returns */ getlocalShopListSendo(): any; /** * @example: * let productlistsendo = this.vhQuerySales.getlocalProductListSendo('ư0e4tuiwe98rhvqw9vtqw9t7rq987r9qvwn98et98'); * @param status * @returns */ getlocalProductListSendo(id_shop: any): any; /** * @example: * this.vhQuerySales.refreshLocalProductListSendo() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getProductListSendo() trong localstorage * @return Promise => null */ refreshLocalProductListSendo(shop_id?: string): any; /** * @example: * this.vhQuerySales.getProductListSendo().then(()=>{ do something... },(error:any)=>{ }) * @returns */ private getProductListSendo; private getProductListSendos; /** * @example: * this.vhQuerySales.getProductDetailSendo(['13857630'], 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTdG9yZUlkIjoiNTczNjciLCJVc2VyTmFtZSI6IiIsIlN0b3JlU3RhdHVzIjoiMiIsIlNob3BUeXBlIjoiMCIsIlN0b3JlTGV2ZWwiOiIzIiwiZXhwIjoxNjMzNjU1ODMxLCJpc3MiOiI1NzM2NyIsImF1ZCI6IjU3MzY3In0.qM6gqpf3758JrSsTL2JlDOoD-TFS1VVaGkL6ixaI_lw', '403754acaafc4564a16c19faa32d73c8').then((productdetail)=>{ console.log('productdetail', productdetail); },(error:any)=>{ }) * @param idArray * @param token * @returns Promise */ getProductDetailSendo(idArray: any, token: string, id_shop: any): Promise; /** * @example: * this.vhQuerySales.signInSendo('09384tni0qw8t9q90g', '938476838whsofis', {name: sendo 1}).then((obj)=>{ if(obj){ console.log('obj', obj) } }) * @param shop_key * @param secret_key * @param data * @returns Promise => obj or null */ signInSendo(shop_key: string, secret_key: string, data: object): Promise; /** * @example: this.vhQuerySales.signOutSendo('938476838whsofis').then((bool:any)=>{ if(bool){ console.log('bool', bool) } }) * @param id_shop * @returns Promise => true or false */ signOutSendo(id_shop: string): Promise; /** * @example: this.vhQuerySales.getShopListSendo().then((array:any)=>{ console.log('array', array); }) * @returns Promise => array =[{},{},...] */ private getShopListSendo; /** * @example: * this.vhQuerySales.createMergeSendosProduct('5fb6780ca2148e09806c5b01',['48284964','48284965', '48284966'], '870909t87t098thiuahn') .then((sendosproduct)=>{ console.log('createMergeSendosProduct', sendosproduct); }, error=>{ console.log('error', error); }) * @param id_product * @param sendoproductArray * @param id_shop * @return Promise => array = [{},{},..] * 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 */ /** * @example: * this.vhQuerySales.updateMergeSendosProduct('5fb6780ca2148e09806c5b01', '13123135654', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param id: trường id trong sản phẩm sendo * @param variant_attribute_hash: trường variant_attribute_hash trong sản phẩm sendo * @param data * @returns Promise => true or false */ /** * @example: * this.vhQuerySales.deleteMergeSendoProduct('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', 'jhiy87685765r575345re') .then((bool:any)=>{ console.log('deleteMergeSendoProduct', bool); }, error=>{ reject(error) }) * @param id_product * @param id: trường id trong sản phẩm sendo * @param variant_attribute_hash: trường variant_attribute_hash trong sản phẩm sendo * @return Promise => bool = true or false */ /** * Tạo liên kết sản phẩm trên phần mềm quản lý bán hàng sales viethas và sản phẩm trên sàn sendo * @example: * this.vhQuerySales.addMergeSendoProduct_variants('5fb6780ca2148e09806c5b01','tf3452345234', [{},{}], 'hjhjrtyur56u53') .then((bool:any)=>{ console.log('addMergeSendoProduct_variants', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param id * @param skuArray : [{variant_attribute_hash,..},{variant_attribute_hash,..}] * @param id_shop * @return Promise => boolean true or false */ addMergeSendoProduct_variants(id_sub_or_product: string, id: string, variantArray: any, id_shop: string): Promise; /** * @example: * this.vhQuerySales.updateMergeSendoProduct('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', {hidden:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeSendoProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param id: trường id trong sản phẩm sendo * @param data : {hidden:true} * @param id_shop * @returns Promise => bool = true or false */ updateMergeSendoProduct(id_sub_or_product: string, id: string, data: any, id_shop: string): Promise; /** * Lưu ý: * - trong sản phẩm sendo, tạm ẩn sản phẩm cha thì sản phẩm con ẩn theo luôn * - hàm updateMergeSendoProduct_hidden trả về true thì sản phẩm trong database và trong database có thêm trường hidden * @example: * this.vhQuerySales.updateMergeSendoProduct_hidden('435f34tf34f3243fdf', {hidden:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeSendoProduct_hidden', bool); }, error=>{ console.log('error', error); }) * @param id: trường id trong sản phẩm sendo * @param hidden : {hidden:true} * @param id_shop * @returns Promise => bool = true or false */ updateMergeSendoProduct_hidden(id: string, hidden: boolean, id_shop: string): Promise; /** * @example: * this.vhQuerySales.updateMergeSendoProduct_variants('5fb6780ca2148e09806c5b01', '435f34tf34f3243fdf', '13123135654', {abc:true}, 'jfaosidfu9we87f9w') .then((bool:any)=>{ console.log('updateMergeSendoProduct_variants', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param id : id của sản phẩm sàn sendo * @param variant_attribute_hash * @param data : object => data = {abc:true} * @param id_shop * @returns Promise => bool = true or false */ updateMergeSendoProduct_variants(id_sub_or_product: string, id: string, variant_attribute_hash: string, data: any, id_shop: string): Promise; /** * @example: * this.vhQuerySales.deleteMergeSendoProduct_variants('5fb67fda87c0f21d484cbdf3', 'gsdfgsdg4345324534t3w', 'sdfgsdfgererasds3563') .then((bool:any)=>{ console.log('deleteMergeSendoProduct_variants', bool); }, error=>{ reject(error) }) * @param id_sub_or_product * @param id * @param variant_attribute_hash * @param id_shop * @return Promise => bool = true or false */ deleteMergeSendoProduct_variants(id_sub_or_product: string, id: string, variant_attribute_hash: string, id_shop: string): Promise; getReportSales_Sendo(starttime: any, endtime: any, IDproduct: any, type?: any, IDbranch?: string): void; /** * @example: this.vhQuerySales.syncCollections_Mobile().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Mobile(): Promise; /** * @example: this.vhQuerySales.syncCollections_Sales365_Mobile().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Sales365_Mobile(): Promise; /** * @example: this.vhQuerySales.syncCollections_Desktop().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Desktop(): Promise; /** * @example: this.vhQuerySales.syncCollections_Sales365_Desktop().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections_Sales365_Desktop(): Promise; private getLocalLiveIndexDB1; /** * vhQuerySales * Hàm này lấy về tất cả các collections mà firebase lưu trong cache ứng dụng, dữ liệu trong cache này dùng ko mất phí * @returns */ private getLocalLiveIndexDB; private checkExpireBranch_Sales; private checkExpireBranch_Sales365; private initSyncCollections; /** * @example: * this.vhQuerySales.closeSyncCollections(); * disconnect collections synchronization in the APP * @returns void */ closeSyncCollections(): void; /** * 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 * (3 loại dữ liệu local đc fw sử dụng để tính toán hoặc trả về cho frontend khi cần), dùng cho type =3 * @example: * this.vhQuerySales.syncRaw_Detail_ProductInsert(obj); * @param obj */ private syncRaw_Detail_ProductInsert; /** * vhQuerySales * @param obj */ private syncRaw_Detail_ProductUpdate; /** * vhQuerySales * @returns */ private callbackCollectionInsert; /** * vhQuerySales * @returns */ private callbackCollectionUpdate; /** * vhQuerySales * @returns */ private callbackCollectionDelete; /** * vhQuerySales */ initChatToAppCare(): Promise; /** * vhQuerySales * @returns */ listeningChatToAppCare_Insert(): Observable; /** * vhQuerySales * @returns */ listeningChatToAppCare_Update(): Observable; /** * vhQuerySales * @param limit * @returns */ getOldMessages(limit: number): Promise; /** * @example: this.vhQuerySales.sendMessageToAppCare('hello' ).then((res:any) => { }); * @param message */ sendMessageToAppCare(message: any): Promise; /** * @example: this.vhQuerySales.sendMessageToAppCare('hello' ).then((res:any) => { }); * @param message */ sendImageToAppCare(image: string): Promise; /** * Hàm này chạy sau hàm đăng nhập hoặc xác thực đăng nhập vào phần mềm */ startLocalStorage(): Promise; initPurchase(): void; private initPaymentOnAPPStore; private registerHandlersForPurchase; paymentOnAPPStore(moneyID: any): void; refreshPurchase(): void; private publishObservableEventProducts; private observableLocalProducts; /** * @example: * this.observableProducts = this.vhQuerySales.getObservableLocalProducts(1).subscribe((localProducts:any) => { do something... }) ngOnDestroy(){ this.observableProducts.unsubscribe(); } * @param type = 1 là sản phẩm, = 2 là dịch vụ, giá trị khác là cả hai * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalProducts(type?: any): Observable; private getlocalProductAndCombos; /** * @example: * let product = this.vhQuerySales.getlocalProduct('5fb6780ca2148e09806c5b01'); * @param id_product * @return Object => obj = {} or null */ getlocalProduct(id_product: any): any; /** * @example * let products = this.vhQuerySales.getlocalProducts(); * @param * type = 3 là sản phẩm, * type = 2 là dịch vụ, = 5 là combo, * type = 23 là dịch vụ và sản phẩm, * type = 35 là sản phẩm và combo * type = 235 là dịch vụ, sản phẩm và combo * giá trị khác là cả 3 * @return Array(object) => array = [{},{},...] */ getlocalProducts(type?: any): any[]; /** * Hàm này lấy về tất cả detailproducts theo type của sản phẩm * @example * let detailproducts = this.vhQuerySales.getlocalDetailProducts(); * @param * type = 2 là sản phẩm, * type = 3 là dịch vụ, = 5 là combo, * type = 23 là dịch vụ và sản phẩm, * type = 35 là sản phẩm và combo * type = 235 là dịch vụ, sản phẩm và combo * giá trị khác là cả 3 * @return Array(object) => array = [{},{},...] */ getlocalDetailProducts(type?: any): any[]; /** * 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 * @example * let id_sub_or_product = id_subproduct?id_subproduct:id_product; * let detailproduct = this.vhQuerySales.getlocalDetailProduct('ETxNu8exrvGtXFjkIhnc'); * @param id_sub_or_product : id_subproduct hoặc id_product * @return Object => obj = {} hoặc null */ getlocalDetailProduct(id_sub_or_product: string): any; /** * @example: * this.vhQuerySales.getlocalDetailProduct_Async('ETxNu8exrvGtXFjkIhnc') .then((detailproduct)=>{ }, error=>{ console.log('error', error); }) * @param id_sub_or_product : object * @return Promise => object or null */ private getlocalDetailProduct_Async; /** * Hàm kiểm tra và đồng bộ các sản phẩm trong bill_details (chi tiết hóa đơn), đảm bảo sản phẩm trong bill_detail đã tồn tại trong local * @example: * this.vhQuerySales.syncBillDetails_Products(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Products; /** * Hàm kiểm tra và đồng bộ các khách hàng trong bill_details (chi tiết hóa đơn), đảm bảo khách hàng trong bill_detail đã tồn tại trong local * @example: * this.vhQuerySales.syncBillDetails_Customers(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Customers; /** * Hàm kiểm tra và đồng bộ các nhà cung cấp trong bill_details (chi tiết hóa đơn), đảm bảo nhà cung cấp trong bill_detail đã tồn tại trong local * @example: * this.vhQuerySales.syncBillDetails_Suppliers(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Suppliers; /** * Hàm kiểm tra và đồng bộ các sản phẩm trong bill_details (chi tiết hóa đơn), đảm bảo nhân viên trong bill_detail đã tồn tại trong local * @example: * this.vhQuerySales.syncBillDetails_Employees(array) .then(()=>{ }, error=>{ console.log('error', error); }) * @param bill_details : Array * @return Promise => null * Luu ý: chỉ có 2 trường hợp, hoặc là sync thành công, hoặc là báo lỗi error */ private syncBillDetails_Employees; /** * Hàm này tìm, kiểm tra barcode bất kỳ có tồn tại không, nếu có thì trả về 1 detailproduct, nếu ko thì trả về null * Hàm này dùng trong 2 trường hợp: * - Tìm kiếm sản phẩm có mã là barcode (dùng máy quét tìm sản phẩm đưa vào bill_detail) * - Kiểm tra xem đã tồn tại sản phẩm có mã là barcode chưa (khi thêm, sửa sản phẩm) * @example * let detailproduct = this.vhQuerySales.getlocalDetailProduct_byBarcode('121212'); * @param barcode * @return Object => obj = [{},{},...] hoặc null */ getlocalDetailProduct_byBarcode(barcode: string): any; /** * @example: * this.vhQuerySales.refreshLocalProducts() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProduct(), getlocalProducts() trong localstorage * @return Promise => null */ refreshLocalProducts(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhQuerySales.refreshLocalProducts_Delete_Hidden(3) .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProduct(), getlocalProducts() trong localstorage * @param type * @return Promise => null */ refreshLocalProducts_Delete_Hidden(type: any): any; /** * @example: * this.vhQuerySales.addProduct({name:'camera 2', quantity:20, price:200000}) .then((product)=>{ console.log('addProduct', product); }, error=>{ console.log('error', error); }) * @param data : object * @return Promise => object = {} * 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 */ addProduct(data: any): Promise; /** * @example: * this.vhQuerySales.addProducts([{name:'camera 2', quantity:20, price:200000},{},...]) .then((products)=>{ console.log('addProducts', products); }, error=>{ console.log('error', error); }) * @param data : array(object) * @return Promise => array = [{},{},...] * 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 */ addProducts(data_array: any): Promise; /** * @example: * this.vhQuerySales.updateProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateProduct(id_product: string, value: any): Promise; private updateProduct_fw; /** * @example: * this.vhQuerySales.deleteProduct('5fb67fda87c0f21d484cbdf3') .then((rsp)=>{ if(rsp.vcode === 0){ //-----------your code 0----------- }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } }, error=>{ reject(error) }) * @param id_product * @return Observable object => rsp = {vcode, message} * vcode == 0: xóa thành công * vcode == 1: Bạn không thể xóa, vì sản phẩm đang liên kết với sản phẩm combo khác * vcode == 2: Bạn không thể xóa, vì sản phẩm này đã phát sinh hóa đơn * vcode == 3: Bạn không thể xóa, bạn phải xóa các thuộc tính của sản phẩm trước */ deleteProduct(id_product: string): Promise; /** * @example * this.vhQuerySales.getProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getProduct', product); }) * @param id_product * @return null or object */ private getProduct; /** * @example * this.vhQuerySales.getProducts() .then((response)=>{ console.log('getDoc', response); }) * @return array(object) = [{},{},..] */ private getProducts; /** * Hàm lấy chi tiết sản phẩm dựa vào id sản phẩm hoặc id sản phẩm con * @example * this.vhQuerySales.getDetailProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getDetailProduct', product); }) * @param id_product * @return null or object */ private getDetailProduct; /** * @example: * this.vhQuerySales.addCombosProduct('5fb6780ca2148e',[{id_product:'rtw554b5634573456', id_subproduct: 'gty3456ygw454287', quantity:2, price: 20000, type: 1},{},..]) .then((combos)=>{ console.log('addCombosProduct', combos); }, error=>{ console.log('error', error); }) * @param id_product * @param dataArray * @return Promise => object = [{id_product, name, price},{},...] hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addCombosProduct(id_product: any, dataArray: any): Promise; /** * @example: * this.vhQuerySales.updateComboProduct('5fb6780ca2148e', 'rtw554b5634573456', {name:'Cơm chiên (nhỏ)', quantity: 2, price: 20000}) .then((bool:any)=>{ console.log('updateCombo', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateComboProduct(id_product: string, id_comboproduct: string, data: any): Promise; /** * hàm này tạo product và thêm subs vào product (lần đầu) * Lưu ý: trong product, subProductArray không có các trường quantity, quantity_branch và subs * @example: * @case 1: manysize (false) * let product = { allow_sell: true, brand: "OEM", tax: 0, id_category: "vTr90aYfhDqSCyuRh4DR", img: "image link", manysize: false, name: "test ko sub 3", selling: true, type: 1, warning_number: 3, item_code: '', units:[{ barcode: "3103", price: 3100, price2: 3101, price_import: 3102, ratio: 1, unit: "Cái" }] * } * @case 2: manysize (true) * let product = { allow_sell: true, brand: "OEM", tax: 0, id_category: "vTr90aYfhDqSCyuRh4DR", img: "image link", manysize: true, name: "test sub 4", selling: true, type: 3, warning_number: 3, item_code: '', units:[{ ratio: 1, unit: "Cái" },{ barcode: "4203", price: 4200, price2: 4101, price_import: 4202, ratio: 10, unit: "Hộp" }] } let subProductArray = [{ barcode: "43004", name: "Lớn", price: 43000, price2: 43002, price_import: 43001, warning_number: 43003, item_code: '' }] * this.vhQuerySales.addProductAndSubsProduct(product,subProductArray) .then(()=>{ console.log('addProductAndSubsProduct'); }, error=>{ console.log('error', error); }) * @param product * @param subProductArray * @return Promise => null hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về null (resolve), hoặc là thất bại trả về error (reject) */ addProductAndSubsProduct(product: any, subProductArray: any): Promise; /** * Hàm này cập nhật lại những thay đổi trong sub (cỡ) của sản phẩm * @example: * this.vhQuerySales.updateSubProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateSubProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param id_subproduct * @param data * @return Promise => bool = true or false */ updateSubProduct(id_subproduct: string, value: any): Promise; /** * Hàm này thêm Sub vào Product * @example: * let subProduct ={ allow_sell: true, manylot: true, name: "Lớn", selling: true, type: 3, warning_number: 5, item_code: '', units:[{ barcode: "384807544448", default: true, price: 70000, price2: 60000, price_import: 50000, ratio: 1, unit: "Cái" }], days_exp_warning: 30, days_import_warning: 60, lots:[{ _id: "tgwOaMDVmQaHfaL8FD02SMl9" barcode: "337953449785" date_exp: 'October 7, 2022 at 11:59:59 PM UTC+7' date_mfg: 'March 1, 2022 at 12:00:00 AM UTC+7' hidden: false lot_number: "lo1101" }] } * this.vhQuerySales.addSubProduct('5fb6780ca2148e09806c5b01',{price:0, name:'small'}) .then((subproduct)=>{ console.log('addSubProduct', subproduct); }, error=>{ console.log('error', error); }) * @param id_product * @param subProduct * @return Promise => null hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về null (resolve), hoặc là thất bại trả về error (reject) */ addSubProduct(id_product: string, subProduct: any): Promise; /** * Hàm này thêm Lot vào Product * @example: * let lot:{ barcode: "337953449785", date_exp: new Date('October 7, 2022 at 11:59:59 PM UTC+7'), date_mfg: new Date('March 1, 2022 at 12:00:00 AM UTC+7'), hidden: false, lot_number: "lo1101" } * this.vhQuerySales.addLotProduct('5fb6780ca2148e09806c5b01',lot) .then(()=>{ console.log('addLotProduct'); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param lot * @return Promise => newlot (lot có _id) hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về newlot (resolve), hoặc là thất bại trả về error (reject) */ addLotProduct(id_sub_or_product: string, lot: any): Promise; /** * @example: * this.vhQuerySales.deleteLotProduct('5fb67fda87c0f21d484cbdf3', 'NdbCy50cz5nNQyFVtITS') .then((rsp)=>{ if(rsp.vcode === 0){ //-----------your code 0----------- }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } }, error=>{ reject(error) }) * @param id_sub_or_product * @param id_lotproduct * @return Promise object => rsp = {vcode, message} * vcode == 0: xóa thành công * vcode == 1: Bạn không thể xóa, vì lô sản phẩm này không tồn tại * vcode == 2: Bạn không thể xóa, vì lô sản phẩm này đã phát sinh hóa đơn */ deleteLotProduct(id_sub_or_product: string, id_lotproduct: string): Promise; /** * this.vhQuerySales.updateLotProduct('5fb6780ca2148e09806c5b01','56s46ww54HFG3H265', {barcode: '13464160156465'}) .then((bool:any)=>{ console.log('updateLotProduct', bool); }, error=>{ console.log('error', error); }) * @param id_sub_or_product * @param id_lotproduct * @param value * @return Promise => bool = true or false */ updateLotProduct(id_sub_or_product: string, id_lotproduct: string, value: any): Promise; /** * Hàm này thêm Subs vào Product * @example: * this.vhQuerySales.addSubsProduct('5fb6780ca2148e09806c5b01',[{price:0, name:'small'},{},...]) .then((subproducts)=>{ console.log('addSubsProduct', subproducts); }, error=>{ console.log('error', error); }) * @param id_product * @param subProductArray * @return Promise => null hoặc error * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công trả về null (resolve), hoặc là thất bại trả về error (reject) */ private addSubsProduct; /** * @example: * this.vhQuerySales.deleteSubProduct('5fb67fda87c0f21d484cbdf3') .then((rsp)=>{ if(rsp.vcode === 0){ //-----------your code 0----------- }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } }, error=>{ reject(error) }) * @param id_subproduct * @return Promise object => rsp = {vcode, message} * vcode == 0: xóa thành công * vcode == 1: Bạn không thể xóa, vì sản phẩm con này đang liên kết với sản phẩm combo khác * vcode == 2: Bạn không thể xóa, vì sản phẩm con này đã phát sinh hóa đơn */ deleteSubProduct(id_subproduct: string): Promise; private publishObservableEventCustomers; private observableLocalCustomers; /** * @example: * this.observableCustomer = this.vhQuerySales.getObservableLocalCustomers().subscribe((localCustomers:any) => { do something... }) ngOnDestroy(){ this.observableCustomer.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCustomers(): Observable; /** * @example: * let customer = this.vhQuerySales.getlocalCustomer('5fb6780ca2148e09806c5b01'); * @param id_customer * @return Object => obj = {} or null */ getlocalCustomer(id_customer: any): any; /** * @example: * this.vhQuerySales.getlocalCustomer_Async('ETxNu8exrvGtXFjkIhnc') .then((customer)=>{ }, error=>{ console.log('error', error); }) * @param id_customer * @return Object => obj = {} or null */ private getlocalCustomer_Async; /** * @example: * let customers = this.vhQuerySales.getlocalCustomers(); * @return Array(object) => array = [{},{},...] */ getlocalCustomers(): any; /** * @example: * this.vhQuerySales.refreshLocalCustomers() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCustomer(), getlocalCustomers() trong localstorage * @return Promise => null */ refreshLocalCustomers(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhQuerySales.refreshLocalCustomers_Delete_Hidden() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCustomer(), getlocalCustomers() trong localstorage * @param type * @return Promise => null */ refreshLocalCustomers_Delete_Hidden(): any; /** * @example: * this.vhQuerySales.addCustomer({name:'Khách hàng 1', address: 'HCM'}) .then((rsp)=>{ if(rsp.vcode == 0){ //addCustomer thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param data: Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => rsp ={vcode, msg, data(obj)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another customer' */ addCustomer(data: any): Promise; /** * @example: * this.vhQuerySales.addCustomers([{name:'Khách hàng 1', address: 'HCM'},{},...]) .then((rsp)=>{ if(rsp.vcode == 0){ //addCustomers thành công }else if(rsp.vcode == 0){ //Phone numbers in the list are duplicated } },(error:any)=>{ console.log('error', error); }) * @param data : array(object), Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => {vcode, msg, data(array)} * vcode = 0: 'success' * vcode = 1: 'Phone numbers in the list are duplicated' */ addCustomers(arr_data: any): Promise; /** * @example: * this.vhQuerySales.updatePCustomer('5fb6780ca2148e09806c5b01', {name: Nguyễn Thị Nở}) .then((rsp)=>{ if(rsp.vcode == 0){ //updatePCustomer thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param id_customer * @param value : Nếu value hoặc có cả 3 trường countryCode, phone, phoneNumber hoặc ko có * @return Promise => {vcode, msg, data(true/false)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another customer' */ updateCustomer(id_customer: string, value: any): Promise; private _updateCustomer; /** * @example: * this.vhQuerySales.deleteCustomer('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCustomer', bool); }) * @param id_customer * @return Promise => bool = true or false */ deleteCustomer(id_customer: string): Promise; /** * @example * this.vhQuerySales.getCustomer('5fb67fda87c0f21d484cbdf3') .then((customer)=>{ console.log('getCustomer', customer); }) * @param id_customer * @return Promise => obj = {} or null */ getCustomer(id_customer: string): Promise; /** * @example * this.vhQuerySales.getCustomers() .then((customers)=>{ console.log('getCustomers', customers); }) * @return Promise => array(object) = [{},{},..] */ getCustomers(): Promise; /** * Hàm này dùng để xóa hoặc đặt lại điểm mới cho khách hàng * @example: * this.vhQuerySales.updateCustomer_byPoints('5fb6780ca2148e09806c5b01', 1000) .then((bool:any)=>{ console.log('updateCustomer_byPoints', bool); }) * @param _id * @param points * @return Promise => bool = true or false */ updateCustomer_byPoints(_id: string, points: number): Promise; /** * Hàm này thêm điểm mới kiếm được vào quỹ điểm khách hàng đang có * points = points(tích được trên bill) - point (sử dụng thanh toán trên bill) * @example: * this.vhQuerySales.updateCustomer_byEarnedPoints('5fb6780ca2148e09806c5b01', 200) .then((bool:any)=>{ console.log('updateCustomer_byEarnedPoints', bool); }) * @param _id * @param points * @return Promise => bool = true or false */ updateCustomer_byEarnedPoints(_id: string, points: number): Promise; /** * 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 * @example: * let customer = this.vhQuerySales.getlocalCustomer_byPoints('5fb6780ca2148e09806c5b01'); * @param id_customer * @return Object => obj = {} or null */ getlocalCustomerPoints(id_customer: any): any; /** * Hàm tìm kiếm tên chủ sở hữu và số điện thoại, nghĩa là nhập 1 chuỗi tên (2 từ trở lên) hoặc chuỗi số (6 ký tự trở lên) hàm sẽ * trả về những chủ sở hữu có tên hoặc số điện thoại tương ứng với keyword tìm kiếm * @example: * this.vhQuerySales.searchKeyword_NamePhone({'customers, '925354'}) .then((rsp)=>{ console.log('searchKeyword_NamePhone', rsp); },(error:any)=>{ console.log('error', error); }) * @param name_or_phone * @param countryCode * @returns Promise = > {vcode, msg, data(array)} */ searchKeyword_NamePhone(colname: string, name_or_phone: string, countryCode?: string): Promise; private publishObservableEventSuppliers; private observableLocalSuppliers; /** * @example: * this.observableSuppliers = this.vhQuerySales.getObservableLocalSuppliers().subscribe((localSuppliers:any) => { do something... }) ngOnDestroy(){ this.observableSuppliers.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalSuppliers(): Observable; /** * @example: * let supplier = this.vhQuerySales.getlocalSupplier('5fb6780ca2148e09806c5b01'); * @param id_supplier * @return Object => obj = {} or null */ getlocalSupplier(id_supplier: any): any; /** * @example: * this.vhQuerySales.getlocalSupplier_Async('ETxNu8exrvGtXFjkIhnc') .then((customer)=>{ }, error=>{ console.log('error', error); }) * @param id_supplier * @return Object => obj = {} or null */ private getlocalSupplier_Async; /** * @example: * let suppliers = this.vhQuerySales.getlocalWallets(); * @return Array(object) => array = [{},{},...] */ getlocalSuppliers(): any[]; /** * this.vhQuerySales.refreshLocalSuppliers() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalSupplier(), getlocalSuppliers() trong localstorage * @return Promise => null */ refreshLocalSuppliers(): any; /** * Hàm này dùng để đồng bộ dữ liệu ẩn (delete_hidden = true) từ database về local * @example: * this.vhQuerySales.refreshLocalSuppliers_Delete_Hidden() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalSupplier(), getlocalSuppliers() trong localstorage * @param type * @return Promise => null */ refreshLocalSuppliers_Delete_Hidden(): any; /** * @example: * this.vhQuerySales.addSupplier({name:'Nhà cung cấp 1', address: 'HCM'}) .then((rsp)=>{ if(rsp.vcode == 0){ //addSupplier thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param data: Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => rsp ={vcode, msg, data(obj)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another supplier' */ addSupplier(data: any): Promise; /** * @example: * this.vhQuerySales.addSuppliers([{name:'Nhà cung cấp 1', address: 'HCM'},{},...]) .then((rsp)=>{ if(rsp.vcode == 0){ //addSuppliers thành công }else if(rsp.vcode == 0){ //Phone numbers in the list are duplicated } },(error:any)=>{ console.log('error', error); }) * @param data: array(object), Có cả 3 trường countryCode, phone và phoneNumber * @return Promise => {vcode, msg, data(array)} * vcode = 0: 'success' * vcode = 1: 'Phone numbers in the list are duplicated' */ addSuppliers(arr_data: any): Promise; /** * @example: * this.vhQuerySales.updateSupplier('5fb6780ca2148e09806c5b01', {name: Nguyễn Thị Nở}) .then((rsp)=>{ if(rsp.vcode == 0){ //updateSupplier thành công }else if(rsp.vcode == 0){ //This phone number is already in use with another customer } },(error:any)=>{ console.log('error', error); }) * @param id_customer * @param value : Nếu value hoặc có cả 3 trường countryCode, phone, phoneNumber hoặc ko có * @return Promise => {vcode, msg, data(true/false)} * vcode = 0: 'success' * vcode = 1: 'This phone number is already in use with another supplier' */ updateSupplier(id_supplier: string, value: any): Promise; private _updateSupplier; /** * @example: * this.vhQuerySales.deleteSupplier('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteSupplier', bool); }) * @param id_supplier * @return Promise => bool = true or false */ deleteSupplier(id_supplier: string): Promise; /** * @example * this.vhQuerySales.getSupplier('5fb67fda87c0f21d484cbdf3') .then((supplier)=>{ console.log('getSupplier', supplier); }) * @param id_supplier * @return Promise => obj ={} or null */ getSupplier(id_supplier: string): Promise; /** * @example * this.vhQuerySales.getSuppliers() .then((suppliers)=>{ console.log('getSuppliers', suppliers); }) * @return Promise => array(object) = [{},{},..] */ private getSuppliers; private publishObservableEventWallets; private observableLocalWallets; /** * @example: * Lấy danh sách tài khoản thanh toán getDataWallets() { this.observableWallets = this.vhQuerySales.getObservableLocalWallets().subscribe((localwallets:any) => { let data = localwallets.filter((item:any) => item._id != 'id_cash' && item.id_branch == this.vhQuerySales.getDefaultBranch()._id); if (this.keySearch) { this.list_wallet = this.vhAlgorithm.searchList( this.keySearch, data, ["name", "bank_name", "number"] ); } else { this.list_wallet = data; } this.sortData(this.sortby); }) } ngOnInit(): void { this.getDataWallets(); } ngOnDestroy(){ this.observableWallets.unsubscribe(); } * @returns */ getObservableLocalWallets(): Observable; /** * @example: * let wallet = this.vhQuerySales.getlocalWallet('5fb6780ca2148e09806c5b01'); * @param id_wallet * @return Object => obj = {} or null */ getlocalWallet(id_wallet: any): any; /** * @example: * let wallets = this.vhQuerySales.getlocalWallets(); * @return Array(object) => array = [{},{},...] */ getlocalWallets(): any[]; /** * @example: * this.vhQuerySales.refreshLocalWallets() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalWallet(), getlocalWallets() trong localstorage * @return Promise => null */ refreshLocalWallets(): any; /** * @example: * this.vhQuerySales.addWallet({name:'camera 2', quantity:20, price:200000}) .then((wallet)=>{ console.log('addWallet', wallet); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addWallet(data: any): Promise; /** * @example: * this.vhQuerySales.updateWallet('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateWallet', bool); }) * @param id_wallet * @param data * @return Promise => bool = true or false */ updateWallet(id_wallet: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteWallet('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteWallet', bool); }) * @param id_wallet * @return Promise => bool = true or false */ deleteWallet(id_wallet: string): Promise; /** * @example * this.vhQuerySales.getWallet('5fb67fda87c0f21d484cbdf3') .then((wallet)=>{ console.log('getWallet', wallet); }) * @param id_wallet * @return Promise => obj ={} or null */ getWallet(id_wallet: string): Promise; /** * @example * this.vhQuerySales.getWallets() .then((wallets)=>{ console.log('getWallets', wallets); }) * @return Promise => array(object) = [{},{},..] */ getWallets(): Promise; private publishObservableEventTaxs; private observableLocalTaxs; /** * @example: * this.observableTaxs = this.vhQuerySales.getObservableLocalTaxs().subscribe((localTaxs:any) => { do something... }) ngOnDestroy(){ this.observableTaxs.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalTaxs(): Observable; /** * @example: * let tax = this.vhQuerySales.getlocalTax('5fb6780ca2148e09806c5b01'); * @param id_tax * @return Object => obj = {} or null */ getlocalTax(id_tax: any): any; /** * @example: * let taxs = this.vhQuerySales.getlocalTaxs(); * @return Array(object) => array = [{},{},...] */ getlocalTaxs(): any; /** * @example: * this.vhQuerySales.refreshLocalTaxs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalTax(), getlocalTaxs() trong localstorage * @return Promise => null */ refreshLocalTaxs(): any; /** * @example: * this.vhQuerySales.addTax({name:'camera 2', quantity:20, price:200000}) .then((tax)=>{ console.log('addTax', tax); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addTax(data: any): Promise; /** * @example: * this.vhQuerySales.updateTax('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateTax', bool); }) * @param id_tax * @param data * @return Promise => bool = true or false */ updateTax(id_tax: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteTax('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteTax', bool); }) * @param id_tax * @return Promise => bool = true or false */ deleteTax(id_tax: string): Promise; /** * @example * this.vhQuerySales.getTax('5fb67fda87c0f21d484cbdf3') .then((tax)=>{ console.log('getTax', tax); }) * @param id_tax * @return Promise => obj ={} or null */ getTax(id_tax: string): Promise; /** * @example * this.vhQuerySales.getTaxs() .then((taxs)=>{ console.log('getTaxs', taxs); }) * @return Promise => array(object) = [{},{},..] */ getTaxs(): Promise; private publishObservableEventCategorys; private observableLocalCategorys; /** * @example: * this.observableCategorys = this.vhQuerySales.getObservableLocalCategorys(1).subscribe((localCategorys:any) => { do something... }) ngOnDestroy(){ this.observableCategorys.unsubscribe(); } * @param type = 1 là danh mục sản phẩm, = 2 là danh mục dịch vụ, giá trị khác là cả hai * @returns Observable (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCategorys(type?: any): Observable; /** * @example: * let category = this.vhQuerySales.getlocalCategory('5fb6780ca2148e09806c5b01'); * @param id_category * @return Object => obj = {} or null */ getlocalCategory(id_category: any): any; /** * @example: * let categorys = this.vhQuerySales.getlocalCategorys(23); * @param type = 3 là danh mục sản phẩm, = 2 là danh mục dịch vụ, = 5 là combos, = 23 là sản phẩm và dịch vụ, giá trị khác là cả ba * @return Array(object) => array = [{},{},...] */ getlocalCategorys(type?: any): any[]; /** * @example: * this.vhQuerySales.refreshLocalCategory() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCategory(), getlocalCategorys() trong localstorage * @return Promise => null */ refreshLocalCategorys(): any; /** * @example: * this.vhQuerySales.addCategory({name:'Danh mục 1'}) .then((category)=>{ console.log('addCategory', category); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCategory(data: any): Promise; /** * @example: * this.vhQuerySales.addCategorys([{name:'Danh mục 1'},{},...]) .then((categorys)=>{ console.log('addCategorys', categorys); }, error=>{ console.log('error', error); }) * @param data : array(object) * @return Promise => array = [{},{},...] * 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 */ addCategorys(data_array: any): Promise; /** * @example: * this.vhQuerySales.updateCategory('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCategory', bool); }) * @param id_category * @param data * @return Promise => bool = true or false */ updateCategory(id_category: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteCategory('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCategory', bool); }) * @param id_category * @return Promise => bool = true or false */ deleteCategory(id_category: string): Promise; /** * @example * this.vhQuerySales.getCategory('5fb67fda87c0f21d484cbdf3') .then((category)=>{ console.log('getCategory', category); }) * @param id_category * @return Promise => obj ={} or null */ getCategory(id_category: string): Promise; /** * @example * this.vhQuerySales.getCategorys() .then((categorys)=>{ console.log('getCategorys', categorys); }) * @return Promise => array(object) = [{},{},..] */ private getCategorys; private publishObservableEventInventorytimes; private observableLocalInventorytimes; /** * @example: * this.observableInventorytime = this.vhQuerySales.getObservableLocalInventorytimes().subscribe((localInventorytimes:any) => { do something... }) ngOnDestroy(){ this.observableInventorytime.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalInventorytimes(): Observable; /** * @example: * let inventorytime = this.vhQuerySales.getlocalInventorytime('5fb6780ca2148e09806c5b01'); * @param id_inventorytime * @return Object => obj = {} or null */ getlocalInventorytime(id_inventorytime: any): any; /** * @example: * let inventorytimes = this.vhQuerySales.getlocalInventorytimes(); * @return Array(object) => array = [{},{},...] */ getlocalInventorytimes(): any; /** * @example: * this.vhQuerySales.refreshLocalTaxs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalInventorytime(), getlocalInventorytimes() trong localstorage * @return Promise => null */ refreshLocalInventorytimes(): any; /** * @example: * this.vhQuerySales.addInventorytime({name:'camera 2', quantity:20, price:200000}) .then((inventorytime)=>{ console.log('addInventorytime', inventorytime); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addInventorytime(data: any): Promise; /** * @example: * this.vhQuerySales.updateInventorytime('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateInventorytime', bool); }) * @param id_inventorytime * @param data * @return Promise => bool = true or false */ updateInventorytime(id_inventorytime: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteInventorytime('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteInventorytime', bool); }) * @param id_inventorytime * @return Promise => bool = true or false */ deleteInventorytime(id_inventorytime: string): Promise; /** * @example * this.vhQuerySales.getInventorytime('5fb67fda87c0f21d484cbdf3') .then((inventorytime)=>{ console.log('getInventorytime', inventorytime); }) * @param id_inventorytime * @return Promise => obj ={} or null */ getInventorytime(id_inventorytime: string): Promise; /** * @example * this.vhQuerySales.getInventorytimes() .then((inventorytimes)=>{ console.log('getInventorytimes', inventorytimes); }) * @return Promise => array(object) = [{},{},..] */ getInventorytimes(): Promise; private publishObservableEventWarrantys; private observableLocalWarrantys; /** * @example: * this.observableWarrantys = this.vhQuerySales.getObservableLocalWarrantys().subscribe((localWarrantys:any) => { do something... }) ngOnDestroy(){ this.observableWarrantys.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ private getObservableLocalWarrantys; /** * @example: * let warranty = this.vhQuerySales.getlocalWarranty('5fb6780ca2148e09806c5b01'); * @param id_warranty * @return Object => obj = {} or null */ private getlocalWarranty; /** * @example: * let warrantys = this.vhQuerySales.getlocalWarrantys(); * @return Array(object) => array = [{},{},...] */ private getlocalWarrantys; /** * @example: * this.vhQuerySales.refreshLocalWarrantys() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalWarranty(), getlocalWarrantys() trong localstorage * @return Promise => null */ private refreshLocalWarrantys; /** * @example: * this.vhQuerySales.addWarranty({name:'camera 2', quantity:20, price:200000}) .then((warranty)=>{ console.log('addWarranty', warranty); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addWarranty(data: any): Promise; /** * @example: * this.vhQuerySales.updateWarranty('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateWarranty', bool); }) * @param id_warranty * @param data * @return Promise => bool = true or false */ updateWarranty(id_warranty: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteWarranty('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteWarranty', bool); }) * @param id_warranty * @return Promise => bool = true or false */ deleteWarranty(id_warranty: string): Promise; /** * @example * this.vhQuerySales.getWarranty('5fb67fda87c0f21d484cbdf3') .then((warranty)=>{ console.log('getWarranty', warranty); }) * @param id_warranty * @return Promise => obj ={} or null */ getWarranty(id_warranty: string): Promise; /** * @example * this.vhQuerySales.getWarrantys_byFields({id_bill:{$eq:'49Lsd2SqPGlqUylJATxg'}}, {}, {}, 0) .then((warrantys)=>{ console.log('getWarrantys_byFields', warrantys); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getWarrantys_byFields(query: any, projection?: object, sort?: any, limit?: number): Promise; /** * @example * this.vhQuerySales.getWarrantys() .then((warrantys)=>{ console.log('getWarrantys', warrantys); }) * @return Promise => array(object) = [{},{},..] */ private getWarrantys; /** * vhQuerySales */ private publishObservableEventCustomerClasss; /** * */ private observableLocalCustomerClasss; /** * @example: * this.observableCustomerClasss = this.vhQuerySales.getObservableLocalCustomerClasss().subscribe((localCustomer_classs:any) => { do something... }) ngOnDestroy(){ this.observableCustomerClasss.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ private getObservableLocalCustomerClasss; /** * @example: * let customer_class = this.vhQuerySales.getlocalCustomerClass('5fb6780ca2148e09806c5b01'); * @param id_customer_class * @return Object => obj = {} or null */ getlocalCustomerClass(id_customer_class: any): any; /** * @example: * let customer_classs = this.vhQuerySales.getlocalCustomerClasss(); * @return Array(object) => array = [{},{},...] */ getlocalCustomerClasss(): any; /** * @example: * this.vhQuerySales.addCustomerClass({name:'camera 2', quantity:20, price:200000}) .then((customer_class)=>{ console.log('addCustomerClass', customer_class); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCustomerClass(data: any): Promise; /** * @example: * this.vhQuerySales.updateCustomerClass('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCustomerClass', bool); }) * @param id_customer_class * @param data * @return Promise => bool = true or false */ updateCustomerClass(id_customer_class: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteCustomerClass('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCustomerClass', bool); }) * @param id_customer_class * @return Promise => bool = true or false */ deleteCustomerClass(id_customer_class: string): Promise; /** * vhQuerySales */ private publishObservableEventDiscount_bills; /** * vhQuerySales */ private observableLocalDiscount_bills; /** * @example: * this.observableDiscount_bills = this.vhQuerySales.getObservableLocalDiscount_bills().subscribe((localDiscount_bills:any) => { do something... }) ngOnDestroy(){ this.observableDiscount_bills.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ private getObservableLocalDiscount_bills; /** * @example: * let discount_bill = this.vhQuerySales.getlocalDiscount_bill('5fb6780ca2148e09806c5b01'); * @param id_discount_bill * @return Object => obj = {} or null */ getlocalDiscount_bill(id_discount_bill: any): any; /** * @example: * let discount_bills = this.vhQuerySales.getlocalDiscount_bills(); * @return Array(object) => array = [{},{},...] */ getlocalDiscount_bills(): any; /** * @example: * this.vhQuerySales.addDiscount_bill({name:'camera 2', quantity:20, price:200000}) .then((discount_bill)=>{ console.log('addDiscount_bill', discount_bill); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDiscount_bill(data: any): Promise; /** * @example: * this.vhQuerySales.updateDiscount_bill('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDiscount_bill', bool); }) * @param id_discount_bill * @param data * @return Promise => bool = true or false */ updateDiscount_bill(id_discount_bill: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteDiscount_bill('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDiscount_bill', bool); }) * @param id_discount_bill * @return Promise => bool = true or false */ deleteDiscount_bill(id_discount_bill: string): Promise; /** * @example: * this.vhQuerySales.addDiscount_sales({name:'camera 2', quantity:20, price:200000}) .then((discount_saless)=>{ console.log('addDiscount_sales', discount_sales); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDiscount_sales(data: any): Promise; /** * @example: * this.vhQuerySales.updateDiscount_sales('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDiscount_sales', bool); }) * @param id_discount_sales * @param data * @return Promise => bool = true or false */ updateDiscount_sales(id_discount_sales: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteDiscount_sales('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDiscount_sales', bool); }) * @param id_discount_sales * @return Promise => bool = true or false */ deleteDiscount_sales(id_discount_sales: string): Promise; /** * @example * this.vhQuerySales.getDiscount_sales('5fb67fda87c0f21d484cbdf3') .then((discount_sales)=>{ console.log('getDiscount_sales', discount_sales); }) * @param id_discount_sales * @return Promise => obj ={} or null */ getDiscount_sales(id_discount_sales: string): Promise; /** * @example * this.vhQuerySales.getDiscount_saless() .then((discount_saless)=>{ console.log('getDiscount_saless', discount_saless); }) * @return Promise => array(object) = [{},{},..] */ getDiscount_saless(): Promise; /** * @example: * this.vhQuerySales.addCommission({name:'camera 2', quantity:20, price:200000}) .then((commissions)=>{ console.log('addCommission', commissions); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCommission(data: any): Promise; /** * @example: * this.vhQuerySales.updateCommission('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCommission', bool); }) * @param id_commission * @param data * @return Promise => bool = true or false */ updateCommission(id_commission: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteCommission('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCommission', bool); }) * @param id_commission * @return Promise => bool = true or false */ deleteCommission(id_commission: string): Promise; /** * @example * this.vhQuerySales.getCommission('5fb67fda87c0f21d484cbdf3') .then((commission)=>{ console.log('getCommission', commission); }) * @param id_commission * @return Promise => obj ={} or null */ getCommission(id_commission: string): Promise; /** * @example * this.vhQuerySales.getCommissions() .then((commissions)=>{ console.log('getCommissions', commissions); }) * @return Promise => array(object) = [{},{},..] */ getCommissions(): Promise; /** * @example: * let delivery = this.vhQuerySales.getlocalDelivery('5fb6780ca2148e09806c5b01'); * @param id_delivery * @return Object => obj = {} or null */ getlocalDelivery(id_delivery: any): any; /** * @example: * let deliverys = this.vhQuerySales.getlocalDeliverys(); * @return Array(object) => array = [{},{},...] */ getlocalDeliverys(): any; /** * @example: * this.vhQuerySales.refreshLocalDeliverys() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalDelivery(), getlocalDeliverys() trong localstorage * @return Promise => null */ refreshLocalDeliverys(): any; /** * @example: * this.vhQuerySales.addDelivery({name:'camera 2', quantity:20, price:200000}) .then((delivery)=>{ console.log('addDelivery', delivery); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDelivery(data: any): Promise; /** * @example: * this.vhQuerySales.updateDelivery('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDelivery', bool); }) * @param id_delivery * @param data * @return Promise => bool = true or false */ updateDelivery(id_delivery: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteDelivery('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDelivery', bool); }) * @param id_delivery * @return Promise => bool = true or false */ deleteDelivery(id_delivery: string): Promise; /** * @example * this.vhQuerySales.getDelivery('5fb67fda87c0f21d484cbdf3') .then((delivery)=>{ console.log('getDelivery', delivery); }) * @param id_delivery * @return Promise => obj ={} or null */ getDelivery(id_delivery: string): Promise; /** * @example * this.vhQuerySales.getDeliverys() .then((deliverys)=>{ console.log('getDeliverys', deliverys); }) * @return Promise => array(object) = [{},{},..] */ getDeliverys(): Promise; /** * @example: * this.vhQuerySales.addAdss({name:name: 'Quảng cáo 1'}) .then((ads)=>{ console.log('addAdss', ads); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} * 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 */ addAdss(data: object): Promise; /** * @example: * this.vhQuerySales.updateAds('5fb6780ca2148e09806c5b01', {name: 'Quảng cáo 1'}) .then((bool:any)=>{ console.log('updateAds', bool); }, error=>{ console.log('error', error); }) * @param id_ads * @param data * @return Promise => bool = true or false */ updateAds(id_ads: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteAds('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteAds', bool); }, error=>{ reject(error) }) * @param id_ads * @return Promise => bool = true or false */ deleteAds(id_ads: string): Promise; /** * @example * this.vhQuerySales.getAds('5fb67fda87c0f21d484cbdf3') .then((ads)=>{ console.log('getAds', ads); }) * @param id_ads * @return false or object */ getAds(id_ads: string): Promise; /** * @example * this.vhQuerySales.getAdss() .then((adss)=>{ console.log('getAdss', adss); }) * @return array(object) = [{},{},..] */ getAdss(): Promise; /** * @example * this.vhQuerySales.getAdss_byFields({quantity:{$gte:10}}, {}, {}, 0) .then((adss)=>{ console.log('getAdss_byFields', adss); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getAdss_byFields(query: any, projection?: object, sort?: any, limit?: number): Promise; /** * @example: * let address = this.vhQuerySales.getlocalAddress('5fb6780ca2148e09806c5b01'); * @param id_address * @return Object => obj = {} or null */ getlocalAddress(id_address: any): any; /** * @example: * let addresss = this.vhQuerySales.getlocalAddresss(); * @return Array(object) => array = [{},{},...] */ getlocalAddresss(): any; /** * @example: * this.vhQuerySales.refreshLocalAddresss() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalAddress(), getlocalAddresss() trong localstorage * @return Promise => null */ refreshLocalAddresss(): any; /** * @example: * this.vhQuerySales.addAddress({name:'camera 2', quantity:20, price:200000}) .then((address)=>{ console.log('addAddress', address); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addAddress(data: object): Promise; /** * @example: * this.vhQuerySales.updateAddress('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateAddress', bool); }) * @param id_address * @param data * @return Promise => bool = true or false */ updateAddress(id_address: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteAddress('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteAddress', bool); }) * @param id_address * @return Promise => bool = true or false */ deleteAddress(id_address: string): Promise; /** * @example * this.vhQuerySales.getAddress('5fb67fda87c0f21d484cbdf3') .then((address)=>{ console.log('getAddress', address); }) * @param id_address * @return Promise => obj ={} or null */ getAddress(id_address: string): Promise; /** * @example: * let ahamoveURL = this.vhQuerySales.getShippingAhamoveURL(); * @returns String */ getShippingAhamoveURL(): string; /** * @example: * let ghtkURL = this.vhQuerySales.getShippingGHTKURL(); * @returns String */ getShippingGHTKURL(): string; /** * @example * this.vhQuerySales.getAddresss() .then((addresss)=>{ console.log('getAddresss', addresss); }) * @return Promise => array(object) = [{},{},..] */ getAddresss(): Promise; /** * @example: * let incoming_group = this.vhQuerySales.getlocalIncoming_group('5fb6780ca2148e09806c5b01'); * @param id_incoming_group * @return Object => obj = {} or null */ getlocalIncoming_group(id_incoming_group: any): any; /** * @example: * let incoming_groups = this.vhQuerySales.getlocalIncoming_groups(); * @return Array(object) => array = [{},{},...] */ getlocalIncoming_groups(): any[]; /** * @example: * this.vhQuerySales.refreshLocalIncoming_groups() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIncoming_group(), getlocalIncoming_groups() trong localstorage * @return Promise => null */ refreshLocalIncoming_groups(): any; /** * Tạo thêm nhóm thu khác * @example: * this.vhQuerySales.addIncoming_group({name:'camera 2', quantity:20, price:200000}) .then((incoming_group)=>{ console.log('addIncoming_group', incoming_group); },(error:any)=>{ console.log('error', error); }) * @param data * @return Promise => obj = {} * 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 */ addIncoming_group(data: any): Promise; /** * @example: * this.vhQuerySales.updateIncoming_group('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIncoming_group', bool); }) * @param id_incoming_group * @param data * @return Promise => bool = true or false */ updateIncoming_group(id_incoming_group: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteIncoming_group('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIncoming_group', bool); }) * @param id_incoming_group * @return Promise => bool = true or false */ deleteIncoming_group(id_incoming_group: string): Promise; /** * @example * this.vhQuerySales.getIncoming_groups() .then((incoming_groups)=>{ console.log('getIncoming_groups', incoming_groups); }) * @return Promise => array(object) = [{},{},..] */ getIncoming_groups(): Promise; /** * @example: * let spending_group = this.vhQuerySales.getlocalSpending_group('5fb6780ca2148e09806c5b01'); * @param id_spending_group * @return Object => obj = {} or null */ getlocalSpending_group(id_spending_group: any): any; /** * @example: * let spending_groups = this.vhQuerySales.getlocalSpending_groups(); * @return Array(object) => array = [{},{},...] */ getlocalSpending_groups(): any[]; /** * @example: * this.vhQuerySales.refreshLocalSpending_groups() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm refreshLocalSpending_group(), refreshLocalSpending_groups() trong localstorage * @return Promise => null */ refreshLocalSpending_groups(): any; /** * Tạo thêm nhóm chi khác * @example: * this.vhQuerySales.addSpending_group({name:'camera 2', quantity:20, price:200000}) .then((spending_groups)=>{ console.log('addSpending_group', spending_groups); },(error:any)=>{ console.log('error', error); }) * @param data * @return Promise => obj = {} * 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 */ addSpending_group(data: any): Promise; /** * @example: * this.vhQuerySales.updateSpending_group('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateSpending_group', bool); }) * @param id_spending_group * @param data * @return Promise => bool = true or false */ updateSpending_group(id_spending_group: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteSpending_group('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteSpending_group', bool); }) * @param id_spending_group * @return Promise => bool = true or false */ deleteSpending_group(id_spending_group: string): Promise; /** * @example * this.vhQuerySales.getSpending_groups() .then((spending_groups)=>{ console.log('getSpending_groups', spending_groups); }) * @return Promise => array(object) = [{},{},..] */ getSpending_groups(): Promise; /** * @example: * this.vhQuerySales.updateDebtAtBeginningCustomer('5fb6780ca2148e09806c5b01', '56345gy34t12tf12', 2000000) .then((bool:any)=>{ console.log('updateDebtAtBeginningCustomer', bool); }) * @param id_customer * @param id_branch * @param debt_beginning * @return Promise => bool = true or false */ updateDebtAtBeginningCustomer(id_customer: string, id_branch: string, debt_beginning: number): Promise; /** * @example * this.vhQuerySales.getDebtAtBeginningCustomers_byIDcustomer() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers_byIDcustomer', debtatbeginnings); }) * @param id_customer * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers_byIDcustomer; /** * @example * this.vhQuerySales.getDebtAtBeginningCustomers_byIDbranch() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers_byIDbranch', debtatbeginnings); }) * @param id_customer * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers_byIDbranch; /** * @example * this.vhQuerySales.getDebtAtBeginningCustomers_byIDcustomer_byIDbranch('3546235ytrhdghyw465', 'i5455234trgxi8675eg') .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers_byIDcustomer_byIDbranch', debtatbeginnings); }) * @param id_customer * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers_byIDcustomer_byIDbranch; /** * Hàm lấy về những khách hàng có công nợ đầu kỳ * @example * this.vhQuerySales.getDebtAtBeginningCustomers() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningCustomers', debtatbeginnings); }) * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningCustomers; /** * @example: * this.vhQuerySales.updateDebtAtBeginningSupplier('5fb6780ca2148e09806c5b01', '56345gy34t12tf12', 2000000) .then((bool:any)=>{ console.log('updateDebtAtBeginningSupplier', bool); }) * @param id_supplier * @param id_branch * @param debt_beginning * @return Promise => bool = true or false */ updateDebtAtBeginningSupplier(id_supplier: string, id_branch: string, debt_beginning: number): Promise; /** * @example * this.vhQuerySales.getDebtAtBeginningSuppliers_byIDsupplier() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers_byIDsupplier', debtatbeginnings); }) * @param id_supplier * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers_byIDsupplier; /** * @example * this.vhQuerySales.getDebtAtBeginningSuppliers_byIDbranch('sdafsdfaw564655ybr') .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers_byIDbranch', debtatbeginnings); }) * @param id_branch * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers_byIDbranch; /** * @example * this.vhQuerySales.getDebtAtBeginningSuppliers_byIDsupplier_byIDbranch('4ye5r6tyhdfdfaenm', '576dfgbdshdmiret3') .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers_byIDsupplier_byIDbranch', debtatbeginnings); }) * @param id_supplier * @param id_branch * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers_byIDsupplier_byIDbranch; /** * @example * this.vhQuerySales.getDebtAtBeginningSuppliers() .then((debtatbeginnings)=>{ console.log('getDebtAtBeginningSuppliers', debtatbeginnings); }) * @return Promise => array(object) = [{},{},..] */ private getDebtAtBeginningSuppliers; setDefaultBranch(id_branch: any): void; getDefaultBranch(): any; clearDefaultBranch(): void; isChains(): boolean | null; private publishObservableEventBranchs; private observableLocalBranchs; /** * @example: * this.observableBranch = this.vhQuerySales.getObservableLocalBranchs().subscribe((localBranchs:any) => { do something... }) ngOnDestroy(){ this.observableBranch.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalBranchs(): Observable; /** * @example: * let branch = this.vhQuerySales.getlocalBranch('5fb6780ca2148e09806c5b01'); * @param id_branch * @return Object => obj = {} or null */ getlocalBranch(id_branch: any): any; /** * @example: * let branchs = this.vhQuerySales.getlocalBranchs(); * @return Array(object) => array = [{},{},...] */ getlocalBranchs(): any[]; /** * @example: * this.vhQuerySales.refreshLocalBranchs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalBranch(), getlocalBranchs() trong localstorage * @return Promise => null */ refreshLocalBranchs(): any; /** * @example: * this.vhQuerySales.addBranch({name:'Chi nhánh 2'}) .then((branch)=>{ console.log('addBranch', branch); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addBranch(data: any): Promise; /** * @example: * this.vhQuerySales.updateBranch('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateBranch', bool); }) * @param id_branch * @param data * @return Promise => bool = true or false */ updateBranch(id_branch: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteBranch('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBranch', bool); }) * @param id_branch * @return Promise => bool = true or false */ deleteBranch(id_branch: string): Promise; /** * @example * this.vhQuerySales.getBranch('5fb67fda87c0f21d484cbdf3') .then((branch)=>{ console.log('getBranch', branch); }) * @param id_branch * @return Promise => obj ={} or null */ private getBranch; /** * @example * this.vhQuerySales.getBranchs() .then((branchs)=>{ console.log('getBranchs', branchs); }) * @return Promise => array(object) = [{},{},..] */ private getBranchs; private publishObservableEventPrinters; private observableLocalPrinters; /** * @example: * this.observablePrinter = this.vhQuerySales.getObservableLocalPrinters().subscribe((localPrinters:any) => { do something... }) ngOnDestroy(){ this.observablePrinter.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalPrinters(): Observable; /** * @example: * let printer = this.vhQuerySales.getlocalPrinter('5fb6780ca2148e09806c5b01'); * @param id_printer * @return Object => obj = {} or null */ getlocalPrinter(id_printer: any): any; /** * @example * let printers = this.vhQuerySales.getlocalPrinters(); * @return Array(object) => array = [{},{},...] */ getlocalPrinters(): any; /** * @example: * this.vhQuerySales.refreshLocalPrinters() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPrinter(), getlocalPrinters() trong localstorage * @return Promise => null */ refreshLocalPrinters(): any; /** * @example: * this.vhQuerySales.addPrinter({name:'camera 2', quantity:20, price:200000}) .then((printer)=>{ console.log('addPrinter', printer); }, error=>{ console.log('error', error); }) * @param data * Promise => object = {} 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 */ addPrinter(data: any): Promise; /** * @example: * this.vhQuerySales.updatePrinter('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePrinter', bool); }, error=>{ console.log('error', error); }) * @param id_printer * @param data * @return Promise => bool = true or false */ updatePrinter(id_printer: string, data: object): Promise; /** * @example: * this.vhQuerySales.deletePrinter('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePrinter', bool); }) * @param id_printer * @return Promise => bool = true or false */ deletePrinter(id_printer: string): Promise; /** * @example * this.vhQuerySales.getPrinter('5fb67fda87c0f21d484cbdf3') .then((printer)=>{ console.log('getPrinter', printer); }) * @param id_printer * @return false or object */ getPrinter(id_printer: string): Promise; /** * @example * this.vhQuerySales.getPrinters() .then((printers)=>{ console.log('getDoc', printers); }) * @return array(object) = [{},{},..] */ getPrinters(): Promise; /** * @example: * this.vhQuerySales.refreshLocalPrintPages() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPrintPage(), getlocalPrintPages() trong localstorage * @return Promise => null */ private refreshLocalPrintPages; /** * @example: * let print_page = this.vhQuerySales.getLocalPrintPage('page_desktop_sales'); * @param print_page_type * @return Object => obj = {} or null */ getLocalPrintPage(print_page_type: string): any; /** * @example: * let pagesize = this.vhQuerySales.getLocalDefaultPageSize('page_desktop_sales'); * @param print_page_type * @return Object => obj = {} or null */ getLocalDefaultPageSize(print_page_type: string): any; /** * @example: * this.vhQuerySales.addPrintPage('page_desktop_sales', {name:'camera 2', quantity:20, price:200000}) .then((print_page)=>{ console.log('addPrintPage', print_page); }, error=>{ console.log('error', error); }) * @param data * Promise => object = {} 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 */ addPrintPage(print_page_type: string, data: any): Promise; /** * @example: * this.vhQuerySales.updatePrintPage('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePrintPage', bool); }, error=>{ console.log('error', error); }) * @param id_print_page * @param data * @return Promise => bool = true or false */ updatePrintPage(id_print_page: string, data: object): Promise; /** * @example: * this.vhQuerySales.deletePrintPage('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePrintPage', bool); }) * @param id_print_page * @return Promise => bool = true or false */ deletePrintPage(id_print_page: string): Promise; /** * @example * this.vhQuerySales.getPrintPages() .then((print_pages)=>{ console.log('getPrintPages', print_pages); }) * @return array(object) = [{},{},..] */ getPrintPages(): Promise; /** * Hàm này dùng để thực hiện trừ hàng hóa trong nhiều Payment_Card * 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 * @example let bill = { bill_type: 51, id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_branch: 'ADGNX9HFzffJ59yRtqNd', id_customer: 'cus001', id_wallet: 'wallet001', note: '', date: new Date(), bill_code: 'L46K0502' } let bill_details =[{ id_payment_card: '7Q5BZVRlyySrhShngMDv', id_payment_card_code: '33cTgnd2xZo3OW9tsu1d', pctype: 1, products:[{ id_product:'9tg6UxzK26DDVEVHsvq5', quantity: 5, outquantity: xem cách tính bên dưới, restquantity: xem cách tính bên dưới, price: 0, //vì đổi thẻ lấy hàng, nên price luôn luôn là 0 ptype: 1, ratio:1 },{ id_product:'jUqd5bE6y2JhX0aCd5TF', quantity: 1, outquantity: xem cách tính bên dưới, restquantity: xem cách tính bên dưới, price: 0, ptype: 2, ratio:1 },{ id_product, quantity, outquantity: xem cách tính bên dưới, restquantity: xem cách tính bên dưới, price 0, ptype: 1, ratio:1 }] this.vhQuerySales.createBill_Billdetail_51(bill, bill_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param bill * @param bill_details * @returns Promise => object = {} or null; * @notice : * outquantity (của bill_detail) = outquantity (của thẻ) + quantity (của bill_detail); * restquantity (của bill_detail) = quantity (của thẻ) - outquantity (của bill_detail); */ private createBill_Billdetail_51; /** * Hàm này dùng để thực hiện đổi voucher lấy hàng hóa * @example let bill = { bill_type: 41, id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_branch: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_customer: 'cus001', id_wallet: 'wallet001', note: '', date: new Date(), bill_code: '' } let bill_details =[{ id_voucher: 'voucher006', id_voucher_code: 'MHRD9N0531', vtype: 1, products:[{ id_product:'9tg6UxzK26DDVEVHsvq5', quantity: 5, price: 0, //vì đổi voucher lấy hàng, nên price luôn luôn là 0 ptype: 3, unit: 'cái', ratio:1 },{ id_product:'jUqd5bE6y2JhX0aCd5TF', quantity: 1, price: 0, ptype: 2, unit: 'cái', ratio:1 },{ id_product, quantity, price, ptype: 5// bây giờ phần mềm chưa dùng voucher có combo combos:[{ id_product, quantity, price: 0, //vì đổi voucher lấy hàng, nên price luôn luôn là 0 ptype: 3, unit: 'cái', ratio:1 },{ id_product, quantity, price: 0, ptype: 2, unit: 'cái', ratio:1 }] }] this.vhQuerySales.createBill_Billdetail_41(bill, bill_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param bill * @param bill_details * @returns Promise => object = {} or null */ private createBill_Billdetail_41; /** * * 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 * @example let bill ={ id_employee: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_cashier: '2rVieBQTubQ2hjUnpwU4w7qSlD83', id_customer: 'cus001', total: 10000000, bill_type: 1, tax_value: 0, fee: 0, date: new Date() } let bill_details =[{ id_product: 'pro006', price: 10000000, quantity: 1 },{ id_product: 'pro007', price: 12000000, quantity: 1 }] this.vhQuerySales.createBill_Billdetail(bill, bill_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param bill * @param bill_details * @return Promise => object = {} or null */ createBill_Billdetail(bill: any, bill_details: any): any; /** * @example: * this.vhQuerySales.createBill_Detail({}) .then((vhbill_detail)=>{ console.log('vhQuerySales', vhbill_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ createBill_Detail(data: any): any; /** * @example: * this.vhQuerySales.updateBill_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updateBill_Detail', bool); }, error=>{ console.log('error', error); }) * @param id_bill * @param data * @return Promise => bool = true or false */ updateBill_Detail(id_bill_detail: string, value: object): Promise; /** * @example: * this.vhQuerySales.deleteBill_Detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBill_Detail', bool); }) * @param id_bill_detail * @return Promise => bool = true or false */ deleteBill_Detail(id_bill_detail: any): Promise; /** * Hàm này chỉ áp dụng cho bill_type 1,5 và bill_detail có ptype 5 * @example: * this.vhQuerySales.deleteBill_Detail_ptype_5('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBill_Detail', bool); }) * @param id_bill_detail * @return Promise => bool = true or false */ deleteBill_Detail_ptype_5(id_bill_detail: any): Promise; /** * hàm này chỉ dùng cho trường hợp chuyển trạng thái (bill_type) của biên nhận bảo hành (chưa xử lý 18, đang xử lý 19, hoàn thành 20, đã giao khách 21) * @example this.vhQuerySales.changeStateWarranty_Bill_Billdetail('SzyEYNN39Mq90NkzUFpz', 21) .then(()=>{ console.log("success"); }) * @param id_bill * @return Promise => bool = true or false */ changeStateWarranty_Bill_Billdetail(id_bill: any, bill_type: any): any; /** * @example * this.vhQuerySales.changeBill_toInvoice_byMinvoice(id_bill,invoiceSeries) .then((rsp)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param id_bill * @param invoiceSeries * @returns Promise => {vcode, msg, data(array)} */ changeBill_toInvoice_byMinvoice(id_bill: string, invoiceSeries: string): Promise; /** * @example * this.vhQuerySales.changeTiktok_toInvoice_byMinvoice(order,invoiceSeries) .then((rsp)=>{ //-----------your code here----------- },(error:any)=>{ console.log('error', error) }) * @param order : hóa đơn lấy từ tiktok về * @param invoiceSeries : ký hiệu hóa đơn * @returns Promise => {vcode, msg, data(array)} */ private changeTiktok_toInvoice_byMinvoice; private changeTiktok_toInvoice_byMinvoice1; /** * hàm này chỉ dùng cho trường hợp bill_type 5->1, 29->3031, 36->1, 42->40, 43->41, 52->50, 53->51 * @example this.vhQuerySales.saveBill_Billdetail('SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) * @param id_bill * @param newbill_type * @return Promise => undefined */ saveBill_Billdetail(id_bill: any, newbill_type: number): any; /** * hàm này chỉ dùng cho trường hợp bill_type 29->30 và 31 * @example this.vhQuerySales.saveBill_Billdetail_3031('SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) * @param id_bill */ private saveBill_Billdetail_3031; /** * 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 * @example this.vhQuerySales.calculateUpdateImportPrice(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateUpdateImportPrice; /** * @example this.vhQuerySales.calculateQuantityProduct_UP(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_UP; /** * @example this.vhQuerySales.calculateQuantityProduct_UP_9(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_UP_9; /** * @example this.vhQuerySales.calculateQuantityProduct_DOWN(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_DOWN; /** * @example this.vhQuerySales.calculateQuantityProduct_DOWN(bill_details,'SzyEYNN39Mq90NkzUFpz') .then(()=>{ console.log("success"); }) */ private calculateQuantityProduct_DOWN_9; /** * hàm này chỉ dùng cho trường hợp bill đã lưu rồi mà muốn sửa, bill_type trước khi sửa và sau khi sửa phải giống nhau * Lưu ý: trương bill_type (trong bill), trước và sau khi cập nhật phải cùng giá trị * @example this.vhQuerySales.updateBill_Billdetail('SzyEYNN39Mq90NkzUFpz',{},[{},{},...]) .then(()=>{ console.log("success"); }) * @param id_bill * @param bill (bill phải đủ các field) * @param bill_details (bill_details phải đủ các field) * @returns */ updateBill_Billdetail(id_bill: any, bill: any, bill_details: any): any; /** * VhQuerySales: * Lưu ý: xóa tất cả các bill_type(từ 1 đến 28, 40, 41, 50, 51) đều dùng hàm này, chưa có xóa bill_type 30 và 31 * @example this.vhQuerySales.deleteBill_Billdetail('RcECbNgU9BdYQo37s30p') .then((bool:any)=>{ if(bool){ console.log('success'); }else{ console.log('no success'); } },(error:any)=>{ console.log('error ', error); }) * @param id_bill * @return Promise => null or orror */ deleteBill_Billdetail(id_bill: any): any; /** * Hàm lấy về các có kèm chương trình khuyến mãi * @example this.vhQuerySales.getBill_details_byId_bill('RcECbNgU9BdYQo37s30p') .then((bill_details:any)=>{ console.log('getBill_details_byId_bill', bill_details); },(error:any)=>{ console.log('error ', error); }) * @param id_bill * @return Promise => array / orror */ getBill_details_byId_bill(id_bill: any): any; /** * @example: * this.vhQuerySales.getBill_details_byID({id_bill:{$eq:id_bill}, bill_type:{$eq:5}}, {},{date:1},0) .then((bill_details)=>{ console.log('bill_details', bill_details); }) * @param query : trong query phải có query id_bill or id_product or id_subproduct.... * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ private getBill_details_byID; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySales.getBill_details_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0) .then((bill_details)=>{ console.log('getBill_details_byFields', bill_details); }) * @param query trong query phải có date * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ private getBill_details_byFields; /** * Hàm này tạo bill_code theo số thứ tự (trong ngày) của từng loại bill_type * @example: * this.vhQuerySales.createBillCode(new Date(), 7) .then((bill_code)=>{ console.log('createBillCode', bill_code); }) * @param billdate * @param bill_type */ createBillCode(billdate: any, bill_type: number): Promise; /** * @example: * this.vhQuerySales.getBill('5fb67fda87c0f21d484cbdf3') .then((bill)=>{ console.log('getBill', bill); }) * @param id_bill */ getBill(id_bill: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySales.getBills_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0) .then((bills)=>{ console.log('getBills', bills); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getBills_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQuerySales.createBill({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()}) .then((bill)=>{ console.log('createBill', bill); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail */ createBill(data: any): Promise; /** * @example: * this.vhQuerySales.updateBill('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updateBill', bool); }, error=>{ console.log('error', error); }) * @param id_bill * @param bill * @return Promise => bool = true or false * @notice : hàm này chỉ dùng cập nhật những bill_type mà không có phát sinh bill_detail * @notice : trường hợp bill.bill_type == 3334, thì hàm sẽ xóa bill có bill_type 32 đồng thời tạo 2 bill mới có bill_type là 33 và 34 */ updateBill(id_bill: string, bill: any): Promise; /** * @example: * this.vhQuerySales.deleteBill('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteBill', bool); }) * @param id_bill_detail * @return Promise => bool = true or false * @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 */ deleteBill(id_bill: any): Promise; /** * 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 * @example: * this.vhQuerySales.observableSyncOpeningBill('5fb6780ca2148e09806c5b01', 5) .subscribe((rsp)=> { if(rsp.vcode === 0){ //-----------your code 0----------- let bill = rsp.data; console.log('observableSyncOpeningBill', bill); }else if(rsp.vcode === 1){ //-----------your code 1----------- }else if(rsp.vcode === 2){ //-----------your code 2----------- } },(error:any) => { console.log(error); }) * @param id_bill * @param bill_type * @returns Observable => bill hoặc null; * @return Observable object => rsp = {vcode, message, data} * vcode == 0: repaired bill by another device * vcode == 1: changed bill_type by another device * vcode == 2: deleted bill by unknown device * @notice : nhớ đóng closeSyncOpeningBill() khi thoát trang hiện tại this.vhQueryCafe.closeSyncOpeningBill(); */ observableSyncOpeningBill(id_bill: string, bill_type: number): Observable; /** * @example: * this.vhQuerySales.closeSyncOpeningBill(); * @returns void */ closeSyncOpeningBill(): void; /** * Hàm callback, mỗi lần callback trả về danh sách hóa đơn mới nhất * @example: * this.vhQuerySales.observableSyncBillType('5fb6780ca2148e09806c5b01', 5) .subscribe((listbill_bybilltype)=> { console.log('observableSyncBillType', listbill_bybilltype); },(error:any) => { console.log(error); }) * @param id_branch * @param bill_type * @returns Observable => array */ observableSyncBillType(id_branch: string, bill_type: number): Observable; /** * Hàm đóng Observable của observableSyncBillType(), mỗi lần thoát trang, thoát component nên gọi hàm này * @example: * this.vhQuerySales.closeSyncBillType(); * @returns void */ closeSyncBillType(): void; /** * @example: * this.vhQuerySales.createPaymentVnpay(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang, link này gán trong nút back của trang trả về * @Return Promise => void */ private createPaymentVnpay; /** * @example: * this.vhQuerySales.createPaymentVnpay_web(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang, link này gán trong nút back của trang trả về * @Return Void */ createPaymentVnpay_web(amount: number, orderDescription: string, id_payment: string, backHref: string): any; /** * @example: * this.vhQuerySales.createPaymentVnpay_soft(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG') .then((payment_url)=>{ //Hiện loading chờ ở đây setTimeout(() => { //Sau 15s đóng loading lại và refresh trang lại window.location = backHref; }, 15000); //Đồng thời mở 1 browser trong 1 window mới vơi ulr là payment_url cho khách hàng thanh toán },(error:any)=>{ console.log('error', error); }) * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @Return Promise => payment_url */ createPaymentVnpay_soft(amount: number, orderDescription: string, id_payment: string): any; /** * @example: * this.vhQuerySales.createPaymentVnpay_app(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG') .then((payment_url)=>{ //Dùng thư viện chạy browser trong app vơi ulr là payment_url cho khách hàng thanh toán },(error:any)=>{ console.log('error', error); }) * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @Return payment_url */ createPaymentVnpay_app(amount: number, orderDescription: string, id_payment: string): any; /** * @example: * this.vhQuerySales.createPaymentVnpay_Mobile(10000, 'Thanh toan hoa don so A7TG2004, vao luc: 2021-11-19 13:11:27', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') .then(link=>{ //Nếu Desktop chạy luôn link này: window.location = response.data; // Nếu Mobile chạy luôn link này trong tag frame html },(error:any)=>{ console.log('error', error); }) * @param platform : "mobile"/"desktop" * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang * @Return Promise => trả về link thanh toán vnpay */ private createPaymentVnpay_Mobile; /** * 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 * @example: * this.vhQuerySales.createPaymentVnpay_iFrame(10000, 'Thanh toan hoa don so A7TG2004', 'o0wEpPDhR8QiGDkp2hLG', 'http://localhost:4200/') .then(link=>{ //Nếu Desktop chạy luôn link này: window.location = response.data; // Nếu Mobile chạy link link này trong tag frame html },(error:any)=>{ console.log('error', error); }) * @param amount * @param orderDescription (lưu ý chữ không dấu) * @param id_payment : id của hóa đơn khách hàng cần thanh toán * @param backHref : lấy link mà chạy khởi động lại trang * @Return Promise => trả về link thanh toán vnpay */ private createPaymentVnpay_iFrame; /** * @example: * let data = { date: new Date(), payment_type: 5, //1 lưu (khách đã thanh toán cho vnpay); 5 lưu tạm (khách chưa thanh toán vnpay), hệ thống sẽ tự động xóa những payment này hoặc trên giao diện hiện ra cho khách tự xóa payment: 990.000, tax: 0, total: 990.000 } * this.vhQuerySales.createPayment(data) .then((payment)=>{ console.log('createPayment', payment); },(error:any)=>{ console.log('error', error); }) * payment = { _id, payment_code, id_store, date payment_type, payment, tax, total } * @param payment : object * @return Promise => payment = {} / error * 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 * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail */ createPayment(data: any): Promise; /** * @example: * this.vhQuerySales.updatePayment('5fb6780ca2148e09806c5b01', {total:990000}) .then((response)=>{ console.log('updatePayment', response); }, error=>{ console.log('error', error); }) * @param id_payment * @param value * @return Promise => response = undefined / error */ updatePayment(id_payment: string, value: any): Promise; /** * @example: * this.vhQuerySales.deletePayment('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deletePayment', response); }, error=>{ console.log(error, error); }) * @param id_payment * @return Promise => response = undefined / error */ deletePayment(id_payment: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySales.getPayments({payment_type:{$eq:5}}, {},{},0) .then((payments)=>{ console.log('getPayments', payments); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getPayments(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQuerySales.getPayment('5fb67fda87c0f21d484cbdf3') .then((payment)=>{ console.log('getPayment', payment); }) * @param id_payment * @return Promise => payment ={} or null / error */ getPayment(id_payment: any): Promise; /** * @example: let payment_detail_main = { id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id id_restriction: 'main_package_advanced', //package.id_restriction id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua package_type: 1, //gói chinh, gói tmđt hay gói facebook... day: 31, //package.day, tax: 0, package.tax, price: 99000, package.price, quantity: 1, //khách chọn payment_detail_type: 1, //1: gói gia hạng mới, 2: gói nâng cấp, 3: gói kéo dài thêm thời gian } this.vhQuerySales.createPayment_Detail({}) .then((payment_detail)=>{ console.log('createPayment_Detail', payment_detail); },(error:any)=>{ console.log('error', error); }) payment_detail = { _id, id_store, payment_type, activating, invalid, date, id_branch, id_payment, id_restriction, id_package, package_type, payment_type, payment_detail_type, day, tax, price, quantity } * @param data * @return Promise => response = {} / error * 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 */ createPayment_Detail(data: any): any; /** * @example: * this.vhQuerySales.updatePayment_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((response)=>{ console.log('updatePayment_Detail', response); },(error:any)=>{ reject(error); }) * @param id_payment_detail * @param value * @return Promise => response = undefined / error */ updatePayment_Detail(id_payment_detail: string, value: object): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySales.getPayment_details({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0) .then((payment_details)=>{ console.log('getPayment_details', payment_details); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return Promise Array => array = [{},{},...] / error */ getPayment_details(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQuerySales.getPayment_detail('5fb67fda87c0f21d484cbdf3') .then((payment_detail)=>{ console.log('getPayment_detail', payment_detail); }) * @param id_payment_detail * @return Promise => payment_detail ={} or null / error */ getPayment_detail(id_payment_detail: any): Promise; /** * @example: * this.vhQuerySales.deletePayment_Detail('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deletePayment_Detail', response); },(error:any)=>{ reject(error); }) * @param id_payment_detail * @return Promise => Promise => response = undefined / error */ deletePayment_Detail(id_payment_detail: string): Promise; /** * @example: * this.vhQuerySales.getPackage('5fb67fda87c0f21d484cbdf3') .then((package)=>{ console.log('getPackage', package); }) * @param id_package * @return Promise => package ={} or null / error */ getPackage(id_package: any): Promise; /** * @example: * this.vhQuerySales.extendLicenseValidaty_byLicenseKEY('5fb6780ca2148e09806c5b01', '674fd94a9ace7267deb685fd') .then((response)=>{ console.log('extendLicenseValidaty_byLicenseKEY', response); }, error=>{ console.log('error', error); }) * @param id_branch * @param id_licenseKEY * @return Promise => response = {vcode, msg} * vcode = 0: gia hạn thành công * vcode = 1: id_licenseKEY không thuộc về Store * vcode = 2: id_licenseKEY đã được kích hoạt trước đây * vcode = 3: id_licenseKEY đã bị vô hiệu hóa trước đây * vcode = 4: id_licenseKEY không kích hoạt được do khác loại gói đang dùng */ extendLicenseValidaty_byLicenseKEY(id_branch: string, id_licenseKEY: string): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySales.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0) .then((payments)=>{ console.log('getLicenseKEYs', payments); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR * @example: * this.vhQuerySales.vietqr_getBanks() .then((rsp:any)=>{ if(rsp.vcode === 0){ } }, error=>{ console.log(error) }) * @returns Promise => rsp ={vcode, msg, data(array)} / error * vcode == 0: success */ vietqr_getBanks(): Promise; /** * Tạo mã QR cho Shop quét thanh toán vào tài khoản ngân hàng đã đăng ký Casso * @example: * this.vhQuerySales.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000) .then((rsp:any)=>{ if(rsp.vcode === 0){ } }, error=>{ console.log(error) }) * @param accountNo: số tài khoản ngân hàng * @param accountName: tên chủ tài khoản * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks()) * @param template: compact2, compact, qr_only, print + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản * @param id_bill: _id của đơn hàng * @param amount: tổng tiền khách phải thanh toán * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error * vcode == 0: success */ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise; private publishObservableEventPromotions; private observableLocalPromotions; /** * @example: * this.observablePromotion = this.vhQuerySales.getObservableLocalPromotions().subscribe((localPromotions:any) => { do something... }) ngOnDestroy(){ this.observablePromotion.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ private getObservableLocalPromotions; /** * @example: * let promotion = this.vhQuerySales.getlocalPromotion('5fb6780ca2148e09806c5b01'); * @param id_promotion * @return Object => obj = {} or null */ getlocalPromotion(id_promotion: any): null; /** * @example: * let promotions = this.vhQuerySales.getlocalPromotions(); * @return Array(object) => array = [{},{},...] */ getlocalPromotions(): never[]; /** * @example: * let date = new Date(); * this.vhQuerySales.refreshLocalPromotions(date) .then(()=>{ do something..... }, error=>{ console.log('error', error); }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPromotion(), getlocalPromotions() trong localstorage * @return Promise => null */ private refreshLocalPromotions; /** * @example: * this.vhQuerySales.addPromotion({name:'Cuối tuần vui vẻ', type:2, active:true, date_start:new Date(), date_end: new Date()}) .then((promotion)=>{ console.log('addPromotion', promotion); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPromotion(data: any): Promise; /** * @example: * this.vhQuerySales.updatePromotion('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((bool:any)=>{ console.log('updatePromotion', bool); }, error=>{ console.log('error', error); }) * @param id_promotion * @param data * @return Promise => bool = true or false */ updatePromotion(id_promotion: string, data: object): Promise; /** * @example: * this.vhQuerySales.deletePromotion('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePromotion', bool); }) * @param id_promotion * @return Promise => bool = true or false */ deletePromotion(id_promotion: any): Promise; /** * @example * this.vhQuerySales.getPromotion('5fb67fda87c0f21d484cbdf3') .then((promotion)=>{ console.log('getPromotion', promotion); }) * @param id_promotion * @return false or object */ getPromotion(id_promotion: string): Promise; /** * @example * this.vhQuerySales.getPromotions() .then((response)=>{ console.log('getPromotions', response); }) * @return array(object) = [{},{},..] */ private getPromotions; /** * hàm này trả về danh sách chương trình khuyến mãi diễn ra từ thời gian fromTime đến thời gian toTime * @example: * let fromTime = new Date(); * let toTime = new Date('2020-07-01T05:24:00'); * this.vhQuerySales.getPromotions_fromTime_toTime(fromTime, toTime, 'all') .then((res)=>{ console.log('getPromotions_fromTime_toTime', res); }, error=>{ console.log('error', error); }) * @param fromTime * @param toTime * @param type: 'all' or 1->8 * @return Promise => array(object) = [{},{},..] */ getPromotions_fromTime_toTime(fromTime: any, toTime: any, type: any): Promise; /** * hàm này trả về danh sách chương trình khuyến mãi diễn ra tại thời điểm tạo hóa đơn => mỗi lần chỉnh lại thời gian tạo hóa đơn phải gọi hàm này * @example: * let date = new Date(); * this.vhQuerySales.getPromotions_byDate(date) .then((res)=>{ console.log('getPromotions_byDate', res); }, error=>{ console.log('error', error); }) * @param date : thơi gian tạo hóa đơn * @return Promise => array(object) = [{},{},..] */ private getPromotions_byDate; /** * Hàm này lấy về tất cả các chương trình khuyến mãi mà có id_product tham gia * @example: * let date = new Date(); * this.vhQuerySales.getPromotions_byIDproduct_byDate(id_product, date) .then((promotions)=>{ console.log('getPromotions_byIDproduct_byDate', promotions); }, error=>{ console.log('error', error); }) * @param id_product * @param date : thơi gian tạo hóa đơn * @return Array => array = [{},{},..] */ private getPromotions_byIDproduct_byDate; /** * Hàm này đổi mảng Bill_Details sang mảng Bill_Details có chương trình khuyến mãi (nếu có) * @example: * let date = new Date(); * this.vhQuerySales.changeBillDetails_withPromotions(bill_details, date) .then((bill_details_promotions)=>{ console.log('bill_details_promotions', res); bill_details = [...bill_details_promotions]; }, error=>{ console.log('error', error); }) * @param bill_details * @param date : thơi gian tạo hóa đơn * @return Oject => obj = {bill_details_pmtype_0to6: Array, bill_details_pmtype_7: Array}}; (bill_details_pmtype_0 là bill_details ko có khuyến mãi) */ changeBillDetails_withPromotions(bill_details: any, date: any): Promise; /** * Hàm này đổi mảng Bill_Details có chương trình khuyến mãi (nếu có) sang mảng Bill_Details thường * @example: * bill_details = this.vhQuerySales.destroyBillDetails_withPromotions(bill_details_promotions) * @param bill_details * @return Array => array = [{},{},..] */ destroyBillDetails_withPromotions(bill_details: any): any[]; private sumBill_Details; /** * vhQuerySales * @param bill_details * @returns */ private changeBillDetails_withPromotions_toRaw; /** * vhQuerySales * @param bill_details * @returns */ private changeBillDetails_withRaw_toPromotions; /** * @example: * this.vhQuerySales.getBillDetails_withName({name:'promition 1'}) .then((bill_details:any)=>{ console.log('getBillDetails_withName', bill_details); },(error:any)=>{ console.log('error', error); }) * @param bill_details * @return Promise => array = [{},{},...] * 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 */ private changeBillDetails_withPromotionNameUnitsLots; /** * @example: * let _bill_details = this.vhQuerySales.changeBillDetails_withNameUnitsLots(bill_details); * @param bill_details * @return Promise => array = [{},{},...] * 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 */ private changeBillDetails_withNameUnitsLots; /** * Hàm này lấy về 1 unit của sản phẩm theo ratio truyền vào * @example * let unit = this.vhQuerySales.getUnit_byRatio(1); * @param units * @param ratio * @return Object => obj = {} hoặc null */ getUnit_byRatio(units: any, ratio: number): any; /** * @example: * this.vhQuerySales.addPromotion_detail({name:'promition 1'}) .then((promotion_details)=>{ console.log('promotion_details', promotion_details); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPromotion_detail(data: any): Promise; /** * @example: * this.vhQuerySales.updatePromotion_detail('5fb6780ca2148e09806c5b01', {name:'promoiton 2'}) .then((bool:any)=>{ console.log('updatePromotion_detail', bool); }) * @param id_promotion * @param data * @return Promise => bool = true or false */ updatePromotion_detail(id_promotion: string, data: object): Promise; /** * @example: * this.vhQuerySales.id_promotion_detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('id_promotion_detail', bool); }) * @param id_promotion_detail * @return Promise => bool = true or false */ deletePromotion_detail(id_promotion_detail: any): Promise; /** * @example * this.vhQuerySales.getPromotion_detail('5fb67fda87c0f21d484cbdf3') .then((promotion)=>{ console.log('getPromotion_detail', promotion); }) * @param id_promotion * @return false or object */ getPromotion_detail(id_promotion: string): Promise; /** * @example * this.vhQuerySales.getPromotion_details() .then((response)=>{ console.log('getPromotion_details', response); }) * @return array(object) = [{},{},..] */ getPromotion_details(): Promise; /** * @example let promotion ={ name: "Chuong Trinh Giam Gia 10", date_start: new Date(), date_end: new Date() } let promotion_details =[{ barcode: '01435438426', id_product: 'pro001', id_sub_product: 'pro00105', new_price: 10000, type: 1 },{ barcode: '0989070707786', id_product: 'pro002', id_sub_product: 'pro00201', new_price: 20000, type: 2 }] this.vhQuerySales.addPromotion_Promotiondetail(promotion, promotion_details) .then((bill:any)=>{ console.log(bill._id); },(error:any)=>{ console.log('error ', error); }) * @param promotion * @param promotion_details * Promise Object => obj = {} * 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 */ addPromotion_Promotiondetail(promotion: any, promotion_details: any): any; /** * @example: * this.vhQuerySales.updatePromotion_Promotiondetail('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePromotion_Promotiondetail', bool); }, error=>{ console.log('error', error); }) * @param id_promotion * @param promotion * @param promotion_details * @return Promise => bool = true or false */ updatePromotion_Promotiondetail(id_promotion: any, promotion: any, promotion_details: any): any; /** * @example: * this.vhQuerySales.deletePromotion_Promotiondetail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePromotion_Promotiondetail', bool); }) * @param id_promotion * @return Promise => bool = true or false */ deletePromotion_Promotiondetail(id_promotion: any): Promise; /** * @example * this.vhQuerySales.getPromotion_details_byId_promotion() .then((promotion_details)=>{ console.log('promotion_details', promotion_details); }) * @return array(object) = [{},{},..] */ getPromotion_details_byId_promotion(id_promotion: any): Promise; /** * * @param starttime * @param endtime * @param array_IDproduct * @return Promise Array => array.length == 0 hợp lệ, được phép tạo promotion; array.length > 0 không hợp lệ, không được phép tạo promotion */ checkNewPromotion(starttime: any, endtime: any, array_IDproduct: any): Promise; /** * * @param starttime * @param endtime * @param array_IDproduct * @param id_promotion * @return Promise Array => array.length == 0 hợp lệ, được phép cập nhật promotion; array.length > 0 không hợp lệ, không được phép cập nhật promotion */ checkOldPromotion(starttime: any, endtime: any, array_IDproduct: any, id_promotion: any): Promise; private publishObservableEventAppSettingNameStations; private observableLocalAppSettingNameStations; /** * Các hàm AppSettingNameStations thêm, xóa, sửa thông tin (dạng object) riêng giữa các thiết bi, như: thông tin máy in * @example: * this.observableAppSetting = this.vhQuerySales.getObservableLocalAppSettingNameStations().subscribe(() => { let info_header_footer_bill = this.vhQuerySales.getLocalAppSettingNameStation('info_header_footer_bill'); console.log(info_header_footer_bill); }) ngOnDestroy(){ this.observableAppSetting.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameStations(): Observable; /** *@example: this.vhQuerySales.getLocalAppSettingNameStations() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameStations(): any[]; /** * @example: let appsetting = this.vhQuerySales.getLocalAppSettingNameStation('info_header_footer_bill'); //printer_config_selling_page console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameStation(appsetting_name: any): any; /** * @example: * let appsetting = this.vhQuerySales.getLocalAppSettingStation('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingStation; /** * Hàm này refresh giá trị mới nhất cho hàm getLocalAppSettingNameStations(), getLocalAppSettingNameStation() trong localstorage * @return Promise => null */ refreshLocalAppSettingNameStations(): any; /** * @example * this.vhQuerySales.getAppSettingStations() .then((settings)=>{ console.log('getAppSettings', settings); }) * @return Promise => array(object) = [{},{},..] */ private getAppSettingStations; /** * @example: this.vhQuerySales.updateAppSettingNameStation('info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameStation(appsetting_name: any, value: any): Promise; /** * @example * this.vhQuerySales.deleteAppSettingNameStation('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameStation(appsetting_name: any): Promise; private publishObservableEventAppSettingNameBranchs; private observableLocalAppSettingNameBranchs; /** * 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 * @example: * this.observableAppSettingName = this.vhQuerySales.getObservableLocalAppSettingNameBranchs().subscribe(() => { let store_info = this.vhQuerySales.getLocalAppSettingNameBranch('store_info'); console.log(store_info); }) ngOnDestroy(){ this.observableAppSettingName.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameBranchs(): Observable; /** *@example: this.vhQuerySales.getLocalAppSettingNameBranchs() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameBranchs(): any[]; /** * @example: let appsetting = this.vhQuerySales.getLocalAppSettingNameBranch('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameBranch(appsetting_name: any): any; /** * @example: * let appsetting = this.vhQuerySales.getLocalAppSettingBranch('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingBranch; /** * @example: this.vhQuerySales.updateAppSettingNameBranch('permission_branch',{display_promotion_selling_price:true}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameBranch(appsetting_name: any, value: any): Promise; /** * @example * this.vhQuerySales.deleteAppSettingNameBranch('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameBranch(appsetting_name: any): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC (layer 1) -> Chọn TẤT CẢ hoặc MỘT danh mục * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Categorys_byCategorys(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDcategory = 'all' or id_category * @param IDbranch : 'all' or id_branch * @param type = 2 là dịch vụ, = 3 là sản phẩm, giá trị khác là cả hai * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, id_category, quantity, sales_btax, sales_atax} */ getReportSales_Categorys_byCategorys(starttime: any, endtime: any, IDcategory: any, type?: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC (layer 2) -> Chọn TẤT CẢ hoặc MỘT sản phẩm -> Chọn một danh mục trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Categorys_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_category * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_product, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Categorys_byProducts(starttime: any, endtime: any, id_category: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ DANH MỤC (layer 3) -> Chọn TẤT CẢ hoặc MỘT danh mục -> Chọn một danh mục trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Categorys_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Categorys_byProduct(starttime: any, endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ SẢN PHẨM & DỊCH VỤ (layer 1) -> Chọn TẤT CẢ hoặc MỘT sản phẩm, dịch vụ * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Products_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all'/id_subproduct/id_product * @param type = 3 là sản phẩm, = 2 là dịch vụ, = 23 là sản phẩm và dịch vụ * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Products_byProducts(starttime: any, endtime: any, IDsub_or_product: any, type: number, IDbranch?: string): Promise; /** * VhQuerySales * @Usage Hàm này dùng trong page DOANH SỐ SẢN PHẨM (layer 2) -> Chọn TẤT CẢ hoặc MỘT sản phẩm -> Chọn MỘT sản phẩm trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Products_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_sub_or_product : id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Products_byProduct(starttime: any, endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * VhQuerySales * @Usage Hàm này dùng trong page DOANH SỐ COMBO (layer 1) -> Chọn TẤT CẢ hoặc MỘT combo * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Combos_byProducts(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDproduct : 'all'/id_product (của combo) * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Combos_byProducts(starttime: any, endtime: any, IDproduct: any, IDbranch?: string): Promise; /** * VhQuerySales * @Usage Hàm này dùng trong page DOANH SỐ COMBO (layer 2) -> Chọn TẤT CẢ hoặc MỘT combo -> Chọn MỘT combo trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Combos_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Combos_byProduct(starttime: any, endtime: any, id_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ VOUCHER (layer 1) -> Chọn TẤT CẢ hoặc MỘT voucher * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Vouchers_byVouchers(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDvoucher : 'all'/id_voucher * @param vtype = 1 là voucher * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_Vouchers_byVouchers(starttime: any, endtime: any, IDvoucher: any, vtype: number, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ PAYMENT_CARD (layer 1) -> Chọn TẤT CẢ hoặc MỘT payment_card * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_PaymentCards_byPaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDpayment_card : 'all'/id_payment_card * @param pctype = 1 là payment_card * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, quantity, sales_btax, sales_atax} */ getReportSales_PaymentCards_byPaymentCards(starttime: any, endtime: any, IDpayment_card: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ VOUCHER (layer 2) -> Chọn TẤT CẢ hoặc MỘT voucher -> Chọn MỘT sản phẩm trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Vouchers_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_voucher * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_Vouchers_byVoucher(starttime: any, endtime: any, id_voucher: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ PAYMENT_CARD (layer 2) -> Chọn TẤT CẢ hoặc MỘT payment_card -> Chọn MỘT payment_card trong list * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_PaymentCards_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_payment_card * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman} */ getReportSales_PaymentCards_byPaymentCard(starttime: any, endtime: any, id_payment_card: any, IDbranch?: string): Promise; /** * @Usage : Hàm này lấy về tiền chiết khấu trên tổng giá trị hàng hóa bán ra của mỗi đơn hàng theo khách mua hàng * @example : * let discount = this.vhQuerySales.getDiscount_bill_byCustomer(43000000, '7YLcm0cFKLu2KaQQ8cyv'); * @param total_price : Tổng giá * @param id_customer * @returns Object or null => obj = {discount}, discount là số tiền đc chiết khấu, * trả về null nghĩa là khách hàng này không có chiết khấu theo hóa đơn */ getDiscount_bill_byCustomer(total_price: number, id_customer: any): { discount: number; } | null; /** * @Usage :Hàm này dùng trong page CHIẾT KHẤU KHÁCH HÀNG -> Chọn TẤT CẢ hoặc MỘT khách hàng * @notice : Mỗi công thức chiết khấu có 5 mức (level1, level2, level3, level4, level5), giá trị doanh số (sales) level sau phải lơn hơn level trước * type : 1 chiết khấu %, 2 chiết khấu tiền * method : 1 phương pháp tính theo từng mức, 2 phương pháp tính theo mức cuối * usage: 1 chiết khấu trên hóa đơn, 2 chiết khấu trên doanh số * @example : * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportDiscount_sales_Customers(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((discounts)=>{ console.log('discounts', discounts); console.log('discounts.docs[0]', discounts.docs[0]); }) * @param starttime * @param endtime * @param IDcustomer : 'all' or id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, discount_name,sales_btax, discount_btax, sales_atax, discount_atax} */ getReportDiscount_sales_Customers(starttime: any, endtime: any, IDcustomer: any, IDbranch?: string): Promise; /** * @Usage :Hàm này dùng trong page HOA HỒNG hạng NHÂN VIÊN -> Chọn TẤT CẢ hoặc MỘT nhân viên * @notice : Mỗi công thức chiết khấu có 5 mức (level1, level2, level3, level4, level5), giá trị doanh số (sales) level sau phải lơn hơn level trước * type : 1 chiết khấu %, 2 chiết khấu tiền * method : 1 phương pháp tính theo từng mức, 2 phương pháp tính theo mức cuối * @example : * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportCommission_Employees(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((commissions)=>{ console.log('commissions', commissions); console.log('commissions.docs[0]', commissions.docs[0]); }) * @param starttime * @param endtime * @param IDemployee : 'all' or id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, commission_name, sales_btax, commission_btax, sales_atax, commission_atax} */ getReportCommission_Employees(starttime: any, endtime: any, IDemployee: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 1) -> Chọn TẤT CẢ hoặc MỘT khách hàng * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Customers_byCustomers(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDcustomer : 'all' or id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, id_customer, quantity, sales_btax, sales_atax} */ getReportSales_Customers_byCustomers(starttime: any, endtime: any, IDcustomer: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 2) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Customers_byProducts_Vouchers_PaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, ptype, hoặc id_voucher, vtype, hoặc id_payment_card, pctype, index, name, barcode, unit, img, id_customer, quantity, sales_btax, sales_atax} */ getReportSales_Customers_byProducts_Vouchers_PaymentCards(starttime: any, endtime: any, id_customer: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một voucher trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Customers_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_voucher: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_voucher, vtype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Customers_byVoucher(starttime: any, endtime: any, id_customer: string, id_voucher: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một payment_card trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Customers_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_payment_card: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_payment_card, pctype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Customers_byPaymentCard(starttime: any, endtime: any, id_customer: string, id_payment_card: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong phân tích số liệu từ doanh số bán hàng trên mỗi sàn TMĐT 3 THÁNG, 3 TUẦN gần nhất * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Customers_byProducts_Analytics(starttime, endtime, '9879657432', 'shopee', '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_shop * @param ecommerce: 'shopee'/'lazada'/'tiki'/'sendo' * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, id_product, name, barcode, unit, img, id_customer, quantity, sales_btax, sales_atax} */ getReportSales_Customers_byProducts_Analytics(starttime: any, endtime: any, id_customer: string, id_shop: string, ecommerce: string, IDbranch: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ KHÁCH HÀNG (layer 3) -> Chọn TẤT CẢ hoặc MỘT khách hàng -> Chọn một khách hàng trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Customers_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_customer * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, barcode, unit, img, date, quantity, price, tax, id_bill, id_product, salesman, customer} */ getReportSales_Customers_byProduct(starttime: any, endtime: any, id_customer: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 1) -> Chọn TẤT CẢ hoặc MỘT nhân viên * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Employees_byEmployees(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param IDemployee = 'all' or id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={index, name, img, id_employee, quantity, sales_btax, sales_atax} */ getReportSales_Employees_byEmployees(starttime: any, endtime: any, IDemployee: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 2) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra * Hàm đã bao gồm doanh số bán voucher và payment_card * @example * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Employees_byProducts_Vouchers_PaymentCards(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, ptype, hoặc id_voucher, vtype, hoặc id_payment_card, pctype, index, name, barcode, unit, img, id_employee, quantity, sales_btax, sales_atax} */ getReportSales_Employees_byProducts_Vouchers_PaymentCards(starttime: any, endtime: any, id_employee: any, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 3) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra -> Chọn một sản phẩm trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Employees_byProduct(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param id_sub_or_product : id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_product, type, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Employees_byProduct(starttime: any, endtime: any, id_employee: string, id_sub_or_product: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 3) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra -> Chọn một voucher trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Employees_byVoucher(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param id_voucher: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_voucher, vtype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Employees_byVoucher(starttime: any, endtime: any, id_employee: string, id_voucher: string, IDbranch?: string): Promise; /** * @Usage Hàm này dùng trong page DOANH SỐ NHÂN VIÊN (layer 3) -> Chọn TẤT CẢ hoặc MỘT nhân viên -> Chọn một nhân viên trong list hiện ra -> Chọn một payment_card trong list tiếp theo hiện ra * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_Employees_byPaymentCard(starttime, endtime, '7YLcm0cFKLu2KaQQ8cyv') .then((reportsales)=>{ console.log('reportsales', reportsales); console.log('reportsales.docs[0]', reportsales.docs[0]); }) * @param starttime * @param endtime * @param id_employee * @param id_payment_card: * @param IDbranch : 'all' or id_branch * @return Promise JSON(array) => json.docs = [obj, obj, obj....]; obj ={id_payment_card, pctype, index, name, barcode, unit, img, date, quantity, price, tax, id_bill, salesman, customer} */ getReportSales_Employees_byPaymentCard(starttime: any, endtime: any, id_employee: string, id_payment_card: string, IDbranch?: string): Promise; /** * VhQuerySales: đã check * Hàm này dùng trong page XUẤT-NHẬP-TRẢ -> tất cả các trường hợp * @example: * let starttime = new Date('2020-12-10T05:24:00'); let endtime = new Date(); this.vhQuerySales.getReportInputOutputReturns_byTime_byIDProduct_byBillTypeArray(starttime, endtime, 'all', 1, [1]) .then((products)=>{ console.log('products', products); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all' or id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @param ptype * @param array_bill_type * @return Promise Array * @Notice id_product = 'all' or id_product; ptype = 3(product) or 2(service); array_bill_type = [bill_type]; [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportInputOutputReturns_byTime_byIDProduct_byBillTypeArray(starttime: any, endtime: any, IDsub_or_product: string, ptype: any, array_bill_type: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TRẢ -> tất cả các trường hợp -> chi tiết * @example: * this.vhQuerySales.getReportInputOutputReturns_Detail_byTime_byIDProduct_byBillTypeArray(time['startTime'], time['endTime'], 'UTWXdaU3UDq3xq7aK77p', [1]) .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param id_sub_or_product :id_subproduct or id_product * @param array_bill_type * @param IDbranch * @return Promise Array * @Notice array_bill_type = [bill_type]; [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportInputOutputReturns_Detail_byTime_byIDProduct_byBillTypeArray(starttime: any, endtime: any, id_sub_or_product: any, array_bill_type: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN -> Xuất nhập tồn * @example: * this.vhQuerySales.getReportInputOutputInventory_byTime_byIDProduct(starttime , endtime, 'all', 'tj1iYodbVoShwtEetACx') .then((json)=>{ console.log('json', json); }) * @param starttime * @param endtime * @param IDsub_or_product: 'all' or id_subproduct or id_product; * @param IDbranch: 'all' or id_branch; * @return Promise Array * * @Notice bill_type = [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportInputOutputInventory_byTime_byIDProduct(starttime: any, endtime: any, IDsub_or_product: any, IDbranch: any): Promise; private makeCorrectStock1stDayOfMonth; /** * 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 đó * @example: * this.vhQuerySales.getReportInputOutputInventory_byEndTime_byIDProduct_allRecords(endtime, 'all') .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param IDproduct : 'all' or id_product * @param IDbranch : 'all' or id_branch * @return Promise Array * @Notice id_product = 'all' or id_product; * @Notice bill_type = [1,10,15,30,2,3,9,31] */ private getReportInputOutputInventory_byEndTime_byIDProduct_allRecords; /** * 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 đó * @example: * this.vhQuerySales.getReportInputOutputInventory_byEndTime_byIDProduct(endtime, IDsub_or_product, IDbranch) .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all' or id_subproduct or id_product * @param IDbranch : 'all' or id_branch * @return Promise Array * @Notice bill_type = [1,10,15,30,2,3,9,31] */ getReportInputOutputInventory_byEndTime_byIDProduct(endtime: any, IDsub_or_product: any, IDbranch: string): Promise; /** * Hàm này kiểm tra các detailproducts (type=3) nào đã thỏa mãn 60days mà chưa có ký sinh inventory trong sản phẩm thì sẽ gọi hàm * syncInventoryEveryDay_Stock1stDayOfMonth để tính lại * @example: * this.vhQuerySales.checkAndsyncInventoryOfProducts(endtime, 'all') .then(()=>{ }) */ private checkAndsyncInventoryOfProducts; /** * 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 đó -> chi tiết của một sản phẩm nào đó * Lấy về chi tiết xuất nhập của 1 sản phẩm nào đó trong từ 0h ngày 1 đến thời điểm endtime * @example: * this.vhQuerySales.getReportInputOutputInventory_Detail_byEndTime_byIDProduct(endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param id_sub_or_product * @param IDbranch : 'all' or id_branch * @Notice bill_type = [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportInputOutputInventory_Detail_byEndTime_byIDProduct(endtime: any, id_sub_or_product: any, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN -> Xuất nhập tồn -> chi tiết * @example: * this.vhQuerySales.getReportInputOutputInventory_Detail_byTime_byIDProduct(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param id_sub_or_product * @param IDbranch * @Notice bill_type = [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportInputOutputInventory_Detail_byTime_byIDProduct(starttime: any, endtime: any, id_sub_or_product: string, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN -> Xuất nhập hàng * @example: * this.vhQuerySales.getReportInputOutput_byTime_byIDProduct(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param IDsub_or_product : 'all' or id_subproduct or id_product; * @param IDbranch * @return Promise Array * @Notice id_product = 'all' or id_product; * @Notice IDbranch = 'all' or id_branch; * @Notice bill_type = [1,10,15,38,41,51,2,3,39] //xem có đưa 9 vào ko */ getReportInputOutput_byTime_byIDProduct(starttime: any, endtime: any, IDsub_or_product: string, IDbranch?: string): Promise; /** * Hàm này dùng trong page XUẤT-NHẬP-TỒN -> Xuất nhập hàng -> chi tiết * @example: * this.vhQuerySales.getReportInputOutput_Detail_byTime_byIDProduct(starttime , endtime, 'UTWXdaU3UDq3xq7aK77p') .then((bill_details:any)=>{ console.log('bill_details', bill_details); }) * @param starttime * @param endtime * @param id_sub_or_product: id_subproduct or id_product * @param IDbranch: 'all' or id_branch; * @Notice bill_type = [1,10,15,38,41,51,2,3,9,39] */ getReportInputOutput_Detail_byTime_byIDProduct(starttime: any, endtime: any, id_sub_or_product: string, IDbranch?: string): Promise; /** * Hàm này dùng trong page LỢI NHUẬN HÀNG HÓA * @example: * this.vhQuerySales.getReportProfit_byTime_byIDProduct(starttime , endtime, 'all', 'tj1iYodbVoShwtEetACx') .then((json)=>{ console.log('json', json); }) * @param starttime * @param endtime * @param IDsub_or_product: 'all' or id_subproduct or id_product; * @param IDbranch: 'all' or id_branch; * @return Promise Array * * @Notice bill_type = [1,10,15,30,38,41,51,2,3,9,31,39] */ getReportProfit_byTime_byIDProduct(starttime: any, endtime: any, IDsub_or_product: any, IDbranch: any): Promise; syncInventoryEveryDay_StockBeginning(): Promise; /** * 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: * + 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 * + Nếu sản phẩm mới thêm vào thì hàm sẽ tính * vhQuerySales * @returns */ private syncInventoryEveryDay_Stock1stDayOfMonth; private syncInventoryEveryDay_Stock1stDayOfMonth_old; /** * this.vhQuerySales.xoaduthuatronglots() .then((bool:any)=>{ console.log('xoaduthuatronglots', bool); },(error:any)=>{ console.log(error); }) */ xoaduthuatronglots(): Promise; /** * this.vhQuerySales.xoainventory30to60() .then((bool:any)=>{ console.log('xoainventory30to60', bool); },(error:any)=>{ console.log(error); }) */ xoainventory30to60(): Promise; /** * Trong quá trình THÊM-XÓA-SỬA có thể xảy ra lỗi bill, bill_detail * Hàm này giúp đồng bộ lại dữ liệu và sửa các bill, bill_detail bị lỗi đó * @example: * this.vhQuerySales.makeCorrectQuantityProducts_byShop() .then((bool:any)=>{ console.log('makeCorrectQuantityProducts_byShop', bool); },(error:any)=>{ console.log(error); }) * @returns */ makeCorrectQuantityProducts_byShop(): Promise; private only_onetimes_writeerrorlog; private writeLog_ErrorOfFunction; /** * Hàm này dùng động bộ dữ liệu theo thuật toán 60day * @example: * this.vhQuerySales.makeCorrectQuantityProducts_60days() .then((json)=>{ console.log('json', json); }) * @param starttime * @param endtime * @param IDproduct: 'all' or id_product; * @param IDbranch: 'all' or id_branch; * @return Promise Array * * @Notice bill_type = [1,10,15,30,2,3,9,31] */ makeCorrectQuantityProducts_60days(): Promise; /** * @example: * this.vhQuerySales.makeCorrectQuantityProducts() .then((bool:any)=>{ console.log('makeCorrectQuantityProducts', bool); }) * @returns */ makeCorrectQuantityProducts(): Promise; private makeCorrectQuantityProductsManyBranch; /** * VhQuerySales * lấy về danh sách sản phẩm sắp hết hàng theo chi nhánh * @example: * this.vhQuerySales.getReportProducts_byLowInStock() .then((products)=>{ console.log(products); }) * @param id_branch */ getReportProducts_byLowInStock(id_branch: any): Promise; /** * VhQuerySales: * lấy về danh sách sản phẩm đã hết hàng theo chi nhánh * @example: * this.vhQuerySales.getReportProducts_byOutOfStock() .then((products)=>{ console.log(products); }) * @param id_branch */ getReportProducts_byOutOfStock(id_branch: string): Promise; /** * VhQuerySales: đã check * @example: * let hour_array: Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportRevenue_byHoursOut_hourArray(starttime, endtime, hour_array) .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportRevenue_byHoursOut_hourArray(starttime: any, endtime: any, hour_array: any, IDbranch?: string): Promise; /** * VhQuerySales: đã check * @example: * let day_array: Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportRevenue_byDaysOut_dayArray(starttime, endtime, day_array) .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param day_array * @param IDbranch : 'all' or id_branch * @notice Doanh thu thì ko có thuế */ getReportRevenue_byDaysOut_dayArray(starttime: any, endtime: any, day_array: any, IDbranch?: string): Promise; /** * VhQuerySales: đã check * @example: * let month_array: Array = [0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportRevenue_byMonthsOut_monthArray(starttime, endtime, month_array) .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param month_array * @param IDbranch : 'all' or id_branch */ getReportRevenue_byMonthsOut_monthArray(starttime: any, endtime: any, month_array: any, IDbranch?: string): Promise; /** * lấy về mảng json.docs(array) doanh thu theo một hoặc tất cả các chi nhánh * @example: this.vhQuerySales.getReportRevenue_byIDbranch(starttime, endtime, 'dfs3fw3tr3g2a1rgmfg2h1') .then((reportRevenue)=>{ console.log('reportRevenue', reportRevenue); console.log('reportRevenue.docs[0]', reportRevenue.docs[0]); }) * @param starttime * @param endtime * @param IDbranch : 'all' or id_branch * @return : * json = {docs(array), empty(boolean), size(number), revenue(number)} * trong đó docs = [{name(string), id_branch(string), revenue(number)}] */ getReportRevenue_byIDbranch(starttime: any, endtime: any, IDbranch?: string): Promise; /** * Báo cáo doanh số giờ * @example: * let hour_array: Array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_byHoursOut_hourArray(starttime, endtime, hour_array) .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportSales_byHoursOut_hourArray(starttime: any, endtime: any, hour_array: any, IDbranch?: string): Promise; /** * Báo cáo doanh số ngày * @example: * let day_array: Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_byDaysOut_dayArray(starttime, endtime, day_array) .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportSales_byDaysOut_dayArray(starttime: any, endtime: any, day_array: any, IDbranch?: string): Promise; /** * Báo cáo doanh số tháng * lấy về mảng json.docs(array) doanh số theo 12 tháng trong năm * @example: * let month_array: Array = [0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportSales_byMonthsOut_monthArray(starttime, endtime, month_array) .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param hour_array * @param IDbranch : 'all' or id_branch */ getReportSales_byMonthsOut_monthArray(starttime: any, endtime: any, month_array: any, IDbranch?: string): Promise; /** * Báo cáo doanh số chi nhánh, tất cả chi nhánh * lấy về mảng json.docs(array) doanh số theo một hoặc tất cả các chi nhánh * @example: this.vhQuerySales.getReportSales_byIDbranch(starttime, endtime, 'fda3s2fd1a3sgghdfg1h') .then((reportSales)=>{ console.log('reportSales', reportSales); console.log('reportSales.docs[0]', reportSales.docs[0]); }) * @param starttime * @param endtime * @param IDbranch : 'all' or id_branch * @return : * json = {docs(array), empty(boolean), size(number), sales_btax(number), sales_atax(number)} * trong đó docs = [{name(string), id_branch(string), sales_btax(number), sales_atax(number)}] */ getReportSales_byIDbranch(starttime: any, endtime: any, IDbranch?: string): Promise; /** * VhQuerySales: đã check * cashbook_first: tiền mặt đầu kỳ (starttime), * income: tiền thu trong kỳ * expenditure: tiền chi trong kỳ * cashbook_last: tiền mặt cuối kỳ (endtime) * IDwallet = 'all' hoặc id_wallet của ví nào đó * @param IDbranch : 'all' or id_branch * @notice : ở giao diện APP, chọn IDbranch rồi mới hiện ra những IDwallet của chi nhánh đó để chọn tiếp. Nếu IDbranch = 'all' thì IDwallet phải là 'all' */ getReportCashBook(starttime: any, endtime: any, IDwallet: any, IDbranch?: any): Promise; /** * VhQuerySales: * @param starttime * @param endtime * @param IDwallet * @param IDbranch * @returns */ private getReportCashBook_old; /** * VhQuerySales: * @param id_branch * @returns */ private syncCashBook; /** * VhQuerySales: * Hàm này chỉ chạy trên giao diện Desktop * @returns Promise */ private syncCashBookEveryDay_Stock1stDayOfMonth; /** * Sales: * @example: * let DayArray = this.get1stDayOfMonthArray(store.registrationdate, serverdate); * @param startdate * @param enddate * @returns */ private get1stDayOfMonthArray; /** * Hàm này kiểm tra ngày tạo bill, sửa bill đã chọn có hợp lệ không * Ngày hợp lệ phải thỏa mãn: * 1. phải sau ngày cửa hàng đăng ký sử dụng phần mềm sales viethas * 2. thuộc tháng mà trước tháng hiện tại 1 tháng * @example: * this.vhQuerySales.getValidityDate('2021-06-18T16:27:16.276Z') .then((validitydate)=>{ if(validitydate) console.log('Bạn chỉ có thể tạo/chỉnh sửa hóa đơn này từ ngày', validitydate); }) * @param date (String or Date): ngày tạo bill, sửa bill * @returns Promise => validitydate = null nếu hợp lệ; validitydate != null nếu không hợp lệ, và từ ngày validitydate trở đi là có thể tạo bill và sửa bill */ getValidityDate(date: any): Promise; /** * Nhật ký thu chi * @param starttime * @param endtime * @param id_wallet là 'all' hoặc id của ví nào đó * @param id_employee là 'all' hoặc id của thu ngân nào đó * @param array_bill_type * @param IDbranch : 'all' or id_branch * array_bill_type (all) = [1,7,10,11,15,34,40,50,2,3,8,12,33]; thu:1,7,10,11,15,34,40,50 - chi: 2,3,8,12,33 * */ getReportIncomeExpenditureDiary(starttime: any, endtime: any, id_wallet: any, id_employee: any, array_bill_type: any, IDbranch?: string): Promise; /** * @example: * let endtime = new Date(); * let starttime = new Date('2020-07-01T05:24:00'); * this.vhQuerySales.getDebtSuppliers(starttime, endtime, 'yewwg44667njdt443s', 'gtrtyery56646577456') .then((debts)=>{ console.log('getDebtSuppliers', debts); }) * @param starttime * @param endtime * @param IDsuppiler: id_supplier hoặc 'all' * @param IDbranch: id_branch hoặc 'all' * @return JSON(Array) => json.docs = [{id, name, index, debt, payment, rest,...},{},....] * Lưu ý: giá trị này trả về dạng array */ getDebtSuppliers(starttime: any, endtime: any, IDsuppiler: string, IDbranch?: string): Promise; /** * CÔNG NỢ KHÁCH HÀNG * @example: * let endtime = new Date(); * let starttime = new Date('2020-07-01T05:24:00'); * this.vhQuerySales.getDebtCustomers('gtrtyery56646577456') .then((debts)=>{ console.log('getDebtCustomers', debts); }) * @param IDbranch: id_branch hoặc 'all' * @return JSON(Array) => json.docs = [{id, name, index, debt, payment, rest,...},{},....] * Lưu ý: giá trị này trả về dạng array */ private getDebtCustomers_danglam; /** * CÔNG NỢ KHÁCH HÀNG * @example: * let endtime = new Date(); * let starttime = new Date('2020-07-01T05:24:00'); * this.vhQuerySales.getDebtCustomers(starttime, endtime, 'yewwg44667njdt443s', 'gtrtyery56646577456') .then((debts)=>{ console.log('getDebtCustomers', debts); }) * @param starttime * @param endtime * @param id_customer: id_customer * @param IDbranch: id_branch hoặc 'all' * @return JSON(Array) => json.docs = [{id, name, index, debt, payment, rest,...},{},....] * Lưu ý: giá trị này trả về dạng array */ private getDebtCustomer_byTime; /** * CÔNG NỢ KHÁCH HÀNG * @example: * let endtime = new Date(); * let starttime = new Date('2020-07-01T05:24:00'); * this.vhQuerySales.getDebtCustomers(starttime, endtime, 'yewwg44667njdt443s', 'gtrtyery56646577456') .then((debts)=>{ console.log('getDebtCustomers', debts); }) * @param starttime * @param endtime * @param IDcustomer: id_customer hoặc 'all' * @param IDbranch: id_branch hoặc 'all' * @return JSON(Array) => json.docs = [{id, name, index, debt, payment, rest,...},{},....] * Lưu ý: giá trị này trả về dạng array */ getDebtCustomers(starttime: any, endtime: any, IDcustomer: string, IDbranch?: string): Promise; /** * lấy về 1 bảng báo cáo kiểm kho (report) theo cấu trúc json ở dưới, nếu có cân bằng kho thì lấy về chung luôn * @example: * this.vhQuerySales.getReportInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((reports)=>{ console.log('getReportInventoryTime_byTimes',reports); }) * @param id_inventorytime * @return Promise json = {docs(array), empty(boolean), size(number), total_stock(number), realstock, total_inventorynotes(array)} * docs(array) --> {id_product(string), id_subproduct(string), lots(array), name(string), img(string), ratio(number), barcode(string), unit(string), stock(number), inventorynotes(array), deviation(number), note(string), balance_quantity(number), balance_cause(string)} * inventorynotes(array) --> [{bill_code(string), quantity(number)},{},...] */ getReportInventoryTime_byTimes(id_inventorytime: any): Promise; /** * Tạo cân bằng kho * @example: * this.vhQuerySales.createBalanceInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((bool:any)=>{ console.log('createBalanceInventoryTime_byTimes',bool); }) * @param id_inventorytime * @return Promise boolean => true or false */ createBalanceInventoryTime_byTimes(id_inventorytime: any): Promise; /** * Xóa cân bằng kho * @example: * this.vhQuerySales.deleteBalanceInventoryTime_byTimes('hNCda0obCvrX6qC3PZ0N') .then((bool:any)=>{ console.log('deleteBalanceInventoryTime_byTimes',bool); }) * @param id_inventorytime * @return Promise boolean => true or false */ deleteBalanceInventoryTime_byTimes(id_inventorytime: any): Promise; private getBeginningInventory; private getReportProducts_by3Time; /** * @example: * let endtime = new Date(); let starttime = new Date('2020-07-01T05:24:00'); this.vhQuerySales.getReportProduct_byID(starttime, endtime, 'pro002') .then((reportReports)=>{ console.log('reportReports', reportReports); console.log('reportReports.docs[0].data()', reportReports.docs[0].data()); }) * @param starttime * @param endtime * @param id_product */ getReportProduct_byID(starttime: any, endtime: any, id_product: any): Promise; /***************************************************************************************************** ******************************* CHƯƠNG TRÌNH BÁN HÀNG SALES VIETHAS *********************************************** *****************************************************************************************************/ /******************************************TÍCH ĐIỂM THEO HÓA ĐƠN*************************************/ /** * @example: * let data ={ name : 'chương trình tích điểm hóa đơn', exchange :{ money : 100000, points : 1 }, bill_total_minimum :0, payment :{ enable : true, money : 100000, points : 1 }, include_discount: false, include_promotion_product : false, include_paid_points : false, include_tax : false, include_fee : false, //id_branch : '5fb6780ca2148e09806c5b01', //trong hàm đã thêm vào earned_points_clear_auto:{ enable, months_of_year: 1 } } this.vhQuerySales.addEarningPointsBill(data) .then((earningpoint)=>{ console.log('addEarningPointsBill', earningpoint); },(error:any)=>{ console.log('error', error); }) * @param data * @return Promise => obj = {} */ addEarningPointsBill(data: any): Promise; /** * @example: let data ={ name : 'chương trình tích điểm hóa đơn', exchange :{ money : 100000, points : 1 }, bill_total_minimum :0, payment :{ enable : true, money : 100000, points : 1 }, include_discount: false, include_promotion_product : false, include_paid_points : false, include_tax : false, include_fee : false, id_branch : '5fb6780ca2148e09806c5b01' } * @param id_earning_points_bill * @param data * @return Promise => bool = true or false */ updateEarningPointsBill(id_earning_points_bill: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteEarningPointsBill('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteEarningPointsBill', bool); }) * @param id_earning_points_bill * @return Promise => bool = true or false */ deleteEarningPointsBill(id_earning_points_bill: string): Promise; /** * @example * this.vhQuerySales.getEarningPointsBill('5fb67fda87c0f21d484cbdf3') .then((earning_points_bill)=>{ console.log('getEarningPointsBill', earning_points_bills); },(error:any)=>{ reject(error); }) * @param id_earning_points_bill * @return Promise => obj ={} or null */ getEarningPointsBill(id_earning_points_bill: string): Promise; /** * @example * this.vhQuerySales.getEarningPointsBills() .then((earning_points_bills)=>{ console.log('getEarningPointsBills', earning_points_bills); }) * @return Promise => array(object) = [{},{},..] */ getEarningPointsBills(): Promise; /** * @example: * let data ={ name : 'chương trình tích điểm sản phẩm', exchange :{ money : 100000, points : 1 }, payment :{ enable : true, money : 100000, points : 1 }, products:['05ztAR5h3UslYo70Amut','0S8NOcG8wEUYWVo1weHV','0tmbM5SyGe5O1mvuh61l',...], include_promotion_product : false, include_paid_points : false, //id_branch : '5fb6780ca2148e09806c5b01' //trong hàm đã thêm vào } this.vhQuerySales.addEarningPointsProduct(data) .then((res)=>{ console.log('addEarningPointsProduct', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addEarningPointsProduct(data: any): Promise; /** * @example: let data ={ name : 'chương trình tích điểm sản phẩm', exchange :{ money : 100000, points : 1 }, payment :{ enable : true, money : 100000, points : 1 }, include_promotion_product : false, include_paid_points : false, id_branch : '5fb6780ca2148e09806c5b01' } * this.vhQuerySales.updateEarningPointsProduct(id_earning_points_product,data) .then((bool:any)=>{ console.log('updateEarningPointsProduct', bool); }, error=>{ console.log('error', error); }) * @param id_earning_points_product * @param data * @return Promise => bool = true or false */ updateEarningPointsProduct(id_earning_points_product: any, data: any): Promise; /** * @example: * this.vhQuerySales.deleteEarningPointsProduct('654QFNMOIYUENC321') .then((bool:any)=>{ console.log('deleteEarningPointsProduct', bool); }, error=>{ console.log('error', error); }) * @param id_earning_points_product * @return Promise => bool = true or false */ deleteEarningPointsProduct(id_earning_points_product: any): Promise; /** * @example: * this.vhQuerySales.getEarningPointsProduct('654QFNMOIYUENC321') .then((res)=>{ console.log('getEarningPointsProduct', res); }, error=>{ console.log('error', error); }) * @param id_earning_points_product * @return Promise => object or null */ getEarningPointsProduct(id_earning_points_product: any): Promise; /** * @example: * this.vhQuerySales.getEarningPointsProducts() .then((arr)=>{ console.log('getEarningPointsProducts', arr); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getEarningPointsProducts(): Promise; /** * @example: * this.vhQuerySales.addEmployeeClass({name : "Gold"}) .then((res)=>{ console.log('addEmployeeClass', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addEmployeeClass(data: any): Promise; /** * @example: * this.vhQuerySales.updateEmployeeClass('KNOVIYWKN135468',{id_commission : "321SDWC65DWSVDFS"}) .then((bool:any)=>{ console.log('updateEmployeeClass', bool); }, error=>{ console.log('error', error); }) * @param id_employee_class * @param data * @return Promise => bool = true or false */ updateEmployeeClass(id_employee_class: any, data: any): Promise; /** * @example: * this.vhQuerySales.deleteEmployeeClass('KNOVIYWKN135468') .then((bool:any)=>{ console.log('deleteEmployeeClass', bool); }, error=>{ console.log('error', error); }) * @param id_employee_class * @return Promise => bool = true or false */ deleteEmployeeClass(id_employee_class: any): Promise; /** * @example: * this.vhQuerySales.getEmployeeClass('KNOVIYWKN135468') .then((res)=>{ console.log('getEmployeeClass', res); }, error=>{ console.log('error', error); }) * @param id_employee_class * @return Promise => object or null */ getEmployeeClass(id_employee_class: any): Promise; /** * @example: * this.vhQuerySales.getEmployeeClasss() .then((array:any)=>{ console.log('getEmployeeClasss', array); }, error=>{ console.log('error', error); }) * @param id_employee_class * @return Promise => Array */ getEmployeeClasss(): Promise; /** * trong local chưa có * @example: * let employee_classs = this.vhQuerySales.getlocalEmployeeClasss() * @param data * @return Array */ getlocalEmployeeClasss(): void; /** * trong local chưa có * @example: * let employee_class = this.vhQuerySales.getlocalEmployeeClass('321987965DOIUEHN') * @param id_employee_class * @return object or null */ getlocalEmployeeClass(id_customer_class: any): void; /** * @example: * let data = { * name:"Phiếu thanh toán 100k", * value : 100000, * point : 1000, * id_design_barcode : "", * //id_branch :" 316OIUHLKMLSDYW235" //trong hàm đã có thêm vào * } * this.vhQuerySales.addCoupon(data) .then((res)=>{ console.log('addCoupon', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addCoupon(data: any): Promise; /** * @example: * let data = { * name:"Phiếu thanh toán 100k", * value : 100000, * point : 1000, * id_design_barcode : "", * } * this.vhQuerySales.updateCoupon('FBHYWIBDNIUH1321687',data) .then((bool:any)=>{ console.log('updateCoupon', bool); }, error=>{ console.log('error', error); }) * @param data * @param id_coupon * @return Promise => bool = true or false */ updateCoupon(id_coupon: any, data: any): Promise; /** * @example: * this.vhQuerySales.deleteCoupon("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteCoupon', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_coupon * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do coupon đã được phát hành, vui lòng xóa đợt phát hành liên quan */ deleteCoupon(id_coupon: any): Promise; /** * @example: * * this.vhQuerySales.getCoupon('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getCoupon', res); }, error=>{ console.log('error', error); }) * @param id_coupon * @return Promise => object or null */ getCoupon(id_coupon: any): Promise; /** * @example: * this.vhQuerySales.getCoupons() .then((res)=>{ console.log('getCoupons', res); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getCoupons(): Promise; /** * @example: * this.vhQuerySales.addCouponRelease({name : "Đợt phát hành phiếu thanh toán 100k",id_branch :'OHFNEIOUH6549846'}) .then((res)=>{ console.log('addCouponRelease', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addCouponRelease(data: any): Promise; /** * @example: * this.vhQuerySales.updateCouponRelease('ANOFIEUPOIUJ49861',{name : "Đợt phát hành phiếu thanh toán 100k"}) .then((bool:any)=>{ console.log('updateCouponRelease', bool); }, error=>{ console.log('error', error); }) * @param data * @param id_coupon_release * @return Promise => bool = true or false */ updateCouponRelease(id_coupon_release: any, data: any): Promise; /** * @example: * this.vhQuerySales.deleteCouponRelease("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteCouponRelease', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_coupon_release * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có coupon cần phát hành, vui lòng xóa coupon khỏi đợt phát hành */ deleteCouponRelease(id_coupon_release: any): Promise; /** * @example: * * this.vhQuerySales.getCouponRelease('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getCouponRelease', res); }, error=>{ console.log('error', error); }) * @param id_coupon_release * @return Promise => object or null */ getCouponRelease(id_coupon_release: any): Promise; /** * @example: * * this.vhQuerySales.getCouponReleases() .then((arr)=>{ console.log('getCouponReleases', arr); }, error=>{ console.log('error', error); }) * @return Promise => Array< object > */ getCouponReleases(): Promise; /** * @example: let data = { id_coupon : "9841654DOIWSDYW235", id_coupon_release :" 316OIUHLKMLSDYW235" } this.vhQuerySales.addCouponReleaseDetail(data) .then((res)=>{ console.log('addCouponReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param data * @param id_coupon * @return Promise => bool = true or false */ addCouponReleaseDetail(data: any): Promise; /** * @example: * this.vhQuerySales.deleteCouponReleaseDetail("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteCouponReleaseDetail', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_coupon_release_detail * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do coupon_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng) */ deleteCouponReleaseDetail(id_coupon_release_detail: any): Promise; /** * @example: * * this.vhQuerySales.getCouponReleaseDetail('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getCouponReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param id_coupon_release_detail * @return Promise => object or null */ getCouponReleaseDetail(id_coupon_release_detail: any): Promise; /** * hàm này trả về những Coupon Release Detail của đợt coupon đó * @example: * this.vhQuerySales.getCouponRelaseDetail_byIdCouponRelease("9841654DOIWSDYW235") .then((array:any)=>{ console.log('getCouponRelaseDetail_byIdCouponRelease', array); }, error=>{ console.log('error', error); }) * @param id_coupon_release * @return Promise => Array = [{id_coupon_relase, id_coupon, coupon_name, coupon_value, coupon_code_numbers}] */ getCouponRelaseDetail_byIdCouponRelease(id_coupon_release: any): Promise; /** * hàm này để phát hành 1 coupon_code * @example: //truyền vào let data = { date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * this.vhQuerySales.createCouponCode(data) .then((coupon_code)=>{ console.log('createCouponCode', coupon_code); }, error=>{ console.log('error', error); }) //trả về let data = { _id:'9841654DOIWSDYW235' status: 1, id_branch, date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * @param data * @return Promise => Object */ private createCouponCode; /** * 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 * trong collection coupon_release_details * @example: //truyền vào let data = { date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * this.vhQuerySales.createCouponCodes(data, 10) .then((coupon_codes)=>{ console.log('createCouponCodes', coupon_codes); }, error=>{ console.log('error', error); }) //trả về let data = { _id:'9841654DOIWSDYW235' status: 1, id_branch, date_validity: new Date(), date_expire : new Date(), id_coupon_release_detail :"315KHIUHWNIUHCIYUW3187", id_coupon: '9841654DOIWSDYW235' } * @param data * @param quantity <=20 : Dev kiểm tra trường quantity nhập vào không được lớn hơn 20 * @return Promise => Array(object) */ createCouponCodes(data: any, quantity: number): Promise; /** * @example: * * this.vhQuerySales.updateCouponCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()}) .then((bool:any)=>{ console.log('updateCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_coupon_code * @param data * @return Promise => boolean = true or false */ updateCouponCode(id_coupon_code: any, data: any): Promise; /** * Hàm này chỉ cho phép xóa coupon_code đang ở trạng thái đã phát hành (status ==1), * và cập nhật giảm trường số lượng quantity_released bớt 1 trong collection coupon_release_details * @example: * this.vhQuerySales.deleteCouponCode('OUHEOIWUYGHIQNIDOUW1359478'}) .then((bool:any)=>{ console.log('deleteCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_coupon_code * @param id_coupon_release_detail * @return Promise => boolean = true or false */ deleteCouponCode(id_coupon_code: string, id_coupon_release_detail: string): Promise; /** * hàm này trả về danh sách coupon code đã phát hành theo mỗi đợt * @example: * * this.vhQuerySales.getCouponCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'}) .then((array:any)=>{ console.log('getCouponCodes_byIdCouponReleaseDetail', array); }, error=>{ console.log('error', error); }) * @param id_coupon_release_detail * @return Promise => Array */ getCouponCodes_byIdCouponReleaseDetail(id_coupon_release_detail: any): Promise; /** * hàm này trả về danh sách coupon code đã phát hành theo điều kiện query * @example: * this.vhQuerySales.getCouponCodes_byFields({status:{$eq: 1}}, {}, {}, 0) .then((res)=>{ console.log('getCouponCodes_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getCouponCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * hàm này trả về coupon_code đã phát hành theo trường _id của Coupon_code * @example: * * this.vhQuerySales.getCouponCode('OUHEDW0512'}) .then((res)=>{ console.log('getCouponCode', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCouponCode(id_coupon_code: any): Promise; /** * hàm này trả về coupon_code đã phát hành theo trường code của Coupon_code. * @example: * * this.vhQuerySales.getCouponCode('OUHEDW0512'}) .then((res)=>{ console.log('getCouponCode', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCouponCode_byCode(code: any): Promise; /** * hàm này trả về coupon_code đã phát hành theo trường _id của voucher_code. * @example: * * this.vhQuerySales.getCoupon_Code_Name_Release('OUHEDW0512'}) .then((res)=>{ console.log('getCoupon_Code_Name_Release', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCoupon_Code_Name_Release(id_coupon_code: any): Promise; /** * hàm này trả về coupon đã phát hành theo trường code của coupon_code. dùng trong thanh toán bằng phiếu, đổi điểm lấy coupon, * trả về có cả code, name_coupon, name_coupon_release * @example: * * this.vhQuerySales.getCoupon_Code_Name_Release_byCode('OUHEDW0512'}) .then((res)=>{ console.log('getCoupon_Code_Name_Release_byCode', res); }, error=>{ console.log('error', error); }) * @param id_coupon_code: cũng chính là code * @return Promise => obj ={} or null */ getCoupon_Code_Name_Release_byCode(code: any): Promise; /** * 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 * hàm này đã cập nhật lại trường status, id_customer, date_points_exchanged cho coupon_codes * hàm này đã cập nhật lại trường earned_points, id_customer, branch_earned_points cho customers * @example: * let array = [{id_coupon_code, points, value},{}...] * this.vhQuerySales.exchangeCouponCode_byEarningPoints([array,'1984QIHBSYGWDIOUHIQFE'], 'INBIFDYWUGUHNI65498', 1000}) .then((bool:any)=>{ console.log('exchangeCouponCode_byEarningPoints', bool); }, error=>{ console.log('error', error); }) * @param array_id_coupon_code_and_points_and_value : [{id_coupon_code, points, value}] * @param id_customer * @param total_points_exchanged: tổng điểm của các phiếu đã quy đổi * @return Promise => boolean = true or false */ exchangeCouponCode_byEarningPoints(array_id_coupon_code_and_points_and_value: any, id_customer: any, total_points_exchanged: any): Promise; /** * @example: * let data = { name : "Siêu khuyến mãi", id_design_barcode :"316OIUHLKMLSDYW235", products: [{ id_product : "NIDOUHWIOLDNOIU1142748", price : 1000000, quantity: 1, ptype: 1 }], point: 10, price_origin: 9300000, price: 9200000, id_branch: 4zFGhVUAZyj5d09r01xZ } * this.vhQuerySales.addVoucher(data) .then((res)=>{ console.log('addVoucher', res); }, error=>{ console.log('error', error); }) * @param data * @return object or error */ addVoucher(data: any): Promise; /** * @example: * let data = { point: 23, price_origin: 9400000, id_branch: 4zFGhVUAZyj5d09r01xZ } * this.vhQuerySales.updateVoucher("fuMS21I6othUm34385WV", data) .then((bool:any)=>{ console.log('updateVoucher', bool); }, error=>{ console.log('error', error); }) * @param id_voucher * @param data * @return Promise Boolean => true or false */ updateVoucher(id_voucher: any, data: any): Promise; /** * @example: * this.vhQuerySales.deleteVoucher("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteVoucher', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_voucher * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do voucher đã được phát hành, vui lòng xóa đợt phát hành liên quan */ deleteVoucher(id_voucher: any): Promise; /** * @example: * this.vhQuerySales.getVoucher(id_voucher) .then((res)=>{ console.log('addVoucher', res); }, error=>{ console.log('error', error); }) * @param id_voucher * @return Promise => object or null */ getVoucher(id_voucher: any): Promise; /** * @example: * this.vhQuerySales.getVouchers() .then((arr)=>{ console.log('getVouchers', arr); }, error=>{ console.log('error', error); }) * @return Promise => array(object) =[{},{},...] */ getVouchers(): Promise; /** * @example: * let data = { name : "Tháng 6 bùng nổ", id_branch: 4zFGhVUAZyj5d09r01xZ } * this.vhQuerySales.addVoucherRelease(data) .then((res)=>{ console.log('addVoucherRelease', res); }, error=>{ console.log('error', error); }) * @param data * @return object or error */ addVoucherRelease(data: any): Promise; /** * @example: * let data = { name : "Tháng 6 bùng nổ" } * this.vhQuerySales.updateVoucherRelease("fuMS21I6othUm34385WV", data) .then((bool:any)=>{ console.log('updateVoucherRelease', bool); }, error=>{ console.log('error', error); }) * @param id_voucher_release * @param data * @return Promise Boolean => true or false */ updateVoucherRelease(id_voucher_release: any, data: any): Promise; /** * @example: * this.vhQuerySales.deleteVoucherRelease("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteVoucherRelease', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_voucher_release * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có voucher cần phát hành, vui lòng xóa voucher khỏi đợt phát hành */ deleteVoucherRelease(id_voucher_release: any): Promise; /** * @example: * this.vhQuerySales.getVoucherRelease("fuMS21I6othUm34385WV") .then((res)=>{ console.log('getVoucherRelease', res); }, error=>{ console.log('error', error); }) * @param id_voucher_release * @return Promise => object or null */ getVoucherRelease(id_voucher_release: any): Promise; /** * @example: * this.vhQuerySales.getVoucherRelases() .then((res)=>{ console.log('getVoucherRelases', res); }, error=>{ console.log('error', error); }) * @return Promise => array(object) =[{},{},...] */ getVoucherRelases(): Promise; /** * @example: * let data = { id_voucher : "fuMS21I6othUm34385WV", id_voucher_release: "4zFGhVUAZyj5d09r01xZ" } * this.vhQuerySales.addVoucherReleaseDetail(data) .then((res)=>{ console.log('addVoucherReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param data * @return object or error */ addVoucherReleaseDetail(data: any): Promise; /** * @example: * this.vhQuerySales.deleteVoucherReleaseDetail("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deleteVoucherReleaseDetail', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_voucher_release_detail * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do voucher_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng) */ deleteVoucherReleaseDetail(id_voucher_release_detail: any): Promise; /** * @example: * this.vhQuerySales.getVoucherReleaseDetail("fuMS21I6othUm34385WV") .then((res)=>{ console.log('getVoucherReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param (id_voucher_release_detail) * @return Promise => object or null */ getVoucherReleaseDetail(id_voucher_release_detail: string): Promise; /** * @example: * this.vhQuerySales.getVoucherRelaseDetail_byFields({id_voucher:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0) .then((res)=>{ console.log('getVoucherRelaseDetail_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getVoucherRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * hàm này để phát hành 1 voucher_code * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_voucher_release_detail: "fuMS21I6othUm34385WV", id_voucher: '9841654DOIWSDYW235' } * this.vhQuerySales.createVoucherCode(data) .then((voucher_code)=>{ console.log('createVoucherCode', voucher_code); }, error=>{ console.log('error', error); }) * @param data * @return Promise => Object */ createVoucherCode(data: any): Promise; /** * 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 * trong collection voucher_release_details * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_voucher_release_detail: "fuMS21I6othUm34385WV", id_voucher: '9841654DOIWSDYW235' } * this.vhQuerySales.createVoucherCodes(data, 10) .then((voucher_codes)=>{ console.log('createVoucherCodes', voucher_codes); }, error=>{ console.log('error', error); }) * @param data * @param quantity * @return Promise => Array(object) */ createVoucherCodes(data: any, quantity: number): Promise; /** * @example: * * this.vhQuerySales.updateVoucherCode('OUHEOIWUYGHIQNIDOUW1359478',{date_expire : new Date()}) .then((bool:any)=>{ console.log('updateCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_voucher_code * @param data * @return Promise => boolean = true or false */ updateVoucherCode(id_voucher_code: any, data: any): Promise; /** * Hàm này chỉ cho phép xóa voucher_code đang ở trạng thái đã phát hành (status ==1), * và cập nhật giảm trường số lượng quantity_released bớt một trong collection voucher_release_details * @example: * this.vhQuerySales.deleteVoucherCode('BjHxEYPWrB0rPwfj2L9R', 'CBrcRQIL11lwcHBljliW'}) .then((bool:any)=>{ console.log('deleteVoucherCode', bool); }, error=>{ console.log('error', error); }) * @param id_voucher_code * @param id_voucher_release_detail * @return Promise => boolean = true or false */ deleteVoucherCode(id_voucher_code: string, id_voucher_release_detail: string): Promise; /** * hàm này trả về danh sách voucher_codes đã phát hành theo mỗi đợt * @example: * this.vhQuerySales.getVoucherCodes_byIdCouponReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'}) .then((array:any)=>{ console.log('getVoucherCodes_byIdCouponReleaseDetail', array); }, error=>{ console.log('error', error); }) * @param id_voucher_release_detail * @return Promise => Array */ getVoucherCodes_byIdCouponReleaseDetail(id_voucher_release_detail: any): Promise; /** * hàm này trả về danh sách voucher code đã phát hành theo điều kiện query * @example: * this.vhQuerySales.getVoucherCodes_byFields({status:{$eq: 1}}, {}, {}, 0) .then((res)=>{ console.log('getVoucherCodes_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getVoucherCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * 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 * @example: * * this.vhQuerySales.getVoucherCode('OUHEDW0512'}) .then((res)=>{ console.log('getVoucherCode', res); }, error=>{ console.log('error', error); }) * @param id_voucher_code: cũng chính là code * @return Promise => obj ={} or null */ getVoucherCode(id_voucher_code: any): Promise; /** * hàm này trả về voucher code đã phát hành theo trường _id của voucher code. * trả về có cả code, name_voucher, name_voucher_release * @example: * * this.vhQuerySales.getVoucher_Code_Name_Release('OUHEDW0512'}) .then((res)=>{ console.log('getVoucher_Code_Name_Release', res); }, error=>{ console.log('error', error); }) * @param id_voucher_code: cũng chính là code * @return Promise => obj ={} or null */ getVoucher_Code_Name_Release(id_voucher_code: any): Promise; /** * hàm này trả về voucher đã phát hành theo trường code của voucher_code. dùng trong trang đổi điểm lấy voucher và bán voucher, đổi voucher lấy hàng hóa, * trả về có cả code, name_voucher, name_voucher_release * @example: * * this.vhQuerySales.getVoucher_Code_Name_Release_byCode('OUHEDW0512'}) .then((res)=>{ console.log('getVoucher_Code_Name_Release_byCode', res); }, error=>{ console.log('error', error); }) * @param code: cũng chính là code * @return Promise => obj ={} or null */ getVoucher_Code_Name_Release_byCode(code: any): Promise; exchangeVoucherCode_byEarningPoints(array_id_voucher_code_and_points_and_products: any, id_customer: any, points: any): Promise; /** * @example: * let data = { * name :"Thẻ trả trước", * price :1000000, * products : [ * { * id_product : 'MOIUHWDWIUHG1345674', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 1 * },{ * id_product : 'NJIDUEWNBIJUWGHD135', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 2 * }] * } * this.vhQuerySales.addPaymentCard(data) .then((res)=>{ console.log('addPaymentCard', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => Array */ addPaymentCard(data: any): Promise; /** * @example: * let data = { * name :"Thẻ trả trước", * price :1000000, * products : [ * { * id_product : 'MOIUHWDWIUHG1345674', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 1 * },{ * id_product : 'NJIDUEWNBIJUWGHD135', * price : 100000, * quantity: 5, * quantity_valid : 5, * type : 2 * }] * } * this.vhQuerySales.updatePaymentCard(data) .then((bool:any)=>{ console.log('updatePaymentCard', bool); }, error=>{ console.log('error', error); }) * @param data * @param id_payment_card * @return Promise => bool = true or false */ updatePaymentCard(id_payment_card: any, data: any): Promise; /** * @example: * this.vhQuerySales.deletePaymentCard("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deletePaymentCard', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_payment_card * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do payment_card đã được phát hành, vui lòng xóa đợt phát hành liên quan */ deletePaymentCard(id_payment_card: any): Promise; /** * @example: * this.vhQuerySales.getPaymentCard('FDNOIUWDHIWH21564DWQ') .then((res)=>{ console.log('getPaymentCard', res); }, error=>{ console.log('error', error); }) * @param id_payment_card * @return Promise => object or null */ getPaymentCard(id_payment_card: any): Promise; /** * @example: * this.vhQuerySales.getPaymentCards() .then((res)=>{ console.log('getPaymentCards', res); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getPaymentCards(): Promise; /** * @example: * this.vhQuerySales.addPaymentCardRelease({name : "Đợt phát hành thẻ 1", id_branch :"NIOUHDWLJUNBHIU16549"}) .then((res)=>{ console.log('addPaymentCardRelease', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addPaymentCardRelease(data: any): Promise; /** * @example: * this.vhQuerySales.updatePaymentCardRelease({name : "Đợt phát hành thẻ 1"}) .then((bool:any)=>{ console.log('updatePaymentCardRelease', bool); }, error=>{ console.log('error', error); }) * @param id_payment_card_release * @param data * @return Promise => object or error */ updatePaymentCardRelease(id_payment_card_release: any, data: any): Promise; /** * @example: * this.vhQuerySales.deletePaymentCardRelease("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deletePaymentCardRelease', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_payment_card_release * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do trong đợt phát hành đã có payment_card cần phát hành, vui lòng xóa payment_card khỏi đợt phát hành */ deletePaymentCardRelease(id_payment_card_release: any): Promise; /** * @example: * this.vhQuerySales.getPaymentCardRelease("OIHIDUWNIDOLW123456") .then((res)=>{ console.log('getPaymentCardRelease', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_release * @return Promise => object or null */ getPaymentCardRelease(id_payment_card_release: any): Promise; /** * @example: * this.vhQuerySales.getPaymentCardReleases() .then((res)=>{ console.log('getPaymentCardReleases', res); }, error=>{ console.log('error', error); }) * @return Promise => Array */ getPaymentCardReleases(): Promise; /** * @example: * this.vhQuerySales.addPaymentCardReleaseDetail({id_payment_card : "OIUHFIUWHGGU41698496", id_payment_card_release :"NIOUHDWLJUNBHIU16549"}) .then((res)=>{ console.log('addPaymentCardReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object or error */ addPaymentCardReleaseDetail(data: any): Promise; /** * @example: * this.vhQuerySales.deletePaymentCardReleaseDetail("9841654DOIWSDYW235") .then((rsp)=>{ console.log('deletePaymentCardReleaseDetail', rsp); if(rsp.vcode == 0){ //phát thông báo xóa thành công }else if(rsp.vcode == 1){ //phát thông báo lý do xóa ko thành công (dùng câu từ dễ hiểu với khách hàng) } }, error=>{ console.log('error', error); }) * @param id_payment_card_release_detail * @return Promise => rsp = {vcode, message} / error * vcode == 0 : xóa thành công * vcode == 1 : xóa không thành công, do payment_card_code của đợt phát hành chi tiết này có status !=1 (đã được đổi điểm, hoặc đã sử dụng) */ deletePaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise; /** * @example: * * this.vhQuerySales.getPaymentCardReleaseDetail('FBHYWIBDNIUH1321687') .then((res)=>{ console.log('getPaymentCardReleaseDetail', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_release_detail * @return Promise => object or null */ getPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise; /** * @example: * this.vhQuerySales.getVoucherRelaseDetail_byFields({id_payment_card:{$eq: "316OIUHLKMLSDYW235"}}, {}, {}, 0) .then((res)=>{ console.log('getVoucherRelaseDetail_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getPaymentCardRelaseDetail_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * hàm này để phát hành 1 payment_card_code * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_payment_card_release_detail: "fuMS21I6othUm34385WV", id_payment_card: '9841654DOIWSDYW235' } * this.vhQuerySales.createPaymentCardCode(data) .then((coupon_code)=>{ console.log('createPaymentCardCode', coupon_code); }, error=>{ console.log('error', error); }) * @param data * @return Promise => Object */ private createPaymentCardCode; /** * 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 * trong collection payment_card_release_details * @example: let data = { date_validity: new Date(), date_expire: new Date(), id_payment_card_release_detail: "fuMS21I6othUm34385WV", id_payment_card: '9841654DOIWSDYW235' } * this.vhQuerySales.createPaymentCardCodes(data, 10) .then((voucher_codes)=>{ console.log('createPaymentCardCodes', voucher_codes); }, error=>{ console.log('error', error); }) * @param data * @param quantity * @return Promise => Array(object) */ createPaymentCardCodes(data: any, quantity: number): Promise; /** * @example: * let data = { date_validity: new Date(), date_expire: new Date(), id_branch: "4zFGhVUAZyj5d09r01xZ" } * this.vhQuerySales.updatePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478',data) .then((bool:any)=>{ console.log('updateCouponCode', bool); }, error=>{ console.log('error', error); }) * @param id_payment_card_code * @param data * @return Promise => boolean = true or false */ updatePaymentCardCode(id_payment_card_code: any, data: any): Promise; /** * Hàm này chỉ cho phép xóa payment_card đang ở trạng thái đã phát hành (status ==1), * và cập nhật giảm trường số lượng quantity_released bớt một trong collection payment_card_release_details * @example: * this.vhQuerySales.deletePaymentCardCode('OUHEOIWUYGHIQNIDOUW1359478', 'qKgt3cRPRXtw75JV9URp'}) .then((bool:any)=>{ console.log('deletePaymentCardCode', bool); }, error=>{ console.log('error', error); }) * @param id_payment_card_code * @param id_payment_card_release_detail * @return Promise => boolean = true or false */ deletePaymentCardCode(id_payment_card_code: string, id_payment_card_release_detail: string): Promise; /** * hàm này trả về danh sách payment_card_codes đã phát hành theo mỗi đợt * @example: * * this.vhQuerySales.getPaymentCardCodes_byIdPaymentCardReleaseDetail('OUHEOIWUYGHIQNIDOUW1359478'}) .then((array:any)=>{ console.log('getPaymentCardCodes_byIdPaymentCardReleaseDetail', array); }, error=>{ console.log('error', error); }) * @param id_payment_card_release_detail * @return Promise => Array */ getPaymentCardCodes_byIdPaymentCardReleaseDetail(id_payment_card_release_detail: any): Promise; /** * hàm này trả về danh sách payment_card code đã phát hành theo điều kiện query * @example: * this.vhQuerySales.getPaymentCardCodes_byFields({status:{$eq: 1}}, {}, {}, 0) .then((res)=>{ console.log('getPaymentCardCodes_byFields', res); }, error=>{ console.log('error', error); }) * @param query * @param projection * @param sort * @param limit * @return Promise => array(object) = [{},{},..] */ getPaymentCardCodes_byFields(query: object, projection: object, sort: object, limit: number): Promise; /** * 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) * @example: * * this.vhQuerySales.getPaymentCardCode('OUHEDW0512'}) .then((res)=>{ console.log('getPaymentCardCode', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_code: cũng chính là code * @return Promise => obj = {} or null */ getPaymentCardCode(id_payment_card_code: any): Promise; /** * hàm này trả về payment_card code đã phát hành theo trường _id của payment_card code * trả về có cả code, name_payment_card, name_payment_card_release * @example: * * this.vhQuerySales.getPaymentCard_Code_Name_Release('OUHEDW0512'}) .then((res)=>{ console.log('getPaymentCard_Code_Name_Release', res); }, error=>{ console.log('error', error); }) * @param id_payment_card_code: cũng chính là code * @return Promise => obj ={} or null */ getPaymentCard_Code_Name_Release(id_payment_card_code: any): Promise; /** * hàm này trả về payment_card đã phát hành theo trường code của payment_card_code. dùng trong trang đổi điểm lấy thẻ payment_card và bán payment_card, đổi payment_card lấy hàng hóa, * trả về có cả code, name_payment_card, name_payment_card_release * @example: * * this.vhQuerySales.getPaymentCard_Code_Name_Release_byCode('OUHEDW0512'}) .then((res)=>{ console.log('getPaymentCard_Code_Name_Release_byCode', res); }, error=>{ console.log('error', error); }) * @param code: cũng chính là code * @return Promise => obj ={} or null */ getPaymentCard_Code_Name_Release_byCode(code: any): Promise; exchangePaymentCardCode_byEarningPoints(array_id_payment_card_code_and_points_and_products: any, id_customer: any, points: any): Promise; /** * không cần hàm này vì khi tạo phiếu bill_type51 đã được cập nhật * hàm này dùng để cập nhật số lượng sản phẩm trong Payment Card khi đổi thẻ * @example: * this.vhQuerySales.getPaymentCardCode_byCode("ONHDIWUHIODUWN","NDPIUWUHIOUYEW",{quantity_valid: 0}) .then((res)=>{ console.log('getPaymentCardCode_byCode', res); }, error=>{ console.log('error', error); }) * @param id_payment_card * @param id_comboproduct * @param data * @return Promise object or null */ updateComboPaymentCard(id_payment_card: any, id_comboproduct: any, data: any): void; /** * Hàm này MÁY ĐANG DÙNG PHẦN MỀM sẽ mở kết nối với tất cả các thiết bị giao tiếp RS232 đã khai báo trong Cài đặt/Cấu hình/Bảng LED hiển thị giá * @example: * this.vhQuerySales.connectDisplayLEDScreens(); */ connectDisplayLEDScreens(): void; /** * Hàm này MÁY ĐANG DÙNG PHẦN MỀM sẽ đóng kết nối với tất cả các thiết bị giao tiếp RS232 đã khai báo trong Cài đặt/Cấu hình/Bảng LED hiển thị giá * @example: * this.vhQuerySales.connectDisplayLEDScreens(); */ disconnectDisplayLEDScreens(): void; /** * Hàm này PHẦN MỀM sẽ gửi bill và bill_details xuống bảng LED hiển thị giá để hiển thị giá trị lên. * Lưu ý bắt sự kiện giá trị tổng hóa đơn (total) thay đổi và gọi lại hàm này. * @example: * this.vhQuerySales.writeBill_BillDetails_toDisplayLEDScreens(bill, bill_details); */ writeBill_BillDetails_toDisplayLEDScreens(bill: any, bill_details: any): void; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySales.getAffiliate_byFields({payment_type:{$eq:5}}, {},{},0) .then((affiliates)=>{ console.log('getAffiliate_byFields', affiliates); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getAffiliate_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryAdministrator { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_rootdatabase; private vhAuth; private vhAlgorithm; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @description: Lấy về tất cả các cửa hàng (shops) đã đăng ký vào hệ thống phần mềm, theo thời gian * @example: * let starttime = new Date('2022-03-13T05:24:00'); * let endtime = new Date(); * this.VhQueryAdministrator.getShops_byTime(starttime, endtime') .then(result=>{ console.log('result', result); }, error=>{ console.log('error', error); }) * @param starttime * @param endtime * @returns Promise Array */ getShops_byTime(starttime: any, endtime: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryAdministrator.getAffiliaters_byFields({code:{$eq: 'A0001;}}, {},{},0) .then((affiliaters)=>{ console.log('getAffiliaters_byFields', affiliaters); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getAffiliaters_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryAdministrator.getDealers_byFields({creationdate:{$lte: new Date()}}, {},{},0) .then((dealers)=>{ console.log('getDealers_byFields', dealers); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getDealers_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * let data = { date: new Date(), code: "A0001", name: "Giá tốt mỗi ngày", id_affiliater: "5fb6780ca2148e09806c5b01", payment_details:[{ id_package: "store_main_package_standard_12month", original_price: 1980000, partner_price: 1980000, selling_price: 980000 },{ id_package: "store_main_package_super_pro_12month", original_price: 3960000, partner_price: 3960000, original_price: 3960000 }] } * this.vhQueryAdministrator.createAffiliate(data) .then((affiliate)=>{ console.log('createAffiliate', affiliate); },(error:any)=>{ console.log('error', error); }) * @param data : object * @return Promise => affiliate = {} / error * 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 */ createAffiliate(data: any): Promise; /** * Hàm lấy về thông tin, giá cả các gói phần mềm mà các affiliater muốn bán cho khách của họ * @example: * this.vhQueryAdministrator.getAffiliate('5fb67fda87c0f21d484cbdf3') .then((affiliate)=>{ console.log('getAffiliate', affiliate); }) * @param id_affiliate * @return Promise => affiliate ={} or null / error */ getAffiliate(id_affiliate: any): Promise; /** * @example: * this.vhQueryAdministrator.updateAffiliate('5fb6780ca2148e09806c5b01', {total:990000}) .then((response)=>{ console.log('updateAffiliate', response); }, error=>{ console.log('error', error); }) * @param id_affiliate * @param value * @return Promise => response = undefined / error */ updateAffiliate(id_affiliate: string, value: any): Promise; /** * @example: * this.vhQueryAdministrator.deleteAffiliate('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deleteAffiliate', response); }, error=>{ console.log(error, error); }) * @param id_affiliate * @return Promise => response = undefined / error */ deleteAffiliate(id_affiliate: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryAdministrator.getAffiliate_byFields({payment_type:{$eq:5}}, {},{},0) .then((affiliates)=>{ console.log('getAffiliate_byFields', affiliates); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getAffiliate_byFields(query: any, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryAffiliater { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_rootdatabase; private vhAuth; private vhAlgorithm; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * Lấy về các shops đã đăng ký sử dụng nhưng chưa gia hạn * this.vhQueryAffiliater.getShops_byFree() .then((shops)=>{ }) * @returns */ getShops_byFree(): Promise; /** * Lấy vế các shops đã thanh toán và gia hạn sử dụng * this.vhQueryAffiliater.getPayments_byShop() .then((shops)=>{ }) * @returns */ getPayments_byShop(): Promise; /** * Hàm lấy về thông tin, giá cả các gói phần mềm mà sales365 ủy quyền cho các affiliater bán cho khách của họ * @example: * this.vhQueryAffiliater.getAffiliate() .then((affiliate)=>{ console.log('getAffiliate', affiliate); }) * @return Promise => affiliate ={} or null / error */ getAffiliate(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryDealer { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_rootdatabase; private vhAuth; private vhAlgorithm; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * Lấy về danh sách các ngân hàng (kèm logo) mà vietqr hỗ trợ tạo mã QR * @example: * this.vhQueryDealer.vietqr_getBanks() .then((rsp:any)=>{ if(rsp.vcode === 0){ } }, error=>{ console.log(error) }) * @returns Promise => rsp ={vcode, msg, data(array)} / error * vcode == 0: success */ vietqr_getBanks(): Promise; /** * Tạo mã QR cho Shop quét thanh toán vào tài khoản ngân hàng đã đăng ký Casso * @example: * this.vhQueryDealer.vietqr_generateQR('0909925354', 'LE DUC HUY', '970422', 'compact2', '674fd94a9ace7267deb685fd', 99000) .then((rsp:any)=>{ if(rsp.vcode === 0){ } }, error=>{ console.log(error) }) * @param accountNo: số tài khoản ngân hàng * @param accountName: tên chủ tài khoản * @param acqId: mã bin của ngân hàng (lấy từ hàm vietqr_getBanks()) * @param template: compact2, compact, qr_only, print + compact2: 540x640 Bao gồm : Mã QR, các logo , thông tin chuyển khoản + compact: 540x540 QR kèm logo VietQR, Napas, ngân hàng + qr_only: 480x480 Trả về ảnh QR đơn giản, chỉ bao gồm QR + print: 600x776 Bao gồm : Mã QR, các logo và đầy đủ thông tin chuyển khoản * @param id_bill: _id của đơn hàng * @param amount: tổng tiền khách phải thanh toán * @returns Promise => rsp ={vcode, msg, data(img_base64)} / error * vcode == 0: success */ vietqr_generateQR(accountNo: string, accountName: string, acqId: string, template: string, id_payment: string, amount: number): Promise; /** * @example: * let data = { date: new Date(), payment_type: 5, //1 lưu (khách đã thanh toán cho vnpay); 5 lưu tạm (khách chưa thanh toán vnpay), hệ thống sẽ tự động xóa những payment này hoặc trên giao diện hiện ra cho khách tự xóa payment: 990.000, tax: 0, total: 990.000 } * this.vhQueryDealer.createPayment(data) .then((payment)=>{ console.log('createPayment', payment); },(error:any)=>{ console.log('error', error); }) * payment = { _id, payment_code, id_dealer, date payment_type, payment, tax, total } * @param payment : object * @return Promise => payment = {} / error * 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 * @notice : hàm này chỉ dùng tạo những bill_type mà không có phát sinh bill_detail */ createPayment(data: any): Promise; /** * @example: * this.vhQueryDealer.updatePayment('5fb6780ca2148e09806c5b01', {total:990000}) .then((response)=>{ console.log('updatePayment', response); }, error=>{ console.log('error', error); }) * @param id_payment * @param value * @return Promise => response = undefined / error */ updatePayment(id_payment: string, value: any): Promise; /** * @example: * this.vhQueryDealer.deletePayment('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deletePayment', response); }, error=>{ console.log(error, error); }) * @param id_payment * @return Promise => response = undefined / error */ deletePayment(id_payment: any): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryDealer.getPayments({payment_type:{$eq:5}}, {},{},0) .then((payments)=>{ console.log('getPayments', payments); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getPayments(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQueryDealer.getPayment('5fb67fda87c0f21d484cbdf3') .then((payment)=>{ console.log('getPayment', payment); }) * @param id_payment * @return Promise => payment ={} or null / error */ getPayment(id_payment: any): Promise; /** * @example: let payment_detail_main = { id_branch: 'AEUWSWZXA4iHv8BmCNz2', //khách chọn id_payment: '5D4XGdZ2q5XLnOUa0mMx', //payment._id id_restriction: 'main_package_advanced', //package.id_restriction id_package: 'main_package_advanced_1month', //có được khi khách chọn gói để mua package_type: 1, //gói chinh, gói tmđt hay gói facebook... day: 31, //package.day, tax: 0, package.tax, price: 99000, package.price, quantity: 1, //khách chọn payment_detail_type: 1, //1: gói gia hạng mới, 2: gói nâng cấp, 3: gói kéo dài thêm thời gian } this.vhQueryDealer.createPayment_Detail({}) .then((payment_detail)=>{ console.log('createPayment_Detail', payment_detail); },(error:any)=>{ console.log('error', error); }) payment_detail = { _id, id_dealer, payment_type, activating, invalid, date, id_branch, id_payment, id_restriction, id_package, package_type, payment_type, payment_detail_type, day, tax, price, quantity } * @param data * @return Promise => response = {} / error * 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 */ createPayment_Detail(data: any): any; /** * @example: * this.vhQueryDealer.updatePayment_Detail('5fb6780ca2148e09806c5b01', {name:'Khuyến mãi 12/12'}) .then((response)=>{ console.log('updatePayment_Detail', response); },(error:any)=>{ reject(error); }) * @param id_payment_detail * @param value * @return Promise => response = undefined / error */ updatePayment_Detail(id_payment_detail: string, value: object): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryDealer.getPayment_details({id_payment:{$eq:'5fb67fda87c0f21d484cbdf3'}}, {},{},0) .then((payment_details)=>{ console.log('getPayment_details', payment_details); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return Promise Array => array = [{},{},...] / error */ getPayment_details(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQueryDealer.getPayment_detail('5fb67fda87c0f21d484cbdf3') .then((payment_detail)=>{ console.log('getPayment_detail', payment_detail); }) * @param id_payment_detail * @return Promise => payment_detail ={} or null / error */ getPayment_detail(id_payment_detail: any): Promise; /** * @example: * this.vhQueryDealer.deletePayment_Detail('5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('deletePayment_Detail', response); },(error:any)=>{ reject(error); }) * @param id_payment_detail * @return Promise => Promise => response = undefined / error */ deletePayment_Detail(id_payment_detail: string): Promise; /** * @example: * this.vhQueryDealer.getPackage('5fb67fda87c0f21d484cbdf3') .then((package)=>{ console.log('getPackage', package); }) * @param id_package * @return Promise => package ={} or null / error */ getPackage(id_package: any): Promise; /** * @example: * this.vhQueryDealer.assignLicenseKEY_toStore('5fb6780ca2148e09806c5b01', '5fb67fda87c0f21d484cbdf3') .then((response)=>{ console.log('assignLicenseKEY_toStore', response); }, error=>{ console.log('error', error); }) * @param id_store * @param id_licenseKEY * @return Promise => response = undefined / error */ assignLicenseKEY_toStore(id_store: string, id_licenseKEY: string): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQueryDealer.getLicenseKEYs({payment_type:{$eq:5}}, {},{},0) .then((payments)=>{ console.log('getLicenseKEYs', payments); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getLicenseKEYs(query: any, projection?: object, sort?: object, limit?: number): Promise; /** * Lấy về thông tin Đại lý từ mã đại lý (dealerCode) * @example: * this.vhQueryDealer.getDealer_byDealerCode() .then((dealer)=>{ if(dealer){ console.log('getDealer_byDealerCode', dealer); } }, error=>{ console.log(error); }) * @param dealerCode * @returns object or null */ getDealer_byDealerCode(dealerCode: any): Promise; /** * @example: * this.vhQueryDealer.getStoresAPP_byTime(starttime, endtime, '5fb67fda87c0f21d484cbdf3') .then((stores)=>{ console.log('getStoresAPP_byTime', stores); }) * Lấy về tất cả các Shop đăng ký dùng APP thuộc quản lý của Đại lý (IDdealer) * @param starttime * @param endtime * @param IDdealer * @returns Promise => Array -> array = [{},{},...] */ getStoresAPP_byTime(starttime: any, endtime: any, IDdealer: any): Promise; /** * lấy danh sách các id_branchs của các chi nhánh trong store * @param obj * @returns */ private findRootFields; /** * @example: * this.vhQueryDealer.getBranchs_byIDstore('5fb67fda87c0f21d484cbdf3') .then((branchs)=>{ console.log('getBranchs_byIDstore', branchs); }) * @param id_store * @return Promise => Array -> array = [{},{},...] */ getBranchs_byIDstore(id_store: any): Promise; /** * @example: * this.vhQueryDealer.extendLicenseValidaty_byLicenseKEY('3I1oQhMvkeySdtCSmsy5', '5fb6780ca2148e09806c5b01', '674fd94a9ace7267deb685fd') .then((response)=>{ console.log('extendLicenseValidaty_byLicenseKEY', response); }, error=>{ console.log('error', error); }) * @param id_store:string * @param id_branch * @param id_licenseKEY * @return Promise => response = {vcode, msg} * vcode = 0: gia hạn thành công * vcode = 1: id_licenseKEY không thuộc về Store * vcode = 2: id_licenseKEY đã được kích hoạt trước đây * vcode = 3: id_licenseKEY đã bị vô hiệu hóa trước đây * vcode = 4: id_licenseKEY không kích hoạt được do khác loại gói đang dùng */ extendLicenseValidaty_byLicenseKEY(id_store: string, id_branch: string, id_licenseKEY: string): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuerySCclient { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_f3rdclouds; private vhQuery; private vhAuth; private vhAlgorithm; private cloudcams; private mainboards; private functions; private components; private icons; private zones; private appsettingstations; private scripts; private script_details; private logs; private hwinfo; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_f3rdclouds: VhMGDB_f3rdclouds, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); startLocalStorage(): Promise; private getEUtokenfromDatabase; /** * * @param licensecam * @param camplaybackURL * @param starttime * @param endtime * @return Promise => array(string) = [,,..] */ getPlaybackListCamByEndUser(licensecam: string, camplaybackURL: string, starttime: any, endtime: any): Promise; /** * @example: * let cloudcam = this.vhQuerySecurityCam.getlocalCloudCam('5fb6780ca2148e09806c5b01'); * @param licensecam * @return Object => obj = {} or null */ getlocalCloudCam(licensecam: any): any; /** * @example: * let cloudcams = this.vhQuerySecurityCam.getlocalCloudCams(); * @return Array(object) => array = [{},{},...] */ getlocalCloudCams(): any[]; /** * @example: * this.vhQuerySecurityCam.refreshLocalCloudCams() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCloudCam(), getlocalCloudCams() trong localstorage * @return Promise => null */ refreshLocalCloudCams(): any; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableDetector('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableDetector', bool); }) * @param licensecam * @param detector_enable * @return Promise => bool = true or false */ changeCloudCamEnableDetector(licensecam: string, detector_enable: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableRecord('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableRecord', bool); }) * @param licensecam * @param record_enable * @return Promise => bool = true or false */ changeCloudCamEnableRecord(licensecam: string, record_enable: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableActive('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableActive', bool); }) * @param licensecam * @param active * @return Promise => bool = true or false */ changeCloudCamEnableActive(licensecam: string, active: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamURL('5fb6780ca2148e09806c5b01', 'udp', 'rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream') .then((bool:any)=>{ console.log('changeCloudCamURL', bool); }) * @param licensecam * @param url * @return Promise => bool = true or false */ changeCloudCamURL(licensecam: string, url: string): Promise; /** * @example: * this.vhQuerySecurityCam.deleteCloudCam('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCloudCam', bool); }) * @param licensecam * @return Promise => bool = true or false */ deleteCloudCam(licensecam: string): Promise; /** * @example: * this.vhQuerySecurityCam.updateCloudCam('5fb6780ca2148e09806c5b01', {name:'camera 3'}) .then((bool:any)=>{ console.log('updateCloudCam', bool); }) * @param licensecam * @param data * @return Promise => bool = true or false */ updateCloudCam(licensecam: string, data: any): Promise; /** * @example: * this.vhQuerySecurityCam.addCloudCam('rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream', 'udp', {name:camera 3}) .then((cloudcam:any)=>{ console.log('addCloudCam', cloudcam); }) * @param url * @param data * @return Promise => {} or null */ addCloudCam(url: string, data: object): Promise; getCloudCams(): Promise; /** * @example: * let wallet = this.vhQuerySCclient.getlocalFunction('5fb6780ca2148e09806c5b01'); * @param id_function * @return Object => obj = {} or null */ getlocalFunction(id_function: any): any; /** * @example: * let wallets = this.vhQuerySCclient.getlocalFunctions(); * @return Array(object) => array = [{},{},...] */ getlocalFunctions(): any; /** * @example: * this.vhQuerySCclient.refreshLocalFunctions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalFunction(), getlocalFunctions() trong localstorage * @return Promise => null */ refreshLocalFunctions(): any; /** * @example: * this.vhQuerySCclient.addFunction({name:'camera 2', quantity:20, price:200000}) .then((func)=>{ console.log('addFunction', func); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addFunction(data: object): Promise; /** * @example: * this.vhQuerySCclient.updateFunction('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateFunction', bool); }) * @param id_function * @param data * @return Promise => bool = true or false */ updateFunction(id_function: string, data: object): Promise; /** * @example: * this.vhQuerySCclient.deleteFunction('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteFunction', bool); }) * @param id_function * @return Promise => bool = true or false */ deleteFunction(id_function: string): Promise; /** * @example * this.vhQuerySCclient.getFunctions() .then((functions)=>{ console.log('getFunctions', functions); }) * @return Promise => array(object) = [{},{},..] */ getFunctions(): Promise; /** * @example * this.vhAuth.getFunctions_byFields({name:{$eq:'name abc'}}, {},{},0) .then((functions)=>{ console.log('getFunctions_byFields', functions); }) * @param query * @param projection : {} * @param sort : {} * @param limit : 0 * @return Promise => array(object) = [{},{},..] */ getFunctions_byFields(query: any, projection: object, sort: any, limit: number): Promise; /** * @example: * let wallet = this.vhQuerySCclient.getlocalComponent('5fb6780ca2148e09806c5b01'); * @param id_component * @return Object => obj = {} or null */ getlocalComponent(id_component: any): any; /** * @example: * let wallets = this.vhQuerySCclient.getlocalComponents(); * @return Array(object) => array = [{},{},...] */ getlocalComponents(): any; /** * @example: * this.vhQuerySCclient.refreshLocalComponents() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalComponent(), getlocalComponents() trong localstorage * @return Promise => null */ refreshLocalComponents(): any; /** * @example: * this.vhQuerySCclient.addComponent({name:'camera 2', quantity:20, price:200000}) .then((component)=>{ console.log('addComponent', component); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addComponent(data: object): Promise; /** * @example: * this.vhQuerySCclient.updateComponent('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateComponent', bool); }) * @param id_component * @param data * @return Promise => bool = true or false */ updateComponent(id_component: string, data: object): Promise; /** * @example: * this.vhQuerySCclient.deleteComponent('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteComponent', bool); }) * @param id_component * @return Promise => bool = true or false */ deleteComponent(id_component: string): Promise; /** * @example * this.vhQuerySCclient.getComponents() .then((components)=>{ console.log('getComponents', components); }) * @return Promise => array(object) = [{},{},..] */ getComponents(): Promise; /** * @example * this.vhAuth.getComponents_byFields({name:{$eq:'name abc'}}, {},{},0) .then((components)=>{ console.log('getComponents_byFields', components); }) * @param query * @param projection : {} * @param sort : {} * @param limit : 0 * @return Promise => array(object) = [{},{},..] */ getComponents_byFields(query: any, projection: object, sort: any, limit: number): Promise; /** * @example: * let wallet = this.vhQuerySCclient.getlocalIcon('5fb6780ca2148e09806c5b01'); * @param id_icon * @return Object => obj = {} or null */ getlocalIcon(id_icon: any): any; /** * @example: * let wallets = this.vhQuerySCclient.getlocalIcons(); * @return Array(object) => array = [{},{},...] */ getlocalIcons(): any; /** * @example: * this.vhQuerySCclient.refreshLocalIcons() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIcon(), getlocalIcons() trong localstorage * @return Promise => null */ refreshLocalIcons(): any; /** * @example: * this.vhQuerySCclient.addIcon({name:'camera 2', quantity:20, price:200000}) .then((icon)=>{ console.log('addIcon', icon); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addIcon(data: object): Promise; /** * @example: * this.vhQuerySCclient.updateIcon('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIcon', bool); }) * @param id_icon * @param data * @return Promise => bool = true or false */ updateIcon(id_icon: string, data: object): Promise; /** * @example: * this.vhQuerySCclient.deleteIcon('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIcon', bool); }) * @param id_icon * @return Promise => bool = true or false */ deleteIcon(id_icon: string): Promise; /** * @example * this.vhQuerySCclient.getIcons() .then((icons)=>{ console.log('getIcons', icons); }) * @return Promise => array(object) = [{},{},..] */ getIcons(): Promise; /** * @example * this.vhAuth.getIcons_byFields({name:{$eq:'name abc'}}, {},{},0) .then((icons)=>{ console.log('getIcons_byFields', icons); }) * @param query * @param projection : {} * @param sort : {} * @param limit : 0 * @return Promise => array(object) = [{},{},..] */ getIcons_byFields(query: any, projection: object, sort: any, limit: number): Promise; /** * @example: * let wallet = this.vhQuerySCclient.getlocalMainboard('5fb6780ca2148e09806c5b01'); * @param id_mainboard * @return Object => obj = {} or null */ getlocalMainboard(id_mainboard: any): any; /** * @example: * let wallets = this.vhQuerySCclient.getlocalMainboards(); * @return Array(object) => array = [{},{},...] */ getlocalMainboards(): any; /** * @example: * this.vhQuerySCclient.refreshLocalMainboards() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalMainboard(), getlocalMainboards() trong localstorage * @return Promise => null */ refreshLocalMainboards(): any; /** * @example: * this.vhQuerySCclient.addMainboard({name:'camera 2', quantity:20, price:200000}) .then((mainboard)=>{ console.log('addMainboard', mainboard); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMainboard(data: object): Promise; /** * @example: * this.vhQuerySCclient.updateMainboard('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMainboard', bool); }) * @param id_mainboard * @param data * @return Promise => bool = true or false */ updateMainboard(id_mainboard: string, data: object): Promise; /** * @example: * this.vhQuerySCclient.deleteMainboard('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMainboard', bool); }) * @param id_mainboard * @return Promise => bool = true or false */ deleteMainboard(id_mainboard: string): Promise; /** * @example * this.vhQuerySCclient.getMainboard('5fb67fda87c0f21d484cbdf3') .then((mainboard)=>{ console.log('getMainboard', mainboard); }) * @param id_mainboard * @return Promise => obj ={} or null */ getMainboard(id_mainboard: string): Promise; /** * @example * this.vhQuerySCclient.getMainboards() .then((mainboards)=>{ console.log('getMainboards', mainboards); }) * @return Promise => array(object) = [{},{},..] */ getMainboards(): Promise; /** * @example * this.vhQuerySCclient.getMainboards_byFields({name:{$eq:'name abc'}}, {},{},0) .then((mainboards)=>{ console.log('getMainboards_byFields', mainboards); }) * @param query * @param projection : {} * @param sort : {} * @param limit : 0 * @return Promise => array(object) = [{},{},..] */ getMainboards_byFields(query: any, projection: object, sort: any, limit: number): Promise; /** * @example: * let zone = this.vhQuerySCclient.getlocalZone('5fb6780ca2148e09806c5b01'); * @param id_zone * @return Object => obj = {} or null */ getlocalZone(id_zone: any): any; /** * @example: * let zones = this.vhQuerySCclient.getlocalZones(); * @return Array(object) => array = [{},{},...] */ getlocalZones(): any; /** * @example: * this.vhQuerySCclient.refreshLocalZones() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalZone(), getlocalZones() trong localstorage * @return Promise => null */ refreshLocalZones(): any; /** * @example: * this.vhQuerySCclient.addZone({name:'camera 2', quantity:20, price:200000}) .then((zone)=>{ console.log('addZone', zone); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addZone(data: object): Promise; /** * @example: * this.vhQuerySCclient.updateZone('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateZone', bool); }) * @param id_zone * @param data * @return Promise => bool = true or false */ updateZone(id_zone: string, data: object): Promise; /** * @example: * this.vhQuerySCclient.deleteZone('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteZone', bool); }) * @param id_zone * @return Promise => bool = true or false */ deleteZone(id_zone: string): Promise; /** * @example * this.vhQuerySCclient.getZones() .then((zones)=>{ console.log('getZones', zones); }) * @return Promise => array(object) = [{},{},..] */ getZones(): Promise; /** * @example * this.vhAuth.getZones_byFields({name:{$eq:'name abc'}}, {},{},0) .then((zones)=>{ console.log('getZones_byFields', zones); }) * @param query * @param projection : {} * @param sort : {} * @param limit : 0 * @return Promise => array(object) = [{},{},..] */ getZones_byFields(query: any, projection: object, sort: any, limit: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Người đăng ký vào hệ thống SecurityCam (securitycam database) để quản lý dịch vụ của mình được gọi là người dùng (user), khi đăng ký user được VhMGDB_clouds (vhclouds database) cấp cho một utoken, * utoken này có hạn sử dụng * Khách hàng sử dụng dịch vụ SecurityCam của người dùng user được gọi là người dùng cuối (enduser), khi thêm enduser vào hệ thống thì thông qua utoken sẽ cấp cho * người dùng cuối eutoken (để hệ thống biết được enduser nào thuộc user nào), eutoken này cũng có hạn sử dụng */ export declare class VhQuerySecurityCam { private vhMGDB_auth; private vhMGDB_database; private vhMGDB_socketMongoDB; private vhMGDB_f3rdclouds; private vhQuery; private vhAuth; private vhAlgorithm; private cameras; private provinces; private rooms; private positions; private areas; private mainboards; private functions; private components; private icons; private appsettingstations; private scripts; private script_details; private logs; private hwinfo; private subjectcameras; private subjectappsettingstations; private subjectrooms; private subjectmainboards; private subjectfunctions; private subjecticons; private subjectpositions; private subjectareas; private subjectpages; private subjectcomponents; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_database: VhMGDB_database, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_f3rdclouds: VhMGDB_f3rdclouds, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); syncCollections(): Promise; private initSyncCollections; /** * @example: * this.vhQuerySecurityCam.closeSyncCollections(); * disconnect collections synchronization in the APP * @returns void */ closeSyncCollections(): void; /** * vhQuerySecurityCam * @returns */ private callbackCollectionInsert; /** * vhQuerySecurityCam * @returns */ private callbackCollectionUpdate; /** * vhQuerySecurityCam * @returns */ private callbackCollectionDelete; /** * vhQuerySecurityCam * @returns */ startLocalStorage(): Promise; /** * vhQuerySecurityCam */ private publishObservableEventCameras; /** * vhQuerySecurityCam * @returns */ private observableLocalCameras; /** * @example: * this.observableCamera = this.vhQueryCloudCam.getObservableLocalCameras().subscribe((localCameras:any) => { do something... }) ngOnDestroy(){ this.observableCamera.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCameras(): Observable; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalCamera('5fb6780ca2148e09806c5b01'); * @param id_camera * @return Object => obj = {} or null */ getlocalCamera(id_camera: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalCameras(); * @return Array(object) => array = [{},{},...] */ getlocalCameras(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalCameras() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCamera(), getlocalCameras() trong localstorage * @return Promise => null */ refreshLocalCameras(): any; /** * @example: * this.vhQuerySecurityCam.addCamera({name:'camera 2', url:'rtsp://admin:admin@115.78.100.57:1020/av_stream/ch0', licensecam:'pTqOFsJEndPrg7AImFxV'}) .then((camera)=>{ console.log('addCamera', camera); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 * Trường hợp không thành công: * code = 0 : licensecam không đúng * code = 1 : licensecam đã và đang được sử dụng */ addCamera(data: any): Promise; /** * @example: * this.vhQuerySecurityCam.updateCamera('5fb6780ca2148e09806c5b01', {name:camera 3}) .then((bool:any)=>{ console.log('updateCamera', bool); }) * @param id_camera * @param data * @return Promise => bool = true or false */ updateCamera(id_camera: string, data: any): Promise; /** * @example: * this.vhQuerySecurityCam.deleteCamera('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCamera', bool); }) * @param id_camera * @return Promise => bool = true or false */ deleteCamera(id_camera: string): Promise; /** * @example * this.vhQuerySecurityCam.getCamera('5fb67fda87c0f21d484cbdf3') .then((camera)=>{ console.log('getCamera', camera); }) * @param id_camera * @return Promise => obj ={} or null */ getCamera(id_camera: string): Promise; /** * @example * this.vhQuerySecurityCam.getCameras() .then((cameras)=>{ console.log('getCameras', cameras); }) * @return Promise => array(object) = [{},{},..] */ getCameras(): Promise; getLocalEUtoken(): any; private getEUtokenfromDatabase; /** * @example: * this.vhQuerySecurityCam.checkExpiredUtoken('89wt79w8qb987r9q08r7qv983457qhKAJJDCHXibuqw89r8q20398tyrg9qw3') .then((bool:any)=>{ if(bool){ do something.... } }) * @param utoken * @returns Promise => true or false */ checkExpiredUtoken(): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableCLPRbyEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableCLPRbyEndUser', bool); }) * @param licensecam * @param cLPR_enable * @return Promise => bool = true or false */ changeCloudCamEnableCLPRbyEndUser(licensecam: string, cLPR_enable: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableRLPRbyEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableRLPRbyEndUser', bool); }) * @param licensecam * @param rLPR_enable * @return Promise => bool = true or false */ changeCloudCamEnableRLPRbyEndUser(licensecam: string, rLPR_enable: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableDetectorByEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableDetectorByEndUser', bool); }) * @param licensecam * @param detector_enable * @return Promise => bool = true or false */ changeCloudCamEnableDetectorByEndUser(licensecam: string, detector_enable: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableRecordByEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableRecordByEndUser', bool); }) * @param licensecam * @param record_enable * @return Promise => bool = true or false */ changeCloudCamEnableRecordByEndUser(licensecam: string, record_enable: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamEnableActiveByEndUser('5fb6780ca2148e09806c5b01', false) .then((bool:any)=>{ console.log('changeCloudCamEnableActiveByEndUser', bool); }) * @param licensecam * @param active * @return Promise => bool = true or false */ changeCloudCamEnableActiveByEndUser(licensecam: string, active: boolean): Promise; /** * @example: * this.vhQuerySecurityCam.changeCloudCamURLbyEndUser('5fb6780ca2148e09806c5b01', 'rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream', 'udp') .then((bool:any)=>{ console.log('changeCloudCamURLbyEndUser', bool); }) * @param licensecam * @param url * @return Promise => bool = true or false */ changeCloudCamURLbyEndUser(licensecam: string, url: string): Promise; /** * @example: * this.vhQuerySecurityCam.addCloudCamByEndUser('rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream', 'udp', {name:camera 3}) .then((cloudcam:any)=>{ console.log('addCloudCamByEndUser', cloudcam); }) * @param url * @param data * @return Promise => {} or null */ addCloudCamByEndUser(url: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateCloudCamDataByEndUser('5fb6780ca2148e09806c5b01', {name:'camera 3'}) .then((bool:any)=>{ console.log('updateCloudCamDataByEndUser', bool); }) * @param licensecam * @param data * @return Promise => bool = true or false */ updateCloudCamDataByEndUser(licensecam: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteCloudCamByEndUser('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCloudCamByEndUser', bool); }) * @param licensecam * @return Promise => bool = true or false */ deleteCloudCamByEndUser(licensecam: string): Promise; /** * @example * this.vhQuerySecurityCam.getCloudCamByEndUser('5fb67fda87c0f21d484cbdf3') .then((cloudcam:any)=>{ console.log('getCloudCamByEndUser', cloudcam); }) * @param licensecam:string * @return Promise => obj ={} or null */ getCloudCamByEndUser(licensecam: string): Promise; /** * @example: * this.vhQuerySecurityCam.getCloudCamsByDataFieldsByEndUser({id_enduser:{$gte:'ksdf984ur9weif928'}}, {},{},0) .then((response)=>{ console.log('getCloudCamsByFieldsByEndUser', response); }) .catch(()=>{ }) * @param colname * @param query : {} * @param projection {} đang tìm hiểu * @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 * @param limit null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return Array -> array = [{},{},...] * @notice : trường hợp ko get đc data thì array.length = 0; */ getCloudCamsByDataFieldsByEndUser(query: any, projection?: object, sort?: any, limit?: number): Promise; /** * * @param licensecam * @param camplaybackURL * @param starttime * @param endtime * @return Promise => array(string) = [,,..] */ getPlaybackListCamByEndUser(licensecam: string, camplaybackURL: string, starttime: any, endtime: any): Promise; /** * @example: * let province = this.vhQuerySecurityCam.getlocalProvince('5fb6780ca2148e09806c5b01'); * @param id_province * @return Object => obj = {} or null */ getlocalProvince(id_province: any): any; /** * @example: * let provinces = this.vhQuerySecurityCam.getlocalProvinces(); * @return Array(object) => array = [{},{},...] */ getlocalProvinces(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalProvinces() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalProvince(), getlocalProvinces() trong localstorage * @return Promise => null */ refreshLocalProvinces(): any; /** * @example: * this.vhQuerySecurityCam.addProvince({name:'Thành phố Hồ Chí Minh'}) .then((province)=>{ console.log('addProvince', province); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addProvince(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateProvince('5fb6780ca2148e09806c5b01', {name:'Tỉnh Đồng Nai'}) .then((bool:any)=>{ console.log('updateProvince', bool); }) * @param id_province * @param data * @return Promise => bool = true or false */ updateProvince(id_province: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteProvince('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteProvince', bool); }) * @param id_province * @return Promise => bool = true or false */ deleteProvince(id_province: string): Promise; /** * @example * this.vhQuerySecurityCam.getProvinces() .then((provinces)=>{ console.log('getProvinces', provinces); }) * @return Promise => array(object) = [{},{},..] */ private getProvinces; /** * @example: * this.vhQuerySecurityCam.addSubsProvince('5fb6780ca2148e09806c5b01',[{name:'Công An Quận Tân Bình', address: '', phoneone: '', phonetwo: '', duty: ''},{},...]) .then((subs)=>{ console.log('addSubsProvince', subs); }, error=>{ console.log('error', error); }) * @param id_province * @param data * @return Promise => object = {} hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addSubsProvince(id_province: any, dataArray: any): Promise; /** * @example: * this.vhQuerySecurityCam.updateSubProvince('5fb6780ca2148e', 'rtw554b5634573456', {name:'Công An Tỉnh Đồng Nai', address: '', phoneone: '', phonetwo: '', duty: ''}) .then((bool:any)=>{ console.log('updateSubProvince', bool); }, error=>{ console.log('error', error); }) * @param id_province * @param data * @return Promise => bool = true or false */ updateSubProvince(id_province: string, id_sub: string, data: any): Promise; /** * @example: * this.vhQuerySecurityCam.deleteSubProvince('5fb67fda87c0f21d484cbdf3', 'jhit98q2rhfn9q38900913fr') .then((bool:any)=>{ console.log('deleteSubProvince', bool); }, error=>{ reject(error) }) * @param id_province * @param id_sub * @return Promise => bool = true or false */ deleteSubProvince(id_province: string, id_sub: any): Promise; /** * @example: * this.vhQuerySecurityCam.addDistrict({name:'Quận Bình Thạnh', id_province: 'h982r9ur9hf8ur9q83'}) .then((district)=>{ console.log('addDistrict', district); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addDistrict(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateDistrict('5fb6780ca2148e09806c5b01', {name:'Quận Bình Tân'}) .then((bool:any)=>{ console.log('updateDistrict', bool); }) * @param id_district * @param data * @return Promise => bool = true or false */ updateDistrict(id_district: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteDistrict('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDistrict', bool); }) * @param id_district * @return Promise => bool = true or false */ deleteDistrict(id_district: string): Promise; /** * @example * this.vhQuerySecurityCam.getDistrict('5fb67fda87c0f21d484cbdf3') .then((district)=>{ console.log('getDistrict', district); }) * @param id_district * @return Promise => obj ={} or null */ getDistrict(id_district: string): Promise; /** * @example * this.vhQuerySecurityCam.getDistricts() .then((districts)=>{ console.log('getDistricts', districts); }) * @return Promise => array(object) = [{},{},..] */ getDistricts(): Promise; /** * @example * this.vhQuerySecurityCam.getDistricts_byIDprovince('hjkhklf8f90we8') .then((districts)=>{ console.log('getDistricts_byIDprovince', districts); }) * @param id_province * @return Promise => array(object) = [{},{},..] */ getDistricts_byIDprovince(id_province: string): Promise; /** * @example: * this.vhQuerySecurityCam.addSubsDistrict('5fb6780ca2148e09806c5b01',[{name:'Công An Quận Tân Bình', address: '', phoneone: '', phonetwo: '', duty: ''},{},...]) .then((subs)=>{ console.log('addSubsDistrict', subs); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addSubsDistrict(id_district: any, dataArray: any): Promise; /** * @example: * this.vhQueryCafe.updateSubDistrict('5fb6780ca2148e', 'rtw554b5634573456', {name:'Quận Tân Bình', address: '', phoneone: '', phonetwo: '', duty: ''}) .then((bool:any)=>{ console.log('updateSubDistrict', bool); }, error=>{ console.log('error', error); }) * @param id_district * @param data * @return Promise => bool = true or false */ updateSubDistrict(id_district: string, id_sub: string, data: any): Promise; /** * @example: * this.vhQuerySecurityCam.deleteSubDistrict('5fb67fda87c0f21d484cbdf3', 'h7662ry8fy263y') .then((bool:any)=>{ console.log('deleteSubDistrict', bool); }, error=>{ reject(error) }) * @param id_sub * @return Promise => bool = true or false */ deleteSubDistrict(id_district: string, id_sub: any): Promise; /** * @example: * this.vhQuerySecurityCam.addWard({name:'Phường 10', id_district: 'h982r9ur9hf8ur9q83'}) .then((ward)=>{ console.log('addWard', ward); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addWard(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateWard('5fb6780ca2148e09806c5b01', {name:'Quận Bình Tân'}) .then((bool:any)=>{ console.log('updateWard', bool); }) * @param id_ward * @param data * @return Promise => bool = true or false */ updateWard(id_ward: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteWard('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteWard', bool); }) * @param id_ward * @return Promise => bool = true or false */ deleteWard(id_ward: string): Promise; /** * @example * this.vhQuerySecurityCam.getWard('5fb67fda87c0f21d484cbdf3') .then((ward)=>{ console.log('getWard', ward); }) * @param id_ward * @return Promise => obj ={} or null */ getWard(id_ward: string): Promise; /** * @example * this.vhQuerySecurityCam.getWards() .then((wards)=>{ console.log('getWards', wards); }) * @return Promise => array(object) = [{},{},..] */ getWards(): Promise; /** * @example * this.vhQuerySecurityCam.getWards_byIDdistrict('hjkhklf8f90we8') .then((wards)=>{ console.log('getWards_byIDdistrict', wards); }) * @param id_district * @return Promise => array(object) = [{},{},..] */ getWards_byIDdistrict(id_district: string): Promise; /** * @example: * this.vhQuerySecurityCam.addSubsWard('5fb6780ca2148e09806c5b01',[{name:'Phường 1', address: '', phoneone: '', phonetwo: '', duty: ''},{},...]) .then((subs)=>{ console.log('addSubsWard', subs); }, error=>{ console.log('error', error); }) * @param data * @param id_ward * @return Promise => object = {} hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addSubsWard(id_ward: any, dataArray: any): Promise; /** * @example: * this.vhQuerySecurityCam.updateSubWard('5fb6780ca2148e', 'rtw554b5634573456', {name:'Phường 2', address: '', phoneone: '', phonetwo: '', duty: ''}) .then((bool:any)=>{ console.log('updateSubWard', bool); }, error=>{ console.log('error', error); }) * @param id_ward * @param data * @return Promise => bool = true or false */ updateSubWard(id_ward: string, id_sub: string, data: any): Promise; /** * @example: * this.vhQuerySecurityCam.deleteSubWard('5fb67fda87c0f21d484cbdf3','342345u9t83th0u98') .then((bool:any)=>{ console.log('deleteSubWard', bool); }, error=>{ reject(error) }) * @param id_ward * @param id_sub * @return Promise => bool = true or false */ deleteSubWard(id_ward: string, id_sub: any): Promise; private publishObservableEventRooms; private observableLocalRooms; /** * @example: * this.observableRoom = this.vhQuerySecurityCam.getObservableLocalRooms().subscribe((localRooms:any) => { do something... }) ngOnDestroy(){ this.observableRoom.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalRooms(): Observable; /** * @example: * let room = this.vhQuerySecurityCam.getlocalRoom('5fb6780ca2148e09806c5b01'); * @param id_room * @return Object => obj = {} or null */ getlocalRoom(id_room: any): any; /** * @example: * let rooms = this.vhQuerySecurityCam.getlocalRooms(); * @return Array(object) => array = [{},{},...] */ getlocalRooms(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalRooms() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalRoom(), getlocalRooms() trong localstorage * @return Promise => null */ refreshLocalRooms(): any; /** * @example: * this.vhQuerySecurityCam.addRoom({name:'camera 2', quantity:20, price:200000}) .then((room)=>{ console.log('addRoom', room); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addRoom(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateRoom('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateRoom', bool); }) * @param id_room * @param data * @return Promise => bool = true or false */ updateRoom(id_room: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteRoom('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteRoom', bool); }) * @param id_room * @return Promise => bool = true or false */ deleteRoom(id_room: string): Promise; /** * @example * this.vhQuerySecurityCam.getRoom('5fb67fda87c0f21d484cbdf3') .then((room)=>{ console.log('getRoom', room); }) * @param id_room * @return Promise => obj ={} or null */ private getRoom; /** * @example * this.vhQuerySecurityCam.getRooms() .then((rooms)=>{ console.log('getRooms', rooms); }) * @return Promise => array(object) = [{},{},..] */ private getRooms; /** * @example: * this.vhQuerySecurityCam.addPage({name:'Đội BV 1 - Page 1'}) .then((page)=>{ console.log('addPage', page); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPage(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updatePage('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePage', bool); }) * @param id_page * @param data * @return Promise => bool = true or false */ updatePage(id_page: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deletePage('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePage', bool); }) * @param id_page * @return Promise => bool = true or false */ deletePage(id_page: string): Promise; /** * @example * this.vhQuerySecurityCam.getPage('5fb67fda87c0f21d484cbdf3') .then((page)=>{ console.log('getPage', page); }) * @param id_page * @return Promise => obj ={} or null */ getPage(id_page: string): Promise; /** * @example * this.vhQuerySecurityCam.getPages() .then((pages)=>{ console.log('getPages', pages); }) * @return Promise => array(object) = [{},{},..] */ getPages(): Promise; /** * @example * this.vhQuerySecurityCam.getPages_byIDdistrict('hjkhklf8f90we8') .then((pages)=>{ console.log('getPages_byIDdistrict', pages); }) * @param id_district * @return Promise => array(object) = [{},{},..] */ getPages_byIDdistrict(id_district: string): Promise; /** * @example * this.vhQuerySecurityCam.getPages_byIDemployee('hjkhklf8f90we8') .then((pages)=>{ console.log('getPages_byIDemployee', pages); }) * @param id_employee * @return Promise => array(object) = [{},{},..] */ getPages_byIDemployee(id_employee: string): Promise; /** * @example: * this.vhQuerySecurityCam.addMonitoring({name:'Đội BV 1 - Page 1'}) .then((monitoring)=>{ console.log('addMonitoring', monitoring); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMonitoring(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateMonitoring('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMonitoring', bool); }) * @param id_monitoring * @param data * @return Promise => bool = true or false */ updateMonitoring(id_monitoring: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteMonitoring('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMonitoring', bool); }) * @param id_monitoring * @return Promise => bool = true or false */ deleteMonitoring(id_monitoring: string): Promise; /** * @example * this.vhQuerySecurityCam.getMonitoring('5fb67fda87c0f21d484cbdf3') .then((page)=>{ console.log('getMonitoring', page); }) * @param id_monitoring * @return Promise => obj ={} or null */ getMonitoring(id_monitoring: string): Promise; /** * @example * this.vhQuerySecurityCam.getMonitorings() .then((monitorings)=>{ console.log('getMonitorings', monitorings); }) * @return Promise => array(object) = [{},{},..] */ getMonitorings(): Promise; /** * @example: * this.vhQuerySecurityCam.addMonitoringTeam({name:'Đội BV 1 - Page 1'}) .then((monitoring)=>{ console.log('addMonitoringTeam', monitoring); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMonitoringTeam(data: object): Promise; /** * Cập nhật lại các trường của một doc trong collection monitorings * @example: * this.vhQuerySecurityCam.updateMonitoringTeam('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMonitoringTeam', bool); }) * @param id_monitoring_team * @param data * @return Promise => bool = true or false */ updateMonitoringTeam(id_monitoring_team: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteMonitoringTeam('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMonitoringTeam', bool); }) * @param id_monitoring_team * @return Promise => bool = true or false */ deleteMonitoringTeam(id_monitoring_team: string): Promise; /** * @example * this.vhQuerySecurityCam.getMonitoringTeam('5fb67fda87c0f21d484cbdf3') .then((page)=>{ console.log('getMonitoringTeam', page); }) * @param id_monitoring_team * @return Promise => obj ={} or null */ getMonitoringTeam(id_monitoring_team: string): Promise; /** * @example * this.vhQuerySecurityCam.getMonitors() .then((monitoring_teams)=>{ console.log('getMonitors', monitoring_teams); }) * @return Promise => array(object) = [{},{},..] */ getMonitoringTeams(): Promise; private publishObservableEventAreas; private observableLocalAreas; /** * @example: * this.observableArea = this.vhQueryCloudCam.getObservableLocalAreas().subscribe((localAreas:any) => { do something... }) ngOnDestroy(){ this.observableArea.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAreas(): Observable; /** * @example: * let area = this.vhQuerySecurityCam.getlocalArea('5fb6780ca2148e09806c5b01'); * @param id_area * @return Object => obj = {} or null */ getlocalArea(id_area: any): any; /** * @example: * let areas = this.vhQuerySecurityCam.getlocalAreas(); * @return Array(object) => array = [{},{},...] */ getlocalAreas(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalAreas() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalArea(), getlocalAreas() trong localstorage * @return Promise => null */ refreshLocalAreas(): any; /** * @example: * this.vhQuerySecurityCam.addArea({name:'camera 2', quantity:20, price:200000}) .then((area)=>{ console.log('addArea', area); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addArea(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateArea('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateArea', bool); }) * @param id_area * @param data * @return Promise => bool = true or false */ updateArea(id_area: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteArea('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteArea', bool); }) * @param id_area * @return Promise => bool = true or false */ deleteArea(id_area: string): Promise; /** * @example * this.vhQuerySecurityCam.getArea('5fb67fda87c0f21d484cbdf3') .then((area)=>{ console.log('getArea', area); }) * @param id_area * @return Promise => obj ={} or null */ private getArea; /** * @example * this.vhQuerySecurityCam.getAreas() .then((areas)=>{ console.log('getAreas', areas); }) * @return Promise => array(object) = [{},{},..] */ private getAreas; private publishObservableEventPositions; private observableLocalPositions; /** * @example: * this.observablePosition = this.vhQueryCloudCam.getObservableLocalPositions().subscribe((localPositions:any) => { do something... }) ngOnDestroy(){ this.observablePosition.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalPositions(): Observable; /** * @example: * let position = this.vhQuerySecurityCam.getlocalPosition('5fb6780ca2148e09806c5b01'); * @param id_position * @return Object => obj = {} or null */ getlocalPosition(id_position: any): any; /** * @example: * let positions = this.vhQuerySecurityCam.getlocalPositions(); * @return Array(object) => array = [{},{},...] */ getlocalPositions(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalPositions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalPosition(), getlocalPositions() trong localstorage * @return Promise => null */ refreshLocalPositions(): any; /** * @example: * this.vhQuerySecurityCam.addPosition({name:'camera 2', quantity:20, price:200000}) .then((room)=>{ console.log('addPosition', room); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addPosition(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updatePosition('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updatePosition', bool); }) * @param id_position * @param data * @return Promise => bool = true or false */ updatePosition(id_position: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deletePosition('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deletePosition', bool); }) * @param id_position * @return Promise => bool = true or false */ deletePosition(id_position: string): Promise; /** * @example * this.vhQuerySecurityCam.getPosition('5fb67fda87c0f21d484cbdf3') .then((room)=>{ console.log('getPosition', room); }) * @param id_position * @return Promise => obj ={} or null */ private getPosition; /** * @example * this.vhQuerySecurityCam.getPositions() .then((positions)=>{ console.log('getPositions', positions); }) * @return Promise => array(object) = [{},{},..] */ private getPositions; /** * @example: * let log = this.vhQuerySecurityCam.getlocalLog('5fb6780ca2148e09806c5b01'); * @param id_log * @return Object => obj = {} or null */ getlocalLog(id_log: any): any; /** * @example: * let logs = this.vhQuerySecurityCam.getlocalLogs(); * @return Array(object) => array = [{},{},...] */ getlocalLogs(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalLogs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalLog(), getlocalLogs() trong localstorage * @return Promise => null */ refreshLocalLogs(): any; /** * @example: * this.vhQuerySecurityCam.addLog({name:'camera 2', quantity:20, price:200000}) .then((log)=>{ console.log('addLog', log); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addLog(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateLog('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateLog', bool); }) * @param id_log * @param data * @return Promise => bool = true or false */ updateLog(id_log: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteLog('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteLog', bool); }) * @param id_log * @return Promise => bool = true or false */ deleteLog(id_log: string): Promise; /** * @example * this.vhQuerySecurityCam.getLog('5fb67fda87c0f21d484cbdf3') .then((log)=>{ console.log('getLog', log); }) * @param id_log * @return Promise => obj ={} or null */ getLog(id_log: string): Promise; /** * @example * this.vhQuerySecurityCam.getLogs() .then((logs)=>{ console.log('getLogs', logs); }) * @return Promise => array(object) = [{},{},..] */ getLogs(): Promise; private publishObservableEventMainboards; private observableLocalMainboards; /** * @example: * this.observableMainboard = this.vhQueryCloudCam.observableLocalMainboards().subscribe((localMainboards:any) => { do something... }) ngOnDestroy(){ this.observableMainboard.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalMainboards(): Observable; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalMainboard('5fb6780ca2148e09806c5b01'); * @param id_mainboard * @return Object => obj = {} or null */ getlocalMainboard(id_mainboard: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalMainboards(); * @return Array(object) => array = [{},{},...] */ getlocalMainboards(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalMainboards() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalMainboard(), getlocalMainboards() trong localstorage * @return Promise => null */ refreshLocalMainboards(): any; /** * @example: * this.vhQuerySecurityCam.addMainboard({name:'camera 2', quantity:20, price:200000}) .then((mainboard)=>{ console.log('addMainboard', mainboard); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMainboard(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateMainboard('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMainboard', bool); }) * @param id_mainboard * @param data * @return Promise => bool = true or false */ updateMainboard(id_mainboard: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteMainboard('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMainboard', bool); }) * @param id_mainboard * @return Promise => bool = true or false */ deleteMainboard(id_mainboard: string): Promise; /** * @example * this.vhQuerySecurityCam.getMainboard('5fb67fda87c0f21d484cbdf3') .then((mainboard)=>{ console.log('getMainboard', mainboard); }) * @param id_mainboard * @return Promise => obj ={} or null */ getMainboard(id_mainboard: string): Promise; /** * @example * this.vhQuerySecurityCam.getMainboards() .then((mainboards)=>{ console.log('getMainboards', mainboards); }) * @return Promise => array(object) = [{},{},..] */ getMainboards(): Promise; private publishObservableEventFunctions; private observableLocalFunctions; /** * @example: * this.observableFunction = this.vhQueryCloudCam.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalFunctions(): Observable; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalFunction('5fb6780ca2148e09806c5b01'); * @param id_function * @return Object => obj = {} or null */ getlocalFunction(id_function: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalFunctions(); * @return Array(object) => array = [{},{},...] */ getlocalFunctions(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalFunctions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalFunction(), getlocalFunctions() trong localstorage * @return Promise => null */ refreshLocalFunctions(): any; /** * @example: * this.vhQuerySecurityCam.addFunction({name:'camera 2', quantity:20, price:200000}) .then((func)=>{ console.log('addFunction', func); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addFunction(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateFunction('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateFunction', bool); }) * @param id_function * @param data * @return Promise => bool = true or false */ updateFunction(id_function: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteFunction('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteFunction', bool); }) * @param id_function * @return Promise => bool = true or false */ deleteFunction(id_function: string): Promise; /** * @example * this.vhQuerySecurityCam.getFunction('5fb67fda87c0f21d484cbdf3') .then((func)=>{ console.log('getFunction', func); }) * @param id_function * @return Promise => obj ={} or null */ getFunction(id_function: string): Promise; /** * @example * this.vhQuerySecurityCam.getFunctions() .then((functions)=>{ console.log('getFunctions', functions); }) * @return Promise => array(object) = [{},{},..] */ getFunctions(): Promise; private publishObservableEventComponents; private observableLocalComponents; /** * @example: * this.observableFunction = this.vhQueryCloudCam.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalComponents(): Observable; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalComponent('5fb6780ca2148e09806c5b01'); * @param id_component * @return Object => obj = {} or null */ getlocalComponent(id_component: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalComponents(); * @return Array(object) => array = [{},{},...] */ getlocalComponents(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalComponents() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalComponent(), getlocalComponents() trong localstorage * @return Promise => null */ refreshLocalComponents(): any; /** * @example: * this.vhQuerySecurityCam.addComponent({name:'camera 2', quantity:20, price:200000}) .then((component)=>{ console.log('addComponent', component); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addComponent(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateComponent('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateComponent', bool); }) * @param id_component * @param data * @return Promise => bool = true or false */ updateComponent(id_component: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteComponent('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteComponent', bool); }) * @param id_component * @return Promise => bool = true or false */ deleteComponent(id_component: string): Promise; /** * @example * this.vhQuerySecurityCam.getComponent('5fb67fda87c0f21d484cbdf3') .then((component)=>{ console.log('getComponent', component); }) * @param id_component * @return Promise => obj ={} or null */ getComponent(id_component: string): Promise; /** * @example * this.vhQuerySecurityCam.getComponents() .then((components)=>{ console.log('getComponents', components); }) * @return Promise => array(object) = [{},{},..] */ getComponents(): Promise; private publishObservableEventIcons; private observableLocalIcons; /** * @example: * this.observableIcon = this.vhQueryCloudCam.getObservableLocalIcons().subscribe((localIcons:any) => { do something... }) ngOnDestroy(){ this.observableIcon.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalIcons(): Observable; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalIcon('5fb6780ca2148e09806c5b01'); * @param id_icon * @return Object => obj = {} or null */ getlocalIcon(id_icon: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalIcons(); * @return Array(object) => array = [{},{},...] */ getlocalIcons(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalIcons() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIcon(), getlocalIcons() trong localstorage * @return Promise => null */ refreshLocalIcons(): any; /** * @example: * this.vhQuerySecurityCam.addIcon({name:'camera 2', quantity:20, price:200000}) .then((icon)=>{ console.log('addIcon', icon); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addIcon(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateIcon('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIcon', bool); }) * @param id_icon * @param data * @return Promise => bool = true or false */ updateIcon(id_icon: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteIcon('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIcon', bool); }) * @param id_icon * @return Promise => bool = true or false */ deleteIcon(id_icon: string): Promise; /** * @example * this.vhQuerySecurityCam.getIcon('5fb67fda87c0f21d484cbdf3') .then((icon)=>{ console.log('getIcon', icon); }) * @param id_icon * @return Promise => obj ={} or null */ getIcon(id_icon: string): Promise; /** * @example * this.vhQuerySecurityCam.getIcons() .then((icons)=>{ console.log('getIcons', icons); }) * @return Promise => array(object) = [{},{},..] */ getIcons(): Promise; private publishObservableEventAppSettingNameStations; private observableLocalAppSettingNameStations; /** * @example: * this.observableAppSetting = this.vhQuerySecurityCam.getObservableLocalAppSettingNameStations().subscribe((localAppSettings:any) => { do something... }) ngOnDestroy(){ this.observableAppSetting.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameStations(): Observable; /** *@example: this.vhQuerySecurityCam.getLocalAppSettingList_Branch() .then((list)=>{ console.log(list); }) * @return object => list of app_settings */ getLocalAppSettingNameStations(): any[]; /** * @example: let appsetting = this.vhQuerySecurityCam.getLocalAppSetting_Branch('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameStation(appsetting_name: any): any; /** * @example: * let branch = this.vhQuerySecurityCam.getlocalSetting('5fb6780ca2148e09806c5b01'); * @param id_branch * @return Object => obj = {} or null */ private getLocalAppSettingStation; /** * Hàm này refresh giá trị mới nhất cho hàm getLocalAppSettingList(), getLocalAppSettingStation() trong localstorage * @return Promise => null */ refreshLocalAppSettingNameStations(): any; /** * @example * this.vhQuerySecurityCam.getAppSettingStations() .then((settings)=>{ console.log('getAppSettings', settings); }) * @return Promise => array(object) = [{},{},..] */ private getAppSettingStations; /** * @example: this.vhQuerySecurityCam.updateAppSettingNameStation('ryvSD2tCHYRcpD3AYxUc', 'info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameStation(appsetting_name: any, value: any): Promise; /** * @example * this.vhQuerySecurityCam.deleteAppSettingNameStation('ryvSD2tCHYRcpD3AYxUc','info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameStation(appsetting_name: any): Promise; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalScript('5fb6780ca2148e09806c5b01'); * @param id_script * @return Object => obj = {} or null */ getlocalScript(id_script: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalScripts(); * @return Array(object) => array = [{},{},...] */ getlocalScripts(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalScripts() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript(), getlocalScripts() trong localstorage * @return Promise => null */ refreshLocalScripts(): any; /** * @example: * this.vhQuerySecurityCam.addScript({name:'camera 2', quantity:20, price:200000}) .then((script)=>{ console.log('addScript', script); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateScript('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript', bool); }) * @param id_script * @param data * @return Promise => bool = true or false */ updateScript(id_script: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteScript('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript', bool); }) * @param id_script * @return Promise => bool = true or false */ deleteScript(id_script: string): Promise; /** * @example * this.vhQuerySecurityCam.getScript('5fb67fda87c0f21d484cbdf3') .then((script)=>{ console.log('getScript', script); }) * @param id_script * @return Promise => obj ={} or null */ getScript(id_script: string): Promise; /** * @example * this.vhQuerySecurityCam.getScripts() .then((scripts)=>{ console.log('getScripts', scripts); }) * @return Promise => array(object) = [{},{},..] */ getScripts(): Promise; /** * @example: * let wallet = this.vhQuerySecurityCam.getlocalScript_detail('5fb6780ca2148e09806c5b01'); * @param id_script_detail * @return Object => obj = {} or null */ getlocalScript_detail(id_script_detail: any): any; /** * @example: * let wallets = this.vhQuerySecurityCam.getlocalScript_details(); * @return Array(object) => array = [{},{},...] */ getlocalScript_details(): any; /** * @example: * this.vhQuerySecurityCam.refreshLocalScript_details() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript_detail(), getlocalScript_details() trong localstorage * @return Promise => null */ refreshLocalScript_details(): any; /** * @example: * this.vhQuerySecurityCam.addScript_detail({name:'camera 2', quantity:20, price:200000}) .then((script_detail)=>{ console.log('addScript_detail', script_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript_detail(data: object): Promise; /** * @example: * this.vhQuerySecurityCam.updateScript_detail('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript_detail', bool); }) * @param id_script_detail * @param data * @return Promise => bool = true or false */ updateScript_detail(id_script_detail: string, data: object): Promise; /** * @example: * this.vhQuerySecurityCam.deleteScript_detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript_detail', bool); }) * @param id_script_detail * @return Promise => bool = true or false */ deleteScript_detail(id_script_detail: string): Promise; /** * @example * this.vhQuerySecurityCam.getScript_detail('5fb67fda87c0f21d484cbdf3') .then((script_detail)=>{ console.log('getScript_detail', script_detail); }) * @param id_script_detail * @return Promise => obj ={} or null */ getScript_detail(id_script_detail: string): Promise; /** * @example * this.vhQuerySecurityCam.getScript_details() .then((script_details)=>{ console.log('getScript_details', script_details); }) * @return Promise => array(object) = [{},{},..] */ getScript_details(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuerySmhome { private vhMGDB_auth; private vhMGDB_socketMongoDB; private vhMGDB_rootdatabase; private vhMGDB_database; private vhMGDB_f3rdclouds; private vhQuery; private vhAuth; private vhAlgorithm; private cameras; private rooms; private mainboards; private functions; private components; private icons; private appsettingstations; private scripts; private script_details; private logs; private hwinfo; private subjectcameras; private subjectappsettingstations; private subjectrooms; private subjectmainboards; private subjectfunctions; private subjecticons; private subjectcomponents; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhMGDB_database: VhMGDB_database, vhMGDB_f3rdclouds: VhMGDB_f3rdclouds, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @example: this.VhQuerySmhome.syncCollections().then((bool:any)=>{ if(bool){ do something... } }) * @returns Promise bool = true or false */ syncCollections(): Promise; private initSyncCollections; /** * @example: * this.vhQuerySmhome.closeSyncCollections(); * disconnect collections synchronization in the APP * @returns void */ closeSyncCollections(): void; /** * VhQuerySmhome * @returns */ private callbackCollectionInsert; private callbackCollectionUpdate; private callbackCollectionDelete; startLocalStorage(): Promise; private publishObservableEventCameras; private observableLocalCameras; /** * @example: * this.observableCamera = this.vhQueryCloudCam.getObservableLocalCameras().subscribe((localCameras:any) => { do something... }) ngOnDestroy(){ this.observableCamera.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalCameras(): Observable; /** * @example: * let wallet = this.VhQuerySmhome.getlocalCamera('5fb6780ca2148e09806c5b01'); * @param id_camera * @return Object => obj = {} or null */ getlocalCamera(id_camera: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalCameras(); * @return Array(object) => array = [{},{},...] */ getlocalCameras(): any; /** * @example: * this.VhQuerySmhome.refreshLocalCameras() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalCamera(), getlocalCameras() trong localstorage * @return Promise => null */ refreshLocalCameras(): any; /** * @example: * this.VhQuerySmhome.addCamera({name:'camera 2', url:'rtsp://admin:admin@115.78.100.57:1020/av_stream/ch0', licensecam:'pTqOFsJEndPrg7AImFxV'}) .then((camera)=>{ console.log('addCamera', camera); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 * Trường hợp không thành công: * code = 0 : licensecam không đúng * code = 1 : licensecam đã và đang được sử dụng */ addCamera(data: any): Promise; /** * @example: * this.VhQuerySmhome.updateCamera('5fb6780ca2148e09806c5b01', {name:camera 3}) .then((bool:any)=>{ console.log('updateCamera', bool); }) * @param id_camera * @param data * @return Promise => bool = true or false */ updateCamera(id_camera: string, data: any): Promise; /** * @example: * this.VhQuerySmhome.deleteCamera('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCamera', bool); }) * @param id_camera * @return Promise => bool = true or false */ deleteCamera(id_camera: string): Promise; /** * @example * this.VhQuerySmhome.getCamera('5fb67fda87c0f21d484cbdf3') .then((camera)=>{ console.log('getCamera', camera); }) * @param id_camera * @return Promise => obj ={} or null */ getCamera(id_camera: string): Promise; /** * @example * this.VhQuerySmhome.getCameras() .then((cameras)=>{ console.log('getCameras', cameras); }) * @return Promise => array(object) = [{},{},..] */ getCameras(): Promise; /** * * @param licensecam * @param camplaybackURL * @param starttime * @param endtime * @return Promise => array(string) = [,,..] */ getPlaybackListCambyEndUser(licensecam: string, camplaybackURL: string, starttime: any, endtime: any): Promise; private publishObservableEventRooms; private observableLocalRooms; /** * @example: * this.observableRoom = this.vhQueryCloudCam.getObservableLocalRooms().subscribe((localRooms:any) => { do something... }) ngOnDestroy(){ this.observableRoom.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalRooms(): Observable; /** * @example: * let wallet = this.VhQuerySmhome.getlocalRoom('5fb6780ca2148e09806c5b01'); * @param id_room * @return Object => obj = {} or null */ getlocalRoom(id_room: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalRooms(); * @return Array(object) => array = [{},{},...] */ getlocalRooms(): any; /** * @example: * this.VhQuerySmhome.refreshLocalRooms() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalRoom(), getlocalRooms() trong localstorage * @return Promise => null */ refreshLocalRooms(): any; /** * @example: * this.VhQuerySmhome.addRoom({name:'camera 2', quantity:20, price:200000}) .then((room)=>{ console.log('addRoom', room); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addRoom(data: object): Promise; /** * @example: * this.VhQuerySmhome.updateRoom('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateRoom', bool); }) * @param id_room * @param data * @return Promise => bool = true or false */ updateRoom(id_room: string, data: object): Promise; /** * @example: * this.VhQuerySmhome.deleteRoom('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteRoom', bool); }) * @param id_room * @return Promise => bool = true or false */ deleteRoom(id_room: string): Promise; /** * @example * this.VhQuerySmhome.getRoom('5fb67fda87c0f21d484cbdf3') .then((room)=>{ console.log('getRoom', room); }) * @param id_room * @return Promise => obj ={} or null */ getRoom(id_room: string): Promise; /** * @example * this.VhQuerySmhome.getRooms() .then((rooms)=>{ console.log('getRooms', rooms); }) * @return Promise => array(object) = [{},{},..] */ getRooms(): Promise; /** * @example: * let log = this.vhQuerySales.getlocalLog('5fb6780ca2148e09806c5b01'); * @param id_log * @return Object => obj = {} or null */ getlocalLog(id_log: any): any; /** * @example: * let logs = this.vhQuerySales.getlocalLogs(); * @return Array(object) => array = [{},{},...] */ getlocalLogs(): any; /** * @example: * this.vhQuerySales.refreshLocalLogs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalLog(), getlocalLogs() trong localstorage * @return Promise => null */ refreshLocalLogs(): any; /** * @example: * this.vhQuerySales.addLog({name:'camera 2', quantity:20, price:200000}) .then((log)=>{ console.log('addLog', log); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addLog(data: object): Promise; /** * @example: * this.vhQuerySales.updateLog('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateLog', bool); }) * @param id_log * @param data * @return Promise => bool = true or false */ updateLog(id_log: string, data: object): Promise; /** * @example: * this.vhQuerySales.deleteLog('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteLog', bool); }) * @param id_log * @return Promise => bool = true or false */ deleteLog(id_log: string): Promise; /** * @example * this.vhQuerySales.getLog('5fb67fda87c0f21d484cbdf3') .then((log)=>{ console.log('getLog', log); }) * @param id_log * @return Promise => obj ={} or null */ getLog(id_log: string): Promise; /** * @example * this.vhQuerySales.getLogs() .then((logs)=>{ console.log('getLogs', logs); }) * @return Promise => array(object) = [{},{},..] */ getLogs(): Promise; private publishObservableEventMainboards; private observableLocalMainboards; /** * @example: * this.observableMainboard = this.vhQueryCloudCam.observableLocalMainboards().subscribe((localMainboards:any) => { do something... }) ngOnDestroy(){ this.observableMainboard.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalMainboards(): Observable; /** * @example: * let wallet = this.VhQuerySmhome.getlocalMainboard('5fb6780ca2148e09806c5b01'); * @param id_mainboard * @return Object => obj = {} or null */ getlocalMainboard(id_mainboard: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalMainboards(); * @return Array(object) => array = [{},{},...] */ getlocalMainboards(): any; /** * @example: * this.VhQuerySmhome.refreshLocalMainboards() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalMainboard(), getlocalMainboards() trong localstorage * @return Promise => null */ refreshLocalMainboards(): any; /** * @example: * this.VhQuerySmhome.addMainboard({name:'camera 2', quantity:20, price:200000}) .then((mainboard)=>{ console.log('addMainboard', mainboard); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addMainboard(data: object): Promise; /** * @example: * this.VhQuerySmhome.updateMainboard('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateMainboard', bool); }) * @param id_mainboard * @param data * @return Promise => bool = true or false */ updateMainboard(id_mainboard: string, data: object): Promise; /** * @example: * this.VhQuerySmhome.deleteMainboard('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteMainboard', bool); }) * @param id_mainboard * @return Promise => bool = true or false */ deleteMainboard(id_mainboard: string): Promise; /** * @example * this.VhQuerySmhome.getMainboard('5fb67fda87c0f21d484cbdf3') .then((mainboard)=>{ console.log('getMainboard', mainboard); }) * @param id_mainboard * @return Promise => obj ={} or null */ getMainboard(id_mainboard: string): Promise; /** * @example * this.VhQuerySmhome.getMainboards() .then((mainboards)=>{ console.log('getMainboards', mainboards); }) * @return Promise => array(object) = [{},{},..] */ getMainboards(): Promise; private publishObservableEventFunctions; private observableLocalFunctions; /** * @example: * this.observableFunction = this.vhQueryCloudCam.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalFunctions(): Observable; /** * @example: * let wallet = this.VhQuerySmhome.getlocalFunction('5fb6780ca2148e09806c5b01'); * @param id_function * @return Object => obj = {} or null */ getlocalFunction(id_function: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalFunctions(); * @return Array(object) => array = [{},{},...] */ getlocalFunctions(): any; /** * @example: * this.VhQuerySmhome.refreshLocalFunctions() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalFunction(), getlocalFunctions() trong localstorage * @return Promise => null */ refreshLocalFunctions(): any; /** * @example: * this.VhQuerySmhome.addFunction({name:'camera 2', quantity:20, price:200000}) .then((func)=>{ console.log('addFunction', func); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addFunction(data: object): Promise; /** * @example: * this.VhQuerySmhome.updateFunction('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateFunction', bool); }) * @param id_function * @param data * @return Promise => bool = true or false */ updateFunction(id_function: string, data: object): Promise; /** * @example: * this.VhQuerySmhome.deleteFunction('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteFunction', bool); }) * @param id_function * @return Promise => bool = true or false */ deleteFunction(id_function: string): Promise; /** * @example * this.VhQuerySmhome.getFunction('5fb67fda87c0f21d484cbdf3') .then((func)=>{ console.log('getFunction', func); }) * @param id_function * @return Promise => obj ={} or null */ getFunction(id_function: string): Promise; /** * @example * this.VhQuerySmhome.getFunctions() .then((functions)=>{ console.log('getFunctions', functions); }) * @return Promise => array(object) = [{},{},..] */ getFunctions(): Promise; private publishObservableEventComponents; private observableLocalComponents; /** * @example: * this.observableFunction = this.vhQueryCloudCam.getObservableLocalFunctions().subscribe((localFunctions:any) => { do something... }) ngOnDestroy(){ this.observableFunction.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalComponents(): Observable; /** * @example: * let wallet = this.VhQuerySmhome.getlocalComponent('5fb6780ca2148e09806c5b01'); * @param id_component * @return Object => obj = {} or null */ getlocalComponent(id_component: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalComponents(); * @return Array(object) => array = [{},{},...] */ getlocalComponents(): any; /** * @example: * this.VhQuerySmhome.refreshLocalComponents() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalComponent(), getlocalComponents() trong localstorage * @return Promise => null */ refreshLocalComponents(): any; /** * @example: * this.VhQuerySmhome.addComponent({name:'camera 2', quantity:20, price:200000}) .then((component)=>{ console.log('addComponent', component); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addComponent(data: object): Promise; /** * @example: * this.vhQuerySmhome.updateComponent('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateComponent', bool); }) * @param id_component * @param data * @return Promise => bool = true or false */ updateComponent(id_component: string, data: object): Promise; /** * @example: * this.vhQuerySmhome.deleteComponent('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteComponent', bool); }) * @param id_component * @return Promise => bool = true or false */ deleteComponent(id_component: string): Promise; /** * @example * this.vhQuerySmhome.getComponent('5fb67fda87c0f21d484cbdf3') .then((component)=>{ console.log('getComponent', component); }) * @param id_component * @return Promise => obj ={} or null */ getComponent(id_component: string): Promise; /** * @example * this.vhQuerySmhome.getComponents() .then((components)=>{ console.log('getComponents', components); }) * @return Promise => array(object) = [{},{},..] */ getComponents(): Promise; /** * @example: * let data = { * name: 'TCL', * code_type: 10, * type: 1 * } * this.vhQuerySmhome.addIRManufacturer_byID('5fb6780ca2148e09806c5b01', data) .then((IRmanufacturer)=>{ console.log('addIRManufacturer', IRmanufacturer); },(error:any)=>{ console.log('error', error); }) * @param id_IRmanufacturer * @param data : {} * @return Promise => obj = {} /error * 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 */ addIRManufacturer_byID(id_IRmanufacturer: string, data: object): Promise; /** * @example: * this.vhQuerySmhome.updateIRManufacturer('5fb6780ca2148e09806c5b01', {code_type: 9}) .then(()=>{ console.log('updateIRManufacturer'); }, error=>{ console.log('error'); }) * @param id_IRmanufacturer * @param value : {} * @return Promise => response = undefined / error */ updateIRManufacturer(id_IRmanufacturer: string, value: object): Promise; /** * @example: * this.vhQuerySmhome.deleteIRManufacturer('5fb67fda87c0f21d484cbdf3') .then(()=>{ console.log('deleteIRManufacturer'); }) * @param id_IRmanufacturer * @return Promise => response = undefined / error */ deleteIRManufacturer(id_IRmanufacturer: string): Promise; /** * @example * this.vhQuerySmhome.getIRManufacturer('5fb67fda87c0f21d484cbdf3') .then((IRmanufacturer)=>{ console.log('getIRManufacturer', IRmanufacturer); },(error:any)=>{ console.log('error', error); }) * @param id_IRmanufacturer * @return Promise => response ={} or null / error */ getIRManufacturer(id_IRmanufacturer: string): Promise; /** * @example * this.vhQuerySmhome.getIRManufacturers(1) .then((IRmanufacturers)=>{ console.log('getIRManufacturers', IRmanufacturers); }, error=>{ console.log(error, error); }) * @return Promise => array(object) = [{},{},..] */ getIRManufacturers(type: number): Promise; private publishObservableEventIcons; private observableLocalIcons; /** * @example: * this.observableIcon = this.vhQueryCloudCam.getObservableLocalIcons().subscribe((localIcons:any) => { do something... }) ngOnDestroy(){ this.observableIcon.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalIcons(): Observable; /** * @example: * let wallet = this.VhQuerySmhome.getlocalIcon('5fb6780ca2148e09806c5b01'); * @param id_icon * @return Object => obj = {} or null */ getlocalIcon(id_icon: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalIcons(); * @return Array(object) => array = [{},{},...] */ getlocalIcons(): any; /** * @example: * this.VhQuerySmhome.refreshLocalIcons() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalIcon(), getlocalIcons() trong localstorage * @return Promise => null */ refreshLocalIcons(): any; /** * @example: * this.VhQuerySmhome.addIcon({name:'camera 2', quantity:20, price:200000}) .then((icon)=>{ console.log('addIcon', icon); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addIcon(data: object): Promise; /** * @example: * this.VhQuerySmhome.updateIcon('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateIcon', bool); }) * @param id_icon * @param data * @return Promise => bool = true or false */ updateIcon(id_icon: string, data: object): Promise; /** * @example: * this.VhQuerySmhome.deleteIcon('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteIcon', bool); }) * @param id_icon * @return Promise => bool = true or false */ deleteIcon(id_icon: string): Promise; /** * @example * this.VhQuerySmhome.getIcon('5fb67fda87c0f21d484cbdf3') .then((icon)=>{ console.log('getIcon', icon); }) * @param id_icon * @return Promise => obj ={} or null */ getIcon(id_icon: string): Promise; /** * @example * this.VhQuerySmhome.getIcons() .then((icons)=>{ console.log('getIcons', icons); }) * @return Promise => array(object) = [{},{},..] */ getIcons(): Promise; private publishObservableEventAppSettingNameStations; private observableLocalAppSettingNameStations; /** * @example: * this.observableAppSetting = this.VhQuerySmhome.getObservableLocalAppSettingNameStations().subscribe((localAppSettings:any) => { do something... }) ngOnDestroy(){ this.observableAppSetting.unsubscribe(); } * @returns Observerble (Array) => Array(object) => array = [{},{},...] */ getObservableLocalAppSettingNameStations(): Observable; /** *@example: this.VhQuerySmhome.getLocalAppSettingNameStations() .then((list)=>{ console.log(list); }) * @return object => list of appsetting_names */ getLocalAppSettingNameStations(): any[]; /** * @example: let appsetting = this.VhQuerySmhome.getLocalAppSettingNameStation('info_header_footer_bill'); console.log(appsetting); * @param appsetting_name * @return object => {title:'title',name:'name', quantity: 10} */ getLocalAppSettingNameStation(appsetting_name: any): any; /** * @example: * let appsetting = this.VhQuerySmhome.getLocalAppSettingStation('5fb6780ca2148e09806c5b01'); * @param id_appsetting * @return Object => obj = {} or null */ private getLocalAppSettingStation; /** * Hàm này refresh giá trị mới nhất cho hàm getLocalAppSettingNameStations(), getLocalAppSettingNameStation() trong localstorage * @return Promise => null */ refreshLocalAppSettingNameStations(): any; /** * @example * this.VhQuerySmhome.getAppSettingStations() .then((settings)=>{ console.log('getAppSettings', settings); }) * @return Promise => array(object) = [{},{},..] */ private getAppSettingStations; /** * @example: this.VhQuerySmhome.updateAppSettingNameStation('info_header_footer_bill',{title:'title',name:'name'}) .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @param value * @format value = {title:'title',name:'name'} * @return Promise Boolean => bool = true or false */ updateAppSettingNameStation(appsetting_name: any, value: any): Promise; /** * @example * this.VhQuerySmhome.deleteAppSettingNameStation('info_header_footer_bill') .then((bool:any)=>{ console.log(bool); }) * @param appsetting_name * @return Promise Boolean => bool = true or false */ deleteAppSettingNameStation(appsetting_name: any): Promise; /** * @example: * let wallet = this.VhQuerySmhome.getlocalScript('5fb6780ca2148e09806c5b01'); * @param id_script * @return Object => obj = {} or null */ getlocalScript(id_script: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalScripts(); * @return Array(object) => array = [{},{},...] */ getlocalScripts(): any; /** * @example: * this.VhQuerySmhome.refreshLocalScripts() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript(), getlocalScripts() trong localstorage * @return Promise => null */ refreshLocalScripts(): any; /** * @example: * this.VhQuerySmhome.addScript({name:'camera 2', quantity:20, price:200000}) .then((script)=>{ console.log('addScript', script); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript(data: object): Promise; /** * @example: * this.VhQuerySmhome.updateScript('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript', bool); }) * @param id_script * @param data * @return Promise => bool = true or false */ updateScript(id_script: string, data: object): Promise; /** * @example: * this.VhQuerySmhome.deleteScript('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript', bool); }) * @param id_script * @return Promise => bool = true or false */ deleteScript(id_script: string): Promise; /** * @example * this.VhQuerySmhome.getScript('5fb67fda87c0f21d484cbdf3') .then((script)=>{ console.log('getScript', script); }) * @param id_script * @return Promise => obj ={} or null */ getScript(id_script: string): Promise; /** * @example * this.VhQuerySmhome.getScripts() .then((scripts)=>{ console.log('getScripts', scripts); }) * @return Promise => array(object) = [{},{},..] */ getScripts(): Promise; /** * @example: * let wallet = this.VhQuerySmhome.getlocalScript_detail('5fb6780ca2148e09806c5b01'); * @param id_script_detail * @return Object => obj = {} or null */ getlocalScript_detail(id_script_detail: any): any; /** * @example: * let wallets = this.VhQuerySmhome.getlocalScript_details(); * @return Array(object) => array = [{},{},...] */ getlocalScript_details(): any; /** * @example: * this.VhQuerySmhome.refreshLocalScript_details() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalScript_detail(), getlocalScript_details() trong localstorage * @return Promise => null */ refreshLocalScript_details(): any; /** * @example: * this.VhQuerySmhome.addScript_detail({name:'camera 2', quantity:20, price:200000}) .then((script_detail)=>{ console.log('addScript_detail', script_detail); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addScript_detail(data: object): Promise; /** * @example: * this.VhQuerySmhome.updateScript_detail('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateScript_detail', bool); }) * @param id_script_detail * @param data * @return Promise => bool = true or false */ updateScript_detail(id_script_detail: string, data: object): Promise; /** * @example: * this.VhQuerySmhome.deleteScript_detail('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteScript_detail', bool); }) * @param id_script_detail * @return Promise => bool = true or false */ deleteScript_detail(id_script_detail: string): Promise; /** * @example * this.VhQuerySmhome.getScript_detail('5fb67fda87c0f21d484cbdf3') .then((script_detail)=>{ console.log('getScript_detail', script_detail); }) * @param id_script_detail * @return Promise => obj ={} or null */ getScript_detail(id_script_detail: string): Promise; /** * @example * this.VhQuerySmhome.getScript_details() .then((script_details)=>{ console.log('getScript_details', script_details); }) * @return Promise => array(object) = [{},{},..] */ getScript_details(): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class HttpLoaderFactory implements TranslateLoader { http: HttpClient; constructor(http: HttpClient); getTranslation(lang: string): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class DefaultLanguage { private translate; constructor(translate: TranslateService); list(): any[]; get(): any; set(value: any): any; syncExistedLanguage(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhDriver { private bluetoothSerial; private socketId; private win; private device; private ESC; private GS; private InitializePrinter; private BoldOn; private BoldOff; private DoubleHeight; private DoubleWidth; private DoubleOn; private DoubleOff; private PrintAndFeedMaxLine; private TextAlignLeft; private TextAlignCenter; private TextAlignRight; private commend; private cutpaper; private whiteblackmode; private leftmargin; private bitmap; private font; private linefeed; private dots; constructor(bluetoothSerial: BluetoothSerial); /** * let div = document.getElementById('my-node') */ BluetoothSerialPrinter(): { search(): Promise; printInvoice(value: any, div: any): Promise; }; /** * let div = document.getElementById('my-node') * @returns */ IPSerialPrinter(): { printInvoice(value: any, div: any): Promise; }; private getImageData; private rawPrint; private useEscPrintImage; private rgbToPixel; private threshold; private toEscPrintData; private encodeCommand; private PrintAndFeedLine; private CutAndFeedLine; private printAndFeedLine; private cutAndFeedLine; private printImage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhMqttService { private mqttService; private wifiWizard2; boolean: boolean; constructor(mqttService: MqttService, wifiWizard2: WifiWizard2); /** * @example: * this.subscription = this.vhMqttService.callbackTopic(this.iot_id+this.iot_topic_string).subscribe((data)=>{ //Cách dùng 1: let value = { topic: data.topic, value: data.payload.toString(), date : new Date() }; //Cách dùng 2: let value = { topic: data.topic, value: this.vhAlgorithmconvert_STRING2OBJECT(data.payload.toString()), date : new Date() }; //Cách dùng 3: let json = this.vhAlgorithmconvert_STRING2OBJECT(data.payload.toString()); }) * Lưu ý: * import { Subscription } from 'rxjs'; * subscription: Subscription; * this.subscription = callbackTopic.... * if (this.subscription) this.subscription.unsubscribe(); * @param iotID * @param topic */ callbackTopic(iotID: any, topic?: any): Observable; /** * @example 1: * let obj = { ptype:1, value: { slave:2, addr:3100 } }; this.vhMqttService.publish(this.iot_id, this.vhAlgorithmconvert_OBJECT2STRING(obj)); * @example 2: this.vhMqttService.publish("CCC27BAE114C", "{\"ptype\":1,\"value\":{\"slave\":2,\"addr\":3100}}"); * @param iotID * @param message * @param topic */ publish(iotID: any, message: any, topic?: any): void; /** * @example: * let value:any = { ssid: 'Carol-BH', password: '123456789' } this.vhMqttService.startESPsmartconfig(value) .then(iotid=>{ if(iotid != ''){ console.log('iotid', iotid) } },(error:any)=>{ console.log(error); }) * @param value * @return Promise => iotid */ startESPsmartconfig(value: any): Promise; stopESPsmartconfig(): Promise; /** * @example: * this.vhMqttService.getConnectedSSID() .then((ssid)=>{ console.log('ssid: ', ssid); }) * @return Promise => SSID */ getConnectedSSID(): Promise; private getIotID; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuerySalesWebUser { private vhMGDB_database; private vhQuery; private vhAuth; private vhAlgorithm; constructor(vhMGDB_database: VhMGDB_database, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @example * this.vhQuerySalesWebUser.getBranch('5fb67fda87c0f21d484cbdf3') .then((branch)=>{ console.log('getBranch', branch); },(error:any)=>{ reject(error); }) * @param id_branch * @return Promise => obj ={} or null */ getBranch(id_branch: string): Promise; /** * @example * this.vhQuerySalesWebUser.getBranchs() .then((branchs)=>{ console.log('getBranchs', branchs); },(error:any)=>{ reject(error); }) * @return Promise => array(object) = [{},{},..] */ getBranchs(): Promise; /** * @example * this.vhQuerySalesWebUser.getProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getProduct', product); }, error=>{ reject(error) }) * @param id_product * @return false or object */ getProduct(id_product: string): Promise; /** * @example: * this.vhQuerySalesWebUser.getProductsByFields({name:{$eq:'name abc'}}, {},{},0) .then((products)=>{ console.log('getProductsByFields', products); },(error:any)=>{ console.log('error', error); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getProductsByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example * this.vhQuerySalesWebUser.getCategory('5fb67fda87c0f21d484cbdf3') .then((category)=>{ console.log('getCategory', category); }) * @param id_category * @return Promise => obj ={} or null */ getCategory(id_category: string): Promise; /** * @example * this.vhQuerySalesWebUser.getCategorys() .then((categorys)=>{ console.log('getCategorys', categorys); }) * @return Promise => array(object) = [{},{},..] */ getCategorys(): Promise; /** * @example: * this.vhQuerySalesWebUser.getCategorysByFields({name:{$eq:'name abc'}}, {},{},0) .then((categorys)=>{ console.log('getCategorysByFields', categorys); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getCategorysByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuerySalesWebAdmin { private vhMGDB_database; private vhQuery; private vhAuth; private vhAlgorithm; constructor(vhMGDB_database: VhMGDB_database, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @example * this.vhQuerySalesWebAdmin.getBranch('5fb67fda87c0f21d484cbdf3') .then((branch)=>{ console.log('getBranch', branch); },(error:any)=>{ reject(error); }) * @param id_branch * @return Promise => obj ={} or null */ getBranch(id_branch: string): Promise; /** * @example * this.vhQuerySalesWebAdmin.getBranchs() .then((branchs)=>{ console.log('getBranchs', branchs); },(error:any)=>{ reject(error); }) * @return Promise => array(object) = [{},{},..] */ getBranchs(): Promise; /** * @example: * this.vhQuerySalesWebAdmin.addProduct({name:'camera 2', quantity:20, price:200000}) .then((product)=>{ console.log('addProduct', product); }, error=>{ console.log('error', error); }) * @param data : object * @return Promise => object = {} * 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 */ addProduct(data: any): Promise; /** * @example: * this.vhQuerySalesWebAdmin.updateProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateProduct(id_product: string, data: object): Promise; /** * @example: * this.vhQuerySalesWebAdmin.deleteProduct('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDoc', bool); }, error=>{ reject(error) }) * @param id_product * @return Promise => bool = true or false */ deleteProduct(id_product: string): Promise; /** * @example * this.vhQuerySalesWebAdmin.getProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getProduct', product); }) * @param id_product * @return false or object */ getProduct(id_product: string): Promise; /** * @example: * this.vhQuerySalesWebAdmin.getProductsByFields({name:{$eq:'name abc'}}, {},{},0) .then((products)=>{ console.log('getProductsByFields', products); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getProductsByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQuerySalesWebAdmin.addCategory({name:'Danh mục 1'}) .then((category)=>{ console.log('addCategory', category); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCategory(data: object): Promise; /** * @example: * this.vhQuerySalesWebAdmin.updateCategory('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCategory', bool); }) * @param id_category * @param data * @return Promise => bool = true or false */ updateCategory(id_category: string, data: object): Promise; /** * @example: * this.vhQuerySalesWebAdmin.deleteCategory('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCategory', bool); }) * @param id_category * @return Promise => bool = true or false */ deleteCategory(id_category: string): Promise; /** * @example * this.vhQuerySalesWebAdmin.getCategory('5fb67fda87c0f21d484cbdf3') .then((category)=>{ console.log('getCategory', category); }) * @param id_category * @return Promise => obj ={} or null */ getCategory(id_category: string): Promise; /** * @example * this.vhQuerySalesWebAdmin.getCategorys() .then((categorys)=>{ console.log('getCategorys', categorys); }) * @return Promise => array(object) = [{},{},..] */ getCategorys(): Promise; /** * @example: * this.vhQuerySalesWebAdmin.getCategorysByFields({name:{$eq:'name abc'}}, {},{},0) .then((categorys)=>{ console.log('getCategorysByFields', categorys); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getCategorysByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryCafeWebUser { private vhMGDB_database; private vhQuery; private vhAuth; private vhAlgorithm; constructor(vhMGDB_database: VhMGDB_database, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); /** * @example * this.vhQueryCafeWebUser.getBranch('5fb67fda87c0f21d484cbdf3') .then((branch)=>{ console.log('getBranch', branch); },(error:any)=>{ reject(error); }) * @param id_branch * @return Promise => obj ={} or null */ getBranch(id_branch: string): Promise; /** * @example * this.vhQueryCafeWebUser.getBranchs() .then((branchs)=>{ console.log('getBranchs', branchs); },(error:any)=>{ reject(error); }) * @return Promise => array(object) = [{},{},..] */ getBranchs(): Promise; /** * @example * this.vhQueryCafeWebUser.getProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getProduct', product); }, error=>{ reject(error) }) * @param id_product * @return false or object */ getProduct(id_product: string): Promise; /** * @example: * this.vhQueryCafeWebUser.getProductsByFields({name:{$eq:'name abc'}}, {},{},0) .then((products)=>{ console.log('getProductsByFields', products); },(error:any)=>{ console.log('error', error); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getProductsByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example * this.vhQueryCafeWebUser.getCategory('5fb67fda87c0f21d484cbdf3') .then((category)=>{ console.log('getCategory', category); }) * @param id_category * @return Promise => obj ={} or null */ getCategory(id_category: string): Promise; /** * @example * this.vhQueryCafeWebUser.getCategorys() .then((categorys)=>{ console.log('getCategorys', categorys); }) * @return Promise => array(object) = [{},{},..] */ getCategorys(): Promise; /** * @example: * this.vhQueryCafeWebUser.getCategorysByFields({name:{$eq:'name abc'}}, {},{},0) .then((categorys)=>{ console.log('getCategorysByFields', categorys); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getCategorysByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQueryCafeWebAdmin { private vhMGDB_database; private vhQuery; private vhAuth; private vhAlgorithm; private products; constructor(vhMGDB_database: VhMGDB_database, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm); private getlocalProductAndCombosAndToppings; /** * @example: * let product = this.vhQueryCafe.getlocalProduct('5fb6780ca2148e09806c5b01'); * @param id_product * @return Object => obj = {} or null */ private getlocalProduct; /** * @example * this.vhQueryCafeWebAdmin.getBranch('5fb67fda87c0f21d484cbdf3') .then((branch)=>{ console.log('getBranch', branch); },(error:any)=>{ reject(error); }) * @param id_branch * @return Promise => obj ={} or null */ getBranch(id_branch: string): Promise; /** * @example * this.vhQueryCafeWebAdmin.getBranchs() .then((branchs)=>{ console.log('getBranchs', branchs); },(error:any)=>{ reject(error); }) * @return Promise => array(object) = [{},{},..] */ getBranchs(): Promise; /** * @example: * this.vhQueryCafeWebAdmin.addProduct({name:'camera 2', quantity:20, price:200000}) .then((product)=>{ console.log('addProduct', product); }, error=>{ console.log('error', error); }) * @param data * @return Promise => object = {} * 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 */ addProduct(data: any): Promise; /** * @example: * this.vhQueryCafeWebAdmin.addSubsProduct('5fb6780ca2148e09806c5b01',[{price:0, name:'small'},{},...]) .then((subproducts)=>{ console.log('addSubsProduct', subproducts); }, error=>{ console.log('error', error); }) * @param id_product * @param id_product * @return Promise => object = {} hoặc null * Luu ý: chỉ có 2 trường hợp, hoặc là thêm thành công, hoặc là null */ addSubsProduct(id_product: any, dataArray: any): Promise; /** * @example: * this.vhQueryCafeWebAdmin.updateSubProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateSubProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param id_subproduct * @param data * @return Promise => bool = true or false */ updateSubProduct(id_product: string, id_subproduct: string, data: object): Promise; /** * @example: * this.vhQueryCafeWebAdmin.deleteSubProduct('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDoc', bool); }, error=>{ reject(error) }) * @param id_product * @param id_subproduct * @return Promise => bool = true or false */ deleteSubProduct(id_product: string, id_subproduct: string): Promise; /** * @example: * this.vhQueryCafeWebAdmin.updateProduct('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateProduct', bool); }, error=>{ console.log('error', error); }) * @param id_product * @param data * @return Promise => bool = true or false */ updateProduct(id_product: string, data: object): Promise; /** * @example: * this.vhQueryCafeWebAdmin.deleteProduct('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDoc', bool); }, error=>{ reject(error) }) * @param id_product * @return Promise => bool = true or false */ deleteProduct(id_product: string): Promise; /** * @example * this.vhQueryCafeWebAdmin.getProduct('5fb67fda87c0f21d484cbdf3') .then((product)=>{ console.log('getProduct', product); }) * @param id_product * @return false or object */ getProduct(id_product: string): Promise; /** * @example: * this.vhQueryCafeWebAdmin.getProductsByFields({name:{$eq:'name abc'}}, {},{},0) .then((products)=>{ console.log('getProductsByFields', products); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getProductsByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; /** * @example: * this.vhQueryCafeWebAdmin.addCategory({name:'Danh mục 1'}) .then((category)=>{ console.log('addCategory', category); },(error:any)=>{ console.log('error', error); }) * @param colname * @param data * @return Promise => obj = {} * 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 */ addCategory(data: object): Promise; /** * @example: * this.vhQueryCafeWebAdmin.updateCategory('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateCategory', bool); }) * @param id_category * @param data * @return Promise => bool = true or false */ updateCategory(id_category: string, data: object): Promise; /** * @example: * this.vhQueryCafeWebAdmin.deleteCategory('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteCategory', bool); }) * @param id_category * @return Promise => bool = true or false */ deleteCategory(id_category: string): Promise; /** * @example * this.vhQueryCafeWebAdmin.getCategory('5fb67fda87c0f21d484cbdf3') .then((category)=>{ console.log('getCategory', category); }) * @param id_category * @return Promise => obj ={} or null */ getCategory(id_category: string): Promise; /** * @example * this.vhQueryCafeWebAdmin.getCategorys() .then((categorys)=>{ console.log('getCategorys', categorys); }) * @return Promise => array(object) = [{},{},..] */ getCategorys(): Promise; /** * @example: * this.vhQueryCafeWebAdmin.getCategorysByFields({name:{$eq:'name abc'}}, {},{},0) .then((categorys)=>{ console.log('getCategorysByFields', categorys); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getCategorysByFields(query: object, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhQuerySMS { private vhMGDB_auth; private vhMGDB_rootdatabase; private vhMGDB_database; private vhMGDB_socketMongoDB; private vhMGDB_tiki; private vhMGDB_sendo; private vhMGDB_lazada; private vhMGDB_socketFacebook; private vhMGDB_paymentVNPAY; private vhQuery; private vhAuth; private vhAlgorithm; private vhDisplayLEDService; private iap2; private platform; private hwinfo; constructor(vhMGDB_auth: VhMGDB_auth, vhMGDB_rootdatabase: VhMGDB_rootdatabase, vhMGDB_database: VhMGDB_database, vhMGDB_socketMongoDB: VhMGDB_socketMongoDB, vhMGDB_tiki: VhMGDB_tiki, vhMGDB_sendo: VhMGDB_sendo, vhMGDB_lazada: VhMGDB_lazada, vhMGDB_socketFacebook: VhMGDB_socketFacebook, vhMGDB_paymentVNPAY: VhMGDB_paymentVNPAY, vhQuery: VhQuery, vhAuth: VhAuth, vhAlgorithm: VhAlgorithm, vhDisplayLEDService: VhDisplayLEDService, iap2: InAppPurchase2, platform: Platform); /** * @example: * this.vhQuerySMS.updateSKHDT('5fb6780ca2148e09806c5b01', {name: 'Quảng cáo 1'}) .then((bool:any)=>{ console.log('updateSKHDT', bool); }, error=>{ console.log('error', error); }) * @param id_skhdt * @param data * @return Promise => bool = true or false */ updateSKHDT(id_skhdt: string, data: object): Promise; /** * @example: * this.vhQuerySMS.deleteSKHDT('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteSKHDT', bool); }, error=>{ reject(error) }) * @param id_skhdt * @return Promise => bool = true or false */ deleteSKHDT(id_skhdt: string): Promise; /** * @example: * let time = new Date(); * time.setDate(time.getDate()-7); * this.vhQuerySMS.getSKHDTs_byFields({date:{$gte:time}, {bill_type:{$eq:5}}, {},{date:1},0) .then((skhdts)=>{ console.log('getSKHDTs_byFields', skhdts); }) * @param query * @param projection — đang tìm hiểu, tạm thời để giá trị là {} * @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 * @param limit — null hoặc 0: không giới hạn record get về; 2: get về 2 record * @return — Array -> array = [{},{},...] */ getSKHDTs_byFields(query: object, projection?: object, sort?: object, limit?: number): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** Các phương thức tương đương trong file preloader.js cảu bản build electron */ export interface IElectronAPI { send: (channel: string, data?: any) => void; invoke: (channel: string, data?: any) => Promise; on: (channel: string, func: (...args: any[]) => void) => void; off: (channel: string) => void; scanPorts: () => Promise; openPort: (options: { port: string; baudrate: number; }) => Promise; checkPort: () => Promise; closePort: () => Promise; clean: () => Promise; writeLine: (text: string) => Promise; writeLineAtPos: (text: string, position: number) => Promise; writeLinesAtPos: (textLine1: string, textLine2: string, position: number) => Promise; } declare global { interface Window { electronAPI: IElectronAPI; } } export declare class VhDisplayLEDService { private vhMGDB_database; private platform; private vhAuth; private displayLEDs; private hwinfo; constructor(vhMGDB_database: VhMGDB_database, platform: Platform, vhAuth: VhAuth); scanPorts(): Promise; openPort(port: string, baudrate: number): Promise; checkPort(): Promise; closePort(): Promise; clean(): Promise; writeLine(text: string): Promise; writeLineAtPos(text: string, position: number): Promise; writeLinesAtPos(textLine1: string, textLine2: string, position: number): Promise; /** * @example: * let displayLED = this.vhDisplayLEDService.getlocalDisplayLED('5fb6780ca2148e09806c5b01'); * @param id_displayLED * @return Object => obj = {} or null */ getlocalDisplayLED(id_displayLED: any): any; /** * @example * let displayLEDs = this.vhDisplayLEDService.getlocalDisplayLEDs(); * @return Array(object) => array = [{},{},...] */ getlocalDisplayLEDs(): any; updateLocalDisplayLEDs(id_displayLED: string, value: any): void; /** * @example: * this.vhDisplayLEDService.refreshLocalDisplayLEDs() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalDisplayLED(), getlocalDisplayLEDs() trong localstorage * @return Promise => null */ refreshLocalDisplayLEDs(): any; /** * @example: * this.vhDisplayLEDService.refreshLocalDisplayLEDs_byEnable() .then(()=>{ do something..... }) * Hàm này refresh giá trị mới nhất cho hàm getlocalDisplayLED(), getlocalDisplayLEDs() trong localstorage * @return Promise => null */ refreshLocalDisplayLEDs_byEnable(): any; /** * @example: * this.vhDisplayLEDService.addDisplayLED({name:'camera 2', quantity:20, price:200000}) .then((displayLED)=>{ console.log('addDisplayLED', displayLED); }, error=>{ console.log('error', error); }) * @param data * Promise => object = {} 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 */ addDisplayLED(data: any): Promise; /** * @example: * this.vhDisplayLEDService.updateDisplayLED('5fb6780ca2148e09806c5b01', {quantity:400}) .then((bool:any)=>{ console.log('updateDisplayLED', bool); }, error=>{ console.log('error', error); }) * @param id_displayLED * @param data * @return Promise => bool = true or false */ updateDisplayLED(id_displayLED: string, data: object): Promise; /** * @example: * this.vhDisplayLEDService.deleteDisplayLED('5fb67fda87c0f21d484cbdf3') .then((bool:any)=>{ console.log('deleteDisplayLED', bool); }) * @param id_displayLED * @return Promise => bool = true or false */ deleteDisplayLED(id_displayLED: string): Promise; /** * @example * this.vhDisplayLEDService.getDisplayLED('5fb67fda87c0f21d484cbdf3') .then((displayLED)=>{ console.log('getDisplayLED', displayLED); }) * @param id_displayLED * @return false or object */ private getDisplayLED; /** * @example * this.vhDisplayLEDService.getDisplayLEDs() .then((displayLEDs)=>{ console.log('getDisplayLEDs', displayLEDs); }) * @return array(object) = [{},{},..] */ getDisplayLEDs(): Promise; /** * @example * this.vhDisplayLEDService.getDisplayLEDs_byEnable() .then((displayLEDs)=>{ console.log('getDisplayLEDs_byEnable', displayLEDs); }) * @return array(object) = [{},{},..] */ getDisplayLEDs_byEnable(): Promise; /** * @example: * let displayMode = this.vhDisplayLEDService.getlocalDisplayMode(1); * @param type * @return Object => obj = {} or null */ getlocalDisplayMode(type: number): { name: string; type: number; } | null; /** * @example * let displayModes = this.vhDisplayLEDService.getlocalDisplayModes(); * @return Array(object) => array = [{},{},...] */ getlocalDisplayModes(): { name: string; type: number; }[]; /** * @example: * let displayModel = this.vhDisplayLEDService.getlocalDisplayModel(1); * @param type * @return Object => obj = {} or null */ getlocalDisplayModel(type: number): any; /** * @example * let displayModels = this.vhDisplayLEDService.getlocalDisplayModels(); * @return Array(object) => array = [{},{},...] */ getlocalDisplayModels(): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class VhCurrencyPipe implements PipeTransform { transform(value: number, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol-narrow' | string | boolean, digitsInfo?: string, locale?: string): string | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export declare class VhCurrencyUnitPipe implements PipeTransform { transform(value: number, locale?: string, currencyCode?: string, display?: 'code' | 'symbol' | 'symbol' | string | boolean, digitsInfo?: string): string | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export declare class VhPercentPipe implements PipeTransform { transform(value: number, locale?: string, digitsInfo?: string): string | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export declare class VhLinkPipe implements PipeTransform { private dom; constructor(dom: DomSanitizer); transform(value: any, args: any): import("@angular/platform-browser").SafeResourceUrl; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export declare class VhYoutubeLinkPipe implements PipeTransform { private dom; constructor(dom: DomSanitizer); transform(value: any): import("@angular/platform-browser").SafeResourceUrl; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export declare class VhDate implements PipeTransform { transform(value: any, format?: string, locate?: string): string | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export interface itfProduct { allow_sell: boolean; brand: string; id_category: string; img: string; manysize: boolean; name: string; selling: boolean; type: number; warning_number: number; item_code: string; units: []; }