From 24eee320e8976505039f235742a09f492d615a53 Mon Sep 17 00:00:00 2001 From: Bobbie Hodgetts Date: Mon, 25 Mar 2019 16:32:22 +0000 Subject: [PATCH] Feature to handle different SKU tax types when creating sales invoices Added feature to handle different tax types when creating Xero sales invoice from Amazon settlement reports. (#1) --- bnhtrade Database Client/Program.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bnhtrade Database Client/Program.cs b/bnhtrade Database Client/Program.cs index 840ee79..ef7e97e 100644 --- a/bnhtrade Database Client/Program.cs +++ b/bnhtrade Database Client/Program.cs @@ -3875,15 +3875,24 @@ namespace bnhtradeDatabaseClient // get transaction type id for line // build the match string - // NB special case for global accounting sale and refunds (also note Goodlwill is included) + // NB special case for global accounting sale and refunds (also note Goodlwill is included) and sku's where tax is included string matchString = "<" + match01 + "><" + match02 + ">"; - if ((match01 == "Order" || match01 == "Refund") && match02 == "ItemPrice" && (match03 == "Principal" || match03 == "Goodwill")) + if ((match01 == "Order" || match01 == "Refund") && match02 == "ItemPrice" && (match03 == "Principal" || match03 == "Goodwill" || match03 == "Tax")) { if (lineSku == "") { throw new Exception("Could not retrive Sku from SettleLineId=" + settlementLineId); } - matchString = matchString + ""; + + if (match03 == "Goodwill") + { + matchString = matchString + ""; + } + else + { + matchString = matchString + "<" + match03 + ">"; + } + if (dicSkuToTaxCodeId.ContainsKey(lineSku)) { matchString = matchString + "";