"VER1.0","Albaranes","Listado de Albaranes"
;Versio, Categoria, Descripcion

;Ampla, Llarg, [EspaiCos]
;MargenX,MargenY, EtiLin, EtiPag
[DOCUM]
H, 0, 0
0,0,0,0

; Tipo, NomGrup, InicNumPag,   Select, From, GropBy
[GRUP]
1,"CABECERA", #FALSE#
"SELECT * , CodigoPostal & ' - ' & Poblacion as Direc, 'Tel : ' & Telefono1 as Tel "
"FROM Configuracion"
""
[CAPSALERA]
0, 0, #FALSE#, 0, #FALSE#, #TRUE#, 0
; RAp(n), Alt(n), SMin(b), Salto(D), GA(b), All(b), Rel(D)
[CAMPS] 4
3,"CABECERA","NombreComercial",10,0,"ARIAL",22,0,0,"1000",""
3,"CABECERA","Nif",10,8,"ARIAL",8,0,0,"1000",""
0,"Condiciones : ",20,23,"ARIAL",8,0,0,"1000"
6,"Condiciones",45,23,"ARIAL",8,0,0,"1000",""
;3,"CABECERA","Domicilio",10,8,"ARIAL",8,0,0,"1000",""
;3,"CABECERA","Direc",10,11,"ARIAL",8,0,0,"1000",""
;3,"CABECERA","Provincia",10,14,"ARIAL",8,0,0,"1000",""
;3,"CABECERA","Tel",10,17,"ARIAL",8,0,0,"1000",""
[FICAP]

[FIGRUP]

;-----------------------------------------

; Tipo, NomGrup, InicNumPag,   Select, From, GropBy
[GRUP]
0, "GENERAL", #FALSE#
""
""
""
;[ordenaciones] y [condiciones]


[CAPSALERA]
10, 25, #TRUE#, 0, #TRUE#, #TRUE#, 0
; RAp(n), Alt(n), SMin(b), Salto(D), GA(b), All(b), Rel(D)
[CAMPS] 20
0,"Pgina :",170,0,"ARIAL",8,0,0,"1000"
6,"Pagina",200,0,"ARIAL",8,0,1,"1000",""
0,"Fecha :",170,5,"ARIAL",8,0,0,"1000"
6,"Fecha",200,5,"ARIAL",8,0,1,"1000",""
0,"Rentabilidad Facturas (Detallado)",45,5,"ARIAL",16,0,0,"1001"
1,"lineaH1",5,17,285,17,,,
1,"lineaH2",5,22,285,22,,,
0,"Cod.Cliente",5,18,"ARIAL",8,0,0,"1000"
0,"Nombre",30,18,"ARIAL",8,0,0,"1000"
0,"Fecha",100,18,"ARIAL",8,0,0,"1000"
0,"N Fra.",115,18,"ARIAL",8,0,0,"1000"
0,"Bruto.",145,18,"ARIAL",8,0,1,"1000"
0,"Dto pp",163,18,"ARIAL",8,0,1,"1000"
0,"Dto. comer.",183,18,"ARIAL",8,0,1,"1000"
0,"B.Imp.",200,18,"ARIAL",8,0,1,"1000"
0,"% Repr.",217,18,"ARIAL",8,0,1,"1000"
0,"Comis",229,18,"ARIAL",8,0,1,"1000"
0,"Coste",244,18,"ARIAL",8,0,1,"1000"
0,"Margen",262,18,"ARIAL",8,0,1,"1000"
0,"%",280,18,"ARIAL",8,0,1,"1000"

[FICAP]

