TavernerPOS - Source Code

Clone: 

git clone http://www.librarysmith.co.uk/tavernerPOS

 

viewgit/viewgit/inc/functions.php:49 Function create_function() is deprecated [8192]

Index » tavernerPOS : Commitdiff 69d9cf

Start Fixing the incorrect Tax calculations when tax is inclusive.

Matthew Smith [16-03-29 11:28]
Start Fixing the incorrect Tax calculations when tax is inclusive.
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);
 	}

Add comment
These comments are moderated so so won't be published until reviewed.