align col in summary report
This commit is contained in:
parent
e6851cba3b
commit
2238988846
@ -854,63 +854,51 @@ public abstract class BaseXPrint {
|
||||
printer.appendPrnStr( currencyCodeToText(currency) + " " +"Transactions", fontNormal, AlignEnum.LEFT, false);
|
||||
emptyLine(1);
|
||||
|
||||
printer.appendPrnStr("(COUNT)TRANS", "AMOUNT(" + currencyCodeToText(currency) + ")", fontNormal, false);
|
||||
// printer.appendPrnStr("(COUNT)TRANS", "AMOUNT(" + currencyCodeToText(currency) + ")", fontNormal, false);
|
||||
print3ColumnsStringWithAlign("COUNT", "TRANS", "AMOUNT" + "(" + currencyCodeToText(currency) + ")", fontNormal, false);
|
||||
|
||||
if (data.saleCount > 0) {
|
||||
printer.appendPrnStr("(" + data.saleCount + ")SALES",
|
||||
print3ColumnsStringWithAlign("(" + data.saleCount + ")",
|
||||
"SALES",
|
||||
PrintUtils.getInstance().getSeparatorNumberFormat(data.saleAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.voidSaleCount > 0) {
|
||||
printer.appendPrnStr("(" + data.voidSaleCount + ")VOID SALES",
|
||||
print3ColumnsStringWithAlign("(" + data.voidSaleCount + ")",
|
||||
"VOID",
|
||||
"- " + PrintUtils.getInstance().getSeparatorNumberFormat(data.voidSaleAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.cashOutCount > 0) {
|
||||
printer.appendPrnStr("(" + data.cashOutCount + ")CASH OUT",
|
||||
print3ColumnsStringWithAlign("(" + data.cashOutCount + ")",
|
||||
"CASH ADV",
|
||||
PrintUtils.getInstance().getSeparatorNumberFormat(data.cashOutAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.refundCount > 0) {
|
||||
printer.appendPrnStr("(" + data.refundCount + ")REFUND",
|
||||
print3ColumnsStringWithAlign("(" + data.refundCount + ")",
|
||||
"REFUND",
|
||||
"- " + PrintUtils.getInstance().getSeparatorNumberFormat(data.refundAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.preAuthCompCount > 0) {
|
||||
printer.appendPrnStr("(" + data.preAuthCompCount + ")PREAUTH COMP",
|
||||
print3ColumnsStringWithAlign("(" + data.preAuthCompCount + ")",
|
||||
"PREAUTH COMP",
|
||||
PrintUtils.getInstance().getSeparatorNumberFormat(data.preAuthCompAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.preAuthCompVoidCount > 0) {
|
||||
printer.appendPrnStr("(" + data.preAuthCompVoidCount + ")VOID PREAUTH COMPLETE",
|
||||
"- " + PrintUtils.getInstance().getSeparatorNumberFormat(data.preAuthCompVoidAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.qrPayCount > 0) {
|
||||
printer.appendPrnStr("(" + data.qrPayCount + ")QR PAY",
|
||||
PrintUtils.getInstance().getSeparatorNumberFormat(data.qrPayAmount, isQrDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
if (data.qrRefundCount > 0) {
|
||||
printer.appendPrnStr("(" + data.qrRefundCount + ")QR REFUND",
|
||||
"- " + PrintUtils.getInstance().getSeparatorNumberFormat(data.qrRefundAmount, isQrDecimalEnabled),
|
||||
fontNormal, false);
|
||||
}
|
||||
|
||||
dotBreak();
|
||||
|
||||
long totalAmount =
|
||||
(data.saleAmount + data.cashOutAmount + data.preAuthCompAmount + data.qrPayAmount)
|
||||
- (data.voidSaleAmount + data.refundAmount + data.preAuthCompVoidAmount + data.qrRefundAmount);
|
||||
(data.saleAmount + data.cashOutAmount + data.preAuthCompAmount)
|
||||
- (data.voidSaleAmount + data.refundAmount + data.preAuthCompVoidAmount);
|
||||
|
||||
printer.appendPrnStr(currencyCodeToText(currency) + " " + "TOTAL",
|
||||
printer.appendPrnStr( "TOTAL"+ " " + currencyCodeToText(currency),
|
||||
PrintUtils.getInstance().getSeparatorNumberFormat(totalAmount, isDecimalEnabled),
|
||||
fontNormal, false);
|
||||
|
||||
@ -1010,6 +998,11 @@ public abstract class BaseXPrint {
|
||||
// printer.appendPrnStr(first + " " + second + " " + third, fontNormal, AlignEnum.LEFT,false);
|
||||
printer.appendPrnStr(first + " " + second + " " + third, fontNormal, AlignEnum.LEFT,isBold);
|
||||
}
|
||||
|
||||
protected void print3ColumnsStringWithAlign(String first, String second, String third, int font, boolean isBold){
|
||||
String fixedSizeString = String.format("%-5s", first);
|
||||
printer.appendPrnStr(fixedSizeString + " " + second, third, font, isBold);
|
||||
}
|
||||
|
||||
protected void dotBreak(){
|
||||
printer.appendPrnStr(new String(new char[29]).replace("\0", "."), fontNormal, AlignEnum.CENTER, false);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user