소스 검색

Updated index attributes on Bill export so that loading the Reject file works correctly.

Kenric Nugteren 1 년 전
부모
커밋
649b2b6a03
2개의 변경된 파일64개의 추가작업 그리고 58개의 파일을 삭제
  1. 5 0
      prs.media/TimberlineExportFiles/APREJECT.TXT
  2. 59 58
      prs.shared/Posters/Timberline/BillTimberlinePoster.cs

+ 5 - 0
prs.media/TimberlineExportFiles/APREJECT.TXT

@@ -0,0 +1,5 @@
+APIF,CAP001,98324480,,168.685,15.335,0,0,01/11/2023,,01/11/2023,31/01/2024,30/11/2023,,,,,,,,
+APDF,,0,,,2740-2,,,,,,,,0,GST,1,91.35,100.485,9.135,0,0,0,0,f,,,0,,0,0,,,
+APDF,,0,,,2740-2,,,,,,,,0,GST,1,62,68.2,6.2,0,0,0,0,f,,,0,,0,0,,,
+APIF,HEA001,C1121391,,31.108,2.8280000000000003,0,0,02/11/2023,,02/11/2023,31/01/2024,30/11/2023,,,,,,,,
+APDF,,0,,,,,,,,,,,0,GST,4,7.07,31.108,2.8280000000000003,0,0,0,0,f,,,0,,0,0,,,

+ 59 - 58
prs.shared/Posters/Timberline/BillTimberlinePoster.cs

@@ -27,204 +27,204 @@ namespace PRS.Shared
         [Ignore]
         public List<BillTimberlineDistribution> Distributions { get; set; } = new();
 
-        [Index(1)]
+        [Index(0)]
         public string RecordID { get; set; } = "APIF";
 
-        [Index(2)]
+        [Index(1)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string Vendor { get; set; } = "";
 
-        [Index(3)]
+        [Index(2)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 15)]
         public string Invoice { get; set; } = "";
 
-        [Index(4)]
+        [Index(3)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 30)]
         public string Description { get; set; } = "";
 
-        [Index(5)]
+        [Index(4)]
         public double Amount { get; set; }
 
-        [Index(6)]
+        [Index(5)]
         public double Tax { get; set; }
 
-        [Index(7)]
+        [Index(6)]
         public double DiscountOffered { get; set; }
 
-        [Index(8)]
+        [Index(7)]
         public double MiscDeduction { get; set; }
 
-        [Index(9)]
+        [Index(8)]
         [TypeConverter(typeof(TimberlinePosterDateConverter))]
         public DateTime InvoiceDate { get; set; }
 
-        [Index(10)]
+        [Index(9)]
         [TypeConverter(typeof(TimberlinePosterDateConverter))]
         public DateTime DateReceived { get; set; }
 
-        [Index(11)]
+        [Index(10)]
         [TypeConverter(typeof(TimberlinePosterDateConverter))]
         public DateTime DiscountDate { get; set; }
 
-        [Index(12)]
+        [Index(11)]
         [TypeConverter(typeof(TimberlinePosterDateConverter))]
         public DateTime PaymentDate { get; set; }
 
-        [Index(13)]
+        [Index(12)]
         [TypeConverter(typeof(TimberlinePosterDateConverter))]
         public DateTime AccountingDate { get; set; }
 
-        [Index(14)]
+        [Index(13)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string InvoiceCode1 { get; set; } = "";
 
-        [Index(15)]
+        [Index(14)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string InvoiceCode2 { get; set; } = "";
 
-        [Index(16)]
+        [Index(15)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 30)]
         public string SmryPayeeName { get; set; } = "";
 
-        [Index(17)]
+        [Index(16)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 33)]
         public string SmryPayeeAddress1 { get; set; } = "";
 
-        [Index(18)]
+        [Index(17)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 33)]
         public string SmryPayeeAddress2 { get; set; } = "";
 
-        [Index(19)]
+        [Index(18)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 15)]
         public string SmryPayeeCity { get; set; } = "";
 
-        [Index(20)]
+        [Index(19)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 4)]
         public string SmryPayeeState { get; set; } = "";
 
-        [Index(21)]
+        [Index(20)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string SmryPayeeZip { get; set; } = "";
     }
 
     public class BillTimberlineDistribution
     {
-        [Index(1)]
+        [Index(0)]
         public string RecordID { get; set; } = "APDF";
 
-        [Index(2)]
+        [Index(1)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 12)]
         public string Commitment { get; set; } = "";
 
-        [Index(3)]
+        [Index(2)]
         public int CommitmentLineItem { get; set; }
 
