This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-04-27 22:09:57 -07:00
46 changed files with 2193 additions and 971 deletions

View File

@@ -1162,6 +1162,8 @@ Public Class ClsContPAQi
StrSQL.AppendLine("")
StrSQL.AppendLine(" BEGIN TRY")
StrSQL.AppendLine("")
StrSQL.AppendLine(" SET ARITHABORT ON; ")
StrSQL.AppendLine("")
StrSQL.AppendLine(" CREATE TABLE #TablaContable (")
StrSQL.AppendLine(" Id INT,")
StrSQL.AppendLine(" IdPoliza INT,")

View File

@@ -1171,13 +1171,14 @@ Public Class ClsContabilidad
End Function
Public Function ContabilizaDesContabilizaPrePoliza(CvePrePoliza As Integer, Contabilizar As Boolean, CveEmpresa As Integer) As Boolean
Public Function ContabilizaDesContabilizaPrePoliza(CvePrePoliza As Integer, Contabilizar As Boolean, CveEmpresa As Integer, Optional Folio As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Conta_PrePolizasContabilizarDescontabilizar")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
.Add("@Contabilizar", SqlDbType.Bit).Value = Contabilizar
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@FolioPoliza", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try

View File

@@ -723,7 +723,8 @@ Public Class ClsMovimientos
Public Function GetCxPPeriodo(CveProveedor As Integer, CveSubProyecto As Integer, CveClasificacion As Integer, CveUsuarioResponsable As Integer,
CveUsuarioRegistro As Integer, CveEstatus As Integer, CveEmpresa As Integer, Gpo As Integer, CveSucursal As Integer,
TipoCambio As Integer, TCEspecifico As Double, FechaCorte As Date, CveUsuarioConsulta As Integer, CveTipoProveedor As Integer) As Boolean
TipoCambio As Integer, TCEspecifico As Double, FechaCorte As Date, CveUsuarioConsulta As Integer, CveTipoProveedor As Integer,
Optional TipoDocto As String = "-1", Optional CveMoneda As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_RepCxPPeriodo")
With SqlAdapter.SelectCommand.Parameters
@@ -740,6 +741,8 @@ Public Class ClsMovimientos
.Add("@FechaCorte", SqlDbType.Date).Value = FechaCorte
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
.Add("@CveTipoProveedor", SqlDbType.Int).Value = CveTipoProveedor
.Add("@TipoDocto", SqlDbType.VarChar).Value = TipoDocto
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -3238,6 +3238,43 @@ Public Class ClsNominas
End Function
#End Region
#End Region
Public Function GetLayoutAltaBanorte(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_LayoutAltaBanorteGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el layout de nominas.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
Public Function GetDispersionNominaBanorte(CvePeriodo As Integer, CveEmpresa As Integer) As Boolean
Dim retorno As Boolean = False
DataAdapter("PA_Nom_DispersionNominaBanorteGet", CommandType.StoredProcedure)
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el layout de nominas Banorte.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return retorno
End Function
#Region "IDisposable Support"
' IDisposable
Protected Overridable Sub Dispose(ByVal disposing As Boolean)

View File

@@ -33,7 +33,7 @@ Public Class ClsOC
Public Property CveIEAnticipo As Integer
Public Property CveProveedorAnticipo As Integer
Public Property FolioIEAnticipo As Integer
Public Property ImporteAnticipo As Double
Public Property ImporteAnticipo As Decimal
Public Property FolioAdicional As String
Public Property EntregaDirecta As Boolean
@@ -79,16 +79,16 @@ Public Class ClsOC
Public Property RFC As String
Public Property LugarEntrega As String
Public Property Cancelacion As String
Public Property PorcentajeIVA As Double
Public Property PorcentajeIVA As Decimal
Public Property CveCliente As Integer
Public Property CveVendedor As Integer
Public Property PrioridadObservacion As String
Public Property SubTotal As Double
Public Property IVA As Double
Public Property RetIVA As Double
Public Property RetISR As Double
Public Property IEPS As Double
Public Property Total As Double
Public Property SubTotal As Decimal
Public Property IVA As Decimal
Public Property RetIVA As Decimal
Public Property RetISR As Decimal
Public Property IEPS As Decimal
Public Property Total As Decimal
Public Property CvePresupuestoEgreso As Integer
Public Property RequiereCotizacion As Boolean
Public Property CveActivoFijo As Integer
@@ -98,8 +98,8 @@ Public Class ClsOC
Public Property SubProyecto As String
Public Property UsuarioSolicito As String
Public Property UsuarioAutorizo As String
Public Property Descuento As Double
Public Property Pendiente As Double
Public Property Descuento As Decimal
Public Property Pendiente As Decimal
Public Property NombreCliente As String
Public Property SucCalle As String
Public Property SucNoExt As String
@@ -274,7 +274,7 @@ Public Class ClsOC
Extension = Data.Rows(0)("Extension").ToString
Usuario = Data.Rows(0)("Usuario").ToString
Me.CveUsuario = Data.Rows(0)("CveUsuario").ToString.ToEntero
Me.Total = Data.Rows(0)("Total").ToString.ToDouble
Me.Total = Data.Rows(0)("Total").ToString.ToDecimal
Me.CveEmpresa = Data.Rows(0)("CveEmpresa").ToString.ToEntero
@@ -416,7 +416,7 @@ Public Class ClsOC
Return Retorno
End Function
Public Function AddCotizacionDetalle(pCveCotizacion As Integer, pCvePS As Integer, pPrecioUnitario As Double, pCantidad As Double, pCveUM As Integer, pCantidadSurtir As Double, pFechaEntrega As String, pObservacion As String, pCveOrdenCompraDetalle As Integer) As Boolean
Public Function AddCotizacionDetalle(pCveCotizacion As Integer, pCvePS As Integer, pPrecioUnitario As Decimal, pCantidad As Decimal, pCveUM As Integer, pCantidadSurtir As Decimal, pFechaEntrega As String, pObservacion As String, pCveOrdenCompraDetalle As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_CotizacionesDetalleAdd")
@@ -425,9 +425,9 @@ Public Class ClsOC
.Add("@CveCotizacion", SqlDbType.Int).Value = pCveCotizacion
.Add("@CvePS", SqlDbType.Int).Value = pCvePS
.Add("@PU", SqlDbType.Money).Value = pPrecioUnitario
.Add("@Cantidad", SqlDbType.Float).Value = pCantidad
.Add("@Cantidad", SqlDbType.Decimal).Value = pCantidad
.Add("@CveUM", SqlDbType.Int).Value = pCveUM
.Add("@CantidadSurtir", SqlDbType.Float).Value = pCantidadSurtir
.Add("@CantidadSurtir", SqlDbType.Decimal).Value = pCantidadSurtir
.Add("@FechaEntrega", SqlDbType.VarChar).Value = pFechaEntrega
.Add("@Observacion", SqlDbType.VarChar).Value = pObservacion
.Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = pCveOrdenCompraDetalle
@@ -452,14 +452,14 @@ Public Class ClsOC
Return Retorno
End Function
Public Function UpdateCotizacionDetalle(pCveCotizacionDetalle As Integer, pPrecioUnitario As Double, pCantidadSurtir As Double, pFechaEntrega As String, pObservacion As String) As Boolean
Public Function UpdateCotizacionDetalle(pCveCotizacionDetalle As Integer, pPrecioUnitario As Decimal, pCantidadSurtir As Decimal, pFechaEntrega As String, pObservacion As String) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_CotizacionesDetalleUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@PU", SqlDbType.Money).Value = pPrecioUnitario
.Add("@CantidadSurtir", SqlDbType.Float).Value = pCantidadSurtir
.Add("@CantidadSurtir", SqlDbType.Decimal).Value = pCantidadSurtir
.Add("@FechaEntrega", SqlDbType.VarChar).Value = pFechaEntrega
.Add("@Observacion", SqlDbType.VarChar).Value = pObservacion
.Add("@CveCotizacionDetalle", SqlDbType.Int).Value = pCveCotizacionDetalle
@@ -546,107 +546,6 @@ Public Class ClsOC
End Function
#End Region
'Public Function GetEstatusCompra(ByVal CveEstatusCompra As Integer, ByVal EstatusCompra As String) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_OC_EstatusOrdenCompraGet")
' Try
' SqlAdapter.Fill(Data)
' If Data.Rows.Count = 1 Then
' _CveEstatusCompra = Data.Rows(0)("CveEstatusCompra").ToString().ToEntero()
' _EstatusCompra = Data.Rows(0)("EstatusCompra").ToString()
' _Estatus = Data.Rows(0)("Estatus").ToString = "True"
' _FechaIng = Data.Rows(0)("FechaIng").ToString().ToDate()
' _CveUsuario = Data.Rows(0)("CveUsuario").ToString().ToEntero()
' _NombreUsuario = Data.Rows(0)("Nombre").ToString()
' End If
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al obtener el Catálogo de Estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
'Public Function AddEstatusCompra(ByVal Descripcion As String, Estatus As Boolean, ByVal CveUsuario As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_OC_EstatusOrdenCompraAdd")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@EstatusOrdenCompra", SqlDbType.VarChar).Value = Descripcion
' .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As SqlException
' If ex.Number = 2627 Then
' Alert("La Clave o Descripción del EstatusCompra ya existe.", TipoMensaje.MsgAdvertencia)
' Else
' OnError("Ocurrió un error al guardar el nuevo estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End If
' Catch ex As Exception
' OnError("Ocurrió un error al guardar el nuevo estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
'Public Function UpdateEstatusCompra(ByVal Descripcion As String, Estatus As Boolean, ByVal CveEstatusCompra As Integer, ByVal CveUsuario As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_OC_EstatusOrdenCompraUpdate")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@EstatusOrdenCompra", SqlDbType.VarChar).Value = Descripcion
' '.Add("@pCveUsuario", SqlDbType.Int).Value = CveUsuario
' .Add("@Estatus", SqlDbType.Bit).Value = Estatus
' .Add("@CveEstatusOrdenCompra", SqlDbType.Int).Value = CveEstatusCompra
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As SqlException
' If ex.Number = 2627 Then
' Alert("La Clave o Descripción del Estatus de Compra ya existe.", TipoMensaje.MsgAdvertencia)
' Else
' OnError("Ocurrió un error al guardar los cambios en el estatus de compra", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End If
' Catch ex As Exception
' OnError("Ocurrió un error al guardar los cambios en el estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
'Public Function RemoveEstatusCompra(ByVal CveEstatusCompra As Integer) As Boolean
' Dim Retorno As Boolean = False
' DataAdapter("PA_OC_EstatusOrdenCompraRemove")
' With SqlAdapter.SelectCommand.Parameters
' .Add("@CveEstatusOrdenCompra", SqlDbType.Int).Value = CveEstatusCompra
' End With
' Try
' SqlAdapter.Fill(Data)
' Retorno = True
' Catch ex As Exception
' OnError("Ocurrió un error al eliminar el estatus de compra.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
' End Try
' Return Retorno
'End Function
#Region "O R D E N E S - D E - C O M P R A S"
Public Function GetOC(ObjOrdenCompra As Modelos.OrdenCompra) As Boolean
@@ -707,7 +606,7 @@ Public Class ClsOC
_Folio = dr("Folio").ToString.ToEntero
_CveIEAnticipo = dr("CveIEAnticipo").ToString.ToEntero
_FolioIEAnticipo = dr("FolioIEAnticipo").ToString.ToEntero
_ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDouble
_ImporteAnticipo = dr("ImporteAnticipo").ToString.ToDecimal
_CveProveedorAnticipo = dr("CveProveedorAnticipo").ToString.ToEntero
_CveEmpresa = dr("CveEmpresa").ToString.ToEntero
_CveProyecto = dr("CveProyecto").ToString.ToEntero
@@ -752,32 +651,15 @@ Public Class ClsOC
Me.SucursalTelefono = If(Not IsDBNull(dr("TelefonoSucursal")), dr("TelefonoSucursal").ToString, "")
ProveedorContacto = dr("ContactoNombre").ToString
PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDouble
SubTotal = dr("SubTotal").ToString.ToDouble
Descuento = dr("Descuento").ToString.ToDouble
IVA = dr("IVA").ToString.ToDouble
RetIVA = dr("RetIVA").ToString.ToDouble
RetISR = dr("RetISR").ToString.ToDouble
IEPS = dr("IEPS").ToString.ToDouble
Total = dr("Total").ToString.ToDouble
Pendiente = dr("Pendiente").ToString.ToDouble
'If Not IsDBNull(dr("SubTotal")) Then
' SubTotal = dr("SubTotal").ToString.ToDouble
' If IVA <= 0 Then
' _IVA = _SubTotal * dr("PorcentajeIVA").ToString.ToDouble
' End If
' _Total = _SubTotal + _IVA - _Descuento - _RetIVA - _RetISR
'End If
'_CveSupervisara = dr("CveSupervisara").ToString.ToEntero
'_CveAutoriza = dr("CveAutoriza").ToString.ToEntero
'_CveAutorizara = dr("CveAutorizara").ToString.ToEntero
'_NombreSupervisa = dr("NombreSupervisa").ToString
'_NombreAutoriza = dr("NombreAutoriza").ToString
'_FechaSupervisa = dr("FechaSupervisa").ToString.ToDate
'_FechaAutoriza = dr("FechaAutoriza").ToString.ToDate
PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
SubTotal = dr("SubTotal").ToString.ToDecimal
Descuento = dr("Descuento").ToString.ToDecimal
IVA = dr("IVA").ToString.ToDecimal
RetIVA = dr("RetIVA").ToString.ToDecimal
RetISR = dr("RetISR").ToString.ToDecimal
IEPS = dr("IEPS").ToString.ToDecimal
Total = dr("Total").ToString.ToDecimal
Pendiente = dr("Pendiente").ToString.ToDecimal
'RequiereCotizacion = CType(dr("RequiereCotizacion"), Boolean)
SubProyecto = dr("SubProyecto").ToString
@@ -820,9 +702,9 @@ Public Class ClsOC
pFechaEstimadaEntrega As String, pLugarEntrega As String, pCveUsuario As Integer, pCveEmpresa As Integer, pCvePresupuestoEgreso As Integer,
Optional pCveProveedor As Integer = -1, Optional pCveProveedorSucursal As Integer = -1, Optional IDPoliza As Integer = -1, Optional RequiereCotizacion As Boolean = False, Optional CveUsuarioAsignado As Integer = -1,
Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "",
Optional PorcentajeIVA As Double = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional PorcentajeIVA As Decimal = 0.16, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional FechaExpiracion As Date = Nothing, Optional CveCotizacion As Integer = -1,
Optional FolioAdicional As String = "", Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1,
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Double = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1) As Boolean
Optional CveIEAnticipo As Integer = -1, Optional ImporteAnticipo As Decimal = 0, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1", Optional CveProveedorContacto As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraAdd")
@@ -971,7 +853,7 @@ Public Class ClsOC
Return Retorno
End Function
Public Function UpdateOrdenCompraDetalleAjuste(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Diferencia As Double, CveUsuarioModifico As Integer) As Boolean
Public Function UpdateOrdenCompraDetalleAjuste(CveOrdenCompra As Integer, CveOrdenCompraDetalle As Integer, Diferencia As Decimal, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraDetalleAjusteUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -1028,7 +910,7 @@ Public Class ClsOC
pCveProveedor As Integer, pCveOrdenCompra As Integer, pCveUsuarioModifico As Integer, Optional CveCliente As Integer = -1, Optional CveVendedor As Integer = -1, Optional PrioridadObservacion As String = "",
Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional IDPoliza As Integer = -1, Optional FechaExpiracion As Date = Nothing, Optional FolioAdicional As String = "",
Optional EntregaDirecta As Integer = -1, Optional CveDireccionEnvio As Integer = -1, Optional Guia As String = "-1", Optional IEPS As Decimal = -1, Optional UsoCFDI As Integer = -1, Optional Promocion As String = "-1",
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Double = 0.16) As Boolean
Optional pCveProveedorSucursal As Integer = -1, Optional CveProveedorContacto As Integer = -1, Optional PorcentajeIVA As Decimal = 0.16) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraUpdate")
@@ -1266,18 +1148,18 @@ Public Class ClsOC
Return Retorno
End Function
Public Function AddOrdenCompraDetalle(pCveOrdenCompra As Integer, pCantidad As Double, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Double, pCveSubProyecto As Integer, pCveActivoFijo As Integer,
pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0,
Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0,
Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
Public Function AddOrdenCompraDetalle(pCveOrdenCompra As Integer, pCantidad As Decimal, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Decimal, pCveSubProyecto As Integer, pCveActivoFijo As Integer,
pObservacion As String, pCveUsuario As Integer, Optional pCveOrdenCompraPadre As Integer = -1, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0,
Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Decimal = 0, Optional RetIVAPorcentaje As Decimal = 0, Optional RetISRPorcentaje As Decimal = 0, Optional IEPSPSPorcentaje As Decimal = 0,
Optional IEPSPSIVAPorcentaje As Decimal = 0, Optional CveVentaDetalleCotizacion As Integer = -1, Optional CveTipoGastoObra As Integer = -1, Optional CveCultivoCuadroDetalle As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_OrdenesCompraDetalleAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOrdenCompra", SqlDbType.Int).Value = pCveOrdenCompra
.Add("@Cantidad", SqlDbType.Float).Value = pCantidad
.Add("@Descuento", SqlDbType.Float).Value = Descuento
.Add("@Cantidad", SqlDbType.Decimal).Value = pCantidad
.Add("@Descuento", SqlDbType.Decimal).Value = Descuento
.Add("@Importe", SqlDbType.Float).Value = pImporte
.Add("@CveUnidadMedida", SqlDbType.Int).Value = pCveUnidadMedida
.Add("@CvePS", SqlDbType.Int).Value = pCvePS
@@ -1290,16 +1172,16 @@ Public Class ClsOC
.Add("@vCveOrdenCompraDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
.Add("@IEPSPS", SqlDbType.Money).Value = IEPSPS
.Add("@IEPSPSIVA", SqlDbType.Money).Value = IEPSPSIVA
.Add("@IVA", SqlDbType.Float).Value = IVA
.Add("@RetIVA", SqlDbType.Float).Value = RetIVA
.Add("@RetISR", SqlDbType.Float).Value = RetISR
.Add("@Total", SqlDbType.Float).Value = Total
.Add("@IVA", SqlDbType.Decimal).Value = IVA
.Add("@RetIVA", SqlDbType.Decimal).Value = RetIVA
.Add("@RetISR", SqlDbType.Decimal).Value = RetISR
.Add("@Total", SqlDbType.Decimal).Value = Total
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@IVAPorcentaje", SqlDbType.Float).Value = IVAPorcentaje
.Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje
.Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje
.Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje
.Add("@IVAPorcentaje", SqlDbType.Decimal).Value = IVAPorcentaje
.Add("@RetIVAPorcentaje", SqlDbType.Decimal).Value = RetIVAPorcentaje
.Add("@RetISRPorcentaje", SqlDbType.Decimal).Value = RetISRPorcentaje
.Add("@IEPSPSPorcentaje", SqlDbType.Decimal).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Decimal).Value = IEPSPSIVAPorcentaje
.Add("@CveVentaDetalleCotizacion", SqlDbType.Int).Value = CveVentaDetalleCotizacion
.Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra
.Add("@CveCultivoCuadroDetalle", SqlDbType.Int).Value = CveCultivoCuadroDetalle
@@ -1322,11 +1204,11 @@ Public Class ClsOC
Return Retorno
End Function
Public Function UpdateOrdenCompraDetalle(pCantidad As Double, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Double, pCveSubProyecto As Integer, pCveActivoFijo As Integer,
pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Double = 0,
Optional IEPSPS As Double = 0, Optional IEPSPSIVA As Double = 0, Optional IVA As Double = 0, Optional RetIVA As Double = 0, Optional RetISR As Double = 0, Optional Total As Double = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Double = 0, Optional RetIVAPorcentaje As Double = 0, Optional RetISRPorcentaje As Double = 0, Optional IEPSPSPorcentaje As Double = 0,
Optional IEPSPSIVAPorcentaje As Double = 0, Optional CveTipoGastoObra As Integer = -1) As Integer
Public Function UpdateOrdenCompraDetalle(pCantidad As Decimal, pCveUnidadMedida As Integer, pCvePS As Integer, pImporte As Decimal, pCveSubProyecto As Integer, pCveActivoFijo As Integer,
pObservacion As String, pCveUsuario As Integer, pCveOrdenCompraDetalle As Integer, Optional CvePresupuestoEgreso As Integer = -1, Optional Descuento As Decimal = 0,
Optional IEPSPS As Decimal = 0, Optional IEPSPSIVA As Decimal = 0, Optional IVA As Decimal = 0, Optional RetIVA As Decimal = 0, Optional RetISR As Decimal = 0, Optional Total As Decimal = 0,
Optional CveContratoDetalle As Integer = -1, Optional IVAPorcentaje As Decimal = 0, Optional RetIVAPorcentaje As Decimal = 0, Optional RetISRPorcentaje As Decimal = 0, Optional IEPSPSPorcentaje As Decimal = 0,
Optional IEPSPSIVAPorcentaje As Decimal = 0, Optional CveTipoGastoObra As Integer = -1) As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_OC_OrdenesCompraDetalleUpdate")
@@ -1336,8 +1218,8 @@ Public Class ClsOC
.Add("@Cantidad", SqlDbType.Float).Value = pCantidad
.Add("@CveUnidadMedida", SqlDbType.Int).Value = pCveUnidadMedida
.Add("@CvePS", SqlDbType.Int).Value = pCvePS
.Add("@Descuento", SqlDbType.Float).Value = Descuento
.Add("@Importe", SqlDbType.Float).Value = pImporte
.Add("@Descuento", SqlDbType.Decimal).Value = Descuento
.Add("@Importe", SqlDbType.Decimal).Value = pImporte
.Add("@CveSubProyecto", SqlDbType.Int).Value = pCveSubProyecto
.Add("@CveOrdenCompraDetalle", SqlDbType.Int).Value = pCveOrdenCompraDetalle
.Add("@CveActivoFijo", SqlDbType.Int).Value = pCveActivoFijo
@@ -1346,16 +1228,16 @@ Public Class ClsOC
.Add("@CveUsuario", SqlDbType.Int).Value = pCveUsuario
.Add("@IEPSPS", SqlDbType.Money).Value = IEPSPS
.Add("@IEPSPSIVA", SqlDbType.Money).Value = IEPSPSIVA
.Add("@IVA", SqlDbType.Float).Value = IVA
.Add("@RetIVA", SqlDbType.Float).Value = RetIVA
.Add("@RetISR", SqlDbType.Float).Value = RetISR
.Add("@Total", SqlDbType.Float).Value = Total
.Add("@IVA", SqlDbType.Decimal).Value = IVA
.Add("@RetIVA", SqlDbType.Decimal).Value = RetIVA
.Add("@RetISR", SqlDbType.Decimal).Value = RetISR
.Add("@Total", SqlDbType.Decimal).Value = Total
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@IVAPorcentaje", SqlDbType.Float).Value = IVAPorcentaje
.Add("@RetIVAPorcentaje", SqlDbType.Float).Value = RetIVAPorcentaje
.Add("@RetISRPorcentaje", SqlDbType.Float).Value = RetISRPorcentaje
.Add("@IEPSPSPorcentaje", SqlDbType.Float).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Float).Value = IEPSPSIVAPorcentaje
.Add("@IVAPorcentaje", SqlDbType.Decimal).Value = IVAPorcentaje
.Add("@RetIVAPorcentaje", SqlDbType.Decimal).Value = RetIVAPorcentaje
.Add("@RetISRPorcentaje", SqlDbType.Decimal).Value = RetISRPorcentaje
.Add("@IEPSPSPorcentaje", SqlDbType.Decimal).Value = IEPSPSPorcentaje
.Add("@IEPSPSIVAPorcentaje", SqlDbType.Decimal).Value = IEPSPSIVAPorcentaje
.Add("@CveTipoGastoObra", SqlDbType.Int).Value = CveTipoGastoObra
End With
@@ -2412,7 +2294,7 @@ Public Class ClsOC
Return Retorno
End Function
Public Function AddSolicitudAnticipo(CveOrdenCompra As Integer, Importe As Double, CveEmpresa As Integer) As Boolean
Public Function AddSolicitudAnticipo(CveOrdenCompra As Integer, Importe As Decimal, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_OC_SolicitudAnticipoAdd")
@@ -2496,16 +2378,16 @@ Public Class ClsOC
End Function
#Region " OC DETALLE - SALDOS [ SURTIDO INV | VINCULADO COMP ]"
Public Function OrdenesCompraDetalleSaldosInvCompraAdd(CveOCDetalle As Integer, CveInvDetalle As Integer, CantidadSurtida As Double, CveCompraDetalle As Integer, CantidadVinculada As Double) As Boolean
Public Function OrdenesCompraDetalleSaldosInvCompraAdd(CveOCDetalle As Integer, CveInvDetalle As Integer, CantidadSurtida As Decimal, CveCompraDetalle As Integer, CantidadVinculada As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("OC_OrdenesCompraDetalleSaldosInvCompraAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveOCDetalle", SqlDbType.Int).Value = CveOCDetalle
.Add("@CveInvDetalle", SqlDbType.Int).Value = CveInvDetalle
.Add("@CantidadSurtida", SqlDbType.Float).Value = CantidadSurtida
.Add("@CantidadSurtida", SqlDbType.Decimal).Value = CantidadSurtida
.Add("@CveCompraDetalle", SqlDbType.Int).Value = CveCompraDetalle
.Add("@CantidadVinculada", SqlDbType.Float).Value = CantidadVinculada
.Add("@CantidadVinculada", SqlDbType.Decimal).Value = CantidadVinculada
End With
Try

View File

@@ -7171,8 +7171,11 @@ Public Class ClsPaginas
'DATOS GENERALES
If UsuarioActual.CveEmpresa.Contiene(15) Then
params.Add(New ReportParameter("CP", UsuarioActual.Empresa.CP.ToString))
End If
'params.Add(New ReportParameter("CP", UsuarioActual.Empresa.CP.ToString))
params.Add(New ReportParameter("Observaciones", Vta.Observaciones))
params.Add(New ReportParameter("CveVendedor", Vta.CveVendedor.ToString))
params.Add(New ReportParameter("Status", Vta.EstatusFactura))

View File

@@ -838,7 +838,7 @@ Public Class ClsVentas
Return Retorno
End Function
Public Function UpdateEstatusVenta(CveVenta As Integer, CveEstatusFactura As Integer, CveEmpresa As Integer, Optional Num2 As Integer = -1) As Boolean
Public Function UpdateEstatusVenta(CveVenta As Integer, CveEstatusFactura As Integer, CveEmpresa As Integer, Optional Num2 As Integer = -1, Optional CveEstatusRefacturacion As Integer = -1, Optional CveMotivoCancelacion As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasEstatusUpdate")
@@ -848,6 +848,8 @@ Public Class ClsVentas
.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Num2", SqlDbType.Float).Value = Num2
.Add("@CveEstatusRefacturacion", SqlDbType.Int).Value = CveEstatusRefacturacion
.Add("@CveMotivoCancelacion", SqlDbType.Int).Value = CveMotivoCancelacion
End With
Try

View File

@@ -4845,7 +4845,8 @@ Namespace Modelos
End If
'SI YA ESTA TIMBRADA, NUEVO PROCESO REFACTURACION, ASIGNA LA CANCELACION PENDIENTE
If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 Then
'EL ESTATUS REFACTURACION 4 ES PARA LAS QUE NO SE PUDIERON CANCELAR, DEBE OBLIGAR A CANCELAR ANTE EL SAT
If EsRefacturacion AndAlso Me.CveEstatusFactura = 3 AndAlso CveMotivoCancelacion > 0 AndAlso CveEstatusRefacturacion <> 4 Then
CveEstatusFacturaAsignado = 23
End If

View File

@@ -761,6 +761,8 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
Dim EsDistribuidor As Integer = IfNull(context.Request("esdistribuidor"), "-1").ToString.ToEntero
Dim cveclienteclasificacion = IfNull(context.Request("cveclienteclasificacion"), "-1").ToString.ToEntero
Dim usuario As Usuario = UsuarioActual(context)
Dim CveEmpresa As String
If IsNothing(usuario) Then
@@ -772,7 +774,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
'sino existe, recarga los datos
If context.Application(AppNombre) Is Nothing Then
Dim ObjClientes As New ClsClientes
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1) Then
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", "-1", "-1", "-1", -1, CveEmpresa, Estatus:=-1, CveClienteClasificacion:=cveclienteclasificacion) Then
context.Application(AppNombre) = ObjClientes.DtResultados
End If
ObjClientes.Dispose()

View File

@@ -105,6 +105,7 @@
<asp:ListItem Value="3" Text="Cheque"></asp:ListItem>
<asp:ListItem Value="11" Text="Tarjeta de Debito"></asp:ListItem>
<asp:ListItem Value="12" Text="Tarjeta de Crédito"></asp:ListItem>
<asp:ListItem Value="-2" Text="Tarjetas"></asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="DDlMesesSinIntereses" runat="server" Visible="false" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="40px">
@@ -281,9 +282,10 @@
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" class="form-check-input" id="ChkSelector" onclick="SelectorNotas(this)">
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkFactura" runat="server"/>
<asp:CheckBox ID="ChkFactura" CssClass="CssSelector" runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Factura">
@@ -560,8 +562,8 @@
function txtSumaTntermediario(txt) {
var comision2 = ToDouble($('#C_TxtComisionIntermediario').val());
if (comision2 > ValorTotalSeleccionado) {
$('#C_TxtComisionIntermediario').val(ComisionIntermediario);
alert("No es posible poner un importe superior a lo seleccionado");
//$('#C_TxtComisionIntermediario').val(ComisionIntermediario);
//alert("No es posible poner un importe superior a lo seleccionado");
} else {
saldo = ValorTotalSeleccionado - descuento + comision - comision2 - IVA;
$('#C_lblValorTotal').text(FormatoNumero(saldo, 2));
@@ -653,6 +655,32 @@
ComisionIntermediario = 0;
}
function SelectorNotas(Chk) {
$(`.CssSelector input[type=checkbox]`).each(function () {
if (Chk.checked) {
if (! $(this).prop('checked')) {
$(this).click();
}
} else {
if ($(this).prop('checked')) {
$(this).click();
}
}
});
}
</script>

View File

@@ -215,6 +215,19 @@
<asp:TextBox ID="TxtFolio" runat="server" MaxLength="14" class="form-control input-sm"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="El campo <b>''Folio''</b> es requerido por la aplicación, por favor ingrese una fecha." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RequiredFieldValidator1" Width="350px"></ajax:ValidatorCalloutExtender>
<div runat="server" id="DvFolioACCondiciones" visible="false">
<ajax:FilteredTextBoxExtender runat="server" ID="FTEFolio" TargetControlID="TxtFolio" FilterType="Custom" ValidChars="0123456789" />
<asp:RangeValidator ID="RvTxtFolio" runat="server" ControlToValidate="TxtFolio" Display="None" ErrorMessage="El Folio debe de tener un valor de entre 1 y 2147483647" Type="Integer" MinimumValue="1" MaximumValue="2147483647" ValidationGroup="GrpGuardar"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender8" runat="server" HighlightCssClass="vco" TargetControlID="RvTxtFolio" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-4"></div>
<label class="col-md-1 control-label text-right">Importe:</label>

View File

@@ -843,6 +843,9 @@ Partial Class Bancos_IE
DdlMotivoCancelacion.DataBind()
DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
If UsuarioActual.Empresa.UsaAC Then
DvFolioACCondiciones.Visible = True
End If
End If
End Sub
@@ -861,6 +864,8 @@ Partial Class Bancos_IE
End Try
CveIEDeposito = ObjIE.DtResultados(0)("CveIEDepositoPadre").ToString.ToEntero
CuentaDepositoPadre = ObjIE.DtResultados(0)("CuentaDepositoPadre").ToString
Cuenta = ObjIE.DtResultados(0)("NumCuenta").ToString
@@ -4554,15 +4559,24 @@ Partial Class Bancos_IE
Dim TipoMovimiento As Integer = 1
Dim CveTipoTransaccionCancelacion As Integer = DdlTipoTransaccionCancelacion.SelectedValue.ToEntero
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
GeneraCancelacionEnCero = False
TipoMovimiento = 2
If DdlTipoTransaccionCancelacion.SelectedValue.ToEntero = -1 Then
CveTipoTransaccionCancelacion = 16 'Validacion manual para solo enviar el correcto
End If
End If
Dim CvePrePolizaCancelacion As Integer = 0
If Not GeneraCancelacionEnCero Then
'CANCELA IE MES ANTERIOR
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento,
CveTipoTransaccionCancelacion:=CveTipoTransaccionCancelacion)
If CvePrePolizaCancelacion <= 0 Then
ErrorCancelar = True
MensajeError = "Error al cancelar IE MES ANTERIOR"
@@ -4577,7 +4591,8 @@ Partial Class Bancos_IE
MensajeError = "Error al desbloquear prepoliza."
Else
'CANCELA IE MES ACTUAL
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate,
CveTipoTransaccionCancelacion:=CveTipoTransaccionCancelacion)
If CvePrePolizaCancelacion <= 0 Then
ErrorCancelar = True
MensajeError = "Error al cancelar IE MES ACTUAL"
@@ -4792,7 +4807,7 @@ Partial Class Bancos_IE
Else
'siempre se hace una cancelación
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2) <= 0 Then
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaDevuelto.Text.ToDate, 2, 16) <= 0 Then
ErrorCancelar = True
End If

