<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{293,30,1024,656}</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 zbFechaSemDsc:={||(ProcessaEscolhaDaListaDePlanos(.f.),(wFgConfirmouVenda.and.(hwg_oDlgKey(oDlg,27,nBrwAtivo),.t.)))}
//skel VARIAVEL zbFechaComDsc:={||(ProcessaEscolhaDaListaDePlanos(),(wFgConfirmouVenda.and.(hwg_oDlgKey(oDlg,27,nBrwAtivo),.t.)))}
d_ob:lEditable = .f. 
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,390,535,143,75)
hwg_TbMt(oToolbar,'13;eVal(zbFechaComDsc);Enter-Plano com Acrescimo/Desconto;Enter-Confirma Plano com Acrescimo/Desconto;sembitmap;;;Lucida Bright;-12;Enter - Confirma Plano com Acrescimo ou &Desconto;')
hwg_TbMt(oToolbar,'32;eVal(zbFechaSemDsc);Barra-Fecha Venda;<Barra> Fecha Venda;sembitmap;;;Lucida Bright;-12;Barra - Confirma Plano e &Fecha Venda;')
hwg_Btn(oToolbar,10,137,64,24)
hwg_TbMt(oToolbar,' 80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa;sembitmap;;;Lucida Bright;-10;&P-Pesquisa;')
hwg_TbMt(oToolbar,' 84;tb_locate(D_oB);T-Busca_Trecho ;T-Acha Trecho;sembitmap;;;Lucida Bright;-10;&T-Trecho;')
hwg_TbMt(oToolbar,' 79;tb_index(D_OB);O-Ordena ;O-Ordena;sembitmap;;;Lucida Bright;-10;&O-Ordena;')
hwg_TbMt(oToolbar,' 70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-10;&F-Filtra;')
hwg_Btn(oToolbar,,,74,24)
hwg_TbMt(oToolbar,' 70;ProcessaEscolhaDaListaDePlanos(,"DigitarProdutos");U-Produtos;Digitar novos produtos;sembitmap;;;Lucida Bright;-10;&U-Produtos;')
hwg_Btn(oToolbar,,,84,24)

hwg_TbMt(oToolbar,'89;MudaParaTV();Y-Delivery;Y-Marca venda para Delivery, Entrega a Domicilio;sembitmap;;;Lucida Bright;-10;&Y-Delivery;')
hwg_TbMt(oToolbar,' 68;(PAF_DadosConsumidor(),d_ob:Refresh(),d_ob:SetFocus());D-Consumidor ;D-Dados do Consumidor;sembitmap;;;Lucida Bright;-10;&D-Consumidor;')
hwg_TbMt(oToolbar,' 71;(Senhad(),d_ob:Refresh(),d_ob:SetFocus());G-Gerencial ;G-Acessa Funcao Gerencial;sembitmap;;;Lucida Bright;-10;&G-Gerencial;')
hwg_TbMt(oToolbar,' 47;eVal(zbExpande);/-Parcelamentos ;/-Mostra os Valores Possiveis de Cada Parcela do Plano Selecionado;sembitmap;;;Lucida Bright;-10;&/-Parcelas;')

hwg_TbMt(oToolbar,'66;(Obs_pn(),d_ob:Refresh(),d_ob:SetFocus());B-Observacoes ;B-Registra observacoes a ser destacadas no Pedido;sembitmap;;;Lucida Bright;-10;&B-Obs;')
hwg_TbMt(oToolbar,'65;(GetCaucao("GetValorAdiantado"),d_ob:Refresh(),d_ob:SetFocus());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(),d_ob:Refresh(),d_ob:SetFocus());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)
hwg_TbMt(oToolbar,'27;ConfirmeCancelarVenda();Saida;Saida;sembitmap;;;Lucida Bright;-10;&Esc-Sair;')
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]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,626,1024,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{17,211,988,336}</property>
      <property name="Name">[D_oB]</property>
      <property name="Anchor">15</property>
      <property name="font">
        <font name="Arial" width="0" height="-35" weight="400"/>
      </property>
      <property name="GridLinesSepColor">0</property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onInit">
      <![CDATA[hwg_TbFi(D_oB, 'Pl;FPLANOPAG;N;99;2;N;')
// hwg_TbFi(D_oB, '     Valor  x Parcelas;Transform(FVAL/FPARCELAS,"@e 999,999.99")+" x "+Str(FPARCELAS,5);C;@S25;18;N;')
hwg_TbFi(D_oB, 'Descricao;PDESC;C;@S15; 15;N;')
hwg_TbFi(D_oB, 'Val_Liquido;Transform(cr_valor+if(sys_segmento="locacao",m_fValFrete,0)-m_fValDev,"@e 999,999.99");P;@S10;10;;')
hwg_TbFi(D_oB, 'Parcelamento;if(fParcelas=1, eVal(zbFormaDiv), Str(fParcelas,3)+" x "+lTrim(Transform((cr_valor-m_fValDev)/fParcelas,"@e 999,999.99")));P;@S25;16;;')
hwg_TbFi(D_oB, 'Recalc;Changed;C;X; 6;;')
hwg_TbFi(D_oB, 'ValProds;fValProd;N;999999.99;9;;')
hwg_TbFi(D_oB, 'ValVenda;fVal;N;9999.99; 7;;')
hwg_TbFi(D_oB, 'DscProds;fValDscPrd;N;9999.99; 7;;')
hwg_TbFi(D_oB, '**;FDSCADIC;N;9999.99; 7;;')
hwg_TbFi(D_oB, '*;if(FDSCADIC>0,"*","");C;!; 1;;')
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.,"PLANOS",.F.,.T.,{||.T.} }
// d_ob:bEdit := {|D_oB| nKey:=13, ProcessaEscolhaDaListaDePlanos()}
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{27,5,840,93}</property>
      <property name="Name">[oLabelTitulo]</property>
      <property name="Caption">
[(&quot;Escolha Plano de Pagamento no Caixa do Valor a Receber de R$  &quot;+Ltrim(Str(IF(wFgLocacao.or.wFgRetornoLocacao,m_fValLoca,m_fVal-m_fValDev),10,2)))]      </property>
      <property name="Justify">[Center]</property>
      <property name="font">
        <font name="Arial" width="0" height="-37" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">6</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{21,171,301,41}</property>
      <property name="Name">[oLabel7]</property>
      <property name="Caption">[Valor dos Produtos:]</property>
      <property name="font">
        <font name="Arial" width="0" height="-35" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">39</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{322,171,242,38}</property>
      <property name="Name">[oLabel2]</property>
      <property name="Caption">[(Transform(m_fvalprod,&quot;@E 999,999.99&quot;))]</property>
      <property name="font">
        <font name="Arial" width="0" height="-35" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="WordWrap">.F.</property>
      <property name="TabIndex">39</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{573,171,432,38}</property>
      <property name="Name">[oLabelDevolucao]</property>
      <property name="Caption">
[(&quot;Cred. Dev/NC :&quot;+Transform(m_fValDev+m_fAvalPago,&quot;@E 999,999.99&quot;))]      </property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Arial" width="0" height="-35" weight="400"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="WordWrap">.F.</property>
      <property name="TabIndex">39</property>
    </style>
  </part>
</part>
