public class PaymentsModel extends Object
- Serial number for close cash added
- Payments directly related to active cash instead going through tickets. Exception: getPayments/printPayments
- list all tax lines, i.e. also tax free and tax_total = 0 - don't count topup payments for total - added class DiscountLine to print discount statistics *
Modifier and Type | Field and Description |
---|---|
protected static PaymentsModel |
instance |
protected Date |
m_dDateEnd |
protected Date |
m_dDateStart |
protected Double |
m_dSalesSubtotal |
protected Double |
m_dSalesTotal |
protected Integer |
m_iPayments |
protected Integer |
m_iSales |
protected List<DiscountLineFormatter> |
m_lDiscounts |
protected List<AccountingLineFormatter> |
m_linesByAccountingLevel |
protected List<AccountingLineFormatter> |
m_linesByModifiers |
protected List<Object[]> |
m_lPayments |
protected Integer |
m_maxNumber |
protected Integer |
m_minNumber |
protected List<Object[]> |
m_oDiscounts |
protected static CashRegister |
m_reg |
protected Integer |
m_serialNr |
protected String |
m_sHost |
protected Set<Ticket> |
m_tickets |
protected User |
m_user |
protected static String[] |
SALEHEADERS |
protected List<SalesLineFormatter> |
slines |
Modifier and Type | Method and Description |
---|---|
void |
addPaymentLine(Object[] pline) |
static PaymentsModel |
emptyInstance()
PaymentsModel defines all methods that can be referenced in
Printer.CloseCash.xml and and Printer.CurrentCash.xml and are used in
JPanelCloseMoney and JPanelCloseCash.
|
List<AccountingLineFormatter> |
getAccountingLines(int levelMask)
Retrieves sales values for products having the accounting levels in levelMask.
|
List<AccountingLineFormatter> |
getAccountingLines(int levelMask,
boolean groupByProduct)
Retrieves sales values for products having the accounting levels in levelMask.
|
List<AccountingLineFormatter> |
getAccountingLinesByModifier(int modifierMask,
boolean groupByProduct)
Retrieves sales values for products having the modifiers in modifierMask set.
|
CashRegister |
getActiveCash() |
Integer |
getCashCloseNr()
Get the serial number of the active cashregister for the current host.
|
Integer |
getCurrentRegister(String host)
Get the serial number of the current register for host.
|
Date |
getDateEnd()
Get the closing date for cash close.
|
Date |
getDateStart()
Start date of the active cash register.
|
List<DiscountLineFormatter> |
getDiscountLines()
Retrieves the list of discount line formatters.
|
String |
getHost()
Host name of the current host.
|
Integer |
getMaxTicketNum()
Print the last ticket number of this sales period
|
Integer |
getMinTicketNum()
Print the first ticket number of this sales period
|
HashMap<String,PaymentsLineFormatter[]> |
getPaymentGroups()
Returns a hash with key value pairs where the key represents a payment
method and the value represents a vector of PaymentLines
|
List<PaymentsLineFormatter> |
getPaymentLines()
Retrieves a list of all payment lines.
|
List<PaymentsLineFormatter> |
getPaymentLinesByHosts(String hosts)
Get a list of PaymentLineFormatters for the listed hosts.
|
List<PaymentsLineFormatter> |
getPaymentLinesByUser()
Get a list of PaymentsLineFormatters for the selected register of the
current host.
|
int |
getPayments()
Number of payments
|
AbstractTableModel |
getPaymentsModel()
The payment table model is meant to be used in JPanelCloseMoney only.
|
List<SalesLineFormatter> |
getSaleLines()
Retrieves a list of all sales lines.
|
int |
getSales()
Return the number of sales transactions
|
DiscountLineFormatter |
getSalesByAccountingLevel(int mask) |
AbstractTableModel |
getSalesModel()
The sales table model is meant to be used in JPanelCloseMoney only.
|
Double |
getSalesSubtotal()
Net sum of all sales as Double
|
Double |
getSalesTotal()
Gross sum of all sales calculated from the ticketlines as Double.
|
double |
getTotal()
Total of all payments made.
|
static PaymentsModel |
loadInstance(CashRegister reg,
String host,
User user)
Loads all data related to the active cash register.
|
String |
printDateStart()
Start date of the current cash register formatted as timestamp string.
|
String |
printPayments()
Returns the total number of payments including top up's as string.
|
String |
printPaymentsTotal()
Return the total of payments formatted as string (excluding top up's).
|
String |
printSales()
Return the string formatted number of sales transactions.
|
String |
printSalesSubtotal()
Net sum of all sales calculated from the ticketlines formatted as
currency.
|
String |
printSalesTotal()
Gross sum of all sales calculated from the ticketlines formatted as currency.
|
void |
setDateEnd(Date dValue)
Set the closing date for cash close.
|
protected String m_sHost
protected Date m_dDateStart
protected Date m_dDateEnd
protected Integer m_iPayments
protected List<DiscountLineFormatter> m_lDiscounts
protected List<AccountingLineFormatter> m_linesByAccountingLevel
protected List<AccountingLineFormatter> m_linesByModifiers
protected List<SalesLineFormatter> slines
protected Integer m_iSales
protected Double m_dSalesSubtotal
protected Double m_dSalesTotal
protected static final String[] SALEHEADERS
protected Integer m_serialNr
protected User m_user
protected static CashRegister m_reg
protected static PaymentsModel instance
protected Integer m_minNumber
protected Integer m_maxNumber
public static PaymentsModel emptyInstance()
public static PaymentsModel loadInstance(CashRegister reg, String host, User user) throws BasicException
reg
- host
- user
- BasicException
public HashMap<String,PaymentsLineFormatter[]> getPaymentGroups()
public int getPayments()
public double getTotal()
public String getHost()
public Date getDateStart()
public String printDateStart()
public Integer getCashCloseNr()
public void setDateEnd(Date dValue)
dValue
- is the date value to set.public Date getDateEnd()
public String printPayments()
public String printPaymentsTotal()
public int getSales()
public String printSales()
public String printSalesSubtotal()
public Double getSalesSubtotal()
public String printSalesTotal()
public Double getSalesTotal()
public Integer getMinTicketNum()
public Integer getMaxTicketNum()
public List<PaymentsLineFormatter> getPaymentLines()
public DiscountLineFormatter getSalesByAccountingLevel(int mask)
public void addPaymentLine(Object[] pline)
public List<SalesLineFormatter> getSaleLines()
public AbstractTableModel getPaymentsModel()
public List<DiscountLineFormatter> getDiscountLines()
public List<AccountingLineFormatter> getAccountingLines(int levelMask)
levelMask
- The mask representing the desired accounting levels.public List<AccountingLineFormatter> getAccountingLines(int levelMask, boolean groupByProduct)
levelMask
- The mask representing the desired accounting levels.groupByProduct
- public List<AccountingLineFormatter> getAccountingLinesByModifier(int modifierMask, boolean groupByProduct)
modifierMask
- groupByProduct
- public AbstractTableModel getSalesModel()
public Integer getCurrentRegister(String host)
host
- hostname to get the current serial number from.public List<PaymentsLineFormatter> getPaymentLinesByHosts(String hosts)
hosts
- comma separated list of hostnamespublic List<PaymentsLineFormatter> getPaymentLinesByUser()
public CashRegister getActiveCash()
Copyright © 2021. All rights reserved.