View File

@@ -32,9 +32,10 @@
<div class="titlefiltros caption ">
<ul class="list-inline text-size-12">
<li>Cliente:
<asp:DropDownList ID="DdlClientes" onclick="CargaClientes();" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="form-control input-sm" Style="width: 240px !important; display: inline-block;">
<%-- <asp:DropDownList ID="DdlClientes" onclick="CargaClientes();" runat="server" AppendDataBoundItems="true" DataTextField="NombreComercial" DataValueField="CveCliente" CssClass="form-control input-sm" Style="width: 240px !important; display: inline-block;">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</asp:DropDownList>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClientes" Width="100%" data-metodo="getcliente" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 240px;"></ADS:Dropdownlost>
<asp:Button ID="BtnCargarClientes" runat="server" ClientIDMode="Static" Text="CargaClientes" Style="display: none;" />
</li>
<li>&nbsp;F.I.:

View File

@@ -27,8 +27,17 @@ Partial Class Bancos_RepIngresosPorComprobar
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
'DdlProveedores.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
'DdlProveedores.DataBind()
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientes.setEsWebService(True)
Else
DdlClientes.setEsWebService(False)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
If UsuarioActual.TienePermisoProceso(91) Then
@@ -58,15 +67,16 @@ Partial Class Bancos_RepIngresosPorComprobar
If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1"
If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1"
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
If Mov.GetIngresosPorComprobar(FechaI, FechaF, DdlClientes.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
If Mov.GetIngresosPorComprobar(FechaI, FechaF, CveCliente, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
DtDatos = Mov.DtResultados
CargaGrid("")
UPDatos.Update()
End If
If Mov.GetIngresosAnticiposPorComprobar(FechaI, FechaF, DdlClientes.SelectedValue.ToEntero, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
If Mov.GetIngresosAnticiposPorComprobar(FechaI, FechaF, CveCliente, DdlUsuarioRegistro.SelectedValue.ToEntero, DdlMoneda.SelectedValue.ToEntero, If(ChkSaldo.Checked, 1, 0), UsuarioActual.CveEmpresa) Then
DtAnticipos = Mov.DtResultados
CargaGrid("")
UpAnt.Update()
@@ -77,13 +87,26 @@ Partial Class Bancos_RepIngresosPorComprobar
End Sub
Protected Sub BtnCargarProveedores_Click(sender As Object, e As System.EventArgs) Handles BtnCargarClientes.Click
DdlClientes.CssClass += " select2me"
DdlClientes.Items.Clear()
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
DdlClientes.DataBind()
DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
DdlClientes.Attributes.Remove("onclick")
Dim EsWS = If(UsuarioActual.Empresa.Funcionalidad(105) = "1" Or UsuarioActual.Empresa.Funcionalidad(141) = "1", True, False)
If EsWS Then
DdlClientes.setEsWebService(True)
Else
DdlClientes.setEsWebService(False)
DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientes.DataBind()
DdlClientes.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
'DdlClientes.CssClass += " select2me"
'DdlClientes.Items.Clear()
'DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
'DdlClientes.DataBind()
'DdlClientes.Items.Insert(0, New ListItem("Todos", "-1"))
'DdlClientes.Attributes.Remove("onclick")
End Sub

View File

@@ -2149,18 +2149,8 @@ Partial Class Compras_Compras
Private Sub CargaRetIVAConcepto(Optional Cambio As Boolean = False)
If TrRetIVA.Visible Then
TdRetIVAConcepto.Visible = True
End If
If Cambio Then
@@ -2174,15 +2164,12 @@ Partial Class Compras_Compras
End If
DdlRetIVAConcepto.Items.Add(New ListItem("Arrendamiento", "4"))
'If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
'End If
''If UsuarioActual.Empresa.Funcionalidad(577).ToEntero = 1 Then
'DdlRetIVAConcepto.Items.Add(New ListItem("Ret IVA Servicios", "5"))
''End If
End If
UpPS.Update()
End Sub
@@ -3380,6 +3367,47 @@ Partial Class Compras_Compras
DdlRetIVAConcepto.SelectedValueExist("2") ' flete pf
DdlRetIVAConcepto.SelectedValueExist("3") ' fletes pm
DdlRetISRConcepto.SelectedValueExist("1") ' honorarios
ElseIf ObjProveedor.DIOTCveTipoOperacion = 0 Then
If CveFactura > 0 Then
If RetIVAOriginal > 0 Then
Dim CalRetIVAPor As Decimal = (RetIVAOriginal * 1 / SubTotal2Original).RoundAD(6).ToDecimal
If (CalRetIVAPor).RoundAD(6) = 0.106667 Then
DdlRetIVAConcepto.SelectedValueExist("1") '10.66 servicios profecionales
End If
If (CalRetIVAPor).RoundAD(2) = 0.04 Then '4 Fletes
If RFCProv.Length = 13 Then
DdlRetIVAConcepto.SelectedValueExist("2")
Else
DdlRetIVAConcepto.SelectedValueExist("3")
End If
End If
End If
If RetISROriginal > 0 Then
Dim CalRetISRPor As Decimal = (RetISROriginal * 1 / SubTotal2Original).RoundAD(5).ToDecimal
If (CalRetISRPor).RoundAD(1) = 0.1 Then '10 Sercviios profecionales
DdlRetISRConcepto.SelectedValueExist("1")
End If
If (CalRetISRPor).RoundAD(4) = 0.0125 Then '1.25 Recico regimen simplificado confianza
DdlRetISRConcepto.SelectedValueExist("3")
End If
End If
End If
End If
LbAgregar.Enabled = True
@@ -4013,9 +4041,7 @@ Partial Class Compras_Compras
Protected Sub BtnGuardar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnGuardar.Click
'If Not AjustaCombustibles() Then
' Exit Sub
'End If
'------------------ INICIA VALIDACIONES ------------------
@@ -4437,6 +4463,10 @@ Partial Class Compras_Compras
'------------------TERMINA VALIDACIONES------------------
'si hay necesidad de actualizar el globaldtps
If RegeneraPS Then
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
@@ -5219,7 +5249,7 @@ Partial Class Compras_Compras
'QUEMA SALDOS DE INV-COMPRA | MERCANCIA RECIBIDA POR ADELANTADO (OC) | PP 176
If OCVinculada And Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") And Not UsuarioActual.Empresa.Funcionalidad(126) = "1" Then
For Each Row As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows
If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Row("CveOrdenCompraDetalle").ToString.ToEntero, -1, -1, Row("CveCompraDetalle").ToString.ToEntero, Row("Cantidad").ToString.ToDouble) Then
If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Row("CveOrdenCompraDetalle").ToString.ToEntero, -1, -1, Row("CveCompraDetalle").ToString.ToEntero, Row("Cantidad").ToString.ToDecimal) Then
ErrorSaldosInvComp = True
Exit For
End If
@@ -5894,7 +5924,10 @@ Partial Class Compras_Compras
Dim IdCtaContable As Integer = 0
Dim Concepto As String = ObjConta.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, NombreProveedor, $"{TxtSerie.Text}-{TxtFolio.Text}", If(TxtDocumentoFolio.Visible, TxtDocumentoFolio.Text, If(TxtDocumentoFolioCaja.Visible, TxtDocumentoFolioCaja.Text, ConceptoPersonal)))
Dim importeMN As Decimal = 0
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1)
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1)
Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation
Dim PorcentajeImpuesto As Decimal = 0
CveConceptoOriginal = ConceptoContable
@@ -8939,7 +8972,7 @@ Partial Class Compras_Compras
IdCtaContable = 0
Dim Concepto As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text)
Dim importeMN As Decimal = 0
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1)
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1)
Dim PorcentajeImpuesto As Decimal = 0
Dim ConceptoPartida As String = String.Format("{0}-{1}", TxtSerie.Text, TxtFolio.Text)
@@ -10558,7 +10591,7 @@ Partial Class Compras_Compras
Dim importeMovimiento As Decimal = 0
Dim IdCtaContable As Integer = 0
Dim importeMN As Decimal = 0
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1)
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, -1, 1)
Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation
Select Case ConceptoContable
@@ -10775,7 +10808,7 @@ Partial Class Compras_Compras
'End If
'AGREGA MOVIMIENTO
If importeMovimiento <> 0 Then
If importeMovimiento <> 0 AndAlso Not DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV", "Ant") Then
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, 6, Concepto, FechaMovimiento, IdCtaContable, IdSegmentoNegocio, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, CveIE:=CveIE, CveCreditoDetalle:=CveCreditoDetalle, CveClasificacion:=Row2("CveClasificacion").ToString.ToEntero, CveSubProyecto:=Row2("CveSubProyecto").ToString.ToEntero, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveTipoGasto:=Row2("CveTipoGasto").ToString.ToEntero) Then
ErrorPrepoliza = True

