This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-03-10 09:06:35 -07:00
25 changed files with 476 additions and 439 deletions

View File

@@ -395,7 +395,8 @@ End Class
<Serializable> <Serializable>
Public Class CFDIRetenciones Public Class CFDIRetenciones
Public Property Impuesto As String Public Property Impuesto As String
Public Property Importe As Double Public Property Importe As Decimal
Public Property TasaOCuota As String
End Class End Class
@@ -439,8 +440,8 @@ Public Class CFDIComplementoPagos
Public Property FormaDePagoP As String = "" Public Property FormaDePagoP As String = ""
Public Property MonedaP As String = "" Public Property MonedaP As String = ""
Public Property NumOperacion As String = "" Public Property NumOperacion As String = ""
Public Property TipoCambioP As Double = 0 Public Property TipoCambioP As Decimal = 0
Public Property Monto As Double Public Property Monto As Decimal
Public Property RfcEmisorCtaOrd As String = "" Public Property RfcEmisorCtaOrd As String = ""
Public Property NomBancoOrdExt As String = "" Public Property NomBancoOrdExt As String = ""
Public Property CtaOrdenante As String = "" Public Property CtaOrdenante As String = ""
@@ -452,8 +453,24 @@ Public Class CFDIComplementoPagos
Public Property SelloPago As String = "" Public Property SelloPago As String = ""
Public Property DocumentosRelacionados As List(Of CFDIComplementoPagosDocsRelacionados) Public Property DocumentosRelacionados As List(Of CFDIComplementoPagosDocsRelacionados)
Public Property Impuestos As List(Of CFDIConceptosImpuestos) Public Property Impuestos As List(Of CFDIConceptosImpuestos)
Public ReadOnly Property Totales As CFDIComplementoPagosTotales
Get
Dim tRetorno As New CFDIComplementoPagosTotales
tRetorno.MontoTotalPagos = (From c In DocumentosRelacionados Select c.ImpPagado).Sum()
Public ReadOnly Property TotalImpuestosRetenidos As Double tRetorno.TotalTrasladosBaseIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Base).Sum()
tRetorno.TotalTrasladosBaseIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.Base).Sum()
tRetorno.TotalTrasladosBaseIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.Base).Sum()
tRetorno.TotalTrasladosImpuestoIVA0 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0 Select c.Importe).Sum()
tRetorno.TotalTrasladosImpuestoIVA8 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.08 Select c.Importe).Sum()
tRetorno.TotalTrasladosImpuestoIVA16 = (From c In Traslados Where c.Impuesto = "002" And c.TasaOCuota = 0.16 Select c.Importe).Sum()
Return tRetorno
End Get
End Property
Public ReadOnly Property TotalImpuestosRetenidos As Decimal
Get Get
Return (From c In Impuestos Return (From c In Impuestos
Where c.TrasladooRetencion = "R" Where c.TrasladooRetencion = "R"
@@ -461,7 +478,7 @@ Public Class CFDIComplementoPagos
End Get End Get
End Property End Property
Public ReadOnly Property TotalImpuestosTrasladados As Double Public ReadOnly Property TotalImpuestosTrasladados As Decimal
Get Get
Return (From c In Impuestos Return (From c In Impuestos
Where c.TrasladooRetencion = "T" Where c.TrasladooRetencion = "T"
@@ -469,13 +486,6 @@ Public Class CFDIComplementoPagos
End Get End Get
End Property End Property
Public ReadOnly Property TotalPagos As Decimal
Get
Return (From c In DocumentosRelacionados
Select c.ImpPagado).Sum()
End Get
End Property
Sub New() Sub New()
DocumentosRelacionados = New List(Of CFDIComplementoPagosDocsRelacionados) DocumentosRelacionados = New List(Of CFDIComplementoPagosDocsRelacionados)
@@ -534,7 +544,6 @@ Public Class CFDIComplementoPagos
tRetorno = Nothing tRetorno = Nothing
Return TTraslados Return TTraslados
End Get End Get
End Property End Property
@@ -548,6 +557,7 @@ Public Class CFDIComplementoPagosDocsRelacionados
Public Property MonedaDR As String = "" Public Property MonedaDR As String = ""
Public Property MetodoDePagoDR As String = "" Public Property MetodoDePagoDR As String = ""
Public Property TipoCambioDR As Decimal Public Property TipoCambioDR As Decimal
Public Property EquivalenciaDR As Decimal = 1
Public Property NumParcialidad As Integer = 1 Public Property NumParcialidad As Integer = 1
Public Property ImpSaldoAnt As Decimal Public Property ImpSaldoAnt As Decimal
Public Property ImpPagado As Decimal Public Property ImpPagado As Decimal
@@ -560,6 +570,23 @@ Public Class CFDIComplementoPagosDocsRelacionados
End Class End Class
<Serializable>
Public Class CFDIComplementoPagosTotales
Public Property MontoTotalPagos As Decimal = 0
Public Property TotalTrasladosBaseIVA16 As Decimal = 0
Public Property TotalTrasladosImpuestoIVA16 As Decimal = 0
Public Property TotalTrasladosBaseIVA8 As Decimal = 0
Public Property TotalTrasladosImpuestoIVA8 As Decimal = 0
Public Property TotalTrasladosBaseIVA0 As Decimal = 0
Public Property TotalTrasladosImpuestoIVA0 As Decimal = 0
Public Property TotalTrasladosBaseExento As Decimal = 0
Public Property TotalRetencionesIVA As Decimal = 0
Public Property TotalRetencionesISR As Decimal = 0
Public Property TotalRetencionesIEPS As Decimal = 0
End Class
<Serializable> <Serializable>
Public Class CFDIComercioExterior11 Public Class CFDIComercioExterior11
Public Property MotivoTraslado As String Public Property MotivoTraslado As String

View File

@@ -1091,9 +1091,9 @@ Public Class ClsBancos
End If End If
Timbre = Timbrado.PreparaTimbrePago40(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal, Timbre = Timbrado.PreparaTimbrePago40(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal,
RFCCliente, dr("NombreCliente").ToString, RFCCliente, dr("NombreCliente").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago, RFCCliente, dr("NombreCliente").ToString, dr("ClienteCP").ToString, dr("CodigoRegimenFiscal").ToString, Serie, Folio.ToString, FechaTimbrado, Cuentapago,
dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDecimal, dr("FechaDocumento").ToString.ToDate, dr("ClaveFormaPagoSAT").ToString, dr("AbreviaturaSAT").ToString, dr("VentasTotalPagado").ToString.ToDecimal,
UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDecimal, dttpagos, dttpagosimpuestos, CFDIRelacionado:=CFDIRelacionado, EsCancelacion:=False) UsuarioActual.Empresa.CP.ToString, CuentaBeneficiario, dr("TipoCambioPago").ToString.ToDecimal, dttpagos, dttpagosimpuestos, CFDIRelacionado:=CFDIRelacionado)
Else Else
Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal, Timbre = Timbrado.PreparaTimbrePago(RFCEmpresa, UsuarioActual.Empresa.Empresa, UsuarioActual.Empresa.CodigoRegimenFiscal,

View File

@@ -5807,7 +5807,7 @@ Public Class ClsContabilidad
Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesAdd") DataAdapter("PA_Conta_CuentasAsignacionesAdd")
@@ -5827,6 +5827,7 @@ Public Class ClsContabilidad
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
End With End With
Try Try
@@ -5862,7 +5863,7 @@ Public Class ClsContabilidad
Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional IdCtaContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1,
Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1) As Boolean Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesUpdate") DataAdapter("PA_Conta_CuentasAsignacionesUpdate")
@@ -5882,6 +5883,7 @@ Public Class ClsContabilidad
.Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta .Add("@CveBancoCuenta", SqlDbType.Int).Value = CveBancoCuenta
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
End With End With
Try Try
@@ -6629,6 +6631,30 @@ Public Class ClsContabilidad
End Function End Function
Public Function GetRepOrigenAplicacion(FechaFin As Date, CveEmpresa As Integer) As Boolean
Dim Respuesta As Boolean = False
DataAdapter("PA_Conta_RepOrigenAplicacionGet2")
With SqlAdapter.SelectCommand.Parameters
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Respuesta = True
Catch ex As Exception
Me.OnError("Ocurrió un error al obtener el reporte", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Respuesta
End Function
#Region "IDisposable Support" #Region "IDisposable Support"
' IDisposable ' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean) Protected Overridable Sub Dispose(disposing As Boolean)

View File

@@ -4863,7 +4863,6 @@ Public Class ClsPaginas
'PaginaDict.Add("/Contabilidad2/RepBalanceGeneral.aspx".ToUpper(), 530) 'PaginaDict.Add("/Contabilidad2/RepBalanceGeneral.aspx".ToUpper(), 530)
PaginaDict.Add("/Contabilidad2/CatCuentasAsignaciones.aspx".ToUpper(), 724) PaginaDict.Add("/Contabilidad2/CatCuentasAsignaciones.aspx".ToUpper(), 724)
PaginaDict.Add("/Contabilidad2/CatContaEjercicios.aspx".ToUpper(), 725) PaginaDict.Add("/Contabilidad2/CatContaEjercicios.aspx".ToUpper(), 725)
PaginaDict.Add("/Contabilidad2/PolizasImpresion.aspx".ToUpper(), 726)
PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420) PaginaDict.Add("/Contabilidad2/RepEstadoResultadosHorizontal.aspx".ToUpper(), 420)
PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad2/RepAnexoCatalogoMensualHorizontal.aspx".ToUpper(), -1)

View File

@@ -746,7 +746,7 @@ Public Class ClsVentas
Optional IdPolizaCancelacion As Integer = -1, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0, Optional IdPolizaCancelacion As Integer = -1, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0,
Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1", Optional CveUsuarioCambiaEstatus As Integer = -1, Optional FechaCambioEstatus As String = "-1", Optional RFCReceptor As String = "-1",
Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional EstadoCancelacion As String = "", Optional CveMotivoCancelacion As Integer = -1, Optional MotivoCancelacion As String = "", Optional EstadoCancelacion As String = "",
Optional CveEstadoCancelacion As Integer = 0) As Boolean Optional CveEstadoCancelacion As Integer = 0, Optional SelloSolicitudDigitalSAT As String = "") As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_VentasUpdateEstatus") DataAdapter("PA_VentasUpdateEstatus")
@@ -767,6 +767,7 @@ Public Class ClsVentas
.Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion .Add("@MotivoCancelacion", SqlDbType.VarChar).Value = MotivoCancelacion
.Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion .Add("@EstadoCancelacion", SqlDbType.VarChar).Value = EstadoCancelacion
.Add("@CveEstadoCancelacion", SqlDbType.TinyInt).Value = CveEstadoCancelacion .Add("@CveEstadoCancelacion", SqlDbType.TinyInt).Value = CveEstadoCancelacion
.Add("@SelloSolicitudDigitalSAT", SqlDbType.VarChar).Value = SelloSolicitudDigitalSAT
End With End With
Try Try

View File

@@ -4811,6 +4811,7 @@ Namespace Modelos
Dim CancelacionFecha As Date Dim CancelacionFecha As Date
Dim FolioFiscal As String = ObjFactura.FolioFiscal Dim FolioFiscal As String = ObjFactura.FolioFiscal
Dim SolicitudCancelacionAcuse As String = ""
Dim CancelacionAcuse As String = "" Dim CancelacionAcuse As String = ""
Dim EstadoCancelacion As String = "" Dim EstadoCancelacion As String = ""
Dim MensajeError As String = "" Dim MensajeError As String = ""
@@ -4918,6 +4919,7 @@ Namespace Modelos
CveEstatus = 5 CveEstatus = 5
End If End If
CancelacionAcuse = ObjCancelacion.CancelacionAcuse CancelacionAcuse = ObjCancelacion.CancelacionAcuse
SolicitudCancelacionAcuse = Resp.SolicitudCancelacionAcuse
Else Else
Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx" Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx"
Retorno.TipoMensaje = TipoMensaje.MsgError Retorno.TipoMensaje = TipoMensaje.MsgError
@@ -5000,6 +5002,7 @@ Namespace Modelos
CveEstatus = Resp.CveEstatus CveEstatus = Resp.CveEstatus
CancelacionFecha = Resp.CancelacionFecha CancelacionFecha = Resp.CancelacionFecha
CancelacionAcuse = ObjCancelacion.CancelacionAcuse CancelacionAcuse = ObjCancelacion.CancelacionAcuse
SolicitudCancelacionAcuse = Resp.SolicitudCancelacionAcuse
Else Else
Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx" Retorno.Mensaje = "Los servicios de cancelación del SAT no se encuentran disponibles o presentan time out. Intente de nuevo en unos minutos.<br/>Origen del error: WebService www.sat.gob.mx"
Retorno.TipoMensaje = TipoMensaje.MsgError Retorno.TipoMensaje = TipoMensaje.MsgError

View File

@@ -784,6 +784,7 @@ Public Class Timbrado
If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then If VigenciaExtra.Estado.ToUpper = "VIGENTE" AndAlso VigenciaExtra.EstatusCancelacion.ToUpper.Contiene("EN PROCESO") Then
Retorno.Estado = "EN PROCESO" Retorno.Estado = "EN PROCESO"
Retorno.CveEstatus = 20 Retorno.CveEstatus = 20
Retorno.SolicitudCancelacionAcuse = Retorno.CancelacionAcuse
End If End If
If VigenciaExtra.Estado.ToUpper = "CANCELADO" Then If VigenciaExtra.Estado.ToUpper = "CANCELADO" Then
Retorno.Estado = "CANCELADO" Retorno.Estado = "CANCELADO"
@@ -897,8 +898,8 @@ Public Class Timbrado
Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String, Public Function PreparaTimbrePago(EmisorRFC As String, EmisorNombre As String, EmisorRegimenFiscal As String,
ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime, ReceptorRFC As String, ReceptorNombre As String, Serie As String, Folio As String, FechaTimbrado As DateTime,
CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Double, LugarExpedicion As String, CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String,
CuentaBeneficiario As String, TipoCambioP As Double, dttpagos As Data.DataTable, CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable,
Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre
' validación extra para cuando es cancelación requiere el folio relacionado ' validación extra para cuando es cancelación requiere el folio relacionado
If EsCancelacion AndAlso CFDIRelacionado = "" Then If EsCancelacion AndAlso CFDIRelacionado = "" Then
@@ -956,7 +957,7 @@ Public Class Timbrado
Dim ImporteCancelacion As Decimal = 1 Dim ImporteCancelacion As Decimal = 1
Dim MonedaCancelacion As String = "MXN" Dim MonedaCancelacion As String = "MXN"
Dim TipoCambioCancelacion As Double = 1 Dim TipoCambioCancelacion As Decimal = 1
If EsCancelacion Then MonedaPago = MonedaCancelacion If EsCancelacion Then MonedaPago = MonedaCancelacion
'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre
If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count
@@ -965,7 +966,7 @@ Public Class Timbrado
Timbre.ComplementoPagos.FechaPago = FechaPago Timbre.ComplementoPagos.FechaPago = FechaPago
Timbre.ComplementoPagos.FormaDePagoP = FormaPago Timbre.ComplementoPagos.FormaDePagoP = FormaPago
Timbre.ComplementoPagos.MonedaP = MonedaPago Timbre.ComplementoPagos.MonedaP = MonedaPago
Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto) Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto).RoundSQL
Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP) Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP)
@@ -1029,11 +1030,7 @@ Public Class Timbrado
Serie As String, Folio As String, FechaTimbrado As DateTime, Serie As String, Folio As String, FechaTimbrado As DateTime,
CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String, CuentaPago As String, FechaPago As DateTime, FormaPago As String, MonedaPago As String, Monto As Decimal, LugarExpedicion As String,
CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable, dttpagosimpuestos As DataTable, CuentaBeneficiario As String, TipoCambioP As Decimal, dttpagos As Data.DataTable, dttpagosimpuestos As DataTable,
Optional UsoCFDI As String = "P01", Optional CFDIRelacionado As String = "", Optional EsCancelacion As Boolean = False) As CFDITimbre Optional UsoCFDI As String = "CP01", Optional CFDIRelacionado As String = "") As CFDITimbre
' validación extra para cuando es cancelación requiere el folio relacionado
If EsCancelacion AndAlso CFDIRelacionado = "" Then
Return Nothing
End If
Dim Timbre As New CFDITimbre Dim Timbre As New CFDITimbre
@@ -1089,8 +1086,8 @@ Public Class Timbrado
Dim ImporteCancelacion As Decimal = 1 Dim ImporteCancelacion As Decimal = 1
Dim MonedaCancelacion As String = "MXN" Dim MonedaCancelacion As String = "MXN"
Dim TipoCambioCancelacion As Double = 1 Dim TipoCambioCancelacion As Decimal = 1
If EsCancelacion Then MonedaPago = MonedaCancelacion
'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre 'como registra un peso por cada fatura que se cancele, se tiene que multiplicar por el numero de facturas, para que se pueda emitir el timbre
If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count If dttpagos IsNot Nothing AndAlso dttpagos.Rows.Count > 0 Then ImporteCancelacion = ImporteCancelacion * dttpagos.Rows.Count
Timbre.ComplementoPagos.CtaOrdenante = CuentaPago Timbre.ComplementoPagos.CtaOrdenante = CuentaPago
@@ -1098,8 +1095,8 @@ Public Class Timbrado
Timbre.ComplementoPagos.FechaPago = FechaPago Timbre.ComplementoPagos.FechaPago = FechaPago
Timbre.ComplementoPagos.FormaDePagoP = FormaPago Timbre.ComplementoPagos.FormaDePagoP = FormaPago
Timbre.ComplementoPagos.MonedaP = MonedaPago Timbre.ComplementoPagos.MonedaP = MonedaPago
Timbre.ComplementoPagos.Monto = If(EsCancelacion, ImporteCancelacion, Monto) Timbre.ComplementoPagos.Monto = Monto.RoundSQL
Timbre.ComplementoPagos.TipoCambioP = If(EsCancelacion, TipoCambioCancelacion, TipoCambioP) Timbre.ComplementoPagos.TipoCambioP = TipoCambioP
Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago, ObjetoImpuesto As String Dim VentaFolioFiscal, VentaSerie, VentaFolio, VentaAbreviaturaSAT, VentaMetodoPago, ObjetoImpuesto As String
@@ -1123,7 +1120,9 @@ Public Class Timbrado
PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal PorcentajeIEPS = dr("PorcentajeIEPS").ToString.ToDecimal
ObjetoImpuesto = dr("ObjetoImpuesto").ToString ObjetoImpuesto = dr("ObjetoImpuesto").ToString
' si la moneda es igual, se omite el tipo de cambio de la venta ' si la moneda es igual, se omite el tipo de cambio de la venta
If MonedaPago = VentaAbreviaturaSAT Then VentaTipoCambio = 0 If MonedaPago = VentaAbreviaturaSAT Then
VentaTipoCambio = 1
End If
'condiciones especiales para el pago en pesos, facturas en moneda extranjera 'condiciones especiales para el pago en pesos, facturas en moneda extranjera
If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then If MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then
@@ -1136,20 +1135,21 @@ Public Class Timbrado
.Folio = VentaFolio, .Folio = VentaFolio,
.MonedaDR = VentaAbreviaturaSAT, .MonedaDR = VentaAbreviaturaSAT,
.MetodoDePagoDR = VentaMetodoPago, .MetodoDePagoDR = VentaMetodoPago,
.ImpPagado = If(EsCancelacion, 1, VentaImportePago), .ImpPagado = VentaImportePago,
.ImpSaldoInsoluto = If(EsCancelacion, VentaImporteSaldoAnterior - 1, VentaImporteSaldoInsoluto), .ImpSaldoInsoluto = VentaImporteSaldoInsoluto,
.ImpSaldoAnt = VentaImporteSaldoAnterior, .ImpSaldoAnt = VentaImporteSaldoAnterior,
.TipoCambioDR = VentaTipoCambio, .TipoCambioDR = VentaTipoCambio,
.EquivalenciaDR = VentaTipoCambio,
.NumParcialidad = VentaNumParcialidad, .NumParcialidad = VentaNumParcialidad,
.ObjetoImpuesto = OBjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)} .ObjetoImpuesto = ObjetoImpuesto} 'If(drr("MetodoPago").ToString = "PUE", 0, drr("NumParcialidad").ToString.ToEntero)}
For Each drp As DataRow In dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower)).Rows For Each drp As DataRow In dttpagosimpuestos.FiltraParametros(String.Format("FolioFiscal = '{0}'", VentaFolioFiscal.ToLower)).Rows
doc.Impuestos.Add(New CFDIConceptosImpuestos With { doc.Impuestos.Add(New CFDIConceptosImpuestos With {
.TrasladooRetencion = drp("Tipo").ToString, .TrasladooRetencion = drp("Tipo").ToString,
.Base = drp("Base").ToString.ToDecimal, .Base = drp("Base").ToString.ToDecimal.RoundSQL,
.TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal, .TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal,
.Impuesto = drp("TipoImpuesto").ToString, .Impuesto = drp("TipoImpuesto").ToString,
.Importe = drp("Importe").ToString().ToDecimal .Importe = drp("Importe").ToString().ToDecimal.RoundSQL
} }
) )
@@ -1353,7 +1353,7 @@ Public Class Timbrado
For Each Ret In ObjCFDITimbre.Retenciones For Each Ret In ObjCFDITimbre.Retenciones
Dim clbImp As ClbNegBICFDv3_3.Impuesto = If(Ret.Impuesto = "002", ClbNegBICFDv3_3.Impuesto.IVA, If(Ret.Impuesto = "003", ClbNegBICFDv3_3.Impuesto.IEPS, ClbNegBICFDv3_3.Impuesto.ISR)) Dim clbImp As ClbNegBICFDv3_3.Impuesto = If(Ret.Impuesto = "002", ClbNegBICFDv3_3.Impuesto.IVA, If(Ret.Impuesto = "003", ClbNegBICFDv3_3.Impuesto.IEPS, ClbNegBICFDv3_3.Impuesto.ISR))
Msg = CFDi.ImpuestosRetencionesCfd(clbImp, Ret.Importe.ToDecimal) Msg = CFDi.ImpuestosRetencionesCfd(clbImp, Ret.Importe)
Next Next
If Not HasErrorRetenciones Then If Not HasErrorRetenciones Then
@@ -3700,6 +3700,10 @@ Public Class Timbrado
#End Region #End Region
#Region "Receptor" #Region "Receptor"
If ObjCFDITimbre.Receptor.RFC.ToUpper.Contiene("XAXX010101000", "XEXX010101000") Then 'Condición del SAT. CFDI40149
ObjCFDITimbre.Receptor.DomicilioFiscalReceptor = ObjCFDITimbre.Comprobante.LugarExpedicion
End If
comprobante.Receptor = New Profact.TimbraCFDI40.ComprobanteReceptor() comprobante.Receptor = New Profact.TimbraCFDI40.ComprobanteReceptor()
comprobante.Receptor.Rfc = ObjCFDITimbre.Receptor.RFC comprobante.Receptor.Rfc = ObjCFDITimbre.Receptor.RFC
comprobante.Receptor.Nombre = ObjCFDITimbre.Receptor.Nombre comprobante.Receptor.Nombre = ObjCFDITimbre.Receptor.Nombre
@@ -3824,7 +3828,7 @@ Public Class Timbrado
For Each Ret In ObjCFDITimbre.Retenciones For Each Ret In ObjCFDITimbre.Retenciones
comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI40.ComprobanteImpuestosRetencion() comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI40.ComprobanteImpuestosRetencion()
comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto
comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe.ToDecimal comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe
w += 1 w += 1
Next Next
@@ -4048,9 +4052,9 @@ Public Class Timbrado
ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate() ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate()
ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP
ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP
ComPag.Pago(0).TipoCambioPSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True) ComPag.Pago(0).TipoCambioPSpecified = True 'If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToDecimal ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP
ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto.ToDecimal ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto
If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then
ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion
End If End If
@@ -4085,6 +4089,30 @@ Public Class Timbrado
End If End If
If ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0 Then If ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0 Then
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales()
'Totales Generales
Totales.MontoTotalPagos = ObjCFDITimbre.ComplementoPagos.Totales.MontoTotalPagos
Totales.TotalTrasladosBaseIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16
Totales.TotalTrasladosBaseIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0
Totales.TotalTrasladosImpuestoIVA16 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16.RoundSQL
Totales.TotalTrasladosImpuestoIVA16Specified = Totales.TotalTrasladosBaseIVA16 > 0
Totales.TotalTrasladosBaseIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8
Totales.TotalTrasladosBaseIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0
Totales.TotalTrasladosImpuestoIVA8 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8.RoundSQL
Totales.TotalTrasladosImpuestoIVA8Specified = Totales.TotalTrasladosBaseIVA8 > 0
Totales.TotalTrasladosBaseIVA0 = ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0
Totales.TotalTrasladosBaseIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
Totales.TotalTrasladosImpuestoIVA0 = 0
Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
Totales.TotalRetencionesIEPSSpecified = False
ComPag.Totales = Totales
ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {} ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {}
Dim i As Integer Dim i As Integer
For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados
@@ -4096,10 +4124,12 @@ Public Class Timbrado
ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio
ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDRSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
If doc.Impuestos IsNot Nothing Then If doc.Impuestos IsNot Nothing Then
@@ -4116,6 +4146,9 @@ Public Class Timbrado
Tra.ImporteDRSpecified = True Tra.ImporteDRSpecified = True
Tra.ImporteDR = docimp.Importe Tra.ImporteDR = docimp.Importe
Tra.ImpuestoDR = docimp.Impuesto Tra.ImpuestoDR = docimp.Impuesto
Tra.TipoFactorDR = docimp.TipoFactor
Tra.TasaOCuotaDRSpecified = True
Tra.TasaOCuotaDR = docimp.TasaOCuota
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra
End If End If
j += 1 j += 1
@@ -4132,54 +4165,80 @@ Public Class Timbrado
Tra.BaseDR = docimp.Base Tra.BaseDR = docimp.Base
Tra.ImporteDR = docimp.Importe Tra.ImporteDR = docimp.Importe
Tra.ImpuestoDR = docimp.Impuesto Tra.ImpuestoDR = docimp.Impuesto
Tra.TipoFactorDR = docimp.TipoFactor
Tra.TasaOCuotaDR = docimp.TasaOCuota
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra
End If End If
j += 1 j += 1
Next Next
End If End If
End If End If
i += 1 i += 1
Next Next
'Estos impuestos aplicarían para anticipos If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
If ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then Dim x As Integer
ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {} ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP() ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosRetenidosSpecifiedP = True ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Traslados).Count - 1) {}
'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosRetenidos = ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos.ToDecimal For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosTrasladadosSpecified = True ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
'ComPag.Pago(0).ImpuestosP(0).TotalImpuestosTrasladados = ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados.ToDecimal ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota
Dim x As Integer ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe
ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R").Count - 1) {} ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).BaseP = Tra.Base
For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R") x += 1
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP() Next
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto End If
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
x += 1
Next
End If
If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
Dim x As Integer
ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T").Count - 1) {}
For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T")
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe
x += 1
Next
End If
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
Dim x As Integer
If ComPag.Pago(0).ImpuestosP(0) Is Nothing Then ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Retenciones).Count - 1) {}
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
x += 1
Next
End If End If
Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces() ''Estos impuestos aplicarían para anticipos
'If ObjCFDITimbre.ComplementoPagos.tota > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then
' ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
' ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
' If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
' Dim x As Integer
' ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T").Count - 1) {}
' For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "T")
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota
' ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.Importe
' x += 1
' Next
' End If
' If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
' Dim x As Integer
' ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R").Count - 1) {}
' For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(w) w.TrasladooRetencion = "R")
' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
' ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.Importe
' x += 1
' Next
' End If
'End If
Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces()
nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20") nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20")
Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp) Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp)
Dim docComp As New XmlDocument() Dim docComp As New XmlDocument()
@@ -4820,7 +4879,6 @@ Public Class Timbrado
If FolioFiscal <> "" Then If FolioFiscal <> "" Then
resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML) resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML)
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
'Actualiza Estatus Factura 'Actualiza Estatus Factura
@@ -4914,6 +4972,7 @@ Public Class Timbrado
End If End If
End If End If
resultadoTimbre.GuardaXml(RutaArchivo, NombreArchivoXML)
Catch ex As Exception Catch ex As Exception
Retorno = ex.ToString() Retorno = ex.ToString()
End Try End Try
@@ -4972,6 +5031,9 @@ Public Class Timbrado
#End Region #End Region
#Region "Receptor" #Region "Receptor"
If ObjCFDITimbre.Receptor.RFC.ToUpper.Contiene("XAXX010101000", "XEXX010101000") Then 'Condición del SAT. CFDI40149
ObjCFDITimbre.Receptor.DomicilioFiscalReceptor = ObjCFDITimbre.Comprobante.LugarExpedicion
End If
cfdi.Receptor(ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Receptor.Nombre, ObjCFDITimbre.Receptor.DomicilioFiscalReceptor, ObjCFDITimbre.Receptor.ResidenciaFiscal, ObjCFDITimbre.Receptor.NumeroRegistroTributario, ObjCFDITimbre.Receptor.RegimenFiscalReceptor, ObjCFDITimbre.Receptor.UsoCFDI) cfdi.Receptor(ObjCFDITimbre.Receptor.RFC, ObjCFDITimbre.Receptor.Nombre, ObjCFDITimbre.Receptor.DomicilioFiscalReceptor, ObjCFDITimbre.Receptor.ResidenciaFiscal, ObjCFDITimbre.Receptor.NumeroRegistroTributario, ObjCFDITimbre.Receptor.RegimenFiscalReceptor, ObjCFDITimbre.Receptor.UsoCFDI)
@@ -5227,7 +5289,18 @@ Public Class Timbrado
#Region "Complemento Pago" #Region "Complemento Pago"
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
cfdi.Pago20Totales(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ObjCFDITimbre.ComplementoPagos.TotalPagos)
cfdi.Pago20Totales(ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIVA,
ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesISR,
ObjCFDITimbre.ComplementoPagos.Totales.TotalRetencionesIEPS,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA16,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA16,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA8,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA8,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseIVA0,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosImpuestoIVA0,
ObjCFDITimbre.ComplementoPagos.Totales.TotalTrasladosBaseExento,
ObjCFDITimbre.ComplementoPagos.Totales.MontoTotalPagos)
cfdi.Pago20(ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"), cfdi.Pago20(ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss"),
ObjCFDITimbre.ComplementoPagos.FormaDePagoP, ObjCFDITimbre.ComplementoPagos.FormaDePagoP,
@@ -5260,31 +5333,47 @@ Public Class Timbrado
doc.ImpPagado, doc.ImpPagado,
doc.ImpSaldoInsoluto, doc.ImpSaldoInsoluto,
doc.ObjetoImpuesto) doc.ObjetoImpuesto)
'falta impuestos If doc.Impuestos IsNot Nothing Then
''traslados
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
Dim j As Integer = 0
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
If docimp.TrasladooRetencion = "T" Then
cfdi.Pago20TrasladoDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe)
End If
j += 1
Next
End If
''retenciones
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
Dim j As Integer = 0
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
If docimp.TrasladooRetencion = "R" Then
cfdi.Pago20RetencionDR(docimp.Base, docimp.Impuesto, docimp.TipoFactor, docimp.TasaOCuota, docimp.Importe)
End If
j += 1
Next
End If
End If
Next Next
'Estos impuestos aplicarían para anticipos If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
If ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados > 0 Then
cfdi.PagoImpuestos(ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos, ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados)
If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
For Each Ret As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R")
cfdi.PagoRetencion(Ret.Impuesto, Ret.Importe)
Next
End If
If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
For Each Tra As CFDIConceptosImpuestos In (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "T")
cfdi.PagoTraslado(Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota, Tra.Importe)
Next
End If
For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
cfdi.Pago20TrasladoP(Tra.Base, Tra.Impuesto, Tra.TipoFactor, Tra.TasaOCuota, Tra.Importe)
Next
End If End If
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
cfdi.Pago20RetencionP(Ret.Impuesto, Ret.Importe)
Next
End If
End If End If
End If End If
#End Region #End Region
@@ -6220,7 +6309,7 @@ Public Class Timbrado
For Each Ret In ObjCFDITimbre.Retenciones For Each Ret In ObjCFDITimbre.Retenciones
comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI33.ComprobanteImpuestosRetencion() comprobante.Impuestos.Retenciones(w) = New Profact.TimbraCFDI33.ComprobanteImpuestosRetencion()
comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto comprobante.Impuestos.Retenciones(w).Impuesto = Ret.Impuesto
comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe.ToDecimal comprobante.Impuestos.Retenciones(w).Importe = Ret.Importe
w += 1 w += 1
Next Next
@@ -6444,8 +6533,8 @@ Public Class Timbrado
ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP
ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP
ComPag.Pago(0).TipoCambioPSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True) ComPag.Pago(0).TipoCambioPSpecified = If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP.ToDecimal ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP
ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto.ToDecimal ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto
If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then
ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion
End If End If
@@ -6511,9 +6600,9 @@ Public Class Timbrado
ComPag.Pago(0).Impuestos = New Profact.TimbraCFDI33.Complementos.Pagos10.PagosPagoImpuestos(0) {} ComPag.Pago(0).Impuestos = New Profact.TimbraCFDI33.Complementos.Pagos10.PagosPagoImpuestos(0) {}
ComPag.Pago(0).Impuestos(0) = New Profact.TimbraCFDI33.Complementos.Pagos10.PagosPagoImpuestos() ComPag.Pago(0).Impuestos(0) = New Profact.TimbraCFDI33.Complementos.Pagos10.PagosPagoImpuestos()
ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidosSpecified = True ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidosSpecified = True
ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidos = ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos.ToDecimal ComPag.Pago(0).Impuestos(0).TotalImpuestosRetenidos = ObjCFDITimbre.ComplementoPagos.TotalImpuestosRetenidos
ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladadosSpecified = True ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladadosSpecified = True
ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladados = ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados.ToDecimal ComPag.Pago(0).Impuestos(0).TotalImpuestosTrasladados = ObjCFDITimbre.ComplementoPagos.TotalImpuestosTrasladados
If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then If (ObjCFDITimbre.ComplementoPagos.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
Dim x As Integer Dim x As Integer

View File

@@ -153,6 +153,7 @@ Namespace Extensiones
Public Property Estado As String = "" Public Property Estado As String = ""
Public Property EstatusCancelacion As String = "" Public Property EstatusCancelacion As String = ""
Public Property CancelacionFecha As Date Public Property CancelacionFecha As Date
Public Property SolicitudCancelacionAcuse As String = ""
Public Property CancelacionAcuse As String = "" Public Property CancelacionAcuse As String = ""
End Class End Class

View File

@@ -1307,16 +1307,25 @@ Partial Class Bancos_IE
GvRH.DataBind() GvRH.DataBind()
UpGvRH.Update() UpGvRH.Update()
End Sub End Sub
Private Sub CargaCorteCaja(CveCuenta As Integer) Private Sub CargaCorteCaja()
'Checar si hay un Turno Abierto 'Checar si hay un Turno Abierto
Dim ObjPVenta As New ClsPuntoVenta Dim ObjPVenta As New ClsPuntoVenta
If ObjPVenta.GetCortesPorCuenta(CveCuenta, UsuarioActual.CveEmpresa) Then If ObjPVenta.GetVta_Cortes("-1", "-1", UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, 0) Then
If ObjPVenta.DtResultados.Rows.Count > 0 Then
CveCorte = ObjPVenta.CveCorte CveCorte = ObjPVenta.CveCorte
End If
End If End If
ObjPVenta.Dispose() ObjPVenta.Dispose()
'Dim ObjPVenta As New ClsPuntoVenta
'If ObjPVenta.GetCortesPorCuenta(CveCuenta, UsuarioActual.CveEmpresa) Then
' CveCorte = ObjPVenta.CveCorte
'End If
'ObjPVenta.Dispose()
End Sub End Sub
#Region " CARGA PROVEEDOR " #Region " CARGA PROVEEDOR "
@@ -1671,7 +1680,7 @@ Partial Class Bancos_IE
'PAGAR NC CON C.CH DEBE DESCONTAR EN EL CORTE 'PAGAR NC CON C.CH DEBE DESCONTAR EN EL CORTE
If Opcion IsNot Nothing AndAlso Opcion = "DevDinV" AndAlso dr("CveTipoCuenta").ToString.ToEntero = 1 Then If Opcion IsNot Nothing AndAlso Opcion = "DevDinV" AndAlso dr("CveTipoCuenta").ToString.ToEntero = 1 Then
CargaCorteCaja(DdlCuenta.SelectedValue.ToEntero) CargaCorteCaja()
End If End If
If dr("UsaTarjeta").ToString = "True" Then If dr("UsaTarjeta").ToString = "True" Then
@@ -2613,7 +2622,7 @@ Partial Class Bancos_IE
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString = "ANTC" Then
If CveCliente > 0 Then If CveCliente > 0 Then
CveConceptoCompra = 3 'Clientes CveConceptoCompra = 66 'Clientes
CveConceptoContable = 30 'Bancos CveConceptoContable = 30 'Bancos
CvePlantillaPoliza = 12 CvePlantillaPoliza = 12
End If End If

View File

@@ -101,7 +101,7 @@
</div> </div>
<div class="col-md-1 control-label" > <div class="col-md-1 control-label" >
<asp:Label ID="LblSunproyecto" runat="server" Text="SubProyecto:"></asp:Label> <asp:Label ID="LblSubproyecto" runat="server" Text="SubProyecto:"></asp:Label>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@@ -664,7 +664,7 @@
if (textBoxes[i].id.indexOf('C_Tab_TabPago_GvMovAcreedor_TxtComision') >= 0) { if (textBoxes[i].id.indexOf('C_Tab_TabPago_GvMovAcreedor_TxtComision') >= 0) {
if (textBoxes[i].value != '') { if (textBoxes[i].value != '') {
Comision = parseFloat(Comision) + parseFloat(textBoxes[i].value.split(',').join('')); Comision = parseFloat(Comision) + ToDouble(textBoxes[i].value);
} }
} }
@@ -673,16 +673,15 @@
idd = textBoxes[i].id.replace('C_Tab_TabPago_GvMovAcreedor_TxtAbonar_', ''); idd = textBoxes[i].id.replace('C_Tab_TabPago_GvMovAcreedor_TxtAbonar_', '');
Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_Tab_TabPago_GvMovAcreedor_HplF_" + idd).innerText; Facturas = Facturas + (Importe == 0 ? '' : ', ') + $get("C_Tab_TabPago_GvMovAcreedor_HplF_" + idd).innerText;
if (CveMoneda == 2 && CveMonedaPago == 1) { if (CveMoneda == 2 && CveMonedaPago == 1) {
Importe = parseFloat(Importe) + (parseFloat($get('TxtTCPago').value) * parseFloat(textBoxes[i].value.split(',').join(''))); Importe = parseFloat(Importe) + (parseFloat($get('TxtTCPago').value) * ToDouble(textBoxes[i].value));
} else if (CveMoneda == 1 && CveMonedaPago == 2) { } else if (CveMoneda == 1 && CveMonedaPago == 2) {
Importe = parseFloat(Importe) + (parseFloat($get('TxtTCPago').value) / parseFloat(textBoxes[i].value.split(',').join(''))); Importe = parseFloat(Importe) + (ToDouble(textBoxes[i].value) / ToDouble($get('TxtTCPago').value));
} else if ((CveMoneda == 1 && CveMonedaPago == 1) || (CveMoneda == 2 && CveMonedaPago == 2)) { } else if ((CveMoneda == 1 && CveMonedaPago == 1) || (CveMoneda == 2 && CveMonedaPago == 2)) {
Importe = parseFloat(Importe) + parseFloat(textBoxes[i].value.split(',').join('')); Importe = parseFloat(Importe) + ToDouble(textBoxes[i].value);
} }
} }
} }
} }
} }
if (!Facturas == '') { if (!Facturas == '') {

View File

@@ -277,7 +277,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
int CveConceptoContablePrestamoComplementario = 202; int CveConceptoContablePrestamoComplementario = 202;
int CvePlantillaPoliza = 21; int CvePlantillaPoliza = 21;
int CvePrePoliza = 0; int CvePrePoliza = 0;
int CveMoneda = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero(); int CveMonedaPago = get_GlobalDTBancosCuentas(-1, CveEmpresa: UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveMoneda", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveCuenta = {DdlCuenta.SelectedValue.ToEntero()}").ToEntero();
int FolioFijo = 0; int FolioFijo = 0;
int IDPoliza = 0; int IDPoliza = 0;
StringBuilder Msg = new StringBuilder(); StringBuilder Msg = new StringBuilder();
@@ -300,7 +300,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
// DATOS PREPOLIZA // DATOS PREPOLIZA
if ( DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero(); if ( DdlTipoTransaccion.SelectedValue == "1" && UsuarioActual.CveEmpresa != 119) FolioFijo = TxtFolio.Text.ToEntero();
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMoneda, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa)); CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE PAGO ACRREDORES", CvePlantillaPoliza, TxtImporte.Text.Trim().ToDouble(), TxtImporte.Text.Trim().ToDouble(), CveMonedaPago, TxtFechaDocumento.Text.ToDate(), DdlProveedores.SelectedText.ToString(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo: FolioFijo, ReglaFolioPoliza: ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, null, UsuarioActual.CveEmpresa), CveTipoPoliza: ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa));
if (CvePrePoliza > 0) if (CvePrePoliza > 0)
{ {
@@ -311,7 +311,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Conc = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text;
string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text; string Ref = TxtObservaciones.Text == "" ? TxtFolio.Text : TxtObservaciones.Text;
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), DdlProveedores.SelectedText.ToString(), ImporteBanco.ToString().ToDouble(), CveMoneda, CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero(), DdlTipoTransaccion.SelectedValue.ToEntero(), TxtFechaDocumento.Text.Trim().ToDate(), TxtFolio.Text.Trim(), DdlProveedores.SelectedText.ToString(), ImporteBanco.ToString().ToDouble(), CveMonedaPago,
TCPago.ToString().ToDouble(), TxtObservaciones.Text.Trim(), "", ChkAbonoCuenta.Checked, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); TCPago.ToString().ToDouble(), TxtObservaciones.Text.Trim(), "", ChkAbonoCuenta.Checked, false, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
@@ -327,6 +327,7 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
decimal ImporteMN; decimal ImporteMN;
decimal ImporteComision; decimal ImporteComision;
decimal ImporteComisionMN; decimal ImporteComisionMN;
decimal AcumImporteMN = 0;
bool TipoMovtoComision = false; bool TipoMovtoComision = false;
int IdCtaContableOtrosGastos = 0; int IdCtaContableOtrosGastos = 0;
@@ -364,18 +365,18 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
if (gvr.FCCheckBox("Chk").Checked) if (gvr.FCCheckBox("Chk").Checked)
{ {
int tCveMoneda = gvr.DataKey("CveMoneda").ToEntero(); int tCveMoneda = gvr.DataKey("CveMoneda").ToEntero();
if (CveMoneda == 1 && tCveMoneda == 1) if (CveMonedaPago == 1 && tCveMoneda == 1)
{ {
ImporteMN = Importe; ImporteMN = Importe;
ImporteComisionMN = ImporteComision; ImporteComisionMN = ImporteComision;
} }
else if (CveMoneda == 1 && tCveMoneda == 2) else if (CveMonedaPago == 1 && tCveMoneda == 2)
{ {
ImporteComisionMN = ImporteComision; ImporteComisionMN = ImporteComision;
if (UsaComplementaria) if (UsaComplementaria)
{ {
ImporteMN = Importe; ImporteMN = Importe;
ImporteComplementaria = Importe * TC - Importe; ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
} }
else else
{ {
@@ -383,33 +384,32 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
ImporteComplementaria = 0; ImporteComplementaria = 0;
} }
} }
else if (CveMoneda == 2 && tCveMoneda == 1) else if (CveMonedaPago == 2 && tCveMoneda == 1)
{ {
ImporteMN = Importe; ImporteMN = Importe;
ImporteComisionMN = ImporteComision; ImporteComisionMN = ImporteComision;
} }
else if (CveMoneda == 2 && tCveMoneda == 2) else if (CveMonedaPago == 2 && tCveMoneda == 2)
{ {
ImporteComisionMN = ImporteComision; ImporteComisionMN = ImporteComision;
if (UsaComplementaria) if (UsaComplementaria)
{ {
ImporteMN = Importe; ImporteMN = Importe;
ImporteComplementaria = Importe * TC - Importe; ImporteComplementaria = (Importe * TC - Importe).RoundSQL();
} }
else else
{ {
ImporteMN = Importe * TC; ImporteMN = (Importe * TC).RoundSQL();
ImporteComplementaria = 0; ImporteComplementaria = 0;
} }
} }
ImporteMN = Math.Round(ImporteMN, 2, MidpointRounding.AwayFromZero); ImporteMN = ImporteMN.RoundSQL();
ImporteComplementaria = Math.Round(ImporteComplementaria, 2, MidpointRounding.AwayFromZero); ImporteComplementaria = ImporteComplementaria.RoundSQL();
ImporteComisionMN = Math.Round(ImporteComisionMN, 2, MidpointRounding.AwayFromZero); ImporteComisionMN = ImporteComisionMN.RoundSQL();
ImporteComision = Math.Round(ImporteComision, 2, MidpointRounding.AwayFromZero); ImporteComision = ImporteComision.RoundSQL();
AcumImporteMN += ImporteMN;
if (tCveMoneda != 1) if (tCveMoneda != 1)
{ {
@@ -477,18 +477,19 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
} }
if (CveMoneda != 1) if (CveMonedaPago != 1)
{ {
if (UsaComplementaria) if (UsaComplementaria)
{ {
ImporteMNBanco = ImporteBanco; ImporteMNBanco = ImporteBanco;
ImporteComplementaria = ImporteBanco * TCPago - ImporteBanco; ImporteComplementaria = (ImporteBanco * TCPago - ImporteBanco).RoundSQL();
} }
else else
{ {
ImporteMNBanco = ImporteBanco * TCPago; ImporteMNBanco = (ImporteBanco * TCPago).RoundSQL();
ImporteComplementaria = 0; ImporteComplementaria = 0;
} }
} }
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBanco, Conc, DateTime.Now, IDCtaContableBancos, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteMNBanco, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
@@ -496,12 +497,30 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
MsgError = "No se pudo insertar concepto de bancos"; MsgError = "No se pudo insertar concepto de bancos";
} }
if (CveMoneda != 1 && UsaComplementaria) if (CveMonedaPago != 1 && UsaComplementaria)
{ {
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero())) if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, true, ImporteBanco, Ref, CveConceptoContableBancoComplementario, Conc, DateTime.Now, IDCtaContableBancosComplementario, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: ImporteComplementaria, ImporteME: ImporteBanco, TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
{ {
MsgError = "No se pudo insertar concepto de bancos complementaria"; MsgError = "No se pudo insertar concepto de bancos complementaria";
} }
if (AcumImporteMN!=(ImporteBanco + ImporteComplementaria)) {
int tCveConceptoOtIngresos = 0;
bool TipoMovtoOt = false;
decimal Dif = AcumImporteMN - (ImporteBanco + ImporteComplementaria);
if (Dif < 0)
{
tCveConceptoOtIngresos = 211; TipoMovtoOt = false;
}
else
{
tCveConceptoOtIngresos = 78; TipoMovtoOt = true;
}
if (!ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoOt, Dif.Abs(), Ref, tCveConceptoOtIngresos, Conc, DateTime.Now, 0, -1, CveIE, CveProveedor: DdlProveedores.SelectedValue.ToEntero(), ImporteMX: Dif.Abs(), ImporteME: Dif.Abs(), TipoCambio: TCPago, TipoCambioPago: TCPago, CveSubProyecto: DdlSubProyecto.SelectedValue.ToEntero()))
{
MsgError = "No se pudo insertar concepto de ajuste en redondeo";
}
}
} }
} }
@@ -556,7 +575,8 @@ public partial class Bancos_PagoAcreedor : ClsPaginas
{ {
if (Msg.ToString().Equals("")) if (Msg.ToString().Equals(""))
{ {
Msg.Append("El Documento se guardo correctamente"); Msg.AppendFormat("El Documento se guardo correctamente. Folio <b><a href='/Bancos/IE.aspx?CveIE={0}' target='_blank' class='Texto'>{1}</a></b> <br/>", CveIE, ObjIE.Folio);
} }
System.IO.FileInfo archivo = null; System.IO.FileInfo archivo = null;

View File

@@ -124,6 +124,11 @@
<td> <td>
<asp:TextBox ID="TxtFolio" CssClass="form-control input-sm " runat="server" MaxLength="14" Width="80px"></asp:TextBox></td> <asp:TextBox ID="TxtFolio" CssClass="form-control input-sm " runat="server" MaxLength="14" Width="80px"></asp:TextBox></td>
</tr> </tr>
<tr id="trPagueseA">
<td>Paguese</td>
<td>
<asp:TextBox ID="TxtPaguese" CssClass="form-control input-sm " runat="server" Width="200px"></asp:TextBox></td>
</tr>
<tr> <tr>
<td>Observaciones:</td> <td>Observaciones:</td>
<td> <td>

View File

@@ -283,6 +283,14 @@ Partial Class Bancos_Transferencias
CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEDestino = CveIE CveIEDestino = CveIE
Else Else
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
FolioDestino = TxtFolio.Text.Trim
If TxtPaguese.Text.Trim <> "" Then
CuentaDestino = TxtPaguese.Text.Trim
End If
End If
CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEDestino = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, String.Format("Transferencia Cta: {0}", DdlCuentaOrigen.SelectedItem.Text), ImporteDestino, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIEDestino = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, String.Format("Transferencia Cta: {0}", DdlCuentaOrigen.SelectedItem.Text), ImporteDestino, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
End If End If

Binary file not shown.

View File

@@ -21,8 +21,7 @@
<li> <li>
<asp:LinkButton ID="LnkPaqueteEgre" runat="server"><i class="fa fa-ad-pdf"></i> Paquete Egresos</asp:LinkButton> <asp:LinkButton ID="LnkPaqueteEgre" runat="server"><i class="fa fa-ad-pdf"></i> Paquete Egresos</asp:LinkButton>
</li> </li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
@@ -71,7 +70,7 @@
<asp:ListItem Text="Orden" Value="4"></asp:ListItem> <asp:ListItem Text="Orden" Value="4"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
</div> </div>
<label class="col-md-1">Segmento: </label> <label class="col-md-1">Centro Costo: </label>
<div class="col-md-1"> <div class="col-md-1">
<asp:DropDownList ID="DdlSegmentoNeg" DataTextField="Nombre" DataValueField="Id" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList> <asp:DropDownList ID="DdlSegmentoNeg" DataTextField="Nombre" DataValueField="Id" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList>
</div> </div>

View File

@@ -45,14 +45,8 @@ Partial Class Contabilidad_FiltraPolizas
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG ContabilidadSIG = UsuarioActual.Empresa.UsaContabilidadSIG
ViewState("Orden") = "" ViewState("Orden") = ""
DdlPeriodo.SelectedValue = Now.Month.ToString DdlPeriodo.SelectedValue = Now.Month.ToString
TxtFechaICredito.Text = Now.FirstDayOfMonth.ToShortDateString TxtFechaICredito.Text = Now.FirstDayOfMonth.ToShortDateString
@@ -87,9 +81,6 @@ Partial Class Contabilidad_FiltraPolizas
Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString().ToEntero() Dim Ejercicio As Integer = DdlEjercicio.SelectedValue.ToString().ToEntero()
Dim Periodo As Integer = DdlPeriodo.SelectedValue.ToString().ToEntero() Dim Periodo As Integer = DdlPeriodo.SelectedValue.ToString().ToEntero()
If ContabilidadSIG Then If ContabilidadSIG Then
Dim ObjConta As New ClsContabilidad Dim ObjConta As New ClsContabilidad
@@ -103,7 +94,6 @@ Partial Class Contabilidad_FiltraPolizas
ObjConta.Dispose() ObjConta.Dispose()
Else Else
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
@@ -125,8 +115,6 @@ Partial Class Contabilidad_FiltraPolizas
End If End If
Gv.DataBind() Gv.DataBind()
UpDatos.Update() UpDatos.Update()
End Sub End Sub
@@ -151,7 +139,6 @@ Partial Class Contabilidad_FiltraPolizas
End If End If
DdlSegmentoNeg.DataBind() DdlSegmentoNeg.DataBind()
DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1")) DdlSegmentoNeg.Items.Insert(0, New ListItem("Todos", "-1"))
@@ -183,7 +170,6 @@ Partial Class Contabilidad_FiltraPolizas
End If End If
DdlEjercicio.DataBind() DdlEjercicio.DataBind()
DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString) DdlEjercicio.SelectedValueExist(UsuarioActual.Empresa.EjercicioActual.ToString)
@@ -621,11 +607,12 @@ Partial Class Contabilidad_FiltraPolizas
e.Row.Cells(2).Text = $"<a href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("Id")}' class='Texto' Target='_blank' >{e.Row.DataKey("Folio")}</a>" e.Row.Cells(2).Text = $"<a href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("Id")}' class='Texto' Target='_blank' >{e.Row.DataKey("Folio")}</a>"
e.Row.Cells(6).Text = $"<a href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("Id")}' class='Texto' Target='_blank'><i class='fa fa-arrow-right' style='color:#686868;'></i></a>" e.Row.Cells(6).Text = $"<a href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("Id")}' class='Texto' Target='_blank'><i class='fa fa-arrow-right' style='color:#686868;'></i></a>"
Else
e.Row.Cells(2).Text = $"<a href='/Contabilidad/RegPoliza.aspx?IdPoliza={e.Row.DataKey("Id")}' class='Texto' Target='_blank' >{e.Row.DataKey("Folio")}</a>"
e.Row.Cells(6).Text = $"<a href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={e.Row.DataKey("Id")}' class='Texto' Target='_blank'><i class='fa fa-arrow-right' style='color:#686868;'></i></a>"
End If End If
End If End If
End Sub End Sub

View File

@@ -9,8 +9,6 @@ Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad_PolizasImpresion Partial Class Contabilidad_PolizasImpresion
Inherits ClsPaginas Inherits ClsPaginas
Public Property ContabilidadSIG As Boolean Public Property ContabilidadSIG As Boolean
Get Get
If ViewState("ContabilidadSIG") Is Nothing Then If ViewState("ContabilidadSIG") Is Nothing Then
@@ -53,26 +51,22 @@ Partial Class Contabilidad_PolizasImpresion
CargaCuentas() CargaCuentas()
End If End If
End If End If
End Sub End Sub
Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click
If ContabilidadSIG Then If ContabilidadSIG Then
ConsultaSIIG() ConsultaSIG()
Else Else
ConsultaCONTPAQi() ConsultaCONTPAQi()
End If End If
End Sub End Sub
#Region "SIG"
Private Sub ConsultaSIG()
#Region "SIIG"
Private Sub ConsultaSIIG()
Dim foli As Integer = -1 Dim foli As Integer = -1
Dim folf As Integer = -1 Dim folf As Integer = -1
@@ -129,9 +123,7 @@ Partial Class Contabilidad_PolizasImpresion
End Sub End Sub
Private Sub CargaDdlPolizasSIG()
Private Sub cargaddlpolizasSIG()
Dim objcont As New ClsContabilidad Dim objcont As New ClsContabilidad
If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then
ddlTipoPoliza.DataSource = objcont.DtResultados ddlTipoPoliza.DataSource = objcont.DtResultados
@@ -159,8 +151,6 @@ Partial Class Contabilidad_PolizasImpresion
DdlCuenta.DataValueField = "CveCuenta" DdlCuenta.DataValueField = "CveCuenta"
DdlCuenta.DataTextField = "CtaCodigo" DdlCuenta.DataTextField = "CtaCodigo"
Dim objconta As New ClsContabilidad Dim objconta As New ClsContabilidad
If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DdlCuenta.DataSource = objconta.DtResultados DdlCuenta.DataSource = objconta.DtResultados
@@ -276,7 +266,4 @@ Partial Class Contabilidad_PolizasImpresion
#End Region #End Region
End Class End Class

View File

@@ -1,6 +1,16 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOrigenAplicacion.aspx.vb" Inherits="Contabilidad_RepOrigenAplicacion" %> <%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepOrigenAplicacion.aspx.vb" Inherits="Contabilidad_RepOrigenAplicacion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="LnkExcel" data-toggle="tooltip" OnClick="LnkExcel_Click" data-placement="left" title="Excel" Text="<i class='fa fa-file-excel-o'></i> Excel" Visible="false"></asp:LinkButton>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkExcel" />
</Triggers>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CP" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="CP" runat="Server">
</asp:Content> </asp:Content>
@@ -233,6 +243,22 @@
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="400" HorizontalAlign="Left" /> <ItemStyle Width="400" HorizontalAlign="Left" />
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="" Visible="false">
<ItemTemplate>
<asp:Label ID="LblImporteBase" runat="server" Text='<%# Eval("ImporteBase", "{0:N2}")%>' ></asp:Label>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="" Visible="false">
<ItemTemplate>
<asp:Label ID="ImporteActual" runat="server" Text='<%# Eval("ImporteActual", "{0:N2}")%>' ></asp:Label>
</ItemTemplate>
<ItemStyle Width="100" HorizontalAlign="Right" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Origen"> <asp:TemplateField HeaderText="Origen">
<ItemTemplate> <ItemTemplate>
<asp:HyperLink ID="HLOrigen" runat="server" Text='<%# Eval("Origen", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink> <asp:HyperLink ID="HLOrigen" runat="server" Text='<%# Eval("Origen", "{0:N2}")%>' CssClass="Texto" Target="_blank"></asp:HyperLink>

View File

@@ -81,6 +81,16 @@ Partial Class Contabilidad_RepOrigenAplicacion
TabContainer_ActiveTabChanged(TabContainer, EventArgs.Empty) TabContainer_ActiveTabChanged(TabContainer, EventArgs.Empty)
If UsuarioActual.Empresa.UsaContabilidadSIG Then
TabMensual.Enabled = False
TabAnual.Enabled = False
TdFI.Visible = False
tdTipoReporte.Visible = False
End If
End If End If
End Sub End Sub
@@ -139,23 +149,62 @@ Partial Class Contabilidad_RepOrigenAplicacion
#Region " NORMAL " #Region " NORMAL "
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
If ObjConta.GetOrigenAplicacion(FechaInicio, FechaFin) Then LnkExcel.Visible = False
DtDatos = ObjConta.DtResultados
If UsuarioActual.Empresa.UsaContabilidadSIG Then
Dim AnioActual As Integer = TxtFechaAl.Text.ToDate.Year
Dim AnioAnteior As Integer = AnioActual - 1
GvDatos.Columns(1).Visible = True
GvDatos.Columns(2).Visible = True
GvDatos.Columns(1).HeaderText = AnioAnteior.ToString
GvDatos.Columns(2).HeaderText = AnioActual.ToString
Dim ObjConta As New ClsContabilidad
If ObjConta.GetRepOrigenAplicacion(TxtFechaAl.Text.ToDate, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjConta.DtResultados
If ObjConta.DtResultados.Rows.Count > 0 Then
LnkExcel.Visible = True
End If
Else
GvDatos.DataSource = Nothing
End If
ObjConta.Dispose()
GvDatos.DataBind()
Else Else
DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError) Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
End If
ObjConta.Dispose() Dim FechaInicio = If(TxtFechaDel.Text = "" Or TxtFechaDel.Text = "__/__/____", Date.Now, TxtFechaDel.Text.ToDate)
Dim FechaFin = If(TxtFechaAl.Text = "" Or TxtFechaAl.Text = "__/__/____", Date.Now, TxtFechaAl.Text.ToDate)
If ObjConta.GetOrigenAplicacion(FechaInicio, FechaFin) Then
DtDatos = ObjConta.DtResultados
If DtDatos IsNot Nothing Then Else
CargaGrid() DtDatos = Nothing
Alert("Ocurrio un error al cargar los datos de origen y aplicación", TipoMensaje.MsgError)
End If
ObjConta.Dispose()
If DtDatos IsNot Nothing Then
CargaGrid()
End If
End If End If
End Sub End Sub
Private Sub CargaGrid() Private Sub CargaGrid()
@@ -334,4 +383,7 @@ Partial Class Contabilidad_RepOrigenAplicacion
#End Region #End Region
Protected Sub LnkExcel_Click(sender As Object, e As EventArgs)
GvDatos.ExportToExcel2("RepOrigenAplicacion.xlsx")
End Sub
End Class End Class

View File

@@ -1,116 +0,0 @@
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PolizasImpresion.aspx.vb" Inherits="Contabilidad2_PolizasImpresion" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:Panel ID="Panel1" runat="server" DefaultButton="BtnConsultar">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px;">
<div class="tools">
<asp:Button ID="BtnConsultar" CssClass="btn btn-default" runat="server" Text="Generar" />
</div>
<div class="titlefiltros caption ">
<div class="row" style="padding-top: 1px;">
<label class="col-md-1 truncate">Fecha Inicio:</label>
<div class="col-md-2">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaInicio" PopupButtonID="ImgFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVEFechaInicio" runat="server" ControlToValidate="TxtFechaInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VcoFechaInicio1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaInicio" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VcoFechaInicio2" runat="server" HighlightCssClass="vco" TargetControlID="CVEFechaInicio" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate">Fecha Fin:</label>
<div class="col-md-2 ">
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px;">
<asp:TextBox ID="TxtFechaFin" runat="server" CssClass="form-control" CausesValidation="true" Style="width: 118px" MaxLength="10"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton ID="ImgFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtFechaFin" PopupButtonID="ImgFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RFVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CVFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<ajax:ValidatorCalloutExtender ID="VCOFechaFin1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaFin" Width="350px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCOFechaFin2" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaFin" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<label class="col-md-1 truncate">Tipo Póliza:</label>
<div class="col-md-2">
<asp:DropDownList ID="ddlTipoPoliza" DataTextField="TipoPoliza" DataValueField="CveTipoPoliza" CssClass="form-control input-sm select2-me" runat="server"></asp:DropDownList>
</div>
</div>
</div>
</div>
<div class="portlet-body">
<div class="row">
<label class="col-md-1 truncate">Folio Inicio:</label>
<div class="col-md-2">
<asp:TextBox ID="FolioInicio" CssClass="form-control input-sm" runat="server" Width="60px"></asp:TextBox>
</div>
<label class="col-md-1 truncate">Folio Fin:</label>
<div class="col-md-2 ">
<asp:TextBox ID="FolioFin" CssClass="form-control input-sm" runat="server" Width="60px"></asp:TextBox>
</div>
<label class="col-md-1 truncate">Registró:</label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlUsuarioRegistro" DataTextField="Nombre" DataValueField="CveUsuario" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList>
</div>
<label class="col-md-1 truncate" data-toggle="tooltip" data-placement="top" title="Centro de Costo">Centro de costo:</label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlSubProyectos" DataTextField="SubProyecto" DataValueField="CveSubProyecto" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-1 truncate" data-toggle="tooltip" data-placement="top" title="Segmento de Negocio">Cuenta:</label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlCuenta" DataValueField="CveCuenta" DataTextField="CtaCodigo" CssClass="form-control input-sm select2me" runat="server"></asp:DropDownList>
</div>
<label class="col-md-1 truncate" data-toggle="tooltip" data-placement="top" title="Grupo Plantilla">Grupo Plantilla:</label>
<div class="col-md-2 ">
<asp:DropDownList ID="DdlGrupoPlantilla" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Compras" Value="1"></asp:ListItem>
<asp:ListItem Text="Ventas" Value="2"></asp:ListItem>
<asp:ListItem Text="Pago Compra" Value="3"></asp:ListItem>
<asp:ListItem Text="Pago Venta" Value="4"></asp:ListItem>
</asp:DropDownList>
</div>
<label class="col-md-1 truncate">Tipo Proveedor:</label>
<div class="col-md-3">
<asp:DropDownList ID="DdlTipoProveedor" CssClass="form-control input-sm select2me" Width="260px" runat="server">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
<asp:ListItem Text="Proveedor" Value="1"></asp:ListItem>
<asp:ListItem Text="Acreedor" Value="2"></asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
</div>
</asp:Panel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -1,111 +0,0 @@
Option Explicit On
Option Strict On
Imports System.Data
Imports Extensiones
Imports System.Activities.Statements
Imports Microsoft.Reporting.WebForms
Partial Class Contabilidad2_PolizasImpresion
Inherits ClsPaginas
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.LoadComplete
If Not IsPostBack Then
TxtFechaInicio.Text = Now.AddDays(-1).ToShortDateString
TxtFechaFin.Text = Now.ToShortDateString
DdlUsuarioRegistro.DataSource = GlobalDTUsuarios(CveEmpresa:=UsuarioActual.CveEmpresa)
DdlUsuarioRegistro.DataBind()
cargaddlpolizas()
CargaSubProyectos()
CargaCuentas()
End If
End Sub
Private Sub BtnConsultar_click(sender As Object, args As EventArgs) Handles BtnConsultar.Click
Dim foli As Integer = -1
Dim folf As Integer = -1
If Not FolioInicio.Text = "" Then
foli = FolioInicio.Text.ToEntero()
End If
If Not FolioFin.Text = "" Then
folf = FolioFin.Text.ToEntero()
End If
Dim ArchivoReporte As String = "Empresas/Grales/Formatos/Polizas.rdlc"
If IO.File.Exists(String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)) Then
ArchivoReporte = String.Format("{0}Formatos/Polizas.rdlc", UsuarioActual.Empresa.Ruta)
End If
Dim ObjConta As New ClsContabilidad
If ObjConta.GetPrePolizasImpresion(UsuarioActual.CveEmpresa, TxtFechaInicio.Text.ToDate, TxtFechaFin.Text.ToDate, CveTipoPoliza:=ddlTipoPoliza.SelectedValue.ToEntero, FolioI:=foli,
FolioF:=folf, CveUsuario:=DdlUsuarioRegistro.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero,
CveCuenta:=DdlCuenta.SelectedValue.ToEntero, CvePlantillaPoliza:=DdlGrupoPlantilla.SelectedValue.ToEntero,
CveTipoProveedor:=DdlTipoProveedor.SelectedValue.ToEntero) Then
If ObjConta.DtResultados.Rows.Count < 10000 Then
If ObjConta.DtResultados.Rows.Count > 0 Then
Dim dr As DataRow
dr = ObjConta.DtResultados.Rows(0)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("TipoPoliza", dr("TipoPoliza").ToString))
params.Add(New ReportParameter("Finicio", TxtFechaInicio.Text))
params.Add(New ReportParameter("FFin", TxtFechaFin.Text))
params.Add(New ReportParameter("Fecha", dr("Fecha").ToString.ToDate.ToShortDateString))
'params.Add(New ReportParameter("Nombre", dr("Cuenta").ToString))
'params.Add(New ReportParameter("Cuenta", dr("Codigo").ToString))
params.Add(New ReportParameter("Numero", dr("Folio").ToString))
params.Add(New ReportParameter("Moneda", ""))
params.Add(New ReportParameter("CodigoPostal", ""))
If UsuarioActual.CveEmpresa = 119 Then
params.Add(New ReportParameter("UsuarioRegistro", dr("NombreUsuario").ToString))
End If
ImprimirPDF(ArchivoReporte, ObjConta.DtResultados, params)
Else
Alert("Los Filtros Actuales no contienen datos")
End If
Else
Alert("Los Filtros Actuales contienen muchos datos")
End If
End If
ObjConta.Dispose()
End Sub
Private Sub cargaddlpolizas()
Dim objcont As New ClsContabilidad
If objcont.GetTiposPoliza(-1, "-1", UsuarioActual.CveEmpresa) Then
ddlTipoPoliza.DataSource = objcont.DtResultados
ddlTipoPoliza.DataBind()
ddlTipoPoliza.Items.Insert(0, New ListItem("Todos", "-1"))
End If
objcont.Dispose()
DdlUsuarioRegistro.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub CargaSubProyectos()
DdlSubProyectos.DataSource = GlobalDTSubProyectos(UsuarioActual.CveEmpresa)
DdlSubProyectos.DataBind()
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
DdlSubProyectos.Items.Insert(1, New ListItem("Sin Asignar", "-2"))
End Sub
Private Sub CargaCuentas()
Dim objconta As New ClsContabilidad
If objconta.GetCuentas(-1, "-1", -1, UsuarioActual.CveEmpresa) Then
DdlCuenta.DataSource = objconta.DtResultados
End If
objconta.Dispose()
DdlCuenta.DataBind()
DdlCuenta.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
End Class

