Wednesday, 12 September 2012

Maintaing Minium Quantity in Inventory


task-2:
In a company called ABC, there is a requirement, every item should be maintained a minimum number of quantity, which if reduced,
should give a warning. Customize the following:

 a. Accept min mandatory quantity whenever new item is created. This should be a mandatory field and should be editable.
b. When a user create a sales order and sales lines, check for the min mandatory stock and if the stock becomes less than the min.
mandatory stock after selling items, show warning to user about the stock issue.
c. Whenever we perform operation on inventory ie., Sell/Purchase/Move Inventory/Transfer Inventory/Produce goods etc.,
 available stock should be matched with minimum mandatory stock and take appropriate action as per requirement.

Solutions:
Forms:
EcoResProductCreate
SalesTable

Table:
EcoResProduct
EcoResProductMaster

Code Modified/Written;

Sales Line Grid -> SalesLine_SalesQty


    public boolean modified()
    {
        InventSum inventSum;
        EcoResProductMaster ecoResProductMaster;
        real minQty,RequiredQty,AvailQty;

        boolean ret;
        select sum(AvailOrdered) from inventSum where inventSum.ItemId == SalesLine.ItemId;
        select firstOnly MinimumQty from ecoResProductMaster where ecoResProductMaster.DisplayProductNumber== SalesLine.ItemId;
        AvailQty = inventSum.AvailOrdered;
        minQty = ecoResProductMaster.MinimumQty;
        RequiredQty = this.realValue();

        if(minQty>(AvailQty-RequiredQty))
        {
            info("Stock is not available, Please Purchase Item");
        }

        ret = super();

        return ret;
    }






No comments:

Post a Comment