View File

@@ -1198,14 +1198,17 @@ Partial Class PopUpVerFactura
Dim Usuario As String = $"&emsp;<b>Usuario:</b> {Nombre}"
If DtCortesVentas.Rows.Count > 0 Or DtCortesVentasResumen.Rows.Count > 0 Then
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), "")))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
params.Add(New ReportParameter("AgrupoPor", $"{FechaCorte}{Usuario}"))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
@@ -1311,7 +1314,7 @@ Partial Class PopUpVerFactura
Private Sub ImprimeGastoContrato(CveContrato As Integer, CveContratoGasto As Integer)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim Dr As DataRow = Nothing
Dim ObjContratos As New ClsContratos
@@ -1345,7 +1348,9 @@ Partial Class PopUpVerFactura
End If
params.Add(New ReportParameter("Utilidad", $"$ {(SumaUtilidad - SumaGasto).ToString.FormatoNumero()}"))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
@@ -1493,14 +1498,9 @@ Partial Class PopUpVerFactura
If Dt.Rows.Count > 0 Then
Dim params As New List(Of ReportParameter)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'params.Add(New ReportParameter("LogoPath", If(Imagen.Exists, ImageToBase64(Drawing.Image.FromFile(Imagen.FullName), Drawing.Imaging.ImageFormat.Png), "")))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
@@ -1920,7 +1920,7 @@ Partial Class PopUpVerFactura
If DtConceptos.Rows.Count > 0 Then
Dim params As New List(Of ReportParameter)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Imagen.Exists Then
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
@@ -3437,8 +3437,15 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreEntrego", Personal))
params.Add(New ReportParameter("Responsable", Personal))
params.Add(New ReportParameter("NombreRecibio", Capturo.ToUpper))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
params.Add(New ReportParameter("LogoPath", logouri))
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
If Imagen.Exists Then
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
If DtMovimientos.COUNT("Serie") > 0 Then
params.Add(New ReportParameter("MostrarSerieLote", "1"))
Else
@@ -3523,8 +3530,14 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("NombreEntrego", Capturo.ToUpper))
params.Add(New ReportParameter("Responsable", Personal))
params.Add(New ReportParameter("NombreRecibio", Personal))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
params.Add(New ReportParameter("LogoPath", logouri))
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
If Imagen.Exists Then
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
If DtMovimientos.COUNT("Serie") > 0 Then
params.Add(New ReportParameter("MostrarSerieLote", "1"))
Else
@@ -4962,7 +4975,8 @@ Partial Class PopUpVerFactura
End If
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Not ReporteEmpresa.Exists Then
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
@@ -4970,7 +4984,8 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
@@ -5166,10 +5181,9 @@ Partial Class PopUpVerFactura
ObjAF.Dispose()
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
@@ -6257,7 +6271,9 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("CodigoTD", CodigoTD))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
@@ -6315,7 +6331,7 @@ Partial Class PopUpVerFactura
ObjPS.Dispose()
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim DtDatos As New DataTable
Dim params As New List(Of ReportParameter)
@@ -6394,7 +6410,9 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("CodigoTD", CodigoTD))
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Dim LogoRuta As String = String.Format("file://{0}", Imagen.FullName)
params.Add(New ReportParameter("LogoPath", LogoRuta))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If

View File

@@ -713,18 +713,36 @@ Partial Class Compras_Proveedores
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
Dim nodo As XmlNode = XMLDoc.DocumentElement
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
namespaces.AddNamespace(Prefijo, cfdVer)
Dim nodo As XmlNode = XMLDoc.DocumentElement
Dim Version As String = ValorXml(nodo, "Version")
If Version = "3.2" Then
Prefijo = "cfd"
cfdVer = "http://www.sat.gob.mx/cfd/2"
ElseIf Version = "3.3" Then
cfdVer = "http://www.sat.gob.mx/cfd/3"
Else ' se considera que es la version 4.0
cfdVer = "http://www.sat.gob.mx/cfd/4"
End If
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
namespaces.AddNamespace(Prefijo, cfdVer)
Dim node As XmlNode
node = XMLDoc.SelectSingleNode(String.Format("//{0}:Emisor", Prefijo), namespaces)
If node IsNot Nothing Then
TxtRFC.Text = ValorXml(node, "rfc")
If Version = "3.3" Then
If Version = "3.3" Or Version = "4.0" Then
TxtRazonSocial.Text = HttpUtility.HtmlDecode(ValorXml(node, "Nombre"))
TxtNombreComercial.Text = HttpUtility.HtmlDecode(ValorXml(node, "Nombre"))
ChkEstado.Checked = True

View File

@@ -48,9 +48,7 @@
<div class="row text-size-12">
<div class="col-md-1"><span>Proveedor: </span></div>
<div class="col-md-1">
<asp:DropDownList ID="DdlProveedor" runat="server" CssClass="select2me" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Width="100%">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<ADS:Dropdownlost ID="DdlProveedor" runat="server" CssStyle="width: 100%; selected2me" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor" ></ADS:Dropdownlost>
</div>
<div class="col-md-1"><span>Clasificación:</span></div>
<div class="col-md-1">
@@ -126,6 +124,16 @@
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="col-md-1"><span>Tipo Docto:</span></div>
<div class="col-md-2 " style="padding-bottom: 10px;">
<asp:ListBox ID="DdlTipoDocto" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server">
<asp:ListItem Selected="True" Value="Fac" Text="Factura"></asp:ListItem>
<asp:ListItem Selected="True" Value="Ant" Text="Anticipos"></asp:ListItem>
<asp:ListItem Selected="True" Value="NC" Text="Nota Crédito"></asp:ListItem>
<asp:ListItem Selected="True" Value="ExC" Text="Egresos X Comp"></asp:ListItem>
<asp:ListItem Selected="True" Value="DEV" Text="Devolución"></asp:ListItem>
</asp:ListBox>
</div>
</div>
</div>
</div>

View File

