hasokeric
3/23/2015 - 7:00 PM

Epicor oTrans.adapter.NegativeInventoryTest

Epicor oTrans.adapter.NegativeInventoryTest

	/**
	 * Check for Negative Inventory, Epicor does Check for this however we have no control
	 * wether we should play the ERROR sound or not unless we check and play the sound
	 * before Epicor makes a Dialog Box appear
	 *
	 * @var 	partNum
	 * @var 	lotNum
	 * @var 	qty
	 * @type 	Custom Function
	 * @return	bool
	 */
	public bool CheckNegativeInventory(string partNum, string lotNum, decimal qty)
	{

		// Get Epicor DataRow
		DataRow drPO = edvPackOut.dataView[edvPackOut.Row].Row;

        string pcPartNum 		= partNum;
        string pcWhseCode 		= Convert.ToString(drPO["WarehouseCode"]);
        string pcBinNum 		= Convert.ToString(drPO["BinNum"]);
       	string pcLotNum 		= lotNum;
        string pcJobNum 		= Convert.ToString(drPO["JobNum"]);
        string pcDimCode 		= Convert.ToString(drPO["InventoryShipUOM"]);
        decimal pdTranQty 		= Convert.ToDecimal(qty);
        string pcNeqQtyAction 	= string.Empty;
        string pcMessage 		= string.Empty;

		this.oTrans.adapter.NegativeInventoryTest(pcPartNum, pcWhseCode, pcBinNum, pcLotNum, pcDimCode, 1.0m, pdTranQty, out pcNeqQtyAction, out pcMessage);

        if ((pcMessage != "") && (pcNeqQtyAction == "Ask User"))
        {
            return true;
        }

        return false;
	}