Prechádzať zdrojové kódy

Improvements to new Receivals module

Frank van den Bos 11 mesiacov pred
rodič
commit
09ef6e3ed7

+ 2 - 0
prs.mobile.new/PRS.Mobile.Droid/PRS.Mobile.Droid.csproj

@@ -18,6 +18,7 @@
         <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
         <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
         <AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
         <AndroidSupportedAbis>armeabi-v7a;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
         <LangVersion>9</LangVersion>
         <LangVersion>9</LangVersion>
+        <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
     </PropertyGroup>
     </PropertyGroup>
     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
         <DebugSymbols>true</DebugSymbols>
         <DebugSymbols>true</DebugSymbols>
@@ -43,6 +44,7 @@
         <AndroidSigningStorePass>Fr0g50ftw4r3</AndroidSigningStorePass>
         <AndroidSigningStorePass>Fr0g50ftw4r3</AndroidSigningStorePass>
         <AndroidPackageFormat>aab</AndroidPackageFormat>
         <AndroidPackageFormat>aab</AndroidPackageFormat>
         <AndroidLinkMode>None</AndroidLinkMode>
         <AndroidLinkMode>None</AndroidLinkMode>
+        <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
     </PropertyGroup>
     </PropertyGroup>
     <ItemGroup>
     <ItemGroup>
         <Reference Include="Mono.Android" />
         <Reference Include="Mono.Android" />

+ 2 - 0
prs.mobile.new/PRS.Mobile.iOS/PRS.Mobile.iOS.csproj

@@ -26,6 +26,8 @@
     <MtouchArch>x86_64</MtouchArch>
     <MtouchArch>x86_64</MtouchArch>
     <MtouchLink>None</MtouchLink>
     <MtouchLink>None</MtouchLink>
     <MtouchDebug>true</MtouchDebug>
     <MtouchDebug>true</MtouchDebug>
+    <MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
+    <IOSDebugOverWiFi>true</IOSDebugOverWiFi>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>

+ 0 - 8
prs.mobile.new/PRS.Mobile.sln

@@ -109,20 +109,12 @@ Global
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
 		{5626C3A2-09F9-4CBC-BD52-10BB5CD9F452}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
-		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhoneSimulator
-		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.Deploy.0 = Ad-Hoc|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhone.Deploy.0 = Ad-Hoc|iPhone
-		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
-		{2869560F-3142-4C75-8028-95F7C613D61B}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
-		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|Any CPU.ActiveCfg = AppStore|iPhoneSimulator
-		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|Any CPU.Build.0 = AppStore|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.Build.0 = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.Build.0 = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.Deploy.0 = AppStore|iPhone
 		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhone.Deploy.0 = AppStore|iPhone
-		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
-		{2869560F-3142-4C75-8028-95F7C613D61B}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
 		{2869560F-3142-4C75-8028-95F7C613D61B}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator

+ 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.Where(x=>!x.Quantity.IsEffectivelyEqual(0.0)))
+                foreach (var allocation in transaction.Allocations)
                 {
                 {
                     var movement = model.AddItem();
                     var movement = model.AddItem();
                     movement.BatchID = batchid;
                     movement.BatchID = batchid;

+ 51 - 2
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Consignments/ConsignmentsModule.xaml.cs

@@ -126,8 +126,57 @@ namespace PRS.Mobile
         
         
         private void AddConsignment_Clicked(object sender, MobileMenuButtonClickedEventArgs args)
         private void AddConsignment_Clicked(object sender, MobileMenuButtonClickedEventArgs args)
         {
         {
-            _newshell = _consignments.CreateItem();
-            Navigation.PushAsync(new ConsignmentEdit(_newshell));
+            ShowPopup(() => SelectionView.Execute<PurchaseOrderShell>(
+                (columns) =>
+                {
+                    columns.Add(new MobileGridTextColumn<PurchaseOrderShell>()
+                    {
+                        Column = x => x.PONumber,
+                        Width = GridLength.Auto,
+                        Caption = "Number",
+                        Alignment = TextAlignment.Start
+                    });
+                    columns.Add(new MobileGridTextColumn<PurchaseOrderShell>()
+                    {
+                        Column = x => x.SupplierName,
+                        Width = GridLength.Star,
+                        Caption = "Select Purchase Order",
+                        Alignment = TextAlignment.Start
+                    });
+                },
+                (refresh) =>
+                {
+                    var model = new PurchaseOrderModel(App.Data,
+                        () => new Filter<PurchaseOrder>(x => x.IssuedDate).IsNotEqualTo(DateTime.MinValue)
+                            .And(x=>x.ClosedDate).IsEqualTo(DateTime.MinValue)
+                            .And(x=>x.CancelledDate).IsEqualTo(DateTime.MinValue)
+                            .And(x=>x.Unreceived).IsNotEqualTo(FilterConstant.Null)) { FileName = "consigment_orders.index" };
+                    return model.Refresh(false);
+                },
+                (orders) =>
+                {
+                    
+                    _newshell = _consignments.CreateItem();
+                    Navigation.PushAsync(new ConsignmentEdit(_newshell));
+                    
+                    
+                    var model = new PurchaseOrderItemModel(App.Data,
+                        () => new Filter<PurchaseOrderItem>(x => x.PurchaseOrderLink.ID).IsEqualTo(orders.FirstOrDefault()?.ID ?? Guid.Empty));
+                    model.Refresh(false);
+                    foreach (var item in model.Items)
+                    {
+                        var newitem = ViewModel.Items.AddItem();
+                        newitem.Row.LoadValues(item.Row.Values);
+                    }
+                    Dispatcher.BeginInvokeOnMainThread(() =>
+                    {
+                        _itemsList.ItemsSource = null;
+                        _itemsList.ItemsSource = ViewModel.Items;
+                    });
+                    DismissPopup();
+                }));
+            
+
         }
         }
     }
     }
 }
 }

