Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
ConsumoSriAutorizacion
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GERMAN PATRICIO ROMERO QUISHPE
ConsumoSriAutorizacion
Commits
89387b33
Commit
89387b33
authored
a year ago
by
ROBERTO XAVIER GARCIA PAZMINO
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'GERM-MAYO-2023' into 'master'
Germ mayo 2023 See merge request
!1
parents
c49a3892
cb749661
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
2071 additions
and
0 deletions
+2071
-0
pom.xml
+19
-0
src/main/java/ec/edu/epn/consumosriautorizacion/controller/ConsultasFacturacionController.java
+319
-0
src/main/java/ec/edu/epn/consumosriautorizacion/controller/GeneracionFactOfflinePDF.java
+569
-0
src/main/java/ec/edu/epn/consumosriautorizacion/controller/GeneracionFactOfflineXML.java
+38
-0
src/main/java/ec/edu/epn/consumosriautorizacion/dto/ConceptoDTO.java
+171
-0
src/main/java/ec/edu/epn/consumosriautorizacion/dto/DetallefacturaDTO.java
+156
-0
src/main/java/ec/edu/epn/consumosriautorizacion/dto/FacturaDTO.java
+432
-0
src/main/java/ec/edu/epn/consumosriautorizacion/dto/FormaPagoDTO.java
+64
-0
src/main/java/ec/edu/epn/consumosriautorizacion/dto/PagosDTO.java
+140
-0
src/main/java/ec/edu/epn/consumosriautorizacion/dto/ServicioDTO.java
+78
-0
src/main/java/ec/edu/epn/consumosriautorizacion/service/conexionPostgres.java
+85
-0
No files found.
pom.xml
View file @
89387b33
...
...
@@ -73,6 +73,25 @@
<version>
2.3.5
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
<dependency>
<groupId>
com.itextpdf
</groupId>
<artifactId>
itextpdf
</artifactId>
<version>
5.5.13.3
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/postgresql/postgresql -->
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
9.4-1200-jdbc41
</version>
</dependency>
<!--<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/controller/ConsultasFacturacionController.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
controller
;
import
ec.edu.epn.consumosriautorizacion.dto.*
;
import
ec.edu.epn.consumosriautorizacion.service.conexionPostgres
;
import
java.io.Serializable
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
ConsultasFacturacionController
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
void
consumoFactura
(
String
numAutorizacion
){
FacturaDTO
facturaDTO
=
new
FacturaDTO
();
PreparedStatement
ps
=
null
;
try
{
Statement
stmt
=
coneccionSQL
().
createStatement
();
String
sql
=
"SELECT id_factura as id, "
+
"fechafac_f as fechaFac, "
+
"subtotal_f as subtotal, descuento_f as descuento, "
+
"iva_f as iva, total_f as total, "
+
"id_estado_factura as estado,"
+
"id_punto_facturacion as puntofact,"
+
"id_caja as caja, tipo_f as tipo,"
+
"porcentajeiva as porcentajeiva,"
+
"nombre_e as nombree, direccion_e as direccione,"
+
"telefono_e as telefonoe, carrera_e as carrerae,"
+
"cedula_e as cedulae,"
+
"nropagos, "
+
"email_cl as emailcli,"
+
"estadomail, "
+
"claveacceso,"
+
"numautoriza, "
+
"ambiente, emision,"
+
"estado_sri as estadosri, xml "
+
"FROM \"Facturacion\".factura;"
+
"WHERE trim(numautoriza)= ?"
;
ps
=
coneccionSQL
().
prepareStatement
(
sql
);
ps
.
setString
(
1
,
numAutorizacion
);
ResultSet
rs
=
ps
.
executeQuery
(
sql
);
while
(
rs
.
next
())
{
facturaDTO
.
setIdFactura
(
rs
.
getString
(
1
));
facturaDTO
.
setFechafacF
(
rs
.
getTimestamp
(
2
));
facturaDTO
.
setSubtotalF
(
rs
.
getDouble
(
3
));
facturaDTO
.
setDescuentoF
(
rs
.
getDouble
(
4
));
facturaDTO
.
setIvaF
(
rs
.
getDouble
(
5
));
facturaDTO
.
setTotalF
(
rs
.
getDouble
(
6
));
facturaDTO
.
setEstadoFactura
(
rs
.
getString
(
7
));
facturaDTO
.
setPuntoFacturacion
(
rs
.
getString
(
8
));
facturaDTO
.
setIdCaja
(
rs
.
getInt
(
9
));
facturaDTO
.
setTipoF
(
rs
.
getString
(
10
));
facturaDTO
.
setPorcentajeiva
(
rs
.
getBigDecimal
(
11
));
facturaDTO
.
setNombreE
(
rs
.
getString
(
12
));
facturaDTO
.
setNombreCli
(
rs
.
getString
(
12
));
facturaDTO
.
setDireccionE
(
rs
.
getString
(
13
));
facturaDTO
.
setDireccionCli
(
rs
.
getString
(
13
));
facturaDTO
.
setTelefonoE
(
rs
.
getString
(
14
));
facturaDTO
.
setTelefonoCli
(
rs
.
getString
(
14
));
facturaDTO
.
setCarreraE
(
rs
.
getString
(
15
));
facturaDTO
.
setCedulaE
(
rs
.
getString
(
16
));
facturaDTO
.
setCedulaCli
(
rs
.
getString
(
16
));
facturaDTO
.
setRucCli
(
rs
.
getString
(
16
));
facturaDTO
.
setIdEstudiante
(
rs
.
getString
(
16
));
facturaDTO
.
setNropagos
(
rs
.
getInt
(
17
));
facturaDTO
.
setEmailCl
(
rs
.
getString
(
18
)==
null
?
""
:
rs
.
getString
(
18
));
facturaDTO
.
setEstadomail
(
rs
.
getString
(
19
));
facturaDTO
.
setClaveacceso
(
rs
.
getString
(
20
));
facturaDTO
.
setNumautoriza
(
rs
.
getString
(
21
));
facturaDTO
.
setAmbiente
(
rs
.
getString
(
22
));
facturaDTO
.
setEmision
(
rs
.
getString
(
23
));
facturaDTO
.
setEstadoSri
(
rs
.
getString
(
24
));
facturaDTO
.
setXml
(
rs
.
getString
(
25
));
}
conexionPostgres
conexionSQL
=
new
conexionPostgres
();
conexionSQL
.
closeConnection
();
}
catch
(
Exception
e
){
facturaDTO
=
null
;
}
}
public
void
consumoDetalleFact
(
String
idFactura
){
List
<
DetallefacturaDTO
>
listDetalleFAct
=
new
ArrayList
<
DetallefacturaDTO
>();
PreparedStatement
ps
=
null
;
try
{
String
sql
=
"SELECT id_servicio,"
+
"id_factura,"
+
"id_detallefactura,"
+
"costo_df,"
+
"unidades_df,"
+
"costot_df,"
+
"id_metodo,"
+
"id_concepto,"
+
"porcentajeiva,"
+
"valor_iva,n"
+
"subtotal,"
+
"nombreser"
+
"FROM \"Facturacion\".detallefactura WHERE id_factura= ?"
;
ps
=
coneccionSQL
().
prepareStatement
(
sql
);
ps
.
setString
(
1
,
idFactura
);
ResultSet
rs
=
ps
.
executeQuery
(
sql
);
while
(
rs
.
next
())
{
DetallefacturaDTO
detalleDTO
=
new
DetallefacturaDTO
();
detalleDTO
.
setIdServicio
(
rs
.
getString
(
1
)==
null
?
""
:
rs
.
getString
(
1
));
detalleDTO
.
setIdFactura
(
rs
.
getString
(
2
));
detalleDTO
.
setIdDetallefactura
(
rs
.
getString
(
3
));
detalleDTO
.
setCostoDf
(
rs
.
getDouble
(
4
));
detalleDTO
.
setUnidadesDf
(
rs
.
getInt
(
5
));
detalleDTO
.
setCostotDf
(
rs
.
getDouble
(
6
));
detalleDTO
.
setIdMetodo
(
rs
.
getString
(
7
)==
null
?
""
:
rs
.
getString
(
7
));
detalleDTO
.
setConcepto
(
rs
.
getString
(
8
));
detalleDTO
.
setPorcentajeiva
(
rs
.
getBigDecimal
(
9
));
detalleDTO
.
setValorIva
(
rs
.
getDouble
(
10
));
detalleDTO
.
setSubtotal
(
rs
.
getDouble
(
11
));
detalleDTO
.
setNombreser
(
rs
.
getString
(
12
)==
null
?
""
:
rs
.
getString
(
12
));
detalleDTO
.
setConceptoDTO
(
this
.
consumoConcepto
(
detalleDTO
.
getConcepto
()));
listDetalleFAct
.
add
(
detalleDTO
);
}
conexionPostgres
conexionSQL
=
new
conexionPostgres
();
conexionSQL
.
closeConnection
();
}
catch
(
Exception
e
){
listDetalleFAct
=
null
;
}
}
public
void
consumoPagos
(
String
idFactura
){
List
<
PagosDTO
>
listPagosDTO
=
new
ArrayList
<
PagosDTO
>();
PreparedStatement
ps
=
null
;
try
{
String
sql
=
"SELECT id_pagos,"
+
"id_factura,"
+
"numero_documento_pa,"
+
"monto_pa,"
+
"saldo_pa,"
+
"id_bancos,"
+
"id_forma_pago,"
+
"id_tc,"
+
"comision_tc"
+
" FROM \"Facturacion\".pagos WHERE id_factura=?"
;
ps
=
coneccionSQL
().
prepareStatement
(
sql
);
ps
.
setString
(
1
,
idFactura
);
ResultSet
rs
=
ps
.
executeQuery
(
sql
);
while
(
rs
.
next
())
{
PagosDTO
pagosDTO
=
new
PagosDTO
();
pagosDTO
.
setIdPagos
(
rs
.
getString
(
1
));
pagosDTO
.
setIdFactura
(
rs
.
getString
(
2
));
pagosDTO
.
setNumeroDocumentoPa
(
rs
.
getString
(
3
)==
null
?
""
:
rs
.
getString
(
3
));
pagosDTO
.
setMontoPa
(
rs
.
getBigDecimal
(
4
));
pagosDTO
.
setSaldoPa
(
rs
.
getBigDecimal
(
5
));
pagosDTO
.
setIdBancos
(
rs
.
getInt
(
6
));
pagosDTO
.
setIdFormaPago
(
rs
.
getString
(
7
));
pagosDTO
.
setIdTc
(
rs
.
getString
(
8
));
pagosDTO
.
setComisionTc
(
rs
.
getDouble
(
9
));
pagosDTO
.
setFormaPagoDTO
(
this
.
consumoFormaPago
(
pagosDTO
.
getIdFormaPago
()));
listPagosDTO
.
add
(
pagosDTO
);
}
}
catch
(
Exception
e
){
listPagosDTO
=
null
;
}
}
public
FormaPagoDTO
consumoFormaPago
(
String
idFormaPago
){
FormaPagoDTO
formaPagoDTO
=
new
FormaPagoDTO
();
PreparedStatement
ps
=
null
;
try
{
String
sql
=
"SELECT id_forma_pago,"
+
"nombre_fp,"
+
"descr_fp,"
+
"codigo_sri,"
+
"activo,"
+
"codigo_sae"
+
"FROM \"Facturacion\".forma_pago WHERE id_forma_pago=?;"
;
ps
=
coneccionSQL
().
prepareStatement
(
sql
);
ps
.
setString
(
1
,
idFormaPago
);
ResultSet
rs
=
ps
.
executeQuery
(
sql
);
while
(
rs
.
next
())
{
formaPagoDTO
.
setIdFormaPago
(
rs
.
getString
(
1
));
formaPagoDTO
.
setNombreFp
(
rs
.
getString
(
2
));
formaPagoDTO
.
setDescrFp
(
rs
.
getString
(
3
));
formaPagoDTO
.
setCodigoSri
(
rs
.
getString
(
4
));
formaPagoDTO
.
setActivo
(
rs
.
getString
(
5
));
formaPagoDTO
.
setCodigoSae
(
rs
.
getString
(
6
));
}
return
formaPagoDTO
;
}
catch
(
Exception
e
){
return
null
;
}
}
public
ConceptoDTO
consumoConcepto
(
String
idConcepto
){
ConceptoDTO
conceptoDTO
=
new
ConceptoDTO
();
PreparedStatement
ps
=
null
;
try
{
String
sql
=
"SELECT id_concepto, nombre_concp"
+
" FROM \"Facturacion\".concepto WHERE id_concepto= ?;"
;
ps
=
coneccionSQL
().
prepareStatement
(
sql
);
ps
.
setString
(
1
,
idConcepto
);
ResultSet
rs
=
ps
.
executeQuery
(
sql
);
while
(
rs
.
next
())
{
conceptoDTO
.
setIdConcepto
(
rs
.
getString
(
1
));
conceptoDTO
.
setNombreConcp
(
rs
.
getString
(
2
));
}
return
conceptoDTO
;
}
catch
(
Exception
e
){
return
null
;
}
}
public
ServicioDTO
consumoServicio
(
String
idServicio
){
ServicioDTO
servicioDTO
=
new
ServicioDTO
();
PreparedStatement
ps
=
null
;
try
{
String
sql
=
"SELECT id_servicio, id_laboratorio,"
+
"id_tiposerv, nombre_s,"
+
"descr_s, aux_id_servicio,"
+
"precio_s"
+
" FROM \"Laboratorios\".servicio WHERE id_servicio= ?;"
;
ps
=
coneccionSQL
().
prepareStatement
(
sql
);
ps
.
setString
(
1
,
idServicio
);
ResultSet
rs
=
ps
.
executeQuery
(
sql
);
while
(
rs
.
next
())
{
servicioDTO
.
setIdServicio
(
rs
.
getString
(
1
));
servicioDTO
.
setLaboratorio
(
rs
.
getString
(
2
));
servicioDTO
.
setTiposervicio
(
rs
.
getString
(
3
));
servicioDTO
.
setNombreS
(
rs
.
getString
(
4
));
servicioDTO
.
setDescrS
(
rs
.
getString
(
5
));
servicioDTO
.
setAuxIdServicio
(
rs
.
getInt
(
6
));
servicioDTO
.
setPrecioS
(
rs
.
getFloat
(
7
));
}
return
servicioDTO
;
}
catch
(
Exception
e
){
return
null
;
}
}
private
Connection
coneccionSQL
()
{
try
{
conexionPostgres
conexionSQL
=
new
conexionPostgres
();
Connection
con
=
conexionSQL
.
getConnection
();
return
con
;
}
catch
(
Exception
e
)
{
return
null
;
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/controller/GeneracionFactOfflinePDF.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
controller
;
import
java.awt.Color
;
import
java.awt.Font
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
javax.naming.InitialContext
;
import
com.itextpdf.text.BaseColor
;
import
com.itextpdf.text.Document
;
import
com.itextpdf.text.Element
;
import
com.itextpdf.text.FontFactory
;
import
com.itextpdf.text.Image
;
import
com.itextpdf.text.PageSize
;
import
com.itextpdf.text.Paragraph
;
import
com.itextpdf.text.Phrase
;
import
com.itextpdf.text.pdf.Barcode128
;
import
com.itextpdf.text.pdf.Barcode39
;
import
com.itextpdf.text.pdf.BarcodeEAN
;
import
com.itextpdf.text.pdf.PdfContentByte
;
import
com.itextpdf.text.pdf.PdfImportedPage
;
import
com.itextpdf.text.pdf.PdfPCell
;
import
com.itextpdf.text.pdf.PdfPTable
;
import
com.itextpdf.text.pdf.PdfReader
;
import
com.itextpdf.text.pdf.PdfWriter
;
import
ec.edu.epn.consumosriautorizacion.dto.DetallefacturaDTO
;
import
ec.edu.epn.consumosriautorizacion.dto.FacturaDTO
;
import
ec.edu.epn.consumosriautorizacion.dto.PagosDTO
;
import
ec.edu.epn.consumosriautorizacion.dto.ServicioDTO
;
public
class
GeneracionFactOfflinePDF
{
public
String
generarPDFFacturaOffline
(
FacturaDTO
factura
,
List
<
DetallefacturaDTO
>
detalle
,
Double
total
,
Collection
<
PagosDTO
>
pagos
)
{
String
url
=
""
;
try
{
Date
hoy
=
factura
.
getFechafacF
();
String
hoyFecha
=
""
;
DateFormat
fecha
=
new
SimpleDateFormat
(
"dd/MM/yyyy"
);
DateFormat
fechaMs
=
new
SimpleDateFormat
(
"dd/MM/yyyy hh:mm:ss"
);
hoyFecha
=
fecha
.
format
(
hoy
);
String
locate
=
"/FacturaUtils/"
;
//String locate = "C:/facturacion_electronica/facturaUtils/";
System
.
out
.
println
(
"-->"
+
locate
);
// DOCUMENTO TIPO A4
Document
document
=
new
Document
(
PageSize
.
A4
);
//ARCHIVO QUE SE CREA CON EL ID DE LA FACTURA
FileOutputStream
outputStream
=
new
FileOutputStream
(
new
File
(
locate
+
factura
.
getIdFactura
()
+
"-"
+
factura
.
getRucCli
().
trim
()
+
".pdf"
));
url
=
locate
+
factura
.
getIdFactura
()
+
"-"
+
factura
.
getRucCli
().
trim
()
+
".pdf"
;
PdfWriter
writer
=
PdfWriter
.
getInstance
(
document
,
outputStream
);
// SE ABRE EL ARCHIVO PARA CREAR
document
.
open
();
// VARIABLE PARA OCUPAR OTRO PDF COMO PLANTILLA
PdfContentByte
cb
=
writer
.
getDirectContent
();
// CARGA DE LA PLANTILLA
String
path
=
locate
+
"Plantilla2.pdf"
;
PdfReader
reader
=
new
PdfReader
(
path
);
// GENERAMOS UNA PAGINA
PdfImportedPage
page
=
writer
.
getImportedPage
(
reader
,
1
);
// PONEMOS LA PLANTILLA DENTRO DEL DOCUMENTO CREAR PARA TNENER LA PLANTILLA
document
.
newPage
();
cb
.
addTemplate
(
page
,
0
,
0
);
// CREACION DE CONTENIDO INICIO Y NUMERO DE LA FACTURA
PdfPTable
datosFactura
=
new
PdfPTable
(
2
);
datosFactura
.
setWidthPercentage
(
100
);
datosFactura
.
getDefaultCell
().
setBorder
(
0
);
float
[]
columnWidths1
=
new
float
[]{
50
f
,
50
f
};
datosFactura
.
setWidths
(
columnWidths1
);
Image
img
=
Image
.
getInstance
(
locate
+
"epn_cabecera.png"
);
img
.
scalePercent
(
50
);
img
.
setAlignment
(
Element
.
ALIGN_CENTER
);
img
.
scalePercent
(
25
f
);
img
.
setAbsolutePosition
(
250
f
,
620
f
);
img
.
setBorder
(
0
);
datosFactura
.
addCell
(
img
);
Image
imgD
=
createBarcode39Extended
(
factura
.
getNumautoriza
(),
writer
);
imgD
.
setAlignment
(
Element
.
ALIGN_CENTER
);
imgD
.
setBorder
(
0
);
PdfPTable
codBarras
=
new
PdfPTable
(
1
);
//codBarras.getDefaultCell().setBorder(0);
codBarras
.
addCell
(
createLabelCell2
(
"R.U.C.: 1760005620001"
+
"\n\n"
+
"FACTURA"
+
"\n\n"
+
"No. "
+
factura
.
getIdFactura
()
+
"\n\n"
+
"N�MERO DE AUTORIZACI�N"
+
"\n\n"
+
factura
.
getNumautoriza
()
+
"\n\n"
+
"FECHA Y HORA DE "
+
factura
.
getFechaautoriza
()
+
"\n"
+
"AUTORIZACI�N:"
+
"\n\n"
+
"AMBIENTE: "
+
factura
.
getAmbiente
()
+
"\n\n"
+
"EMISI�N: "
+
factura
.
getEmision
()
+
"\n\n"
+
" CLAVE DE ACCESO"
+
"\n\n"
));
codBarras
.
addCell
(
imgD
);
datosFactura
.
addCell
(
codBarras
);
document
.
add
(
datosFactura
);
Paragraph
datosEspacio1
=
new
Paragraph
();
datosEspacio1
.
add
(
"\n"
);
datosEspacio1
.
setFont
(
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
10
,
Font
.
ITALIC
));
document
.
add
(
datosEspacio1
);
// CREANDO CONTENIDO CABECERA ANTES DE LA TABLA DE DETALLE
com
.
itextpdf
.
text
.
Font
fuente
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
10
,
Font
.
BOLD
);
PdfPTable
datoscabecera
=
new
PdfPTable
(
1
);
datoscabecera
.
setWidthPercentage
(
100
);
datoscabecera
.
addCell
(
createLabelCell3
(
"Raz�n Social/ Nombres y Apellidos:\t\t\t\t\t\t\t\t\t "
+
factura
.
getNombreCli
()
+
"\n"
+
"\t\t\t\tidentificaci�n:"
+
factura
.
getRucCli
()
+
"\n\n"
+
"Fecha Emisi�n: "
+
hoyFecha
));
document
.
add
(
datoscabecera
);
Paragraph
datosContrato
=
new
Paragraph
();
fuente
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
10
,
Font
.
ITALIC
);
datosContrato
.
add
(
"\n"
);
datosContrato
.
setFont
(
fuente
);
document
.
add
(
datosContrato
);
// CARGA ACADEMICA EN TABLA
PdfPTable
datosfactura
=
new
PdfPTable
(
10
);
datosfactura
.
setWidthPercentage
(
100
);
float
[]
columnWidths
=
new
float
[]{
18
f
,
18
f
,
22
f
,
60
f
,
22
f
,
22
f
,
22
f
,
22
f
,
22
f
,
30
f
};
datosfactura
.
setWidths
(
columnWidths
);
datosfactura
.
addCell
(
createLabelCell
(
"Cod. Principal"
));
datosfactura
.
addCell
(
createLabelCell
(
"Cod. Auxiliar"
));
datosfactura
.
addCell
(
createLabelCell
(
"Cant."
));
datosfactura
.
addCell
(
createLabelCell
(
"Descripci�n"
));
datosfactura
.
addCell
(
createLabelCell
(
"Detalle Adicional 1"
));
datosfactura
.
addCell
(
createLabelCell
(
"Detalle Adicional 2"
));
datosfactura
.
addCell
(
createLabelCell
(
"Detalle Adicional 3"
));
datosfactura
.
addCell
(
createLabelCell
(
"Precio Unitario"
));
datosfactura
.
addCell
(
createLabelCell
(
"Descuento"
));
datosfactura
.
addCell
(
createLabelCell
(
"Precio Total"
));
for
(
DetallefacturaDTO
det
:
detalle
)
{
if
(
det
.
getIdServicio
()
==
null
||
det
.
getIdServicio
().
equals
(
""
))
{
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getConceptoDTO
().
getIdConcepto
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getConceptoDTO
().
getIdConcepto
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getUnidadesDf
().
toString
()));
if
(
det
.
getNombreser
()
!=
null
)
{
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getNombreser
()
+
"\n\n"
));
}
else
{
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getConceptoDTO
().
getNombreConcp
()
+
"\n\n"
));
}
}
else
{
ConsultasFacturacionController
consultas
=
new
ConsultasFacturacionController
();
ServicioDTO
servicio
=
consultas
.
consumoServicio
(
det
.
getIdServicio
());
if
(
servicio
==
null
){
if
(
det
.
getConcepto
()!=
null
){
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getConceptoDTO
().
getIdConcepto
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getConceptoDTO
().
getIdConcepto
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getUnidadesDf
().
toString
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getConceptoDTO
().
getNombreConcp
()
+
"\n\n"
));
}
}
else
{
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getIdServicio
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getIdServicio
()));
datosfactura
.
addCell
(
createLabelCell4
(
det
.
getUnidadesDf
().
toString
()));
datosfactura
.
addCell
(
createLabelCell4
(
servicio
.
getNombreS
()));
}
}
datosfactura
.
addCell
(
createLabelCell4
(
""
));
//---------------DETALLE ADICIONAL 1
datosfactura
.
addCell
(
createLabelCell4
(
""
));
//---------------DETALLE ADICIONAL 2
datosfactura
.
addCell
(
createLabelCell4
(
""
));
//---------------DETALLE ADICIONAL 3
datosfactura
.
addCell
(
createLabelCell4
(
String
.
valueOf
(
new
BigDecimal
(
det
.
getCostoDf
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
//------------PRECIO UNITARIO
datosfactura
.
addCell
(
createLabelCell4
(
String
.
valueOf
(
new
BigDecimal
(
0
).
setScale
(
2
,
RoundingMode
.
HALF_UP
))));
//---------------DESCUENTO
datosfactura
.
addCell
(
createLabelCell4
(
String
.
valueOf
(
new
BigDecimal
(
det
.
getCostotDf
()).
setScale
(
2
,
// -----------------PRECIO TOTAL
RoundingMode
.
HALF_UP
))));
}
/**SE PRESENTA LOS PAGOS QUE SE REALIZARON*/
String
pagosF
=
""
;
if
(
pagos
!=
null
){
for
(
PagosDTO
pag
:
pagos
)
{
pagosF
+=
" "
+
pag
.
getFormaPagoDTO
().
getNombreFp
()
+
": "
+
new
BigDecimal
(
pag
.
getMontoPa
().
doubleValue
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
+
"\n\n"
;
}
}
PdfPTable
tblInfAdicional
=
new
PdfPTable
(
1
);
tblInfAdicional
.
setWidthPercentage
(
50
);
PdfPCell
celda
;
PdfPCell
celdaInfAdicional
;
com
.
itextpdf
.
text
.
Font
fuente1
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
9
);
String
text
=
" Informaci�n Adicional "
+
"\n\n"
+
"Direcci�n: "
+
factura
.
getDireccionCli
()
+
"\n\n"
+
"Tel�fono: "
+
factura
.
getTelefonoCli
()
+
"\n\n"
+
"Email: "
+
factura
.
getEmailCl
()
+
"\n\n"
+
"Forma de Pago: "
+
pagosF
;
celdaInfAdicional
=
new
PdfPCell
(
new
Phrase
(
text
,
fuente1
));
celdaInfAdicional
.
setHorizontalAlignment
(
Element
.
ALIGN_LEFT
);
celdaInfAdicional
.
setVerticalAlignment
(
Element
.
ALIGN_MIDDLE
);
celdaInfAdicional
.
setPaddingLeft
(
6
);
// LA CELDA TOMA 2 ESPACIOS VERTICALES
tblInfAdicional
.
addCell
(
celdaInfAdicional
);
celda
=
new
PdfPCell
(
tblInfAdicional
);
celda
.
setRowspan
(
11
);
celda
.
setColspan
(
6
);
celda
.
setHorizontalAlignment
(
Element
.
ALIGN_LEFT
);
celda
.
setVerticalAlignment
(
Element
.
ALIGN_MIDDLE
);
celda
.
setBorder
(
0
);
datosfactura
.
addCell
(
celda
);
String
textEsp
=
""
;
PdfPCell
celdaEsp
;
celdaEsp
=
new
PdfPCell
(
new
Phrase
(
textEsp
,
fuente1
));
celdaEsp
.
setRowspan
(
11
);
celdaEsp
.
setColspan
(
1
);
celdaEsp
.
setBorder
(
0
);
datosfactura
.
addCell
(
celdaEsp
);
//SUBTOTAL...
PdfPCell
celda1
;
PdfPCell
celda2
;
celda1
=
new
PdfPCell
(
new
Phrase
(
"SUBTOTAL 12%"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
/**SE REALIZA UN DESGLOSE DE LOS VALORES CON IVA Y SIN IVA*/
double
val
=
0.0
;
BigDecimal
subTotalIva
=
new
BigDecimal
(
val
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
subTotalSinIva
=
new
BigDecimal
(
val
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
for
(
DetallefacturaDTO
det
:
detalle
)
{
if
(
det
.
getPorcentajeiva
()
==
null
||
det
.
getPorcentajeiva
().
intValue
()
==
0
){
subTotalSinIva
=
subTotalSinIva
.
add
(
new
BigDecimal
(
det
.
getCostotDf
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
else
if
(
det
.
getPorcentajeiva
().
toString
().
contains
(
"12"
)){
subTotalIva
=
subTotalIva
.
add
(
new
BigDecimal
(
det
.
getCostotDf
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
));
}
}
celda2
=
new
PdfPCell
(
new
Phrase
(
subTotalIva
.
toString
(),
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"SUBTOTAL 0%"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
subTotalSinIva
.
toString
(),
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"SUBTOTAL no objeto de IVA"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
"0.00"
,
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"SUBTOTAL Exento de IVA"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
"0.00"
,
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"SUBTOTAL SIN IMPUESTOS"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
BigDecimal
stFac1
=
new
BigDecimal
(
factura
.
getSubtotalF
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
celda2
=
new
PdfPCell
(
new
Phrase
(
stFac1
.
toString
(),
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"TOTAL Descuento"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
"0.00"
,
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"ICE"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
"0.00"
,
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"IVA 12%"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
new
BigDecimal
(
factura
.
getIvaF
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
(),
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"IRBPNR"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
"0.00"
,
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"PROPINA"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
"0.00"
,
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
celda1
=
new
PdfPCell
(
new
Phrase
(
"VALOR TOTAL"
,
fuente1
));
celda1
.
setRowspan
(
1
);
celda1
.
setColspan
(
2
);
datosfactura
.
addCell
(
celda1
);
celda2
=
new
PdfPCell
(
new
Phrase
(
new
BigDecimal
(
factura
.
getTotalF
())
.
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
(),
fuente1
));
celda2
.
setRowspan
(
1
);
celda2
.
setColspan
(
1
);
datosfactura
.
addCell
(
celda2
);
document
.
add
(
datosfactura
);
document
.
close
();
writer
.
close
();
cb
.
closePath
();
reader
.
close
();
page
.
closePath
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
url
=
""
;
}
return
url
;
}
private
static
PdfPCell
createLabelCell
(
String
text
)
{
// font
com
.
itextpdf
.
text
.
Font
fuente
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
10
,
Font
.
BOLD
);
// create cell
PdfPCell
cell
=
new
PdfPCell
(
new
Phrase
(
text
,
fuente
));
cell
.
setHorizontalAlignment
(
Element
.
ALIGN_CENTER
);
cell
.
setVerticalAlignment
(
Element
.
ALIGN_MIDDLE
);
cell
.
setBackgroundColor
(
BaseColor
.
LIGHT_GRAY
);
// set style
return
cell
;
}
private
static
PdfPCell
createLabelCell2
(
String
text
)
{
// font
com
.
itextpdf
.
text
.
Font
fuente
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
10
,
Font
.
BOLD
);
// create cell
PdfPCell
cell
=
new
PdfPCell
(
new
Phrase
(
text
,
fuente
));
cell
.
setHorizontalAlignment
(
Element
.
ALIGN_LEFT
);
cell
.
setVerticalAlignment
(
Element
.
ALIGN_MIDDLE
);
//cell.setBorder(0);
return
cell
;
}
private
static
PdfPCell
createLabelCell3
(
String
text
)
{
// font
com
.
itextpdf
.
text
.
Font
fuente
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
9
,
Font
.
BOLD
);
// create cell
PdfPCell
cell
=
new
PdfPCell
(
new
Phrase
(
text
,
fuente
));
cell
.
setHorizontalAlignment
(
Element
.
ALIGN_LEFT
);
// set style
return
cell
;
}
private
static
PdfPCell
createLabelCell4
(
String
text
)
{
// font
com
.
itextpdf
.
text
.
Font
fuente
=
FontFactory
.
getFont
(
FontFactory
.
TIMES_ROMAN
,
9
);
// create cell
PdfPCell
cell
=
new
PdfPCell
(
new
Phrase
(
text
,
fuente
));
cell
.
setHorizontalAlignment
(
Element
.
ALIGN_LEFT
);
cell
.
setVerticalAlignment
(
Element
.
ALIGN_MIDDLE
);
// set style
return
cell
;
}
@SuppressWarnings
(
"unused"
)
private
Image
getBarcode
(
Document
document
,
PdfWriter
pdfWriter
,
String
servicio
,
String
codigoTransaccion
)
{
PdfContentByte
cimg
=
pdfWriter
.
getDirectContent
();
Barcode39
code39
=
new
Barcode39
();
code39
.
setCode
(
servicio
+
codigoTransaccion
);
code39
.
setCodeType
(
Barcode39
.
CODE128
);
code39
.
setTextAlignment
(
Element
.
ALIGN_CENTER
);
Image
image
=
code39
.
createImageWithBarcode
(
cimg
,
null
,
null
);
java
.
awt
.
Image
im
=
code39
.
createAwtImage
(
Color
.
BLACK
,
Color
.
WHITE
);
float
scaler
=
((
document
.
getPageSize
().
getWidth
()
-
document
.
leftMargin
()
-
document
.
rightMargin
()
-
100
)
/
image
.
getWidth
())
*
75
;
image
.
scalePercent
(
scaler
);
image
.
setAlignment
(
Element
.
ALIGN_CENTER
);
return
image
;
}
public
Image
createBarcode39Extended
(
String
myText
,
PdfWriter
writer
)
{
PdfContentByte
pdfContentByte
=
writer
.
getDirectContent
();
Barcode128
barcode128
=
new
Barcode128
();
barcode128
.
setCode
(
myText
);
barcode128
.
setCodeType
(
Barcode128
.
CODE128
);
Image
code128Image
=
barcode128
.
createImageWithBarcode
(
pdfContentByte
,
null
,
null
);
code128Image
.
scalePercent
(
50
);
return
code128Image
;
}
public
Image
createBarcodeEAN
(
String
myText
,
PdfWriter
writer
)
{
PdfContentByte
pdfContentByte
=
writer
.
getDirectContent
();
BarcodeEAN
barcodeEAN
=
new
BarcodeEAN
();
barcodeEAN
.
setCodeType
(
BarcodeEAN
.
EAN13
);
barcodeEAN
.
setCode
(
myText
);
Image
codeEANImage
=
barcodeEAN
.
createImageWithBarcode
(
pdfContentByte
,
null
,
null
);
codeEANImage
.
setAbsolutePosition
(
20
,
20
);
codeEANImage
.
scalePercent
(
10
);
codeEANImage
.
scalePercent
(
30
f
);
return
codeEANImage
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/controller/GeneracionFactOfflineXML.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
controller
;
import
ec.edu.epn.consumosriautorizacion.dto.FacturaDTO
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
public
class
GeneracionFactOfflineXML
{
public
String
generacionXml
(
FacturaDTO
factura
)
throws
IOException
{
String
pathXml
=
""
;
BufferedWriter
writer
=
null
;
pathXml
=
"/FacturaUtils/"
+
factura
.
getRucCli
().
trim
()
+
"-"
+
factura
.
getIdFactura
().
trim
()
+
".xml"
;
File
file
=
new
File
(
pathXml
);
try
{
writer
=
new
BufferedWriter
(
new
FileWriter
(
file
));
writer
.
write
(
factura
.
getXml
());
return
pathXml
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
""
;
}
finally
{
if
(
writer
!=
null
)
{
writer
.
close
();
}
}
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/dto/ConceptoDTO.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
dto
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
public
class
ConceptoDTO
{
private
String
idConcepto
;
private
Integer
aux
;
private
Integer
auxIdConcepto
;
private
String
centrocostoL
;
private
String
cuenta
;
private
String
descrConcp
;
private
String
estado
;
private
String
factura
;
private
Timestamp
fechatrans
;
private
String
idPartida
;
private
Integer
idUnidad
;
private
Integer
iva
;
private
String
nombreConcp
;
private
String
nombreUsuario
;
private
float
precioS
;
private
BigDecimal
saldounidad
;
private
BigDecimal
secuencial
;
private
String
tipoconcepto
;
public
String
getIdConcepto
()
{
return
idConcepto
;
}
public
void
setIdConcepto
(
String
idConcepto
)
{
this
.
idConcepto
=
idConcepto
;
}
public
Integer
getAux
()
{
return
aux
;
}
public
void
setAux
(
Integer
aux
)
{
this
.
aux
=
aux
;
}
public
Integer
getAuxIdConcepto
()
{
return
auxIdConcepto
;
}
public
void
setAuxIdConcepto
(
Integer
auxIdConcepto
)
{
this
.
auxIdConcepto
=
auxIdConcepto
;
}
public
String
getCentrocostoL
()
{
return
centrocostoL
;
}
public
void
setCentrocostoL
(
String
centrocostoL
)
{
this
.
centrocostoL
=
centrocostoL
;
}
public
String
getCuenta
()
{
return
cuenta
;
}
public
void
setCuenta
(
String
cuenta
)
{
this
.
cuenta
=
cuenta
;
}
public
String
getDescrConcp
()
{
return
descrConcp
;
}
public
void
setDescrConcp
(
String
descrConcp
)
{
this
.
descrConcp
=
descrConcp
;
}
public
String
getEstado
()
{
return
estado
;
}
public
void
setEstado
(
String
estado
)
{
this
.
estado
=
estado
;
}
public
String
getFactura
()
{
return
factura
;
}
public
void
setFactura
(
String
factura
)
{
this
.
factura
=
factura
;
}
public
Timestamp
getFechatrans
()
{
return
fechatrans
;
}
public
void
setFechatrans
(
Timestamp
fechatrans
)
{
this
.
fechatrans
=
fechatrans
;
}
public
String
getIdPartida
()
{
return
idPartida
;
}
public
void
setIdPartida
(
String
idPartida
)
{
this
.
idPartida
=
idPartida
;
}
public
Integer
getIdUnidad
()
{
return
idUnidad
;
}
public
void
setIdUnidad
(
Integer
idUnidad
)
{
this
.
idUnidad
=
idUnidad
;
}
public
Integer
getIva
()
{
return
iva
;
}
public
void
setIva
(
Integer
iva
)
{
this
.
iva
=
iva
;
}
public
String
getNombreConcp
()
{
return
nombreConcp
;
}
public
void
setNombreConcp
(
String
nombreConcp
)
{
this
.
nombreConcp
=
nombreConcp
;
}
public
String
getNombreUsuario
()
{
return
nombreUsuario
;
}
public
void
setNombreUsuario
(
String
nombreUsuario
)
{
this
.
nombreUsuario
=
nombreUsuario
;
}
public
float
getPrecioS
()
{
return
precioS
;
}
public
void
setPrecioS
(
float
precioS
)
{
this
.
precioS
=
precioS
;
}
public
BigDecimal
getSaldounidad
()
{
return
saldounidad
;
}
public
void
setSaldounidad
(
BigDecimal
saldounidad
)
{
this
.
saldounidad
=
saldounidad
;
}
public
BigDecimal
getSecuencial
()
{
return
secuencial
;
}
public
void
setSecuencial
(
BigDecimal
secuencial
)
{
this
.
secuencial
=
secuencial
;
}
public
String
getTipoconcepto
()
{
return
tipoconcepto
;
}
public
void
setTipoconcepto
(
String
tipoconcepto
)
{
this
.
tipoconcepto
=
tipoconcepto
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/dto/DetallefacturaDTO.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
dto
;
import
java.math.BigDecimal
;
public
class
DetallefacturaDTO
{
public
DetallefacturaDTO
()
{
}
private
String
idDetallefactura
;
private
Integer
controlUnidades
;
private
double
costoDf
;
private
double
costotDf
;
private
String
estadoServ
;
private
String
idFactura
;
private
String
idMetodo
;
private
String
idServicio
;
private
String
mesArriendo
;
private
String
nombreser
;
private
BigDecimal
porcentajeiva
;
private
double
subtotal
=
0
;
private
Integer
unidadesDf
;
private
double
valorIva
;
private
String
concepto
;
private
ConceptoDTO
conceptoDTO
;
public
String
getIdDetallefactura
()
{
return
idDetallefactura
;
}
public
void
setIdDetallefactura
(
String
idDetallefactura
)
{
this
.
idDetallefactura
=
idDetallefactura
;
}
public
Integer
getControlUnidades
()
{
return
controlUnidades
;
}
public
void
setControlUnidades
(
Integer
controlUnidades
)
{
this
.
controlUnidades
=
controlUnidades
;
}
public
double
getCostoDf
()
{
return
costoDf
;
}
public
void
setCostoDf
(
double
costoDf
)
{
this
.
costoDf
=
costoDf
;
}
public
double
getCostotDf
()
{
return
costotDf
;
}
public
void
setCostotDf
(
double
costotDf
)
{
this
.
costotDf
=
costotDf
;
}
public
String
getEstadoServ
()
{
return
estadoServ
;
}
public
void
setEstadoServ
(
String
estadoServ
)
{
this
.
estadoServ
=
estadoServ
;
}
public
String
getIdFactura
()
{
return
idFactura
;
}
public
void
setIdFactura
(
String
idFactura
)
{
this
.
idFactura
=
idFactura
;
}
public
String
getIdMetodo
()
{
return
idMetodo
;
}
public
void
setIdMetodo
(
String
idMetodo
)
{
this
.
idMetodo
=
idMetodo
;
}
public
String
getIdServicio
()
{
return
idServicio
;
}
public
void
setIdServicio
(
String
idServicio
)
{
this
.
idServicio
=
idServicio
;
}
public
String
getMesArriendo
()
{
return
mesArriendo
;
}
public
void
setMesArriendo
(
String
mesArriendo
)
{
this
.
mesArriendo
=
mesArriendo
;
}
public
String
getNombreser
()
{
return
nombreser
;
}
public
void
setNombreser
(
String
nombreser
)
{
this
.
nombreser
=
nombreser
;
}
public
BigDecimal
getPorcentajeiva
()
{
return
porcentajeiva
;
}
public
void
setPorcentajeiva
(
BigDecimal
porcentajeiva
)
{
this
.
porcentajeiva
=
porcentajeiva
;
}
public
double
getSubtotal
()
{
return
subtotal
;
}
public
void
setSubtotal
(
double
subtotal
)
{
this
.
subtotal
=
subtotal
;
}
public
Integer
getUnidadesDf
()
{
return
unidadesDf
;
}
public
void
setUnidadesDf
(
Integer
unidadesDf
)
{
this
.
unidadesDf
=
unidadesDf
;
}
public
double
getValorIva
()
{
return
valorIva
;
}
public
void
setValorIva
(
double
valorIva
)
{
this
.
valorIva
=
valorIva
;
}
public
String
getConcepto
()
{
return
concepto
;
}
public
void
setConcepto
(
String
concepto
)
{
this
.
concepto
=
concepto
;
}
public
ConceptoDTO
getConceptoDTO
()
{
return
conceptoDTO
;
}
public
void
setConceptoDTO
(
ConceptoDTO
conceptoDTO
)
{
this
.
conceptoDTO
=
conceptoDTO
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/dto/FacturaDTO.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
dto
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
import
java.util.Date
;
public
class
FacturaDTO
{
public
FacturaDTO
()
{
}
private
String
idFactura
;
private
String
ambiente
;
private
String
aux
;
private
Integer
auxsecuencia
;
private
String
carreraE
;
private
String
cedulaCli
;
private
String
cedulaE
;
private
String
claveacceso
;
private
String
concepto
;
private
double
descuentoF
;
private
String
direccionCli
;
private
String
direccionE
;
private
String
emailCl
;
private
String
emision
;
private
String
estadoSri
;
private
String
estadomail
;
private
Date
fecCompromPago
;
private
Date
fecMaxNc
;
private
String
fechaautoriza
;
private
Timestamp
fechafacF
;
private
Timestamp
fechafacPend
;
private
Integer
idCaja
;
private
String
idCliente
;
private
String
idEstudiante
;
private
String
idProforma
;
private
double
ivaF
;
private
String
motivoestadoF
;
private
String
nombreCli
;
private
String
nombreE
;
private
Integer
nropagos
;
private
String
num1
;
private
String
num2
;
private
String
num3
;
private
String
numautoriza
;
private
String
path
;
private
String
pathxml
;
private
BigDecimal
porcentajeiva
;
private
String
rucCli
;
private
double
subtotalF
;
private
String
telefonoCli
;
private
String
telefonoE
;
private
String
tipoF
;
private
double
totalF
;
private
String
puntoFacturacion
;
private
String
xml
;
private
String
estadoFactura
;
public
String
getIdFactura
()
{
return
idFactura
;
}
public
void
setIdFactura
(
String
idFactura
)
{
this
.
idFactura
=
idFactura
;
}
public
String
getAmbiente
()
{
return
ambiente
;
}
public
void
setAmbiente
(
String
ambiente
)
{
this
.
ambiente
=
ambiente
;
}
public
String
getAux
()
{
return
aux
;
}
public
void
setAux
(
String
aux
)
{
this
.
aux
=
aux
;
}
public
Integer
getAuxsecuencia
()
{
return
auxsecuencia
;
}
public
void
setAuxsecuencia
(
Integer
auxsecuencia
)
{
this
.
auxsecuencia
=
auxsecuencia
;
}
public
String
getCarreraE
()
{
return
carreraE
;
}
public
void
setCarreraE
(
String
carreraE
)
{
this
.
carreraE
=
carreraE
;
}
public
String
getCedulaCli
()
{
return
cedulaCli
;
}
public
void
setCedulaCli
(
String
cedulaCli
)
{
this
.
cedulaCli
=
cedulaCli
;
}
public
String
getCedulaE
()
{
return
cedulaE
;
}
public
void
setCedulaE
(
String
cedulaE
)
{
this
.
cedulaE
=
cedulaE
;
}
public
String
getClaveacceso
()
{
return
claveacceso
;
}
public
void
setClaveacceso
(
String
claveacceso
)
{
this
.
claveacceso
=
claveacceso
;
}
public
String
getConcepto
()
{
return
concepto
;
}
public
void
setConcepto
(
String
concepto
)
{
this
.
concepto
=
concepto
;
}
public
double
getDescuentoF
()
{
return
descuentoF
;
}
public
void
setDescuentoF
(
double
descuentoF
)
{
this
.
descuentoF
=
descuentoF
;
}
public
String
getDireccionCli
()
{
return
direccionCli
;
}
public
void
setDireccionCli
(
String
direccionCli
)
{
this
.
direccionCli
=
direccionCli
;
}
public
String
getDireccionE
()
{
return
direccionE
;
}
public
void
setDireccionE
(
String
direccionE
)
{
this
.
direccionE
=
direccionE
;
}
public
String
getEmailCl
()
{
return
emailCl
;
}
public
void
setEmailCl
(
String
emailCl
)
{
this
.
emailCl
=
emailCl
;
}
public
String
getEmision
()
{
return
emision
;
}
public
void
setEmision
(
String
emision
)
{
this
.
emision
=
emision
;
}
public
String
getEstadoSri
()
{
return
estadoSri
;
}
public
void
setEstadoSri
(
String
estadoSri
)
{
this
.
estadoSri
=
estadoSri
;
}
public
String
getEstadomail
()
{
return
estadomail
;
}
public
void
setEstadomail
(
String
estadomail
)
{
this
.
estadomail
=
estadomail
;
}
public
Date
getFecCompromPago
()
{
return
fecCompromPago
;
}
public
void
setFecCompromPago
(
Date
fecCompromPago
)
{
this
.
fecCompromPago
=
fecCompromPago
;
}
public
Date
getFecMaxNc
()
{
return
fecMaxNc
;
}
public
void
setFecMaxNc
(
Date
fecMaxNc
)
{
this
.
fecMaxNc
=
fecMaxNc
;
}
public
String
getFechaautoriza
()
{
return
fechaautoriza
;
}
public
void
setFechaautoriza
(
String
fechaautoriza
)
{
this
.
fechaautoriza
=
fechaautoriza
;
}
public
Timestamp
getFechafacF
()
{
return
fechafacF
;
}
public
void
setFechafacF
(
Timestamp
fechafacF
)
{
this
.
fechafacF
=
fechafacF
;
}
public
Timestamp
getFechafacPend
()
{
return
fechafacPend
;
}
public
void
setFechafacPend
(
Timestamp
fechafacPend
)
{
this
.
fechafacPend
=
fechafacPend
;
}
public
Integer
getIdCaja
()
{
return
idCaja
;
}
public
void
setIdCaja
(
Integer
idCaja
)
{
this
.
idCaja
=
idCaja
;
}
public
String
getIdCliente
()
{
return
idCliente
;
}
public
void
setIdCliente
(
String
idCliente
)
{
this
.
idCliente
=
idCliente
;
}
public
String
getIdEstudiante
()
{
return
idEstudiante
;
}
public
void
setIdEstudiante
(
String
idEstudiante
)
{
this
.
idEstudiante
=
idEstudiante
;
}
public
String
getIdProforma
()
{
return
idProforma
;
}
public
void
setIdProforma
(
String
idProforma
)
{
this
.
idProforma
=
idProforma
;
}
public
double
getIvaF
()
{
return
ivaF
;
}
public
void
setIvaF
(
double
ivaF
)
{
this
.
ivaF
=
ivaF
;
}
public
String
getMotivoestadoF
()
{
return
motivoestadoF
;
}
public
void
setMotivoestadoF
(
String
motivoestadoF
)
{
this
.
motivoestadoF
=
motivoestadoF
;
}
public
String
getNombreCli
()
{
return
nombreCli
;
}
public
void
setNombreCli
(
String
nombreCli
)
{
this
.
nombreCli
=
nombreCli
;
}
public
String
getNombreE
()
{
return
nombreE
;
}
public
void
setNombreE
(
String
nombreE
)
{
this
.
nombreE
=
nombreE
;
}
public
Integer
getNropagos
()
{
return
nropagos
;
}
public
void
setNropagos
(
Integer
nropagos
)
{
this
.
nropagos
=
nropagos
;
}
public
String
getNum1
()
{
return
num1
;
}
public
void
setNum1
(
String
num1
)
{
this
.
num1
=
num1
;
}
public
String
getNum2
()
{
return
num2
;
}
public
void
setNum2
(
String
num2
)
{
this
.
num2
=
num2
;
}
public
String
getNum3
()
{
return
num3
;
}
public
void
setNum3
(
String
num3
)
{
this
.
num3
=
num3
;
}
public
String
getNumautoriza
()
{
return
numautoriza
;
}
public
void
setNumautoriza
(
String
numautoriza
)
{
this
.
numautoriza
=
numautoriza
;
}
public
String
getPath
()
{
return
path
;
}
public
void
setPath
(
String
path
)
{
this
.
path
=
path
;
}
public
String
getPathxml
()
{
return
pathxml
;
}
public
void
setPathxml
(
String
pathxml
)
{
this
.
pathxml
=
pathxml
;
}
public
BigDecimal
getPorcentajeiva
()
{
return
porcentajeiva
;
}
public
void
setPorcentajeiva
(
BigDecimal
porcentajeiva
)
{
this
.
porcentajeiva
=
porcentajeiva
;
}
public
String
getRucCli
()
{
return
rucCli
;
}
public
void
setRucCli
(
String
rucCli
)
{
this
.
rucCli
=
rucCli
;
}
public
double
getSubtotalF
()
{
return
subtotalF
;
}
public
void
setSubtotalF
(
double
subtotalF
)
{
this
.
subtotalF
=
subtotalF
;
}
public
String
getTelefonoCli
()
{
return
telefonoCli
;
}
public
void
setTelefonoCli
(
String
telefonoCli
)
{
this
.
telefonoCli
=
telefonoCli
;
}
public
String
getTelefonoE
()
{
return
telefonoE
;
}
public
void
setTelefonoE
(
String
telefonoE
)
{
this
.
telefonoE
=
telefonoE
;
}
public
String
getTipoF
()
{
return
tipoF
;
}
public
void
setTipoF
(
String
tipoF
)
{
this
.
tipoF
=
tipoF
;
}
public
double
getTotalF
()
{
return
totalF
;
}
public
void
setTotalF
(
double
totalF
)
{
this
.
totalF
=
totalF
;
}
public
String
getXml
()
{
return
xml
;
}
public
void
setXml
(
String
xml
)
{
this
.
xml
=
xml
;
}
public
String
getEstadoFactura
()
{
return
estadoFactura
;
}
public
void
setEstadoFactura
(
String
estadoFactura
)
{
this
.
estadoFactura
=
estadoFactura
;
}
public
String
getPuntoFacturacion
()
{
return
puntoFacturacion
;
}
public
void
setPuntoFacturacion
(
String
puntoFacturacion
)
{
this
.
puntoFacturacion
=
puntoFacturacion
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/dto/FormaPagoDTO.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
dto
;
public
class
FormaPagoDTO
{
public
FormaPagoDTO
()
{
}
private
String
idFormaPago
;
private
String
descrFp
;
private
String
nombreFp
;
private
String
codigoSri
;
private
String
activo
;
private
String
codigoSae
;
public
String
getIdFormaPago
()
{
return
idFormaPago
;
}
public
void
setIdFormaPago
(
String
idFormaPago
)
{
this
.
idFormaPago
=
idFormaPago
;
}
public
String
getDescrFp
()
{
return
descrFp
;
}
public
void
setDescrFp
(
String
descrFp
)
{
this
.
descrFp
=
descrFp
;
}
public
String
getNombreFp
()
{
return
nombreFp
;
}
public
void
setNombreFp
(
String
nombreFp
)
{
this
.
nombreFp
=
nombreFp
;
}
public
String
getCodigoSri
()
{
return
codigoSri
;
}
public
void
setCodigoSri
(
String
codigoSri
)
{
this
.
codigoSri
=
codigoSri
;
}
public
String
getActivo
()
{
return
activo
;
}
public
void
setActivo
(
String
activo
)
{
this
.
activo
=
activo
;
}
public
String
getCodigoSae
()
{
return
codigoSae
;
}
public
void
setCodigoSae
(
String
codigoSae
)
{
this
.
codigoSae
=
codigoSae
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/dto/PagosDTO.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
dto
;
import
java.math.BigDecimal
;
public
class
PagosDTO
{
public
PagosDTO
()
{
}
private
String
idPagos
;
private
double
comisionTc
;
private
String
cuentaCorrientePa
;
private
String
idNc
;
private
String
idRcbCaja
;
private
BigDecimal
montoPa
;
private
String
numeroDocumentoPa
;
private
String
procedenciaPa
;
private
BigDecimal
saldoPa
;
private
Integer
idBancos
;
private
String
idFactura
;
private
String
idFormaPago
;
private
String
idTc
;
private
FormaPagoDTO
formaPagoDTO
;
public
String
getIdPagos
()
{
return
idPagos
;
}
public
void
setIdPagos
(
String
idPagos
)
{
this
.
idPagos
=
idPagos
;
}
public
double
getComisionTc
()
{
return
comisionTc
;
}
public
void
setComisionTc
(
double
comisionTc
)
{
this
.
comisionTc
=
comisionTc
;
}
public
String
getCuentaCorrientePa
()
{
return
cuentaCorrientePa
;
}
public
void
setCuentaCorrientePa
(
String
cuentaCorrientePa
)
{
this
.
cuentaCorrientePa
=
cuentaCorrientePa
;
}
public
String
getIdNc
()
{
return
idNc
;
}
public
void
setIdNc
(
String
idNc
)
{
this
.
idNc
=
idNc
;
}
public
String
getIdRcbCaja
()
{
return
idRcbCaja
;
}
public
void
setIdRcbCaja
(
String
idRcbCaja
)
{
this
.
idRcbCaja
=
idRcbCaja
;
}
public
BigDecimal
getMontoPa
()
{
return
montoPa
;
}
public
void
setMontoPa
(
BigDecimal
montoPa
)
{
this
.
montoPa
=
montoPa
;
}
public
String
getNumeroDocumentoPa
()
{
return
numeroDocumentoPa
;
}
public
void
setNumeroDocumentoPa
(
String
numeroDocumentoPa
)
{
this
.
numeroDocumentoPa
=
numeroDocumentoPa
;
}
public
String
getProcedenciaPa
()
{
return
procedenciaPa
;
}
public
void
setProcedenciaPa
(
String
procedenciaPa
)
{
this
.
procedenciaPa
=
procedenciaPa
;
}
public
BigDecimal
getSaldoPa
()
{
return
saldoPa
;
}
public
void
setSaldoPa
(
BigDecimal
saldoPa
)
{
this
.
saldoPa
=
saldoPa
;
}
public
Integer
getIdBancos
()
{
return
idBancos
;
}
public
void
setIdBancos
(
Integer
idBancos
)
{
this
.
idBancos
=
idBancos
;
}
public
String
getIdFactura
()
{
return
idFactura
;
}
public
void
setIdFactura
(
String
idFactura
)
{
this
.
idFactura
=
idFactura
;
}
public
String
getIdFormaPago
()
{
return
idFormaPago
;
}
public
void
setIdFormaPago
(
String
idFormaPago
)
{
this
.
idFormaPago
=
idFormaPago
;
}
public
String
getIdTc
()
{
return
idTc
;
}
public
void
setIdTc
(
String
idTc
)
{
this
.
idTc
=
idTc
;
}
public
FormaPagoDTO
getFormaPagoDTO
()
{
return
formaPagoDTO
;
}
public
void
setFormaPagoDTO
(
FormaPagoDTO
formaPagoDTO
)
{
this
.
formaPagoDTO
=
formaPagoDTO
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/dto/ServicioDTO.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
dto
;
public
class
ServicioDTO
{
private
String
idServicio
;
private
String
acreditado
;
private
Integer
auxIdServicio
;
private
String
descrS
;
private
String
nombreS
;
private
float
precioS
;
private
String
laboratorio
;
private
String
tiposervicio
;
public
String
getIdServicio
()
{
return
idServicio
;
}
public
void
setIdServicio
(
String
idServicio
)
{
this
.
idServicio
=
idServicio
;
}
public
String
getAcreditado
()
{
return
acreditado
;
}
public
void
setAcreditado
(
String
acreditado
)
{
this
.
acreditado
=
acreditado
;
}
public
Integer
getAuxIdServicio
()
{
return
auxIdServicio
;
}
public
void
setAuxIdServicio
(
Integer
auxIdServicio
)
{
this
.
auxIdServicio
=
auxIdServicio
;
}
public
String
getDescrS
()
{
return
descrS
;
}
public
void
setDescrS
(
String
descrS
)
{
this
.
descrS
=
descrS
;
}
public
String
getNombreS
()
{
return
nombreS
;
}
public
void
setNombreS
(
String
nombreS
)
{
this
.
nombreS
=
nombreS
;
}
public
float
getPrecioS
()
{
return
precioS
;
}
public
void
setPrecioS
(
float
precioS
)
{
this
.
precioS
=
precioS
;
}
public
String
getLaboratorio
()
{
return
laboratorio
;
}
public
void
setLaboratorio
(
String
laboratorio
)
{
this
.
laboratorio
=
laboratorio
;
}
public
String
getTiposervicio
()
{
return
tiposervicio
;
}
public
void
setTiposervicio
(
String
tiposervicio
)
{
this
.
tiposervicio
=
tiposervicio
;
}
}
This diff is collapsed.
Click to expand it.
src/main/java/ec/edu/epn/consumosriautorizacion/service/conexionPostgres.java
0 → 100644
View file @
89387b33
package
ec
.
edu
.
epn
.
consumosriautorizacion
.
service
;
import
java.io.Serializable
;
import
java.sql.DriverManager
;
public
class
conexionPostgres
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
6947528897763208578L
;
private
java
.
sql
.
Connection
conection
=
null
;
public
java
.
sql
.
Connection
getConection
()
{
return
conection
;
}
public
void
setConection
(
java
.
sql
.
Connection
conection
)
{
this
.
conection
=
conection
;
}
private
String
url
=
"jdbc:postgresql://"
;
private
String
serverName
=
"172.31.5.10"
;
private
String
portNumber
=
"5432"
;
private
String
databaseName
=
"bddcorpepn"
;
private
String
userName
=
"seguridad"
;
private
String
password
=
"seguridad"
;
// Constructor
public
conexionPostgres
()
{
}
public
String
getConnectionUrl
()
{
return
url
+
serverName
+
":"
+
portNumber
+
"/"
+
databaseName
;
}
public
java
.
sql
.
Connection
getConnection
()
{
try
{
Class
.
forName
(
"org.postgresql.Driver"
);
conection
=
DriverManager
.
getConnection
(
getConnectionUrl
(),
userName
,
password
);
if
(
conection
!=
null
)
System
.
out
.
println
(
"Connection Successful!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"Error Trace in getConnection() : "
+
e
.
getMessage
());
}
return
conection
;
}
public
void
closeConnection
()
{
try
{
if
(
conection
!=
null
)
conection
.
close
();
conection
=
null
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment