diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm index 17eaa57..7cb5820 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.dfm @@ -23,20 +23,27 @@ object RptFacturasCliente: TRptFacturasCliente ' v_facturas_cliente.referencia, v_facturas_cliente.tipo,'#10' v_' + 'facturas_cliente.fecha_factura, v_facturas_cliente.fecha_VENCIMI' + 'ENTO,'#10' v_facturas_cliente.base_imponible,'#10' v_facturas_client' + - 'e.situacion, v_facturas_cliente.descuento,'#10' v_facturas_cliente' + - '.importe_descuento, v_facturas_cliente.iva,'#10' v_facturas_client' + - 'e.importe_iva, v_facturas_cliente.re,'#10' v_facturas_cliente.impo' + - 'rte_re, v_facturas_cliente.importe_total,'#10' v_facturas_cliente.' + - 'observaciones, v_facturas_cliente.nif_cif,'#10' v_facturas_cliente' + - '.id_cliente, v_facturas_cliente.nombre,'#10' v_facturas_cliente.ca' + - 'lle, v_facturas_cliente.provincia,'#10' v_facturas_cliente.poblaci' + - 'on, v_facturas_cliente.codigo_postal,'#10' v_facturas_cliente.reca' + - 'rgo_equivalencia, v_facturas_cliente.importe_neto,'#10' v_facturas' + - '_cliente.importe_porte, formas_pago.descripcion as FORMA_PAGO,'#10' ' + - ' v_facturas_cliente.DATOS_BANCARIOS, v_facturas_cliente.RETENCI' + - 'ON, v_facturas_cliente.IMPORTE_RETENCION'#10'from v_facturas_cliente' + - #10' left outer join formas_pago on (formas_pago.id = v_facturas_' + - 'cliente.id_forma_pago)'#10'WHERE V_FACTURAS_CLIENTE.ID = :ID'#10 + 'e.situacion, v_facturas_cliente.descuento, v_facturas_cliente.de' + + 'scuento2,'#10' v_facturas_cliente.importe_descuento, v_facturas_cl' + + 'iente.importe_descuento2,'#10' v_facturas_cliente.iva, v_facturas_' + + 'cliente.importe_iva, v_facturas_cliente.re,'#10' v_facturas_client' + + 'e.importe_re, v_facturas_cliente.importe_total,'#10' v_facturas_cl' + + 'iente.observaciones, v_facturas_cliente.nif_cif,'#10' contactos.RE' + + 'FERENCIA as REF_CLIENTE,'#10' contactos.PERSONA_CONTACTO,'#10' conta' + + 'ctos2.nombre as nombre_vendedor,'#10' v_facturas_cliente.id_client' + + 'e, v_facturas_cliente.nombre,'#10' v_facturas_cliente.calle, v_fac' + + 'turas_cliente.provincia,'#10' v_facturas_cliente.poblacion, v_fact' + + 'uras_cliente.codigo_postal,'#10' v_facturas_cliente.recargo_equiva' + + 'lencia, v_facturas_cliente.importe_neto,'#10' v_facturas_cliente.i' + + 'mporte_porte, formas_pago.descripcion as FORMA_PAGO,'#10' v_factur' + + 'as_cliente.DATOS_BANCARIOS, v_facturas_cliente.RETENCION, v_fact' + + 'uras_cliente.IMPORTE_RETENCION'#10'from v_facturas_cliente'#10' left o' + + 'uter join contactos on (contactos.id = v_facturas_cliente.id_cli' + + 'ente)'#10' left outer join formas_pago on (formas_pago.id = v_fact' + + 'uras_cliente.id_forma_pago)'#10' left outer join clientes_datos on' + + ' (clientes_datos.id_cliente = v_facturas_cliente.id_cliente)'#10' ' + + 'left outer join contactos contactos2 on (contactos2.id = cliente' + + 's_datos.id_agente)'#10'WHERE V_FACTURAS_CLIENTE.ID = :ID'#10 StatementType = stSQL ColumnMappings = < item @@ -158,6 +165,26 @@ object RptFacturasCliente: TRptFacturasCliente item DatasetField = 'IMPORTE_RETENCION' TableField = 'IMPORTE_RETENCION' + end + item + DatasetField = 'DESCUENTO2' + TableField = 'DESCUENTO2' + end + item + DatasetField = 'IMPORTE_DESCUENTO2' + TableField = 'IMPORTE_DESCUENTO2' + end + item + DatasetField = 'REF_CLIENTE' + TableField = 'REF_CLIENTE' + end + item + DatasetField = 'PERSONA_CONTACTO' + TableField = 'PERSONA_CONTACTO' + end + item + DatasetField = 'NOMBRE_VENDEDOR' + TableField = 'NOMBRE_VENDEDOR' end> end> Name = 'InformeFacturasCliente' @@ -205,17 +232,25 @@ object RptFacturasCliente: TRptFacturasCliente end item Name = 'DESCUENTO' - DataType = datFloat + DataType = datCurrency DictionaryEntry = 'FacturasCliente_DESCUENTO' end + item + Name = 'DESCUENTO2' + DataType = datCurrency + end item Name = 'IMPORTE_DESCUENTO' DataType = datCurrency DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO' end + item + Name = 'IMPORTE_DESCUENTO2' + DataType = datCurrency + end item Name = 'IVA' - DataType = datFloat + DataType = datCurrency DictionaryEntry = 'FacturasCliente_IVA' end item @@ -225,7 +260,7 @@ object RptFacturasCliente: TRptFacturasCliente end item Name = 'RE' - DataType = datFloat + DataType = datCurrency end item Name = 'IMPORTE_RE' @@ -247,6 +282,21 @@ object RptFacturasCliente: TRptFacturasCliente Size = 15 DictionaryEntry = 'FacturasCliente_NIF_CIF' end + item + Name = 'REF_CLIENTE' + DataType = datString + Size = 255 + end + item + Name = 'PERSONA_CONTACTO' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE_VENDEDOR' + DataType = datString + Size = 255 + end item Name = 'ID_CLIENTE' DataType = datInteger @@ -306,7 +356,7 @@ object RptFacturasCliente: TRptFacturasCliente end item Name = 'RETENCION' - DataType = datFloat + DataType = datCurrency end item Name = 'IMPORTE_RETENCION' @@ -1529,17 +1579,25 @@ object RptFacturasCliente: TRptFacturasCliente end item Name = 'DESCUENTO' - DataType = datFloat + DataType = datCurrency DictionaryEntry = 'FacturasCliente_DESCUENTO' end + item + Name = 'DESCUENTO2' + DataType = datCurrency + end item Name = 'IMPORTE_DESCUENTO' DataType = datCurrency DictionaryEntry = 'FacturasCliente_IMPORTE_DESCUENTO' end + item + Name = 'IMPORTE_DESCUENTO2' + DataType = datCurrency + end item Name = 'IVA' - DataType = datFloat + DataType = datCurrency DictionaryEntry = 'FacturasCliente_IVA' end item @@ -1549,7 +1607,7 @@ object RptFacturasCliente: TRptFacturasCliente end item Name = 'RE' - DataType = datFloat + DataType = datCurrency end item Name = 'IMPORTE_RE' @@ -1571,6 +1629,21 @@ object RptFacturasCliente: TRptFacturasCliente Size = 15 DictionaryEntry = 'FacturasCliente_NIF_CIF' end + item + Name = 'REF_CLIENTE' + DataType = datString + Size = 255 + end + item + Name = 'PERSONA_CONTACTO' + DataType = datString + Size = 255 + end + item + Name = 'NOMBRE_VENDEDOR' + DataType = datString + Size = 255 + end item Name = 'ID_CLIENTE' DataType = datInteger @@ -1630,7 +1703,7 @@ object RptFacturasCliente: TRptFacturasCliente end item Name = 'RETENCION' - DataType = datFloat + DataType = datCurrency end item Name = 'IMPORTE_RETENCION' @@ -1691,63 +1764,38 @@ object RptFacturasCliente: TRptFacturasCliente PrintOptions.Printer = 'Por defecto' PrintOptions.PrintOnSheet = 0 ReportOptions.CreateDate = 39065.872423495400000000 - ReportOptions.LastChange = 39920.656640081000000000 + ReportOptions.LastChange = 40197.425634756900000000 ScriptLanguage = 'PascalScript' ScriptText.Strings = ( - '' - 'procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent);' 'var' - ' Cadena: String;' + ' Pagina: Variant;' + '' + '' + 'procedure Memo2OnBeforePrint(Sender: TfrxComponent);' 'begin' - '{ DatosEmpresa.Lines.Clear;' - ' if ( <> '#39#39') then' - ' Cadena := '#39'TLF: '#39' + ;' - ' if ( <> '#39#39') then' - - ' Cadena := Cadena + '#39' FAX: '#39' + ;' - ' DatosEmpresa.Lines.Add(Cadena);' - '}' + ' Memo2.Lines.Clear;' + ' if (StrToFloat() < 0) then' + ' Memo2.Lines.Add('#39'ORDEN DE DEVOLUCI'#211'N'#39')' + ' else' + ' Memo2.Lines.Add('#39'ALBAR'#193'N DE CLIENTE'#39')' 'end;' '' - 'procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent);' + 'procedure Memo5OnBeforePrint(Sender: TfrxComponent);' 'begin' - '{ NombreEmpresa.Lines.Clear;' - ' NombreEmpresa.Lines.Add();' - '}' + ' if (StrToFloat() < 0) then' + ' begin' + ' Memo5.Lines.Clear;' + ' Memo5.Lines.Add('#39'N'#186' orden:'#39');' + ' end;' 'end;' '' - 'procedure DireccionEnvioOnBeforePrint(Sender: TfrxComponent);' - 'var' - ' ACadena : String;' + 'procedure Memo9OnBeforePrint(Sender: TfrxComponent);' 'begin' - '{ ACadena := '#39#39';' - ' DireccionEnvio.Lines.Clear;' - ' if ( <> '#39#39') then' - ' ACadena := ;' - '' - ' if ( <> '#39#39') then' - - ' ACadena := ACadena + '#39' '#39' + ;' - '' - ' DireccionEnvio.Lines.Add(ACadena);' - ' ACadena := '#39#39';' - ' DireccionEnvio.Lines.Add();' - ' if ( <> '#39#39') then' - ' ACadena := + '#39' '#39';' - ' if ( <> '#39#39') then' - ' ACadena := ACadena + ;' - '' - ' if (ACadena <> '#39#39') then' - ' DireccionEnvio.Lines.Add(ACadena);' - '' - ' if ( <> '#39#39') then' - ' DireccionEnvio.Lines.Add();' - '' - ' if ( <> '#39#39') then' - ' DireccionEnvio.Lines.Add();' - '}' + ' if (StrToFloat() < 0) then' + ' begin' + ' Memo9.Lines.Clear;' + ' Memo9.Lines.Add('#39'Fecha orden:'#39');' + ' end;' 'end;' '' 'procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);' @@ -1756,111 +1804,13 @@ object RptFacturasCliente: TRptFacturasCliente ' Set('#39'TotalPaginas'#39', ( + 1));' '' ' if Engine.FinalPass then' - ' Set('#39'Pagina'#39', ( + 1)); ' + ' Set('#39'Pagina'#39', ( + 1));' 'end;' '' 'procedure frxReportOnStartReport(Sender: TfrxComponent);' 'begin' ' Set('#39'Pagina'#39', 0);' ' Set('#39'TotalPaginas'#39', 0);' - ' Set('#39'Capitulo'#39', 0);' - ' Set('#39'NumCapitulos'#39', 0); ' - 'end;' - '' - 'procedure Memo4OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if (Length() = 0) then' - ' Memo4.Visible := False; ' - 'end;' - '' - 'procedure Memo22OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if ( = 0) then' - ' begin ' - ' Subtotal.Text := '#39'Base imponible:'#39';' - ' BaseImponible.Text := '#39'Importe total:'#39'; ' - ' BaseImponible.Font.Style := fsBold;' - '' - - ' ImpBaseImponible.Text := FormatFloat('#39'#,##0.00 '#8364#39', );' - ' ImpBaseImponible.Font.Style := fsBold; ' - ' ' - ' Descuento.Text := '#39'[]% IVA:'#39';' - ' ImpDescuento.Text := '#39'[frxDBCabecera."IMPORTE_IVA"]'#39';' - ' Memo11.Color := $00CCFFCC;' - '' - ' if ( > 0) then' - ' begin ' - ' BaseImponible.Text := '#39'Total certificaci'#243'n:'#39';' - - ' IVA.Text := FormatFloat('#39'#,##0.00 %'#39',) + '#39' Retenci'#243'n:'#39'; ' - - ' ImpIVA.Text := FormatFloat('#39'-#,##0.00 '#8364#39',);' - - ' ImporteTotal.Text := '#39'TOTAL FACTURA'#39'; ' + - ' ' + - ' ' - - ' ImpImporteTotal.Text := FormatFloat('#39'#,##0.00 '#8364#39', ( - ' + - ')); ' - ' end ' - ' else' - ' begin' - ' IVA.Visible := False;' - ' ImpIVA.Visible := False;' - ' ImporteTotal.Visible := False;' - ' ImpImporteTotal.Visible := False;' - ' Memo16.Visible := False; ' - ' Memo17.Visible := False;' - ' end;' - ' end' - ' else' - ' begin ' - ' if ( > 0) then' - ' begin' - ' ImporteTotal.Text := '#39'Total certificaci'#243'n:'#39'; ' - ' Retencion.Visible := True;' - ' ImpRetencion.Visible := True;' - ' LinRetencion.Visible := True; ' - ' TotalFacturaRet.Visible := True;' - ' ImpTotalFacturaRet.Visible := True;' - ' LinImporteTotalFacturaRet.Visible := True; ' - ' end' - ' end ' - 'end;' - '' - 'procedure Memo39OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' Memo39.Clear; ' - ' if ( = '#39'F'#39') then' - - ' Memo39.Text := '#39'FACTURA'#39' ' + - ' ' - ' else' - ' Memo39.Text := '#39'ABONO'#39'; ' - 'end;' - '' - 'procedure Picture4OnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if ( = 1) then' - ' Picture4.Visible := True' - ' else' - ' Picture4.Visible := False; ' - 'end;' - '' - 'procedure eCopiaOnBeforePrint(Sender: TfrxComponent);' - 'begin' - ' if ( = 1) then' - ' begin ' - ' eCopia.Visible := True; ' - ' Picture4.Visible := False; ' - ' end ' - ' else' - ' eCopia.Visible := False; ' 'end;' '' 'begin' diff --git a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas index 82ad53d..e4f5322 100644 --- a/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas +++ b/Source/Modulos/Facturas de cliente/Reports/uRptFacturasCliente_Server.pas @@ -85,11 +85,11 @@ type frxDBInformeListadoFacturasPendientes: TfrxDBDataset; DADSInformeListadoFacturasPendientes: TDADataSource; tbl_InformeListadoFacturasPendientes: TDAMemDataTable; - schReport: TDASchema; frxDBInformeListadoFacturasResumen: TfrxDBDataset; DADSInformeListadoFacturasResumen: TDADataSource; tbl_InformeListadoFacturasResumen: TDAMemDataTable; Bin2DataStreamer: TDABin2DataStreamer; + schReport: TDASchema; procedure DataModuleCreate(Sender: TObject); procedure DataModuleDestroy(Sender: TObject); private @@ -675,20 +675,16 @@ begin raise Exception.Create (('Error Servidor: _GenerarFactura, no encuentra informe ' + rptFacturaCliente)); frxReport.LoadFromFile(AInforme, True); - if VerSello then - frxReport.Variables.Variables['VerSello'] := 1 - else - frxReport.Variables.Variables['VerSello'] := 0; //La primera impresion siempre es sin la etiqueta copia frxReport.Variables.Variables['VerCopia'] := 0; frxReport.PrepareReport(False); - if VerCopia then - begin - frxReport.Variables.Variables['VerCopia'] := 1; - frxReport.Variables.Variables['VerSello'] := 0; //El sello nunca saldrá en la copia - frxReport.PrepareReport(False); - end; +// if VerCopia then +// begin +// frxReport.Variables.Variables['VerCopia'] := 1; +// frxReport.Variables.Variables['VerSello'] := 0; //El sello nunca saldrá en la copia +// frxReport.PrepareReport(False); +// end; finally FConnection.RollbackTransaction; //<--- Creo que no va a hacer falta. "PUES SI ES NECESARIO" diff --git a/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.dfm b/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.dfm index 9922c1f..efb79bd 100644 --- a/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.dfm +++ b/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.dfm @@ -52,26 +52,22 @@ inherited fDialogOpcionesImpresionFacturasCliente: TfDialogOpcionesImpresionFact Height = 130 ExplicitWidth = 418 ExplicitHeight = 130 - object cbVerCopia: TCheckBox + object cbContabilidad: TCheckBox AlignWithMargins = True Left = 50 Top = 51 Width = 279 Height = 17 - Caption = 'Indicar '#39'COPIA'#39' en la cabecera' - Checked = True - State = cbChecked + Caption = 'Indicar '#39'CONTABILIDAD'#39' en la cabecera' TabOrder = 0 end - object cbVerSello: TCheckBox + object cbCopia: TCheckBox AlignWithMargins = True Left = 50 Top = 28 Width = 200 Height = 17 - Caption = 'Mostrar sello de la empresa' - Checked = True - State = cbChecked + Caption = 'Indicar '#39'COPIA'#39' en la cabecera' TabOrder = 1 end end diff --git a/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.pas index 50b2c5f..ab0f497 100644 --- a/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uDialogOpcionesImpresionFacturasCliente.pas @@ -8,8 +8,8 @@ uses type TfDialogOpcionesImpresionFacturasCliente = class(TfDialogBase) - cbVerSello: TCheckBox; - cbVerCopia: TCheckBox; + cbCopia: TCheckBox; + cbContabilidad: TCheckBox; procedure actAceptarExecute(Sender: TObject); procedure actCancelarExecute(Sender: TObject); private @@ -18,25 +18,27 @@ type { Public declarations } end; - function ElegirOpcionesImpresionFacturaCliente(var AVerSello : Boolean; var AVerCopia : Boolean): Boolean; + function ElegirOpcionesImpresionFacturaCliente(var AMarca : Integer): Boolean; implementation {$R *.dfm} -function ElegirOpcionesImpresionFacturaCliente(var AVerSello : Boolean; var AVerCopia : Boolean): Boolean; +function ElegirOpcionesImpresionFacturaCliente(var AMarca : Integer): Boolean; var AEditor : TfDialogOpcionesImpresionFacturasCliente; begin AEditor := TfDialogOpcionesImpresionFacturasCliente.Create(NIL); try - AEditor.cbVerSello.Checked := AVerSello; - AEditor.cbVerCopia.Checked := AVerCopia; + AEditor.cbCopia.Checked := False; + AEditor.cbContabilidad.Checked := False; Result := (AEditor.ShowModal = mrOk); if Result then begin - AVerSello := AEditor.cbVerSello.Checked; + if True then + + AVerSello := ; AVerCopia := AEditor.cbVerCopia.Checked; end; finally diff --git a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas index 37ac36d..0a8044d 100644 --- a/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas +++ b/Source/Modulos/Facturas de cliente/Views/uEditorFacturasCliente.pas @@ -303,13 +303,12 @@ var Respuesta : Integer; AFacturas: IBizFacturaCliente; AllItems: Boolean; - AVerSello: Boolean; - AVerCopia: Boolean; + AMarca: Integer; + begin AFacturas := Nil; AllItems := False; - AVerSello := True; - AVerCopia := True; + AMarca := 0; if MultiSelect and Assigned(ViewGrid) then AllItems := (ViewGrid.NumSeleccionados > 1); @@ -336,7 +335,7 @@ begin AFacturas := Facturas; //Preguntamos si desea que en las facturas se vea el Sello - if ElegirOpcionesImpresionFacturaCliente(AVerSello, AVerCopia) then + if ElegirOpcionesImpresionFacturaCliente(AMarca) then if Assigned(AFacturas) then FController.Print(AFacturas, AllItems, AVerSello, AVerCopia); end;