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

Account ID
Account
Amount
Comments
Description
Associate
Product ID
Generic Demand
Department
Estimated price
Estimated amount
Final price
Final amount
UoM
Needed Date
Comment
Detailed Comments
Budgeting
Extended parameters
Quantity

Title : AU_EVENT_PURCH

Toolbars

call BrowseEditInsert()
call BrowseEditDoVKUp(fld_id,fld_val,key)
call BrowseEditDoVKDown(fld_id,fld_val,key)
call BrowseEditInsertSame()
call BrowseEditDelete()
call CloseForm(True)
call CloseForm(False)

Buttons

Fields


 (AU_ACCOUNT.CODE)
 (AU_ACCOUNT.TITLE)
 (AU_EVENT_PURCH_BUDG.AMOUNT)
 (AU_EVENT_PURCH_BUDG.COMM)
Description (AU_GOOD.TITLE)
Associate (AU_USER.UNAME)
Product ID (AU_GOOD.CODE)
Generic Demand (AU_PURCH_DEMAND.AU_PURCH_DEMAND_D)
Department (AU_POS.POS_D)
Estimated price (AU_EVENT_PURCH.PRICE_EST)
Estimated amount (AU_EVENT_PURCH.AMOUNT_EST)
Final price (AU_EVENT_PURCH.PRICE_FIN)
Final amount (AU_EVENT_PURCH.AMOUNT_FIN)
UoM (AU_UNITMEAS.CODE)
Needed Date (AU_EVENT_PURCH.SDATE2)
Comment (AU_EVENT_PURCH.COMM)
Detailed Comments (AU_EVENT_PURCH.MEMO1)
Quantity (AU_EVENT_PURCH.QUANT)


AutoScript

lib

proc Form_Start(FORM)

     f = FORM
     pe = PByName(f,"AU_EVENT_PURCH")
     {te: handler of in-memory table}
     te = TByName(pe,"AU_EVENT_PURCH")
     task = FormTask(f)

     mode = __params[6]
     if (task = ptAppend) then

        call TEdit(te)
        call TSetFld(te,"SCHEDULED_FLAG","0")
        call TSetFld(te,"DONE_FLAG","0")
        call TSetFld(te,"CANCELED_FLAG","0")
        call TSetFld(te,"STAT","Non Scheduled")
        call TSetFld(te,"SDATE1",crDate)
        if (mode = "SUPPLIER_MODE") then
         bus_id = __params[7]
         btitle = __params[8]

         call TSetFld(te,"AU_BUSINESS",bus_id)
         call TSetFld(te,"F_AU_BUSINESS_TITLE",btitle)
        endif
        if (mode = "PRODUCT_MODE") then

         start_sql "*" "KOSMOS"
                SELECT AU_GOOD_CODE.AU_GOOD_CODE, AU_BUSINESS.AU_BUSINESS, AU_GOOD.TITLE AS GTITLE,
                AU_GOOD.CODE AS GCODE, AU_GOOD_CODE.CODE, AU_GOOD_CODE.DESCR, AU_BUSINESS.TITLE, AU_GOOD_CODE.AU_GOOD_CODE
                FROM (AU_GOOD LEFT JOIN AU_GOOD_CODE ON AU_GOOD.AU_GOOD = AU_GOOD_CODE.AU_GOOD)
                LEFT JOIN AU_BUSINESS ON AU_GOOD_CODE.AU_BUSINESS = AU_BUSINESS.AU_BUSINESS
                WHERE (AU_GOOD.AU_GOOD=:G)
                ORDER BY AU_GOOD_CODE.AU_GOOD_CODE
         end_sql
         q = QueryByName()
         good_id = __params[7]
         call TSetParam(q,"G",good_id)
         call TExecute(q)
         call TLast(q)
         gcode = TGetFld(q,"GCODE")
         gtitle = TGetFld(q,"GTITLE")
         code = TGetFld(q,"CODE")
         descr = TGetFld(q,"DESCR")
         bus_id = TGetFld(q,"AU_BUSINESS")
         bus_t = TGetFld(q,"TITLE")
         code_id = TGetFld(q,"AU_GOOD_CODE")
         call FreeEmbSQL(q)

         call TSetFld(te,"AU_BUSINESS",bus_id)
         call TSetFld(te,"F_AU_BUSINESS_TITLE",bus_t)
         call TSetFld(te,"AU_GOOD",good_id)
         call TSetFld(te,"F_AU_GOOD_CODE",gcode)
         call TSetFld(te,"F_AU_GOOD_TITLE",gtitle)
         call TSetFld(te,"AU_GOOD_CODE",code_id)
         call TSetFld(te,"F_AU_GOOD_CODE_CODE",code)
         call TSetFld(te,"F_AU_GOOD_CODE_DESCR",descr)
        endif

        if (mode = "DEMAND_DEPART_MODE") then
         demand_id = __params[7]
         depart_id = __params[8]

         call TSetFld(te,"AU_PURCH_DEMAND",demand_id)
         text = LookUpId("AU_PURCH_DEMAND",demand_id,"AU_PURCH_DEMAND_D")
         call TSetFld(te,"F_AU_PURCH_DEMAND_AU_PURCH_DEMAND_D",text)

         call TSetFld(te,"AU_POS",depart_id)
         text = LookUpId("AU_POS",depart_id,"POS_D")
         call TSetFld(te,"F_AU_POS_POS_D",text)
         endif

        call TPost(te)
        call ReLoadEditFields(f)
     endif

     if (mode = "DEMAND_DEPART_MODE") then

        call OnOpenForm_DisableField("F_AU_PURCH_DEMAND_AU_PURCH_DEMAND_D")
        call OnOpenForm_DisableField("F_AU_POS_POS_D")

     endif

end

 proc new_good()

     call OpenFormTop ("ptAppend","AU_GOOD_FAST_E.FM","WORK.AU_GOOD",1,"?=AU_GOOD")

end

proc calculations()

     AMOUNT_EST = AU_EVENT_PURCH!QUANT * AU_EVENT_PURCH!PRICE_EST
     AMOUNT_FIN = AU_EVENT_PURCH!QUANT * AU_EVENT_PURCH!PRICE_FIN
     call TEdit(te)
     call TSetFld(te,"AMOUNT_EST",AMOUNT_EST)
     call TSetFld(te,"AMOUNT_FIN",AMOUNT_FIN)
     call TPost(te)
     call ReLoadEditFields(f)

end