View File

@@ -2193,36 +2193,44 @@ Partial Class OC
Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0) Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)
Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0) Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0)
Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100
Dim CantidadVentaMinima As Decimal = DrPS("VentaMinima").ToString.ToDecimal
If CantidadVentaMinima > 0 AndAlso TxtCant.Text.ToDecimal > 0 Then
If TxtCant.Text.ToDecimal Mod CantidadVentaMinima <> 0 Then
Alert(String.Format("El producto se vende solo en cantidades de <b>{0:####.####}</b>", CantidadVentaMinima))
Exit Sub
End If
End If
'Si es Proveedor Extranjero el IVA es 0% 'Si es Proveedor Extranjero el IVA es 0%
If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then
IvaPS = 0 IvaPS = 0
End If End If
AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS, AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS,
CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto, CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto,
DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer,
IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero, IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero,
DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text) DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text)
TxtCant.Text = "" TxtCant.Text = ""
CboUnidadMedida.SelectedIndex = 0 CboUnidadMedida.SelectedIndex = 0
DdlClasificacion.SelectedIndex = 0 DdlClasificacion.SelectedIndex = 0
DdlP2.SelectedValue = "-1" DdlP2.SelectedValue = "-1"
DdlP2.SelectedText = "Seleccione un producto o servicio" DdlP2.SelectedText = "Seleccione un producto o servicio"
txtPrecioUnitario.Text = "" txtPrecioUnitario.Text = ""
TxtObsPS.Text = "" TxtObsPS.Text = ""
HdnCveActivoFijo.Value = "" HdnCveActivoFijo.Value = ""
LblCodigo.Text = "" LblCodigo.Text = ""
LblCvePOA.Text = "" LblCvePOA.Text = ""
TxtCant.Focus() TxtCant.Focus()
Total.Text = "0.00" Total.Text = "0.00"
TxtDescuentoAdd.Text = "0.00" TxtDescuentoAdd.Text = "0.00"
End If End If
CargaSuperior() CargaSuperior()
CargaDatosDetalles() CargaDatosDetalles()
UPPDetalle.Update() UPPDetalle.Update()

