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

Date Event Type Event Number Invoice Amount Currency Business
12/8/2019 Order 27 222 EUR A Corporation
14/9/2019 Invoice 11 23603,82 EUR A Corporation
6/6/2020 Invoice 20 23603,82 EUR A Corporation
3:1-3

Title : Goods Sending

Toolbars

call bom()
call new_offer()
call paral()
call res_cost()
call OpenForm("ptDelete";"AU_SALE_GOODRECEIPT_E.FM";"WORK.AU_EVENT";1;"?=AU_EVENT")
call BrowseFilter()
call PrintGrid()
call CreateSheet()
call cost()
call print_sale()

Buttons

Fields


 (.DATE)
 (.DESCR)
 (.NUMBER)
 (.TOTAL_AMOUNT)
 (.CCODE)
 (.TITLE)
 (.DATE)
 (.DESCR)
 (.NUMBER)
 (.TOTAL_AMOUNT)
 (.CCODE)
 (.TITLE)


AutoScript

lib

proc Form_Start()

     call SetCaption("Goods Sending")

end

proc Lst_DblClick()

     event = TGetFld(q,"AU_EVENT")
     code = TGetFld (q, "CODE")
     expr = strcat(event,"=AU_EVENT")
     if (code = "AU_OFFER") then
        call OpenForm("ptEdit","AU_EVENT_SALE_OFFER_E.FM","WORK.AU_EVENT",1,expr)
     else
        call OpenForm("ptEdit","AU_SALE_GOODRECEIPT_E.FM","WORK.AU_EVENT",1,expr)
     endif

end

proc Panels_Start()

     mode = __params[4]
     pevent = __params[5]
     bus_id = GetActiveEtair("AU_BUSINESS")

     if (mode = "ALL_MODE") then
        start_sql "DATA" "KOSMOS"
         SELECT AU_EVENT.AU_EVENT, AU_EVENT.DATE, AU_EVENT.EVENT_E, AU_CURRENCY.CCODE,
         AU_BUSINESS.TITLE, AU_EVENT.NUMBER, AU_EVENT.TOTAL_AMOUNT, AU_T_EVENT.DESCR,
         AU_T_EVENT.CODE
         FROM ((AU_EVENT LEFT JOIN AU_CURRENCY ON AU_EVENT.AU_CURRENCY = AU_CURRENCY.AU_CURRENCY)
         INNER JOIN AU_T_EVENT ON AU_EVENT.AU_T_EVENT = AU_T_EVENT.AU_T_EVENT)
         INNER JOIN AU_BUSINESS ON AU_EVENT.BUSINESS_TO = AU_BUSINESS.AU_BUSINESS
         WHERE (AU_T_EVENT.KEVENT1 = 2) AND (AU_EVENT.BUSINESS_FROM = :B)
        end_sql
        q = QueryByName("DATA")
        call TSetParam(q,"B",bus_id)
     endif
     if (mode = "SORDER_MODE") then
        start_sql "DATA" "KOSMOS"
         SELECT AU_EVENT.AU_EVENT, AU_EVENT.DATE, AU_EVENT.EVENT_E, AU_CURRENCY.CCODE,
         AU_BUSINESS.TITLE, AU_EVENT.NUMBER, AU_EVENT.TOTAL_AMOUNT, AU_T_EVENT.DESCR,
         AU_T_EVENT.CODE
         FROM ((AU_EVENT LEFT JOIN AU_CURRENCY ON AU_EVENT.AU_CURRENCY = AU_CURRENCY.AU_CURRENCY)
         INNER JOIN AU_T_EVENT ON AU_EVENT.AU_T_EVENT = AU_T_EVENT.AU_T_EVENT)
         INNER JOIN AU_BUSINESS ON AU_EVENT.BUSINESS_TO = AU_BUSINESS.AU_BUSINESS
         WHERE (AU_T_EVENT.KEVENT1 = 2) AND (AU_EVENT.BUSINESS_FROM = :B)
         AND (AU_EVENT.EVENT_E = :EV)
        end_sql
        q = QueryByName("DATA")
        call TSetParam(q,"EV",pevent)
        call TSetParam(q,"B",bus_id)
     endif

     call TPrepare(q)

end

proc paral()

    call OpenForm("ptAppend","AU_SALE_GOODRECEIPT_E.FM","WORK.AU_EVENT",1,"?=AU_EVENT",pevent)

end

proc cost()

     id = TGetFld(q,"AU_EVENT")
     call OpenFormTop("ptBrowse";"AU_STANDARDCOST_B.FM";"QRY.DATA","EVENT_MODE",id)

end

{----------------------------- Print_Sale -------------------------------------}

proc print_sale()

    resdir = GetResourceDir()
    filename = "AU_PRINTSALE.HTM"

    id = TGetFld(q,"AU_EVENT")

    call html_processfile(filename, id)

    filename = strcat(resdir,"\HTML\_AU_PRINTSALE.HTM")
    call Browse(filename)

end

proc res_cost()

     call OpenFormTop("ptBrowse";"AU_RESOURCE_COST_B.FM";"QRY.DATA","ALL_MODE")

end

proc bom()

     id = TGetFld(q,"AU_EVENT")
     call OpenFormTop("ptBrowse";"AU_BOM_B.1111FM";"QRY.DATA","EVENT_MODE",id)

end

proc new_offer()

     call OpenForm("ptAppend","AU_EVENT_SALE_OFFER_E.FM","WORK.AU_EVENT",1,"?=AU_EVENT")

end