Przeglądaj źródła

Filtered out possible zero-value transactions in Stock Transfer Module
Limited stock Transfer quantities to available stock
Improved Layout of Stock Location Selection screen

Frank van den Bos 1 rok temu
rodzic
commit
e4c42a519c

+ 1 - 1
prs.mobile.new/PRS.Mobile.Droid/Properties/AndroidManifest.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="808100" android:versionName="8.08.1" package="comal.timesheets.Android">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="809000" android:versionName="8.09.0" package="comal.timesheets.Android">
 	<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="34" />
 	<queries>
 		<intent>

+ 1 - 1
prs.mobile.new/PRS.Mobile.iOS/Info.plist

@@ -27,7 +27,7 @@
 	<key>CFBundleIdentifier</key>
 	<string>com.prsdigital.prssiteapp</string>
 	<key>CFBundleVersion</key>
-	<string>8.08.1</string>
+	<string>8.09.0</string>
 	<key>UILaunchStoryboardName</key>
 	<string>LaunchScreen</string>
 	<key>CFBundleName</key>

+ 1 - 1
prs.mobile.new/PRS.Mobile/Data Models/Lists/StockMovementBatch/StockTransaction.cs

@@ -340,7 +340,7 @@ namespace PRS.Mobile
                 )
             {
 
-                foreach (var allocation in transaction.Allocations)
+                foreach (var allocation in transaction.Allocations.Where(x=>!x.Quantity.IsEffectivelyEqual(0.0)))
                 {
                     var movement = model.AddItem();
                     movement.BatchID = batchid;

+ 2 - 1
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Common/StockLocationSelectionPage.xaml

@@ -163,7 +163,8 @@
             <mobile:MobileTabStrip
                 x:Name="_tabStrip"
                 views:DockLayout.Dock="Bottom"
-                SelectionChanged="_tabStrip_OnSelectionChanged">
+                SelectionChanged="_tabStrip_OnSelectionChanged"
+                Margin="5,0,5,0">
                 <mobile:MobileTabStrip.Items>
                     <mobile:MobileTabStripItem Text="Favourites" />
                     <mobile:MobileTabStripItem Text="All" />

+ 3 - 1
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Transfer/Edit/TransferEdit.xaml.cs

@@ -6,6 +6,7 @@ using Xamarin.Forms.Xaml;
 
 namespace PRS.Mobile
 {
+    
     public class StockTransactionSavedArgs : EventArgs
     {
         public StockTransaction Transaction { get; private set; }
@@ -24,10 +25,11 @@ namespace PRS.Mobile
 
         public event StockTransactionSavedEvent? TransactionSaved;
         
-        public TransferEdit(StockTransaction transaction)
+        public TransferEdit(StockTransaction transaction, StockTransactions otherTransactions)
         {
             InitializeComponent();
             ViewModel.Transaction = transaction;
+            ViewModel.OtherTransactions = otherTransactions;
         }
         
         private void _tick_OnClicked(object sender, MobileMenuButtonClickedEventArgs args)

+ 2 - 0
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Transfer/Edit/TransferEditViewModel.cs

@@ -7,5 +7,7 @@ namespace PRS.Mobile
         
         public StockTransaction Transaction { get; set; }
         
+        public StockTransactions OtherTransactions { get; set; }
+        
     }
 }

+ 27 - 2
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Transfer/Module/TransferModule.xaml.cs

@@ -148,9 +148,34 @@ namespace PRS.Mobile
                     transaction.Target.LocationCode = _viewModel.Target.Code;
                     transaction.Target.LocationDescription = _viewModel.Target.Description;
                     transaction.Allocations = shell.Allocations;
+                    
+                    var others = _viewModel.Transactions.Where(x =>
+                        x.Source.LocationID == shell.LocationID
+                        && x.Source.StyleID == shell.StyleID
+                        && x.ProductID == shell.ProductID
+                        && x.DimensionsUnitID == shell.DimensionsUnitID
+                        && x.DimensionsHeight == shell.DimensionsHeight
+                        && x.DimensionsWidth == shell.DimensionsWidth
+                        && x.DimensionsLength == shell.DimensionsLength
+                        && x.DimensionsQuantity == shell.DimensionsQuantity
+                        && x.DimensionsWeight == shell.DimensionsWeight).ToArray();
+                    
+                    var allocations = new List<StockTransactionAllocation>();
+                    foreach (var alloc in shell.Allocations)
+                    {
+                        var newalloc = new StockTransactionAllocation();
+                        newalloc.ID = alloc.ID;
+                        newalloc.Description = alloc.Description;
+                        newalloc.Quantity = alloc.Quantity;
+                        foreach (var other in others)
+                            newalloc.Quantity -= other.Allocations.Where(x => x.ID == alloc.ID).Sum(x => x.Quantity);
+                        newalloc.Maximum = newalloc.Quantity;
+                        allocations.Add(newalloc);
+                    }
+                    transaction.Allocations = allocations.ToArray();
                 }
                 
-                var popup = new TransferEdit(transaction);
+                var popup = new TransferEdit(transaction, _viewModel.Transactions);
                 popup.TransactionSaved += (o,e) =>
                 {
                     shell.Parent.Transactions?.Add(transaction);
@@ -269,7 +294,7 @@ namespace PRS.Mobile
         {
             if ((sender as MobileCard)?.BindingContext is StockTransaction transaction)
             {
-                var popup = new TransferEdit(transaction);
+                var popup = new TransferEdit(transaction, _viewModel.Transactions);
                 //popup.TransactionSaved += (o, e) => _viewModel.Transactions?.Add(transaction);
                 Navigation.PushAsync(popup);
             }