View File

@@ -3310,7 +3310,7 @@
return; return;
//MARCA MOTOBATERIAS //MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") { } else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[1X]"); let regex = new RegExp("^[A-L][0-9][0-9A-Z][A-Q][JAVY]$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
//AUTOMOTRIZ-ACUMULADORES //AUTOMOTRIZ-ACUMULADORES

View File

@@ -7593,6 +7593,12 @@ Partial Class Ventas
ObjDescuento.ImporteDescuento = DescuentoManual ObjDescuento.ImporteDescuento = DescuentoManual
End If End If
'VERIFICA SI EL DESCUENTO SUPERA EL SUBTOTAL
If ObjDescuento.ImporteDescuento > (Cantidad * PU) Then
Alert("El descuento no puede ser mayor al subtotal", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal() Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
Dim DatarowPS As DataRow = Nothing Dim DatarowPS As DataRow = Nothing
@@ -9354,10 +9360,15 @@ Partial Class Ventas
If Not MsgCancelacionRefacturacion.HuboError Then If Not MsgCancelacionRefacturacion.HuboError Then
If MsgCancelacionRefacturacion.CveEstatus = 5 Then If MsgCancelacionRefacturacion.CveEstatus = 5 Then
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> fue cancelado. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta))) MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> fue cancelado. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta)))
MensajeAlert.AppendFormat("&nbsp;<a target='_self' class='Texto' href=""javascript:BtnEnviarMailCancelacion({0});"">Enviar Acuse</a>.<br/><br/>", Me.ObjFacturaNC.CveVenta)
ElseIf MsgCancelacionRefacturacion.CveEstatus = 20 Then ElseIf MsgCancelacionRefacturacion.CveEstatus = 20 Then
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> esta en proceso de cancelación. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta))) MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> esta en proceso de cancelación. <b><a target='_blank' class='Texto' href=""/Compras/PopUpVerFactura.aspx?P={1}"">Descargar Acuse</a></b>", Me.ObjFacturaNC.SerieFolio, Encripta(String.Format("OP=CAN&CVEVTA={0}", Me.ObjFacturaNC.CveVenta)))
MensajeAlert.AppendFormat("&nbsp;<a target='_self' class='Texto' href=""javascript:BtnEnviarMailCancelacion({0});"">Enviar Acuse</a>.<br/><br/>", Me.ObjFacturaNC.CveVenta)
Else
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> no fue cancelado. Intente mas tarde cancelar el documento <b><a target='_blank' class='Texto' href=""/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={1}"">Ver en el reporte</a></b>", Me.ObjFacturaNC.SerieFolio, Me.ObjFacturaNC.CveVenta)
End If End If
MensajeAlert.AppendFormat("&nbsp;<a target='_self' class='Texto' href=""javascript:BtnEnviarMailCancelacion({0});"">Enviar Acuse</a>.<br/><br/>", Me.ObjFacturaNC.CveVenta) Else
MensajeAlert.AppendFormat("<br/>El folio <b>{0}</b> no fue cancelado. Intente mas tarde cancelar el documento <b><a target='_blank' class='Texto' href=""/Ventas/RepCancelacionesPorRespuesta.aspx?CveVenta={1}"">Ver en el reporte</a></b>", Me.ObjFacturaNC.SerieFolio, Me.ObjFacturaNC.CveVenta)
End If End If
End If End If
@@ -17336,7 +17347,7 @@ Partial Class Ventas
End If End If
'multiples vendedores visible 'multiples vendedores visible
If UsuarioActual.TienePermisoProceso(153) Then If UsuarioActual.TienePermisoProceso(153) OrElse UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = True DdlVendedor.Enabled = True
End If End If
@@ -21603,6 +21614,13 @@ Partial Class Ventas
LimpiaContado() LimpiaContado()
LimpiaProntoPago() LimpiaProntoPago()
'NO PERMITE EDITAR FECHA DEL PAGO
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
TxtFechaPago.Enabled = False
imgCalendario.Visible = False
End If
UpContado.Update() UpContado.Update()
UPCondicionesPago.Update() UPCondicionesPago.Update()
End Sub End Sub
@@ -29502,6 +29520,8 @@ Partial Class Ventas
BloqueaCondiconesPago() BloqueaCondiconesPago()
CargaVendedores()
UpPS.Update() UpPS.Update()
UPPDescuento.Update() UPPDescuento.Update()
UPObservaciones.Update() UPObservaciones.Update()
@@ -32615,13 +32635,13 @@ Partial Class Ventas
If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508", "510") Then If resp(0)("Codigo").ToString().Contiene("500", "501", "502", "503", "504", "505", "506", "507", "508", "510") Then
Retorno = True Retorno = True
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, True, Now, obj.product_unique_code) Then If ObjAcum.UpdateEnvioPolizaVirtual(CvePolizaVirtual, True, Now, obj.product_unique_code, resp(0)("Descripcion").ToString()) Then
Alert(Msg.ToString(), TipoMensaje.MsgInformacion) Alert(Msg.ToString(), TipoMensaje.MsgInformacion)
End If End If
ObjAcum.Dispose() ObjAcum.Dispose()
Else Else
Dim ObjAcum As New ClsAcumuladores Dim ObjAcum As New ClsAcumuladores
If ObjAcum.UpdateEnvioPolizaVirutal(CvePolizaVirtual, False, Now, obj.product_unique_code) Then If ObjAcum.UpdateEnvioPolizaVirtual(CvePolizaVirtual, False, Now, obj.product_unique_code, resp(0)("Descripcion").ToString()) Then
Alert(Msg.ToString(), TipoMensaje.MsgAdvertencia) Alert(Msg.ToString(), TipoMensaje.MsgAdvertencia)
End If End If
ObjAcum.Dispose() ObjAcum.Dispose()

View File

@@ -442,8 +442,6 @@