本文整理汇总了C#中AceSoft.RetailPlus.Data.Products.UpdateSellingWSPrice方法的典型用法代码示例。如果您正苦于以下问题:C# Products.UpdateSellingWSPrice方法的具体用法?C# Products.UpdateSellingWSPrice怎么用?C# Products.UpdateSellingWSPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AceSoft.RetailPlus.Data.Products
的用法示例。
在下文中一共展示了Products.UpdateSellingWSPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubtractItemToInventory
private void SubtractItemToInventory(long SOID)
{
SODetails clsSODetails = Details(SOID);
ERPConfig clsERPConfig = new ERPConfig(base.Connection, base.Transaction);
ERPConfigDetails clsERPConfigDetails = clsERPConfig.Details();
SOItem clsSOItem = new SOItem(base.Connection, base.Transaction);
ProductUnit clsProductUnit = new ProductUnit(base.Connection, base.Transaction);
Products clsProduct = new Products(base.Connection, base.Transaction);
ProductVariationsMatrix clsProductVariationsMatrix = new ProductVariationsMatrix(base.Connection, base.Transaction);
ProductPackage clsProductPackage = new ProductPackage(base.Connection, base.Transaction);
MatrixPackage clsMatrixPackage = new MatrixPackage(base.Connection, base.Transaction);
Inventory clsInventory = new Inventory(base.Connection, base.Transaction);
InventoryDetails clsInventoryDetails;
//MatrixPackagePriceHistoryDetails clsMatrixPackagePriceHistoryDetails;
//ProductPackagePriceHistoryDetails clsProductPackagePriceHistoryDetails;
System.Data.DataTable dt = clsSOItem.ListAsDataTable(SOID, "SOItemID", SortOption.Ascending);
foreach (System.Data.DataRow dr in dt.Rows)
{
long lngProductID = long.Parse(dr["ProductID"].ToString());
int intProductUnitID = int.Parse(dr["ProductUnitID"].ToString());
decimal decItemQuantity = decimal.Parse(dr["Quantity"].ToString());
decimal decQuantity = clsProductUnit.GetBaseUnitValue(lngProductID, intProductUnitID, decItemQuantity);
long lngVariationMatrixID = long.Parse(dr["VariationMatrixID"].ToString());
string strMatrixDescription = "" + dr["MatrixDescription"].ToString();
string strProductCode = "" + dr["ProductCode"].ToString();
decimal decUnitCost = decimal.Parse(dr["UnitCost"].ToString());
decimal decItemCost = decimal.Parse(dr["Amount"].ToString());
decimal decVAT = decimal.Parse(dr["VAT"].ToString());
///*******************************************
// * Add in the Sales Price History
// * ****************************************/
//if (lngVariationMatrixID != 0)
//{
// // Update MatrixPackagePriceHistory first to get the history
// clsMatrixPackagePriceHistoryDetails = new MatrixPackagePriceHistoryDetails();
// clsMatrixPackagePriceHistoryDetails.UID = clsSODetails.SellerID;
// clsMatrixPackagePriceHistoryDetails.PackageID = clsMatrixPackage.GetPackageID(lngVariationMatrixID, intProductUnitID);
// clsMatrixPackagePriceHistoryDetails.ChangeDate = DateTime.Now;
// clsMatrixPackagePriceHistoryDetails.Price = decUnitCost;
// clsMatrixPackagePriceHistoryDetails.PurchasePrice = -1; //-1 = nochange
// clsMatrixPackagePriceHistoryDetails.VAT = -1; //-1 = nochange
// clsMatrixPackagePriceHistoryDetails.EVAT = -1; //-1 = nochange
// clsMatrixPackagePriceHistoryDetails.LocalTax = -1; //-1 = nochange
// clsMatrixPackagePriceHistoryDetails.Remarks = "Based on SO #: " + clsSODetails.SONo;
// MatrixPackagePriceHistory clsMatrixPackagePriceHistory = new MatrixPackagePriceHistory(base.Connection, base.Transaction);
// clsMatrixPackagePriceHistory.Insert(clsMatrixPackagePriceHistoryDetails);
//}
//else
//{
// // Update ProductPackagePriceHistory first to get the history
// clsProductPackagePriceHistoryDetails = new ProductPackagePriceHistoryDetails();
// clsProductPackagePriceHistoryDetails.UID = clsSODetails.SellerID;
// clsProductPackagePriceHistoryDetails.PackageID = clsProductPackage.GetPackageID(lngProductID, intProductUnitID);
// clsProductPackagePriceHistoryDetails.ChangeDate = DateTime.Now;
// clsProductPackagePriceHistoryDetails.Price = decUnitCost;
// clsProductPackagePriceHistoryDetails.PurchasePrice = -1; //-1 = nochange
// clsProductPackagePriceHistoryDetails.VAT = -1; //-1 = nochange
// clsProductPackagePriceHistoryDetails.EVAT = -1; //-1 = nochange
// clsProductPackagePriceHistoryDetails.LocalTax = -1; //-1 = nochange
// clsProductPackagePriceHistoryDetails.Remarks = "Based on SO #: " + clsSODetails.SONo;
// ProductPackagePriceHistory clsProductPackagePriceHistory = new ProductPackagePriceHistory(base.Connection, base.Transaction);
// clsProductPackagePriceHistory.Insert(clsProductPackagePriceHistoryDetails);
//}
/*******************************************
* Subtract to Inventory
* ****************************************/
// clsProduct.SubtractQuantity(lngProductID, decQuantity);
// if (lngVariationMatrixID != 0) { clsProductVariationsMatrix.SubtractQuantity(lngVariationMatrixID, decQuantity); }
// July 28, 2011: change the above codes to the following
clsProduct.SubtractQuantity(clsSODetails.BranchID, lngProductID, lngVariationMatrixID, decQuantity, Products.getPRODUCT_INVENTORY_MOVEMENT_VALUE(PRODUCT_INVENTORY_MOVEMENT.DEDUCT_SOLD_WHOLESALE), DateTime.Now, clsSODetails.SONo, clsSODetails.SellerName);
/*******************************************
* Update Selling Information
* ****************************************/
int iBaseUnitID = clsProduct.get_BaseUnitID(lngProductID);
if (iBaseUnitID != intProductUnitID)
{
clsProduct.UpdateSellingPrice(lngProductID, lngVariationMatrixID, clsSODetails.CustomerID, intProductUnitID, (decItemQuantity * decUnitCost) / decQuantity, -1, -1, -1,- 1, -1); // Price should be the sugegsted selling price
}
clsProduct.UpdateSellingWSPrice(lngProductID, lngVariationMatrixID, clsSODetails.CustomerID, intProductUnitID, decUnitCost); // WS Price should be the unit cost
/*******************************************
* Add to Inventory Analysis
* ****************************************/
clsInventoryDetails = new InventoryDetails();
clsInventoryDetails.PostingDateFrom = clsERPConfigDetails.PostingDateFrom;
clsInventoryDetails.PostingDateTo = clsERPConfigDetails.PostingDateTo;
clsInventoryDetails.PostingDate = clsSODetails.DeliveryDate;
clsInventoryDetails.ReferenceNo = clsSODetails.SONo;
//.........这里部分代码省略.........