+ 59 - 0
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Consignments/Item/ConsignmentEditItem.xaml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<mobile:MobilePage xmlns="http://xamarin.com/schemas/2014/forms"
+             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+             xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
+             xmlns:local="clr-namespace:PRS.Mobile;assembly=PRS.Mobile"
+             x:Class="PRS.Mobile.ConsignmentEditItem">
+    
+    <mobile:MobilePage.BindingContext>
+        <local:ConsignmentEditItemViewModel x:Name="ViewModel" />
+    </mobile:MobilePage.BindingContext>
+    
+    <mobile:MobilePage.PageContent>
+               <Grid
+            RowSpacing="5"
+            Margin="5">
+            
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="Auto" />
+            </Grid.RowDefinitions>
+            
+            <mobile:MobilePageStack 
+                x:Name="_tabView"
+                Grid.Row="0"
+                Grid.Column="0"
+                SelectedIndex="{Binding Source={x:Reference _tabStrip}, Path=SelectedIndex}">
+                
+                <mobile:MobilePageStack.Items>
+                    
+                    <mobile:MobilePageStackItem>
+                        <mobile:MobilePageStackItem.Content>
+                            <local:ConsignmentEditDetailsView x:Name="Details" BindingContext="{Binding .}" Changed="Details_OnOnDetailsChanged"/>
+                        </mobile:MobilePageStackItem.Content>
+                    </mobile:MobilePageStackItem>
+                    
+                    <mobile:MobilePageStackItem>
+                        <mobile:MobilePageStackItem.Content>
+                            <local:ConsignmentEditItemsView x:Name="QA" BindingContext="{Binding .}"/>
+                        </mobile:MobilePageStackItem.Content>
+                    </mobile:MobilePageStackItem>
+                    
+                </mobile:MobilePageStack.Items>
+                
+            </mobile:MobilePageStack>
+            
+            <mobile:MobileTabStrip
+                x:Name="_tabStrip"
+                Grid.Row="1"
+                Grid.Column="0">
+                <mobile:MobileTabStrip.Items>
+                    <mobile:MobileTabStripItem Text="Details" />
+                    <mobile:MobileTabStripItem Text="Checks" />
+                </mobile:MobileTabStrip.Items>
+            </mobile:MobileTabStrip>
+            
+            </Grid>
+    </mobile:MobilePage.PageContent>
+</mobile:MobilePage>

+ 25 - 0
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Consignments/Item/ConsignmentEditItem.xaml.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using InABox.Mobile;
+using Xamarin.Forms.Xaml;
+
+namespace PRS.Mobile
+{
+    [XamlCompilation(XamlCompilationOptions.Compile)]
+    public partial class ConsignmentEditItem
+    {
+        public ConsignmentEditItem(PurchaseOrderItemShell item)
+        {
+            InitializeComponent();
+            ViewModel.Item = item;
+        }
+
+        private void Details_OnOnDetailsChanged(object sender, MobileViewChangedEventArgs eventargs)
+        {
+            
+        }
+    }
+}

