Extending the Inventory CSV Import  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Extending the Inventory CSV Import

Postby Atronics » Tue Mar 01, 2016 11:40 am

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
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Extending the Inventory CSV Import  Topic is solved

Postby Mike.Sheen » Sat Mar 12, 2016 1:49 pm

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.
Attachments
Plugin Import P1...P10 Selling Prices.xml
Import selling prices with dates
(77.18 KiB) Downloaded 151 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Extending the Inventory CSV Import

Postby Atronics » Tue Mar 15, 2016 3:31 pm

Thank, Mike.
Atronics
Frequent Contributor
Frequent Contributor
 
Posts: 119
Joined: Fri Feb 29, 2008 4:40 pm
Topics Solved: 10

Re: Extending the Inventory CSV Import

Postby pricerc » Fri Jun 09, 2017 3:50 pm

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
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Re: Extending the Inventory CSV Import

Postby Mike.Sheen » Fri Jun 16, 2017 5:26 pm

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.
Attachments
Plugin Import Inventory Supplier Supplier Warehouse Spare Fields.xml
Sample Plugin
(74.09 KiB) Downloaded 143 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 10 guests