@@ -44,8 +44,28 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas
TipoCambio = 1;
TCEspecifico = -1;
DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa);
DdlProveedor.DataBind();
//DdlProveedor.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa);
//DdlProveedor.DataBind();
if (UsuarioActual.Empresa.Funcionalidad(105) == "1") {
DdlProveedor.setEsWebService(true);
DdlProveedor.Attributes.Add("data-metodo", "getproveedores");
DdlProveedor.SelectedText = "Todos";
DdlProveedor.SelectedValue = "-1";
}
else {
DdlProveedor.setEsWebService(false);
DdlProveedor.ddl.DataSource = get_GlobalDTCompProveedores(UsuarioActual.CveEmpresa);
DdlProveedor.ddl.DataBind();
DdlProveedor.ddl.Items.Insert(0, new ListItem("Todos", "-1"));
}
DdlUsuarioResponsable.DataSource = GlobalDTUsuarioResponsable.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}").FiltraParametros("ProveedoresResponsables > 0");
DdlUsuarioResponsable.DataBind();
@@ -72,10 +92,16 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas
{
if (RblTipoCambio.SelectedValue.ToEntero() == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
int CveProveedor = DdlProveedor.SelectedValue.ToEntero() > 0 ? DdlProveedor.SelectedValue.ToEntero() : -1;
string TipoDocto = (DdlTipoDocto.GetSelectedValuesM() == "") ? "-1" : DdlTipoDocto.GetSelectedValuesM();
ClsMovimientos ObjMov = new ClsMovimientos();
if (ObjMov.GetCxPPeriodo(DdlProveedor.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),DdlProveedoresClasificaciones.SelectedValue.ToEntero(),
if (ObjMov.GetCxPPeriodo(CveProveedor, DdlSubProyecto.SelectedValue.ToEntero(),DdlProveedoresClasificaciones.SelectedValue.ToEntero(),
DdlUsuarioResponsable.SelectedValue.ToEntero(),DdlUsuarioRegistro.SelectedValue.ToEntero(),DdlEstatusCompra.SelectedValue.ToEntero(),UsuarioActual.CveEmpresa,
DdlGrupo.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),TipoCambio,TCEspecifico,txtCorteA.Text.ToDate(),UsuarioActual.CveUsuario,DdlTipoProveedor.SelectedValue.ToEntero()))
DdlGrupo.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),TipoCambio,TCEspecifico,txtCorteA.Text.ToDate(),UsuarioActual.CveUsuario,
DdlTipoProveedor.SelectedValue.ToEntero(), TipoDocto: TipoDocto))
{
GvDatos.DataSource = ObjMov.DtResultados;
DtDatos = ObjMov.DtResultados;
@@ -234,7 +260,7 @@ public partial class Compras_RepCxPPeriodo : ClsPaginas
if (DdlGrupo.SelectedValue != "-1")
StrFiltro.AppendFormat("&emsp;<b>Grupo</b>: {0}", DdlGrupo.SelectedItem.Text);
if (DdlProveedor.SelectedValue != "-1")
StrFiltro.AppendFormat("&emsp;<b>Proveedor</b>: {0}", DdlProveedor.SelectedItem.Text);
StrFiltro.AppendFormat("&emsp;<b>Proveedor</b>: {0}", DdlProveedor.ddl.SelectedItem.Text);
if (DdlProveedoresClasificaciones.SelectedValue != "-1")
StrFiltro.AppendFormat("&emsp;<b>Clasificación Proveedor</b>: {0}", DdlProveedoresClasificaciones.SelectedItem.Text);
if (DdlTipoProveedor.SelectedValue != "-1")

View File

@@ -1581,7 +1581,10 @@ Partial Class Compras_eFacturas
swTiempo.AppendFormat("espera: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)
swmili = sw.ElapsedMilliseconds
sw.Start()
VerificaCorreo(True)
If VerificaCorreo(True) Then
CargaDatos()
End If
sw.Stop()
swTiempo.AppendFormat("Verifica En la app: ({0}) {1} ", sw.ElapsedMilliseconds - swmili, sw.ElapsedMilliseconds)
@@ -1695,6 +1698,9 @@ Partial Class Compras_eFacturas
RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalFacturas"))
'Alert(String.Format("Se cargaron {0} Facturas", Arreglo.Count), TipoMensaje.MsgInformacion)
End Sub
@@ -2847,6 +2853,37 @@ Partial Class Compras_eFacturas
Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
Dim Prefijo As String = ""
Dim DTDocumentosRelacionados As New DataTable
DTDocumentosRelacionados.Columns.Add("Serie")
DTDocumentosRelacionados.Columns.Add("SerieFolio")
DTDocumentosRelacionados.Columns.Add("IdDocumento")
DTDocumentosRelacionados.Columns.Add("Folio", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("MonedaDR")
DTDocumentosRelacionados.Columns.Add("MetodoDePagoDR")
DTDocumentosRelacionados.Columns.Add("ImpPagado", GetType(Decimal))
DTDocumentosRelacionados.Columns.Add("CveFactura", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("CveCompra", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("CveIE", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("Fecha", GetType(Date))
DTDocumentosRelacionados.Columns.Add("FolioPago")
DTDocumentosRelacionados.Columns.Add("ImportePago", GetType(Decimal))
DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date))
DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("SerieFolioCompra")
DTDocumentosRelacionados.Columns.Add("CvePrePolizaDetalle", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("Tipo", GetType(String))
DTDocumentosRelacionados.Columns.Add("Manual", GetType(Boolean))
If IO.File.Exists(Archivo) Then
@@ -2913,30 +2950,7 @@ Partial Class Compras_eFacturas
UUIDPago = ValorXML(nodeTFD, "UUID")
LblUUID.Text = UUIDPago
Dim DTDocumentosRelacionados As New DataTable
DTDocumentosRelacionados.Columns.Add("Serie")
DTDocumentosRelacionados.Columns.Add("SerieFolio")
DTDocumentosRelacionados.Columns.Add("IdDocumento")
DTDocumentosRelacionados.Columns.Add("Folio", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("MonedaDR")
DTDocumentosRelacionados.Columns.Add("MetodoDePagoDR")
DTDocumentosRelacionados.Columns.Add("ImpPagado", GetType(Decimal))
DTDocumentosRelacionados.Columns.Add("CveFactura", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("CveCompra", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("CveIE", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("Fecha", GetType(Date))
DTDocumentosRelacionados.Columns.Add("FolioPago")
DTDocumentosRelacionados.Columns.Add("ImportePago", GetType(Decimal))
DTDocumentosRelacionados.Columns.Add("FechaPago", GetType(Date))
DTDocumentosRelacionados.Columns.Add("CveMetodoPago", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("SerieFolioCompra")
DTDocumentosRelacionados.Columns.Add("CvePrePolizaDetalle", GetType(Integer))
DTDocumentosRelacionados.Columns.Add("Tipo", GetType(String))
DTDocumentosRelacionados.Columns.Add("Manual", GetType(Boolean))
Dim nodePagosN As XmlNodeList
@@ -3140,7 +3154,9 @@ Partial Class Compras_eFacturas
'saco la información de lo vinculado en el ie
ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe")
'ImporteIES = ObjCompras.DtResultados.FiltraParametros("CveIE > 0").SUM("Importe")
ImporteIES = DTDocumentosRelacionados.FiltraParametros("CveIE > 0").SUM("ImportePago")
DiferenciaImportes = Monto - ImporteIES
ObjCompras.Dispose()

View File

@@ -88,9 +88,9 @@
<asp:LinkButton ID="LnkAddConcepto" runat="server" OnClick="LnkAddConcepto_Click" Visible="true"><i class="fa fa-plus" ></i> Agregar Concepto</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkCrearAPartirDe" runat="server" Visible="false" OnClick="LnkCrearAPartirDe_Click" Style="color: #686868;"><i class="fa fa-plus" style="color:#686868;" ></i>Crear a partir de</asp:LinkButton>
</li>
<li>
<asp:LinkButton ID="LnkCrearAPartirDe" runat="server" Visible="false" OnClick="LnkCrearAPartirDe_Click" Style="color: #686868;"><i class="fa fa-plus" style="color:#686868;" ></i>Crear a partir de</asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
@@ -156,8 +156,14 @@
</div>
</div>
<div class="col-md-4">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox CssClass="form-control" ID="TxtFolio" runat="server" MaxLength="15" Enabled="false"></asp:TextBox>
<div class="form-group form-md-line-input input-group input-small ">
<asp:TextBox CssClass="form-control" ID="TxtFolio" runat="server" MaxLength="15" Enabled="false" Width="100%"></asp:TextBox>
<span class="input-group-btn ">
<asp:LinkButton runat="server" ID="LnkFolioManual" CssClass="blue" Visible="false"> <i class="fa fa-pencil" aria-hidden="true"></i></asp:LinkButton>
</span>
<label for="<%= TxtFolio.ClientID.ToString()%>">Folio: </label>
</div>
</div>
@@ -710,6 +716,8 @@
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
<asp:Button ID="BtnEliminar" runat="server" Text="Eliminar" class="btn btn-danger" />
<asp:Button ID="BtnContabilizar" runat="server" Text="Contabilizar" CssClass="btn btn-primary green" Visible="false" />
<asp:Button ID="BtnDescontabilizar" runat="server" Text="Descontabilizar" CssClass="btn btn-primary" Visible="false"
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ContentTemplate>
</asp:UpdatePanel>
</td>

View File

@@ -277,6 +277,21 @@ Partial Class ContabilidadC_RegPrePolizaS
ValidaCrearAPartirDe()
DvPlantilla.Visible = False
UPPDocumento.Visible = False
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If Folio.ToEntero > 0 Then
BtnDescontabilizar.Visible = True
LnkFolioManual.Visible = False
Else
BtnDescontabilizar.Visible = False
LnkFolioManual.Visible = True
End If
End If
Exit Sub
ElseIf Request("CvePrePolizaOrigen") IsNot Nothing AndAlso IsNumeric(Request("CvePrePolizaOrigen")) AndAlso Request("CvePrePolizaOrigen").ToEntero > 0 Then
@@ -2695,22 +2710,51 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim ObjConta As New ClsContabilidad
If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
End If
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If Folio.ToEntero = 0 Then
Dim FolioManual As Integer = If(TxtFolio.Text.ToEntero > 0, TxtFolio.Text.ToEntero, -1)
If ObjConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, True, UsuarioActual.CveEmpresa, Folio:=FolioManual) Then
Alert($"Contabilizado Correctamente Folio <b>{ ObjConta.ContaFolio.ToString()}.</b>", TipoMensaje.MsgInformacion)
TxtFolio.Text = ObjConta.ContaFolio.ToString()
LnkFolioManual.Visible = False
UpPoliza.Update()
End If
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio: <b>{0}</b> ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
Else
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
End If
Else
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
If IdPoliza > 0 Then 'si está bloqueada, lo desbloqueaprimero
ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False)
End If
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IdPoliza > 0, IdPoliza, -1), Concepto:=TxtConcepto.Text, Fecha:=TxtFechaDocumento.Text.ToDateTime()) Then
If UsuarioActual.Empresa.TipoContabilizacion = 1 Then
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio: <b>{0}</b> ", ObjConta.FolioPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
Else
Alert(String.Format("Prepóliza contabilizada. <br/><br/>Folio:<a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", ObjConta.ContaIdPoliza), ModExtensiones.TipoMensaje.MsgInformacion)
End If
Else
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If
End If
ObjConta.Dispose()
End Sub
@@ -3159,13 +3203,38 @@ Partial Class ContabilidadC_RegPrePolizaS
End Sub
#End Region
Private Sub BtnDescontabilizar_Click(sender As Object, e As EventArgs) Handles BtnDescontabilizar.Click
Dim ObjConta As New ClsContabilidad
If ObjConta.ContabilizaDesContabilizaPrePoliza(CvePrePoliza, False, UsuarioActual.CveEmpresa) Then
Alert("Descontabilizado Correctamente.", TipoMensaje.MsgInformacion)
TxtFolio.Text = ""
LnkFolioManual.Visible = True
End If
ObjConta.Dispose()
UpPoliza.Update()
End Sub
Private Sub LnkFolioManual_Click(sender As Object, e As EventArgs) Handles LnkFolioManual.Click
TxtFolio.Enabled = True
TxtFolio.Focus()
UpPoliza.Update()
End Sub
End Class

View File

@@ -3,16 +3,28 @@
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp; &nbsp;--%>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" Visible="true" /> &nbsp;--%>
</li>
</asp:Content>
<asp:UpdatePanel ID="UpAcciones" runat="server" >
<ContentTemplate>
<li>
<asp:LinkButton ID="ImgExcel" runat="server"><i class="fa fa-ad-excel"></i> Exporta Excel</asp:LinkButton>
<%--<asp:ImageButton ID="ImgExcel" runat="server" ImageUrl="/Imagenes/IconoExcel.gif" Width="20px" Height="20px" />&nbsp; &nbsp;--%>
</li>
<li>
<asp:LinkButton ID="BtnImprimir" runat="server"><i class="fa fa-print"></i> Imprimir</asp:LinkButton>
<%--<asp:ImageButton ID="BtnImprimir" runat="server" alt="Imprimir" src="/Imagenes/btnImprimir.gif" Style="cursor: pointer; height: 20px" Visible="true" /> &nbsp;--%>
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="ImgExcel" />
<asp:PostBackTrigger ControlID="BtnImprimir" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="E" runat="Server">
Balanza de Comprobación
<asp:Label runat="server" ID="LbTitulo"></asp:Label>

View File

@@ -228,10 +228,15 @@ Partial Class Contabilidad_RepBalanzaComprobacion
GenerarPDFCrystal("EXCEL")
End Sub
Private Sub GenerarPDFCrystal(Optional Formato As String = "PDF")
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Contabilidad/Reportes/RepBalanzaComprobacion.rpt", UsuarioActual.Empresa.Ruta))
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Contabilidad/Reportes/RepBalanzaComprobacion.rpt", Server.MapPath("~")))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
'If UsuarioActual.CveUsuario = 100 Then
' Alert(String.Format("{0}Contabilidad/Reportes/RepBalanzaComprobacion.rpt", Server.MapPath("~")))
' End If
' Exit Sub
If Not IsNothing(DtDatos) Then
'Dim dr As DataRow = DtCxC.Rows(0)
Dim lista = New List(Of CrystalParametro)
@@ -245,7 +250,9 @@ Partial Class Contabilidad_RepBalanzaComprobacion
lista.Add(New CrystalParametro("pImg", ""))
End If
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Contabilidad/Reportes/RepBalanzaComprobacion.rpt"), DtDatos, lista, "Balanza de Comprobación", Formato), "Balanza de Comprobación", Formato)
Dim DTTemp As DataTable = DtDatos.Copy
ImprimirbytesPDF(ImprimirPDFCrystal(Server.MapPath("~/Contabilidad/Reportes/RepBalanzaComprobacion.rpt"), DTTemp, lista, "Balanza de Comprobación", Formato), "Balanza de Comprobación", Formato)
Else
Alert("No se tienen registrados movimientos", TipoMensaje.MsgAdvertencia)

View File

@@ -910,7 +910,12 @@ Partial Class RepCxCDetalle
'End If
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim logouri As String = ""
If Imagen.Exists Then
logouri = String.Format("file://{0}", Imagen.FullName)
End If
Dim params As New List(Of ReportParameter)
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))

View File

@@ -117,6 +117,7 @@
<asp:ListItem Selected="True" Value="Rem" Text="Remisión"></asp:ListItem>
<asp:ListItem Selected="True" Value="Ant" Text="Anticipos"></asp:ListItem>
<asp:ListItem Selected="True" Value="Egs" Text="Egresos"></asp:ListItem>
<asp:ListItem Selected="True" Value="IxC" Text="Ingresos X Comp"></asp:ListItem>
<asp:ListItem Selected="True" Value="Dev" Text="Devolución"></asp:ListItem>
</asp:ListBox>
</div>

View File

@@ -39,13 +39,18 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas
}
}
private void InicializaValores()
{
TipoCambio = 1;
TCEspecifico = -1;
//CargaClientes
if (UsuarioActual.CveEmpresa == 119) {
if (UsuarioActual.Empresa.Funcionalidad(105) == "1")
{
DdlClientesWS.setEsWebService(true);
}
else
@@ -93,8 +98,11 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas
if (RblTipoCambio.SelectedValue.ToEntero() == 3 && TxtEspecifico.Text != "") { TCEspecifico = TxtEspecifico.Text.ToDouble(); } else { TCEspecifico = -1; }
int CveCliente = DdlClientesWS.SelectedValue.ToEntero() > 0 ? DdlClientesWS.SelectedValue.ToEntero() : -1;
ClsMovimientos ObjMov = new ClsMovimientos();
if (ObjMov.GetCxCPeriodo(DdlClientesWS.SelectedValue.ToEntero(),DdlSubProyecto.SelectedValue.ToEntero(),DdlVendedor.SelectedValue.ToEntero(),DdlUsuario.SelectedValue.ToEntero(),
if (ObjMov.GetCxCPeriodo(CveCliente, DdlSubProyecto.SelectedValue.ToEntero(),DdlVendedor.SelectedValue.ToEntero(),DdlUsuario.SelectedValue.ToEntero(),
-1,"-1",UsuarioActual.CveEmpresa,DdlGrupo.SelectedValue.ToEntero(),DdlResponsable.SelectedValue.ToEntero(),TipoCambio,TCEspecifico, TipoDocto,txtCorteA.Text.ToDate(),
DdlEstatusCliente.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, DdlCobranzaEstatus.SelectedValue.ToEntero(), DdlClienteClasificacion.SelectedValue.ToEntero())){
GvDatos.DataSource = ObjMov.DtResultados;
@@ -107,13 +115,34 @@ public partial class CxC_RepCxCPeriodo : ClsPaginas
private void CargaClientes()
{
if (UsuarioActual.CveEmpresa != 119)
if (UsuarioActual.Empresa.Funcionalidad(105) == "1")
{
DdlClientesWS.setEsWebService(true);
if( DdlClienteClasificacion.SelectedValue.ToEntero() > 0)
{
DdlClientesWS.ddlWS.Attributes.Add("data-cveclienteclasificacion", DdlClienteClasificacion.SelectedValue);
DdlClientesWS.txtValue.Value = "";
DdlClientesWS.txtText.Value = "";
}
else
{
DdlClientesWS.ddlWS.Attributes.Add("data-cveclienteclasificacion", "-1");
}
}
else
{
DdlClientesWS.ddl.Items.Clear();
DdlClientesWS.DataSource = get_GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveClienteClasificacion = {DdlClienteClasificacion.SelectedValue.ToEntero()} OR {DdlClienteClasificacion.SelectedValue.ToEntero()} = -1");
DdlClientesWS.DataBind();
DdlClientesWS.ddl.Items.Insert(0, new ListItem("Todos", "-1"));
}
UPFiltros.Update();
}
protected void DdlClienteClasificacion_SelectedIndexChanged(object sender, EventArgs e)

Binary file not shown.

View File

@@ -768,15 +768,7 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
<TextRun>
<Value>83140</Value>
<Value>=Parameters!CP.Value</Value>
<Style>
<FontFamily>Calibri</FontFamily>
<FontSize>8pt</FontSize>
@@ -3193,7 +3185,19 @@
<Paragraph>
<TextRuns>
<TextRun>
<Value>Regímen: Regímen General de Ley Personas Morales 601; Método de Pago: </Value>
<Value>Regímen: Regímen General de Ley Personas Morales 601</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Método de Pago: </Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
@@ -3206,15 +3210,20 @@
<FontSize>7pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
<Paragraph>
<TextRuns>
<TextRun>
<Value>; Num. Cta Pago:</Value>
<Value>Forma de pago: </Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
</Style>
</TextRun>
<TextRun>
<Value>=IIF(Parameters!NumCta.Value="0" Orelse Parameters!NumCta.Value="","No Identificado",Parameters!NumCta.Value)</Value>
<Value>=Parameters!FormaPago.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>7pt</FontSize>
@@ -3227,7 +3236,7 @@
<rd:DefaultName>Textbox62</rd:DefaultName>
<Top>0.83682in</Top>
<Left>1.59827in</Left>
<Height>0.29498in</Height>
<Height>0.40038in</Height>
<Width>6.31865in</Width>
<ZIndex>9</ZIndex>
<Style>
@@ -3257,9 +3266,9 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox63</rd:DefaultName>
<Top>1.1747in</Top>
<Top>1.2372in</Top>
<Left>2.35328in</Left>
<Height>0.25in</Height>
<Height>0.23611in</Height>
<Width>3.69856in</Width>
<ZIndex>10</ZIndex>
<Style>
@@ -3379,7 +3388,6 @@
<rd:FormatSymbolCulture>es-MX</rd:FormatSymbolCulture>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
</TablixCells>
@@ -4074,13 +4082,13 @@
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>0.74104in</Width>
<Width>0.73688in</Width>
</TablixColumn>
<TablixColumn>
<Width>0.57756in</Width>
<Width>0.5734in</Width>
</TablixColumn>
<TablixColumn>
<Width>0.67516in</Width>
<Width>0.671in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
@@ -4329,9 +4337,9 @@
</TablixRowHierarchy>
<DataSetName>DataSet3</DataSetName>
<Top>0.26817in</Top>
<Left>5.86887in</Left>
<Left>5.88134in</Left>
<Height>0.34081in</Height>
<Width>1.99376in</Width>
<Width>1.98129in</Width>
<ZIndex>3</ZIndex>
<Style>
<Border>
@@ -4362,6 +4370,14 @@
<Value>Moneda </Value>
<Style />
</TextRun>
<TextRun>
<Value>=Parameters!MonedaAbreviatura.Value</Value>
<Style />
</TextRun>
<TextRun>
<Value xml:space="preserve"> </Value>
<Style />
</TextRun>
<TextRun>
<Value>=Parameters!Moneda.Value</Value>
<Style />

Binary file not shown.

View File

@@ -169,17 +169,15 @@
<div class="row">
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-3"></asp:Label>
<asp:Label runat="server" ID="LblSubProyecto" CssClass="col-md-2"></asp:Label>
<div class="col-md-9" style="padding-left: 5px;">
<asp:DropDownList runat="server" ID="DdlSubProyecto" CssClass="select2me" Width="100%" DataTextField="SubProyecto" DataValueField="CveSubProyecto"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlSubProyecto" runat="server" InitialValue="-1" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
</div>
</div>
<div class="row">
<label class="col-md-3">Fecha:</label>
<label class="col-md-2">Fecha:</label>
<div class="col-md-3" style="padding-left: 5px;">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy">
<asp:TextBox ID="TxtFecha" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="10" ValidationGroup="GrpGuardar" Width="100px" ClientIDMode="Static"></asp:TextBox>
@@ -202,7 +200,7 @@
</div>
<div class="row rowpadding" id="divEmitir" runat="server">
<label class="col-md-3">Emitir:</label>
<label class="col-md-2">Emitir:</label>
<div class="col-md-9">
<table>
<tr>
@@ -216,32 +214,32 @@
</div>
</div>
<div class="row rowpadding">
<label class="col-md-3">Chofer:</label>
<div class="col-md-8">
<label class="col-md-2">Chofer:</label>
<div class="col-md-6">
<asp:DropDownList ID="DdlChofer" runat="server" DataTextField="ChoferLicencia" DataValueField="CveChofer" OnSelectedIndexChanged="DldChofer_SelectedIndexChanged" AutoPostBack="true" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlChofer" runat="server" Enabled="false" ControlToValidate="DdlChofer" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Chofer''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlChofer" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlChofer" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
<div class="col-md-1" style="text-align:left!important">
<asp:LinkButton ID="LnkAgregarChofer" runat="server" CssClass="btn btn-primary btn-sm" Text="+" CommandArgument="Agregar Chofer" />
</div>
</div>
<div class="row rowpadding">
<label class="col-md-3">Unidad:</label>
<div class="col-md-8">
<label class="col-md-2">Unidad:</label>
<div class="col-md-6">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlUnidadCamionActivoFijo_SelectedIndexChanged" ></asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlUnidadCamion" runat="server" Enabled="false" ControlToValidate="DdlUnidadCamion" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Unidad''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceDdlUnidadCamion" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlUnidadCamion" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<div class="col-md-1">
<div class="col-md-1" style="text-align:left!important">
<asp:LinkButton ID="LnkAgregarUnidad" runat="server" CssClass="btn btn-primary btn-sm" Text="+" CommandArgument="Agregar Unidad" />
</div>
</div>
<div class="row rowpadding" runat="server" id="DvConfiguracionVeiculo" visible="false">
<label class="col-md-3">Configuración:</label>
<div class="col-md-9">
<label class="col-md-2">Configuración:</label>
<div class="col-md-6">
<%--<asp:DropDownList runat="server" ID="DropDownList1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveActivoFijo" DataTextField="CodigoDescripcion"></asp:DropDownList>--%>
<asp:DropDownList ID="DdlConfigAuto" CssClass="form-control input-sm select2me" Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="true" OnSelectedIndexChanged="DdlConfigAuto_SelectedIndexChanged" CausesValidation="true" DataTextField="ClaveConfigAutoTransporteDescripcion" DataValueField="CveConfigAutoTransporte" Style="padding: 0px">
</asp:DropDownList>
@@ -251,16 +249,16 @@
</div>
<div class="row rowpadding" runat="server" id="DvRemolque1" visible="false">
<label class="col-md-3">Remolque 1:</label>
<div class="col-md-9">
<label class="col-md-6">Remolque 1:</label>
<div class="col-md-6">
<asp:DropDownList runat="server" ID="DdlRemolque1" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" OnSelectedIndexChanged="DdlRemolque1_SelectedIndexChanged"></asp:DropDownList>
</div>
</div>
<div class="row rowpadding" runat="server" id="DvRemolque2" visible="false">
<label class="col-md-3">Remolque 2:</label>
<div class="col-md-9">
<label class="col-md-2">Remolque 2:</label>
<div class="col-md-6">
<asp:DropDownList runat="server" ID="DdlRemolque2" AutoPostBack="true" Width="100%" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="CamionPlaca" ></asp:DropDownList>
</div>
</div>

View File

@@ -1777,7 +1777,7 @@ Partial Class Inventarios_EntradasSalidas
If OrigenMov = 1 Then TipoMovtoAlmacen = False Else TipoMovtoAlmacen = True
TipoMovtoOtro = Not TipoMovtoAlmacen
Dim CveConceptoContable As Integer = 78
Dim CveConceptoContable As Integer = 260
Dim CveClasificacion As Integer = -1
Select Case DdlConcepto.SelectedValue.ToEntero
Case 28, 31

View File

@@ -533,11 +533,7 @@ Partial Class Inventarios_RecepcionAlmacen
Private Sub CargaAlmacenes(CveSubProyecto As Integer, Optional CveTiposAlmacen As String = "", Optional CveTipoCompra As Integer = -1)
Dim StrAlmacenes As String = ""
If UsuarioActual.CveSubProyecto = 8804 Then 'AGS
StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,12,15")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}"
Else
StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,14")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}"
End If
StrAlmacenes = $"CveTipoAlmacen IN ({If(CveTiposAlmacen.Length > 0, CveTiposAlmacen, "1,2,15,14,19")}) {If(CveSubProyecto > 0, $"And CveSubProyecto = {CveSubProyecto}", "")}"
If CveTipoCompra = 10 Then
StrAlmacenes = $"Modalidad = 0"
@@ -3693,7 +3689,7 @@ Partial Class Inventarios_RecepcionAlmacen
If Not ErrorMovInv And CveOCSurtir > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Dr("CveOrdenCompraDetalle").ToString.ToEntero, Dr("CveMovimientoDetalle").ToString.ToEntero, Dr("Cantidad").ToString.ToDouble, -1, -1) Then
If Not ObjOC.OrdenesCompraDetalleSaldosInvCompraAdd(Dr("CveOrdenCompraDetalle").ToString.ToEntero, Dr("CveMovimientoDetalle").ToString.ToEntero, Dr("Cantidad").ToString.ToDecimal, -1, -1) Then
ErrorMovInv = True
Exit For
End If

View File

@@ -287,7 +287,6 @@
<asp:PostBackTrigger ControlID="LnkListaRaya" />
<asp:PostBackTrigger ControlID="LnkFormatoTabular" />
<asp:PostBackTrigger ControlID="LnkLayoutContable" />
</Triggers>
</asp:UpdatePanel>
@@ -4213,6 +4212,67 @@
</div>
<div id="ModalLayoutBancos" class="modal ADS fade" role="dialog">
<asp:UpdatePanel ID="UpModalBancosLayout" class="modal-dialog rowpadding" tabindex="-1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Layout banco</h4>
</div>
<div class="modal-body">
<%-- <div class="form-group form-md-line-input">
<asp:RadioButtonList runat="server" ID="RBLModalBancosLayout" RepeatDirection="Horizontal" CssClass=" form-control input-sm" >
<asp:ListItem Value="1" Selected="True">Generar Layout</asp:ListItem>
<asp:ListItem Value="2">Altas Nomina</asp:ListItem>
</asp:RadioButtonList>
<asp:Label runat="server" AssociatedControlID="RBLModalBancosLayout">Tipo Operacóon:</asp:Label>
</div>--%>
<div class="form-group form-md-line-input">
<asp:DropDownList ID="DdlModalBancosLayout" CssClass=" form-control input-sm select2me" runat="server" Width="100%">
<asp:ListItem Value="-1">Seleccione Uno</asp:ListItem>
<asp:ListItem Value="1">Bancomer</asp:ListItem>
<asp:ListItem Value="2">Banorte</asp:ListItem>
</asp:DropDownList>
<asp:Label runat="server" AssociatedControlID="DdlModalBancosLayout">Banco:</asp:Label>
<asp:RequiredFieldValidator ID="RfvDdlModalBancosLayout" runat="server" CssClass="help-block errorimput" Display="none" InitialValue="-1" ControlToValidate="DdlModalBancosLayout"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Banco''</b> es necesario, por favor ingréselo." ValidationGroup="GrpModalBancoLayout">
</asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CERfvDdlModalBancosLayout" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlModalBancosLayout" Width="350px"></ajax:ValidatorCalloutExtender>
</div>
<br />
</div>
<div class="modal-footer">
<%-- <asp:UpdatePanel ID="UpModalBancosLayoutBotones" runat="server" UpdateMode="Conditional">
<ContentTemplate>--%>
<button id="BtnModalBancosLayoutCerrar" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<asp:Button Text="Generar" ID="BtnModalBancosProcesar" OnClick="BtnModalBancosProcesar_Click" CssClass="btn btn-primary" ValidationGroup="GrpModalBancoLayout" runat="server" />
<%-- </ContentTemplate>
</asp:UpdatePanel>--%>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="BtnModalBancosProcesar" />
</Triggers>
</asp:UpdatePanel>
</div>
<asp:TextBox ID="TxtCvePeriodo" CssClass="TxtCvePeriodo hidden" runat="server"></asp:TextBox>
<asp:TextBox ID="TxtCvePersonal" CssClass="TxtCvePersonal hidden" runat="server"></asp:TextBox>
<asp:Button ID="BtnGeneratepdf" CssClass="BtnGeneratepdf hidden" OnClick="BtnGeneratepdf_Click" UseSubmitBehavior="false" runat="server" Text="Button" />

View File

@@ -1298,8 +1298,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
string RFCReceptor = Nom.RFC;
string RFCEmisor = UsuarioActual.Empresa.RFC;
string SerieFolio = Nom.SerieFolio;
string SerieFolioFiniquito = string.Format ("{0}F-{1}", nrow["Serie"], nrow["Folio"]);
bool SeTimbroFiniquito = nrow["SeTimbroFiniquito"].ToString().ToUpper().Contiene(new string[] {"1","TRUE"});
string SerieFolioFiniquito = string.Format("{0}F-{1}", nrow["Serie"], nrow["Folio"]);
bool SeTimbroFiniquito = nrow["SeTimbroFiniquito"].ToString().ToUpper().Contiene(new string[] { "1", "TRUE" });
string FolioFiscalFiniquito = nrow["FolioFiscalFiniquito"].ToString();
//SeTimbroFiniquito,N.FolioFiscalFiniquito
DataRow rowc = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltroPrimero(string.Format("CveMotivoCancelacion={0}", DdlMotivoCancelacion.SelectedValue));
@@ -1341,33 +1341,33 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
else
{
reultado = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscalFiniquito, Total, RFCReceptor, RFCEmisor, 4, CveSATMotivoCancelacion: CveMotivoCancelacion);
if (reultado.Verificado)//,CveSATMotivoCancelacion:=
{
try
reultado = ObjTimbrado.CFDICancelar(UsuarioActual.Empresa, FolioFiscalFiniquito, Total, RFCReceptor, RFCEmisor, 4, CveSATMotivoCancelacion: CveMotivoCancelacion);
if (reultado.Verificado)//,CveSATMotivoCancelacion:=
{
string ruta = string.Format("{0}XML\\Nomina\\", UsuarioActual.Empresa.Ruta);
string archivo = string.Format("{0}{1}.xml", ruta, SerieFolioFiniquito);
int contador = 1;
string archivonew = string.Format("{0}{1}_{2}.xml", ruta, SerieFolioFiniquito, contador++);
while (System.IO.File.Exists(archivonew))
try
{
archivonew = string.Format("{0}{1}_{2}.xml", ruta, SerieFolioFiniquito, contador++);
string ruta = string.Format("{0}XML\\Nomina\\", UsuarioActual.Empresa.Ruta);
string archivo = string.Format("{0}{1}.xml", ruta, SerieFolioFiniquito);
int contador = 1;
string archivonew = string.Format("{0}{1}_{2}.xml", ruta, SerieFolioFiniquito, contador++);
while (System.IO.File.Exists(archivonew))
{
archivonew = string.Format("{0}{1}_{2}.xml", ruta, SerieFolioFiniquito, contador++);
}
File.Move(archivo, archivonew);
}
catch (Exception)
{
Alert("Ocurrió un error al mover el archivo fiscal cancelado");
}
File.Move(archivo, archivonew);
}
catch (Exception)
{
Alert("Ocurrió un error al mover el archivo fiscal cancelado");
}
secancelo12 = true;
}
else
{
string.Format("Error al cancelar nomina {0}", FolioFiscalFiniquito).GuardaLog();
//ObjTimbrado.MensajeErrorCFDI.GuardaLog();
}
secancelo12 = true;
}
else
{
string.Format("Error al cancelar nomina {0}", FolioFiscalFiniquito).GuardaLog();
//ObjTimbrado.MensajeErrorCFDI.GuardaLog();
}
}
if (secancelo11 && secancelo12)
@@ -1375,7 +1375,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
Nom.UpdateEstatusNomNominas(2, UsuarioActual.Empresa.CvePAC, "", ("01/01/2000").ToDate(), ("01/01/2000").ToDate(), CveNomina);
Alert($"La nómina con folio fiscal '{FolioFiscal}' fue cancelada ante el SAT", TipoMensaje.MsgInformacion);
}else
}
else
{
Alert($"no se pudo cancelar el folio fiscal<br>{ObjTimbrado.MensajeErrorCFDI}", TipoMensaje.MsgAdvertencia);
@@ -5718,7 +5719,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
this.Alert("Se ha eliminadó el movimiento permanente");
}
}
protected void LnkEditarMovtoPermanente_Click(object sender, EventArgs e)
protected void LnkEditarMovtoPermanente_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
@@ -7662,108 +7663,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
}
loadtablas();
}
private void CrearLayout(DataTable DTNomina)
{
StringBuilder sb = new StringBuilder();
StringBuilder SbErrores = new StringBuilder();
bool ErroresValidaciones = false;
SbErrores.AppendLine("Se detectaron los siguientes errores en la generación del layout");
foreach (DataRow dRow in DTNomina.Rows)
{
string RFC = dRow["RFC"].ToString();
string Nombre = dRow["Nombre"].ToString();
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
decimal Importe = dRow["Importe"].ToString().ToDecimal();
if (RFC.Trim().Length == 0)
SbErrores.AppendLine($"El RFC es requerido del empleado {Nombre}<br/>");
System.Text.RegularExpressions.Match Coincidencia = System.Text.RegularExpressions.Regex.Match(RFC, @"/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/");
if (!Coincidencia.Success)
{
SbErrores.AppendLine($"El RFC {RFC} del empleado {Nombre} no es valido <br/>");
ErroresValidaciones = true;
}
if (BancoNumCuenta.Trim().Length != 10)
{
SbErrores.AppendLine($"Empleado {Nombre} numero de cuenta incorrecto, la cuenta debe de tener 10 caracteres<br/>"); // Bancomer 10 caracteres
ErroresValidaciones = true;
}
if (Importe <= 0)
{
SbErrores.AppendLine($"Empleado {Nombre} el importe debe de ser mayor a 0 importe {Importe}"); // importe mayot a 0
ErroresValidaciones = true;
}
}
ErroresValidaciones = false;
if (!ErroresValidaciones)
{
int Count = 1;
foreach (DataRow dRow in DTNomina.Rows)
{
StringBuilder SbLinea = new StringBuilder();
string RFC = dRow["RFC"].ToString();
string Nombre = dRow["Nombre"].ToString();
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
decimal Importe = dRow["Importe"].ToString().ToDecimal().RoundSQL(2);
SbLinea.Append(Count.ToString("000000000"));
SbLinea.Append(RFC.Trim().PadRight(16));
SbLinea.Append("03");
SbLinea.Append(BancoNumCuenta.Trim().PadRight(20));
SbLinea.Append(Importe.ToString("0000000000000.00").Replace(".", ""));
if (Nombre.Trim().Length > 40)
Nombre = Nombre.Substring(0, 40);
SbLinea.Append(Nombre.Trim().PadRight(40));
SbLinea.Append("012");
SbLinea.Append("000");
sb.AppendLine(SbLinea.ToString());
Count = Count + 1;
}
Response.Clear();
Response.ClearHeaders();
Response.AppendHeader("Content-Length", sb.ToString());
Response.ContentType = "text/plain";
//Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina{DateTime.Now.ToString("yyyyMMddhhmmss").ToString()}.txt\"");
Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina {DdlPeriodo.SelectedItem.Text }.txt\"");
Response.Write(sb.ToString());
Response.End();
}
else
Alert(SbErrores.ToString(), TipoMensaje.MsgAdvertencia);
}
protected void LnkLayoutContable_Click(object sender, EventArgs e)
{
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersionnomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
CrearLayout(objnom.DtResultados);
}
}
}
protected void LnkAsistenciaIncidencias_Click(object sender, EventArgs e)
{
@@ -8204,4 +8106,760 @@ public partial class Nomina_Nomina2 : ClsPaginas
this.Alert("El Vacaciones_Empresas Se ha Eliminado");
}
}
#region Layouts
protected void LnkLayoutContable_Click(object sender, EventArgs e)
{
// RBLModalBancosLayout.SelectedValue = "1";
DdlModalBancosLayout.SelectedValueExist("-1");
this.RegistraScript("$('#ModalLayoutBancos').modal('show');");
UpModalBancosLayout.Update();
}
protected void RBLModalBancosLayout_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void BtnModalBancosProcesar_Click(object sender, EventArgs e)
{
//if (RBLModalBancosLayout.SelectedValue.ToEntero() == 1)
//{
if (DdlModalBancosLayout.SelectedValue.ToEntero() == 1)
{
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersionnomina(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
CrearLayoutNominaBancomer(objnom.DtResultados);
}
}
}
else if (DdlModalBancosLayout.SelectedValue.ToEntero() == 2)
{
using (ClsNominas objnom = new ClsNominas())
{
if (objnom.GetDispersionNominaBanorte(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
{
CrearLayoutNominaBanorte(objnom.DtResultados, "1234");
}
}
}
//}
//else if (RBLModalBancosLayout.SelectedValue.ToEntero() == 2)
//{
// if (DdlModalBancosLayout.SelectedValue.ToEntero() == 1)
// {
// //Sin Alta
// }
// else if (DdlModalBancosLayout.SelectedValue.ToEntero() == 2)
// {
// //Banorte
// using (ClsNominas objnom = new ClsNominas())
// {
// if (objnom.GetLayoutAltaBanorte(CvePeriodoSeleccionado, UsuarioActual.CveEmpresa))
// {
// CrearLayoutAltaBanorte(objnom.DtResultados, " 04539871", "12345", UsuarioActual.Empresa.Empresa);
// }
// }
// }
//}
}
private void CrearLayoutNominaBancomer(DataTable DTNomina)
{
StringBuilder sb = new StringBuilder();
StringBuilder SbErrores = new StringBuilder();
bool ErroresValidaciones = false;
SbErrores.AppendLine("Se detectaron los siguientes errores en la generación del layout");
foreach (DataRow dRow in DTNomina.Rows)
{
string RFC = dRow["RFC"].ToString();
string Nombre = dRow["Nombre"].ToString();
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
decimal Importe = dRow["Importe"].ToString().ToDecimal();
if (RFC.Trim().Length == 0)
SbErrores.AppendLine($"El RFC es requerido del empleado {Nombre}<br/>");
System.Text.RegularExpressions.Match Coincidencia = System.Text.RegularExpressions.Regex.Match(RFC, @"/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/");
if (!Coincidencia.Success)
{
SbErrores.AppendLine($"El RFC {RFC} del empleado {Nombre} no es valido <br/>");
ErroresValidaciones = true;
}
if (BancoNumCuenta.Trim().Length != 10)
{
SbErrores.AppendLine($"Empleado {Nombre} numero de cuenta incorrecto, la cuenta debe de tener 10 caracteres<br/>"); // Bancomer 10 caracteres
ErroresValidaciones = true;
}
if (Importe <= 0)
{
SbErrores.AppendLine($"Empleado {Nombre} el importe debe de ser mayor a 0 importe {Importe}"); // importe mayot a 0
ErroresValidaciones = true;
}
}
ErroresValidaciones = false;
if (!ErroresValidaciones)
{
int Count = 1;
foreach (DataRow dRow in DTNomina.Rows)
{
StringBuilder SbLinea = new StringBuilder();
string RFC = dRow["RFC"].ToString();
string Nombre = dRow["Nombre"].ToString();
string BancoNumCuenta = dRow["BancoNumCuenta"].ToString();
decimal Importe = dRow["Importe"].ToString().ToDecimal().RoundSQL(2);
SbLinea.Append(Count.ToString("000000000"));
SbLinea.Append(RFC.Trim().PadRight(16));
SbLinea.Append("03");
SbLinea.Append(BancoNumCuenta.Trim().PadRight(20));
SbLinea.Append(Importe.ToString("0000000000000.00").Replace(".", ""));
if (Nombre.Trim().Length > 40)
Nombre = Nombre.Substring(0, 40);
SbLinea.Append(Nombre.Trim().PadRight(40));
SbLinea.Append("012");
SbLinea.Append("000");
sb.AppendLine(SbLinea.ToString());
Count = Count + 1;
}
Response.Clear();
Response.ClearHeaders();
Response.AppendHeader("Content-Length", sb.ToString());
Response.ContentType = "text/plain";
//Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina{DateTime.Now.ToString("yyyyMMddhhmmss").ToString()}.txt\"");
Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina {DdlPeriodo.SelectedItem.Text }.txt\"");
Response.Write(sb.ToString());
this.RegistraScript("$('#ModalLayoutBancos').modal('hide');");
Response.Flush();
Response.End();
}
else
Alert(SbErrores.ToString(), TipoMensaje.MsgAdvertencia);
}
//private void CrearLayoutAltaBanorte(DataTable DTNomina, string Promotor, string NIE, string RazonSocial)
//{
// StringBuilder sb = new StringBuilder();
// StringBuilder SbErrores = new StringBuilder();
// char Cero = '0';
// char Espacio = ' ';
// bool ErrorProceso = false;
// Promotor = Promotor.Trim();
// NIE = NIE.Trim();
// RazonSocial = RazonSocial.Trim();
// //SbErrores.AppendLine("Se detectaron los siguientes errores en la generación del layout");
// if (DTNomina.Rows.Count > 0)
// {
// //Tip oRegistro 1 1-1
// //Clave servicio 2 2-3
// sb.Append($"HNE");
// //Promotor 8 4-11
// if (Promotor.Length > 0 && Promotor.Length <= 8)
// {
// sb.Append(Promotor.PadLeft(8, Cero));
// }
// else
// {
// SbErrores.AppendLine($"Promotor {Promotor} debe de tener una logitud de entre 1 y 8<br/>");
// ErrorProceso = true;
// }
// //NIE 5 12-26
// if (ErrorProceso == false && NIE.Length > 0 && NIE.Length <= 5)
// {
// sb.Append(NIE.PadLeft(5, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"NIE {NIE} debe de tener una logitud de entre 1 y 8<br/>");
// ErrorProceso = true;
// }
// //Nombre de Empresa ó Razón Social 40 17-56
// if (ErrorProceso == false && RazonSocial.Length > 0 && RazonSocial.Length <= 40)
// {
// sb.Append(RazonSocial.PadLeft(40, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"RazonSocial {RazonSocial} debe de tener una logitud de entre 1 y 40<br/>");
// ErrorProceso = true;
// }
// //57-58consecutivo 1
// sb.Append("1");
// //Número de registros N 6 59-64
// sb.Append(DTNomina.Rows.ToString().PadRight(6, Espacio));
// //Filler A 283 65-347
// sb.Append(DTNomina.Rows.ToString().PadLeft(283, Espacio));
// if (!ErrorProceso)
// {
// foreach (DataRow dRow in DTNomina.Rows)
// {
// string CodigoEmpleado = dRow["Codigo"].ToString().Trim();
// string Nombres = dRow["Nombres"].ToString().Trim();
// string APaterno = dRow["APaterno"].ToString().Trim();
// string Amaterno = dRow["AMaterno"].ToString().Trim();
// string CodigoNacionalOperacion = dRow["CodigoNacionalOperacion"].ToString().Trim();
// string NombreCorto = dRow["NombreCorto"].ToString().Trim();
// string TipoDeVia = dRow["TipoDeVia"].ToString().Trim();
// string Direccion = dRow["Direccion"].ToString().Trim();
// string NumExt = dRow["NumExt"].ToString().Trim();
// string TipoDeVivienda = dRow["TipoDeVivienda"].ToString().Trim();
// string Colonia = dRow["Colonia"].ToString().Trim();
// string DelegacionMunicipio = dRow["DelegacionMunicipio"].ToString().Trim();
// string ClaveEstado = dRow["ClaveEstado"].ToString().Trim();
// string CP = dRow["CP"].ToString().Trim();
// string Sexo = dRow["Sexo"].ToString().Trim();
// DateTime FechaNacimiento = dRow["FechaNacimiento"].ToString().ToDate();
// string Nacionalidad = dRow["Nacionalidad"].ToString().Trim();
// string EstadoCivil = dRow["EstadoCivil"].ToString().Trim();
// string Escolaridad = dRow["Escolaridad"].ToString().Trim();
// string TipoEmpleado = dRow["TipoEmpleado"].ToString().Trim();
// string RFC = dRow["RFC"].ToString().Trim();
// string TipoAlta = dRow["TipoAlta"].ToString().Trim();
// string TipoDeTarjeta = dRow["TipoDeTarjeta"].ToString().Trim();
// string CodigoDeBanco = dRow["CodigoDeBanco"].ToString().Trim();
// string TipoCuenta = dRow["TipoCuenta"].ToString().Trim();
// string Cuenta = dRow["Cuenta"].ToString().Trim();
// string ImpresionContrato = dRow["ImpresionContrato"].ToString().Trim();
// //Tipo de registro A 1 1-1
// sb.AppendLine("D");
// //CodigoEmpleado A 10 2-11
// if (ErrorProceso == false && CodigoEmpleado.Length > 0 && CodigoEmpleado.Trim().Length <= 10)
// {
// sb.Append(CodigoEmpleado.PadLeft(10, Cero));
// }
// else
// {
// SbErrores.AppendLine($"Codigo {CodigoEmpleado} debe de tener una logitud de entre 1 y 10<br/>");
// ErrorProceso = true;
// }
// //Nombres A 20 12-31
// if (ErrorProceso == false && Nombres.Length > 0 && Nombres.Trim().Length <= 20)
// {
// sb.Append(Nombres.PadRight(20, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Nombre {Nombres} debe de tener una logitud de entre 1 y 20<br/>");
// ErrorProceso = true;
// }
// //Apellido Paterno A 20 32-51
// if (ErrorProceso == false && APaterno.Length > 0 && APaterno.Trim().Length <= 20)
// {
// sb.Append(APaterno.PadRight(20, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Apellido Paterno {APaterno} debe de tener una logitud de entre 1 y 20<br/>");
// ErrorProceso = true;
// }
// //Aperllido Materno A 20 52-71
// if (ErrorProceso == false && Amaterno.Length > 0 && Amaterno.Trim().Length <= 20)
// {
// sb.Append(Amaterno.PadRight(20, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Apellido Materno {Amaterno} debe de tener una logitud de entre 1 y 20<br/>");
// ErrorProceso = true;
// }
// // Dependencia A 5 72-76
// sb.Append(string.Empty.PadRight(5, Espacio)); // No requerido
// //CodigoNacionalOperacion N 2 77-78 Anexo 1
// if (ErrorProceso == false && CodigoNacionalOperacion.Length > 0 && CodigoNacionalOperacion.Trim().Length <= 2)
// {
// sb.Append(CodigoNacionalOperacion.PadLeft(2, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Codigo Nacional de Operación {CodigoNacionalOperacion} debe de tener una logitud de entre 1 y 20<br/>");
// ErrorProceso = true;
// }
// //NombreCorto A 19 79-97
// if (ErrorProceso == false && NombreCorto.Length > 0 && NombreCorto.Trim().Length <= 19)
// {
// sb.Append(NombreCorto.PadRight(19, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Nombre Corto{NombreCorto} debe de tener una logitud de entre 1 y 19<br/>");
// ErrorProceso = true;
// }
// //TipoDeVia A 2 98-99 Anexo 2
// if (ErrorProceso == false && TipoDeVia.Length > 0 && TipoDeVia.Trim().Length <= 2)
// {
// sb.Append(TipoDeVia.PadRight(2, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Tipo De Via {TipoDeVia} debe de tener una logitud de entre 1 y 2<br/>");
// ErrorProceso = true;
// }
// //Calle A 24 100-123
// if (ErrorProceso == false && Direccion.Length > 0 && Direccion.Trim().Length <= 24)
// {
// sb.Append(Direccion.PadRight(24, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Calle {Direccion} debe de tener una logitud de entre 1 y 24<br/>");
// ErrorProceso = true;
// }
// //Numero A 7 124-130
// if (ErrorProceso == false && NumExt.Length > 0 && NumExt.Trim().Length <= 7)
// {
// sb.Append(NumExt.PadRight(7, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Tipo De Via {NumExt} debe de tener una logitud de entre 1 y 7<br/>");
// ErrorProceso = true;
// }
// //TipoDeVivienda N 2 131-132
// if (ErrorProceso == false && TipoDeVivienda.Length > 0 && TipoDeVivienda.Trim().Length <= 2)
// {
// sb.Append(TipoDeVivienda.PadLeft(2, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Tipo de Vivienda {TipoDeVivienda} debe de tener una logitud de entre 1 y 2<br/>");
// ErrorProceso = true;
// }
// //Entrada A 2 133-134
// sb.Append(string.Empty.PadRight(2, Espacio)); // No requerido
// //Piso A 5 135-136
// sb.Append(string.Empty.PadRight(2, Espacio)); // No requerido
// //Deparatmento A 4 137-140
// sb.Append(string.Empty.PadRight(4, Espacio)); // No requerido
// //Colonia A 40 141-180
// if (ErrorProceso == false && Colonia.Length > 0 && Colonia.Trim().Length <= 40)
// {
// sb.Append(Colonia.PadRight(40, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Colonia Municipio {Colonia} debe de tener una logitud de entre 1 y 40<br/>");
// ErrorProceso = true;
// }
// //DelegacionMunicipio N 3 181-183
// if (ErrorProceso == false && DelegacionMunicipio.Length > 0 && DelegacionMunicipio.Trim().Length <= 3)
// {
// sb.Append(DelegacionMunicipio.PadLeft(3, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Delegacion Municipio {DelegacionMunicipio} debe de tener una logitud de entre 1 y 3<br/>");
// ErrorProceso = true;
// }
// //ClaveEstado N 2 184-185
// if (ErrorProceso == false && ClaveEstado.Length > 0 && ClaveEstado.Trim().Length <= 2)
// {
// sb.Append(ClaveEstado.PadLeft(2, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Clave Estado {ClaveEstado} debe de tener una logitud de entre 1 y 2<br/>");
// ErrorProceso = true;
// }
// //Codigo Postal N 5 186-190
// if (ErrorProceso == false && CP.Length > 0 && CP.Trim().Length <= 5)
// {
// sb.Append(CP.PadLeft(5, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Codigo Postal {CP} debe de tener una logitud de entre 1 y 5<br/>");
// ErrorProceso = true;
// }
// //Telefono A 12 191-202
// sb.Append(string.Empty.PadRight(12, Espacio)); // No requerido
// //Sexo A 1 203-203
// sb.Append(Sexo); // No requerido
// //Fecha Nacimiento A N 204-211
// sb.Append(FechaNacimiento.ToString("yyyyMMdd"));
// //Nacionalidad N 3 212-214 Anexo 6
// if (ErrorProceso == false && Nacionalidad.Length > 0 && Nacionalidad.Trim().Length <= 3)
// {
// sb.Append(Nacionalidad.PadLeft(3, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Nacionalidad {Nacionalidad} debe de tener una logitud de entre 1 y 2<br/>");
// ErrorProceso = true;
// }
// //Estado Civil N 3 215-215 Anexo 7
// if (ErrorProceso == false && EstadoCivil.Length > 0 && EstadoCivil.Trim().Length <= 1)
// {
// sb.Append(EstadoCivil);
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Estado Civil {EstadoCivil} debe de tener una logitud de 1<br/>");
// ErrorProceso = true;
// }
// //Regimen Matrimonial A 1 216-216
// sb.Append(string.Empty.PadRight(1, Espacio)); // No requerido Anexo 8
// //Escolaridad N 3 217-219 Anexo 9
// if (ErrorProceso == false && Escolaridad.Length > 0 && Escolaridad.Trim().Length <= 3)
// {
// sb.Append(Escolaridad.PadLeft(3, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Escolaridad {Escolaridad} debe de tener una logitud de entre 1 y 3<br/>");
// ErrorProceso = true;
// }
// //Titulo Profecional N 5 220-223
// sb.Append(string.Empty.PadLeft(3, Cero)); // No requerido Anexo 10
// //RFC N 13 225-237
// if (ErrorProceso == false && RFC.Length > 0 && RFC.Trim().Length <= 13)
// {
// sb.Append(RFC.PadRight(13, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} RFC {RFC} debe de tener una logitud de entre 1 y 13<br/>");
// ErrorProceso = true;
// }
// //Curp A 18 238-255
// sb.Append(string.Empty.PadLeft(18, Espacio)); // No requerido
// //Tipo de Alta N 2 256-257
// if (ErrorProceso == false && TipoAlta.Length > 0 && TipoAlta.Trim().Length <= 2)
// {
// sb.Append(TipoAlta.PadLeft(3, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Tipo de Alta {TipoAlta} debe de tener una logitud de entre 1 y 2<br/>");
// ErrorProceso = true;
// }
// //TipoDeTarjeta N 1 258-258
// sb.Append(TipoDeTarjeta);
// //Número de Tarjeta de Débito N 16 259-274
// sb.Append(string.Empty.PadLeft(16, Cero)); // No requerido
// //Clave del Producto de la Cuenta N 4 275-278
// sb.Append(string.Empty.PadLeft(4, Cero)); // No requerido
// //Código de Banco de la Cuenta N 3 279-281
// if (ErrorProceso == false && CodigoDeBanco.Length > 0 && CodigoDeBanco.Trim().Length <= 3)
// {
// sb.Append(CodigoDeBanco.PadLeft(3, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Codigo De Banco {CodigoDeBanco} debe de tener una logitud de entre 1 y 3<br/>");
// ErrorProceso = true;
// }
// //Tipo Cuenta N 2 282-283
// if (ErrorProceso == false && TipoCuenta.Length > 0 && TipoCuenta.Trim().Length <= 2)
// {
// sb.Append(TipoCuenta.PadLeft(2, Cero));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Tipo Cuenta {TipoCuenta} debe de tener una logitud de entre 1 y 2<br/>");
// ErrorProceso = true;
// }
// //Numero cuenta 18 284-301
// if (ErrorProceso == false && Cuenta.Length > 0 && Cuenta.Trim().Length <= 18)
// {
// sb.Append(Cuenta.PadRight(18, Espacio));
// }
// else
// {
// SbErrores.AppendLine($"{CodigoEmpleado} Numero cuenta {Cuenta} debe de tener una logitud de entre 1 y 18<br/>");
// ErrorProceso = true;
// }
// //CR Chequera N 4 302-305
// sb.Append(string.Empty.PadLeft(4, Cero)); // No requerido
// //Impresion Contrato A 1 306-306
// sb.Append("S");
// //Sueldo N 15 307-321
// sb.Append(string.Empty.PadLeft(15, Cero)); // No requerido
// //Numero targeta N 16 307-321
// sb.Append(string.Empty.PadLeft(16, Cero)); // No requerido
// //Filler A 10 338-347
// sb.Append(string.Empty.PadLeft(10, Cero)); // Relleno
// }
// if (!ErrorProceso)
// {
// Response.Clear();
// Response.ClearHeaders();
// Response.AppendHeader("Content-Length", sb.ToString());
// Response.ContentType = "text/plain";
// //Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina{DateTime.Now.ToString("yyyyMMddhhmmss").ToString()}.txt\"");
// Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Alta_Banorte_{DdlPeriodo.SelectedItem.Text }.txt\"");
// Response.Write(sb.ToString());
// this.RegistraScript("$('#ModalLayoutBancos').modal('hide');");
// Response.Flush();
// Response.End();
// }
// else
// {
// this.Alert($"Errores {SbErrores.ToString()}", TipoMensaje.ToastAdventencia);
// }
// }
// }
// #endregion
//}
private void CrearLayoutNominaBanorte(DataTable DTNomina, string Emisora)
{
StringBuilder sb = new StringBuilder();
StringBuilder SbErrores = new StringBuilder();
char Cero = '0';
char Espacio = ' ';
bool ErrorProceso = false;
if (DTNomina.Rows.Count > 0)
{
//Tipo Registro A 1 1-1
sb.Append("H");
//Cleve de Servicio A 2 2-3
sb.Append("NE");
//Emisora N 5 4-8
sb.Append(Emisora.PadLeft(5, Cero));
//FechaProceso N 8 9-16
sb.Append(DateTime.Now.ToString("yyyyMMdd"));
//Conmsecutivo N 2 17-18
sb.Append("01");
//Numero Total de Registros N 6 19-24
sb.Append(DTNomina.Rows.Count.ToString().PadLeft(6, Cero));
//Importe Total de Registros N 15 25-39
sb.Append(DTNomina.SUMD("Importe").ToString("0000000000000.00").Replace(".", ""));
//Numero Total altas N 6 40-45
sb.Append("000000");
//Importe Total altas N 15 46-60
sb.Append("000000000000000");
//Numero Total Bajas N 6 61-66
sb.Append("000000");
//Importe Total Bajas N 15 67-81
sb.Append("000000000000000");
//Numero Total de cuentas a verificar N 6 82-87
sb.Append("000000");
//Accion N 1 88-88
sb.Append("0");
//filler 77 89-165
sb.Append(string.Empty.PadLeft(77, Espacio));
if (!ErrorProceso)
{
foreach (DataRow dRow in DTNomina.Rows)
{
// Codigo ReferenciaDelServicio ReferenciaLeyendaDelOrdenante Importe NumeroBancoReceptor TipoCuenta NumeroCuenta TipoMovimiento Accion ImporteIvaOperacion
string Codigo = dRow["Codigo"].ToString().Trim();
string ReferenciaDelServicio = dRow["ReferenciaDelServicio"].ToString().Trim();
string ReferenciaLeyendaDelOrdenante = dRow["ReferenciaLeyendaDelOrdenante"].ToString().Trim();
decimal Importe = dRow["Importe"].ToString().ToDecimal();
string NumeroBancoReceptor = dRow["NumeroBancoReceptor"].ToString().Trim();
string TipoCuenta = dRow["TipoCuenta"].ToString().Trim();
string NumeroCuenta = dRow["NumeroCuenta"].ToString().Trim();
string TipoMovimiento = dRow["TipoMovimiento"].ToString().Trim();
string Accion = dRow["Accion"].ToString().Trim();
string ImporteIvaOperacion = dRow["ImporteIvaOperacion"].ToString().Trim();
//Tipo de registro A 1 1-1
sb.AppendLine("D");
//Fecha Aplicacion N 8 2-9
sb.Append(DateTime.Now.ToString("yyyyMMdd"));
//CodigoEmpleado A 10 10-19
if (ErrorProceso == false && Codigo.Length > 0 && Codigo.Trim().Length <= 10)
{
sb.Append(Codigo.PadLeft(10, Cero));
}
else
{
SbErrores.AppendLine($"{Codigo} Codigo {Codigo} debe de tener una logitud de entre 1 y 10<br/>");
ErrorProceso = true;
}
//ReferenciaDelServicio A 40 20-29
sb.Append(ReferenciaDelServicio.PadLeft(40, Espacio));
//ReferenciaLeyendaDelOrdenante A 40 60-99
sb.Append(ReferenciaLeyendaDelOrdenante.PadLeft(40, Espacio));
//Importe N 15 100-114
sb.Append(Importe.ToString("0000000000000.00").Replace(".", ""));
//NumeroBancoReceptor N 3 115-117
sb.Append(NumeroBancoReceptor.PadLeft(3, Cero));
//TipoCuenta N 2 118-119
sb.Append(TipoCuenta.PadLeft(2, Cero));
//NumeroCuenta N 18 120-137
sb.Append(NumeroCuenta.PadLeft(18, Cero));
//Tipo movimiento N 1 138-138
sb.Append(TipoCuenta.PadLeft(1, Cero));
//Accion N 1 139-139
sb.Append(Accion.PadLeft(1, Espacio));
//ImporteIvaOperacion 140-147
sb.Append(ImporteIvaOperacion.PadLeft(8, Cero));
//filler 18 148-165
sb.Append(string.Empty.PadLeft(77, Espacio));
}
}
if (!ErrorProceso)
{
Response.Clear();
Response.ClearHeaders();
Response.AppendHeader("Content-Length", sb.ToString());
Response.ContentType = "text/plain";
Response.AppendHeader("Content-Disposition", $"attachment;filename=\"Nomina_Banorte_{DdlPeriodo.SelectedItem.Text }.txt\"");
Response.Write(sb.ToString());
this.RegistraScript("$('#ModalLayoutBancos').modal('hide');");
Response.Flush();
Response.End();
}
else
{
this.Alert($"Errores {SbErrores.ToString()}", TipoMensaje.ToastAdventencia);
}
}
}
#endregion
}

