public class TicketLine extends AbstractIdentifiedHibernateObject<TicketLine> implements Cloneable, Comparable<TicketLine>, Auditable
- rounding for calculateTotal() and calculateSubTotal()
- clone: version set to zero
Modifier and Type | Field and Description |
---|---|
static byte |
STATUS_CREATED |
static byte |
STATUS_LOCKED |
static byte |
STATUS_ORDERED |
static byte |
STATUS_OUT |
static byte |
STATUS_PREPARING |
static byte |
STATUS_SELECTED |
static byte |
STATUS_SERVING |
id
Modifier | Constructor and Description |
---|---|
protected |
TicketLine()
Creates a new instance of TicketLine
|
|
TicketLine(Product product,
double multiply,
double priceSell) |
|
TicketLine(Tax t,
double multiply,
double priceSell) |
|
TicketLine(TicketLine line)
Creates a new instance of TicketLine - only selected properties of line
are copied.
|
Modifier and Type | Method and Description |
---|---|
void |
assignTax(Tax tax)
This is used to set the products taxes to only one tax
|
void |
assignTaxes(Set<Tax> taxes)
A convenience method that sets both the tax and taxRate at once
|
double |
calculateSubTotal()
Net value of the line, rounded to the locally required precision.
|
double |
calculateTotal()
Gross value of the line, rounded to the locally required predision)
|
double |
calculateTotalOrig() |
TicketLine |
clone() |
int |
compareTo(TicketLine cline) |
Double |
getAmount() |
String |
getComment() |
String |
getComProducts() |
User |
getCook() |
Byte |
getCourse() |
Date |
getCreated_at() |
String |
getDescription()
This column describes the purpose of the line, in the case of selling a
product it's just the product's name but otherwise it becomes an optional
description of the reason for a charge.
|
DiscountReason |
getDiscountReason()
If this ticketline was discounted than this will specify the reason why.
|
Integer |
getModifiers()
This column holds the modifier mask (ha)
|
double |
getOldAmount() |
double |
getOrderPrinted()
Retrieve the number of items with which the line has been printed
to a kitchen order receipt.
|
Ticket |
getParent() |
Double |
getPriceBuy()
This transient property is used to allow a modifier to set a buy price
different from the one in the Product.
|
Double |
getPriceOrig() |
Double |
getPriceSell() |
Product |
getProduct() |
Boolean |
getProtect() |
Reservation |
getReservation() |
Boolean |
getReserved() |
Integer |
getSeat()
Get the seat number as Byte
The number of seats available can be limited through a custom variable.
|
Byte |
getStatus()
The status is primarily used to indicate the line status for the kitchen monitor
|
Integer |
getTare()
The tare value is only stored for scale products.
|
Tax |
getTax() |
Set<Tax> |
getTaxes() |
Double |
getTaxRate() |
int |
getTotal_amount() |
Date |
getUpdated_at() |
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 |
hasReservation()
Convenience method to get the RESERVED status
|
Boolean |
isComProduct() |
Boolean |
isCoupon() |
Boolean |
isInactiveVoucher() |
boolean |
isProductCom() |
boolean |
lineIsPrinted()
Boolean value to determine if the line has been printed
to a kitchen order receipt.
|
void |
lineIsPrinted(boolean orderPrinted)
Set a boolean value to determine if the line has been printed
to a kitchen order receipt.
|
String |
printCategoryName()
Print the category name of the associated product.
|
String |
printPlace()
Used for audit: get the name of the parent tickets place, if any.
|
void |
save()
This is a convenience method to wrap the operation in a transaction.
|
void |
setAmount(Double amount) |
void |
setComment(String comment) |
void |
setComProduct(Boolean comProduct) |
void |
setComProducts(String comProducts) |
void |
setCook(User cook) |
void |
setCoupon(Boolean coupon) |
void |
setCourse(Byte course) |
void |
setCreated_at(Date created_at) |
void |
setDescription(String description) |
void |
setDiscountReason(DiscountReason discountReason) |
void |
setInactiveVoucher(Boolean isInactive) |
void |
setModifiers(Integer modifiers)
Set the modifier mask for the ticket line.
|
void |
setOldAmount(double oldAmount) |
void |
setOrderPrinted(double amount)
Set an amount to determine for how many items the line has been printed
to a kitchen order receipt.
|
void |
setParent(Ticket parent)
Note that this relationship is controlled by Ticket so this method isn't
particularly useful from a persistence context.
|
void |
setPriceBuy(Double priceBuy) |
void |
setPriceOrig(Double priceOrig) |
void |
setPriceSell(Double sellPrice) |
void |
setProduct(Product product) |
void |
setProtect(Boolean protect) |
void |
setReservation(Reservation reservation) |
void |
setReserved(Boolean reserved) |
void |
setSeat(Integer seat) |
void |
setStatus(Byte status) |
void |
setTare(Integer tare) |
void |
setTax(Tax tax) |
void |
setTaxes(Set<Tax> taxes) |
void |
setTaxRate(double taxRate) |
void |
setTotal_amount(int total_amount) |
void |
setUpdated_at(Date updated_at) |
void |
updateReservation()
The cloning process for reservations does not set the resource_id properly.
|
equals, getId, getVersion, hashCode, setId, setVersion
delete, getGetters, getKeyValue, merge, refresh
public static final byte STATUS_CREATED
public static final byte STATUS_ORDERED
public static final byte STATUS_PREPARING
public static final byte STATUS_SERVING
public static final byte STATUS_OUT
public static final byte STATUS_LOCKED
public static final byte STATUS_SELECTED
protected TicketLine()
public TicketLine(TicketLine line)
line
- properties of line will be copiedpublic TicketLine(Product product, double multiply, double priceSell)
public TicketLine(Tax t, double multiply, double priceSell)
public Reservation getReservation()
public void setReservation(Reservation reservation)
public Product getProduct()
public void setProduct(Product product)
public boolean isProductCom()
public String getDescription()
public void setDescription(String description)
description
- the description to setpublic void assignTaxes(Set<Tax> taxes)
taxes
- public void assignTax(Tax tax)
tax
- public Double getAmount()
public void setAmount(Double amount)
public Ticket getParent()
public void setParent(Ticket parent)
parent
- public Double getPriceSell()
public void setPriceSell(Double sellPrice)
public Double getPriceBuy()
public void setPriceBuy(Double priceBuy)
public Double getTaxRate()
public void setTaxRate(double taxRate)
public Boolean getReserved()
public void setReserved(Boolean reserved)
public Boolean getProtect()
public void setProtect(Boolean protect)
public double calculateTotal()
public double calculateTotalOrig()
public double calculateSubTotal()
public TicketLine clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public Tax getTax()
public void setTax(Tax tax)
public DiscountReason getDiscountReason()
public void setDiscountReason(DiscountReason discountReason)
discountReason
- the discountReason to setpublic Integer getModifiers()
public void setModifiers(Integer modifiers)
modifiers
- public User getCook()
public void setCook(User cook)
public Byte getCourse()
public void setCourse(Byte course)
public Date getCreated_at()
public void setCreated_at(Date created_at)
setCreated_at
in interface Auditable
public Byte getStatus()
public void setStatus(Byte status)
public Boolean isInactiveVoucher()
public void setInactiveVoucher(Boolean isInactive)
public Boolean isCoupon()
public void setCoupon(Boolean coupon)
public Boolean isComProduct()
public void setComProduct(Boolean comProduct)
public Date getUpdated_at()
public void setUpdated_at(Date updated_at)
setUpdated_at
in interface Auditable
public boolean lineIsPrinted()
public double getOrderPrinted()
public void lineIsPrinted(boolean orderPrinted)
orderPrinted
- set to true when printing the line.public String getComment()
public void setComment(String comment)
public void setOrderPrinted(double amount)
amount
- number of items printedpublic String getComProducts()
public void setComProducts(String comProducts)
public double getOldAmount()
public void setOldAmount(double oldAmount)
public int compareTo(TicketLine cline)
compareTo
in interface Comparable<TicketLine>
public int getTotal_amount()
public void setTotal_amount(int total_amount)
public Integer getTare()
public void setTare(Integer tare)
public boolean hasAccountingLevels(int levelMask)
levelMask
- public String printPlace()
public Integer getSeat()
public void setSeat(Integer seat)
public String printCategoryName()
public void updateReservation()
public boolean hasReservation()
public Double getPriceOrig()
public void setPriceOrig(Double priceOrig)
public void save() throws BasicException
AbstractHibernateObject
save
in class AbstractHibernateObject<TicketLine>
BasicException
Copyright © 2021. All rights reserved.