Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
@@ -929,7 +929,8 @@ Public Class ClsAcumuladores
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
|
||||||
CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1) As Boolean
|
CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1,
|
||||||
|
Optional CveVentaBonificacion As Integer = -1, Optional FacturadoBonificacion As Boolean = False) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
'Data = New DataTable
|
'Data = New DataTable
|
||||||
|
|
||||||
@@ -947,6 +948,8 @@ Public Class ClsAcumuladores
|
|||||||
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
||||||
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
|
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
|
||||||
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
.Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
|
||||||
|
.Add("@CveVentaBonificacion", SqlDbType.Int).Value = CveVentaBonificacion
|
||||||
|
.Add("@FacturadoBonificacion", SqlDbType.Bit).Value = FacturadoBonificacion
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -4324,6 +4324,7 @@ Public Class ClsPaginas
|
|||||||
PaginaDict.Add("/OC/OCPendientes.aspx".ToUpper(), -1)
|
PaginaDict.Add("/OC/OCPendientes.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/Sistemas/Registro.aspx".ToUpper(), -1)
|
PaginaDict.Add("/Sistemas/Registro.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/Sistemas/WizardRegistro.aspx".ToUpper(), -1)
|
PaginaDict.Add("/Sistemas/WizardRegistro.aspx".ToUpper(), -1)
|
||||||
|
PaginaDict.Add("/Sistemas/ListadoReportes.aspx".ToUpper(), 702)
|
||||||
PaginaDict.Add("/Ventas/VentasRene.aspx".ToUpper(), -1)
|
PaginaDict.Add("/Ventas/VentasRene.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/Contratos/Contrato2.aspx".ToUpper(), -1)
|
PaginaDict.Add("/Contratos/Contrato2.aspx".ToUpper(), -1)
|
||||||
PaginaDict.Add("/Flotillas/CatMantenimientos.aspx".ToUpper(), -1)
|
PaginaDict.Add("/Flotillas/CatMantenimientos.aspx".ToUpper(), -1)
|
||||||
@@ -6962,7 +6963,8 @@ Public Class ClsPaginas
|
|||||||
' GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
' GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||||
' End Try
|
' End Try
|
||||||
'End Sub
|
'End Sub
|
||||||
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing) As Byte()
|
|
||||||
|
Public Function PdfFactura(ByRef Vta As Modelos.Factura, Optional AplicaPagare As String = "0", Optional Guardar As Boolean = True, Optional SubReportData As Modelos.MSubReportData = Nothing, Optional UsarStimulsoft As Boolean = False) As Byte()
|
||||||
Dim retorno As Byte() = Nothing
|
Dim retorno As Byte() = Nothing
|
||||||
|
|
||||||
' Dim ObjVentas As New ClsVentas
|
' Dim ObjVentas As New ClsVentas
|
||||||
@@ -7789,46 +7791,52 @@ Public Class ClsPaginas
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Archivo As New System.IO.FileInfo(RutaFormato)
|
If Not UsarStimulsoft Then
|
||||||
If Archivo.Exists Then
|
Dim Archivo As New System.IO.FileInfo(RutaFormato)
|
||||||
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
If Archivo.Exists Then
|
||||||
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||||
' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||||
'Else
|
' retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||||
' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
'Else
|
||||||
'End If
|
' retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
||||||
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
'End If
|
||||||
|
retorno = StreamPDF(RutaFormato, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||||
|
|
||||||
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
|
Dim ArchivoPDF As New System.IO.FileInfo(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio))
|
||||||
If Guardar Then
|
If Guardar Then
|
||||||
If Not ArchivoPDF.Exists Then
|
If Not ArchivoPDF.Exists Then
|
||||||
Try
|
Try
|
||||||
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
DirectoryExistsCreate(String.Format("{0}PDF", UsuarioActual.Empresa.Ruta))
|
||||||
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
DirectoryExistsCreate(String.Format("{0}PDF\{1}", UsuarioActual.Empresa.Ruta, Vta.TipoDocto))
|
||||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||||
End Try
|
End Try
|
||||||
Else
|
Else
|
||||||
Try
|
Try
|
||||||
ArchivoPDF.Delete()
|
ArchivoPDF.Delete()
|
||||||
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
File.WriteAllBytes(String.Format("{0}PDF\{1}\{2}.pdf", UsuarioActual.Empresa.Ruta, Vta.TipoDocto, Vta.SerieFolio), retorno)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
Alert("Ocurrió un error al generar el PDF", TipoMensaje.MsgAdvertencia)
|
||||||
End Try
|
End Try
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
||||||
|
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
||||||
|
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
||||||
|
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||||
|
' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||||
|
'Else
|
||||||
|
' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
||||||
|
'End If
|
||||||
|
retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
|
RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
||||||
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
|
retorno = StreamBytesStimulsoft("Facturas", RutaFormato, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
||||||
'If UsuarioActual.Empresa.Funcionalidad(350) = "1" Then
|
|
||||||
' RutaFormato = RutaFormato.Replace(".rdlc", ".mrt")
|
|
||||||
' retorno = StreamBytesStimulsoft("Facturas", RutaFormatoDefault, lrds, params, NombreArchivo:=NombreArchivo, Formato:="PDF")
|
|
||||||
'Else
|
|
||||||
' retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing)
|
|
||||||
'End If
|
|
||||||
retorno = StreamPDF(RutaFormatoDefault, lrds, params, NombreArchivo, "PDF", MR:=Nothing, SubReportData:=SubReportData)
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
GuardaLog(String.Format("Ocurrio un error al generar el reporte RLDC {0}", ex))
|
||||||
End Try
|
End Try
|
||||||
@@ -7864,9 +7872,12 @@ Public Class ClsPaginas
|
|||||||
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
|
If Not RutaReporte.ToUpper().StartsWith(bdir.ToUpper()) Then
|
||||||
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
|
RutaReporte = String.Format("{0}{1}", bdir, RutaReporte)
|
||||||
End If
|
End If
|
||||||
|
Dim urlHost As String = "http://localhost:2202/"
|
||||||
|
If EsProduccion Then
|
||||||
|
urlHost = "http://sig.adssistemas.mx:6599/"
|
||||||
|
End If
|
||||||
'SITIO DE PRUEBA EN IIS
|
'SITIO DE PRUEBA EN IIS
|
||||||
Dim Url = New Uri(String.Format("{0}{1}", "http://localhost:2202/", Opcion))
|
Dim Url = New Uri(String.Format("{0}{1}", urlHost, Opcion))
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim dataSourceArray As New JArray()
|
Dim dataSourceArray As New JArray()
|
||||||
@@ -7883,6 +7894,7 @@ Public Class ClsPaginas
|
|||||||
Dim payload As New JObject(
|
Dim payload As New JObject(
|
||||||
New JProperty("formato", Formato),
|
New JProperty("formato", Formato),
|
||||||
New JProperty("ruta", RutaReporte),
|
New JProperty("ruta", RutaReporte),
|
||||||
|
New JProperty("UsarFormatoCompilado", false),
|
||||||
New JProperty("parametros", paramsArray),
|
New JProperty("parametros", paramsArray),
|
||||||
New JProperty("dataSource", dataSourceArray)
|
New JProperty("dataSource", dataSourceArray)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
Timbre = New CFDITimbre
|
Timbre = New CFDITimbre
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "", Optional EsCancelacion As Boolean = False, Optional CargaDTDetalle As Boolean = True, Optional CargaDatosCliente As Boolean = True, Optional CargaDatosRelacionados As Boolean = True)
|
Public Sub New(UsuarioActual As Usuario, CveVenta As Integer, CveEmpresa As Integer, Optional DirectorioServidor As String = "", Optional EsCancelacion As Boolean = False, Optional CargaDTDetalle As Boolean = True, Optional CargaDatosCliente As Boolean = True, Optional CargaDatosRelacionados As Boolean = True, Optional VerificaAlmacen As Boolean = True)
|
||||||
Me.UsuarioActual = UsuarioActual
|
Me.UsuarioActual = UsuarioActual
|
||||||
Me.CveVenta = CveVenta
|
Me.CveVenta = CveVenta
|
||||||
Me.CveEmpresa = CveEmpresa
|
Me.CveEmpresa = CveEmpresa
|
||||||
@@ -391,7 +391,7 @@ Namespace Modelos
|
|||||||
IniciaValores()
|
IniciaValores()
|
||||||
|
|
||||||
Dim ObjVentas As New ClsVentas()
|
Dim ObjVentas As New ClsVentas()
|
||||||
If ObjVentas.GetVenta(CveVenta, CveEmpresa) Then
|
If ObjVentas.GetVenta(CveVenta, CveEmpresa, VerificaAlmacen:=VerificaAlmacen) Then
|
||||||
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
|
||||||
setValues(ObjVentas.DtResultados.Rows(0))
|
setValues(ObjVentas.DtResultados.Rows(0))
|
||||||
|
|
||||||
@@ -2101,21 +2101,34 @@ Namespace Modelos
|
|||||||
Case "Egs"
|
Case "Egs"
|
||||||
CveConcepto = 6
|
CveConcepto = 6
|
||||||
End Select
|
End Select
|
||||||
|
'SI ES FACTURA,NC,DEV O ES RNC DE CARGO, CANCELAR MOVIMIENTOS
|
||||||
|
If factura.TipoDocto.Contiene("Ing", "Dev", "Egs") OrElse factura.TipoDocto.Contiene("RNC") AndAlso factura.Num1 = 1 Then
|
||||||
|
If ObjAcum.DistribuidorMovtosGet(factura.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=factura.CveVenta, CveConcepto:=CveConcepto) Then
|
||||||
|
Dim DtMovimientos As DataTable = ObjAcum.DtResultados.FiltraParametros("Cantidad > 0")
|
||||||
|
If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
|
||||||
|
For Each RowSalida As DataRow In DtMovimientos.Rows
|
||||||
|
Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
|
||||||
|
|
||||||
If ObjAcum.DistribuidorMovtosGet(factura.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=factura.CveVenta, CveConcepto:=CveConcepto) Then
|
Dim FacturadoBonificacion = False
|
||||||
Dim DtMovimientos As DataTable = ObjAcum.DtResultados.FiltraParametros("Cantidad > 0")
|
Dim CveVentaBonificacion As Integer = -1
|
||||||
If DtMovimientos IsNot Nothing AndAlso DtMovimientos.Rows.Count > 0 Then
|
|
||||||
For Each RowSalida As DataRow In DtMovimientos.Rows
|
|
||||||
Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
|
|
||||||
|
|
||||||
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
|
If factura.TipoDocto = "RNC" Then
|
||||||
Retorno = False
|
CveVentaBonificacion = RowSalida("CveVentaBonificacion").ToString().ToEntero()
|
||||||
Exit For
|
FacturadoBonificacion = CBool(RowSalida("FacturadoBonificacion").ToString())
|
||||||
End If
|
End If
|
||||||
Next
|
|
||||||
DtMovimientos.Dispose()
|
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha, CveVentaBonificacion:=CveVentaBonificacion, FacturadoBonificacion:=FacturadoBonificacion) Then
|
||||||
|
Retorno = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
DtMovimientos.Dispose()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
@@ -2217,7 +2230,7 @@ Namespace Modelos
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CancelarInventarioUsado(factura As Modelos.Factura, CveAlmacenUsado As Integer, CveMovimientoEntrada As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Integer
|
Private Function CancelarInventarioUsado(factura As Modelos.Factura, CveAlmacenUsado As Integer, CveMovimientoEntrada As Integer, ByRef ObjInventario As ClsInventarios, ByRef ObjConta As ClsContabilidad, Optional GenerarPrePoliza As Boolean = True) As Integer
|
||||||
Dim CveMovimiento As Integer = -1
|
Dim CveMovimiento As Integer = -1
|
||||||
Try
|
Try
|
||||||
Dim CveConceptoSalidaUsado As Integer = 45
|
Dim CveConceptoSalidaUsado As Integer = 45
|
||||||
@@ -2240,7 +2253,7 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If CveMovimiento > 0 Then
|
If GenerarPrePoliza AndAlso CveMovimiento > 0 Then
|
||||||
Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio
|
Dim Concepto As String = "Cancelación Usado" & factura.SerieFolio
|
||||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza = ObjConta.AddPrePolizas("Mod/CancSalUsados", 74, DtMovimientosEntrada.SUMD("Total"), DtMovimientosEntrada.SUMD("Total"), 1, tFecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
|
||||||
@@ -2498,7 +2511,7 @@ Namespace Modelos
|
|||||||
Dim TipoMovto68 = TipoMovimiento
|
Dim TipoMovto68 = TipoMovimiento
|
||||||
'SI ES CANCELACION DEBE GENERAR EL MOVIMIENTO DE SALIDA DE USADOS
|
'SI ES CANCELACION DEBE GENERAR EL MOVIMIENTO DE SALIDA DE USADOS
|
||||||
If ValorMultiplicador = -1 Then
|
If ValorMultiplicador = -1 Then
|
||||||
CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta)
|
CveMovimientoReferencia = CancelarInventarioUsado(ObjFactura, CveAlmacen, CveMovimiento, ObjInventario, ObjConta, GenerarPrePoliza:=False)
|
||||||
Else
|
Else
|
||||||
CveMovimientoReferencia = CveMovimiento
|
CveMovimientoReferencia = CveMovimiento
|
||||||
End If
|
End If
|
||||||
@@ -5675,6 +5688,11 @@ Namespace Modelos
|
|||||||
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||||
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
|
DtMovRemision = ObjInventario.DtResultados.FiltraParametros("CveTipoAlmacen = 10")
|
||||||
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero()
|
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 1").ToString().ToEntero()
|
||||||
|
'SI ES SERVICIO A DOMICILIO DEBE REGRESAR A ESTE TIPO DE ALMACEN
|
||||||
|
If Me.ServicioDomicilio Then
|
||||||
|
CveAlmacenGeneral = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 29").ToString().ToEntero()
|
||||||
|
End If
|
||||||
|
|
||||||
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero()
|
CveAlmacenExA = ObjInventario.DtResultados.FiltroPrimeroValor("CveAlmacen", "CveTipoAlmacen = 10").ToString().ToEntero()
|
||||||
|
|
||||||
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
|
CveMovimientoUsado = ObjInventario.DtResultados.FiltroPrimeroValor("CveMovimiento", "CvePS IS NULL AND CveConcepto = 42").ToEntero()
|
||||||
|
|||||||
@@ -1082,7 +1082,9 @@ Partial Class PopUpVerFactura
|
|||||||
Dim AplicaPagare As String = If(UrlParametros("PAG") IsNot Nothing AndAlso UrlParametros("PAG").ToString <> "", UrlParametros("PAG").ToString, "0")
|
Dim AplicaPagare As String = If(UrlParametros("PAG") IsNot Nothing AndAlso UrlParametros("PAG").ToString <> "", UrlParametros("PAG").ToString, "0")
|
||||||
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
|
Dim Guardar As Boolean = UrlParametros("GUARDAR") IsNot Nothing AndAlso UrlParametros("GUARDAR").ToString() = "1"
|
||||||
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
|
Dim RegenerarPDF As Boolean = UrlParametros("REGENERAR") IsNot Nothing AndAlso UrlParametros("REGENERAR").ToString() = "1"
|
||||||
imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF)
|
Dim STIMULSOFT As Boolean = UrlParametros("STIMULSOFT") IsNot Nothing AndAlso UrlParametros("STIMULSOFT").ToString() = "1"
|
||||||
|
|
||||||
|
imprimirFacturaVenta(UrlParametros("CVEVENTA").ToString.ToEntero, AplicaPagare, GuardarPDF:=Guardar, RegenerarPDF:=RegenerarPDF, UsarStimulsoft:=STIMULSOFT)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2697,7 +2699,7 @@ Partial Class PopUpVerFactura
|
|||||||
Archivo = Nothing
|
Archivo = Nothing
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False)
|
Public Sub imprimirFacturaVenta(CveVenta As Integer, AplicaPagare As String, Optional GuardarPDF As Boolean = False, Optional RegenerarPDF As Boolean = False, Optional UsarStimulsoft As Boolean = False)
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
Dim Vta As Modelos.Factura = Nothing
|
Dim Vta As Modelos.Factura = Nothing
|
||||||
|
|
||||||
@@ -2726,7 +2728,7 @@ Partial Class PopUpVerFactura
|
|||||||
Dim Archivo As New System.IO.FileInfo(PathArchivo)
|
Dim Archivo As New System.IO.FileInfo(PathArchivo)
|
||||||
|
|
||||||
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
|
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
|
||||||
If Not Archivo.Exists OrElse RegenerarPDF Then
|
If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimulsoft Then
|
||||||
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
|
Vta.MonedaAbreviatura = dtVentas(0)("Abreviatura").ToString
|
||||||
'se rellena la sucursal
|
'se rellena la sucursal
|
||||||
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
|
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
|
||||||
@@ -3031,7 +3033,7 @@ Partial Class PopUpVerFactura
|
|||||||
Dim CveTimbreCartaPorteVenta As Integer = -1
|
Dim CveTimbreCartaPorteVenta As Integer = -1
|
||||||
Dim CartaPorte As Modelos.MSubReportData = Nothing
|
Dim CartaPorte As Modelos.MSubReportData = Nothing
|
||||||
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
|
'SI EL ARCHIVO NO EXISTE O SE VA REGENERA EL PDF, SE DEBEN LLENAR LOS DATOS
|
||||||
If Not Archivo.Exists OrElse RegenerarPDF Then
|
If Not Archivo.Exists OrElse RegenerarPDF OrElse UsarStimulsoft Then
|
||||||
If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Ing" Then
|
If UsuarioActual.CveEmpresa = 13 AndAlso Vta.TipoDocto = "Ing" Then
|
||||||
Using ObjGral As New ClsGenerales
|
Using ObjGral As New ClsGenerales
|
||||||
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
|
If ObjGral.GetGralTimbre(-1, "Ing", MinFecha, MaxFecha, 0, UsuarioActual.CveEmpresa, -1, CveVenta:=CveVenta) AndAlso ObjGral.DtResultados.Rows.Count > 0 Then
|
||||||
@@ -3049,37 +3051,42 @@ Partial Class PopUpVerFactura
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Archivo.Exists Then
|
If UsarStimulsoft Then
|
||||||
If RegenerarPDF Then
|
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte, UsarStimulsoft:=UsarStimulsoft), Vta.SerieFolio, "PDF")
|
||||||
Archivo.Delete()
|
Else
|
||||||
|
If Archivo.Exists Then
|
||||||
|
If RegenerarPDF Then
|
||||||
|
Archivo.Delete()
|
||||||
|
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
||||||
|
GeneraPDFVtaPyMe(Vta, "PDF")
|
||||||
|
Else
|
||||||
|
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
|
||||||
|
Vta = Nothing
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
HttpContext.Current.Response.Clear()
|
||||||
|
HttpContext.Current.Response.ClearContent()
|
||||||
|
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf")
|
||||||
|
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
|
||||||
|
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
||||||
|
HttpContext.Current.Response.TransmitFile(PathArchivo)
|
||||||
|
'HttpContext.Current.Response.Flush()
|
||||||
|
HttpContext.Current.Response.End()
|
||||||
|
Archivo = Nothing
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
|
||||||
|
'04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME
|
||||||
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
||||||
GeneraPDFVtaPyMe(Vta, "PDF")
|
GeneraPDFVtaPyMe(Vta, "PDF")
|
||||||
Else
|
Else
|
||||||
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=True, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
|
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
|
||||||
Vta = Nothing
|
Vta = Nothing
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
HttpContext.Current.Response.Clear()
|
|
||||||
HttpContext.Current.Response.ClearContent()
|
|
||||||
HttpContext.Current.Response.ContentType = If(IO.Path.GetExtension(Archivo.Name) = ".txt", "text/plain", "application/pdf")
|
|
||||||
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment; filename=" & Archivo.Name)
|
|
||||||
HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
|
|
||||||
HttpContext.Current.Response.TransmitFile(PathArchivo)
|
|
||||||
'HttpContext.Current.Response.Flush()
|
|
||||||
HttpContext.Current.Response.End()
|
|
||||||
Archivo = Nothing
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
|
|
||||||
'04/05/2018 - Se agrega seccion pruebas para generar factura venta .mrt para PyME
|
|
||||||
If UsuarioActual.Empresa.CvePlataforma = 2 Then
|
|
||||||
GeneraPDFVtaPyMe(Vta, "PDF")
|
|
||||||
Else
|
|
||||||
ImprimirbytesPDF(PdfFactura(Vta, AplicaPagare:=AplicaPagare, Guardar:=Guardar, SubReportData:=CartaPorte), Vta.SerieFolio, "PDF")
|
|
||||||
Vta = Nothing
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -2278,7 +2278,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Me.ObjFactura = Nothing
|
Me.ObjFactura = Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
|
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=ModExtensiones.DirectorioBaseEmpresas, CargaDatosCliente:=False, CargaDatosRelacionados:=False, VerificaAlmacen:=False)
|
||||||
|
|
||||||
If Me.ObjFactura IsNot Nothing Then
|
If Me.ObjFactura IsNot Nothing Then
|
||||||
|
|
||||||
|
|||||||
81
Sistemas/ListadoReportes.aspx
Normal file
81
Sistemas/ListadoReportes.aspx
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ListadoReportes.aspx.cs" Inherits="Sistemas_ListadoReportes" %>
|
||||||
|
|
||||||
|
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||||
|
Listado de reportes de Stimulsoft
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="portlet light smmallpadding traspasorow bordered">
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption font-green">
|
||||||
|
<span class="caption-subject bold uppercase" style="line-height: 1;">Listado de formatos</span>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<div class="btn-group">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body rowpadding">
|
||||||
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron formatos" DataKeyNames="RutaReporte"
|
||||||
|
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" data-sort="true" GridLines="None" Width="100%">
|
||||||
|
<Columns>
|
||||||
|
<asp:BoundField HeaderText="Formato" DataField="Reporte" ItemStyle-Width="80%" />
|
||||||
|
<asp:TemplateField HeaderText="Editar" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton runat="server" ID="BtnEditar" OnClick="BtnEditar_Click" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea editar el formato?" data-btn-ok-label="si"></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
<RowStyle CssClass="Texto" />
|
||||||
|
<HeaderStyle CssClass="Titulos" />
|
||||||
|
</asp:GridView>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
</asp:Content>
|
||||||
|
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
function openWindow(url) {
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.target = "_blank";
|
||||||
|
form.method = "POST";
|
||||||
|
form.action = url;
|
||||||
|
form.style.display = "none";
|
||||||
|
|
||||||
|
//for (var key in data) {
|
||||||
|
// var input = document.createElement("input");
|
||||||
|
// input.type = "hidden";
|
||||||
|
// input.name = key;
|
||||||
|
// input.value = data[key];
|
||||||
|
// form.appendChild(input);
|
||||||
|
//}
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
document.body.removeChild(form);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
46
Sistemas/ListadoReportes.aspx.cs
Normal file
46
Sistemas/ListadoReportes.aspx.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using static Extensiones.ModExtensiones;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.UI;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
|
|
||||||
|
public partial class Sistemas_ListadoReportes : ClsPaginas
|
||||||
|
{
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
CargaDatos();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CargaDatos()
|
||||||
|
{
|
||||||
|
string RutaReportes = string.Format("{0}/Formatos", UsuarioActual.Empresa.Ruta);
|
||||||
|
|
||||||
|
string[] allfiles = Directory.GetFiles(RutaReportes, "*.mrt", SearchOption.AllDirectories);
|
||||||
|
|
||||||
|
GvDatos.DataSource = (from Reporte in allfiles
|
||||||
|
let file = new FileInfo(Reporte)
|
||||||
|
select new { RutaReporte = file.FullName, Reporte = file.Name.Replace(".mrt","") }).QueryToDataTable(true);
|
||||||
|
GvDatos.DataBind();
|
||||||
|
UPDatos.Update();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void BtnEditar_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||||
|
var RutaReporteEncriptada = Encripta(GvRow.DataKey("RutaReporte"));
|
||||||
|
var hostURL = "https://localhost:7162";
|
||||||
|
if (UsuarioActual.Empresa.FacturaProduccion)
|
||||||
|
{
|
||||||
|
hostURL = "http://sig.adssistemas.mx:6599";
|
||||||
|
}
|
||||||
|
var strURL = $"{hostURL}/Designer/EditReport?P={RutaReporteEncriptada}";
|
||||||
|
|
||||||
|
RegistraScript($"openWindow('{strURL}');");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -200,6 +200,12 @@
|
|||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="HplDownPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir PDF</asp:HyperLink>
|
<asp:HyperLink ID="HplDownPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir PDF</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:HyperLink ID="HplRenerarPDF" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Regenerar PDF</asp:HyperLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:HyperLink ID="HplImprimirPDFStimulsoft" Target="_blank" runat="server" Visible="false"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> Imprimir PDF Stimulsoft</asp:HyperLink>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:HyperLink ID="ImgDownCancelacion" Target="_blank" ToolTip="Descarga Acuse Cancelación" Visible="false" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir Acuse Cancelación</asp:HyperLink>
|
<asp:HyperLink ID="ImgDownCancelacion" Target="_blank" ToolTip="Descarga Acuse Cancelación" Visible="false" runat="server"><i class="fa fa-ad-pdf"></i> Imprimir Acuse Cancelación</asp:HyperLink>
|
||||||
</li>
|
</li>
|
||||||
@@ -282,8 +288,8 @@
|
|||||||
<asp:LinkButton ID="LkbRetiro" runat="server" OnClick="LkbRetiro_Click" Visible="false"> <i class="fa fa-ad-excel"></i> Retiro de Efectivo</asp:LinkButton>
|
<asp:LinkButton ID="LkbRetiro" runat="server" OnClick="LkbRetiro_Click" Visible="false"> <i class="fa fa-ad-excel"></i> Retiro de Efectivo</asp:LinkButton>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LnkUUIDRelacionados" runat="server" CausesValidation="False" Text="<i class='fa fa-pencil'></i> UUID Relacionados" OnClick="LnkUUIDRelacionados_Click" Visible="false" />
|
<asp:LinkButton ID="LnkUUIDRelacionados" runat="server" CausesValidation="False" Text="<i class='fa fa-pencil'></i> UUID Relacionados" OnClick="LnkUUIDRelacionados_Click" Visible="false" />
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<asp:LinkButton ID="LBCancelarPedido" runat="server" CausesValidation="False" CommandName="Delete" Text="<i class='fa fa-ban'></i> Cancelar Pedido" OnClick="LBCancelarPedido_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Estás seguro que deseas cancelar el Pedido?" data-btn-ok-label="si" Visible="false" />
|
<asp:LinkButton ID="LBCancelarPedido" runat="server" CausesValidation="False" CommandName="Delete" Text="<i class='fa fa-ban'></i> Cancelar Pedido" OnClick="LBCancelarPedido_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Estás seguro que deseas cancelar el Pedido?" data-btn-ok-label="si" Visible="false" />
|
||||||
@@ -7788,17 +7794,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
|
<div class="row" style="margin-left: 0px; text-align: right" align="left">
|
||||||
|
<div style="margin-right: 15px">
|
||||||
|
<input type="text" id="TxtBusquedaNCCargos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tools">
|
<div class="tools">
|
||||||
<a href="javascript:;" class="collapse"></a>
|
<%-- <a href="javascript:;" class="collapse"></a>--%>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
<div class="portlet-body form-horizontal form-row-sepe formnombottom">
|
||||||
<div class="row" style="margin-right: 10px;" align="right">
|
|
||||||
<input type="text" id="TxtBusquedaNCCargos" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaNCCargos','{0}')", GvDescNCCargos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12" style="max-height: 440px; overflow: auto">
|
<div class="col-md-12" style="max-height: 440px; overflow: auto">
|
||||||
<asp:GridView ID="GvDescNCCargos" runat="server" AutoGenerateColumns="False"
|
<asp:GridView ID="GvDescNCCargos" runat="server" AutoGenerateColumns="False"
|
||||||
|
|||||||
@@ -8905,6 +8905,13 @@ Partial Class Ventas
|
|||||||
If (Archivo.Exists Or Archivo2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
|
If (Archivo.Exists Or Archivo2.Exists) And IfNull(CveVenta, 0).ToString().ToEntero() > 0 Then
|
||||||
HplDownPDF.Visible = True
|
HplDownPDF.Visible = True
|
||||||
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
HplDownPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||||
|
If UsuarioActual.CveRol = 1 Then
|
||||||
|
HplRenerarPDF.Visible = True
|
||||||
|
HplRenerarPDF.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1®ENERAR=1", CveVenta)))
|
||||||
|
|
||||||
|
HplImprimirPDFStimulsoft.Visible = True
|
||||||
|
HplImprimirPDFStimulsoft.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=0&STIMULSOFT=1", CveVenta)))
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'NO DEBE IMPRIMIR PDF DE COTIZACION
|
'NO DEBE IMPRIMIR PDF DE COTIZACION
|
||||||
@@ -19242,22 +19249,28 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ListaDescuentos.Count > 0 Then
|
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ListaDescuentos.Count > 0 Then
|
||||||
TxtObsFact.Text = ""
|
|
||||||
Dim Titulo As String = ListaDescuentos.FirstOrDefault().NombrePromo
|
Dim Titulo As String = ListaDescuentos.FirstOrDefault().NombrePromo
|
||||||
Dim strPromos As New StringBuilder
|
Dim strPromos As New StringBuilder
|
||||||
If Not String.IsNullOrEmpty(Titulo) Then
|
If Not String.IsNullOrEmpty(Titulo) Then
|
||||||
|
|
||||||
For Each Promo As Descuentos In ListaDescuentos
|
For Each Promo As Descuentos In ListaDescuentos
|
||||||
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
|
If Not String.IsNullOrEmpty(Promo.ObsDescuento) Then
|
||||||
|
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If strPromos.Length > 2 Then
|
If strPromos.Length > 2 Then
|
||||||
strPromos.Remove(strPromos.Length - 2, 2)
|
strPromos.Remove(strPromos.Length - 2, 2)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If strPromos.Length > 0 Then
|
||||||
|
TxtObsFact.Text = ""
|
||||||
|
TxtObsFact.Text = String.Format("{0} {1}", Titulo, strPromos.ToString())
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
TxtObsFact.Text = String.Format("{0} {1}", Titulo, strPromos.ToString())
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
UPObservaciones.Update()
|
UPObservaciones.Update()
|
||||||
@@ -23827,7 +23840,36 @@ Partial Class Ventas
|
|||||||
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
|
', "document.location.href=""/Ventas/Ventas.aspx?CveVenta=" & CveVenta
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
ElseIf DdlTipoComprobante.SelectedValue.Contiene("RNC") Then
|
||||||
|
LblCancelarDocumento.Text = "¿Desea cancelar la remisión de nota de crédito?<br/>"
|
||||||
|
Dim sbExtra As New StringBuilder
|
||||||
|
|
||||||
|
Using ObjAcum As New ClsAcumuladores
|
||||||
|
If ObjAcum.DistribuidorMovtosGet(Me.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=Me.CveVenta, CveConcepto:=1) Then
|
||||||
|
Dim DtBon As DataTable = ObjAcum.DtResultados.FiltraParametros("CveVentaBonificacion > 0", DistinctColumns:={"SerieFolioBonificacion", "CveVentaBonificacion"})
|
||||||
|
If DtBon IsNot Nothing AndAlso DtBon.Rows.Count > 0 Then
|
||||||
|
sbExtra.Append("<b>*Se cancelaran las siguientes remisiones de nota de crédito de bonificación.</b><br/>")
|
||||||
|
For Each RowBon As DataRow In DtBon.Rows
|
||||||
|
sbExtra.AppendFormat("  <b><a class='Texto' target='_blank' href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a></b><br/>", RowBon("CveVentaBonificacion"), RowBon("SerieFolioBonificacion"))
|
||||||
|
Next
|
||||||
|
DtBon.Dispose()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
LbCancelarDescripcion.Text = sbExtra.ToString()
|
||||||
|
DivRelacionadasCancelacion.Visible = False
|
||||||
|
BtnCancelarDocumento.Visible = True
|
||||||
|
DivMotivoCancelacion.Visible = False
|
||||||
|
DivMotivoCancelacionTxt.Visible = False
|
||||||
|
DivCanRem.Visible = False
|
||||||
|
DivDevAlm.Visible = False
|
||||||
|
|
||||||
|
UpCancelarDocumento.Update()
|
||||||
|
|
||||||
|
RegistraScript("$('#ModalCancelarDocumento').modal();")
|
||||||
Else
|
Else
|
||||||
|
|
||||||
CancelarDocumento()
|
CancelarDocumento()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -23997,7 +24039,7 @@ Partial Class Ventas
|
|||||||
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True)
|
Dim ObjFacturaCancelacion As New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=True)
|
||||||
Try
|
Try
|
||||||
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
Dim resp As Modelos.Factura.MCancelacionVentaMensaje = Nothing
|
||||||
|
Dim strMensaje As New StringBuilder()
|
||||||
If ObjFacturaCancelacion IsNot Nothing AndAlso ObjFacturaCancelacion.CveVenta > 0 Then
|
If ObjFacturaCancelacion IsNot Nothing AndAlso ObjFacturaCancelacion.CveVenta > 0 Then
|
||||||
Dim SWatch As New Stopwatch
|
Dim SWatch As New Stopwatch
|
||||||
SWatch.Start()
|
SWatch.Start()
|
||||||
@@ -24010,6 +24052,7 @@ Partial Class Ventas
|
|||||||
'ObjE.Dispose()
|
'ObjE.Dispose()
|
||||||
|
|
||||||
resp = ObjFacturaCancelacion.CancelarPorRefacturacion(DdlMotivoRefacturacion.SelectedValue.ToEntero(), TxtMotivoRefac.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
|
resp = ObjFacturaCancelacion.CancelarPorRefacturacion(DdlMotivoRefacturacion.SelectedValue.ToEntero(), TxtMotivoRefac.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
|
||||||
|
strMensaje.Append(resp.Mensaje)
|
||||||
Else
|
Else
|
||||||
Dim ListaRemisionesCancelar As New List(Of Integer)
|
Dim ListaRemisionesCancelar As New List(Of Integer)
|
||||||
If ChkCanRem.Checked Then
|
If ChkCanRem.Checked Then
|
||||||
@@ -24027,6 +24070,41 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
|
resp = ObjFacturaCancelacion.CancelarFactura(ChkDevAlm.Checked, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
|
||||||
|
strMensaje.Append(resp.Mensaje)
|
||||||
|
Dim DtBonificaciones As DataTable = Nothing
|
||||||
|
|
||||||
|
'SI ES RNC DE CARGO DEBE CANCELAR LAS BON
|
||||||
|
If Not resp.HuboError AndAlso ObjFacturaCancelacion.TipoDocto.Contiene("RNC") AndAlso ObjFacturaCancelacion.Num1 = 1 Then
|
||||||
|
Using ObjAcum As New ClsAcumuladores
|
||||||
|
If ObjAcum.DistribuidorMovtosGet(ObjFacturaCancelacion.CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=ObjFacturaCancelacion.CveVenta, CveConcepto:=1) Then
|
||||||
|
DtBonificaciones = ObjAcum.DtResultados.FiltraParametros("CveVentaBonificacion > 0", DistinctColumns:={"CveVentaBonificacion"})
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
|
||||||
|
|
||||||
|
If DtBonificaciones IsNot Nothing AndAlso DtBonificaciones.Rows.Count > 0 Then
|
||||||
|
For Each RowBon As DataRow In DtBonificaciones.Rows
|
||||||
|
Try
|
||||||
|
'VERIFICA SI TIENE RNC DE BONIFICACION
|
||||||
|
Dim Bon = New Modelos.Factura(UsuarioActual, RowBon("CveVentaBonificacion").ToString().ToEntero(), UsuarioActual.CveEmpresa, VerificaAlmacen:=False)
|
||||||
|
Dim respBon = Bon.CancelarFactura(False, ListaRemisionesCancelar, CveMotivoCancelacion:=DdlMotivoCancelacion.SelectedValue.ToEntero(), Motivo:=TxtMotivoCancelacion.Text.Trim(), CveEstadoCancelacion:=Me.CveEstadoCancelacion)
|
||||||
|
If respBon.HuboError Then
|
||||||
|
strMensaje.AppendFormat("<br/>Ocurrió un error al cancelar la remisión de NC de bonificación <b> {0} </b>.", Bon.SerieFolio)
|
||||||
|
Else
|
||||||
|
strMensaje.AppendFormat("<br/> La remisión de nota de credito de bonificación <b> {0}</b> fue cancelada correctamente.", Bon.SerieFolio)
|
||||||
|
End If
|
||||||
|
strMensaje.AppendFormat("<br/> {0}", resp.Mensaje)
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al cancelar la bonificación", ex)
|
||||||
|
strMensaje.Append("<br/> Ocurrió un error al cancelar la bonificación")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Next
|
||||||
|
DtBonificaciones.Dispose()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SWatch.Stop()
|
SWatch.Stop()
|
||||||
@@ -24039,10 +24117,10 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If resp.HuboError Then
|
If resp.HuboError Then
|
||||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
Alert(strMensaje.ToString(), resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||||
Else
|
Else
|
||||||
If resp.CveEstatus = 5 AndAlso Not EsRefacturacion Then
|
If resp.CveEstatus = 5 AndAlso Not EsRefacturacion Then
|
||||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:=$"BtnEnviarMailCancelacion({CveVenta});", TextoConfirmacion:=" Si ", TextoCancelacion:=" <a onclick='Recargar()'>No</> ")
|
Alert(strMensaje.ToString(), resp.TipoMensaje, JSBtnAceptar:=$"BtnEnviarMailCancelacion({CveVenta});", TextoConfirmacion:=" Si ", TextoCancelacion:=" <a onclick='Recargar()'>No</> ")
|
||||||
Else
|
Else
|
||||||
If EsRefacturacion Then
|
If EsRefacturacion Then
|
||||||
If resp.CveEstatus = 20 Then
|
If resp.CveEstatus = 20 Then
|
||||||
@@ -24050,10 +24128,10 @@ Partial Class Ventas
|
|||||||
ElseIf resp.CveEstatus.Contiene(4, 5, 23) Then
|
ElseIf resp.CveEstatus.Contiene(4, 5, 23) Then
|
||||||
LigaRedirigir = $"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1"
|
LigaRedirigir = $"Ventas.aspx?CveDevolucion={CveVenta}&NuevaFactura=1"
|
||||||
Else
|
Else
|
||||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
Alert(strMensaje.ToString(), resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Alert(resp.Mensaje, resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
Alert(strMensaje.ToString(), resp.TipoMensaje, JSBtnAceptar:="BtnRefrescarPagina();")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -26925,14 +27003,15 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
GvDescNCCargos.DataBind()
|
GvDescNCCargos.DataBind()
|
||||||
|
|
||||||
Dim SaldoMaximoUtilizable As Decimal = 0
|
Dim SaldoMaximoCliente As Decimal = 0
|
||||||
|
Dim SaldoEntregado As Decimal = 0
|
||||||
|
|
||||||
If CargarSoloGarantias Then
|
If CargarSoloGarantias Then
|
||||||
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
|
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
|
||||||
If SaldoMaximo > 0 Then
|
If SaldoMaximo > 0 Then
|
||||||
SaldoMaximoUtilizable = SaldoMaximo
|
SaldoMaximoCliente = SaldoMaximo
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoCliente = 0
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
@@ -26942,25 +27021,32 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||||
If SaldoMaximo > 0 Then
|
If SaldoMaximo > 0 Then
|
||||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
SaldoMaximoCliente = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoCliente = 0
|
||||||
End If
|
End If
|
||||||
|
Dim RowEntregado As DataRow = ObjAcum.DtResultados.Rows(1)
|
||||||
|
SaldoEntregado = RowEntregado("ValorConImpuestos").ToString().ToDecimal()
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoCliente = 0
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
|
Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
|
||||||
|
|
||||||
If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then
|
If SaldoMaximoCliente > 0 AndAlso SaldoMaximoCliente < SaldoMaximoUsadosFactura Then
|
||||||
|
SaldoMaximoUsadosFactura = SaldoMaximoCliente
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim SaldoMaximoUtilizable = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado)
|
||||||
|
|
||||||
|
If SaldoMaximoUtilizable > 0 Then
|
||||||
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
|
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
|
||||||
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
|
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
|
||||||
Else
|
Else
|
||||||
HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
|
HdnSaldoMaximoUsados.Value = "0"
|
||||||
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
|
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", 0)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -27076,14 +27162,14 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
GvDescNCCargosDetalle.DataBind()
|
GvDescNCCargosDetalle.DataBind()
|
||||||
|
|
||||||
Dim SaldoMaximoUtilizable As Decimal = 0
|
Dim SaldoMaximoCliente As Decimal = 0
|
||||||
|
Dim SaldoEntregado As Decimal = 0
|
||||||
If CargarSoloGarantias Then
|
If CargarSoloGarantias Then
|
||||||
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
|
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
|
||||||
If SaldoMaximo > 0 Then
|
If SaldoMaximo > 0 Then
|
||||||
SaldoMaximoUtilizable = SaldoMaximo
|
SaldoMaximoCliente = SaldoMaximo
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoCliente = 0
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim ObjAcum As New ClsAcumuladores
|
Dim ObjAcum As New ClsAcumuladores
|
||||||
@@ -27093,27 +27179,36 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||||
If SaldoMaximo > 0 Then
|
If SaldoMaximo > 0 Then
|
||||||
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
SaldoMaximoCliente = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoCliente = 0
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim RowEntregado As DataRow = ObjAcum.DtResultados.Rows(1)
|
||||||
|
SaldoEntregado = RowEntregado("ValorConImpuestos").ToString().ToDecimal()
|
||||||
Else
|
Else
|
||||||
SaldoMaximoUtilizable = 0
|
SaldoMaximoCliente = 0
|
||||||
End If
|
End If
|
||||||
ObjAcum.Dispose()
|
ObjAcum.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
|
Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
|
||||||
|
|
||||||
If SaldoMaximoUtilizable < SaldoMaximoUsados Then
|
If SaldoMaximoCliente > 0 AndAlso SaldoMaximoCliente < SaldoMaximoUsadosFactura Then
|
||||||
|
SaldoMaximoUsadosFactura = SaldoMaximoCliente
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim SaldoMaximoUtilizable = If(SaldoMaximoUsadosFactura < SaldoEntregado, SaldoMaximoUsadosFactura, SaldoEntregado)
|
||||||
|
|
||||||
|
If SaldoMaximoUtilizable > 0 Then
|
||||||
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
|
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
|
||||||
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
|
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
|
||||||
Else
|
Else
|
||||||
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
|
HdnSaldoMaximoUsados.Value = "0"
|
||||||
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados)
|
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", 0)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
UpDescNC.Update()
|
UpDescNC.Update()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaRNCDetalleBonificacion(Optional CveVentaUsado As Integer = -1)
|
Private Sub CargaRNCDetalleBonificacion(Optional CveVentaUsado As Integer = -1)
|
||||||
@@ -27861,8 +27956,17 @@ Partial Class Ventas
|
|||||||
DtImpuestos = query.QueryToDataTable(False)
|
DtImpuestos = query.QueryToDataTable(False)
|
||||||
DtImpuestosBonificacion = queryBonificacion.QueryToDataTable(False)
|
DtImpuestosBonificacion = queryBonificacion.QueryToDataTable(False)
|
||||||
|
|
||||||
|
Dim TieneMultiplesSubProyectos As Boolean = False
|
||||||
|
'VERIFICA SI EN LA FACTURA ACTUAL TUVO MULTIPLES SUBPROYECTOS, PARA CUADRAR AL FINAL EL IMPORTE ACUMULADO
|
||||||
|
If Not AplicaNCMasiva AndAlso AplicoNCFacturaActual Then
|
||||||
|
TieneMultiplesSubProyectos = TmpDT.FiltraParametros("", "", {"CveSubProyecto"}).COUNT("CveSubProyecto", "CveSubProyecto > 0") > 1
|
||||||
|
If TieneMultiplesSubProyectos Then
|
||||||
|
AcumuladoNC = TxtNCImporte.Text.Trim.ToDecimal
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
'ASUSTO LA DIFERENCIA EN EL ÚLTIMO CONCEPTO
|
'ASUSTO LA DIFERENCIA EN EL ÚLTIMO CONCEPTO
|
||||||
If TipoDoctoNC = "Egs" AndAlso (Not AplicaNuevoDocumento) AndAlso AplicaNCMasiva AndAlso (Not NCDescuento) AndAlso AcumuladoNC > 0 Then
|
If TipoDoctoNC = "Egs" AndAlso (Not AplicaNuevoDocumento) AndAlso (AplicaNCMasiva OrElse TieneMultiplesSubProyectos) AndAlso (Not NCDescuento) AndAlso AcumuladoNC > 0 Then
|
||||||
'CODIGO PARA AJUSTE DE CENTAVO, SI EL IMPORTE TOTAL NO CUADRA CON LOS TOTALES
|
'CODIGO PARA AJUSTE DE CENTAVO, SI EL IMPORTE TOTAL NO CUADRA CON LOS TOTALES
|
||||||
Dim ImporteNC As Decimal = DtImpuestos.SUMD("ImporteTotal") + DtImpuestos.SUMD("ImporteIVA") + DtImpuestos.SUMD("ImporteIEPS") - DtImpuestos.SUMD("ImporteRetIVA") - DtImpuestos.SUMD("ImporteRetISR")
|
Dim ImporteNC As Decimal = DtImpuestos.SUMD("ImporteTotal") + DtImpuestos.SUMD("ImporteIVA") + DtImpuestos.SUMD("ImporteIEPS") - DtImpuestos.SUMD("ImporteRetIVA") - DtImpuestos.SUMD("ImporteRetISR")
|
||||||
|
|
||||||
@@ -28642,8 +28746,9 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim AplicaRedondeo As Boolean = True
|
Dim AplicaRedondeo As Boolean = True
|
||||||
|
Dim TieneMultiplesSubProyectos As Boolean = TmpDT.FiltraParametros("", "", {"CveSubProyecto"}).COUNT("CveSubProyecto", "CveSubProyecto > 0") > 1
|
||||||
|
|
||||||
If AplicaNCMasiva AndAlso Not NCDescuento Then
|
If AplicaNCMasiva AndAlso Not NCDescuento OrElse TieneMultiplesSubProyectos Then
|
||||||
AplicaRedondeo = False
|
AplicaRedondeo = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user