Skip to content

Commit

Permalink
Added update definition for 2.2.0
Browse files Browse the repository at this point in the history
autocomplete is now dependent on SKU code from Amazon
Saving Windows size/state is not supported yet
  • Loading branch information
anion0278 committed Feb 12, 2021
1 parent 5e52e89 commit fcf50f7
Show file tree
Hide file tree
Showing 15 changed files with 185 additions and 69 deletions.
1 change: 0 additions & 1 deletion CustomsDeclarationByAmazonName.json

This file was deleted.

2 changes: 2 additions & 0 deletions InvoiceItemWithDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public decimal ItemQuantity
get { return Item.quantity; }
set { Item.quantity = value; }
}

public string AmazonSkuCode => Item.amazonSkuCode;
}
}

Expand Down
3 changes: 3 additions & 0 deletions InvoiceXML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,9 @@ public class invoiceInvoiceItem
private InvoiceXML.invoiceInvoiceItemStockItem stockItemField;
private bool pDPField;

[XmlIgnore]
public string amazonSkuCode { get; set; }

[XmlIgnore]
public bool IsShipping { get; set; } = false;

Expand Down
7 changes: 2 additions & 5 deletions Mapp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>icon.ico</ApplicationIcon>
<AssemblyVersion>2.1.0.*</AssemblyVersion>
<AssemblyVersion>2.2.0.*</AssemblyVersion>
<Deterministic>false</Deterministic>
<PackageId>Mapp</PackageId>
<AssemblyName>Mapp</AssemblyName>
Expand Down Expand Up @@ -73,9 +73,6 @@
<None Update="ProductCodeByAmazonName.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="ProductNumberByName.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
2 changes: 2 additions & 0 deletions Mapp.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">Latest</s:String></wpf:ResourceDictionary>
1 change: 0 additions & 1 deletion ProductCodeByAmazonName.json

This file was deleted.

18 changes: 17 additions & 1 deletion ProductListConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,23 @@ public class ProductsListConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (object)string.Join(Environment.NewLine, (value as IEnumerable<InvoiceXML.invoiceInvoiceItem>).Select<InvoiceXML.invoiceInvoiceItem, string>((Func<InvoiceXML.invoiceInvoiceItem, string>)(p => p.text)));
return (object)string.Join(Environment.NewLine, (value as IEnumerable<InvoiceXML.invoiceInvoiceItem>).Select(p => p.text));
}

public object ConvertBack(
object value,
Type targetType,
object parameter,
CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class ProductsListToSkuConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (object)string.Join(Environment.NewLine, (value as IEnumerable<InvoiceXML.invoiceInvoiceItem>).Select(p => p.amazonSkuCode));
}

public object ConvertBack(
Expand Down
1 change: 0 additions & 1 deletion ProductNumberByName.json

This file was deleted.

1 change: 0 additions & 1 deletion ProductQuantityByAmazonName.json

This file was deleted.

38 changes: 37 additions & 1 deletion Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion Settings.settings
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Martin_app" GeneratedClassName="Settings">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Mapp" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="DPH" Type="System.decimal" Scope="User">
Expand All @@ -14,5 +14,14 @@
<Setting Name="LatestTrackingCode" Type="System.String" Scope="User">
<Value Profile="(Default)">123456</Value>
</Setting>
<Setting Name="MainWindowSize" Type="System.Drawing.Size" Scope="User">
<Value Profile="(Default)">900, 600</Value>
</Setting>
<Setting Name="IsMainWindowMaximized" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="MainWindowTopLeftCorner" Type="System.Drawing.Size" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
</Settings>
</SettingsFile>
1 change: 0 additions & 1 deletion ShippingNameByItemName.json

This file was deleted.

10 changes: 6 additions & 4 deletions StartWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xmlns:sys="clr-namespace:System;assembly=System.Runtime"
xmlns:martinApp="clr-namespace:Martin_App"
mc:Ignorable="d"
Title="Amazon Invoice Converter" Height="600" Width="650"
Title="Amazon Invoice Converter" Height="600" Width="950"
DataContext="{Binding RelativeSource={RelativeSource Self}}" Closing="Window_Closing">
<FrameworkElement.Resources>
<!--<x:Array Type="{x:Type sys:String}" x:Key="ShippingTypes">
Expand All @@ -20,6 +20,7 @@
</x:Array>-->
<!--<martinApp:ItemTextToStringConverter x:Key="StringConverter"/>-->
<martinApp:ProductsListConverter x:Key="ProductsConverter"/>
<martinApp:ProductsListToSkuConverter x:Key="ProductsToSkuConverter"/>
</FrameworkElement.Resources>
<TabControl>
<TabItem Header="Amazon - konverter">
Expand Down Expand Up @@ -51,6 +52,7 @@
</Style>
</DataGridBoundColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="SKU (Amazon)" IsReadOnly="True" Width="*" Binding="{Binding Item.amazonSkuCode}" />
<DataGridTextColumn Header="Kod zbozi (!)" Width="*" Binding="{Binding Item.code}">
<DataGridBoundColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
Expand All @@ -73,8 +75,8 @@
Binding="{Binding invoice.invoiceHeader.symVar}"/>
<DataGridTextColumn Header="Puvod" Width="0.4*" IsReadOnly="true"
Binding="{Binding invoice.invoiceHeader.paymentType.ids}"/>
<DataGridTextColumn Header="Produkty" Width="*" IsReadOnly="true"
Binding="{Binding invoice.invoiceDetail, Converter={StaticResource ProductsConverter}}"/>
<DataGridTextColumn Header="Produkty" Width="*" IsReadOnly="true" Binding="{Binding invoice.invoiceDetail, Converter={StaticResource ProductsConverter}}"/>
<DataGridTextColumn Header="SKU kody" Width="*" IsReadOnly="true" Binding="{Binding invoice.invoiceDetail, Converter={StaticResource ProductsToSkuConverter}}"/>
<DataGridTextColumn Header="Kod z skladu (!)" Width="*" Binding="{Binding invoice.invoiceHeader.centre.ids}">
<DataGridBoundColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
Expand All @@ -89,7 +91,7 @@
</DataGridTextColumn>
<DataGridTextColumn Header="Celni prohlaseni" Width="*"
Binding="{Binding invoice.invoiceHeader.partnerIdentity.address.mobilPhone}"/>
<DataGridTextColumn Header="Typ" Width="*" IsReadOnly="True"
<DataGridTextColumn Header="Typ VAT" Width="*" IsReadOnly="True"
Binding="{Binding invoice.invoiceHeader.classificationVAT.ids}"/>
</DataGrid.Columns>
</DataGrid>
Expand Down
Loading

0 comments on commit fcf50f7

Please sign in to comment.