<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{96,17,1019,696}</property>
    <property name="Name">[planos.scr]</property>
    <property name="Caption">[Planos de Pagamento]</property>
    <property name="AlwaysOnTop">.F.</property>
    <property name="AutoCenter">.T.</property>
    <property name="Font">
      <font name="Verdana" width="0" height="-13" weight="400"/>
    </property>
    <property name="FormType">[dlgModal]</property>
    <property name="Modal">.F.</property>
    <property name="ScopeVarObj">[Private]</property>
    <property name="lClipper">.T.</property>
    <property name="lExitOnEnter">.F.</property>
    <property name="lExitOnESC">.T.</property>
    <property name="FromStyle">[Center]</property>
    <property name="Clipsiblings">.F.</property>
    <property name="Clipchildren">.F.</property>
    <property name="TitleBar">.T.</property>
    <property name="StyleBorder">[3 - Sizable (Default)]</property>
    <property name="nBackColor">14215660</property>
    <property name="Icon">[]</property>
    <property name="Bitmap">[icon\tela.jpg]</property>
    <property name="NoIcon">.F.</property>
    <property name="SystemMenu">.T.</property>
    <property name="Minimizebox">.F.</property>
    <property name="Maximizebox">.T.</property>
    <property name="AbsAlignment">.T.</property>
    <property name="WindowState">[1 - Normal (Default)]</property>
    <property name="minHeight">-1</property>
    <property name="maxHeight">-1</property>
    <property name="minWidth">-1</property>
    <property name="maxWidth">-1</property>
    <property name="ScrollBars">[0 - None (Default)]</property>
    <property name="DSControl">.F.</property>
  </style>
  <method name="onDlgInit">
    <![CDATA[PARAMETERS oDlg

//skel VARIAVEL zbExpande = {||wFiltraParcelas:=.f.,DbClearFilter(),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
//skel VARIAVEL zbFormaDiv = {||if(fParcFinal=fParcInic,"","ate "+Str(fParcFinal,3)+" x "+lTrim(Transform(cr_valor/fParcFinal,"@e 999,999.99")))}
//skel VARIAVEL zbFormaDivPend = {||if(fParcFinal=fParcInic,"","ate "+Str(fParcFinal,3)+" x "+lTrim(Transform(wValPendenteDePagamento/fParcFinal,"@e 999,999.99")))}

//skel VARIAVEL zbFechaSemDsc:={||(ProcessaEscolhaDaListaDePlanos(.f.),(wFgConfirmouVenda.and.(hwg_oDlgKey(oDlg,27,nBrwAtivo),.t.)))}
//skel VARIAVEL zbFechaComDsc:={||(ProcessaEscolhaDaListaDePlanos(),(wFgConfirmouVenda.and.(hwg_oDlgKey(oDlg,27,nBrwAtivo),.t.)))}

//skel VARIAVEL wValCreditos := m_fValDev+m_fAvalPago 
//skel VARIAVEL wValPendenteAoEntrar:=IF(wFgLocacao.or.wFgRetornoLocacao,m_fValLoca,m_fVal-wValCreditos)
//skel VARIAVEL wValPendenteDePagamento:=wValPendenteAoEntrar
//skel VARIAVEL m_cp_val_lqd:=0
//skel VARIAVEL m_cr_saldo:=0

//skel VARIAVEL wfValES:=0
//skel VARIAVEL wfValCH:=0
//skel VARIAVEL wfValCT:=0
//skel VARIAVEL wfValCV:=0
//skel VARIAVEL wfValCA:=0
//skel VARIAVEL wValEntradaDoPlano := 0

//skel VARIAVEL m_cp_valor:=wValPendenteAoEntrar
//skel VARIAVEL m_cp_val_lqd:=0
//skel VARIAVEL m_cr_saldo:=wValPendenteAoEntrar
//skel VARIAVEL m_cr_dt_venc:=s_datual
//skel VARIAVEL wFgSaoParcelasDeUmPlano:=.t.
////skel VARIAVEL oTimerParcelamento

oContextMenu:=Hwg_ContextMenu()
//hwg_Btn(oToolbar,190,91,120,105)
//hwg_TbMt(oToolbar,' 22;GetInfoParcRec(D_OB,"ES");Ins-Especie ;Ins-Recebimento em ESPECIE;vda00pp_dinheiro.jpg;;;Lucida Bright;-14;<Ins> F1-&Especie;')
//hwg_TbMt(oToolbar,' 67;GetInfoParcRec(D_OB,"CT");C-Cartao ;C-Recebimento em CARTAO;vda00pp_cartoes.jpg;;;Lucida Bright;-14;F2-&Cartao;')
//hwg_TbMt(oToolbar,' 72;GetInfoParcRec(D_OB,"CH");H-Cheque ;H-Recebimento em CHEQUE;vda00pp_cheque.jpg;;;Lucida Bright;-14;F3-C&heque;')
//hwg_TbMt(oToolbar,' 86;GetInfoParcRec(D_OB,"CV");V-Convenio ;V-Recebimento em CONVENIO;vda00pp_convenio.jpg;;;Lucida Bright;-14;F4-Con&venio;')
//hwg_TbMt(oToolbar,' 65;GetInfoParcRec(D_OB,"CA");A-Carne ;A-Recebimento em CARNE;vda00pp_pmixto.jpg;;;Lucida Bright;-14;F5-C&arne;')

wFgDisporBotoesNaHorizontal:=.t.  // a barra vertical serta funcoes diretas
hwg_Btn(oPanelToolbar,0,0,80,80)

hwg_ToolBtn('65;fpagrec->(EditaParcelaRecebimento(cr_tip_dup));A-Altera;Altera Lancamento de Pagamento;xml\icon\ico_pdv_altera.ico;48;48;Segoe UI Emoji;-10;&A-Altera;;;', oPanelToolbar)
hwg_ToolBtn('7;fpagrec->(EditaParcelaRecebimento(cr_tip_dup,"DEL"));Del-Apaga;Exclui Lancamento de Pagamento;xml\icon\ico_pdv_apaga.ico;48;48;Segoe UI Emoji;-10;Del-Apaga;;;', oPanelToolbar)
hwg_ToolBtn('66;Obs_pn();B-Observacao;Incluir Observacao na Venda;xml\icon\ico_pdv_obs.ico;48;48;Segoe UI Emoji;-10;&B-Observacao;;;', oPanelToolbar)
hwg_ToolBtn('71;Senhad();G-Gerencial;Acessa Funcao Gerencial;xml\icon\ico_pdv_senha.ico;48;48;Segoe UI Emoji;-10;&G-Gerente;;;', oPanelToolbar)
hwg_ToolBtn('68;PAF_DadosConsumidor();D-Consumidor;Inclui dados do Consumidor CPF e Nome;xml\icon\ico_pdv_dados.ico;48;48;Segoe UI Emoji;-10;&D-Consumidor;;;', oPanelToolbar)
hwg_ToolBtn('89;MudaParaTV();Y-Delivery;Marca Venda para Entrega a Domicilio;xml\icon\ico_pdv_delivery.ico;48;48;Segoe UI Emoji;-10;&Y-Delivery;;;', oPanelToolbar)
//hwg_ToolBtn('65;GetCaucao("GetValorAdiantado");A-Adiantamento;Registra Adiantamento ou Caucao de Cliente;xml\icon\ico_pdv_caucao.ico;32;32;Segoe UI Emoji;-10;&A-Caucao;;;', oPanelToolbar)
IF xGetEnv("FATURA_COM_ABATIMENTOS")="S"
     hwg_ToolBtn('65;Compl_Abat();M-Abatimentos;M-Registra Descontos Adicionais a Vista ou a Prazo;xml\icon\ico_pdv_abat.ico;48;48;Segoe UI Emoji;-10;&M-Abatimentos;;;', oPanelToolbar)
ENDIF
hwg_ToolBtn('27;ConfirmeCancelarVenda();Saida;Saida;xml\icon\ico_pdv_sair.ico;48;48;Segoe UI Emoji;-10;Esc-Sair;;;', oPanelToolbar)

d_ob:lEditable = .f. 

// hwg_TbMt(oToolbar,'27;hwg_oDlgKey(oDlg, 27, nBrwAtivo);Saida;Saida;sembitmap;;;Lucida Bright;-10;&Esc-Sair;')
// hwg_Btn(oToolbar,662,137,64,24)

SetDlgKey(oDlg,8,26,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"UP"))})
SetDlgKey(oDlg,8,28,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"DOWN"))})
Hwg_EndMenu()

