SBarnes wrote:How can I in c# get a sell price for an inventory object such as P1 based upon its effective date, i.e. at today's date?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GetInventorySellPriceAsAtDate
{
class Program
{
static void Main(string[] args)
{
JiwaFinancials.Jiwa.JiwaApplication.Manager manager = new JiwaFinancials.Jiwa.JiwaApplication.Manager();
manager.Logon("localhost", "JiwaDemo721-3", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", "password");
JiwaFinancials.Jiwa.JiwaPriceSchemes.PriceScheme priceScheme = manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaPriceSchemes.PriceScheme>(null);
priceScheme.CreateNew();
JiwaFinancials.Jiwa.JiwaPriceSchemes.PriceUsed usedPrice = manager.CollectionItemFactory.CreateCollectionItem<JiwaFinancials.Jiwa.JiwaPriceSchemes.PriceUsed>();
usedPrice.Price = manager.CollectionItemFactory.CreateCollectionItem<JiwaFinancials.Jiwa.JiwaPriceSchemes.Price>();
usedPrice.Price.IsStoredProc = true;
usedPrice.Price.StoredProcName = "usp_Jiwa_Price_SellPrice1";
priceScheme.PriceUsedCollection.Add(usedPrice);
JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory inventory = manager.EntityFactory.CreateEntity<JiwaFinancials.Jiwa.JiwaApplication.Entities.Inventory.Inventory>();
inventory.ReadRecordFromPartNo("1170");
JiwaFinancials.Jiwa.JiwaApplication.Entities.Debtor.Debtor debtor = manager.EntityFactory.CreateEntity<JiwaFinancials.Jiwa.JiwaApplication.Entities.Debtor.Debtor>();
debtor.ReadRecordFromAccountNo("1001");
decimal price = 0;
bool priceIsIncTax = false;
priceScheme.GetPrice(JiwaFinancials.Jiwa.JiwaPriceSchemes.PriceScheme.PriceSchemePriceChangeOrigin.e_PriceSchemePriceChangeOriginSalesOrder, null, inventory.InventoryID, debtor.DebtorID, DateTime.Now, "ZZZZZZZZZZ0000000000", 1, ref price, ref priceIsIncTax);
Console.WriteLine("Price is {0}", price);
}
}
}
Inventory.SellingPrices["P1"].get_CurrentPrice(this.get_Manager().SysDateTime);
Inventory.SellingPrices["P1"][this.get_Manager().SysDateTime];
Return to Technical and or Programming
Users browsing this forum: No registered users and 6 guests