Code: Select all
oMae:setorder( 2 )
IF nLoguin # 10
oMae:setfilter( "vendedor = oApp:nloguin" )
ENDIF
oMae:gotop()
oMae:beof := {|| nil }
AAdd( aObj, oMae )
finarch( aObj )
define ICON surge resource "icomega"
DEFINE DIALOG oDlg RESOURCE "DIALOG_2" ICON surge
oDlg:cCaption := "Clientes"
oDlg:bgotfocus := {|| oMae:activate() }
REDEFINE SPLITTER oSplit[ 1 ] id 110 COLOR rgb( 234, 234, 234 ) of oDlg
REDEFINE SPLITTER oSplit[ 2 ] id 111 COLOR rgb( 234, 234, 234 ) of oDlg
REDEFINE xbrowse oLbx;
COLUMNS Str( ( oMae:cAlias )->NCLI ), ; // Campos que contendr
( ( oMae:cAlias )->NAPE ), ; // el TBrowse.
( oMae:cAlias )->Domi, ;
( oMae:cAlias )->LOCA, ;
( oMae:cAlias )->PCIA, ;
( oMae:cAlias )->TELE, ;
( oMae:cAlias )->CUIT, ;
( oMae:cAlias )->IVA, ;
( oMae:cAlias )->RUBRO, ;
Str( ( oMae:cAlias )->VENDEDOR );
ON DBLCLICK CLIENTES( oLbx, .F., oMae, oMemos, oDomcli, oClitrans, oVend, ( oMae:cAlias )->ncli ) ID 101 OF oDlg;
HEADERS "Código", "Cliente", "Domicilio", "Localidad", "Provincia", ;
"Telefono", "Cuit", "Iva", "Rubro", "Vendedor";
COLSIZES 60, 210, 190, 190, 190, 160, 90, 100, 180, 60
WITH OBJECT oLbx
:nMarqueeStyle := 4
:nColDividerStyle := LINESTYLE_BLACK
:nStretchCol := STRETCHCOL_LAST
:lColDividerComplete := .F.
:l2010 := .T.
:lAllowColHiding := .F.
:lIncrFilter := .T.
:lSeekWild := .t.
:lIncrFilter := .t.
//:bKeyDown := {| nKey | If( nKey == K_ENTER, ( FCHOFER( oLbx, .f.,oCho),oDlg:end()), ) }
:nRowDividerStyle :=2
:nColDividerStyle :=2
END WITH
etc etc
FUNCTION clientes( olbx, lnuevo, oMae, oMemos, oDomcli, oClitrans, oVend, nclia )
LOCAL oDlgCli // Objeto que contendr la Caja de Di logo.
LOCAL aivaa := tipoiva()
LOCAL ivaa := "Inscripto"
LOCAL lSalvar := .F.
LOCAL nRecno := ( oMae:calias )->( RecNo() )
LOCAL oData
LOCAL oRadio, norden, titu
LOCAL oNcli
LOCAL oCedr
LOCAL oRubr
LOCAL oNape
LOCAL oDomi
LOCAL oLoca
LOCAL oCpos
LOCAL oTele
LOCAL oCuit
LOCAL oNtro
LOCAL oVtocedro
LOCAL oAte
LOCAL oSaldo
LOCAL oConsigna
LOCAL oProm
LOCAL oVen
LOCAL oPercibe, oRetiene, oSplit1
LOCAL nBut := Array( 10 )
LOCAL aPciaa := provin()
LOCAL aPciadgi := DGIPROV()
LOCAL pciaa := "Ciudad autónoma"
LOCAL cPla := "Contado"
LOCAL oMem, oMem1, oMem2, oCufe
LOCAL oNroib
LOCAL oInv, surge
LOCAL oChex := Array( 11 )
LOCAL oFold
LOCAL cDato := ""
LOCAL cDeposito := ""
LOCAL cOficina := ""
LOCAL aplazos := { "Pago Anticipado","Contado", "7 Días f/f", "7 Días c/val", "10 Días", "10 Días C/Val", "15 Días", "15 Días C/val", "21 Días f/f", "21 Días c/val", ;
"30 Días f/f", "30 Días c/val", "45 Días f/f", "45 Días c/val", ;
"60 Días f/f", "60 Días c/val", "90 días", "90 días c/val", "120 días" }
LOCAL aConvenio := { "Local", "Multilateral", "Local Simplificado","No Inscripto" }
LOCAL cConvenio := "Local"
LOCAL nvendedor := 0
LOCAL cConiva := ""
LOCAL cCongan := ""
LOCAL cConmono := ""
LOCAL oCos := Array( 3 )
LOCAL oCombo := Array( 4 )
LOCAL oBrw, oBrw1
LOCAL oHasedro
LOCAL oMail, oBcc, oCC
LOCAL oDolar
LOCAL aDolar := { "Libre", "30 días", "45 días", "60 días", "90 días", "120 días", "150 días", "Nación", "Especial" }
LOCAL cDolar := "Libre"
LOCAL oSay
LOCAL aConstancia := { "Activo", "No Inscripto", "Exento", "No Alcanzado", "Exento no alcanzado" }
LOCAL oFont1
LOCAL oVtopercibe
LOCAL lvercuit := .F. //doy como inválido el número de cuit
LOCAL oPeret := Array( 7 )
LOCAL oCosafip
LOCAL aCobro := Array(6)
LOCAL aGetcobro := Array( 6 )
LOCAL aFlds
LOCAL lNewcobro := .T.
LOCAL aDomCob
LOCAL lcobro := .f.
aCobro[1] := Date()
aCobro[2] := Space(40)
aCobro[3] := CToD( " " )
aCobro[4] := Space(70 )
aCobro[5] := Space(50)
aCobro[6] := Space(40)
// default napea := ""
IF !pasaje( "hasedro" );RETURN nil;ENDIF
DATABASE oHasedro
DEFAULT lnuevo := .F.
oMae:setorder(1)
oMae:seek(nclia)
oData := oClone( oMae )
oMae:setorder(2)
IF lnuevo
iif( !Empty( olbx ), orden( 2,olbx,oMae ), oMae:setorder( 1 ) )
oMae:gobottom()
nclia := oData:ncli
nvendedor := 0
iif( !Empty( olbx ), orden( 1,olbx,oData ), oData:setorder( 2 ) )
oData:setorder( 1 )
titu := "Nuevo Cliente"
oData:blank()
oData:ti = "01"
oData:ncli := nclia + 1
oData:pcia := "Ciudad autónoma"
ELSE
IF oMemos:seek( oData:ncli )
cDato := oMemos:informe
cDeposito := oMemos:deposito
cOficina := oMemos:oficina
ENDIF
// oData:goto( nRecno )
//oData:load()
IF !Empty( oData:tipoib )
cConvenio := aConvenio[ oData:tipoib ]
ENDIF
IF !Empty( oData:dolar )
cDolar := aDolar[ oData:dolar ]
ENDIF
cConiva := vercond( oData:constiva )
cCongan := vercond( oData:constgan )
cConmono := vercond( oData:constmono )
nclia := oData:ncli
aDomCob := NEWADRESS( oData:ncli, aPciaa, oDomcli,, .T. )
ivaa := oData:iva
cPla := oData:plazo
titu := "Modificar Cliente"
nvendedor := oData:vendedor
IF ValType( oCobro ) = "O"
oCobro:setfilter( "ncli == " + Str( nclia ) )
oCobro:gotop()
if !Empty(oCobro:ncli)
lcobro := .t.
endif
ENDIF
ENDIF
oData:setorder(2)
oHasedro:gotop()
oHasedro:setfilter( "ncli == " + Str( oData:ncli ) )
DEFINE FONT oFont1 NAME GetSysFont() SIZE 0, -14 bold
DEFINE DIALOG oDlgCli RESOURCE "FOLD_CLI" ICON surge
REDEFINE FOLDEREX oFold id 101 oF oDlgCli ;
PROMPTS "General", "Impuestos", "Sedronar", "Datos", "Cobranza";
BITMAPS "","","","",IIF(lcobro,"B_ACEPTAR","");
DIALOGS "fold_cli1", "fold_cli2", "fold_cli3", "fold_cli4", "fold_cli5";
REDEFINE URLLINK ID 400 URL "www.afip.gov.ar" oF oFold:adialogs[ 1 ] ;
TOOLTIP "Sitio oficial AFIP" font oFont1
oDlgCli:bgotfocus := {|| oData:activate() }
REDEFINE GET oNcli VAR oData:ncli id 106 oF oFold:adialogs[ 1 ] update
REDEFINE GET oNape VAR oData:nape PICTURE "@!" id 107 oF oFold:adialogs[ 1 ] update VALID CampoNoVacio( oData:nape )
REDEFINE GET oDomi VAR oData:domi id 108 oF oFold:adialogs[ 1 ] update VALID CampoNoVacio( oData:domi )
REDEFINE GET oLoca VAR oData:LOCA id 109 oF oFold:adialogs[ 1 ] update VALID CampoNoVacio( oData:loca )
REDEFINE GET oCpos VAR oData:cpos id 118 oF oFold:adialogs[ 1 ] update VALID CampoNoVacio( oData:cpos )
REDEFINE COMBOBOX oCombo[ 1 ] VAR oData:pcia id 110 items aPciaa oF oFold:adialogs[ 1 ] update;
valid ( oData:nropcia := ( AScan(aPciaa, pciaa ) -1 ), oData:pciadgi := ( AScan(aPciadgi, pciaa ) -1 ), .T. )
REDEFINE GET oTele VAR oData:tele id 120 oF oFold:adialogs[ 1 ] update VALID CampoNoVacio( oData:tele )
REDEFINE GET oCuit VAR oData:cuit PICTURE "99-99999999-9" id 113 oF oFold:adialogs[ 1 ] update;
VALID ( lvercuit := altacuit( oData, lnuevo, "maeclie", oDlgCli ), actuacons( oData,@cConiva, @cCongan, @cConmono, oCos, oPeret ), lvercuit )
REDEFINE CHECKBOX oConsigna VAR oData:lconsigna id 112 oF oFold:adialogs[ 1 ] update
REDEFINE GET oRubr VAR oData:rubro PICTURE "@!" id 111 oF oFold:adialogs[ 1 ] update
REDEFINE BTNBMP oMail id 200 oF oFold:adialogs[ 1 ] resource "BT_MAIL" ACTION correo( oData:mail, oData:cc, oData:bcc ) NOBORDER TOOLTIP "Enviar mail"
REDEFINE BTNBMP oCosafip id 202 oF oFold:adialogs[ 1 ] resource "LUPITA" ACTION consaltafip( oData, oDlgCli ) NOBORDER TOOLTIP "Consultar datos registrados en afip"
REDEFINE GET oVen VAR nvendedor id 117 oF oFold:adialogs[ 1 ] update ;
VALID iif( oApp:nloguin = 10, .T., ( nohay(),nvendedor := oData:vendedor, oVen:refresh(), .T. ) )
REDEFINE COMBOBOX oCombo[ 2 ] VAR ivaa id 116 items aivaa oF oFold:adialogs[ 1 ] update valid ( oData:ti := StrZero( AScan(aivaa,ivaa ),2 ), .T. )
REDEFINE BUTTON ID 121 oF oFold:adialogs[ 1 ] ACTION AGRTRAN( oData:ncli, oClitrans )
REDEFINE GET oAte VAR oData:ate PICTURE "@!" id 128 oF oFold:adialogs[ 1 ] update
REDEFINE BUTTON ID 127 oF oFold:adialogs[ 1 ] ACTION NEWADRESS( oData:ncli, aPciaa, oDomcli )
REDEFINE COMBOBOX oCos[ 1 ] VAR cConiva id 114 ITEMS aConstancia oF oFold:adialogs[ 1 ] update ON change( grabcons( cConiva ) ) //grabcons solamente para que en harbour pase bien la variable
REDEFINE COMBOBOX oCos[ 2 ] VAR cCongan id 115 ITEMS aConstancia oF oFold:adialogs[ 1 ] update ON change ( grabcons( cCongan ) )
REDEFINE COMBOBOX oCos[ 3 ] VAR cConmono id 119 ITEMS aConstancia oF oFold:adialogs[ 1 ] update ON change ( grabcons( cConmono ) )
REDEFINE CHECKBOX oChex[ 7 ] VAR oData:lexporta id 500 oF oFold:adialogs[ 1 ] update;
ON CHANGE ( oSay:settext( iif(oData:lexporta,"País","Localidad" ) ), oSay:refresh() )
REDEFINE CHECKBOX oChex[ 11 ] VAR oData:lfaccre id 145 oF oFold:adialogs[ 1 ] update
REDEFINE BTNBMP nBut[ 6 ] id 201 oF oFold:adialogs[ 1 ] resource "b_AFIP" ACTION consafip( oData, .T. ) tooltip "Clientes nuevos"
REDEFINE SAY oSay id 501 oF oFold:adialogs[ 1 ] update
REDEFINE GET oPeret[ 6 ] VAR oData:fibcapin PICTURE "@d" id 146 oF oFold:adialogs[ 2 ] update
REDEFINE GET oPeret[ 7 ] VAR oData:fibcapvt PICTURE "@d" id 147 oF oFold:adialogs[ 2 ] update
REDEFINE COMBOBOX oCombo[ 3 ] VAR cPla id 126 items aplazos oF oFold:adialogs[ 2 ] update
REDEFINE GET oPeret[ 1 ] VAR oData:percibe PICTURE "@e 999.99" id 130 oF oFold:adialogs[ 2 ] update
REDEFINE GET oPeret[ 3 ] VAR oData:vtoper PICTURE "@d" id 134 oF oFold:adialogs[ 2 ] update
REDEFINE GET oPeret[ 2 ] VAR oData:retiene PICTURE "@e 999.99" id 131 oF oFold:adialogs[ 2 ] update
REDEFINE GET oSaldo VAR oData:saldo PICTURE "@e 999,999.99" id 114 oF oFold:adialogs[ 2 ] update
REDEFINE GET oProm VAR oData:promedio PICTURE "@e 999.99" id 115 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 1 ] VAR oData:cobro id 103 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 2 ] VAR oData:Ingbruto id 124 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 3 ] VAR oData:facdol id 125 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 4 ] VAR oData:remito id 112 oF oFold:adialogs[ 2 ] update when ( oApp:nloguin = 10 )
REDEFINE CHECKBOX oChex[ 5 ] VAR oData:difcam id 132 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 6 ] VAR oData:ibcapital id 133 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 8 ] VAR oData:agreccap id 135 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 9 ] VAR oData:ibjurcap id 136 oF oFold:adialogs[ 2 ] update
REDEFINE CHECKBOX oChex[ 10 ] VAR oData:sinleyenda id 145 oF oFold:adialogs[ 2 ] update
REDEFINE COMBOBOX oCombo[ 4 ] VAR cConvenio id 141 items aConvenio oF oFold:adialogs[ 2 ] update
REDEFINE GET oPeret[ 4 ] VAR oData:percap PICTURE "@e 999.99" id 104 oF oFold:adialogs[ 2 ] update
REDEFINE GET oPeret[ 5 ] VAR oData:retcap PICTURE "@e 999.99" id 105 oF oFold:adialogs[ 2 ] update
REDEFINE GET oNroib VAR oData:nroibruto PICTURE "xxxxxxxxxxxxxx" id 140 oF oFold:adialogs[ 2 ] update VALID CampoNoVacio( oData:nroibruto )
REDEFINE COMBOBOX oDolar VAR cDolar id 106 items aDolar oF oFold:adialogs[ 2 ] update
REDEFINE GET oCedr VAR oData:cedronar id 101 oF oFold:adialogs[ 3 ] update
REDEFINE GET oVtocedro VAR oData:vtocedro PICTURE "@!" id 102 oF oFold:adialogs[ 3 ] update
REDEFINE GET oInv VAR oData:inv id 103 oF oFold:adialogs[ 3 ] update
REDEFINE SPLITTER oSplit1 id 107 COLOR rgb( 234, 234, 234 ) oF oFold:adialogs[ 3 ] _3DLOOK
REDEFINE GET oCufe VAR oData:cufe PICTURE "@!" id 108 oF oFold:adialogs[ 3 ]
REDEFINE LISTBOX oBrw FIELDS Str( ( oHasedro:cAlias )->codigo, 5 ), ( oHasedro:cAlias )->producto ID 104 oF oFold:adialogs[ 3 ]
oBrw:aheaders := { "Código", "Producto" }
oBrw:aColSizes := { 100, 210 }
//oBrw:bSkip = {| nRecs | oHasedro:Skipper( nRecs ) }
oBrw:nLineStyle := 3
oBrw:nClrBackFocus := CLR_CYAN
oBrw:nClrForeFocus := CLR_WHITE
REDEFINE BUTTON nBut[ 4 ] ID 105 oF oFold:adialogs[ 3 ] ACTION fsedron( oBrw, oHasedro, oData:ncli )
REDEFINE BUTTON nBut[ 5 ] ID 106 oF oFold:adialogs[ 3 ] ACTION borro( oBrw, oHasedro, nRecno, oData )
REDEFINE GET oMem VAR cDato MEMO ID 101 oF oFold:adialogs[ 4 ];
MESSAGE "Datos varios del cliente" UPDATE;
MULTILINE
oMem:SetSel( 0, 0 )
REDEFINE GET oMem1 VAR cDeposito MEMO ID 105 oF oFold:adialogs[ 4 ];
MESSAGE "Datos Para depósito" UPDATE;
MULTILINE
oMem1:SetSel( 0, 0 )
REDEFINE GET oMem2 VAR cOficina MEMO ID 106 oF oFold:adialogs[ 4 ];
MESSAGE "Datos útiles para oficina envíos" UPDATE;
MULTILINE
oMem2:SetSel( 0, 0 )
REDEFINE GET oMail VAR oData:mail PICTURE "@s" id 102 oF oFold:adialogs[ 4 ] update // valid revisamail(oData:mail)
REDEFINE GET oCC VAR oData:cc PICTURE "@s" id 103 oF oFold:adialogs[ 4 ] update // valid revisamail(oData:cc)
REDEFINE GET oBcc VAR oData:bcc PICTURE "@s" id 104 oF oFold:adialogs[ 4 ] update // valid revisamail(oData:bcc)
/////////////////////////COBRANZAS//////////////////
REDEFINE DTPICKER aGetcobro[ 1 ] VAR aCobro[ 1 ] PICTURE "@D" id 101 oF oFold:adialogs[ 5 ] update
REDEFINE GET aGetcobro[ 2 ] VAR aCobro[ 2 ] PICTURE "@!" id 102 oF oFold:adialogs[ 5 ] update
REDEFINE DTPICKER aGetcobro[ 3 ] VAR aCobro[ 3 ] PICTURE "@D" id 103 oF oFold:adialogs[ 5 ]update
REDEFINE COMBOBOX aGetcobro[ 4 ] VAR aCobro[ 4 ] id 104 items aDomCob oF oFold:adialogs[ 5 ] update
REDEFINE GET aGetcobro[ 5 ] VAR aCobro[ 5 ] PICTURE "@!" id 105 oF oFold:adialogs[ 5 ] update
REDEFINE COMBOBOX aGetcobro[ 6 ] VAR aCobro[ 6 ] id 109 items aVend oF oFold:adialogs[ 5 ] update
REDEFINE BUTTON nBut[ 9 ] id 107 ACTION grabocobro( oBrw1, aCobro, oCobro, aGetcobro, oData:ncli, lNewcobro )
REDEFINE BUTTON nBut[ 10 ] id 106 ACTION borrocobro( oBrw1, aCobro, oCobro, aGetcobro, oData:ncli, lNewcobro )
REDEFINE XBROWSE oBrw1 id 108 OF oFold:adialogs[ 5 ] ;
COLUMNS "pasar", "direccion", "cobrador" HEADERS "Pasar", "Direccion", "Cobrador" ;
object oCobro AUTOSORT CELL LINES NOBORDER ON DBLCLICK ( lNewcobro := editar( oCobro,aCobro,aGetcobro ) )
//"pasar","direccion","cobrador"
WITH OBJECT oBrw1
:lIncrFilter := .T.
:nStretchCol := STRETCHCOL_WIDEST
END
REDEFINE BUTTON nBut[ 1 ] ID 105 oF oDlgCli ACTION;
iif( ACEPTAR( oData,lnuevo, cConiva, cCongan, cConmono,cPla, nvendedor, aConvenio,cConvenio,ivaa, pciaa, aDolar, cDolar, cDato,cDeposito, cOficina, oMemos ), oDlgCli:end(), ) //(lSalvar := .T. )
REDEFINE BUTTON nBut[ 2 ] ID 106 oF oDlgCli ACTION( oDlgCli:End() ) CANCEL
REDEFINE BUTTON nBut[ 3 ] ID 122 oF oDlgCli when ( iif( lnuevo,nBut[ 3 ]:disable(),"" ), .T. );
ACTION ctacli( oData:ncli, oData:nape,.F. )
REDEFINE BTNBMP nBut[ 7 ] id 102 oF oDlgCli resource "FIND3" ACTION responsable( "01", oData:ncli ) NOBORDER
IF oApp:privado != "1"
nBut[ 7 ]:disable()
ENDIF
// REDEFINE BUTTON nbut[4] ID 123 of oDlgcli ACTION(MEMCLI(odata:ncli))
ACTIVATE DIALOG oDlgCli CENTER ON INIT ( oSay:settext( iif(oData:lexporta,"País","Localidad" ) ),oNcli:setfocus(), .F. )
oFont1:end()
oHasedro:setfilter( NIL )
cierroalias( oHasedro:cAlias, oHasedro )
sysrefresh()
try
iif( !Empty( olbx ), olbx:refresh(), ) // Repintamos el objeto ListBox
catch
end
RETURN NIL
Estuve buscando lo que encontre con el mismo problema es con ads, yo utilizo dbf.