Do not let any software impress you!

Only let it convince your intellect.
Slider img 1
Do not look for a business paradise!

It is a waste of time.
Slider img 2
Only yourself can push you uphill.

There is no easy road to prizes.
Slider img 3
Productivity is the name of the game.

And you have to conquer it.
Slider img 4
As long as you understand it,

you will start to build your know-how.
Slider img 5
We can help with that.

We have the tools and the method.
Slider img 6

Product
Qty
UOM
Product ID
Serial No
Lot No
Expir Date
Budged
Event Type
From Location
Num
Date
Products to Transfer

Title : Product Transfer

Toolbars

call BrowseEditDelete()
call CloseForm(True)
call CloseForm(False)

Buttons

Fields


 (AU_KE_GOOD.QUANT)
 (AU_KE_GOOD.SERIAL_NUMBER)
 (AU_UNITMEAS.CODE)
 (AU_GOOD.TITLE)
 (AU_GOOD.CODE)
 (AU_KE_GOOD.LOT_NUM)
 (AU_KE_GOOD.EXPIR_DATE)
Budged (AU_EVENT.BUDGET_FLAG)
Event Type (AU_T_EVENT.DESCR)
From Location (AU_WAREHOUSE.DESCR)
Num (AU_EVENT.NUMBER)
Date (AU_EVENT.DATE)


AutoScript

lib

{================================== Form_Start ==============================}

proc Form_Start()

     f = TopForm()
     task = FormTask(f)
     p = PByName(f,"AU_EVENT")
     t = TByName(p,"AU_EVENT")
     p_synt = PByName(f,"AU_KE_GOOD")
     t_synt = TByName(p_synt,"AU_KE_GOOD")

     call SetCaption("Product Consumption")

     {......................................selection lists..............}
     start_sql "DESCR_SEL" "KOSMOS"
       SELECT AU_T_EVENT.DESCR, AU_T_EVENT.AU_T_EVENT
       FROM AU_KEVENT INNER JOIN AU_T_EVENT
       ON AU_KEVENT.AU_KEVENT = AU_T_EVENT.KEVENT1
       WHERE (AU_T_EVENT.KEVENT1=2)
       AND (AU_T_EVENT.MOVE_GOODS_FLAG = '1')
       AND (AU_T_EVENT.DESCR LIKE :E & '%')
       ORDER BY AU_T_EVENT.DESCR
     end_sql
     start_sql "UOM_SEL" "KOSMOS"
       SELECT AU_UNITMEAS.CODE, AU_UNITMEAS.AU_UNITMEAS
       FROM AU_GOOD_UNITMEAS INNER JOIN AU_UNITMEAS
       ON AU_GOOD_UNITMEAS.AU_UNITMEAS = AU_UNITMEAS.AU_UNITMEAS
       WHERE (AU_UNITMEAS.CODE LIKE :E & '%')
       AND (AU_GOOD_UNITMEAS.AU_GOOD = :G)
       ORDER BY AU_UNITMEAS.CODE
     end_sql

     if (task = ptAppend) then

        str = SelectFrom("SELECT AU_T_EVENT, DESCR, CODE FROM AU_T_EVENT WHERE (CODE='AU_CONSUME')")
        tevent = GetSQLSelectItem(str,1)
        tevent_descr = GetSQLSelectItem(str,2)
        tevent_code = GetSQLSelectItem(str,3)

        call TEdit(t)
        call TSetFld(t,"DATE",crDate)
        call TSetFld(t,"AU_T_EVENT",tevent)
        call TSetFld(t,"F_AU_T_EVENT_CODE",tevent_code)
        call TSetFld(t,"F_AU_T_EVENT_DESCR",tevent_descr)
        call TSetFld(t,"EVENT_E",pevent)
        call TPost(t)

        call ReLoadEditFields(f)

     endif

end

proc Select_DESCR_SEL_Params()

   s = GetEditedText()
   call ParamsEmbSQL("DESCR_SEL";s)

end

proc Select_UOM_SEL_Params()

   good_id = TGetFld(t_synt,"AU_GOOD")
   s = GetEditedText()
   call ParamsEmbSQL("UOM_SEL",s,good_id)

end

{============================== Form_BeforeClose ===============================}

fun Form_BeforeClose()

    result = 1

    {..............check for au_ke_good valitity}
    count = TRecordCount(t_synt)
    call TFirst(t_synt)
    for i = 1 to count
        id = TGetFld(t_synt,"AU_GOOD")
        id = val(id)
        if (id = 0) then
         call message("Line ",i," misses good!")
         result = 0
        endif

        qnt = TGetFld(t_synt,"QUANT")
        qnt = val(qnt)
        if (qnt = 0) then
         call message("Line ",i," misses quantity!")
         result = 0
        endif

        id = TGetFld(t_synt,"AU_UNITMEAS")
        id = val(id)
        if (id = 0) then
         call message("Line ",i," misses unit!")
         result = 0
        endif

        call TNext(t_synt)
    next

end