//IF m_fValDev+m_fAvalPago=0
//   oLabelDevolucao:Hide()
//endif

CiSetKey( "K_F1","(wfValES:=m_Cr_saldo, owfValES:SETFOCUS(),RefreshGetlist())",,,"F1:Entrada em Dinheiro")
CiSetKey( "K_F2","(wfValCT:=m_Cr_saldo, owfValCT:SETFOCUS(),RefreshGetlist())",,,"F2:Entrada em Cartao")
CiSetKey( "K_F3","(wfValCH:=m_Cr_saldo, owfValCH:SETFOCUS(),RefreshGetlist())",,,"F3:Entrada em Cheques")
CiSetKey( "K_F4","(wfValCV:=m_Cr_saldo, owfValCV:SETFOCUS(),RefreshGetlist())",,,"F4:Entrada em Convenio")
CiSetKey( "K_F8","if(m_cp_val_lqd>0,Alert('Essa opcao so pode ser usada antes de iniciar recebimento!'),( oContainerDica:hide() , oContainerDescontos:show(), ofpercdesc:SETFOCUS() ))",,,"F8:Descontos")

ofValPago:SETFOCUS()

oContainerDescontos:Hide()
oContainerDica:Move(oContainerDescontos:nLeft,oContainerDescontos:nTop)
]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,666,1019,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="container">
    <style>
      <property name="Geometry">{8,131,554,70}</property>
      <property name="Name">[oContainerDescontos]</property>
      <property name="TabIndex">0</property>
    </style>
    <part class="editbox">
      <style>
        <property name="Geometry">{16,154,122,41}</property>
        <property name="Name">[ofpercdesc]</property>
        <property name="varName">[m_fpercdesc]</property>
        <property name="font">
          <font name="Segoe UI" width="0" height="-24" weight="700"/>
        </property>
        <property name="cPicture">[@E 99.99]</property>
        <property name="TabIndex">20</property>
      </style>
      <method name="onLostFocus">
        <![CDATA[.F.]]>
      </method>
    </part>
    <part class="editbox">
      <style>
        <property name="Geometry">{140,154,122,41}</property>
        <property name="Name">[ofdesconto]</property>
        <property name="varName">[m_fdesconto]</property>
        <property name="font">
          <font name="Segoe UI" width="0" height="-24" weight="700"/>
        </property>
        <property name="cPicture">[@E 99,9999.99]</property>
        <property name="TabIndex">21</property>
      </style>
      <method name="onGetFocus">
        <![CDATA[.F.]]>
      </method>
    </part>
    <part class="editbox">
      <style>
        <property name="Geometry">{264,154,122,41}</property>
        <property name="Name">[oFacrescimo]</property>
        <property name="varName">[m_facrescimo]</property>
        <property name="font">
          <font name="Segoe UI" width="0" height="-24" weight="700"/>
        </property>
        <property name="cPicture">[@E 99,9999.99]</property>
        <property name="TabIndex">22</property>
      </style>
      <method name="onGetFocus">
        <![CDATA[.f.]]>
      </method>
    </part>
    <part class="editbox">
      <style>
        <property name="Geometry">{388,154,156,41}</property>
        <property name="Name">[ofValLiquido]</property>
        <property name="varName">[m_fValLiquido]</property>
        <property name="font">
          <font name="Segoe UI" width="0" height="-24" weight="700"/>
        </property>
        <property name="cPicture">[@E 999,999.99]</property>
        <property name="TabIndex">23</property>
      </style>
      <method name="onGetFocus">
        <![CDATA[.f.]]>
      </method>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{16,135,120,19}</property>
        <property name="Name">[oLabel2]</property>
        <property name="Caption">[% Desconto]</property>
        <property name="font">
          <font name="Segoe UI Emoji" width="0" height="-13" weight="400"/>
        </property>
        <property name="Transparent">.T.</property>
        <property name="TabIndex">45</property>
      </style>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{140,135,122,19}</property>
        <property name="Name">[oLabel3]</property>
        <property name="Caption">[Valor do Desconto]</property>
        <property name="font">
          <font name="Segoe UI Emoji" width="0" height="-13" weight="400"/>
        </property>
        <property name="Transparent">.T.</property>
        <property name="TabIndex">46</property>
      </style>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{388,135,155,19}</property>
        <property name="Name">[oLabel4]</property>
        <property name="Caption">[Valor Liquido]</property>
        <property name="font">
          <font name="Segoe UI Emoji" width="0" height="-13" weight="400"/>
        </property>
        <property name="Transparent">.T.</property>
        <property name="TabIndex">47</property>
      </style>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{264,135,122,19}</property>
        <property name="Name">[oLabel8]</property>
        <property name="Caption">[TAC]</property>
        <property name="font">
          <font name="Segoe UI Emoji" width="0" height="-13" weight="400"/>
        </property>
        <property name="Transparent">.T.</property>
        <property name="TabIndex">53</property>
      </style>
    </part>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{564,89,448,260}</property>
      <property name="Name">[d_Ob]</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-21" weight="700"/>
      </property>
      <property name="BackColor">15791615</property>
      <property name="GridLinesSepColor">0</property>
      <property name="TabIndex">0</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onInit">
      <![CDATA[hwg_TbFi(D_oB, 'FPg;CR_TIP_DUP;C;xx;  3;;')
hwg_TbFi(D_oB, 'Valor;CR_VALOR;N;@E 999,999.99; 10;;')
hwg_TbFi(D_oB, 'Descricao;Cr_Obs;C;@S50; 50;;')
D_oB:bColorSel:= RGB(3,23,133)
D_oB:tColorSel:= RGB(255,255,255)
D_oB:Alias := alias()
D_oB:lDisableVScrollPos := .t.
D_oB:bKeyDown := {|self, wParam| (aBrowses[nBrwAtivo,2])->(hwg_oDlgKey(self, wparam,1)) , .T. }
D_oB:bOther:={|o,m,wp,lp| MessagesBrowse(o,m,wp,lp)}
D_oB:cargo:={.T.,.T.,"FPAGREC",.F.,.T.,{||.T.} }
// A tecla Enter foi associada ao botao acima... neste caso tem de definir a ::bEdit para nao fazer nada
// Voce indicaria na bedit uma funcao qualquer caso desejasse executar uma funcao para o enter sem usar botao
// d_ob:bEdit := {|D_oB| alert("esta no bloco enter"), nKey:=13, EditaParcelaRecebimento(cr_tip_dup)}
d_ob:bEdit := {|| .t.} 
d_ob:lEditable = .f.
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})
]]>
    </method>
  </part>
  <part class="panel">
    <style>
      <property name="Geometry">{453,7,560,80}</property>
      <property name="Name">[oPanelToolbar]</property>
    </style>
    <method name="onSize">
      <![CDATA[//PARAMETERS o,x,y
// MoveWindow(o:handle,0,0,x,o:nHeight)]]>
    </method>
  </part>
  <part class="container">
    <style>
      <property name="Geometry">{1031,144,554,70}</property>
      <property name="Name">[oContainerDica]</property>
      <property name="TabIndex">0</property>
    </style>
    <part class="label">
      <style>
        <property name="Geometry">{1034,147,548,64}</property>
        <property name="Name">[oLabel14]</property>
        <property name="Caption">[Informe as Formas de Recebimento]</property>
        <property name="Justify">[Center]</property>
        <property name="BackColor">15791615</property>
        <property name="font">
          <font name="Segoe UI Emoji" width="0" height="-32" weight="400" italic="255"/>
        </property>
        <property name="TabIndex">55</property>
      </style>
    </part>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{249,214,297,70}</property>
      <property name="Name">[owfValES]</property>
      <property name="varName">[wfValES]</property>
      <property name="TextColor">8404992</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-48" weight="700"/>
      </property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="ToolTip">
[Informe valor da Entrada em Dinheiro, se existir]      </property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[IF wfValES<0
   ALERT("A entrada em especie nao pode ser negativa!")
   RETURN .f.
ENDIF
m_fPlanoPag:=if(m_Cp_Val_Lqd>0, 5, 1)
RETURN wfValES=0.OR.(GetInfoParcRec(D_OB, "ES",,wfValES) .AND. (wfValES:=0, RefreshGetList().AND.DobRefresh()))
]]>
    </method>
    <method name="onGetFocus">
      <![CDATA[wfValES:=m_Cr_saldo
RETURN m_Cr_saldo>0 .AND. RefreshGetList()

]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{249,285,297,70}</property>
      <property name="Name">[owfValCT]</property>
      <property name="varName">[wfValCT]</property>
      <property name="TextColor">4210688</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-48" weight="700"/>
      </property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="ToolTip">[Informe aqui Valor de Entrada em CARTAO]</property>
      <property name="TabIndex">5</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[IF wfValCT<0
   ALERT("Voce nao deve informar numero negativo aqui!")
   RETURN .f.
ENDIF
m_fPlanoPag:=if(m_Cp_Val_Lqd>0, 5, 2)
RETURN wfValCT=0.OR.(GetInfoParcRec(D_OB,"CT",,wfValCT) .AND. (wfValCT:=0, RefreshGetList().AND.DobRefresh()))

]]>
    </method>
    <method name="onGetFocus">
      <![CDATA[// wfValCT:=m_Cr_saldo
RETURN m_Cr_saldo>0 .AND. RefreshGetList()
]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{249,356,297,70}</property>
      <property name="Name">[owfValCH]</property>
      <property name="varName">[wfValCH]</property>
      <property name="TextColor">16512</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-48" weight="700"/>
      </property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="ToolTip">[Informe aqui valor de entrada em CHEQUES]</property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[IF wfValCH<0
   ALERT("A entrada em Cheques nao pode ser negativa!")
   RETURN .f.
ENDIF
m_fPlanoPag:=if(m_Cp_Val_Lqd>0, 5, 3)
RETURN wfValCH=0.OR.(GetInfoParcRec(D_OB,"CH",,wfValCH) .AND. (wfValCH:=0, RefreshGetList().AND.DobRefresh()))
]]>
    </method>
    <method name="onGetFocus">
      <![CDATA[// wfValCH:=m_Cr_saldo
RETURN m_Cr_saldo>0 .AND. RefreshGetList()
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{587,470,148,35}</property>
      <property name="Name">[oLabel10]</property>
      <property name="Caption">[PENDENTE:]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">255</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-21" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">6</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{249,427,297,70}</property>
      <property name="Name">[owfValCV]</property>
      <property name="varName">[wfValCV]</property>
      <property name="TextColor">64</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-48" weight="700"/>
      </property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="ToolTip">
[Informe aqui valor a lancar diretamente na conta a prazo do Cliente]      </property>
      <property name="TabIndex">7</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[IF wfValCV<0
   ALERT("A entrada em Convenio nao pode ser negativa!")
   RETURN .f.
ENDIF
m_fPlanoPag:=if(m_Cp_Val_Lqd>0, 5, 4)
RETURN wfValCV=0.OR.(GetInfoParcRec(D_OB,"CV",,wfValCV) .AND. (wfValCV:=0, RefreshGetList().AND.DobRefresh()))
]]>
    </method>
    <method name="onGetFocus">
      <![CDATA[// wfValCV:=m_Cr_saldo
RETURN m_Cr_saldo>0 .AND. RefreshGetList()
]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{737,407,268,53}</property>
      <property name="Name">[oCp_Val_Lqd]</property>
      <property name="varName">[m_Cp_Val_Lqd]</property>
      <property name="TextColor">16384</property>
      <property name="font">
        <font name="Arial" width="0" height="-48" weight="700"/>
      </property>
      <property name="Justify">[Right]</property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="Border">.F.</property>
      <property name="TabIndex">8</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{737,461,268,53}</property>
      <property name="Name">[oCr_Saldo]</property>
      <property name="varName">[m_Cr_saldo]</property>
      <property name="TextColor">255</property>
      <property name="Transparent">.T.</property>
      <property name="font">
        <font name="Arial" width="0" height="-48" weight="700"/>
      </property>
      <property name="Justify">[Right]</property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="Border">.F.</property>
      <property name="TabIndex">9</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{34,525,377,75}</property>
      <property name="Name">[ofvalpago]</property>
      <property name="varName">[m_fvalpago]</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-48" weight="700"/>
      </property>
      <property name="cPicture">[@E 999,999.99]</property>
      <property name="TabIndex">24</property>
    </style>
    <method name="onLostFocus">
      <![CDATA[m_ftroco:=m_fvalpago-m_fValLiquido
OFTROCO:Refresh()
// RETURN IF(m_cr_saldo>0, (owfValES:SETFOCUS(),.t.), (M_FVALPAGO>=M_FVAL-M_FDESCONTO+M_MFACRESCIMO).AND.CRIT_FDESCONTO("VPG",M_FVALPAGO) )
RETURN (M_FVALPAGO>=M_FVAL-M_FDESCONTO+M_MFACRESCIMO).AND.CRIT_FDESCONTO("VPG",M_FVALPAGO)

]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{412,515,377,85}</property>
      <property name="Name">[oFtroco]</property>
      <property name="varName">[m_Ftroco]</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-64" weight="700"/>
      </property>
      <property name="Justify">[Center]</property>
      <property name="cPicture">[@E 999,999.99]</property>
      <property name="Border">.F.</property>
      <property name="TabIndex">25</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.F.]]>
    </method>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{961,592,50,50}</property>
      <property name="Name">[oButtonex3]</property>
      <property name="Id">[IDOK]</property>
      <property name="Caption">[&amp;O]</property>
      <property name="Anchor">9</property>
      <property name="TextColor">4194304</property>
      <property name="font">
        <font name="Arial" width="0" height="-1" weight="700"/>
      </property>
      <property name="Bitmap">[icon\confirmar2.jpg]</property>
      <property name="ToolTip">[Confirmar Cadastro ou Alteracao]</property>
      <property name="TabIndex">25</property>
    </style>
  </part>
  <part class="buttonex">
    <style>
      <property name="Geometry">{910,592,50,50}</property>
      <property name="Name">[oButtonex4]</property>
      <property name="Id">[IDCANCEL]</property>
      <property name="Caption">[]</property>
      <property name="Anchor">9</property>
      <property name="TextColor">4194304</property>
      <property name="font">
        <font name="Arial" width="0" height="-1" weight="400"/>
      </property>
      <property name="Bitmap">[icon\cancelar2.jpg]</property>
      <property name="ToolTip">[Sair ou Cancelar Alteracao]</property>
      <property name="TabIndex">26</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{737,351,268,53}</property>
      <property name="Name">[ofval]</property>
      <property name="_InitValue">[89.10]</property>
      <property name="varName">[m_fval]</property>
      <property name="font">
        <font name="Arial" width="0" height="-48" weight="700"/>
      </property>
      <property name="Justify">[Right]</property>
      <property name="cPicture">[@e 999,999.99]</property>
      <property name="Border">.F.</property>
      <property name="TabIndex">30</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[.f.]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{64,227,182,55}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Dinheiro]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">8404992</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-37" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">41</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{64,298,182,55}</property>
      <property name="Name">[oLabel3]</property>
      <property name="Caption">[Cartao]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">4210688</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-37" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">41</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{64,369,182,55}</property>
      <property name="Name">[oLabel4]</property>
      <property name="Caption">[Cheques]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">16512</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-37" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">41</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{64,440,182,55}</property>
      <property name="Name">[oLabel5]</property>
      <property name="Caption">[Convenio]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">64</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-37" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">41</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{587,419,148,35}</property>
      <property name="Name">[oLabel6]</property>
      <property name="Caption">[RECEBIDO:]</property>
      <property name="Justify">[Right]</property>
      <property name="TextColor">16384</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-21" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">41</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{453,100,110,23}</property>
      <property name="Name">[oLabel15]</property>
      <property name="Caption">[[F8] - Desconto]</property>
      <property name="Justify">[Center]</property>
      <property name="TextColor">8404992</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-13" weight="400" italic="255"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">41</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{22,227,57,55}</property>
      <property name="Name">[oLabel9]</property>
      <property name="Caption">[F1]</property>
      <property name="Justify">[Center]</property>
      <property name="Anchor">3</property>
      <property name="TextColor">8404992</property>
      <property name="font">
        <font name="Segoe WP" width="0" height="-37" weight="700" italic="255"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">45</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{22,298,57,55}</property>
      <property name="Name">[oLabel11]</property>
      <property name="Caption">[F2]</property>
      <property name="Justify">[Center]</property>
      <property name="Anchor">3</property>
      <property name="TextColor">4210688</property>
      <property name="font">
        <font name="Segoe WP" width="0" height="-37" weight="700" italic="255"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">45</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{22,369,57,55}</property>
      <property name="Name">[oLabel12]</property>
      <property name="Caption">[F3]</property>
      <property name="Justify">[Center]</property>
      <property name="Anchor">3</property>
      <property name="TextColor">16512</property>
      <property name="font">
        <font name="Segoe WP" width="0" height="-37" weight="700" italic="255"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">45</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{22,440,57,55}</property>
      <property name="Name">[oLabel13]</property>
      <property name="Caption">[F4]</property>
      <property name="Justify">[Center]</property>
      <property name="Anchor">3</property>
      <property name="TextColor">64</property>
      <property name="font">
        <font name="Segoe WP" width="0" height="-37" weight="700" italic="255"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">45</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{34,602,377,37}</property>
      <property name="Name">[oLabel16]</property>
      <property name="Caption">[Valor Pago]</property>
      <property name="Justify">[Center]</property>
      <property name="BackColor">8454016</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-21" weight="700"/>
      </property>
      <property name="TabIndex">48</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{412,602,377,37}</property>
      <property name="Name">[oLabel17]</property>
      <property name="Caption">[TROCO]</property>
      <property name="Justify">[Center]</property>
      <property name="BackColor">13031935</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-21" weight="700"/>
      </property>
      <property name="TabIndex">48</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{566,363,169,35}</property>
      <property name="Name">[oLabel7]</property>
      <property name="Caption">[Total A Receber:]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Segoe UI Emoji" width="0" height="-21" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">51</property>
    </style>
  </part>
  <part class="group">
    <style>
      <property name="Geometry">{6,4,446,125}</property>
      <property name="Name">[oGroup1]</property>
      <property name="Caption">[SubTotal dos Produtos/Serviços]</property>
      <property name="Transparent">.T.</property>
      <property name="font">
        <font name="Segoe UI" width="0" height="-16" weight="400"/>
      </property>
      <property name="TabIndex">54</property>
    </style>
    <method name="onPaint">
      <![CDATA[PARAMETERS oDlg

//skel VARIAVEL zbExpande = {||wFiltraParcelas:=.f.,DbClearFilter(),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
//skel VARIAVEL zbFormaDiv = {||if(fParcFinal=fParcInic,"","ate "+Str(fParcFinal,3)+" x "+lTrim(Transform(cr_valor/fParcFinal,"@e 999,999.99")))}
//skel VARIAVEL zbFormaDivPend = {||if(fParcFinal=fParcInic,"","ate "+Str(fParcFinal,3)+" x "+lTrim(Transform(wValPendenteDePagamento/fParcFinal,"@e 999,999.99")))}

//skel VARIAVEL zbFechaSemDsc:={||(ProcessaEscolhaDaListaDePlanos(.f.),(wFgConfirmouVenda.and.(hwg_oDlgKey(oDlg,27,nBrwAtivo),.t.)))}
//skel VARIAVEL zbFechaComDsc:={||(ProcessaEscolhaDaListaDePlanos(),(wFgConfirmouVenda.and.(hwg_oDlgKey(oDlg,27,nBrwAtivo),.t.)))}

//skel VARIAVEL wValCreditos := m_fValDev+m_fAvalPago 
//skel VARIAVEL wValPendenteAoEntrar:=IF(wFgLocacao.or.wFgRetornoLocacao,m_fValLoca,m_fVal-wValCreditos)
//skel VARIAVEL wValPendenteDePagamento:=wValPendenteAoEntrar
//skel VARIAVEL m_cp_val_lqd:=0
//skel VARIAVEL m_cr_saldo:=0

//skel VARIAVEL wfValES:=0
//skel VARIAVEL wfValCH:=0
//skel VARIAVEL wfValCT:=0
//skel VARIAVEL wfValCV:=0
//skel VARIAVEL wfValCA:=0
//skel VARIAVEL wValEntradaDoPlano := 0

//skel VARIAVEL m_cp_valor:=wValPendenteAoEntrar
//skel VARIAVEL m_cp_val_lqd:=0
//skel VARIAVEL m_cr_saldo:=wValPendenteAoEntrar
//skel VARIAVEL m_cr_dt_venc:=s_datual
//skel VARIAVEL wFgSaoParcelasDeUmPlano:=.t.
////skel VARIAVEL oTimerParcelamento

oContextMenu:=Hwg_ContextMenu()
//hwg_Btn(oToolbar,190,91,120,105)
//hwg_TbMt(oToolbar,' 22;GetInfoParcRec(D_OB,"ES");Ins-Especie ;Ins-Recebimento em ESPECIE;vda00pp_dinheiro.jpg;;;Lucida Bright;-14;<Ins> F1-&Especie;')
//hwg_TbMt(oToolbar,' 67;GetInfoParcRec(D_OB,"CT");C-Cartao ;C-Recebimento em CARTAO;vda00pp_cartoes.jpg;;;Lucida Bright;-14;F2-&Cartao;')
//hwg_TbMt(oToolbar,' 72;GetInfoParcRec(D_OB,"CH");H-Cheque ;H-Recebimento em CHEQUE;vda00pp_cheque.jpg;;;Lucida Bright;-14;F3-C&heque;')
//hwg_TbMt(oToolbar,' 86;GetInfoParcRec(D_OB,"CV");V-Convenio ;V-Recebimento em CONVENIO;vda00pp_convenio.jpg;;;Lucida Bright;-14;F4-Con&venio;')
//hwg_TbMt(oToolbar,' 65;GetInfoParcRec(D_OB,"CA");A-Carne ;A-Recebimento em CARNE;vda00pp_pmixto.jpg;;;Lucida Bright;-14;F5-C&arne;')

wFgDisporBotoesNaHorizontal:=.t.  // a barra vertical serta funcoes diretas
hwg_Btn(oPanelToolbar,0,0,36,36)

hwg_ToolBtn('65;fpagrec->(EditaParcelaRecebimento(cr_tip_dup));A-Altera;Altera Lancamento de Pagamento;xml\icon\ico_pdv_altera.ico;32;32;Segoe UI Emoji;-10;&A-Altera;;;', oPanelToolbar)
hwg_ToolBtn('7;fpagrec->(EditaParcelaRecebimento(cr_tip_dup,"DEL"));Del-Apaga;Exclui Lancamento de Pagamento;xml\icon\ico_pdv_apaga.ico;32;32;Segoe UI Emoji;-10;Del-Apaga;;;', oPanelToolbar)
hwg_ToolBtn('27;ConfirmeCancelarVenda();Saida;Saida;xml\icon\ico_pdv_apaga.ico;32;32;Segoe UI Emoji;-10;Esc-Sair;;;', oPanelToolbar)
hwg_ToolBtn('66;Obs_pn();B-Observacao;Incluir Observacao na Venda;xml\icon\ico_pdv_obs.ico;32;32;Segoe UI Emoji;-10;&B-Observacao;;;', oPanelToolbar)
hwg_ToolBtn('71;Senhad();G-Gerencial;Acessa Funcao Gerencial;xml\icon\ico_pdv_senha.ico;32;32;Segoe UI Emoji;-10;&G-Gerente;;;', oPanelToolbar)
hwg_ToolBtn('68;PAF_DadosConsumidor();D-Consumidor;Inclui dados do Consumidor CPF e Nome;xml\icon\ico_pdv_dados.ico;32;32;Segoe UI Emoji;-10;&D-Consumidor;;;', oPanelToolbar)
hwg_ToolBtn('89;MudaParaTV();Y-Delivery;Marca Venda para Entrega a Domicilio;xml\icon\ico_pdv_delivery.ico;32;32;Segoe UI Emoji;-10;&Y-Delivery;;;', oPanelToolbar)


d_ob:lEditable = .f. 

hwg_Btn(oToolbar,600,390)
hwg_TbMt(oToolbar,'65;GetCaucao("GetValorAdiantado");A-Adiantamento ;A-Registra Adiantamento ou Caucao de Cliente;sembitmap;;;Lucida Bright;-10;&A-Caucao;')

IF xGetEnv("FATURA_COM_ABATIMENTOS")="S"
   hwg_TbMt(oToolbar,'65;Compl_Abat();M-Abatimentos ;M-Registra Descontos Adicionais a Vista ou a Prazo;sembitmap;;;Lucida Bright;-10;&M-Abatimentos;')
ENDIF

// hwg_TbMt(oToolbar,'27;hwg_oDlgKey(oDlg, 27, nBrwAtivo);Saida;Saida;sembitmap;;;Lucida Bright;-10;&Esc-Sair;')
// hwg_Btn(oToolbar,662,137,64,24)
SetDlgKey(oDlg,8,26,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"UP"))})
SetDlgKey(oDlg,8,28,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"DOWN"))})
Hwg_EndMenu()

