ARMS Uploader

This commit is contained in:
Patrick Fic
2022-02-07 13:31:51 -08:00
parent 1221f35162
commit c936d354b2
16 changed files with 440 additions and 175 deletions

View File

@@ -7,24 +7,13 @@ using FileHelpers;
namespace BodyshopPartner.Utils
{
[FixedLengthRecord()]
public class ARMSRoDataModel
{
[FieldFixedLength(5)]
public int CustId;
[FieldFixedLength(30)]
[FieldTrim(TrimMode.Both)]
public string Name;
[FieldFixedLength(8)]
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
public DateTime? AddedDate;
[FieldFixedLength(8)]
public int ShopShortName;
public string ShopShortName;
[FieldFixedLength(8)]
public int RO;
[FieldFixedLength(1)]
@@ -52,9 +41,9 @@ namespace BodyshopPartner.Utils
[FieldFixedLength(11)]
public String CustomerZip;
[FieldFixedLength(10)]
public int CustomerPhone1;
public String CustomerPhone1;
[FieldFixedLength(10)]
public int CustomerPhone2;
public String CustomerPhone2;
[FieldFixedLength(35)]
public String CustomerSource;
[FieldFixedLength(1)]
@@ -92,9 +81,9 @@ namespace BodyshopPartner.Utils
[FieldFixedLength(11)]
public String InsuranceZip;
[FieldFixedLength(10)]
public int InsurancePhone;
public String InsurancePhone;
[FieldFixedLength(10)]
public int InsuranceFax;
public String InsuranceFax;
[FieldFixedLength(4)]
public String ClaimType;
@@ -132,7 +121,7 @@ namespace BodyshopPartner.Utils
[FieldFixedLength(35)]
public String InsuranceAgentFirstName;
[FieldFixedLength(10)]
public int InsAgentPhone;
public String InsAgentPhone;
[FieldFixedLength(8)]
[FieldConverter(ConverterKind.Date, "ddMMyyyy")]
@@ -183,184 +172,250 @@ namespace BodyshopPartner.Utils
public DateTime? DateClosed;
[FieldFixedLength(12)]
public Double? BodyRate;
public Decimal? BodyRate;
[FieldFixedLength(12)]
public Double? RefinishRate;
public Decimal? RefinishRate;
[FieldFixedLength(12)]
public Double? MechanicalRate;
public Decimal? MechanicalRate;
[FieldFixedLength(12)]
public Double? StructuralRate;
public Decimal? StructuralRate;
[FieldFixedLength(12)]
public Double? PMRate;
public Decimal? PMRate;
[FieldFixedLength(12)]
public Double? BMRate;
public Decimal? BMRate;
[FieldFixedLength(7)]
public Double? RetailWholesaleTaxRate;
public Decimal? RetailWholesaleTaxRate;
[FieldFixedLength(12)]
public Double? StorageRateperDay;
public Decimal? StorageRateperDay;
[FieldFixedLength(3)]
public Double? DaysStored;
public Decimal? DaysStored;
[FieldFixedLength(5)]
public Double? BodyHours;
public Decimal? BodyHours;
[FieldFixedLength(5)]
public Double? RefinishHours;
public Decimal? RefinishHours;
[FieldFixedLength(5)]
public Double? MechanicalHours;
public Decimal? MechanicalHours;
[FieldFixedLength(5)]
public Double? StructuralHours;
public Decimal? StructuralHours;
[FieldFixedLength(12)]
public Double? PartsTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? PartsTotal;
[FieldFixedLength(12)]
public Double? SubletTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SubletTotal;
[FieldFixedLength(12)]
public Double? BodyLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? BodyLaborTotal;
[FieldFixedLength(12)]
public Double? RefinishLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RefinishLaborTotal;
[FieldFixedLength(12)]
public Double? MechanicalLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? MechanicalLaborTotal;
[FieldFixedLength(12)]
public Double? StructuralLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? StructuralLaborTotal;
[FieldFixedLength(12)]
public Double? MiscellaneousChargeTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? MiscellaneousChargeTotal;
[FieldFixedLength(12)]
public Double? PMTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? PMTotal;
[FieldFixedLength(12)]
public Double? BMTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? BMTotal;
[FieldFixedLength(12)]
public Double? MiscTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? MiscTotal;
[FieldFixedLength(12)]
public Double? TowingTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? TowingTotal;
[FieldFixedLength(12)]
public Double? StorageTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? StorageTotal;
[FieldFixedLength(12)]
public Double? DetailTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? DetailTotal;
[FieldFixedLength(12)]
public Double? SalesTaxTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SalesTaxTotal;
[FieldFixedLength(12)]
public Double? GrossTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? GrossTotal;
[FieldFixedLength(12)]
public Double? DeductibleTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? DeductibleTotal;
[FieldFixedLength(12)]
public Double? DepreciationTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? DepreciationTotal;
[FieldFixedLength(12)]
public Double? Discount;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? Discount;
[FieldFixedLength(12)]
public Double? CustomerPay;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? CustomerPay;
[FieldFixedLength(12)]
public Double? InsurancePay;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? InsurancePay;
[FieldFixedLength(12)]
public Double? Deposit;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? Deposit;
[FieldFixedLength(12)]
public Double? AmountDue;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? AmountDue;
[FieldFixedLength(5)]
public Double? SupplementBodyHours;
public Decimal? SupplementBodyHours;
[FieldFixedLength(5)]
public Double? SupplementRefinishHours;
public Decimal? SupplementRefinishHours;
[FieldFixedLength(5)]
public Double? SupplementMechanicalHours;
public Decimal? SupplementMechanicalHours;
[FieldFixedLength(5)]
public Double? SupplementStructuralHours;
public Decimal? SupplementStructuralHours;
[FieldFixedLength(12)]
public Double? SupplementPartsTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementPartsTotal;
[FieldFixedLength(12)]
public Double? SupplementSubletTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementSubletTotal;
[FieldFixedLength(12)]
public Double? SupplementBodyLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementBodyLaborTotal;
[FieldFixedLength(12)]
public Double? SupplementRefinishLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementRefinishLaborTotal;
[FieldFixedLength(12)]
public Double? SupplementMechanicalLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementMechanicalLaborTotal;
[FieldFixedLength(12)]
public Double? SupplementStructuralLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementStructuralLaborTotal;
[FieldFixedLength(12)]
public Double? SupplementMiscellaneousChargeTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementMiscellaneousChargeTotal;
[FieldFixedLength(12)]
public Double? SupplementPMTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementPMTotal;
[FieldFixedLength(12)]
public Double? SupplementBMTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementBMTotal;
[FieldFixedLength(12)]
public Double? SupplementMiscTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementMiscTotal;
[FieldFixedLength(12)]
public Double? SupplementTowingTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementTowingTotal;
[FieldFixedLength(12)]
public Double? SupplementStorageTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementStorageTotal;
[FieldFixedLength(12)]
public Double? SupplementDetailTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementDetailTotal;
[FieldFixedLength(12)]
public Double? SupplementSalesTaxTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementSalesTaxTotal;
[FieldFixedLength(12)]
public Double? SupplementGrossTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementGrossTotal;
[FieldFixedLength(12)]
public Double? SupplementDeductibleTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementDeductibleTotal;
[FieldFixedLength(12)]
public Double? SupplementDepreciationTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementDepreciationTotal;
[FieldFixedLength(12)]
public Double? SupplementDiscount;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementDiscount;
[FieldFixedLength(12)]
public Double? SupplementCustomerPay;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementCustomerPay;
[FieldFixedLength(12)]
public Double? SupplementInsurancePay;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementInsurancePay;
[FieldFixedLength(12)]
public Double? SupplementDeposit;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementDeposit;
[FieldFixedLength(12)]
public Double? SupplementAmountDue;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? SupplementAmountDue;
[FieldFixedLength(5)]
public Double? RevisedTotalsBodyHours;
public Decimal? RevisedTotalsBodyHours;
[FieldFixedLength(5)]
public Double? RevisedTotalsRefinishHours;
public Decimal? RevisedTotalsRefinishHours;
[FieldFixedLength(5)]
public Double? RevisedTotalsMechanicalHours;
public Decimal? RevisedTotalsMechanicalHours;
[FieldFixedLength(5)]
public Double? RevisedTotalsStructuralHours;
public Decimal? RevisedTotalsStructuralHours;
[FieldFixedLength(12)]
public Double? RevisedTotalsPartsTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsPartsTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsSubletTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsSubletTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsBodyLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsBodyLaborTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsRefinishLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsRefinishLaborTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsMechanicalLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsMechanicalLaborTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsStructuralLaborTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsStructuralLaborTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsMiscellaneousChargeTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsMiscellaneousChargeTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsPMTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsPMTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsBMTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsBMTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsMiscTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsMiscTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsTowingTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsTowingTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsStorageTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsStorageTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsDetailTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsDetailTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsSalesTaxTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsSalesTaxTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsGrossTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsGrossTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsDeductibleTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsDeductibleTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsDepreciationTotal;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsDepreciationTotal;
[FieldFixedLength(12)]
public Double? RevisedTotalsDiscount;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsDiscount;
[FieldFixedLength(12)]
public Double? RevisedTotalsCustomerPay;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsCustomerPay;
[FieldFixedLength(12)]
public Double? RevisedTotalsInsurancePay;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsInsurancePay;
[FieldFixedLength(12)]
public Double? RevisedTotalsDeposit;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsDeposit;
[FieldFixedLength(12)]
public Double? RevisedTotalsAmountDue;
[FieldConverter(typeof(MoneyConverter))]
public Decimal? RevisedTotalsAmountDue;
[FieldFixedLength(2)]
public int ProductionStatus;
@@ -382,11 +437,11 @@ namespace BodyshopPartner.Utils
[FieldFixedLength(50)]
public String InScreenCommentsLine2;
[FieldFixedLength(4)]
public int CustomerPhone2Extension;
public string CustomerPhone2Extension;
[FieldFixedLength(10)]
public int CustomerPhone3;
public String CustomerPhone3;
[FieldFixedLength(4)]
public int CustomerPhone3Extension;
public string CustomerPhone3Extension;
[FieldFixedLength(60)]
public String CustomerFileComments;
[FieldFixedLength(10)]
@@ -422,7 +477,7 @@ namespace BodyshopPartner.Utils
[FieldFixedLength(80)]
public String CustomerEmail;
[FieldFixedLength(12)]
public Double? GSTTax;
public Decimal? GSTTax;
[FieldFixedLength(3)]
public String RepairDelayStatusCode;
[FieldFixedLength(80)]
@@ -443,3 +498,21 @@ namespace BodyshopPartner.Utils
}
public class MoneyConverter : ConverterBase
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public override object StringToField(string from)
{
return Convert.ToDecimal(Decimal.Parse(from) / 100);
}
public override string FieldToString(object fieldValue)
{
if (fieldValue == null) return "";
return ((Decimal)(fieldValue ?? 0)).ToString("#.##");
}
};