Class InvoiceBaseService

Interface for a generic service.

Hierarchy

Implements

Constructors

Properties

configService: ConfigService
db: Dexie
http: AxiosInstance
methodName: string = 'invoice'
moduleName: string = 'invoices'
printJobService: PrintJobService
printTemplateService: PrintTemplateService
printerService: PrinterService
sectionItemService: ISectionItemService
tillService: ITillService

Methods

  • Calculate the total discount amount of an invoice and update grand total accordingly

    Parameters

    • invoice: IInvoice

      The invoice object containing discount details and lines

    • flow: CalcFlow

      The calculation of discount flow

    Returns void

    The updated invoice object with calculated discount and grand total

  • Calculates the rewarded credit for an invoice.

    Parameters

    • invoice: IInvoice

      The invoice to calculate the rewarded credit for.

    • aboveInvoiceAmount: number

      The minimum invoice amount required to be eligible for rewarded credit.

    • includeServiceCharge: boolean

      Whether to include the service charge in the calculation.

    • includeTax: any

      Whether to include the tax in the calculation.

    Returns void

  • Calculates and sets the rewarded points for the given invoice based on various conditions.

    Parameters

    • invoice: IInvoice

      The invoice to calculate rewarded points for.

    • aboveInvoiceAmount: number
    • includeServiceCharge: boolean
    • includeTax: boolean

    Returns void

    void

  • Calculates the rounding for an invoice based on the given parameters.

    Parameters

    • invoice: IInvoice

      The invoice to calculate the rounding for.

    • roundingBase: number

      The base value to round to.

    • roundingUp: boolean

      Whether to round up or down.

    • roundingCashless: boolean

      Whether to apply rounding only for cash payments.

    Returns void

Generated using TypeDoc