Bläddra i källkod

Fix to posters not being found. Added global edit window for customer statuses. Made it so new customers are made with the default status

Kenric Nugteren 1 år sedan
förälder
incheckning
5dfe69d2f6

+ 13 - 0
prs.desktop/Panels/Customers/CustomerGrid.cs

@@ -1,6 +1,9 @@
 using Comal.Classes;
+using InABox.Clients;
 using InABox.Core;
 using InABox.DynamicGrid;
+using System;
+using System.Linq;
 
 namespace PRSDesktop
 {
@@ -19,6 +22,16 @@ namespace PRSDesktop
             //HiddenColumns.Add(x => x.Delivery.Location.Longitude);
         }
 
+        public override Customer CreateItem()
+        {
+            var item = base.CreateItem();
+            item.CustomerStatus.ID = Client.Query(
+                new Filter<CustomerStatus>(x => x.Default).IsEqualTo(true),
+                Columns.None<CustomerStatus>().Add(x => x.ID))
+                .ToObjects<CustomerStatus>().FirstOrDefault()?.ID ?? Guid.Empty;
+            return item;
+        }
+
         protected override void DoReconfigure(DynamicGridOptions options)
         {
             base.DoReconfigure(options);

+ 7 - 0
prs.desktop/Panels/Customers/CustomerPanel.xaml.cs

@@ -74,6 +74,13 @@ namespace PRSDesktop
 
         public void CreateToolbarButtons(IPanelHost host)
         {
+            host.CreateSetupActionIfCanView<CustomerStatus>("Customer Statuses", PRSDesktop.Resources.customer,
+                action =>
+                {
+                    var list = new MasterList(typeof(CustomerStatus));
+                    list.ShowDialog();
+                });
+            host.CreateSetupSeparator();
             AccountsSetupActions.Standard(host);
             host.CreateSetupSeparator();
             AccountsSetupActions.CustomerSpreadsheetTemplates(host);

+ 1 - 1
prs.shared/Posters/MYOB/CustomerMYOBPoster.cs

@@ -233,4 +233,4 @@ public class CustomerMYOBPoster : IMYOBPoster<Customer, CustomerMYOBPosterSettin
     }
 }
 
-public class CustomerMYOBPosterEngine : MYOBPosterEngine<Customer, CustomerMYOBPosterSettings> { }
+public class CustomerMYOBPosterEngine<T> : MYOBPosterEngine<Customer, CustomerMYOBPosterSettings> { }

+ 1 - 1
prs.shared/Posters/MYOB/InvoiceMYOBPoster.cs

@@ -211,4 +211,4 @@ public class InvoiceMYOBPoster : IMYOBPoster<Invoice, InvoiceMYOBPosterSettings>
     }
 }
 
-public class InvoiceMYOBPosterEngine : MYOBPosterEngine<Invoice, InvoiceMYOBPosterSettings> { }
+public class InvoiceMYOBPosterEngine<T> : MYOBPosterEngine<Invoice, InvoiceMYOBPosterSettings> { }