วันอาทิตย์ที่ 25 พฤศจิกายน พ.ศ. 2555

update reflesh master


real SumHoldHFP(ProdJournalRoute _ProdJournalRoute)
{
    real rSumQty;
    SWAN_ProdJournalRoute_Hold _SWAN_ProdJournalRoute_Hold;
    SWAN_Hold_Problem   _SWAN_Hold_Problem;
 
    ;


    select sum(Qty) from _SWAN_ProdJournalRoute_Hold
    where _SWAN_ProdJournalRoute_Hold.JobId == _ProdJournalRoute.JobId
    &&    _SWAN_ProdJournalRoute_Hold.JournalId == _ProdJournalRoute.JournalId
    &&    _SWAN_ProdJournalRoute_Hold.Sequence  == _ProdJournalRoute.Sequence
    join _SWAN_Hold_Problem
    where _SWAN_Hold_Problem.CodeHold == _SWAN_ProdJournalRoute_Hold.Code
    && _SWAN_Hold_Problem.IDHoldGroup == "HFP";


    rSumQty = _SWAN_ProdJournalRoute_Hold.Qty;

  /*
    callerForm         = element.args().caller();

   callerForm.dataSource().refresh();

   callerForm.dataSource().reread();

    callerForm.dataSource().research();
    */
    return rSumQty;
}


SWAN_ProdJournalRoute_Hold

public void refresh()
{
    ProdJournalTable _ProJournalTable;
    ;

    select _ProJournalTable
    where _ProJournalTable.JournalId == ProdJournalRoute.JournalId;

    if(_ProJournalTable.Posted == NoYes::No)
    {
        rSumHoldHFP = element.SumHoldHFP(ProdJournalRoute);
        ProdJournalRoute.HoldFP = rSumHoldHFP;
        rSumHoldMAT = element.SumHoldMAT(ProdJournalRoute);
        ProdJournalRoute.HoldMat = rSumHoldMAT;
        rSumHoldWIP = element.SumHoldWIP(ProdJournalRoute);
        ProdJournalRoute.HoldProd = rSumHoldWIP;
    }

    super();
}

public void delete()
{
    ProdJournalTable _ProJournalTable;
    ;

    select _ProJournalTable
    where _ProJournalTable.JournalId == ProdJournalRoute.JournalId;

    if(_ProJournalTable.Posted == NoYes::No)
    {
        rSumHoldHFP = element.SumHoldHFP(ProdJournalRoute);
        ProdJournalRoute.HoldFP = rSumHoldHFP;
        rSumHoldMAT = element.SumHoldMAT(ProdJournalRoute);
        ProdJournalRoute.HoldMat = rSumHoldMAT;
        rSumHoldWIP = element.SumHoldWIP(ProdJournalRoute);
        ProdJournalRoute.HoldProd = rSumHoldWIP;
    }

    super();
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น