File diff suppressed because it is too large Load Diff

View File

@@ -208,8 +208,8 @@ Partial Class PopOCCotizacionesDetalle
End If
For Each dr As GridViewRow In GvDC.Rows
TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble,
dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble,
TieneError = Not objCotizacion.AddCotizacionDetalle(objCotizacion.CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDecimal, dr.DataKey("Cantidad").ToDecimal,
dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToDecimal,
If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1",
dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToString.ToEntero)
If TieneError = True Then Exit For
@@ -230,12 +230,12 @@ Partial Class PopOCCotizacionesDetalle
For Each dr As GridViewRow In GvDC.Rows
If dr.DataKey("CveCotizacionDetalle").ToEntero > 0 Then
TieneError = Not objCotizacion.UpdateCotizacionDetalle(dr.DataKey("CveCotizacionDetalle").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.FCTextBox("txtCantidadSurtir").Text.ToDouble, dr.FCTextBox("txtFechaEntrega").Text, dr.FCTextBox("txtObservacion").Text.ToString)
TieneError = Not objCotizacion.UpdateCotizacionDetalle(dr.DataKey("CveCotizacionDetalle").ToEntero, dr.FCTextBox("TxtPU").Text.ToDecimal, dr.FCTextBox("txtCantidadSurtir").Text.ToDecimal, dr.FCTextBox("txtFechaEntrega").Text, dr.FCTextBox("txtObservacion").Text.ToString)
Else
Dim strTemp = dr.DataKey("CveOrdenCompraDetalle").ToString
If dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDouble > 0 Then
If dr.FCTextBox("TxtPU").Text.ToDouble > 0 Then TieneError = Not objCotizacion.AddCotizacionDetalle(CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDouble, dr.DataKey("Cantidad").ToDouble, dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDouble, If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToEntero)
If dr.FCTextBox("TxtPU").Text.ToDouble > 0 Then TieneError = Not objCotizacion.AddCotizacionDetalle(CveCotizacion, dr.DataKey("CvePS").ToEntero, dr.FCTextBox("TxtPU").Text.ToDecimal, dr.DataKey("Cantidad").ToDecimal, dr.DataKey("CveUnidadMedida").ToEntero, dr.FCTextBox("txtCantidadSurtir").Text.ToString.ToDecimal, If(dr.FCTextBox("txtFechaEntrega").Text.Trim = "" Or dr.FCTextBox("txtFechaEntrega").Text = "__/__/____", "-1", dr.FCTextBox("txtFechaEntrega").Text), dr.FCTextBox("txtObservacion").Text.ToString, dr.DataKey("CveOrdenCompraDetalle").ToEntero)
End If
End If

