#INCLUDE "PROTHEUS.CH"
User Function SPDFISBLCK()
Local aRet := {}
Local cAlias0210 := ''
Local cAliasK200 := ''
Local cAliasK220 := ''
Local cAliasK230 := ''
Local cAliasK235 := ''
Local cAliasK250 := ''
Local cAliasK255 := ''
Local cAliasK210 := ''
Local cAliasK215 := ''
Local cAliasK260 := ''
Local cAliasK265 := ''
Local cAliasK270 := ''
Local cAliasK275 := ''
Local cAliasK280 := ''
Local cAliasK290 := ''
Local cAliasK291 := ''
Local cAliasK292 := ''
Local cAliasK300 := ''
Local cAliasK301 := ''
Local cAliasK302 := ''
Local cProd1 := "MP0000000000000000000000000001"
Local cProd2 := "PA0000000000000000000000000001"
Local cModArq:= ParamIxb[ 3 ]
Local lGeraComp := cModArq== "1"
Local dDTBackup := dDataBase
dDataBase:=ParamIxb[ 1 ]
TmpBlcK( @cAlias0210 , @cAliasK200 , @cAliasK220 , @cAliasK230 , @cAliasK235 , @cAliasK250 , @cAliasK255 , @cAliasK210 , @cAliasK215 ,;
@cAliasK260 , @cAliasK265 , @cAliasK270 , @cAliasK275 , @cAliasK280 , @cAliasK290 , @cAliasK291 , @cAliasK292 , @cAliasK300 , @cAliasK301 , @cAliasK302 )
G0210(cAlias0210,cProd1,cProd2)
GK200(cAliasK200,cProd1,cProd2)
if lGeraComp
GK210(cAliasK210,cProd1,cProd2)
GK215(cAliasK215,cProd1,cProd2)
endif
GK220(cAliasK220,cProd1,cProd2)
GK230(cAliasK230,cProd1,cProd2)
if lGeraComp
GK235(cAliasK235,cProd1,cProd2)
endif
GK250(cAliasK250,cProd1,cProd2)
if lGeraComp
GK255(cAliasK255,cProd1,cProd2)
GK260(cAliasK260,cProd1,cProd2)
GK265(cAliasK265,cProd1,cProd2)
endif
GK270(cAliasK270,cProd1,cProd2)
GK275(cAliasK275,cProd1,cProd2)
GK280(cAliasK280,cProd1,cProd2)
GK290(cAliasK290,cProd1,cProd2)
GK291(cAliasK291,cProd1,cProd2)
if lGeraComp
GK292(cAliasK292,cProd1,cProd2)
endif
GK300(cAliasK300,cProd1,cProd2)
GK301(cAliasK301,cProd1,cProd2)
if lGeraComp
GK302(cAliasK302,cProd1,cProd2)
endif
aRet := {cAlias0210,;
cAliasK200,;
cAliasK220,;
cAliasK230,;
cAliasK235,;
cAliasK250,;
cAliasK255,;
cAliasK210,;
cAliasK215,;
cAliasK260,;
cAliasK265,;
cAliasK270,;
cAliasK275,;
cAliasK280,;
cAliasK290,;
cAliasK291,;
cAliasK292,;
cAliasK300,;
cAliasK301,;
cAliasK302 }
dDataBase:=dDTBackup
Return aRet
Static Function TmpBlcK(cAlias0210,cAliasK200,cAliasK220,cAliasK230,cAliasK235,cAliasK250,cAliasK255,cAliasK210, cAliasK215, cAliasK260, cAliasK265, cAliasK270,cAliasK275,cAliasK280,cAliasK290,cAliasK291,cAliasK292,cAliasK300,cAliasK301,cAliasK302 )
Local aCampos := {}
Local nTamFil := TamSX3( "D1_FILIAL" )[ 1 ]
Local nTamDt := TamSX3( "D1_DTDIGIT" )[ 1 ]
Local aTamQtd := TamSX3( "B2_QATU" )
Local nTamOP := TamSX3( "D3_OP" )[ 1 ]
Local nTamCod := TamSX3( "B1_COD" )[ 1 ]
Local nTamChave := TamSX3( "D1_COD" )[ 1 ] + TamSX3( "D1_SERIE" )[ 1 ] + TamSX3( "D1_FORNECE" )[ 1 ] + TamSX3( "D1_LOJA" )[ 1 ]
Local nTamPar := TamSX3( "A1_COD" )[ 1 ] + TamSX3( "A1_LOJA" )[ 1 ]
Local nTamReg := 4
Local oAliasTMP1
Local oAliasTMP2
Local oAliasTMP3
Local oAliasTMP4
Local oAliasTMP5
Local oAliasTMP6
Local oAliasTMP7
Local oAliasTMP8
Local oAliasTMP9
Local oAliasTMP10
Local oAliasTMP11
Local oAliasTMP12
Local oAliasTMP13
Local oAliasTMP14
Local oAliasTMP15
Local oAliasTMP16
Local oAliasTMP17
Local oAliasTMP18
Local oAliasTMP19
Local oAliasTMP20
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "COD_I_COMP" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COMP" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "PERDA" , "N" , 5 , 2 })
cAlias0210 := '0210'
CriaTabTmp( @oAliasTMP1 , cAlias0210, aCampos, { "FILIAL" , "COD_ITEM" , "COD_I_COMP" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_EST" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "IND_EST" , "C" , 1 , 0 })
AADD(aCampos,{ "COD_PART" , "C" ,nTamPar, 0 })
cAliasK200 := 'K200'
CriaTabTmp( @oAliasTMP2 , cAliasK200, aCampos, { "FILIAL" , "DT_EST" , "COD_ITEM" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_MOV" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_ITEM_O" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "COD_ITEM_D" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_ORI" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "QTD_DEST" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
cAliasK220 := 'K220'
CriaTabTmp( @oAliasTMP3 , cAliasK220, aCampos, { "FILIAL" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_INI_OP" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "DT_FIN_OP" , "C" ,nTamDt , 0 })
AADD(aCampos,{ "COD_DOC_OP" , "C" ,nTamOP , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_ENC" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
cAliasK230 := 'K230'
CriaTabTmp( @oAliasTMP4 , cAliasK230, aCampos, { "FILIAL" , "COD_DOC_OP" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_SAIDA" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "COD_INS_SU" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "COD_DOC_OP" , "C" ,nTamOP , 0 })
cAliasK235 := 'K235'
CriaTabTmp( @oAliasTMP5 , cAliasK235, aCampos, { "FILIAL" , "COD_DOC_OP" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "DT_PROD" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
cAliasK250 := 'K250'
CriaTabTmp( @oAliasTMP6 , cAliasK250, aCampos, { "FILIAL" , "DT_PROD" , "COD_ITEM" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "DT_CONS" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "COD_INS_SU" , "C" ,nTamCod , 0 })
cAliasK255 := 'K255'
CriaTabTmp( @oAliasTMP7 , cAliasK255, aCampos, { "FILIAL" , "CHAVE" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_INI_OS" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "DT_FIN_OS" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_DOC_OS" , "C" ,nTamOP , 0 })
AADD(aCampos,{ "COD_ITEM_O" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_ORI" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
cAliasK210 := 'K210'
CriaTabTmp( @oAliasTMP8 , cAliasK210, aCampos, { "FILIAL" , "COD_ITEM_O" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_DOC_OS" , "C" ,nTamOP , 0 })
AADD(aCampos,{ "COD_ITEM_D" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_DES" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
cAliasK215 := 'K215'
CriaTabTmp( @oAliasTMP9 , cAliasK215, aCampos, { "FILIAL" , "COD_DOC_OS" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_OP_OS" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "DT_SAIDA" , "D" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_SAIDA" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "DT_RET" , "D" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_RET" , "N" ,nTamCod , 0 })
cAliasK260 := 'K260'
CriaTabTmp( @oAliasTMP10 , cAliasK260, aCampos, { "FILIAL" , "COD_OP_OS" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_OP_OS" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_CONS" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_RET" , "N" ,nTamCod , 0 })
cAliasK265 := 'K265'
CriaTabTmp( @oAliasTMP11 , cAliasK265, aCampos, { "FILIAL" , "COD_OP_OS" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_INI_AP" , "D" ,nTamChave , 0 })
AADD(aCampos,{ "DT_FIN_AP" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_OP_OS" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COR_P" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COR_N" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "ORIGEM " , "C" ,nTamCod , 0 })
cAliasK270 := 'K270'
CriaTabTmp( @oAliasTMP12 , cAliasK270, aCampos, { "FILIAL" , "COD_OP_OS" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_OP_OS" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COR_P" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COR_N" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "COD_INS_SU" , "C" ,nTamCod , 0 })
cAliasK275 := 'K275'
CriaTabTmp( @oAliasTMP13 , cAliasK275, aCampos, { "FILIAL" , "COD_OP_OS" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_EST" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COR_P" , "N" ,nTamCod , 0 })
AADD(aCampos,{ "QTD_COR_N" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "IND_EST" , "C" ,aTamQtd[ 1 ],aTamQtd[ 2 ]})
AADD(aCampos,{ "COD_PART" , "C" ,nTamPar , 0 })
cAliasK280 := 'K280'
CriaTabTmp( @oAliasTMP14 , cAliasK280, aCampos, { "FILIAL" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_INI_OP" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "DT_FIN_OP" , "D" ,nTamDt , 0 })
AADD(aCampos,{ "COD_DOC_OP" , "C" ,nTamOP , 0 })
cAliasK290 := 'K290'
CriaTabTmp( @oAliasTMP15 , cAliasK290, aCampos, { "FILIAL" , "COD_DOC_OP" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_DOC_OP" , "C" ,nTamOP, 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ] , 0 })
cAliasK291 := 'K291'
CriaTabTmp( @oAliasTMP16 , cAliasK291, aCampos, { "FILIAL" , "COD_DOC_OP" , "COD_ITEM" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "COD_DOC_OP" , "C" ,nTamOP, 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ] , 0 })
cAliasK292 := 'K292'
CriaTabTmp( @oAliasTMP17 , cAliasK292, aCampos, { "FILIAL" , "COD_DOC_OP" , "COD_ITEM" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "DT_PROD" , "D" ,nTamDt , 0 })
cAliasK300 := 'K300'
CriaTabTmp( @oAliasTMP18 , cAliasK300, aCampos, { "FILIAL" , "CHAVE" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave, 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ] , 0 })
cAliasK301 := 'K301'
CriaTabTmp( @oAliasTMP19 , cAliasK301, aCampos, { "FILIAL" , "CHAVE" })
aCampos := {}
AADD(aCampos,{ "FILIAL" , "C" ,nTamFil , 0 })
AADD(aCampos,{ "REG" , "C" ,nTamReg , 0 })
AADD(aCampos,{ "CHAVE" , "C" ,nTamChave, 0 })
AADD(aCampos,{ "COD_ITEM" , "C" ,nTamCod , 0 })
AADD(aCampos,{ "QTD" , "N" ,aTamQtd[ 1 ],aTamQtd[ 2 ] , 0 })
cAliasK302 := 'K302'
CriaTabTmp( @oAliasTMP20 , cAliasK302, aCampos, { "FILIAL" , "CHAVE" })
Return
Static Function CriaTabTmp(oAlias, cAlias, aCampos, aIndex)
oAlias := FWTemporaryTable():New(cAlias)
oAlias:SetFields(aCampos)
oAlias:AddIndex( "01" , aIndex)
oAlias:Create()
Return
Static Function G0210(cAlias0210,cProd1,cProd2)
RecLock (cAlias0210, .T.)
(cAlias0210)->FILIAL := cFilAnt
(cAlias0210)->REG := '0210'
(cAlias0210)->COD_ITEM := cProd1
(cAlias0210)->COD_I_COMP := '600'
(cAlias0210)->QTD_COMP := 4
(cAlias0210)->PERDA := 0
MsUnLock ()
Return
Static Function GK200(cAliasK200,cProd1,cProd2)
RecLock (cAliasK200, .T.)
(cAliasK200)->FILIAL := cFilAnt
(cAliasK200)->REG := 'K200'
(cAliasK200)->DT_EST := lastday(dDataBase)
(cAliasK200)->COD_ITEM := cProd1
(cAliasK200)->QTD := 1
(cAliasK200)->IND_EST := '0'
(cAliasK200)->COD_PART := 'SA100001001'
MsUnLock ()
Return
Static Function GK210(cAliasK210,cProd1,cProd2)
RecLock (cAliasK210, .T.)
(cAliasK210)->FILIAL := cFilAnt
(cAliasK210)->REG := 'K210'
(cAliasK210)->DT_INI_OS := lastday(dDataBase, 1 )
(cAliasK210)->DT_FIN_OS := lastday(dDataBase)
(cAliasK210)->COD_DOC_OS := '0000210001'
(cAliasK210)->COD_ITEM_O := cProd2
(cAliasK210)->QTD_ORI := 1
MsUnLock ()
Return
Static Function GK215(cAliasK215,cProd1,cProd2)
RecLock (cAliasK215, .T.)
(cAliasK215)->FILIAL := cFilAnt
(cAliasK215)->REG := 'K215'
(cAliasK215)->COD_DOC_OS := '0000210001'
(cAliasK215)->COD_ITEM_D := cProd1
(cAliasK215)->QTD_DES:= 1
MsUnLock ()
Return
Static Function GK220(cAliasK220,cProd1,cProd2)
RecLock (cAliasK220, .T.)
(cAliasK220)->FILIAL := cFilAnt
(cAliasK220)->REG := 'K220'
(cAliasK220)->DT_MOV := lastday(dDataBase, 1 )
(cAliasK220)->COD_ITEM_O := cProd1
(cAliasK220)->COD_ITEM_D := cProd2
(cAliasK220)->QTD_ORI := 1
(cAliasK220)->QTD_DEST := 1
MsUnLock ()
Return
Static Function GK230(cAliasK230,cProd1,cProd2)
RecLock (cAliasK230, .T.)
(cAliasK230)->FILIAL := cFilAnt
(cAliasK230)->REG := 'K230'
(cAliasK230)->DT_INI_OP := lastday(dDataBase, 1 )
(cAliasK230)->DT_FIN_OP := GRAVADATA(lastday(dDataBase),.F., 5 )
(cAliasK230)->COD_DOC_OP := '00005001001'
(cAliasK230)->COD_ITEM := cProd2
(cAliasK230)->QTD_ENC := 1
MsUnLock ()
Return
Static Function GK235(cAliasK235,cProd1,cProd2)
RecLock (cAliasK235, .T.)
(cAliasK235)->FILIAL := cFilAnt
(cAliasK235)->REG := 'K235'
(cAliasK235)->DT_SAIDA := lastday(dDataBase, 1 )
(cAliasK235)->COD_ITEM := cProd1
(cAliasK235)->QTD := 8
(cAliasK235)->COD_INS_SU := ''
(cAliasK235)->COD_DOC_OP := '00005001001'
MsUnLock ()
Return
Static Function GK250(cAliasK250,cProd1,cProd2)
RecLock (cAliasK250, .T.)
(cAliasK250)->FILIAL := cFilAnt
(cAliasK250)->REG := 'K250'
(cAliasK250)->CHAVE := '000001'
(cAliasK250)->COD_ITEM := cProd2
(cAliasK250)->DT_PROD := lastday(dDataBase, 1 )
(cAliasK250)->QTD := 1
MsUnLock ()
Return
Static Function GK255(cAliasK255,cProd1,cProd2)
RecLock (cAliasK255, .T.)
(cAliasK255)->FILIAL := cFilAnt
(cAliasK255)->REG := 'K255'
(cAliasK255)->CHAVE := '000001'
(cAliasK255)->COD_ITEM := cProd1
(cAliasK255)->DT_CONS := lastday(dDataBase, 1 )
(cAliasK255)->QTD := 1
(cAliasK255)->COD_INS_SU:= ''
MsUnLock ()
Return
Static Function GK260(cAliasK260,cProd1,cProd2)
RecLock (cAliasK260, .T.)
(cAliasK260)->FILIAL := cFilAnt
(cAliasK260)->REG := 'K260'
(cAliasK260)->COD_OP_OS := '000001'
(cAliasK260)->COD_ITEM := cProd2
(cAliasK260)->DT_SAIDA := lastday(dDataBase, 1 )
(cAliasK260)->QTD_SAIDA := 0
(cAliasK260)->DT_RET :=lastday(dDataBase, 1 )
(cAliasK260)->QTD_RET := 0
MsUnLock ()
Return
Static Function GK265(cAliasK265,cProd1,cProd2)
RecLock (cAliasK265, .T.)
(cAliasK265)->FILIAL := cFilAnt
(cAliasK265)->REG := 'K265'
(cAliasK265)->COD_OP_OS := '000001'
(cAliasK265)->COD_ITEM := cProd1
(cAliasK265)->QTD_CONS := 0
(cAliasK265)->QTD_RET := 0
MsUnLock ()
Return
Static Function GK270(cAliasK270,cProd1,cProd2)
RecLock (cAliasK270, .T.)
(cAliasK270)->FILIAL := cFilAnt
(cAliasK270)->REG := 'K270'
(cAliasK270)->DT_INI_AP := lastday(MonthSub(dDataBase, 1 ), 1 )
(cAliasK270)->DT_FIN_AP := lastday(MonthSub(dDataBase, 1 ))
(cAliasK270)->COD_OP_OS := '000001'
(cAliasK270)->CHAVE := '000001'
(cAliasK270)->COD_ITEM := cProd2
(cAliasK270)->QTD_COR_P := 0
(cAliasK270)->QTD_COR_N := 0
(cAliasK270)->ORIGEM := '1'
MsUnLock ()
Return
Static Function GK275(cAliasK275,cProd1,cProd2)
RecLock (cAliasK275, .T.)
(cAliasK275)->FILIAL := cFilAnt
(cAliasK275)->REG := 'K275'
(cAliasK275)->COD_OP_OS := '000001'
(cAliasK275)->CHAVE := '000001'
(cAliasK275)->COD_ITEM := cProd2
(cAliasK275)->QTD_COR_P := 1
(cAliasK275)->QTD_COR_N := 0
(cAliasK275)->COD_INS_SU:= ''
MsUnLock ()
Return
Static Function GK280(cAliasK280,cProd1,cProd2)
RecLock (cAliasK280, .T.)
(cAliasK280)->FILIAL := cFilAnt
(cAliasK280)->REG := 'K280'
(cAliasK280)->DT_EST := lastday(MonthSub(dDataBase, 1 ), 1 )
(cAliasK280)->COD_ITEM := cProd1
(cAliasK280)->QTD_COR_P := 1
(cAliasK280)->QTD_COR_N := 0
(cAliasK280)->IND_EST := '0'
(cAliasK280)->COD_PART:= 'SA1SP0001'
MsUnLock ()
Return
Static Function GK290(cAliasK290,cProd1,cProd2)
RecLock (cAliasK290, .T.)
(cAliasK290)->FILIAL := cFilAnt
(cAliasK290)->REG := 'K290'
(cAliasK290)->DT_INI_OP := lastday(dDataBase, 1 )
(cAliasK290)->DT_FIN_OP := lastday(dDataBase)
(cAliasK290)->COD_DOC_OP := '000001'
MsUnLock ()
Return
Static Function GK291(cAliasK291,cProd1,cProd2)
RecLock (cAliasK291, .T.)
(cAliasK291)->FILIAL := cFilAnt
(cAliasK291)->REG := 'K291'
(cAliasK291)->COD_DOC_OP:= '000001'
(cAliasK291)->COD_ITEM :=cProd2
(cAliasK291)->QTD := 1
MsUnLock ()
Return
Static Function GK292(cAliasK292,cProd1,cProd2)
RecLock (cAliasK292, .T.)
(cAliasK292)->FILIAL := cFilAnt
(cAliasK292)->REG := 'K292'
(cAliasK292)->COD_DOC_OP:= '000001'
(cAliasK292)->COD_ITEM :=cProd1
(cAliasK292)->QTD := 1
MsUnLock ()
Return
Static Function GK300(cAliasK300,cProd1,cProd2)
RecLock (cAliasK300, .T.)
(cAliasK300)->FILIAL := cFilAnt
(cAliasK300)->CHAVE := '00000001'
(cAliasK300)->REG := 'K300'
(cAliasK300)->DT_PROD:= lastday(dDataBase, 1 )
MsUnLock ()
Return
Static Function GK301(cAliasK301,cProd1,cProd2)
RecLock (cAliasK301, .T.)
(cAliasK301)->FILIAL := cFilAnt
(cAliasK301)->REG := 'K301'
(cAliasK301)->CHAVE := '00000001'
(cAliasK301)->COD_ITEM:= cProd2
(cAliasK301)->QTD := 1
MsUnLock ()
Return
Static Function GK302(cAliasK302,cProd1,cProd2)
RecLock (cAliasK302, .T.)
(cAliasK302)->FILIAL := cFilAnt
(cAliasK302)->REG := 'K302'
(cAliasK302)->CHAVE := '00000001'
(cAliasK302)->COD_ITEM:= cProd1
(cAliasK302)->QTD := 1
MsUnLock ()
Return
|