//IF m_fValDev+m_fAvalPago=0
//   oLabelDevolucao:Hide()
//endif

CiSetKey( "K_F1","(wfValES:=m_Cr_saldo, owfValES:SETFOCUS(),RefreshGetlist())",,,"F1:Entrada em Dinheiro")
CiSetKey( "K_F2","(wfValCT:=m_Cr_saldo, owfValCT:SETFOCUS(),RefreshGetlist())",,,"F2:Entrada em Cartao")
CiSetKey( "K_F3","(wfValCH:=m_Cr_saldo, owfValCH:SETFOCUS(),RefreshGetlist())",,,"F3:Entrada em Cheques")
CiSetKey( "K_F4","(wfValCV:=m_Cr_saldo, owfValCV:SETFOCUS(),RefreshGetlist())",,,"F4:Entrada em Convenio")
// CiSetKey( "K_F5","(wfValCA:=m_Cr_saldo, owfValCA:SETFOCUS(),RefreshGetlist())",,,"F6:Entrada em Carne")

ofValPago:SETFOCUS()
]]>
    </method>
    <part class="editbox">
      <style>
        <property name="Geometry">{15,27,417,62}</property>
        <property name="Name">[ofValProd]</property>
        <property name="varName">[m_fValProd]</property>
        <property name="TextColor">6908265</property>
        <property name="font">
          <font name="Segoe UI" width="0" height="-48" weight="700"/>
        </property>
        <property name="cPicture">[@e 999,999.99]</property>
        <property name="Border">.F.</property>
        <property name="ToolTip">
