Capture additional CIECA information.
This commit is contained in:
@@ -51,7 +51,7 @@ using System.Windows;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.1.2.0")]
|
[assembly: AssemblyVersion("1.1.3.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
//Setting Squirrel Aware Version.
|
//Setting Squirrel Aware Version.
|
||||||
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
|
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
|
||||||
@@ -55,9 +55,9 @@ namespace RomeOnlinePartner.Utils
|
|||||||
{
|
{
|
||||||
IsTest = true;
|
IsTest = true;
|
||||||
|
|
||||||
graphQlEndpoint = "https://db.test.bodyshop.app/v1/graphql";
|
graphQlEndpoint = "https://db.test.romeonline.io/v1/graphql";
|
||||||
RestClient = new RestClient("https://api.test.imex.online");
|
RestClient = new RestClient("https://api.test.romeonline.io");
|
||||||
FirebaseAPIKey = "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c";
|
FirebaseAPIKey = "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,13 +37,15 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
bool vehSuccess = ParseVehFile(ref ret, _dir);
|
bool vehSuccess = ParseVehFile(ref ret, _dir);
|
||||||
bool pfhSuccess = ParsePfhFile(ref ret, _dir);
|
bool pfhSuccess = ParsePfhFile(ref ret, _dir);
|
||||||
bool pflSuccess = ParsePflFile(ref ret, _dir, system);
|
bool pflSuccess = ParsePflFile(ref ret, _dir, system);
|
||||||
|
bool pftSuccess = ParsePftFile(ref ret, _dir, system);
|
||||||
bool pfmSuccess = ParsePfmFile(ref ret, _dir);
|
bool pfmSuccess = ParsePfmFile(ref ret, _dir);
|
||||||
|
bool pfoSuccess = ParsePfoFile(ref ret, _dir);
|
||||||
bool stlSuccess = ParseStlFile(ref ret, _dir);
|
bool stlSuccess = ParseStlFile(ref ret, _dir);
|
||||||
bool ttlSuccess = ParseTtlFile(ref ret, _dir);
|
bool ttlSuccess = ParseTtlFile(ref ret, _dir);
|
||||||
bool linSuccess = ParseLinFile(ref ret, _dir, system);
|
bool linSuccess = ParseLinFile(ref ret, _dir, system);
|
||||||
bool pfpSuccess = ParsePfpFile(ref ret, _dir);
|
bool pfpSuccess = ParsePfpFile(ref ret, _dir);
|
||||||
ret.labor_rate_desc = "EST";
|
ret.labor_rate_desc = "EST";
|
||||||
if (!ad1Success || !ad2Success || !vehSuccess || !pfhSuccess || !pflSuccess || !pfmSuccess || !stlSuccess || !ttlSuccess || !linSuccess || !pfpSuccess) return false;
|
if (!ad1Success || !ad2Success || !vehSuccess || !pfhSuccess || !pflSuccess || !pftSuccess || !pfmSuccess || !stlSuccess || !ttlSuccess || !linSuccess || !pfpSuccess) return false;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -723,15 +725,15 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
pfl_x.lbr_taxp = readValues[4];//LBR_TAXP
|
pfl_x.lbr_taxp = readValues[4];//LBR_TAXP
|
||||||
pfl_x.lbr_adjp = readValues[5];//LBR_ADJP
|
pfl_x.lbr_adjp = readValues[5];//LBR_ADJP
|
||||||
pfl_x.lbr_tx_ty1 = readValues[6];//LBR_TX_TY1
|
pfl_x.lbr_tx_ty1 = readValues[6];//LBR_TX_TY1
|
||||||
pfl_x.lbr_tx_in1 = readValues[7];//LBR_TX_IN1
|
pfl_x.lbr_tx_in1 = (string)readValues[7] == "Y" ? true : false;//LBR_TX_IN1
|
||||||
pfl_x.lbr_tx_ty2 = readValues[8];//LBR_TX_TY2
|
pfl_x.lbr_tx_ty2 = readValues[8];//LBR_TX_TY2
|
||||||
pfl_x.lbr_tx_in2 = readValues[9];//LBR_TX_IN2
|
pfl_x.lbr_tx_in2 = (string)readValues[9] == "Y" ? true : false;//LBR_TX_IN2
|
||||||
pfl_x.lbr_tx_ty3 = readValues[10];//LBR_TX_TY3
|
pfl_x.lbr_tx_ty3 = readValues[10];//LBR_TX_TY3
|
||||||
pfl_x.lbr_tx_in3 = readValues[11];//LBR_TX_IN3
|
pfl_x.lbr_tx_in3 = (string)readValues[11] == "Y" ? true : false;//LBR_TX_IN3
|
||||||
pfl_x.lbr_tx_ty4 = readValues[12];//LBR_TX_TY4
|
pfl_x.lbr_tx_ty4 = readValues[12];//LBR_TX_TY4
|
||||||
pfl_x.lbr_tx_in4 = readValues[13];//LBR_TX_IN4
|
pfl_x.lbr_tx_in4 = (string)readValues[13] == "Y" ? true : false;//LBR_TX_IN4
|
||||||
pfl_x.lbr_tx_ty5 = readValues[14];//LBR_TX_TY5
|
pfl_x.lbr_tx_ty5 = readValues[14];//LBR_TX_TY5
|
||||||
pfl_x.lbr_tx_in5 = readValues[15];//LBR_TX_IN5
|
pfl_x.lbr_tx_in5 = (string)readValues[15] == "Y" ? true : false;//LBR_TX_IN5
|
||||||
|
|
||||||
pflObj[readValues[0].ToString()] = pfl_x;
|
pflObj[readValues[0].ToString()] = pfl_x;
|
||||||
}
|
}
|
||||||
@@ -754,6 +756,395 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool ParsePftFile(ref dynamic j, string RootFilePath, string system = "M")
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(j.ciecaid.Value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
logger.Trace(@"Parsing PFt at: {0}{1}", RootFilePath, j.ciecaid.Value);
|
||||||
|
|
||||||
|
int retryNumber = 0;
|
||||||
|
while (retryNumber < numRetries)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (Stream fis = File.Open(RootFilePath + j.ciecaid.Value + ".pft", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||||
|
{
|
||||||
|
var reader = new DBFReader(fis);
|
||||||
|
reader.SetSelectFields(new string[] { "TAX_TYPE1", //The below is is taken from a CCC estimate. Will require validation to ensure it is also accurate for Audatex/Mitchell
|
||||||
|
"TY1_TIER1",
|
||||||
|
"TY1_THRES1",
|
||||||
|
"TY1_RATE1",
|
||||||
|
"TY1_SUR1",
|
||||||
|
"TY1_TIER2",
|
||||||
|
"TY1_THRES2",
|
||||||
|
"TY1_RATE2",
|
||||||
|
"TY1_SUR2",
|
||||||
|
"TY1_TIER3",
|
||||||
|
"TY1_THRES3",
|
||||||
|
"TY1_RATE3",
|
||||||
|
"TY1_SUR3",
|
||||||
|
"TY1_TIER4",
|
||||||
|
"TY1_THRES4",
|
||||||
|
"TY1_RATE4",
|
||||||
|
"TY1_SUR4",
|
||||||
|
"TY1_TIER5",
|
||||||
|
"TY1_THRES5",
|
||||||
|
"TY1_RATE5",
|
||||||
|
"TY1_SUR5",
|
||||||
|
"TAX_TYPE2",
|
||||||
|
"TY2_TIER1",
|
||||||
|
"TY2_THRES1",
|
||||||
|
"TY2_RATE1",
|
||||||
|
"TY2_SUR1",
|
||||||
|
"TY2_TIER2",
|
||||||
|
"TY2_THRES2",
|
||||||
|
"TY2_RATE2",
|
||||||
|
"TY2_SUR2",
|
||||||
|
"TY2_TIER3",
|
||||||
|
"TY2_THRES3",
|
||||||
|
"TY2_RATE3",
|
||||||
|
"TY2_SUR3",
|
||||||
|
"TY2_TIER4",
|
||||||
|
"TY2_THRES4",
|
||||||
|
"TY2_RATE4",
|
||||||
|
"TY2_SUR4",
|
||||||
|
"TY2_TIER5",
|
||||||
|
"TY2_THRES5",
|
||||||
|
"TY2_RATE5",
|
||||||
|
"TY2_SUR5",
|
||||||
|
"TAX_TYPE3",
|
||||||
|
"TY3_TIER1",
|
||||||
|
"TY3_THRES1",
|
||||||
|
"TY3_RATE1",
|
||||||
|
"TY3_SUR1",
|
||||||
|
"TY3_TIER2",
|
||||||
|
"TY3_THRES2",
|
||||||
|
"TY3_RATE2",
|
||||||
|
"TY3_SUR2",
|
||||||
|
"TY3_TIER3",
|
||||||
|
"TY3_THRES3",
|
||||||
|
"TY3_RATE3",
|
||||||
|
"TY3_SUR3",
|
||||||
|
"TY3_TIER4",
|
||||||
|
"TY3_THRES4",
|
||||||
|
"TY3_RATE4",
|
||||||
|
"TY3_SUR4",
|
||||||
|
"TY3_TIER5",
|
||||||
|
"TY3_THRES5",
|
||||||
|
"TY3_RATE5",
|
||||||
|
"TY3_SUR5",
|
||||||
|
"TAX_TYPE4",
|
||||||
|
"TY4_TIER1",
|
||||||
|
"TY4_THRES1",
|
||||||
|
"TY4_RATE1",
|
||||||
|
"TY4_SUR1",
|
||||||
|
"TY4_TIER2",
|
||||||
|
"TY4_THRES2",
|
||||||
|
"TY4_RATE2",
|
||||||
|
"TY4_SUR2",
|
||||||
|
"TY4_TIER3",
|
||||||
|
"TY4_THRES3",
|
||||||
|
"TY4_RATE3",
|
||||||
|
"TY4_SUR3",
|
||||||
|
"TY4_TIER4",
|
||||||
|
"TY4_THRES4",
|
||||||
|
"TY4_RATE4",
|
||||||
|
"TY4_SUR4",
|
||||||
|
"TY4_TIER5",
|
||||||
|
"TY4_THRES5",
|
||||||
|
"TY4_RATE5",
|
||||||
|
"TY4_SUR5",
|
||||||
|
"TAX_TYPE5",
|
||||||
|
"TY5_TIER1",
|
||||||
|
"TY5_THRES1",
|
||||||
|
"TY5_RATE1",
|
||||||
|
"TY5_SUR1",
|
||||||
|
"TY5_TIER2",
|
||||||
|
"TY5_THRES2",
|
||||||
|
"TY5_RATE2",
|
||||||
|
"TY5_SUR2",
|
||||||
|
"TY5_TIER3",
|
||||||
|
"TY5_THRES3",
|
||||||
|
"TY5_RATE3",
|
||||||
|
"TY5_SUR3",
|
||||||
|
"TY5_TIER4",
|
||||||
|
"TY5_THRES4",
|
||||||
|
"TY5_RATE4",
|
||||||
|
"TY5_SUR4",
|
||||||
|
"TY5_TIER5",
|
||||||
|
"TY5_THRES5",
|
||||||
|
"TY5_RATE5",
|
||||||
|
"TY5_SUR5",
|
||||||
|
"TAX_TYPE6",
|
||||||
|
"TY6_TIER1",
|
||||||
|
"TY6_THRES1",
|
||||||
|
"TY6_RATE1",
|
||||||
|
"TY6_SUR1",
|
||||||
|
"TY6_TIER2",
|
||||||
|
"TY6_THRES2",
|
||||||
|
"TY6_RATE2",
|
||||||
|
"TY6_SUR2",
|
||||||
|
"TY6_TIER3",
|
||||||
|
"TY6_THRES3",
|
||||||
|
"TY6_RATE3",
|
||||||
|
"TY6_SUR3",
|
||||||
|
"TY6_TIER4",
|
||||||
|
"TY6_THRES4",
|
||||||
|
"TY6_RATE4",
|
||||||
|
"TY6_SUR4",
|
||||||
|
"TY6_TIER5",
|
||||||
|
"TY6_THRES5",
|
||||||
|
"TY6_RATE5",
|
||||||
|
"TY6_SUR5",
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var readValues = reader.NextRecord();
|
||||||
|
|
||||||
|
dynamic cieca_pft = new JObject();
|
||||||
|
cieca_pft.tax_type1 = readValues[0]?.ToString();
|
||||||
|
cieca_pft.ty1_tier1 = readValues[1]?.ToString();
|
||||||
|
cieca_pft.ty1_thres1 = readValues[2]?.ToString();
|
||||||
|
cieca_pft.ty1_rate1 = readValues[3]?.ToString();
|
||||||
|
cieca_pft.ty1_sur1 = readValues[4]?.ToString();
|
||||||
|
cieca_pft.ty1_tier2 = readValues[5]?.ToString();
|
||||||
|
cieca_pft.ty1_thres2 = readValues[6]?.ToString();
|
||||||
|
cieca_pft.ty1_rate2 = readValues[7]?.ToString();
|
||||||
|
cieca_pft.ty1_sur2 = readValues[8]?.ToString();
|
||||||
|
cieca_pft.ty1_tier3 = readValues[9]?.ToString();
|
||||||
|
cieca_pft.ty1_thres3 = readValues[10]?.ToString();
|
||||||
|
cieca_pft.ty1_rate3 = readValues[11]?.ToString();
|
||||||
|
cieca_pft.ty1_sur3 = readValues[12]?.ToString();
|
||||||
|
cieca_pft.ty1_tier4 = readValues[13]?.ToString();
|
||||||
|
cieca_pft.ty1_thres4 = readValues[14]?.ToString();
|
||||||
|
cieca_pft.ty1_rate4 = readValues[15]?.ToString();
|
||||||
|
cieca_pft.ty1_sur4 = readValues[16]?.ToString();
|
||||||
|
cieca_pft.ty1_tier5 = readValues[17]?.ToString();
|
||||||
|
cieca_pft.ty1_thres5 = readValues[18]?.ToString();
|
||||||
|
cieca_pft.ty1_rate5 = readValues[19]?.ToString();
|
||||||
|
cieca_pft.ty1_sur5 = readValues[20]?.ToString();
|
||||||
|
cieca_pft.tax_type2 = readValues[21]?.ToString();
|
||||||
|
cieca_pft.ty2_tier1 = readValues[22]?.ToString();
|
||||||
|
cieca_pft.ty2_thres1 = readValues[23]?.ToString();
|
||||||
|
cieca_pft.ty2_rate1 = readValues[24]?.ToString();
|
||||||
|
cieca_pft.ty2_sur1 = readValues[25]?.ToString();
|
||||||
|
cieca_pft.ty2_tier2 = readValues[26]?.ToString();
|
||||||
|
cieca_pft.ty2_thres2 = readValues[27]?.ToString();
|
||||||
|
cieca_pft.ty2_rate2 = readValues[28]?.ToString();
|
||||||
|
cieca_pft.ty2_sur2 = readValues[29]?.ToString();
|
||||||
|
cieca_pft.ty2_tier3 = readValues[30]?.ToString();
|
||||||
|
cieca_pft.ty2_thres3 = readValues[31]?.ToString();
|
||||||
|
cieca_pft.ty2_rate3 = readValues[32]?.ToString();
|
||||||
|
cieca_pft.ty2_sur3 = readValues[33]?.ToString();
|
||||||
|
cieca_pft.ty2_tier4 = readValues[34]?.ToString();
|
||||||
|
cieca_pft.ty2_thres4 = readValues[35]?.ToString();
|
||||||
|
cieca_pft.ty2_rate4 = readValues[36]?.ToString();
|
||||||
|
cieca_pft.ty2_sur4 = readValues[37]?.ToString();
|
||||||
|
cieca_pft.ty2_tier5 = readValues[38]?.ToString();
|
||||||
|
cieca_pft.ty2_thres5 = readValues[39]?.ToString();
|
||||||
|
cieca_pft.ty2_rate5 = readValues[40]?.ToString();
|
||||||
|
cieca_pft.ty2_sur5 = readValues[41]?.ToString();
|
||||||
|
cieca_pft.tax_type3 = readValues[42]?.ToString();
|
||||||
|
cieca_pft.ty3_tier1 = readValues[43]?.ToString();
|
||||||
|
cieca_pft.ty3_thres1 = readValues[44]?.ToString();
|
||||||
|
cieca_pft.ty3_rate1 = readValues[45]?.ToString();
|
||||||
|
cieca_pft.ty3_sur1 = readValues[46]?.ToString();
|
||||||
|
cieca_pft.ty3_tier2 = readValues[47]?.ToString();
|
||||||
|
cieca_pft.ty3_thres2 = readValues[48]?.ToString();
|
||||||
|
cieca_pft.ty3_rate2 = readValues[49]?.ToString();
|
||||||
|
cieca_pft.ty3_sur2 = readValues[50]?.ToString();
|
||||||
|
cieca_pft.ty3_tier3 = readValues[51]?.ToString();
|
||||||
|
cieca_pft.ty3_thres3 = readValues[52]?.ToString();
|
||||||
|
cieca_pft.ty3_rate3 = readValues[53]?.ToString();
|
||||||
|
cieca_pft.ty3_sur3 = readValues[54]?.ToString();
|
||||||
|
cieca_pft.ty3_tier4 = readValues[55]?.ToString();
|
||||||
|
cieca_pft.ty3_thres4 = readValues[56]?.ToString();
|
||||||
|
cieca_pft.ty3_rate4 = readValues[57]?.ToString();
|
||||||
|
cieca_pft.ty3_sur4 = readValues[58]?.ToString();
|
||||||
|
cieca_pft.ty3_tier5 = readValues[59]?.ToString();
|
||||||
|
cieca_pft.ty3_thres5 = readValues[60]?.ToString();
|
||||||
|
cieca_pft.ty3_rate5 = readValues[61]?.ToString();
|
||||||
|
cieca_pft.ty3_sur5 = readValues[62]?.ToString();
|
||||||
|
cieca_pft.tax_type4 = readValues[63]?.ToString();
|
||||||
|
cieca_pft.ty4_tier1 = readValues[64]?.ToString();
|
||||||
|
cieca_pft.ty4_thres1 = readValues[65]?.ToString();
|
||||||
|
cieca_pft.ty4_rate1 = readValues[66]?.ToString();
|
||||||
|
cieca_pft.ty4_sur1 = readValues[67]?.ToString();
|
||||||
|
cieca_pft.ty4_tier2 = readValues[68]?.ToString();
|
||||||
|
cieca_pft.ty4_thres2 = readValues[69]?.ToString();
|
||||||
|
cieca_pft.ty4_rate2 = readValues[70]?.ToString();
|
||||||
|
cieca_pft.ty4_sur2 = readValues[71]?.ToString();
|
||||||
|
cieca_pft.ty4_tier3 = readValues[72]?.ToString();
|
||||||
|
cieca_pft.ty4_thres3 = readValues[73]?.ToString();
|
||||||
|
cieca_pft.ty4_rate3 = readValues[74]?.ToString();
|
||||||
|
cieca_pft.ty4_sur3 = readValues[75]?.ToString();
|
||||||
|
cieca_pft.ty4_tier4 = readValues[76]?.ToString();
|
||||||
|
cieca_pft.ty4_thres4 = readValues[77]?.ToString();
|
||||||
|
cieca_pft.ty4_rate4 = readValues[78]?.ToString();
|
||||||
|
cieca_pft.ty4_sur4 = readValues[79]?.ToString();
|
||||||
|
cieca_pft.ty4_tier5 = readValues[80]?.ToString();
|
||||||
|
cieca_pft.ty4_thres5 = readValues[81]?.ToString();
|
||||||
|
cieca_pft.ty4_rate5 = readValues[82]?.ToString();
|
||||||
|
cieca_pft.ty4_sur5 = readValues[83]?.ToString();
|
||||||
|
cieca_pft.tax_type5 = readValues[84]?.ToString();
|
||||||
|
cieca_pft.ty5_tier1 = readValues[85]?.ToString();
|
||||||
|
cieca_pft.ty5_thres1 = readValues[86]?.ToString();
|
||||||
|
cieca_pft.ty5_rate1 = readValues[87]?.ToString();
|
||||||
|
cieca_pft.ty5_sur1 = readValues[88]?.ToString();
|
||||||
|
cieca_pft.ty5_tier2 = readValues[89]?.ToString();
|
||||||
|
cieca_pft.ty5_thres2 = readValues[90]?.ToString();
|
||||||
|
cieca_pft.ty5_rate2 = readValues[91]?.ToString();
|
||||||
|
cieca_pft.ty5_sur2 = readValues[92]?.ToString();
|
||||||
|
cieca_pft.ty5_tier3 = readValues[93]?.ToString();
|
||||||
|
cieca_pft.ty5_thres3 = readValues[94]?.ToString();
|
||||||
|
cieca_pft.ty5_rate3 = readValues[95]?.ToString();
|
||||||
|
cieca_pft.ty5_sur3 = readValues[96]?.ToString();
|
||||||
|
cieca_pft.ty5_tier4 = readValues[97]?.ToString();
|
||||||
|
cieca_pft.ty5_thres4 = readValues[98]?.ToString();
|
||||||
|
cieca_pft.ty5_rate4 = readValues[99]?.ToString();
|
||||||
|
cieca_pft.ty5_sur4 = readValues[100]?.ToString();
|
||||||
|
cieca_pft.ty5_tier5 = readValues[101]?.ToString();
|
||||||
|
cieca_pft.ty5_thres5 = readValues[102]?.ToString();
|
||||||
|
cieca_pft.ty5_rate5 = readValues[103]?.ToString();
|
||||||
|
cieca_pft.ty5_sur5 = readValues[104]?.ToString();
|
||||||
|
cieca_pft.tax_type6 = readValues[105]?.ToString();
|
||||||
|
cieca_pft.ty6_tier1 = readValues[106]?.ToString();
|
||||||
|
cieca_pft.ty6_thres1 = readValues[107]?.ToString();
|
||||||
|
cieca_pft.ty6_rate1 = readValues[108]?.ToString();
|
||||||
|
cieca_pft.ty6_sur1 = readValues[109]?.ToString();
|
||||||
|
cieca_pft.ty6_tier2 = readValues[110]?.ToString();
|
||||||
|
cieca_pft.ty6_thres2 = readValues[111]?.ToString();
|
||||||
|
cieca_pft.ty6_rate2 = readValues[112]?.ToString();
|
||||||
|
cieca_pft.ty6_sur2 = readValues[113]?.ToString();
|
||||||
|
cieca_pft.ty6_tier3 = readValues[114]?.ToString();
|
||||||
|
cieca_pft.ty6_thres3 = readValues[115]?.ToString();
|
||||||
|
cieca_pft.ty6_rate3 = readValues[116]?.ToString();
|
||||||
|
cieca_pft.ty6_sur3 = readValues[117]?.ToString();
|
||||||
|
cieca_pft.ty6_tier4 = readValues[118]?.ToString();
|
||||||
|
cieca_pft.ty6_thres4 = readValues[119]?.ToString();
|
||||||
|
cieca_pft.ty6_rate4 = readValues[120]?.ToString();
|
||||||
|
cieca_pft.ty6_sur4 = readValues[121]?.ToString();
|
||||||
|
cieca_pft.ty6_tier5 = readValues[122]?.ToString();
|
||||||
|
cieca_pft.ty6_thres5 = readValues[123]?.ToString();
|
||||||
|
cieca_pft.ty6_rate5 = readValues[124]?.ToString();
|
||||||
|
cieca_pft.ty6_sur5 = readValues[125]?.ToString();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
j.cieca_pft = cieca_pft;
|
||||||
|
|
||||||
|
|
||||||
|
reader.Dispose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
logger.Trace(ex, "Unable to open PFt file. Retrying. ");
|
||||||
|
retryNumber++;
|
||||||
|
Thread.Sleep(retrySleep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static bool ParsePfoFile(ref dynamic j, string RootFilePath, string system = "M")
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(j.ciecaid.Value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
logger.Trace(@"Parsing PFO at: {0}{1}", RootFilePath, j.ciecaid.Value);
|
||||||
|
|
||||||
|
int retryNumber = 0;
|
||||||
|
while (retryNumber < numRetries)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (Stream fis = File.Open(RootFilePath + j.ciecaid.Value + ".pfo", FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
|
||||||
|
{
|
||||||
|
var reader = new DBFReader(fis);
|
||||||
|
reader.SetSelectFields(new string[] { "TX_TOW_TY",
|
||||||
|
"TOW_T_TY1",
|
||||||
|
"TOW_T_IN1",
|
||||||
|
"TOW_T_TY2",
|
||||||
|
"TOW_T_IN2",
|
||||||
|
"TOW_T_TY3",
|
||||||
|
"TOW_T_IN3",
|
||||||
|
"TOW_T_TY4",
|
||||||
|
"TOW_T_IN4",
|
||||||
|
"TOW_T_TY5",
|
||||||
|
"TOW_T_IN5",
|
||||||
|
"TOW_T_TY6",
|
||||||
|
"TOW_T_IN6",
|
||||||
|
"TX_STOR_TY",
|
||||||
|
"STOR_T_TY1",
|
||||||
|
"STOR_T_IN1",
|
||||||
|
"STOR_T_TY2",
|
||||||
|
"STOR_T_IN2",
|
||||||
|
"STOR_T_TY3",
|
||||||
|
"STOR_T_IN3",
|
||||||
|
"STOR_T_TY4",
|
||||||
|
"STOR_T_IN4",
|
||||||
|
"STOR_T_TY5",
|
||||||
|
"STOR_T_IN5",
|
||||||
|
"STOR_T_TY6",
|
||||||
|
"STOR_T_IN6"
|
||||||
|
});
|
||||||
|
|
||||||
|
var readValues = reader.NextRecord();
|
||||||
|
|
||||||
|
dynamic cieca_pfo = new JObject();
|
||||||
|
cieca_pfo.tx_tow_ty = readValues[0]?.ToString();
|
||||||
|
cieca_pfo.tow_t_ty1 = readValues[1]?.ToString();
|
||||||
|
cieca_pfo.tow_t_in1 = (string)readValues[2] == "Y" ? true : false;
|
||||||
|
cieca_pfo.tow_t_ty2 = readValues[3]?.ToString();
|
||||||
|
cieca_pfo.tow_t_in2 = (string)readValues[4] == "Y" ? true : false;
|
||||||
|
cieca_pfo.tow_t_ty3 = readValues[5]?.ToString();
|
||||||
|
cieca_pfo.tow_t_in3 = (string)readValues[6] == "Y" ? true : false;
|
||||||
|
cieca_pfo.tow_t_ty4 = readValues[7]?.ToString();
|
||||||
|
cieca_pfo.tow_t_in4 = (string)readValues[8] == "Y" ? true : false;
|
||||||
|
cieca_pfo.tow_t_ty5 = readValues[9]?.ToString();
|
||||||
|
cieca_pfo.tow_t_in5 = (string)readValues[10] == "Y" ? true : false;
|
||||||
|
cieca_pfo.tow_t_ty6 = readValues[11]?.ToString();
|
||||||
|
cieca_pfo.tow_t_in6 = (string)readValues[12] == "Y" ? true : false;
|
||||||
|
cieca_pfo.tx_stor_ty = readValues[13]?.ToString();
|
||||||
|
cieca_pfo.stor_t_ty1 = readValues[14]?.ToString();
|
||||||
|
cieca_pfo.stor_t_in1 = (string)readValues[15] == "Y" ? true : false;
|
||||||
|
cieca_pfo.stor_t_ty2 = readValues[16]?.ToString();
|
||||||
|
cieca_pfo.stor_t_in2 = (string)readValues[17] == "Y" ? true : false;
|
||||||
|
cieca_pfo.stor_t_ty3 = readValues[18]?.ToString();
|
||||||
|
cieca_pfo.stor_t_in3 = (string)readValues[19] == "Y" ? true : false;
|
||||||
|
cieca_pfo.stor_t_ty4 = readValues[20]?.ToString();
|
||||||
|
cieca_pfo.stor_t_in4 = (string)readValues[21] == "Y" ? true : false;
|
||||||
|
cieca_pfo.stor_t_ty5 = readValues[22]?.ToString();
|
||||||
|
cieca_pfo.stor_t_in5 = (string)readValues[23] == "Y" ? true : false;
|
||||||
|
cieca_pfo.stor_t_ty6 = readValues[24]?.ToString();
|
||||||
|
cieca_pfo.stor_t_in6 = (string)readValues[25] == "Y" ? true : false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
j.cieca_pfo = cieca_pfo;
|
||||||
|
|
||||||
|
|
||||||
|
reader.Dispose();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
logger.Trace(ex, "Unable to open PFO file. Retrying. ");
|
||||||
|
retryNumber++;
|
||||||
|
Thread.Sleep(retrySleep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static bool ParsePfmFile(ref dynamic j, string RootFilePath)
|
public static bool ParsePfmFile(ref dynamic j, string RootFilePath)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(j.ciecaid.Value))
|
if (string.IsNullOrWhiteSpace(j.ciecaid.Value))
|
||||||
@@ -803,7 +1194,7 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
"MAT_TX_IN5"
|
"MAT_TX_IN5"
|
||||||
});
|
});
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic materialsObj = new JObject();
|
||||||
|
|
||||||
for (int i = 0; i < reader.RecordCount; i++)
|
for (int i = 0; i < reader.RecordCount; i++)
|
||||||
{
|
{
|
||||||
@@ -818,14 +1209,14 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
j.tax_paint_mat_rt = float.Parse(readValues[14].ToString()) / 100;
|
j.tax_paint_mat_rt = float.Parse(readValues[14].ToString()) / 100;
|
||||||
o.cal_maxdlr = float.Parse(readValues[3].ToString());
|
o.cal_maxdlr = float.Parse(readValues[3].ToString());
|
||||||
o.cal_opcode = readValues[12].ToString();
|
o.cal_opcode = readValues[12].ToString();
|
||||||
d.mapa = o;
|
materialsObj.mapa = o;
|
||||||
break;
|
break;
|
||||||
case "MASH":
|
case "MASH":
|
||||||
j.rate_mash = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.?
|
j.rate_mash = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.?
|
||||||
j.tax_shop_mat_rt = float.Parse(readValues[14].ToString()) / 100;
|
j.tax_shop_mat_rt = float.Parse(readValues[14].ToString()) / 100;
|
||||||
o.cal_maxdlr = float.Parse(readValues[3].ToString());
|
o.cal_maxdlr = float.Parse(readValues[3].ToString());
|
||||||
o.cal_opcode = readValues[12].ToString();
|
o.cal_opcode = readValues[12].ToString();
|
||||||
d.mash = o;
|
materialsObj.mash = o;
|
||||||
break;
|
break;
|
||||||
case "MAHW": //TODO Should the remainder of these be index 7 or 11?
|
case "MAHW": //TODO Should the remainder of these be index 7 or 11?
|
||||||
j.rate_mahw = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.?
|
j.rate_mahw = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.?
|
||||||
@@ -850,37 +1241,43 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
logger.Error("Unknown type value present in PFM file. {0}:{1}", readValues[0].ToString(), readValues[2]);
|
logger.Error("Unknown type value present in PFM file. {0}:{1}", readValues[0].ToString(), readValues[2]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
dynamic pfm_x = new JObject();
|
||||||
|
|
||||||
|
pfm_x.matl_type = readValues[0];//MATL_TYPE
|
||||||
|
pfm_x.cal_code = readValues[1];//CAL_CODE
|
||||||
|
pfm_x.cal_desc = readValues[2];//CAL_DESC
|
||||||
|
pfm_x.cal_maxdlr = readValues[3];//CAL_MAXDLR
|
||||||
|
pfm_x.cal_prip = readValues[4];//CAL_PRIP
|
||||||
|
pfm_x.cal_secp = readValues[5];//CAL_SECP
|
||||||
|
pfm_x.mat_calp = readValues[6];//MAT_CALP
|
||||||
|
pfm_x.cal_prethr = readValues[7];//CAL_PRETHR
|
||||||
|
pfm_x.cal_pstthr = readValues[8];//CAL_PSTTHR
|
||||||
|
pfm_x.cal_thramt = readValues[9];//CAL_THRAMT
|
||||||
|
pfm_x.cal_lbrmin = readValues[10];//CAL_LBRMIN
|
||||||
|
pfm_x.cal_lbrrte = readValues[11];//CAL_LBRRTE
|
||||||
|
pfm_x.cal_opcode = readValues[12];//CAL_OPCODE
|
||||||
|
pfm_x.tax_ind = readValues[13];//TAX_IND
|
||||||
|
pfm_x.mat_taxp = readValues[14];//MAT_TAXP
|
||||||
|
pfm_x.mat_adjp = readValues[15];//MAT_ADJP
|
||||||
|
pfm_x.mat_tx_ty1 = readValues[16];//MAT_TX_TY1
|
||||||
|
pfm_x.mat_tx_in1 = readValues[17];//MAT_TX_IN1
|
||||||
|
pfm_x.mat_tx_ty2 = readValues[18];//MAT_TX_TY2
|
||||||
|
pfm_x.mat_tx_in2 = readValues[19];//MAT_TX_IN2
|
||||||
|
pfm_x.mat_tx_ty3 = readValues[20];//MAT_TX_TY3
|
||||||
|
pfm_x.mat_tx_in3 = readValues[21];//MAT_TX_IN3
|
||||||
|
pfm_x.mat_tx_ty4 = readValues[22];//MAT_TX_TY4
|
||||||
|
pfm_x.mat_tx_in4 = readValues[23];//MAT_TX_IN4
|
||||||
|
pfm_x.mat_tx_ty5 = readValues[24];//MAT_TX_TY5
|
||||||
|
pfm_x.mat_tx_in5 = readValues[25];//MAT_TX_IN5
|
||||||
|
|
||||||
|
materialsObj[readValues[0].ToString()] = pfm_x;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
j.materials = d;
|
|
||||||
//TODO: There was additional logic in paradox here around the mxdlr being > 0 which it always appears to be.
|
//TODO: There was additional logic in paradox here around the mxdlr being > 0 which it always appears to be.
|
||||||
|
|
||||||
//j.matl_type = readValues[0];//MATL_TYPE
|
j.materials = materialsObj;
|
||||||
//j.cal_code = readValues[1];//CAL_CODE
|
|
||||||
//j.cal_desc = readValues[2];//CAL_DESC
|
|
||||||
//j.cal_maxdlr = readValues[3];//CAL_MAXDLR
|
|
||||||
//j.cal_prip = readValues[4];//CAL_PRIP
|
|
||||||
//j.cal_secp = readValues[5];//CAL_SECP
|
|
||||||
//j.mat_calp = readValues[6];//MAT_CALP
|
|
||||||
//j.cal_prethr = readValues[7];//CAL_PRETHR
|
|
||||||
//j.cal_pstthr = readValues[8];//CAL_PSTTHR
|
|
||||||
//j.cal_thramt = readValues[9];//CAL_THRAMT
|
|
||||||
//j.cal_lbrmin = readValues[10];//CAL_LBRMIN
|
|
||||||
//j.cal_lbrrte = readValues[11];//CAL_LBRRTE
|
|
||||||
//j.cal_opcode = readValues[12];//CAL_OPCODE
|
|
||||||
//j.tax_ind = readValues[13];//TAX_IND
|
|
||||||
//j.mat_taxp = readValues[14];//MAT_TAXP
|
|
||||||
//j.mat_adjp = readValues[15];//MAT_ADJP
|
|
||||||
//j.mat_tx_ty1 = readValues[16];//MAT_TX_TY1
|
|
||||||
//j.mat_tx_in1 = readValues[17];//MAT_TX_IN1
|
|
||||||
//j.mat_tx_ty2 = readValues[18];//MAT_TX_TY2
|
|
||||||
//j.mat_tx_in2 = readValues[19];//MAT_TX_IN2
|
|
||||||
//j.mat_tx_ty3 = readValues[20];//MAT_TX_TY3
|
|
||||||
//j.mat_tx_in3 = readValues[21];//MAT_TX_IN3
|
|
||||||
//j.mat_tx_ty4 = readValues[22];//MAT_TX_TY4
|
|
||||||
//j.mat_tx_in4 = readValues[23];//MAT_TX_IN4
|
|
||||||
//j.mat_tx_ty5 = readValues[24];//MAT_TX_TY5
|
|
||||||
//j.mat_tx_in5 = readValues[25];//MAT_TX_IN5
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -972,7 +1369,7 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
v.v_prod_dt = readValues[7]?.ToString();
|
v.v_prod_dt = readValues[7]?.ToString();
|
||||||
v.v_model_yr = readValues[8]?.ToString();
|
v.v_model_yr = readValues[8]?.ToString();
|
||||||
v.v_makecode = readValues[9]?.ToString();
|
v.v_makecode = readValues[9]?.ToString();
|
||||||
v.v_make_desc = readValues[10]?.ToString();
|
v.v_make_desc = readValues[10]?.ToString() == "" ? readValues[9]?.ToString() : readValues[10]?.ToString();
|
||||||
v.v_model_desc = readValues[11]?.ToString();
|
v.v_model_desc = readValues[11]?.ToString();
|
||||||
v.v_type = readValues[12]?.ToString();
|
v.v_type = readValues[12]?.ToString();
|
||||||
v.v_bstyle = readValues[13]?.ToString();
|
v.v_bstyle = readValues[13]?.ToString();
|
||||||
@@ -1410,16 +1807,16 @@ namespace RomeOnlinePartner.Utils.Decoder
|
|||||||
t.prt_mkupp = readValues[3];//PRT_MKUPP
|
t.prt_mkupp = readValues[3];//PRT_MKUPP
|
||||||
t.prt_mktyp = readValues[4];//PRT_MKTYP
|
t.prt_mktyp = readValues[4];//PRT_MKTYP
|
||||||
t.prt_discp = readValues[5];//PRT_DISCP
|
t.prt_discp = readValues[5];//PRT_DISCP
|
||||||
//t.prt_tx_ty1 = readValues[6];//PRT_TX_TY1
|
t.prt_tx_ty1 = readValues[6];//PRT_TX_TY1
|
||||||
//t.prt_tx_in1 = readValues[7];//PRT_TX_IN1
|
t.prt_tx_in1 = (string)readValues[7] == "Y" ? true : false;//PRT_TX_IN1
|
||||||
//t.prt_tx_ty2 = readValues[8];//PRT_TX_TY2
|
t.prt_tx_ty2 = readValues[8];//PRT_TX_TY2
|
||||||
//t.prt_tx_in2 = readValues[9];//PRT_TX_IN2
|
t.prt_tx_in2 = (string)readValues[9] == "Y" ? true : false;//PRT_TX_IN2
|
||||||
//t.prt_tx_ty3 = readValues[10];//PRT_TX_TY3
|
t.prt_tx_ty3 = readValues[10];//PRT_TX_TY3
|
||||||
//t.prt_tx_in3 = readValues[11];//PRT_TX_IN3
|
t.prt_tx_in3 = (string)readValues[11] == "Y" ? true : false;//PRT_TX_IN3
|
||||||
//t.prt_tx_ty4 = readValues[12];//PRT_TX_TY4
|
t.prt_tx_ty4 = readValues[12];//PRT_TX_TY4
|
||||||
//t.prt_tx_in4 = readValues[13];//PRT_TX_IN4
|
t.prt_tx_in4 = (string)readValues[13] == "Y" ? true : false;//PRT_TX_IN4
|
||||||
//t.prt_tx_ty5 = readValues[14];//PRT_TX_TY5
|
t.prt_tx_ty5 = readValues[14];//PRT_TX_TY5
|
||||||
//t.prt_tx_in5 = readValues[15];//PRT_TX_IN5
|
t.prt_tx_in5 = (string)readValues[15] == "Y" ? true : false;//PRT_TX_IN5
|
||||||
|
|
||||||
taxRates[readValues[0]] = t;
|
taxRates[readValues[0]] = t;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user