public class TicketLineFormatter extends Object
Also, the Printer.Ticketline template has a ticketline variable referring a TicketLineFormatter object.
Difference between get, print, and prints methods
TicketFormatter
Modifier and Type | Field and Description |
---|---|
protected org.apache.log4j.Logger |
contentLogger |
protected org.apache.log4j.Logger |
debugLogger |
protected TicketLine |
line |
protected org.apache.log4j.Logger |
logger |
Constructor and Description |
---|
TicketLineFormatter(TicketLine line)
TicketLineFormatter is instantiated in TicketFormatter.
|
TicketLineFormatter(TicketLine line,
Modifiers mod)
Used for rendering the ticketline in the sales panel
(template
Ticket.Line |
Modifier and Type | Method and Description |
---|---|
boolean |
createSurfAccount(char type,
String period)
This is a placeholder for a functionality still to be developed.
|
Double |
getAmount()
Get the number of items for the ticketline
|
String |
getBarcode()
Prints the XML escaped barcode string,if any (this is for completeness
and should only be necessary in special cases where the code property
is 'misused'.
|
Integer |
getCategoryVisibleId()
Get the visibleId of the items category.
|
String |
getComment()
Get the lines comment.
|
String |
getDescription()
Print the line items description.
|
String |
getDescriptionWithComment()
Print the line items description with added comment.
|
Double |
getDiscount()
Calculate the discount amount for the line.
|
String |
getGrossPriceSell()
Deprecated.
Use printPriceSellTax() instead. getXXX() methods in formatters should
always return unformatted values.
|
double |
getItemsPrinted()
Use this method to filter unprinted ticket lines when
printing a kitchen order receipt.
|
String |
getModifiers()
Print the display names of the modifiers currently active for the ticketline
|
boolean |
getOrderPrinted()
Use this method to filter unprinted ticket lines when
printing a kitchen order receipt.
|
TicketFormatter |
getParentTicket()
Get a a formatter for the lines parent object, can be used in audit tickets
when the ticket variable is empty.
|
String |
getPlace()
Get the name of the tickets place as XML escaped string.
|
Double |
getPriceSell()
Get the ticketline items sell price (net) in Double precision
|
Double |
getPriceSellTax()
Get the ticketline items sell price with tax (gross) in Double precision.
|
String |
getPrivComment()
Get the lines private comment.
|
ProductFormatter |
getProduct()
Get a formatter for the lines product
|
String |
getPubComment()
Get the lines public comment.
|
String |
getReference()
Prints the XML escaped reference string,if any (this is for completeness
and should only be necessary in special cases.
|
Date |
getReservationStart()
Get the start date for a reservation.
|
Double |
getSubTotal()
Get the ticketline subtotal (net = amount * priceSell) rounded to
currency precision.
|
TaxFormatter |
getTax()
Get the TaxFormatter object for the tax apllied to the item (in case
of no combined taxes being used).
|
List<TaxFormatter> |
getTaxes()
Get a list of TaxFormatter objects used with this ticketline (in case of
combined taxes for a product)
|
String |
getTaxName()
Print the name of the tax applied for this item.
|
Double |
getTaxRate()
Get the rate of the tax applied for this item in Double precision
|
Double |
getTotal()
Get the ticketline total (gross = amount * priceSell * (1 + taxRate))
rounded to currency precision
|
Double |
getTotalOrig() |
boolean |
hasAccountingLevels(int levelMask)
Returns true if at least one of the accounting levels in mask is set for
the product assigned to the line.
|
boolean |
hasModifiers(int mask)
Returns true if at least one of the modifiers in mask is set for
the line.
|
Boolean |
isCoupon() |
boolean |
isProductCom()
Identify helper products (commissioning products)
|
boolean |
isScaleProduct() |
void |
log(int level)
Log an INFO message with the supplied integer value.
|
void |
logLine()
logLine() shall report description, amount, price, ...
|
String |
printAmount()
Print the number of items for the ticketline and append a unit.
|
String |
printBarcode()
Prints the barcode of the product, if any.
|
String |
printComment()
Print the comment.
|
String |
printCreatedAt(String format)
Print the date created of the ticketline
|
String |
printDescription()
Print the line items description as string.
|
String |
printDescriptionWithComment()
Print the line items description with added public comment as string.
|
String |
printDiscount()
Print the currency formatted discount granted for the line total
|
String |
printDiscountPercent()
Print the discount percentage granted for the line total.
|
String |
printNextReservationStart(int slotLength)
Prints the start time which is calculated by rounding to the next slot start.
|
String |
printPlace()
Print the name of the tickets place.
|
String |
printPriceSell()
Print the ticketline items sell price (net) rounded to currency precision
|
String |
printPriceSellTax()
Print the ticketline items sell price with tax (gross) rounded to
currency precision.
|
String |
printPrivComment()
Print the lines private comment.
|
String |
printPubComment()
Print the lines public comment.
|
String |
printReference()
Prints the reference of the product, if any.
|
String |
printReservationDate()
Prints the reservation date like '15 Juni 2017')
|
String |
printReservationDate(String dateFormat)
Prints the reservation date in the requested format
|
String |
printReservationEnd(int slotLength)
Print the end time of a reservation period.
|
String |
printReservationStart()
Prints the start time like ist has been entered in the create slot reservationt dialog.
|
String |
printReservationStart(int slotLength)
Deprecated.
slotLength is ignored, use printReservationStart()
|
String |
printsAmount()
Print the number of items for the ticketline.
|
String |
printsDiscount()
Print the discount granted for the line total
|
String |
printSeat()
The seat number as String
|
String |
printsPriceSell()
Print the ticketline items sell price (net)
|
String |
printsPriceSellTax()
Print the ticketline items sell price with tax (gross) rounded to
currency precision.
|
String |
printsSubTotal()
Print the ticketline subtotal (net = amount * priceSell) rounded to
currency precision.
|
String |
printStatus()
Print the ticket status.
|
String |
printsTotal()
Print the ticketline total (gross = amount * priceSell * (1 + taxRate))
rounded to 2 decimals
|
String |
printSubTotal()
Print the ticketline subtotal (net = amount * priceSell)
rounded to currency precision
|
String |
printTaxRate()
Print the tax rate as percent formatted string
|
String |
printTotal()
Print the ticketline total (gross = amount * priceSell * (1 + taxRate))
rounded to currency precision
|
String |
printUpdatedAt(String format)
Print the date updated of the ticketline
|
void |
setItemsPrinted(double amount)
Use this method to flag ticket lines as printed with an amount of items when
printing a kitchen order receipt.
|
void |
setOrderPrinted()
Use this method to flag ticket lines as printed when
printing a kitchen order receipt.
|
void |
setStatusOrdered()
Set the status flag to ORDERED.
|
void |
setStatusPreparing()
Set the status flag to PREPARING.
|
void |
setStatusServing()
Set the status flag to SERVING.
|
protected final TicketLine line
protected org.apache.log4j.Logger logger
protected org.apache.log4j.Logger debugLogger
protected org.apache.log4j.Logger contentLogger
public TicketLineFormatter(TicketLine line)
ticketline
.line
- public TicketLineFormatter(TicketLine line, Modifiers mod)
Ticket.Line
line
- the referenced ticketlinemod
- the currently active modifier maskpublic Double getPriceSell()
public String printPriceSell()
public String printsPriceSell()
public String printTaxRate()
public Double getTotal()
public String printTotal()
public String printsTotal()
public String printSubTotal()
public Double getSubTotal()
public String printsSubTotal()
public String getGrossPriceSell()
public String printPriceSellTax()
public Double getPriceSellTax()
public String printsPriceSellTax()
public boolean isProductCom()
public String printDescription()
public String printDescriptionWithComment()
public String getDescriptionWithComment()
StringUtils.encodeXML(java.lang.String)
public String getDescription()
StringUtils.encodeXML(java.lang.String)
public String printComment()
public String getComment()
StringUtils.encodeXML(java.lang.String)
public String printPubComment()
public String getPubComment()
StringUtils.encodeXML(java.lang.String)
public String printPrivComment()
public String getPrivComment()
StringUtils.encodeXML(java.lang.String)
public String getModifiers()
public Double getAmount()
public String printAmount()
public String printsAmount()
public List<TaxFormatter> getTaxes()
TaxFormatter
public String getTaxName()
public Double getTaxRate()
public TaxFormatter getTax()
public Integer getCategoryVisibleId()
public boolean getOrderPrinted()
public double getItemsPrinted()
public void setOrderPrinted()
public void setItemsPrinted(double amount)
amount
- number of items printedpublic String printCreatedAt(String format)
format
- A format string as required by SimpleDateFormat.public String printPlace()
public String getPlace()
public String printUpdatedAt(String format)
format
- A format string as required by SimpleDateFormat.public void setStatusOrdered()
public void setStatusPreparing()
public void setStatusServing()
public String printStatus()
public Boolean isCoupon()
public String printSeat()
public boolean hasAccountingLevels(int levelMask)
levelMask
- A bit mask indicating a number of accounting levels.public boolean hasModifiers(int mask)
mask
- modifier mask to checkpublic void log(int level)
level
- an integer to be written to the logpublic boolean createSurfAccount(char type, String period)
type
- period
- public void logLine()
public String printBarcode()
public String printReference()
public String getBarcode()
public String getReference()
public TicketFormatter getParentTicket()
public String printReservationEnd(int slotLength)
slotLength
- public Date getReservationStart()
public String printNextReservationStart(int slotLength)
slotLength
- public String printReservationStart(int slotLength)
slotLength
- public String printReservationStart()
public String printReservationDate()
public String printReservationDate(String dateFormat)
dateFormat
- (see SimpleDateFormat)public ProductFormatter getProduct()
public Double getDiscount()
public String printDiscount()
public String printsDiscount()
public String printDiscountPercent()
public Double getTotalOrig()
public boolean isScaleProduct()
Copyright © 2021. All rights reserved.