From dd221ddc9b4f62d1c3b733feb61731abdc402ccf Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 30 Jan 2020 14:45:06 -0800 Subject: [PATCH] Added notes to Est Decoder from Review Session --- .../Utils/Decoder/EstimateDecoder.cs | 139 +++++++++++++----- 1 file changed, 103 insertions(+), 36 deletions(-) diff --git a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs index 1452b74..3146187 100644 --- a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs +++ b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs @@ -403,24 +403,24 @@ namespace BodyshopUploader.Utils.Decoder //Values divided by 100 to make consistent. //j.id_pro_nam = readValues[0];//ID_PRO_NAM - //j.tax_prethr = readValues[1];//TAX_PRETHR - //j.tax_thramt = readValues[2];//TAX_THRAMT - //j.tax_pstthr = float.Parse(readValues[3].ToString())/100;//TAX_PSTTHR //PST for Parts + //TODO: ADD //j.tax_prethr = readValues[1];//TAX_PRETHR Parts tax for pre-threshold + //TODO: ADD //j.tax_thramt = readValues[2];//TAX_THRAMT Parts threshold amount + //TODO: ADD //j.tax_pstthr = float.Parse(readValues[3].ToString())/100;//TAX_PSTTHR //PST for Parts //j.tax_tow_in = readValues[4];//TAX_TOW_IN j.tax_tow_rt = (bool)readValues[4] ? float.Parse(readValues[5].ToString()) / 100 : 0;//TAX_TOW_RT //j.tax_str_in = readValues[6];//TAX_STR_IN - //j.tax_str_rt = readValues[7];//TAX_STR_RT + //TODO: ADD //j.tax_str_rt = readValues[7];//TAX_STR_RT //j.tax_sub_in = readValues[8];//TAX_SUB_IN - //j.tax_sub_rt = (bool)readValues[8] ? float.Parse(readValues[9].ToString()) / 100 : 0;//TAX_SUB_RT + //TODO: ADD //j.tax_sub_rt = (bool)readValues[8] ? float.Parse(readValues[9].ToString()) / 100 : 0;//TAX_SUB_RT //j.tax_btr_in = readValues[10];//TAX_BTR_IN - //j.tax_lbr_rt = readValues[11];//TAX_LBR_RT + //TODO: ADD //j.tax_lbr_rt = readValues[11];//TAX_LBR_RT j.federal_tax_rate = float.Parse(readValues[12].ToString()) / 100;//TAX_GST_RT - //j.tax_gst_in = readValues[13];//TAX_GST_IN - //j.adj_g_disc = readValues[14];//ADJ_G_DISC - //j.adj_towdis = readValues[15];//ADJ_TOWDIS - //j.adj_strdis = readValues[16];//ADJ_STRDIS - //j.adj_btr_in = readValues[17];//ADJ_BTR_IN - //j.tax_predis = readValues[18];//TAX_PREDIS + //j.tax_gst_in = readValues[13];//TAX_GST_IN + //TODO: ADD //j.adj_g_disc = readValues[14];//ADJ_G_DISC + //TODO: ADD //j.adj_towdis = readValues[15];//ADJ_TOWDIS + //TODO: ADD //j.adj_strdis = readValues[16];//ADJ_STRDIS + //j.adj_btr_in = readValues[17];//ADJ_BTR_IN + //TODO: ADD //j.tax_predis = readValues[18];//TAX_PREDIS reader.Dispose(); return; } @@ -470,6 +470,7 @@ namespace BodyshopUploader.Utils.Decoder for (int i = 0; i < reader.RecordCount; i++) { var readValues = reader.NextRecord(); + //TODO: Add in switch case for Audatex/CCC/Mitchell for Aluminum switch (readValues[0].ToString())//Case switch on LBR_TYPE to assign correctly. { case "LAB": @@ -601,6 +602,7 @@ namespace BodyshopUploader.Utils.Decoder var readValues = reader.NextRecord(); switch (readValues[0].ToString())//Case switch on MATL_TYPE to assign correctly. { + //TODO: Import MAXDLR for every type. case "MAPA": j.rate_mapa = readValues[11]; j.tax_paint_mat_rt = readValues[14]; @@ -837,6 +839,65 @@ namespace BodyshopUploader.Utils.Decoder var allLines = new JArray(); + //Create new column to capture lbr op code description. in UI, show partno ? partno : op code desc. has to be stamped + //If the OEM_PARTNO is empty, use the operation code and look it up in opcode table. If found, take opcode.opcodedescription and populate oem_partno with it + //populate lbr_op with opcode.opcodetouse + //if part_type is blank, pull in the part type from parttypetousemitchell + //if not found, set description to not efined + + #region Code + //TODO: How to handle price markup and discounts. + // if Number(tcLin."PRT_DSMK_P") = 0 then + + // switch + + // case TblEstimatingPlatform= "Audatex": ; calculate adjustmetn without the amount in tcMitchell."PRT_DSMK_M + + // StrPercentAdj = Number(tcLin."PRT_DSMK_P") + + // StrActPrice = (Number(tcLin."PART_QTY") * Number(tcLin."ACT_PRICE")) * (1 + (StrPercentAdj / 100)); '---------------------------- PRT_DSMK_M + + // tcEstLine."ACT_PRICE" = StrActPrice + + // tcEstLine."MISC_AMT" = tcLin."MISC_AMT" + + // case TblEstimatingPlatform= "CCC" : + //if tcLin."MOD_LBR_TY" = "LAR" then + + // tcEstLine."ACT_PRICE" = ""; Price has to be blank,CCC puts the part price on body and refinish lines doubling the price + + // else + // tcEstLine."ACT_PRICE" = Number(tcLin."PART_QTY") * Number(tcLin."ACT_PRICE") + + // endif + + // if Number(tcLin."MISC_AMT") > 0 then; some sublet operations are posted to tcLin."MISC_AMT" + + // tcEstLine."ACT_PRICE" = tcLin."MISC_AMT" + + // endif + // otherwise: + //tcEstLine."ACT_PRICE" = Number(tcLin."PART_QTY") * Number(tcLin."ACT_PRICE") + + // tcEstLine."MISC_AMT" = tcLin."MISC_AMT" + + // endswitch + + // else + // if TblEstimatingPlatform = "Audatex" then; calculate adjustmetn without the amount in tcMitchell."PRT_DSMK_M + + // tcEstLine."ACT_PRICE" = (Number(tcLin."PART_QTY") * Number(tcLin."ACT_PRICE")) * (1 + (Number(tcLin."PRT_DSMK_P") / 100)); '---------------------------- PRT_DSMK_M + + // else + // tcEstLine."ACT_PRICE" = (Number(tcLin."PART_QTY") * Number(tcLin."ACT_PRICE")) + Number(tcLin."PRT_DSMK_M") + + // endif + // endif + #endregion + + + + for (int i = 0; i < reader.RecordCount; i++) { var readValues = reader.NextRecord(); @@ -854,41 +915,47 @@ namespace BodyshopUploader.Utils.Decoder lin.line_desc = readValues[7];//LINE_DESC lin.part_type = readValues[8];//PART_TYPE //lin.part_descj = readValues[9];//PART_DESCJ - //lin.glass_flag = readValues[10];//GLASS_FLAG + //TODO: ADD NEW //lin.glass_flag = readValues[10];//GLASS_FLAG lin.oem_partno = readValues[11];//OEM_PARTNO - //lin.price_inc = readValues[12];//PRICE_INC - //lin.alt_part_i = readValues[13];//ALT_PART_I + //TODO: ADD NEW //lin.price_inc = readValues[12];//PRICE_INC + //TODO: ADD NEW //lin.alt_part_i = readValues[13];//ALT_PART_I lin.tax_part = readValues[14];//TAX_PART lin.db_price = readValues[15];//DB_PRICE lin.act_price = readValues[16];//ACT_PRICE - //lin.price_j = readValues[17];//PRICE_J - //lin.cert_part = readValues[18];//CERT_PART + //TODO: ADD NEW //lin.price_j = readValues[17];//PRICE_J + //TODO: ADD NEW //lin.cert_part = readValues[18];//CERT_PART lin.part_qty = readValues[19];//PART_QTY - //lin.alt_co_id = readValues[20];//ALT_CO_ID + //TODO: ADD NEW //lin.alt_co_id = readValues[20];//ALT_CO_ID lin.alt_partno = readValues[21];//ALT_PARTNO - //lin.alt_overrd = readValues[22];//ALT_OVERRD - //lin.alt_partm = readValues[23];//ALT_PARTM - //lin.prt_dsmk_p = readValues[24];//PRT_DSMK_P - //lin.prt_dsmk_m = readValues[25];//PRT_DSMK_M + //TODO: ADD NEW //lin.alt_overrd = readValues[22];//ALT_OVERRD + //TODO: ADD NEW //lin.alt_partm = readValues[23];//ALT_PARTM + //TODO: ADD NEW //lin.prt_dsmk_p = readValues[24];//PRT_DSMK_P + //TODO: ADD NEW //lin.prt_dsmk_m = readValues[25];//PRT_DSMK_M lin.mod_lbr_ty = readValues[26];//MOD_LBR_TY + + //TODO: Add logic + //TODO: Create LAA for aluminum + //Mitchell uses LA3 for alum, audatex uses LA1 + //Otherwise put in whatever the standard value is. + lin.db_hrs = readValues[27];//DB_HRS lin.mod_lb_hrs = readValues[28];//MOD_LB_HRS - //lin.lbr_inc = readValues[29];//LBR_INC + //TODO: ADD NEW //lin.lbr_inc = readValues[29];//LBR_INC lin.lbr_op = readValues[30];//LBR_OP - //lin.lbr_hrs_j = readValues[31];//LBR_HRS_J - //lin.lbr_typ_j = readValues[32];//LBR_TYP_J - //lin.lbr_op_j = readValues[33];//LBR_OP_J - //lin.paint_stg = readValues[34];//PAINT_STG - //lin.paint_tone = readValues[35];//PAINT_TONE - //lin.lbr_tax = readValues[36];//LBR_TAX + //TODO: ADD NEW //lin.lbr_hrs_j = readValues[31];//LBR_HRS_J + //TODO: ADD NEW //lin.lbr_typ_j = readValues[32];//LBR_TYP_J + //TODO: ADD NEW//lin.lbr_op_j = readValues[33];//LBR_OP_J + //TODO: ADD NEW//lin.paint_stg = readValues[34];//PAINT_STG + //TODO: ADD NEW//lin.paint_tone = readValues[35];//PAINT_TONE + //TODO: ADD NEW//lin.lbr_tax = readValues[36];//LBR_TAX lin.lbr_amt = readValues[37];//LBR_AMT - //lin.misc_amt = readValues[38];//MISC_AMT - //lin.misc_sublt = readValues[39];//MISC_SUBLT - //lin.misc_tax = readValues[40];//MISC_TAX - //lin.bett_type = readValues[41];//BETT_TYPE - //lin.bett_pctg = readValues[42];//BETT_PCTG - //lin.bett_amt = readValues[43];//BETT_AMT - //lin.bett_tax = readValues[44];//BETT_TAX + //TODO: ADD NEW//lin.misc_amt = readValues[38];//MISC_AMT + //TODO: ADD NEW//lin.misc_sublt = readValues[39];//MISC_SUBLT + //TODO: ADD NEW//lin.misc_tax = readValues[40];//MISC_TAX + //TODO: ADD NEW/lin.bett_type = readValues[41];//BETT_TYPE + //TODO: ADD NEW//lin.bett_pctg = readValues[42];//BETT_PCTG + //TODO: ADD NEW//lin.bett_amt = readValues[43];//BETT_AMT + //TODO: ADD NEW//lin.bett_tax = readValues[44];//BETT_TAX allLines.Add(lin); }