exp_addrGETADDR          Get Ship-to Address           1  15               name    1  
{\{txta    2
table  ttccom100               |Business Partners
table  ttccom111               |Ship-to business partner
table  ttccom130               |Addresses


select         tccom100.nama:name
       ,       tccom100.fovn:taxn
       ,       tccom130.namc:addr
       ,       tccom130.namd:addr2
       ,       tccom130.name:city
       ,       tccom130.cste:state
       ,       tccom130.pstc:zipcode
       ,       tccom130.ccty:ctry
       ,       tccom130.telp:telp
       ,       tccom130.tefx:telf
from           tccom100
       ,       tccom111
       ,       tccom130
where          tccom100.bpid = :stbp
and            tccom111.stbp = :stbp
and            tccom111.cadr refers to tccom130
selectdo
               return(true)
selectempty
               return(false)
endselect

return(false)
}\}
exp_addrGETTRMD          Get Transport Catg            1  11 tccom.trmd    stbp    1  
{\{txta    2
table  ttcmcs080       | Carriers
table  ttccom111       | Ship-to Business Partners


select         tccom111.*
       ,       tcmcs080.*
from           tccom111
       ,       tcmcs080
where          tccom111._index1 = {:stbp}
and            tccom111.cfrw refers to tcmcs080
selectdo
               return(tcmcs080.trmd)
endselect

return(tccom.trmd.none)
}\}
exp_billGETADDR          Get Bill-to Address           1  15               addr    1  
{\{txta    2
table  ttccom100               |Business Partners
table  ttccom112               |Invoice-to Business Partner
table  ttccom130               |Addresses

select         tccom100.nama:name
       ,       tccom100.fovn:taxn
       ,       tccom130.namc:addr
       ,       tccom130.namd:addr2
       ,       tccom130.name:city
       ,       tccom130.cste:state
       ,       tccom130.pstc:zipcode
       ,       tccom130.ccty:ctry
       ,       tccom130.telp:telp
       ,       tccom130.tefx:telf
from           tccom100
       ,       tccom112
       ,       tccom130
where          tccom100.bpid = :itbp
and            tccom112.itbp = :itbp
and            tccom112.cadr refers to tccom130
selectdo
               return(true)
selectempty
               return(false)
endselect

return(false)
}\}
exp_dataGETEXADDR        Get exporter address          1  15               name    1  
{\{txta    2
table  ttccom130               |Addresses
table  twhinh490               |Export Provider

db.retry.point()

select         tccom130.nama:name
       ,       tccom130.namc:addr
       ,       tccom130.namd:addr2
       ,       tccom130.name:city
       ,       tccom130.cste:state
       ,       tccom130.pstc:zipcode
       ,       tccom130.ccty:ctry
       ,       tccom130.fovn:taxn
       ,       whinh490.*
from           tccom130
       ,       whinh490 for update
where          tccom130._index1 = {:sfad}     and
               whinh490._index3 = {:ecoa}     and
               whinh490.prsf    = tcyesno.no  and
               whinh490.prst    = tcyesno.no  and
               whinh490.prit    = tcyesno.no  and
               whinh490.proh    = tcyesno.no  and
               whinh490.proi    = tcyesno.no
selectdo
              whinh490.prsf = tcyesno.yes
              db.update(twhinh490,db.retry)
              commit.transaction()
              return(true)

selectempty
endselect

return(false)
}\}
exp_dataGETHEADER        Get Header Data               1  15               ecoa    1  
{\{txta    2
table          twhinh490               |Export Provider

commit.transaction()

db.retry.point()

select         whinh490.*
from           whinh490 for update
where          whinh490._index3 = {:ecoa}     and
               whinh490.prsf    = tcyesno.yes and
               whinh490.prst    = tcyesno.yes and
               whinh490.prit    = tcyesno.yes and
               whinh490.proh    = tcyesno.no  and
               whinh490.proi    = tcyesno.no
selectdo
               whinh490.proh    = tcyesno.yes
               db.update(twhinh490,db.retry)
               commit.transaction()
               return(true)
selectempty
endselect

return(false)
}\}
exp_dataGETITBPADDR      Get Invoice-to Addr           1  15               itbp    1  
{\{txta    2
table          ttccom100               |Business Partners
table          ttccom130               |Addresses
table          twhinh490               |Export Provider

domain whinh.oorg oorg_temp

oorg_temp = ltoe(worg)

commit.transaction()

db.retry.point()

on case oorg_temp
   case whinh.oorg.sales:
   case whinh.oorg.production:
   case whinh.oorg.purchase:
   case whinh.oorg.service:
      select         tccom100.cadr                   ,
                     tccom100.fovn:taxn              ,
                     tccom100.nama:name              ,
                     tccom130.namc:addr              ,
                     tccom130.namd:addr2             ,
                     tccom130.name:city              ,
                     tccom130.cste:state             ,
                     tccom130.pstc:zipcode           ,
                     tccom130.ccty:ctry              ,
                     tccom130.telp:telp              ,
                     tccom130.tefx:tefx              ,
                     whinh490.*
      from           tccom100,
                     tccom130,
                     whinh490 for update
      where          tccom100._index1 = {:itbp}
      and            tccom130._index1 = {:itad}
      and            whinh490._index3 = {:ecoa}
      and            whinh490.prsf    = tcyesno.yes
      and            whinh490.prst    = tcyesno.yes
      and            whinh490.prit    = tcyesno.no
      and            whinh490.proh    = tcyesno.no
      and            whinh490.proi    = tcyesno.no
      selectdo
                     whinh490.prit = tcyesno.yes
                     db.update(twhinh490,db.retry)
                     commit.transaction()
                     return(true)
      selectempty
      endselect
      break
   default:
      select         whinh490.*
      from           whinh490 for update
      where          whinh490._index3 = {:ecoa}
      selectdo
                     whinh490.prit = tcyesno.yes
                     db.update(twhinh490,db.retry)
                     commit.transaction()
                     return(true)
      selectempty
      endselect
      break
endcase

return(false)
}\}
exp_dataGETITEM          Get Item data                 1  15               item    1  
{\{txta    2
table  ttcibd001               |General Item Data
table  twhinh490               |Export Provider

domain whinh.oorg      oorg_temp
string dsca_temp(30)
string fixed_dsca(30)

oorg_temp  =  ltoe(worg)

commit.transaction()

db.retry.point()

select         tcibd001.dsca
       ,       tcibd001.ctyo
       ,       whinh490.*
from           tcibd001
       ,       whinh490 for update
where          tcibd001.item    = :item        and
               whinh490._index3 = {:ecoa}      and
               whinh490.prsf    = tcyesno.yes  and
               whinh490.prst    = tcyesno.yes  and
               whinh490.prit    = tcyesno.yes  and
               whinh490.proh    = tcyesno.yes  and
               whinh490.proi    = tcyesno.no
selectdo
               if oorg_temp  = whinh.oorg.transfer or
                  oorg_temp  = whinh.oorg.transfer.man  then
                     dsca = concat$(" ",strip$(tcibd001.dsca),
                                    "No charge - warehouse transfer")
              else
                 if oorg_temp = whinh.oorg.production.man then
                     dsca = concat$(" ",strip$(tcibd001.dsca),
                              "Default price is used for manual orders")
                 else
                     dsca = tcibd001.dsca
                 endif
              endif

              whinh490.proi = tcyesno.yes
              db.update(twhinh490,db.retry)
              commit.transaction()
              return(true)
selectempty
endselect

return(false)
}\}
exp_dataGETSHTOADD       Get Ship-to Address           1  15               stad    1  
{\{txta    2
table          ttccom130               |Addresses
table          twhinh490               |Export Provider

commit.transaction()

db.retry.point()

select         tccom130.nama:name              ,
               tccom130.namc:addr              ,
               tccom130.namd:addr2             ,
               tccom130.name:city              ,
               tccom130.cste:state             ,
               tccom130.pstc:zipcode           ,
               tccom130.ccty:ctry              ,
               tccom130.telp:telp              ,
               tccom130.tefx:tefx
from           tccom130,
               whinh490 for update
where          tccom130._index1 = {:stad}      and
               whinh490._index3 = {:ecoa}      and
               whinh490.prsf    = tcyesno.yes  and
               whinh490.prst    = tcyesno.no   and
               whinh490.prit    = tcyesno.no   and
               whinh490.proh    = tcyesno.no   and
               whinh490.proi    = tcyesno.no
selectdo
               whinh490.prst    = tcyesno.yes
               db.update(twhinh490,db.retry)
               commit.transaction()
               return(true)
selectempty
endselect

return(false)
}\}
exp_dataUPDPROCDT        Update Processed Dt           1  15               ecoa    1  
{\{txta    2
table          twhinh490               |Export Provider

commit.transaction()

db.retry.point()

select         whinh490.*
from           whinh490 for update
where          whinh490._index3 = {:ecoa}
and            whinh490.prsf    = tcyesno.yes
and            whinh490.prst    = tcyesno.yes
and            whinh490.prit    = tcyesno.yes
and            whinh490.proh    = tcyesno.yes
and            whinh490.proi    = tcyesno.yes
selectdo
               whinh490.dtpr    = utc.num()
               db.update(twhinh490,db.retry)
               commit.transaction()
               return(true)
selectempty
endselect

return(false)
}\}
{\{txth    2
This condition will verify that all the flags on table whinh490 are set to "yes"
before updating the processed date.
}\}
exp_itemGETPRDDESC       Get prod. typ. descr          1  6                item    1  
{\{txta    2
}\}
exp_itemGETPRIS          Get sales price               1  5                item    1  
{\{txta    2
table          ttdisa001

select tdisa001.pris
from   tdisa001
where  tdisa001._index1 = {:item}
selectdo
       return(tdisa001.pris)
selectempty
endselect

return(0)
}\}
exp_wh  GETADDR          Get Warehouse Addr            1  15               zipcode 1  
{\{txta    2
table          ttccom130               |Addresses


select         tccom130.nama:name,
               tccom130.namc:addr,
               tccom130.namd:addr2,
               tccom130.name:city,
               tccom130.cste:state,
               tccom130.pstc:zipcode,
               tccom130.ccty:ctry,
               tccom130.fovn:fovn
from           tccom130
where          tccom130._index1 = {:cadr}
selectdo
               return(true)
selectempty
endselect

return(false)
}\}