View File

@@ -1215,7 +1215,9 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) {
ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto'),
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa'),
cvemarca: (!(DdlWS.data('cvemarca')) || DdlWS.data('cvemarca') == '') ? -1 : DdlWS.data('cvemarca'),
esdistribuidor: (!(DdlWS.data('esdistribuidor')) || DdlWS.data('esdistribuidor') == '') ? -1 : DdlWS.data('esdistribuidor')
esdistribuidor: (!(DdlWS.data('esdistribuidor')) || DdlWS.data('esdistribuidor') == '') ? -1 : DdlWS.data('esdistribuidor'),
cveclienteclasificacion: (!(DdlWS.data('cveclienteclasificacion')) || DdlWS.data('cveclienteclasificacion') == '') ? -1 : DdlWS.data('cveclienteclasificacion')
//Metodo: metodo
};

View File

@@ -41,7 +41,7 @@
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
@@ -88,7 +88,7 @@
</div>
<div class="actions">
<div class="btn-group">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div class="row" style="margin-left: 0px; text-align: right" align="left">
<div style="margin-right: 15px">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvRefacturaciones.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvRefacturaciones.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
@@ -103,7 +103,7 @@
<div class="col-md-12">
<asp:GridView ID="GvRefacturaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron solicitudes de cancelación"
DataKeyNames="CveVenta,CveCliente,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,FolioFiscalSustitucion,CveEstatusFactura,RFCReceptor"
DataKeyNames="CveVenta,CveCliente,SerieFolio,Folio,TipoDocto,Nombre,FolioFiscal,Total,SubTotal,CveEstatusFactura,RFCReceptor,CveEstatusRefacturacion,CveVentaSustitucion,TotalSustitucion,RFCReceptorSustitucion,CveClienteSustitucion,FolioFiscalSustitucion,SerieFolioSustitucion"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="99%" OnRowDataBound="GvDatos_RowDataBound">
<Columns>
<asp:BoundField HeaderText="Cliente" DataField="Nombre" ItemStyle-Width="25%" />
@@ -123,10 +123,19 @@
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="35px" HeaderText="Cancelar">
<ItemTemplate>
<asp:LinkButton ID="LnkCancelar" Visible="false" runat="server" OnClick="BtnCancelarDocumento_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-check'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si"></asp:LinkButton>
<div class="row" style="padding-bottom:3px;">
<div class="col-md-12">
<asp:LinkButton ID="LnkCancelar" Visible="false" runat="server" OnClick="BtnCancelarDocumento_Click" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-check'> Factura Pendiente</i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si"></asp:LinkButton>
</div>
</div>
<div class="row">
<div class="col-md-12">
<asp:LinkButton ID="LnkCancelarFolioSustitucion" Visible="false" runat="server" OnClick="LnkCancelarFolioSustitucion_Click" CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-check'> Folio Sustitucion</i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar el documento?" data-btn-ok-label="si"></asp:LinkButton>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField HeaderText="Refacturar" Text="Refacturar" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveDevolucion={0}&NuevaFactura=1" />
<asp:HyperLinkField HeaderText="Refacturar" Text="Refacturar" DataNavigateUrlFields="CveVenta" ItemStyle-Width="100px" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveDevolucion={0}&NuevaFactura=1" />
</Columns>
<RowStyle CssClass="Texto" />
<HeaderStyle CssClass="Titulos" />