-        [Index(4)]
+        [Index(3)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 7)]
         public string Equipment { get; set; } = "";
 
-        [Index(5)]
+        [Index(4)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 6)]
         public string EQCostCode { get; set; } = "";
 
-        [Index(6)]
+        [Index(5)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 6)]
         public string Job { get; set; } = "";
 
-        [Index(7)]
+        [Index(6)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string Extra { get; set; } = "";
 
-        [Index(8)]
-        [TypeConverter(typeof(TimberlinePosterStringConverter), 6)]
+        [Index(7)]
+        [TypeConverter(typeof(TimberlinePosterStringConverter), 7)]
         public string CostCode { get; set; } = "";
 
-        [Index(9)]
+        [Index(8)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 3)]
         public string Category { get; set; } = "";
 
-        [Index(10)]
+        [Index(9)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string BLStdItem { get; set; } = "";
 
-        [Index(11)]
+        [Index(10)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 8)]
         public string Reserved { get; set; } = "";
 
-        [Index(12)]
-        [TypeConverter(typeof(TimberlinePosterStringConverter), 7)]
+        [Index(11)]
+        [TypeConverter(typeof(TimberlinePosterStringConverter), int.MaxValue)] // int.MaxValue because it was chopping the accounts in PRS
         public string ExpenseAccount { get; set; } = "";
 
-        [Index(13)]
-        [TypeConverter(typeof(TimberlinePosterStringConverter), 7)]
+        [Index(12)]
+        [TypeConverter(typeof(TimberlinePosterStringConverter), int.MaxValue)] // int.MaxValue because it was chopping the accounts in PRS
         public string APAccount { get; set; } = "";
 
-        [Index(14)]
+        [Index(13)]
         public double TaxablePayments { get; set; }
 
-        [Index(15)]
+        [Index(14)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 6)]
         public string TaxGroup { get; set; } = "";
 
-        [Index(16)]
+        [Index(15)]
         public double Units { get; set; }
 
-        [Index(17)]
+        [Index(16)]
         public double UnitCost { get; set; }
 
-        [Index(18)]
+        [Index(17)]
         public double Amount { get; set; }
 
-        [Index(19)]
+        [Index(18)]
         public double Tax { get; set; }
 
-        [Index(20)]
+        [Index(19)]
         public double TaxLiability { get; set; }
 
-        [Index(21)]
+        [Index(20)]
         public double DiscountOffered { get; set; }
 
-        [Index(22)]
+        [Index(21)]
         public double Retainage { get; set; }
 
-        [Index(23)]
+        [Index(22)]
         public double MiscDeduction { get; set; }
 
-        [Index(24)]
+        [Index(23)]
         [BooleanTrueValues("t", "T", "1", "Y", "y")]
         [BooleanFalseValues("f", "F", "0", "N", "n")]
         public bool TaxablePaymentsExempt { get; set; }
 
-        [Index(25)]
+        [Index(24)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string DistCode { get; set; } = "";
 
-        [Index(26)]
+        [Index(25)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string MiscEntry1 { get; set; } = "";
 
-        [Index(27)]
+        [Index(26)]
         public double MiscEntryUnits1 { get; set; }
 
-        [Index(28)]
+        [Index(27)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string MiscEntry2 { get; set; } = "";
 
-        [Index(29)]
+        [Index(28)]
         public double MiscEntryUnits2 { get; set; }
 
-        [Index(30)]
+        [Index(29)]
         public double MeterOdometer { get; set; }
 
-        [Index(31)]
+        [Index(30)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 30)]
         public string Description { get; set; } = "";
 
-        [Index(32)]
+        [Index(31)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 10)]
         public string Authorization { get; set; } = "";
 
-        [Index(33)]
+        [Index(32)]
         [TypeConverter(typeof(TimberlinePosterStringConverter), 30)]
         public string JointPayee { get; set; } = "";
     }
@@ -295,6 +295,7 @@ public class Module
                 .Add(x => x.IncTax)
                 .Add(x => x.Tax)
                 .Add(x => x.Description)
+                .Add(x => x.PurchaseGL.Code)
                 .Add(x => x.OrderItem.ID),
                 alias: "Bill_BillLine");
 
@@ -372,7 +373,7 @@ public class Module
                             // Category
                             /// BL STd Item
                             // Reserved
-                            // Expense account
+                            ExpenseAccount = billLine.PurchaseGL.Code,
                             // AP Account
                             // Taxable Payments
                             TaxGroup = billLine.TaxCode.Code,