import { Observable } from 'rxjs'; import { SunoOrder, OnlineOrder, PosOrder, OrderDetail, OrderConfig, Store, MessageResult, OrderResult, OrderDetailResult, CustomerDetail, SalesUser, TransformableItemConfiguration, TransformationSolution, TransformationResult, ProductVariant, ActionResult } from './../models/pos.model'; import { DataConfig } from './../models/config'; export declare class SunoPosService { private dataService; private helperService; posOrders: PosOrder[]; selectedPosOrder: PosOrder; private promotions; private companySettings; private cashier; private cachedTransformationConf; private isOffline; constructor(config: DataConfig); initOrder(config: OrderConfig): Observable; initCafeOrder(config: OrderConfig): Observable; initOnlineOrder(config: OrderConfig): Observable; initSelfOrder(config: OrderConfig): boolean; createNewOrder(store: Store, orderType?: number, tableId?: string, tableName?: string, zoneId?: string, zoneName?: string): SunoOrder; selectOrder(orderId: string): PosOrder; deleteOrder(orderId: string): SunoOrder; deleteOrderOfTable(orderId: string): boolean; deleteOrderByTable(storeId: string, zoneId?: string, tableId?: string): void; deleteOrderByZone(storeId: string, zoneId?: string): void; saveOrder(order: PosOrder): Observable; saveOnlineOrder(order: OnlineOrder): Observable; updateOnlineOrder(order: OnlineOrder): Observable; saveCafeOrder(order: PosOrder): Observable; calculateTotal(order: PosOrder): void; calculateDiscount(isDiscountPercent: any, discount: any, order: PosOrder): void; changeDiscount(isDiscountPercent: any, discount: any, order: PosOrder): void; changeShipFee(fee: number, order: OnlineOrder): void; exchangeEarningPoint(point: number, order: PosOrder): void; getMaxEarningPoint(point: number, order: PosOrder): number; addVariant(variant: any, order: PosOrder, qty?: number): OrderDetailResult; removeItem(item: OrderDetail, order: PosOrder): void; addItem(item: OrderDetail, order: PosOrder): OrderDetailResult; changeQuantityOnItem(item: OrderDetail, order: PosOrder): MessageResult; changeStore(store: Store, order: PosOrder): void; changeSaleDate(saleDate: Date, order: PosOrder): void; calculatePriceOnItem(detail: OrderDetail, isDiscountPercent: boolean, discount: number, order: PosOrder): void; changeNewPriceOnItem(detail: OrderDetail, newPrice: number, order: PosOrder): void; addCustomer(customer: CustomerDetail, order: PosOrder, callback: any): void; removeCustomer(order: PosOrder): void; selectSaleUser(saleUser: SalesUser, order: PosOrder): void; generatePrinterOrder(order: PosOrder, store: any): any; getSubTotalBeforeDiscount(order: PosOrder): number; updatePromotion(order: any): void; updateToken(tenantId: string, accessToken: string): void; updateOrder(order: any): void; getOrders(storeId: string, zoneId?: string, tableId?: string): PosOrder[]; getPosOrder(orderId: string): Observable; getPrintOrder(orderId: string): Observable; addOrder(order: PosOrder): void; updateSelectedOrder(order: any): void; getSelectedOrder(): PosOrder; updateOrderNote(order: PosOrder, note: string): void; updateItemNote(item: OrderDetail, note: string, order: PosOrder): void; addOrderPayment(payment: any, order: PosOrder): void; updateOrderPayment(payment: any, order: PosOrder): void; deleteOrderPayment(payment: any, order: PosOrder): void; updateOrderWaitingCode(order: PosOrder, code: string): void; addVariantForExchangableItem(variant: ProductVariant, order: PosOrder, qty?: number): ActionResult; checkBeforeAddExchangableItem(item: any, order: PosOrder, qty: number): Observable; checkBeforeChangeQtyForExchangableItem(item: OrderDetail, order: PosOrder): Observable; changeQuantityForExchangableItem(item: OrderDetail, order: PosOrder): ActionResult; updateFeasibleQtyForExchangableItem(item: any, orderId: any): void; getTransformationConfAndCacheIfNeeded(variantId: string): Observable; getConfiguration(productId: string): Observable; getTransformationSolutions(variantIdNeedToBeTransformed: any, neededQty: number, confList: TransformableItemConfiguration[]): TransformationSolution[]; private getSolutionFromCombination; private getDefaultQty; distributeWhenChangedQty(neededQty: any, solution: TransformationSolution): TransformationResult[]; canTransform(variantIdNeedToBeTransformed: any, neededQty: number, confList: TransformableItemConfiguration[]): boolean; canDistributeQty(neededQty: any, solution: TransformationSolution): boolean; private calculateCoefficient; private getNeededQtyForTransformation; private getKCombinationOfN; private getAllCombinations; private getFeasibleCombinations; getCurrentStockBasedOnTotalOrders(variantId: string): number; getCurrentStockOnTotalOrdersExceptInputOrder(variantId: any, orderId: any): number; updateCurrentStock(variantId: any, currentStock: any): void; getTransformedItems(variantIdNeedToBeTransformed: any, solution: TransformationSolution): any[]; getCurrentStockByIds(itemIds: string[], storeId: string): Observable; modelProductVariantForExchangeDialog(productVariant: ProductVariant, order: any, addedQty: any): any; modelOrderDetailForExchangeDialog(orderDetails: OrderDetail): any; calculatePricePolicy(order: PosOrder): void; applyPolicy(order: PosOrder): void; cancelPolicy(order: PosOrder): void; selectPricePolicy(policy: any, variant: OrderDetail, order: PosOrder): void; private filterAllStoresAndCustomersPolicies; private filterByStoresPolicies; private filterByCustomersPolicies; private filterByAllCustomersPolicies; private filterByOrdersPolicies; private filterByAllProductsPolicies; private filterBySpecificProductsPolicies; private filterByCategoriesPolicies; calculatePromotion(order: PosOrder): void; applyPromotion(order: PosOrder): void; cancelPromotion(order: PosOrder): void; applyPromotionCode(code: string, order: PosOrder): OrderResult; selectPromotion(promotion: any, order: PosOrder): void; getMaxPromotionByOrder(order: PosOrder): any; getPromotionsByOrder(promotions: any[], order: PosOrder): any[]; selectPromotionOnItem(promotion: any, item: OrderDetail): void; cancelPromotionOnItem(item: OrderDetail): void; getMaxPromotionByItem(item: OrderDetail): any; getPromotionsByItem(promotions: any[], order: PosOrder, item: OrderDetail): any[]; private getAvailablePromotionsOnItem; private getAvailablePromotionsOnOrder; private getSubTotal; private getAvailablePromotions; private getDiscountValue; private getMaxDiscountOfRule; private getMaxDiscount; updateOfflineStatus(isOffline: boolean): void; getPromotionList(): Observable; reCalculateOrderPromotion(order: PosOrder): void; addPromotion(promotion: any): void; updatePromotionInList(promotion: any): void; deletePromotion(promotion: any): void; preparePosOrder(order: PosOrder): any; prepareOnlineOrder(order: OnlineOrder): any; prepareCafeOrder(order: PosOrder): any; resetOrder(order: PosOrder): PosOrder; resetOnlineOrder(order: OnlineOrder): OnlineOrder; resetCafeOrder(order: PosOrder): PosOrder; getSunoOrder(): SunoOrder; updateManualPaymentMethod(methodId: number, order: PosOrder): void; updateManualPaymentType(multipleSelected: boolean, order: PosOrder): void; updateManualPaymentPaidAmount(paid: number, order: PosOrder): void; updateManualPaymentPaidAmountOnItem(methodId: number, value: number, order: PosOrder): void; generateOrder(store: Store, orderType?: number): PosOrder; private addNewOrder; private getCurrentlyPromotions; private getGroupByCustomer; private getCustomerPoint; validateOrder(order: PosOrder): string; validateOnlineOrder(order: OnlineOrder): string; private isValidQuantity; private calculateSellPrice; private calculateEarningPoint; private calculateEarningMoney; private filterAllStoresAndCustomersPromotions; private filterByStoresPromotions; private filterByCustomersPromotions; private filterByAllCustomersPromotions; private filterByOrdersPromotions; private filterByAllProductsPromotions; private filterBySpecificProductsPromotions; private filterByCategoriesPromotions; private assignCustomer; private generateTableInfo; private convertDateTime; private formatTime; private checkDirtyOrder; }