View File

@@ -68,9 +68,9 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
}
ObjVentas.Dispose();
GvDatos.DataSource = DtVentas.FiltraParametros("(CveEstatusFactura = 20 AND CveEstatusRefacturacion = 0)");
GvDatos.DataSource = DtVentas.FiltraParametros("(CveEstatusFactura = 20 AND CveEstatusRefacturacion IN (0,4))");
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion IN (1,3) OR (CveEstatusFactura = 20 AND CveEstatusRefacturacion > 0) OR CveEstatusFactura = 23");
var DtRefacturar = DtVentas.FiltraParametros("CveEstatusRefacturacion IN (1,3) OR (CveEstatusFactura = 20 AND CveEstatusRefacturacion IN (1,2,3)) OR CveEstatusFactura = 23");
if (DtRefacturar != null && DtRefacturar.Rows.Count > 0)
{
DivRefacturar.Visible = true;
@@ -177,9 +177,25 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
string Nombre = GvRow.DataKey("Nombre");
string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
int CveMotivoCancelacion = -1;
int CveEstatusRefacturacion = GvRow.DataKey("CveEstatusRefacturacion").ToEntero();
//SI NO SE PUDO CANCELAR, CANCELAR CON EL 02
if (CveEstatusRefacturacion == 4)
{
FolioSustitucion = "";
//CUANDO LAS REFACTURACIONES NO SE PUEDEN CANCELAR, DEBE SER CANCELADO CON EL MOTIVO 02
CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
}
else
{
CveEstatusRefacturacion = 2;
}
if (CveVenta > 0 && Uuid != "")
{
var respCancelacion = CancelarDocumento(CveVenta, -1, CveCliente, Folio, Uuid, "", DateTime.Now, TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusRefacturacion: 2);
var respCancelacion = CancelarDocumento(CveVenta, -1, CveCliente, Folio, Uuid, "", DateTime.Now, TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: FolioSustitucion, CveEstatusRefacturacion: CveEstatusRefacturacion);
if (!respCancelacion.HuboError)
{
@@ -463,7 +479,7 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
retorno.Mensaje = sb.ToString();
return retorno;
}
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false, string FolioSustitucion = "", int CveEstatusRefacturacion = 0)
private Modelos.Factura.MCancelacionVentaMensaje CancelarDocumento(int CveVenta, int CveEstatus, int CveCliente, string Folio, string FolioFiscal, string CancelacionAcuse, DateTime CancelacionFecha, string TipoComprobante, double Total, int CvePACCancelacion, bool EsRefacturacion = false, string FolioSustitucion = "", int CveEstatusRefacturacion = 0, int CveMotivoCancelacion = 0)
{
Modelos.Factura.MCancelacionVentaMensaje retorno = null;
var factura = new Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion: true);
@@ -480,12 +496,22 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
factura.CveEstatusRefacturacion = CveEstatusRefacturacion;
}
if (CveMotivoCancelacion > 0)
{
factura.CveMotivoCancelacion = CveMotivoCancelacion;
}
int CveEstatusFactura = -1;
//SI LA FACTURA YA ESTA CANCELADA, LA ASIGNA YA COMO CANCELADA
if (CveEstatus == 5)
{
CveEstatusFactura = CveEstatus;
}
//NO DEBE DE ASIGNAR ESTATUS
if (CveEstatus == -2)
{
CveEstatusFactura = -1;
}
retorno = factura.CancelarPorRefacturacion(factura.CveMotivoCancelacion, factura.MotivoCancelacion, FolioSustitucion: FolioSustitucion, CveEstatusFacturaAsignado: CveEstatusFactura);
}
@@ -561,6 +587,11 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
if (e.Row.DBCampo("PuedeRefacturar").ToString().ToEntero() == 0 && e.Row.DBCampo("CveEstatusFactura").ToString().ToEntero() == 23 && e.Row.DBCampo("CveVentaSustitucion").ToEntero() > 0)
{
e.Row.FCLinkButton("LnkCancelar").Visible = true;
//SOLO MOSTRAR SI LA FACTURA NUEVA ESTA EMITIDA
if (e.Row.DBCampo("CveEstatusRefacturacion").ToString().ToEntero() != 4 && e.Row.DBCampo("CveEstatusFacturaSustitucion").ToString().ToEntero() == 3)
{
e.Row.FCLinkButton("LnkCancelarFolioSustitucion").Visible = true;
}
}
}
}
@@ -708,40 +739,127 @@ public partial class Ventas_RepCancelacionesPorRespuesta : ClsPaginas
}
protected void LnkCancelarFolioSustitucion_Click(object sender, EventArgs e)
{
//this.HdnLigaRefacturar.Value = "";
this.CveVenta = -1;
//protected void BtnAcuse_Click(object sender, EventArgs e)
//{
// GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
// string UsuarioServicio = "rene.molina@adsistemas.mx";
// string ClaveServicio = "rene2018";
// string UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL";
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
this.CveVenta = GvRow.DataKey("CveVentaSustitucion").ToEntero();
// this.CveVenta = GvRow.DataKey("CveVenta").ToEntero();
int CveCliente = GvRow.DataKey("CveClienteSustitucion").ToEntero();
string Total = GvRow.DataKey("TotalSustitucion");
string RFCReceptor = GvRow.DataKey("RFCReceptorSustitucion");
string TipoDocto = GvRow.DataKey("TipoDocto");
string Nombre = GvRow.DataKey("Nombre");
string FolioSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
string SerieFolioSustitucion = GvRow.DataKey("SerieFolioSustitucion");
// string Uuid = GvRow.DataKey("FolioFiscal");
// decimal Total = GvRow.DataKey("Total").ToDecimal();
// string RFCCliente = GvRow.DataKey("RFCCliente");
// string FolioFiscalSustitucion = GvRow.DataKey("FolioFiscalSustitucion");
// Cancelacion2022.AcuseSat resp = new Cancelacion2022.AcuseSat();
// GoFac.GoCfdi a = new GoFac.GoCfdi();
// a.ObtenerAcuse(UrlServicio, UsuarioActual.Empresa.RFC, UsuarioServicio, ClaveServicio, Uuid);
int CveVentaOriginal = GvRow.DataKey("CveVenta").ToEntero();
string SerieFolioOriginal = GvRow.DataKey("SerieFolio");
// if (a.CodigoError != 0)
// {
// //no se pudo obtener, la mandamos cancelar
// Timbrado ObjCancelacion = new Timbrado();
//CUANDO LAS REFACTURACIONES NO SE PUEDEN CANCELAR, DEBE SER CANCELADO CON EL MOTIVO 02
int CveMotivoCancelacion = get_GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa, CveSATMotivoCancelacion: 2).FiltroPrimeroValor("CveMotivoCancelacion").ToEntero();
// if (ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, Uuid, Total, RFCCliente, UsuarioActual.Empresa.RFC, 4, ValidaFactura:false, CveSATMotivoCancelacion: 1, FolioSustitucion: FolioFiscalSustitucion ))
// {
// string b = ObjCancelacion.CancelacionAcuse;
// //falta actualizar
// Alert("Se regeneró la solicitud de cancelación");
// }
if (CveVenta > 0 && FolioSustitucion != "")
{
var respCancelacion = CancelarDocumento(CveVenta, -2, CveCliente, "", FolioSustitucion, "", DateTime.Now, TipoDocto, Total.ToDouble(), UsuarioActual.Empresa.CvePAC, EsRefacturacion: true, FolioSustitucion: "", CveEstatusRefacturacion: 4, CveMotivoCancelacion: CveMotivoCancelacion);
if (!respCancelacion.HuboError)
{
var sb = new StringBuilder();
var EnviarAcuse = false;
if (respCancelacion.CveEstatus > 0)
{
if (respCancelacion.CveEstatus.Contiene(5, 20))
{
EnviarAcuse = true;
}
// }
var CveEstatus = respCancelacion.CveEstatus;
var ObjVentas = new ClsVentas();
if (ObjVentas.UpdateEstatusVenta(CveVenta, CveEstatus, UsuarioActual.CveEmpresa))
{
if (respCancelacion.CveEstatus == 20)
{
sb.Append($"El estatus de la factura <b>{SerieFolioSustitucion}</b> fue cambiado a 'Cancelación en proceso'.");
sb.Append("El documento se canceló correctamente.");
sb.Append($"</br> <a href='/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=CAN&CVEVTA={CveVenta}")}' class='Texto' target='_blank'>Imprimir Acuse</a>");
}
else if (respCancelacion.CveEstatus == 23)
{
sb.Append("La solicitud de cancelación no la aplicó el SAT, intente cancelar de nuevo.");
}
else if (respCancelacion.CveEstatus == 5)
{
sb.Append($"El estatus de la factura <b>{SerieFolioSustitucion}</b> fue cambiado a 'Cancelada'.");
sb.Append("El documento se canceló correctamente.");
sb.Append($"</br> <a href='/Compras/PopUpVerFactura.aspx?P={Encripta($"OP=CAN&CVEVTA={CveVenta}")}' class='Texto' target='_blank'>Imprimir Acuse</a>");
}
//}
if (respCancelacion.CveEstatus.Contiene(5,20))
{
if (ObjVentas.UpdateEstatusVenta(CveVentaOriginal, 23, UsuarioActual.CveEmpresa, CveEstatusRefacturacion:4, CveMotivoCancelacion: CveMotivoCancelacion))
{
sb.Append($"</br>La Factura <b>{SerieFolioOriginal}</b> fue desligada.");
}
}
}
else
{
sb.Append("Ocurrió un error al cambiar el estatus de la factura.");
}
ObjVentas.Dispose();
if (respCancelacion.CveEstatus == 23)
{
var resp = Timbrado.VerificarVigenciaSAT(FolioSustitucion, UsuarioActual.Empresa.RFC, RFCReceptor, Total, true);
if (resp != null)
{
sb.AppendFormat("<br/> Folio Fiscal: {0} <br/>", FolioSustitucion);
sb.AppendFormat("Código Estado: {0} <br/>", resp.CodigoEstatus);
sb.AppendFormat("Estado: {0} <br/>", resp.Estado);
sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable);
sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion);
}
}
}
else
{
var resp = Timbrado.VerificarVigenciaSAT(FolioSustitucion, UsuarioActual.Empresa.RFC, RFCReceptor, Total, true);
if (resp != null)
{
sb.AppendFormat("Folio Fiscal: {0} <br/>", FolioSustitucion);
sb.AppendFormat("Código Estado: {0} <br/>", resp.CodigoEstatus);
sb.AppendFormat("Estado: {0} <br/>", resp.Estado);
sb.AppendFormat("Es Cancelable: {0} <br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EsCancelable);
sb.AppendFormat("Estatus de Cancelación: {0} <br/><br/>", string.IsNullOrEmpty(resp.EsCancelable) ? "Desconocido" : resp.EstatusCancelacion);
}
sb.Append(respCancelacion.Mensaje);
}
if (EnviarAcuse)
{
sb.Append("</br></br> ¿Desea enviar el Acuse de Cancelación al Cliente?");
Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, "BtnEnviarMailCancelacion();", TextoConfirmacion: "Enviar", TextoSegundoBoton: "Cancelar");
}
else
{
Alert(sb.ToString());
}
}
else
{
Alert(respCancelacion.Mensaje, TipoMensaje.MsgError);
}
CargaDatos();
}
UPDatos.Update();
}
}
public class MRespuestaSAT
{

View File

@@ -3853,7 +3853,7 @@
<asp:Button ID="BtnGeneraAutorizacion" runat="server" Text="Generar Autorización" OnClick="BtnGeneraAutorizacion_Click" Visible="false" ValidationGroup="GrpEmitirImprimir" CssClass="btn myventasbutton btn-primary" data-toggle="confirmation" data-popout="true" data-original-title="¿Seguro que desea generar la autorización?" data-btn-ok-label="si" />
<%--<asp:Button ID="Button2" runat="server" Text="Button" />--%>
<asp:Button ID="BtnGenerarPoliza" runat="server" Text="GenerarPoliza" Visible="false" CssClass="btn myventasbutton btn-primary" />
<asp:Button ID="BtnGenerarPoliza" runat="server" Text="GenerarPoliza" OnClick="BtnGenerarPoliza_Click" Visible="false" CssClass="btn myventasbutton btn-primary" />
<asp:Button ID="BtnGenerarOS" runat="server" Text="Generar OS" Visible="false" CssClass="btn myventasbutton btn-primary" />
<asp:Button ID="BtnEditarCotizacion" runat="server" Text="Actualizar" Visible="false" CssClass="btn myventasbutton btn-primary" />

View File

@@ -1266,6 +1266,14 @@ Partial Class Ventas
ViewState("CveEstatusRefacturacion") = value
End Set
End Property
Private Property RefacturarCancelada As Boolean
Get
Return If(IsNothing(ViewState("RefacturarCancelada")), False, CBool(ViewState("RefacturarCancelada")))
End Get
Set(value As Boolean)
ViewState("RefacturarCancelada") = value
End Set
End Property
Private Property CveEstadoCancelacion As Integer
Get
@@ -4393,10 +4401,13 @@ Partial Class Ventas
'End If
If Not CveEstatus.Contiene(4, 5, 12, 13, 20, 23) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then
If (Not CveEstatus.Contiene(4, 5, 12, 13, 20, 23) OrElse (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4)) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Egs", "Ant") AndAlso UsuarioActual.TienePermisoProceso(159) Then
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
If TienePermiso <> "" Then
LkRefacturacion.Visible = True
If (CveEstatus = 5 AndAlso DbRowVenta("CveEstatusRefacturacion").ToString().ToEntero() = 4) Then
RefacturarCancelada = True
End If
End If
End If
@@ -9106,6 +9117,15 @@ Partial Class Ventas
End If
End If
'MARCAR LA FACTURA ANTERIOR
If (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
If Me.ObjFacturaNC IsNot Nothing Then
If Me.ObjFacturaNC.CveEstatusRefacturacion = 4 AndAlso Not ObjVentas.UpdateEstatusVenta(ObjFacturaNC.CveVenta, ObjFacturaNC.CveEstatusFactura, UsuarioActual.CveEmpresa, CveEstatusRefacturacion:=5) Then
ErrorList.Add("No se actualizó el estatus de la factura anterior.")
End If
End If
End If
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot", "DPe", "PeC", "PA", "Pd2")) Then
ObjVentas.Commit()
@@ -9124,6 +9144,10 @@ Partial Class Ventas
AutoConta = False
End If
If UsuarioActual.CveEmpresa = 140 Then
AutoConta = True
End If
If AutoConta Then
If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(ObjFactura.CvePrePoliza, ObjFactura.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContPaq) Then
@@ -9134,13 +9158,14 @@ Partial Class Ventas
End If
Else
Alert(String.Format("Falta asignación de las siguientes cuentas contables: {0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
End If
Else
If UsuarioActual.Empresa.UsaAC Then
If ObjContPaq IsNot Nothing Then ObjContPaq.Commit()
End If
End If
'If ObjContPaq IsNot Nothing Then ObjContPaq.RollBack()
'RMF, cuando es pedido, se manda autorización.
If ObjFactura.TipoDocto.Contiene("PA") Then
@@ -9156,9 +9181,6 @@ Partial Class Ventas
ViewState("CveVenta") = ObjFactura.CveVenta
If Request("CveEmbarqueManifiesto") IsNot Nothing AndAlso IsNumeric(Request("CveEmbarqueManifiesto")) AndAlso Request("CveEmbarqueManifiesto").ToEntero() > 0 Then
If ObjVentas.Embarque_ManifiestoUpvta(ObjFactura.CveVenta, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveEmbarqueManifiesto").ToEntero()) Then
@@ -9167,7 +9189,6 @@ Partial Class Ventas
End If
GVAnticipos.DataBind()
Try
Dim DirectoriArchivoXML As String = String.Format("{0}{1}", UsuarioActual.Empresa.Ruta, ObjFactura.TipoDocto) ' System.IO.Path.Combine()
If Not Directory.Exists(DirectoriArchivoXML) Then
@@ -9268,7 +9289,7 @@ Partial Class Ventas
'CANCELAR FACTURA ANTERIOR
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
If Me.ObjFacturaNC IsNot Nothing Then
If Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.CveEstatusFactura <> 5 Then
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
MsgCancelacionRefacturacion = Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
End If
@@ -11975,8 +11996,13 @@ Partial Class Ventas
factura.Alfa3 = "DEV"
factura.DevolucionImportePagado = ObjFacturaNC.Total / ObjFacturaNC.PagadoBancos 'falta tomar el dato
End If
Dim tCvePlantillaPoliza As Integer = factura.CvePlantillaPoliza
factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
If UsuarioActual.CveEmpresa = 140 Then
tCvePlantillaPoliza = 1 ' que sea siempre ingreso.
End If
factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", tCvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
Dim RFCReceptor As String = ""
@@ -12162,9 +12188,33 @@ Partial Class Ventas
'Si es devolucion se agregan a la tabla de Vta_VentasDetalleDevolucion
If factura.AplicaDevolucion Then
If Not ObjVentas.AddVentaDetalleDevolucion(Row("CveVentaDetalle").ToString().ToEntero(), ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDouble) Then
Try
Dim EsCargo As Integer = If(Row("EsCargo").ToString() = "True", 1, 0)
If EsCargo = 1 Then
If Me.ObjFacturaNC IsNot Nothing Then
Dim CveVentaDetalleUsado As Integer = -1
For Each RowIng As DataRow In Me.ObjFacturaNC.DtDetalle.Rows
If RowIng("Cantidad").ToString().ToDecimal() = Row("Cantidad").ToString().ToDecimal() AndAlso RowIng("CvePS").ToString().ToEntero() = Row("CvePS").ToString().ToEntero() Then
CveVentaDetalleUsado = RowIng("CveVentaDetalle").ToString().ToEntero()
Exit For
End If
Next
If CveVentaDetalleUsado > 0 Then
If Not ObjVentas.AddVentaDetalleDevolucion(CveVentaDetalleUsado, ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDouble) Then
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
End If
End If
End If
Else
If Not ObjVentas.AddVentaDetalleDevolucion(Row("CveVentaDetalle").ToString().ToEntero(), ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDouble) Then
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
End If
End If
Catch ex As Exception
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
End If
End Try
If ErrorList.Count = 0 Then
If Not ObjEventos.AddEventoBitacora(String.Format("Se aplicó una devolución en Folio: <a href=""/Ventas/Ventas.aspx?CveVenta={0}"" target=""_blank"">{1}</a>", factura.CveVenta, factura.SerieFolio), "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVenta:=CveVentaDevolucion) Then
ErrorList.Add("Ocurrió un error al agregar la bitacora de devolución.")
@@ -20881,129 +20931,134 @@ Partial Class Ventas
'End Sub
Private Sub BtnNuevaFactura_Click(sender As Object, e As EventArgs) Handles LkRefacturacion.Click
'Nos vamos a la nueva factura
Dim script As String = ""
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
Dim sb As New StringBuilder()
If RefacturarCancelada Then
Response.Redirect($"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1")
Else
Dim script As String = ""
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
Dim sb As New StringBuilder()
If Not String.IsNullOrEmpty(FolioFiscal) AndAlso Not (UsuarioActual.Empresa.Funcionalidad(529) = "1") Then
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
If Not String.IsNullOrEmpty(FolioFiscal) AndAlso Not (UsuarioActual.Empresa.Funcionalidad(529) = "1") Then
sb.Append("La factura se encuentra en el siguiente estatus del SAT:<br/>")
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
Dim RFCReceptor As String = LblRFC.Text.Trim
Dim TotalT As Decimal = TxtTotal.Text.ToDecimal
Dim RFCReceptor As String = LblRFC.Text.Trim
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
RFCReceptor = Me.ClienteSucursal.RFC
End If
'SI SE FACTURO LA SUCURSAL DEL CLIENTE TOMA EL RFC DE ESTA
If FacturarSucursal AndAlso Me.ClienteSucursal IsNot Nothing Then
RFCReceptor = Me.ClienteSucursal.RFC
End If
Dim SWatch As New Stopwatch
SWatch.Start()
Dim SWatch As New Stopwatch
SWatch.Start()
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True)
SWatch.Stop()
Dim Vigencia = Timbrado.VerificarVigenciaSAT(FolioFiscal, UsuarioActual.Empresa.RFC, RFCReceptor, TotalT.ToString(), True)
SWatch.Stop()
Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000
SegundosRespuesta = SegundosRespuesta.ToEntero
Dim SegundosRespuesta As Double = SWatch.ElapsedMilliseconds / 1000
SegundosRespuesta = SegundosRespuesta.ToEntero
If SegundosRespuesta >= 5 Then
Alert($"Los servicios de validacion del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastError, "")
End If
If SegundosRespuesta >= 5 Then
Alert($"Los servicios de validacion del SAT presentan lentitud en la respuesta [{ SegundosRespuesta } s].", TipoMensaje.ToastError, "")
End If
If Vigencia IsNot Nothing Then
If Vigencia IsNot Nothing Then
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
If Vigencia.EsCancelable.ToUpper() = "NO CANCELABLE" Then
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
DivRelacionadasRefacturacion.Visible = True
BtnMotivoRefacturacion.Visible = False
DivMotivoRefacturacionTexto.Visible = False
DivRelacionadasRefacturacion.Visible = True
BtnMotivoRefacturacion.Visible = False
DivMotivoRefacturacionTexto.Visible = False
Dim Relacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion)
If Relacionados IsNot Nothing Then
Dim sbExtra As New StringBuilder()
If Relacionados.Codigo = 500 Then
sbExtra.Append("El servicio de verificación de documentos relacionados no esta disponible.")
Else
sbExtra.Append(Relacionados.Mensaje)
Dim Relacionados = Timbrado.ConsultarUUIDRelacionados(UsuarioActual.Empresa, FolioFiscal, UsuarioActual.Empresa.FacturaProduccion)
If Relacionados IsNot Nothing Then
Dim sbExtra As New StringBuilder()
If Relacionados.Codigo = 500 Then
sbExtra.Append("El servicio de verificación de documentos relacionados no esta disponible.")
Else
sbExtra.Append(Relacionados.Mensaje)
Dim SbHijos = New StringBuilder()
Dim SbPadres = New StringBuilder()
Dim SbHijos = New StringBuilder()
Dim SbPadres = New StringBuilder()
'If Relacionados.RelacionadosHijo IsNot Nothing Then
' For Each hijo In Relacionados.RelacionadosHijo
' SbHijos.AppendFormat("{0};", hijo.Uuid)
' Next
' If SbHijos.Length > 0 Then
' SbHijos.Remove(SbHijos.Length - 1, 1)
' End If
'End If
If Relacionados.RelacionadosPadre IsNot Nothing Then
For Each padre In Relacionados.RelacionadosPadre
SbPadres.AppendFormat("{0};", padre.Uuid)
Next
If SbPadres.Length > 0 Then
SbPadres.Remove(SbPadres.Length - 1, 1)
End If
End If
Using ObjVentas As New ClsVentas
'If SbHijos.Length > 0 Then
' If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbHijos.ToString(), UsuarioActual.CveEmpresa) Then
' GvFacturasHijosCancelar.DataSource = ObjVentas.DtResultados.Copy()
'If Relacionados.RelacionadosHijo IsNot Nothing Then
' For Each hijo In Relacionados.RelacionadosHijo
' SbHijos.AppendFormat("{0};", hijo.Uuid)
' Next
' If SbHijos.Length > 0 Then
' SbHijos.Remove(SbHijos.Length - 1, 1)
' End If
'End If
If SbPadres.Length > 0 Then
If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbPadres.ToString(), UsuarioActual.CveEmpresa) Then
GvFacturasPadreRefacturar.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveVenta <> {CveVenta}")
If Relacionados.RelacionadosPadre IsNot Nothing Then
For Each padre In Relacionados.RelacionadosPadre
SbPadres.AppendFormat("{0};", padre.Uuid)
Next
If SbPadres.Length > 0 Then
SbPadres.Remove(SbPadres.Length - 1, 1)
End If
End If
End Using
Using ObjVentas As New ClsVentas
'If SbHijos.Length > 0 Then
' If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbHijos.ToString(), UsuarioActual.CveEmpresa) Then
' GvFacturasHijosCancelar.DataSource = ObjVentas.DtResultados.Copy()
' End If
'End If
If SbPadres.Length > 0 Then
If ObjVentas.GetFacturasRelacionadasPorFolioFiscal(SbPadres.ToString(), UsuarioActual.CveEmpresa) Then
GvFacturasPadreRefacturar.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveVenta <> {CveVenta}")
End If
End If
End Using
'GvFacturasHijosCancelar.DataBind()
GvFacturasPadreRefacturar.DataBind()
End If
If sbExtra.Length > 0 Then
LbExtraRefacturacion.Text = $"<br><b>*{sbExtra.ToString()}</b>"
End If
'GvFacturasHijosCancelar.DataBind()
GvFacturasPadreRefacturar.DataBind()
End If
If sbExtra.Length > 0 Then
LbExtraRefacturacion.Text = $"<br><b>*{sbExtra.ToString()}</b>"
End If
End If
End If
If Vigencia.EsCancelable = "Cancelable sin aceptación" Then
'script = "BtnRefacturacionConfirmarAceptacion();"
Me.CveEstadoCancelacion = 1
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
sb.Append("Está seguro de realizar la refacturación?.")
End If
If Vigencia.EsCancelable = "Cancelable sin aceptación" Then
'script = "BtnRefacturacionConfirmarAceptacion();"
Me.CveEstadoCancelacion = 1
sb.AppendFormat("<b>{0}</b> <br/>", Vigencia.EsCancelable)
sb.Append("Está seguro de realizar la refacturación?.")
End If
If Vigencia.EsCancelable = "Cancelable con aceptación" OrElse String.IsNullOrEmpty(Vigencia.EsCancelable) Then
'script = "BtnRefacturacionConfirmar();"
Me.CveEstadoCancelacion = 2
sb.AppendFormat("<b>{0}</b> <br/>", "Cancelable con aceptación")
sb.Append("Está seguro de cancelar el documento para realizar la refacturación?.")
If Vigencia.EsCancelable = "Cancelable con aceptación" OrElse String.IsNullOrEmpty(Vigencia.EsCancelable) Then
'script = "BtnRefacturacionConfirmar();"
Me.CveEstadoCancelacion = 2
sb.AppendFormat("<b>{0}</b> <br/>", "Cancelable con aceptación")
sb.Append("Está seguro de cancelar el documento para realizar la refacturación?.")
End If
Else
'If Not UsuarioActual.Empresa.FacturaProduccion Then
' script = "BtnRefacturacionConfirmar();"
'End If
sb.Append("<b>No encontrado</b> <br/>")
End If
Else
'If Not UsuarioActual.Empresa.FacturaProduccion Then
' script = "BtnRefacturacionConfirmar();"
'End If
sb.Append("<b>No encontrado</b> <br/>")
'sb.Append("¿Desea realizar la refacturación?<br/>")
script = "BtnRefacturacionConfirmarAceptacion();"
End If
Else
'sb.Append("¿Desea realizar la refacturación?<br/>")
script = "BtnRefacturacionConfirmarAceptacion();"
LblEstatusRefacturacion.Text = sb.ToString()
UpMotivoRefac.Update()
RegistraScript("$('#DivMotivoRefacturacion').modal({ backdrop: 'static', keyboard: false });", "R1")
'Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, JSBtnAceptar:=script, TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
End If
LblEstatusRefacturacion.Text = sb.ToString()
UpMotivoRefac.Update()
RegistraScript("$('#DivMotivoRefacturacion').modal({ backdrop: 'static', keyboard: false });", "R1")
'Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, JSBtnAceptar:=script, TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
End If
End Sub
Private Sub BtnMotivoRefacturacion_Click(sender As Object, e As System.EventArgs) Handles BtnMotivoRefacturacion.Click
@@ -21753,7 +21808,7 @@ Partial Class Ventas
DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", If(DdlMoneda.SelectedValue.ToEntero() <= 0, 1, DdlMoneda.SelectedValue.ToEntero())))
Else
@@ -29656,6 +29711,11 @@ Partial Class Ventas
CargaVendedores()
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
TbDescuentosRNC.Visible = True
LnkDescuentosRNC.Visible = UsuarioActual.TienePermisoProceso(328)
End If
UpPS.Update()
UPPDescuento.Update()
UPObservaciones.Update()
@@ -31529,6 +31589,11 @@ Partial Class Ventas
End Function
Private Sub EmitirDocumentoNuevo(TipoDoctoNuevo As String)
If DdlVendedor.SelectedValue.ToEntero() <= 0 AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoDoctoNuevo = "Ing" Then
Alert("Debe seleccionar un vendedor.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If (FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso String.IsNullOrEmpty(Me.ClienteSucursal.RFC))) Then
Alert("La sucursal no tiene asignada un RFC.", TipoMensaje.MsgAdvertencia)
Exit Sub
@@ -34374,5 +34439,38 @@ Partial Class Ventas
UpEmitirTransitorio.Update()
End Sub
#End Region
Protected Sub BtnGenerarPoliza_Click(sender As Object, e As EventArgs)
CreaObjetosVenta()
Dim ObjAC As New ClsContPAQi(UsuarioActual.Empresa)
Dim Msgok As New StringBuilder
If ObjFactura.TipoDocto.Contiene("Ing", "Egs", "OP", "Com") Then
Dim IDPoliza As Modelos.RetornoPolizaConta = GenerarPolizaAC(ObjAC, ObjFactura)
If IDPoliza.IdPoliza > 0 Then
Dim ObjVentas As New ClsVentas
If ObjVentas.UpdateVentaPrePoliza(IDPoliza.IdPoliza, IDPoliza.FolioPoliza, CvePrePoliza, CveVenta, UsuarioActual.CveEmpresa) Then
'Si se facturó la cotización hay que vincular la venta
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
End If
ObjVentas.Dispose()
'Si se facturó la cotización hay que vincular la venta
Msgok.AppendFormat("Abono Registrado Correctamente.<br/><br/> <a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' target='_blank' class='Texto'>Ver Poliza</a>", IDPoliza)
Else
ErrorList.Add("Ocurrió un error al generar A.C. en la Factura.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If
Else
Msgok.Append("Movimiento Registrado Correctamente.<br/><br/> ")
End If
ObjAC.dispose
End Sub
End Class