[PEU]
0, 5, #TRUE#, 0, #FALSE#, #FALSE#, 0
; RAp(n), Alt(n), SMin(b), Salto(D), GA(b), All(b), Rel(D)
[CAMPS] 10
1, "CuadroTotales", 40, 2, 285, 12, 1, 0,
0,"Totales",60,5,"ARIAL",12,0,1,"1000"
5,0,"Margen",265,5,"ARIAL",10,0,1,"1000","Total"
5,0,"Bruto",143,5,"ARIAL",10,0,1,"1000","Total"
5,0,"Base",200,5,"ARIAL",10,0,1,"1000","Total"
5,0,"Comision",225,5,"ARIAL",10,0,1,"1000","Total"
5,0,"TotDesPP",160,5,"ARIAL",10,0,1,"1000","Total"
5,0,"TotDesCo",179,5,"ARIAL",10,0,1,"1000","Total"
5,0,"TotCoste",244,5,"ARIAL",10,0,1,"1000","Total"
8,"1", "DIV(CALCULO('Margen')*100, CALCULO('Base'))", 280, 5, "ARIAL", 10, 0, 1, "1000", "TOTAL"
;5,0,"Base",190,5,"ARIAL",10,0,1,"1000","Total"
;5,0,"Porcient",280,5,"ARIAL",10,0,1,"1000","Total"
[FIPEU]

[FIGRUP]

;-----------------------------------------

;tipo, NomGrup, Select, From, GropBy
[GRUP]
3,"COS", #FALSE#
"SELECT VenFacturas.CodCliente AS Cod, VenFacturas.Seccion, Representantes.Comision, VenFacturas.NombreFiscal AS NomFis, VenFacturas.FechaFactura AS FechaFac, VenFacturas.NumFactura AS NumFac, VenFacturas.CodRepresentante AS CodRepre, VenFacturas.TComision AS Comisi, Sum(VenAlbaLin.Cantidad*Articulos.PrecioCoste) AS TotalCosteLineas, Max(VenFacturas.Bruto) AS MxDeBruto, First(VenFacturas.TDesCo) AS PrimeroDeTDesCo, First(VenFacturas.TDesPP) AS PrimeroDeTDesPP, First(VenAlba.ImportePorte) AS PrimeroDeImportePorte, VenAlba.TipoPortes, VenFacturas.TComision, MxDeBruto-TotalCosteLineas-PrimeroDeTDesCo-PrimeroDeTDesPP-VenFacturas.TComision-PrimeroDeImportePorte AS Megatota, First(VenFacturas.BaseImponible1) AS PrimeroDeBaseImponible1, First(VenFacturas.BaseImponible2) AS PrimeroDeBaseImponible2, First(VenFacturas.BaseImponible3) AS PrimeroDeBaseImponible3, First(VenFacturas.TRE1) AS PrimeroDeTRE1, First(VenFacturas.TRE2) AS PrimeroDeTRE2, First(VenFacturas.TRE3) AS PrimeroDeTRE3, (IIf(IsNull([PrimeroDeTRE1]),0,[PrimeroDeTRE1])+IIf(IsNull([PrimeroDeTRE2]),0,[PrimeroDeTRE2])+IIf(IsNull([PrimeroDeTRE3]),0,[PrimeroDeTRE3])) AS Recar, (IIf(IsNull([PrimeroDeBaseImponible1]),0,[PrimeroDeBaseImponible1])+IIf(IsNull([PrimeroDeBaseImponible2]),0,[PrimeroDeBaseImponible2])+IIf(IsNull([PrimeroDeBaseImponible3]),0,[PrimeroDeBaseImponible3])) AS BaseImponibleFactura, IIf([BaseImponibleFactura]=0,([MxDeBruto]-[PrimeroDeTDesCo]-[PrimeroDeTDesPP]),[BaseImponibleFactura]) AS BASEIMP1, megatota*100/BASEIMP1 AS Porciento, [BaseImponibleFactura]-[Recar] AS Totaltotal"
"FROM (((VenAlba INNER JOIN VenAlbaLin ON VenAlba.NumAlbaran = VenAlbaLin.NumAlbaran) INNER JOIN VenFacturas ON (VenFacturas.Seccion = VenAlbaLin.Seccion) AND (VenAlba.NumFactura = VenFacturas.NumFactura) AND (VenAlba.Seccion = VenFacturas.Seccion)) LEFT JOIN Articulos ON VenAlbaLin.CodArticulo = Articulos.CodArticulo) LEFT JOIN Representantes ON VenFacturas.CodRepresentante = Representantes.CodRepresentante"
"GROUP BY VenFacturas.CodCliente, VenFacturas.Seccion, Representantes.Comision, VenFacturas.NombreFiscal, VenFacturas.FechaFactura, VenFacturas.NumFactura, VenFacturas.CodRepresentante, VenFacturas.TComision, VenAlba.TipoPortes, VenFacturas.TComision"


