TavernerPOS - Source Code
Clone:
git clone http://www.librarysmith.co.uk/tavernerPOS
viewgit/viewgit/inc/functions.php:49 Function create_function() is deprecated [8192]Start Fixing the incorrect Tax calculations when tax is inclusive.
Filename
src/com/floreantpos/model/DrawerPullReport.java
src/com/floreantpos/model/base/BaseTicket.java
src/com/floreantpos/print/DrawerpullReportService.java
diff --git a/src/com/floreantpos/model/DrawerPullReport.java b/src/com/floreantpos/model/DrawerPullReport.java
index 5b28ebe..81a560d 100644
--- a/src/com/floreantpos/model/DrawerPullReport.java
+++ b/src/com/floreantpos/model/DrawerPullReport.java
@@ -3,6 +3,7 @@ package com.floreantpos.model;
import java.util.HashSet;
import java.util.Set;
+import com.floreantpos.main.Application;
import com.floreantpos.model.base.BaseDrawerPullReport;
public class DrawerPullReport extends BaseDrawerPullReport {
@@ -70,8 +71,10 @@ public class DrawerPullReport extends BaseDrawerPullReport {
}
public void calculate() {
- setTotalRevenue(getNetSales() + getSalesTax());
- setGrossReceipts(getTotalRevenue() + getChargedTips());
+
+ setTotalRevenue(getNetSales() + getSalesTax());
+
+ setGrossReceipts(getTotalRevenue() + getChargedTips());
double total = getCashReceiptAmount() + getCreditCardReceiptAmount() + getDebitCardReceiptAmount() + getGiftCertReturnAmount()
+ getGiftCertChangeAmount() - getCashBack() - getRefundAmount();
diff --git a/src/com/floreantpos/model/base/BaseTicket.java b/src/com/floreantpos/model/base/BaseTicket.java
index 1197206..9d87efe 100644
--- a/src/com/floreantpos/model/base/BaseTicket.java
+++ b/src/com/floreantpos/model/base/BaseTicket.java
@@ -2,6 +2,8 @@ package com.floreantpos.model.base;
import java.io.Serializable;
+import com.floreantpos.main.Application;
+
/**
@@ -362,7 +364,10 @@ public abstract class BaseTicket implements Comparable, Serializable {
* @param subtotalAmount the SUB_TOTAL value
*/
public void setSubtotalAmount (java.lang.Double subtotalAmount) {
- this.subtotalAmount = subtotalAmount;
+ if (!Application.getInstance().isPriceIncludesTax())
+ this.subtotalAmount = subtotalAmount;
+ else
+ this.subtotalAmount = subtotalAmount - getTaxAmount();
}
diff --git a/src/com/floreantpos/print/DrawerpullReportService.java b/src/com/floreantpos/print/DrawerpullReportService.java
index 20bafb4..d8654dc 100644
--- a/src/com/floreantpos/print/DrawerpullReportService.java
+++ b/src/com/floreantpos/print/DrawerpullReportService.java
@@ -216,7 +216,9 @@ public class DrawerpullReportService {
}
report.setTicketCount(ticketCount);
- report.setNetSales(subtotal - discount);
+
+
+ report.setNetSales(subtotal - (discount));
report.setSalesTax(salesTax);
report.setChargedTips(tips);
}
- Details
- Last Updated: Monday, 04 April 2016 02:04
- Hits: 45329887