+ 9 - 0
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Consignments/Item/ConsignmentEditItemViewModel.cs

@@ -0,0 +1,9 @@
+using Xamarin.Forms;
+
+namespace PRS.Mobile
+{
+    public class ConsignmentEditItemViewModel : BindableObject
+    {
+        public PurchaseOrderItemShell Item { get; set; }
+    }
+}

+ 2 - 1
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Consignments/Views/ConsignmentEditItemsView.xaml

@@ -35,7 +35,8 @@
                                 IsClickable="True"
                                 IsClickable="True"
                                 BackgroundColor="{StaticResource Theme.Surface}"
                                 BackgroundColor="{StaticResource Theme.Surface}"
                                 Padding="5"
                                 Padding="5"
-                                Margin="0,0,0,5">
+                                Margin="0,0,0,5"
+                                Clicked="SelectPOItem_Clicked">
                                 
                                 
                                 <Grid x:DataType="local:PurchaseOrderItemShell">
                                 <Grid x:DataType="local:PurchaseOrderItemShell">
                             
                             

+ 31 - 32
prs.mobile.new/PRS.Mobile/Modules/Warehousing/Consignments/Views/ConsignmentEditItemsView.xaml.cs

@@ -50,42 +50,41 @@ namespace PRS.Mobile
                         Alignment = TextAlignment.Start
                         Alignment = TextAlignment.Start
                     });
                     });
                 },
                 },
-                (refresh) => App.Data.PurchaseOrders.Refresh(false),
+                (refresh) =>
+                {
+                    var model = new PurchaseOrderModel(App.Data,
+                        () => new Filter<PurchaseOrder>(x => x.IssuedDate).IsNotEqualTo(DateTime.MinValue)
+                            .And(x=>x.ClosedDate).IsEqualTo(DateTime.MinValue)
+                            .And(x=>x.CancelledDate).IsEqualTo(DateTime.MinValue)
+                            .And(x=>x.Unreceived).IsNotEqualTo(FilterConstant.Null)) { FileName = "consigment_orders.index" };
+                    return model.Refresh(false);
+                },
                 (orders) =>
                 (orders) =>
                 {
                 {
+                    var model = new PurchaseOrderItemModel(App.Data,
+                        () => new Filter<PurchaseOrderItem>(x => x.PurchaseOrderLink.ID).IsEqualTo(orders.FirstOrDefault()?.ID ?? Guid.Empty));
+                    model.Refresh(false);
+                    foreach (var item in model.Items)
+                    {
+                        var newitem = ViewModel.Items.AddItem();
+                        newitem.Row.LoadValues(item.Row.Values);
+                    }
+                    Dispatcher.BeginInvokeOnMainThread(() =>
+                    {
+                        _itemsList.ItemsSource = null;
+                        _itemsList.ItemsSource = ViewModel.Items;
+                    });
                     DismissPopup();
                     DismissPopup();
-                    ShowPopup(() => SelectionView.Execute<PurchaseOrderItemShell>(
-                        (columns) =>
-                        {
-                            columns.Add(new MobileGridTextColumn<PurchaseOrderItemShell>()
-                            {
-                                Column = x => x.Description,
-                                Width = GridLength.Star,
-                                Caption = "Select Purchase Order",
-                                Alignment = TextAlignment.Start
-                            });
-                            columns.Add(new MobileGridDoubleColumn<PurchaseOrderItemShell>()
-                            {
-                                Column = x => x.Qty,
-                                Width = GridLength.Auto,
-                                Caption = "Qty",
-                                Format = "F2",
-                                Alignment = TextAlignment.Center
-                            });
-                        },
-                        (refresh) =>
-                        {
-                            var model = new PurchaseOrderItemModel(App.Data,
-                                () => new Filter<PurchaseOrderItem>(x => x.PurchaseOrderLink.ID).IsEqualTo(orders.FirstOrDefault()?.ID ?? Guid.Empty));
-                            return model.Refresh(false);
-                        },
-                        (items) =>
-                        {
-                            DismissPopup();
-                            DoChanged(nameof(ViewModel.Items));
-                        }
-                    ));
                 }));
                 }));
         }
         }
+
+        private void SelectPOItem_Clicked(object sender, EventArgs e)
+        {
+            if ((sender as MobileCard)?.BindingContext is PurchaseOrderItemShell item)
+            {
+                var page = new ConsignmentEditItem(item);
+                Navigation.PushAsync(page);
+            }
+        }
     }
     }
 }
 }