Page 1 of 1

Extending the Inventory CSV Import

PostPosted: Tue Mar 01, 2016 11:40 am
by Atronics
Hi Mike,
I have been trying to get this plugin to also include IN_SellingPrices.ForwardPriceDate and IN_SellingPrices.CurrentPriceDate, but cant figure the syntax for including a date field. Couldyou kindly point me in the right direction for this.

John

Re: Extending the Inventory CSV Import  Topic is solved

PostPosted: Sat Mar 12, 2016 1:49 pm
by Mike.Sheen
Atronics wrote:Hi Mike,
I have been trying to get this plugin to also include IN_SellingPrices.ForwardPriceDate and IN_SellingPrices.CurrentPriceDate, but cant figure the syntax for including a date field. Couldyou kindly point me in the right direction for this.

John


For a file such as this:
Code: Select all
Part No, Description, P1, P2, ForwardPriceDate, CurrentPriceDate
1089-AX, Network System - Custom Specifications, 150.00, 99.89, 2016-08-01, 2016-03-01
1089-J,Desktop - Custom Specifications (Advanced), 155.00, 991.89, 2016-09-19, 2016-02-12


I added this to the AppendProperties method of the plugin:

Code: Select all
destinationPropertyCollection.Add(new JiwaFinancials.Jiwa.JiwaInventory.Import.DestinationProperty("Inventory.CurrentPriceDate, ", "CurrentPriceDate",
delegate(JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory, string value, string rowData, string[] row, int rowNo, JiwaFinancials.Jiwa.JiwaInventory.Import.Mapping mapping)
{
inventory.SellingPrices.CurrentPriceDate = Microsoft.VisualBasic.Information.IsDate(value) ? DateTime.Parse(value) : inventory.SellingPrices.CurrentPriceDate;
},
new String[] {"CurrentPriceDate", "Current Price Date"}));

destinationPropertyCollection.Add(new JiwaFinancials.Jiwa.JiwaInventory.Import.DestinationProperty("Inventory.ForwardPriceDate, ", "ForwardPriceDate",
delegate(JiwaFinancials.Jiwa.JiwaInventory.Inventory inventory, string value, string rowData, string[] row, int rowNo, JiwaFinancials.Jiwa.JiwaInventory.Import.Mapping mapping)
{
inventory.SellingPrices.ForwardPriceDate = Microsoft.VisualBasic.Information.IsDate(value) ? DateTime.Parse(value) : inventory.SellingPrices.ForwardPriceDate;
},
new String[] {"ForwardPriceDate", "Forward Price Date"}));


Attached is a sample using the above.

Re: Extending the Inventory CSV Import

PostPosted: Tue Mar 15, 2016 3:31 pm
by Atronics
Thank, Mike.

Re: Extending the Inventory CSV Import

PostPosted: Fri Jun 09, 2017 3:50 pm
by pricerc
Any clues on how I add additional supplier/supplierWarehouse information to the property collection (in addition to the ones that already pop up)?

We're wanting to load some values into the SpareX fields.

(we're on 157)


/Ryan

Re: Extending the Inventory CSV Import

PostPosted: Fri Jun 16, 2017 5:26 pm
by Mike.Sheen
pricerc wrote:Any clues on how I add additional supplier/supplierWarehouse information to the property collection (in addition to the ones that already pop up)?

We're wanting to load some values into the SpareX fields.

(we're on 157)


/Ryan


Attached is a plugin (for 7.00.157.00, but should work with 7.00.175.00 as well) that will import SpareFloat1 into the supplier and SpareFloat1 into the supplier warehouse, with the following sample file:
Code: Select all
PartNo, Supplier Account No., Supplier SpareFloat1, Supplier Warehouse, Supplier Warehouse SpareFloat1
1170, 5013, 123.45, Main Office, 654.32


It should be pretty much "programming by numbers" to extend it to include any other "Spare" fields from Inventory Suppliers or Supplier Warehouses.

Protip: We often miss questions tacked onto a topic that is already marked as solved - usually it's best to create a new topic.