-
Notifications
You must be signed in to change notification settings - Fork 0
/
MT120OK .prw
49 lines (31 loc) · 902 Bytes
/
MT120OK .prw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#INCLUDE "TOTVS.ch"
#INCLUDE "rwmake.ch"
#INCLUDE "TBICONN.ch"
#INCLUDE "FWMVCDEF.CH"
/*/{Protheus.doc} MT120OK -
Validações Específicas de Usuário
@type function
@version 1.0
@author Joao
@since 6/28/2024
@return lRet
@See https://tdn.totvs.com/pages/releaseview.action?pageId=6085483
/*/
User Function MT120OK()
Local lRet := .T. // Conteúdo de retorno
Local nX := 1
CT1->(DBSetOrder(1))
If INCLUI .Or. ALTERA
If nTipoPed == 1
If CT1->(DBSeek(xFilial("CT1")+aCols[nX,GDFieldPos("C7_CONTA")])) .And. CT1->CT1_CCOBRG == "1"
for nX:=1 to len(aCols)
If Empty(aCols[nX,GDFieldPos("C7_CC",aHeader)])
MsgStop("Não é permitido incluir/alterar um pedido do tipo 'N' sem informar o centro de custo (C7_CC).")
lRet := .F.
Exit
EndIf
Next nX
EndIf
EndIf
EndIf
Return(lRet)