From 7b14cf11656a1719d1e2adec08e028e381123dc9 Mon Sep 17 00:00:00 2001 From: Francesco Mataloni Date: Fri, 12 Jul 2024 12:07:04 +0200 Subject: [PATCH 1/2] VAT code review --- .../CustomRTServerMapping.cs | 36 +++++-------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerMapping.cs b/scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerMapping.cs index 6e1329ed0..846169843 100644 --- a/scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerMapping.cs +++ b/scu-it/src/fiskaltrust.Middleware.SCU.IT.CustomRTServer/CustomRTServerMapping.cs @@ -400,35 +400,15 @@ public static List GenerateTaxDataForReceiptRequest(ReceiptRequ return items; } - public static string GetVatCodeForChargeItemCase(long chargeItemCase) => chargeItemCase switch + public static string GetVatCodeForChargeItemCase(long chargeItemCase) => (chargeItemCase & 0x0000_0000_0000_F00F) switch { - 0x4954_2000_0020_0013 => "", - 0x4954_2000_0020_0011 => "", - 0x4954_2000_0020_0012 => "", - 0x4954_2000_0020_0014 => "", - 0x4954_2000_0020_1014 => "N3", - 0x4954_2000_0020_2014 => "N2", - 0x4954_2000_0020_3014 => "N4", - 0x4954_2000_0020_4014 => "N5", - 0x4954_2000_0020_5014 => "N6", - 0x4954_2000_0020_8014 => "N1", - 0x4954_2000_0020_7014 => "VI", - 0x4954_2000_0000_8038 => "N1", - 0x4954_2000_0022_0013 => "", - 0x4954_2000_0022_0011 => "", - 0x4954_2000_0022_0012 => "", - 0x4954_2000_0022_0014 => "", - 0x4954_2000_0022_1014 => "N3", - 0x4954_2000_0022_2014 => "N2", - 0x4954_2000_0022_3014 => "N4", - 0x4954_2000_0022_4014 => "N5", - 0x4954_2000_0022_5014 => "N6", - 0x4954_2000_0022_8014 => "N1", - 0x4954_2000_0022_7014 => "VI", - 0x4954_2000_0021_0013 => "", - 0x4954_2000_0021_0011 => "", - 0x4954_2000_0021_0012 => "", - 0x4954_2000_0021_0014 => "", + 0x0000_0000_0000_1008 => "N3", + 0x0000_0000_0000_2008 => "N2", + 0x0000_0000_0000_3008 => "N4", + 0x0000_0000_0000_4008 => "N5", + 0x0000_0000_0000_5008 => "N6", + 0x0000_0000_0000_8008 => "N1", + 0x0000_0000_0000_7008 => "VI", _ => "" }; From 20c829f4d76587f2b3594f3ae3e29dbfda345ca5 Mon Sep 17 00:00:00 2001 From: Francesco Mataloni Date: Fri, 12 Jul 2024 12:57:42 +0200 Subject: [PATCH 2/2] review of the receipt examples for testing --- .../ReceiptExamples.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scu-it/test/fiskaltrust.Middleware.SCU.IT.CustomRTServer.UnitTest/ReceiptExamples.cs b/scu-it/test/fiskaltrust.Middleware.SCU.IT.CustomRTServer.UnitTest/ReceiptExamples.cs index fec9e1e6a..ba3fc5f55 100644 --- a/scu-it/test/fiskaltrust.Middleware.SCU.IT.CustomRTServer.UnitTest/ReceiptExamples.cs +++ b/scu-it/test/fiskaltrust.Middleware.SCU.IT.CustomRTServer.UnitTest/ReceiptExamples.cs @@ -136,7 +136,7 @@ public static ReceiptRequest GetTakeAway_Delivery_Cash() "Amount": 10, "VATRate": 0, "VATAmount": 0, - "ftChargeItemCase": 5283883447186624532, + "ftChargeItemCase": 5283883447186624536, "Description": "TakeAway - Delivery - Item VAT NI", "Moment": "{{current_moment}}" }, @@ -145,7 +145,7 @@ public static ReceiptRequest GetTakeAway_Delivery_Cash() "Amount": 10, "VATRate": 0, "VATAmount": 0, - "ftChargeItemCase": 5283883447186628628, + "ftChargeItemCase": 5283883447186628632, "Description": "TakeAway - Delivery - Item VAT NS", "Moment": "{{current_moment}}" }, @@ -154,7 +154,7 @@ public static ReceiptRequest GetTakeAway_Delivery_Cash() "Amount": 10, "VATRate": 0, "VATAmount": 0, - "ftChargeItemCase": 5283883447186632724, + "ftChargeItemCase": 5283883447186632728, "Description": "TakeAway - Delivery - Item VAT ES", "Moment": "{{current_moment}}" }, @@ -163,7 +163,7 @@ public static ReceiptRequest GetTakeAway_Delivery_Cash() "Amount": 10, "VATRate": 0, "VATAmount": 0, - "ftChargeItemCase": 5283883447186636820, + "ftChargeItemCase": 5283883447186636824, "Description": "TakeAway - Delivery - Item VAT RM", "Moment": "{{current_moment}}" }, @@ -172,7 +172,7 @@ public static ReceiptRequest GetTakeAway_Delivery_Cash() "Amount": 10, "VATRate": 0, "VATAmount": 0, - "ftChargeItemCase": 5283883447186640916, + "ftChargeItemCase": 5283883447186640920, "Description": "TakeAway - Delivery - Item VAT AL", "Moment": "{{current_moment}}" }, @@ -181,7 +181,7 @@ public static ReceiptRequest GetTakeAway_Delivery_Cash() "Amount": 10, "VATRate": 0, "VATAmount": 0, - "ftChargeItemCase": 5283883447186653204, + "ftChargeItemCase": 5283883447186653208, "Description": "TakeAway - Delivery - Item VAT EE", "Moment": "{{current_moment}}" }