[CONDICIONS] 7
" (VenFacturas.Estadisticas = false) ","",4
"VenFacturas.CodCliente","Codigo Cliente",0,1, -10
"VenFacturas.NombreFiscal","Nombre Fiscal",0,1, -10
"VenFacturas.FechaFactura","Fecha Factura",0,2, -10
"VenFacturas.NumFactura","Numero Factura",0,1, -10
"VenFacturas.CodRepresentante","Codigo Representante",0,1, -10
"VenFacturas.Seccion","Seccin",0,1
;"NumAlbaran","Nmero albarn",0,0
;"NombreCliente","Nombre Cliente",0,1
;"FechaAlbaran","Fecha",0,2
;"Seccion","Seccin",0,1

[ORDENACIONS] 2
"VenFacturas.FechaFactura","Fecha Factura",0,2, -10
"VenFacturas.CodCliente","Codigo Cliente",0,1, -10
;"FechaAlbaran","Fecha",3
;"NumAlbaran","Nmero de Albarn",3


[CAPSALERA]
0, 5, #TRUE#, 0, #TRUE#, #FALSE#, 0
; RAp(n), Alt(n), SMin(b), Salto(D), GA(b), All(b), Rel(D)
[CAMPS] 13
3, "COS", "Cod",5,0,"ARIAL",10,0,0,"0000",""
3, "COS", "NomFis", 30,0,"ARIAL",10,75,0,"0000",""
3, "COS", "FechaFac", 93,0,"ARIAL",10,0,0,"0000",""
3, "COS", "NumFac", 128,0,"ARIAL",10,0,1,"0000",""
3, "COS", "MxDeBruto", 146,0,"ARIAL",10,0,1,"0000","Total"
3, "COS", "PrimeroDeTDesPP", 160,0,"ARIAL",10,0,1,"0000","Total"
3, "COS", "PrimeroDeTDesCo", 177,0,"ARIAL",10,0,1,"0000","Total"
3, "COS", "BASEIMP1", 200,0,"ARIAL",10,0,1,"0000","Total"
3, "COS", "Comision", 210,0,"ARIAL",10,0,0,"0000",""
3, "COS", "Comisi", 225,0,"ARIAL",10,0,1,"0000",""
3, "COS", "TotalCosteLineas", 243,0,"ARIAL",10,20,1,"0000","Total"
3, "COS", "Megatota", 265,0,"ARIAL",10,0,1,"0000","Total"
3, "COS", "Porciento", 280,0,"ARIAL",10,0,1,"0000","Total"


3, "COS", "Total", 190,0,"ARIAL",10,0,3,"0000","Total"
[FICAP]
[FIGRUP]


[CALCULS] 8
"Margen","COS","MegaTota","GENERAL"
"Bruto","COS","MxDeBruto","GENERAL"
"Base","COS","BASEIMP1","GENERAL"
"Comision","COS","Comisi","GENERAL"
"Porcient","COS","Porciento","GENERAL"
"TotDesPP","COS","PrimeroDeTDesPP","GENERAL"
"TotDesCo","COS","PrimeroDeTDesCo","GENERAL"
"TotCoste","COS","TotalCosteLineas","GENERAL"
;"Base","COS","Recar","GENERAL"
[FIDOCUM]