[Informe aqui valor a lancar diretamente na conta a prazo do Cliente]        </property>
        <property name="TabIndex">1</property>
      </style>
      <method name="onGetFocus">
        <![CDATA[.f.]]>
      </method>
    </part>
    <part class="editbox">
      <style>
        <property name="Geometry">{299,93,133,26}</property>
        <property name="Name">[owValCreditos]</property>
        <property name="varName">[wValCreditos]</property>
        <property name="font">
          <font name="Segoe UI" width="0" height="-19" weight="400"/>
        </property>
        <property name="cPicture">[@e 999,999.99]</property>
        <property name="Border">.F.</property>
        <property name="ToolTip">
[Informe aqui valor a lancar diretamente na conta a prazo do Cliente]        </property>
        <property name="TabIndex">2</property>
      </style>
      <method name="onGetFocus">
        <![CDATA[.f.]]>
      </method>
    </part>
    <part class="label">
      <style>
        <property name="Geometry">{71,96,225,23}</property>
        <property name="Name">[oLabelDevolucao]</property>
        <property name="Caption">[Creditos Dev/NC:]</property>
        <property name="Justify">[Right]</property>
        <property name="font">
          <font name="Segoe UI Emoji" width="0" height="-13" weight="400"/>
        </property>
        <property name="Transparent">.T.</property>
        <property name="TabIndex">41</property>
      </style>
    </part>
  </part>
</part>
