Just raising awarness on bugs i've patched and found in souce code v4.6.4.
Noticed the sources from version 4.6.4 contains file "PaymentsReprintModel.java" in "com.openbravo.pos.panels" contains multiple bugs as well as the "JPanelCloseMoneyReprint.java".
The SQL requests only get voids and no sales from start date until present. Should contain limit of close date so its accurate. Currently display all No sales until present.
Fix:
"JPanelCloseMoneyReprint.java" line 297 should have end date:
SQL = "SELECT payments.total FROM payments JOIN receipts ON payments.receipt = receipts.id WHERE (payments.payment = 'cashrefund' OR payments.payment = 'ccardrefund') AND receipts.datenew > {fn TIMESTAMP('" + m_PaymentsClosed.printDateStart() + "')} AND receipts.datenew < {fn TIMESTAMP('" + m_PaymentsClosed.printDateEnd() + "')}";
Bugs.png - shows bug which will reprint with ALL no sales to date.
Bugs_solved.png - shows the fix.
@unicenta-hugh Sorry for delay reply. Since posting, I've configured 2 terminals running on a single MySQL database. When performing "close cash" the "Ticket Line Voids" and "Drawer openings" as well as additional custom fields i'm tracking needed to check the terminal name.
In unicentaopos v4.6.4 source code the "Ticket Line Voids" and "Drawer Openinigs" would return line voids and no sales from both terminals. Therefore not accurate for the single terminal it's running on.
My Solution
Database change to track terminal that performed no sales and line voids:
draweropened table new column create "host" varchar(255)
lineremoved table new column create "host" varchar(255)
DataLogicSystem.java was updated to insert host/terminal name into drawer opened
same was done for linesremoved in the lines directly below
Next, TicketParser.java was updated to support passing the host name for No sales draweropened.
Here I created a String variable named host=ticket.getHost();
same was done in JPanelCloseMoney.java
So now everytime the drawer opens it will track which terminal/host it relates to.
Similarly this was all repeated for Ticket Lines removed/voided in JPanelTicket.java
and finally to conclude JPanelCloseMoney.java had it's SQL querys updated to only get draweropened/no sales and ticket lines removed/voided for the corresponding host/terminal.
and
So finally this is how my Close Cash panel correctly displays the number of no sales and lines voided corresponding to the terminal/host it corresponds to.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just raising awarness on bugs i've patched and found in souce code v4.6.4.
Noticed the sources from version 4.6.4 contains file "PaymentsReprintModel.java" in "com.openbravo.pos.panels" contains multiple bugs as well as the "JPanelCloseMoneyReprint.java".
The SQL requests only get voids and no sales from start date until present. Should contain limit of close date so its accurate. Currently display all No sales until present.
Fix:
"JPanelCloseMoneyReprint.java" line 297 should have end date:
SQL = "SELECT payments.total FROM payments JOIN receipts ON payments.receipt = receipts.id WHERE (payments.payment = 'cashrefund' OR payments.payment = 'ccardrefund') AND receipts.datenew > {fn TIMESTAMP('" + m_PaymentsClosed.printDateStart() + "')} AND receipts.datenew < {fn TIMESTAMP('" + m_PaymentsClosed.printDateEnd() + "')}";
Bugs.png - shows bug which will reprint with ALL no sales to date.
Bugs_solved.png - shows the fix.
best of luck to developers out there.
Last edit: Si Ono 2022-12-10
Thanks @sitono we'll add this to our backlog! Would you be able to tell me how this manifests on the UI?
Regards
Hugh
@unicenta-hugh Sorry for delay reply. Since posting, I've configured 2 terminals running on a single MySQL database. When performing "close cash" the "Ticket Line Voids" and "Drawer openings" as well as additional custom fields i'm tracking needed to check the terminal name.
In unicentaopos v4.6.4 source code the "Ticket Line Voids" and "Drawer Openinigs" would return line voids and no sales from both terminals. Therefore not accurate for the single terminal it's running on.
My Solution
Database change to track terminal that performed no sales and line voids:
draweropened table new column create "host" varchar(255)
lineremoved table new column create "host" varchar(255)
DataLogicSystem.java was updated to insert host/terminal name into drawer opened
same was done for linesremoved in the lines directly below
Next, TicketParser.java was updated to support passing the host name for No sales draweropened.
Here I created a String variable named host=ticket.getHost();
same was done in JPanelCloseMoney.java
So now everytime the drawer opens it will track which terminal/host it relates to.
Similarly this was all repeated for Ticket Lines removed/voided in JPanelTicket.java
and finally to conclude JPanelCloseMoney.java had it's SQL querys updated to only get draweropened/no sales and ticket lines removed/voided for the corresponding host/terminal.
and
So finally this is how my Close Cash panel correctly displays the number of no sales and lines voided corresponding to the terminal/host it corresponds to.