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
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Public Class ClsPaginas
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public ReadOnly Property EsProduccion As Boolean
|
Public Shared ReadOnly Property EsProduccion As Boolean
|
||||||
Get
|
Get
|
||||||
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
|
||||||
Return False
|
Return False
|
||||||
@@ -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)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2063,7 +2063,7 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
|||||||
CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1,
|
CveJornada As Integer, IdCtaContPersonal As Integer, CtaContPersonal As String, IdCtaContPrestamos As Integer, CtaContPrestamos As String, CveEmpresa As Integer, CveUsuarioNomina As Integer, Optional CveSubProyectoZona As Integer = Nothing, Optional CveUniforme As Integer = -1,
|
||||||
Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1,
|
Optional TelefonoExtension As String = "-1", Optional CelularPersonal As String = "-1", Optional TelefonoMarcadoRapido As String = "-1", Optional ContactoAlterno As String = "-1", Optional CveUsuarioModifico As Integer = -1,
|
||||||
Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveRegistroPatronal As Integer = -1,
|
Optional FechaActivo As Date = MinFecha, Optional FechaReingreso As Date = MinFecha, Optional CveTipodeSalario As Integer = 1, Optional Sindicalizado As Integer = -1, Optional CvePais As Integer = -1, Optional Pensionado As Boolean = False, Optional CveRegistroPatronal As Integer = -1,
|
||||||
Optional CveEmpresaAsignado As Integer = -1) As Boolean
|
Optional CveEmpresaAsignado As Integer = -1, Optional CveMedioTransporte As Integer = -1, Optional EsReserva As Integer = -1) As Boolean
|
||||||
|
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
@@ -2153,6 +2153,8 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
|
|||||||
.Add("@CvePais", SqlDbType.Int).Value = CvePais
|
.Add("@CvePais", SqlDbType.Int).Value = CvePais
|
||||||
.Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal
|
.Add("@CveRegistroPatronal", SqlDbType.Int).Value = CveRegistroPatronal
|
||||||
.Add("@CveEmpresaAsignado", SqlDbType.Int).Value = CveEmpresaAsignado
|
.Add("@CveEmpresaAsignado", SqlDbType.Int).Value = CveEmpresaAsignado
|
||||||
|
.Add("@CveMedioTransporte", SqlDbType.Int).Value = CveMedioTransporte
|
||||||
|
.Add("@EsReserva", SqlDbType.Int).Value = EsReserva
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ Public Class Empresa
|
|||||||
Public Property RutaArchivos As String
|
Public Property RutaArchivos As String
|
||||||
Public ReadOnly Property Ruta As String
|
Public ReadOnly Property Ruta As String
|
||||||
Get
|
Get
|
||||||
If Not String.IsNullOrEmpty(RutaArchivos) Then
|
If Not String.IsNullOrEmpty(RutaArchivos) AndAlso ClsPaginas.EsProduccion Then
|
||||||
Return RutaArchivos
|
Return RutaArchivos
|
||||||
Else
|
Else
|
||||||
Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa)
|
Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa)
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -3483,6 +3483,14 @@ Public Class Timbrado
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then
|
If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then
|
||||||
|
Dim objGrales As New ClsGenerales
|
||||||
|
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC, "3.3") Then
|
||||||
|
Retorno = ""
|
||||||
|
Else
|
||||||
|
Retorno = "Error"
|
||||||
|
End If
|
||||||
|
objGrales.Dispose()
|
||||||
|
|
||||||
Using ObjInv As New ClsInventarios()
|
Using ObjInv As New ClsInventarios()
|
||||||
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
|
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
|
||||||
Retorno = ""
|
Retorno = ""
|
||||||
@@ -5706,6 +5714,14 @@ Public Class Timbrado
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then
|
If ObjCFDITimbre.Comprobante.TipoComprobante = "T" Then
|
||||||
|
Dim objGrales As New ClsGenerales
|
||||||
|
If objGrales.UpdateTimbreTimbrado(Ventas.CveTimbre, FolioFiscal, ObjCFDITimbre.Comprobante.Fecha, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, UsuarioActual.Empresa.CvePAC, "4.0") Then
|
||||||
|
Retorno = ""
|
||||||
|
Else
|
||||||
|
Retorno = "Error"
|
||||||
|
End If
|
||||||
|
objGrales.Dispose()
|
||||||
|
|
||||||
Using ObjInv As New ClsInventarios()
|
Using ObjInv As New ClsInventarios()
|
||||||
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
|
If ObjInv.UpdateMovimientoTimbrado(Ventas.Inv_CveMovimiento, 1, FolioFiscal, MinFecha) Then
|
||||||
Retorno = ""
|
Retorno = ""
|
||||||
|
|||||||
@@ -7482,7 +7482,8 @@ Partial Class Compras_Compras
|
|||||||
Dim Pago As New CompraPago
|
Dim Pago As New CompraPago
|
||||||
Pago.ImportePago = importeMovimiento
|
Pago.ImportePago = importeMovimiento
|
||||||
Pago.CveIE = Ant.CveIE
|
Pago.CveIE = Ant.CveIE
|
||||||
Pago.CveMonedaPago = 1
|
Pago.TCPago = Ant.TCCompra
|
||||||
|
Pago.CveMonedaPago = If(Ant.TCCompra > 1, 2, 1)
|
||||||
|
|
||||||
ErrorPrepoliza = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
|
ErrorPrepoliza = AplicaPrePolizaPago(CompraActual, Pago, CvePrePoliza, ObjConta)
|
||||||
|
|
||||||
@@ -19914,7 +19915,7 @@ Partial Class Compras_Compras
|
|||||||
RblFleteImportacionOpcion.Items.Clear()
|
RblFleteImportacionOpcion.Items.Clear()
|
||||||
|
|
||||||
Dim ObjCompras As New ClsCompras
|
Dim ObjCompras As New ClsCompras
|
||||||
If ObjCompras.GetImportaciones(-1, -1, -1, "-1", "-1", UsuarioActual.CveEmpresa) Then
|
If ObjCompras.GetImportaciones(-1, -1, -1, "-1", "-1", UsuarioActual.CveEmpresa, CveEstatus:=0) Then
|
||||||
DdlImportaciones.DataSource = ObjCompras.DtResultados
|
DdlImportaciones.DataSource = ObjCompras.DtResultados
|
||||||
DdlImportaciones.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
DdlImportaciones.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -289,6 +289,9 @@ Partial Class PopUpVerFactura
|
|||||||
If rfc.Length > 0 Then
|
If rfc.Length > 0 Then
|
||||||
contador = contador + 1
|
contador = contador + 1
|
||||||
RFCs.AppendLine(String.Format("{0}|{1}", contador, rfc))
|
RFCs.AppendLine(String.Format("{0}|{1}", contador, rfc))
|
||||||
|
Else
|
||||||
|
contador = contador + 1
|
||||||
|
RFCs.AppendLine(String.Format("{0}|{1}", contador, "..."))
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
@@ -1079,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
|
||||||
|
|
||||||
@@ -2694,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
|
||||||
|
|
||||||
@@ -2723,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)
|
||||||
@@ -3028,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
|
||||||
@@ -3046,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
|
||||||
|
|||||||
@@ -1188,7 +1188,7 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Dim Concepto As String = row.FCTextBox("TxtConcepto").Text
|
Dim Concepto As String = row.FCTextBox("TxtConcepto").Text
|
||||||
Dim CveSubProyecto As Integer = row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero()
|
Dim CveSubProyecto As Integer = row.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero()
|
||||||
Dim CtaContable As Integer = row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero()
|
Dim CtaContable As Integer = row.FCDropDownList("DdlCtaContable").SelectedValue.ToEntero()
|
||||||
Dim TipoMovto As Boolean = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, False, True)
|
Dim TipoMovto As Boolean = If(row.FCTextBox("TxtAbono").Text.ToDecimal() <> 0, True, False)
|
||||||
Dim TipoMovtoOld As Boolean = (row.DataKey("TipoMovto").ToString = "True")
|
Dim TipoMovtoOld As Boolean = (row.DataKey("TipoMovto").ToString = "True")
|
||||||
Dim ImporteMN As Decimal = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal())
|
Dim ImporteMN As Decimal = If(row.FCTextBox("TxtCargo").Text.ToDecimal() <> 0, row.FCTextBox("TxtCargo").Text.ToDecimal(), row.FCTextBox("TxtAbono").Text.ToDecimal())
|
||||||
Dim CveTipoGastonew As Integer = If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero())
|
Dim CveTipoGastonew As Integer = If(DdlTipoGasto.Visible, row.FCDropDownList("DdlTipoGasto").SelectedValue.ToEntero(), row.DataKey("CveTipoGasto").ToEntero())
|
||||||
|
|||||||
@@ -1633,7 +1633,7 @@ Partial Class ContabilidadC_RegPrePolizaS
|
|||||||
If AplicaComplementaria Then
|
If AplicaComplementaria Then
|
||||||
Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
|
Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
|
||||||
'valida Mon Extranjera por el TC - Mon Extranjera
|
'valida Mon Extranjera por el TC - Mon Extranjera
|
||||||
Dim dif As Decimal = ((TxtME.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal) - TxtME.Text.ToDecimal).RoundSQL - Importe
|
Dim dif As Decimal = ((TxtME.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal).RoundSQL - TxtME.Text.ToDecimal).RoundSQL - Importe
|
||||||
|
|
||||||
If dif <> 0 Then
|
If dif <> 0 Then
|
||||||
Alert("El importe moneda extranjera no coinciden con el TC ")
|
Alert("El importe moneda extranjera no coinciden con el TC ")
|
||||||
|
|||||||
@@ -721,9 +721,10 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
LbTipoCambio.Text = DtMov.Rows(0)("TipoCambio").ToString
|
LbTipoCambio.Text = DtMov.Rows(0)("TipoCambio").ToString
|
||||||
End If
|
End If
|
||||||
Dim TMDsTR = DtMov.Rows(0)("CveMtoRel").ToString
|
Dim TMDsTR = DtMov.Rows(0)("CveMtoRel").ToString
|
||||||
If DtMov.Rows(0)("CveMtoRel").ToString.Length > 0 Then
|
If TMDsTR.Length > 0 Then
|
||||||
RowMtoRel.Visible = True
|
RowMtoRel.Visible = True
|
||||||
lnkMtoRelacionado.NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveMovimiento=" & DtMov.Rows(0)("CveMtoRel").ToString
|
lnkMtoRelacionado.NavigateUrl = "/Inventarios/EntradasSalidas.aspx?CveMovimiento=" & TMDsTR
|
||||||
|
CveMovimientoRelacionado = TMDsTR.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Mov.CveMovimientoVirtual > 0 Then
|
If Mov.CveMovimientoVirtual > 0 Then
|
||||||
@@ -1829,9 +1830,9 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
|
Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
|
||||||
'Dim IdCuentaGasto As Integer = 0
|
'Dim IdCuentaGasto As Integer = 0
|
||||||
For Each Dr As DataRow In Dt.Rows
|
For Each Dr As DataRow In Dt.Rows
|
||||||
Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion").ToString}").SUM("Total").ToDecimal.RoundSQL()
|
Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").ToDecimal.RoundSQL()
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, TxtObservaciones.Text.Trim, CveConceptoContable, TxtObservaciones.Text.Trim, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=Total, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, TxtFolio.Text, TxtObservaciones.Text.Trim, IdCtaContableOtro, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -3725,6 +3726,7 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
|
|
||||||
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & DdlConcepto.SelectedValue).ToEntero
|
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & DdlConcepto.SelectedValue).ToEntero
|
||||||
If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True
|
If OrigenMov = 1 Then MovAlmacen = False Else MovAlmacen = True
|
||||||
|
CveMovimientoRelacionado = ObjInventario.DtResultados.Rows(0)("CveMtoRel").ToString.ToEntero
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
DtCostos = ObjInventario.DtResultados
|
DtCostos = ObjInventario.DtResultados
|
||||||
@@ -3772,70 +3774,75 @@ Partial Class Inventarios_EntradasSalidas
|
|||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 205, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 205, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
ElseIf ObjInventario.Modulo.Contiene("RE/G5", "EA/G5") Then
|
||||||
|
Contabilizable = True
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 331, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjInventario.Modulo.Contiene("M/CU") Then
|
If ObjInventario.Modulo.Contiene("M/CU", "RU/G") Then
|
||||||
Contabilizable = True
|
Contabilizable = True
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 278, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, HplVenta.Text, 278, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then
|
If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then
|
||||||
Contabilizable = False
|
Contabilizable = False
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 289, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjInventario.Modulo.Contiene("Consig") Then
|
If ObjInventario.Modulo.Contiene("Consig") Then
|
||||||
Contabilizable = False
|
Contabilizable = False
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 95, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 95, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If ObjInventario.Modulo = "ASA/G1" Then
|
If ObjInventario.Modulo.Contiene("ASA/G1", "Vta/E4", "ARMPAQ1", "RE/GSC3") Then
|
||||||
Contabilizable = False
|
Contabilizable = False
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then
|
If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then
|
||||||
'genero las prepolizas manuales
|
'genero las prepolizas manuales
|
||||||
Dim tCveConcepto As Integer = 95
|
Dim tCveConcepto As Integer = 95
|
||||||
Dim CveCuenta As Integer
|
Dim CveCuenta As Integer
|
||||||
If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519
|
If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519
|
||||||
IdCtaContable = 1
|
IdCtaContable = 1
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then
|
||||||
ErrorMovInv = True
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
|
|
||||||
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
|
|
||||||
Dim tCveConcepto As Integer = 69
|
|
||||||
If DdlConcepto.SelectedValue = "30" Then
|
|
||||||
tCveConcepto = 181
|
|
||||||
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero
|
|
||||||
End If
|
|
||||||
|
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
|
||||||
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
|
|
||||||
If tCveConcepto = 69 Then
|
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
|
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Next
|
Else
|
||||||
|
|
||||||
|
Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
|
||||||
|
Dim tCveConcepto As Integer = 69
|
||||||
|
If DdlConcepto.SelectedValue = "30" Then
|
||||||
|
tCveConcepto = 181
|
||||||
|
IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
|
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
|
||||||
|
If tCveConcepto = 69 Then
|
||||||
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
|
||||||
|
|||||||
@@ -1758,13 +1758,12 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
'RegistraScript("document.getElementById(""TxtSerie"").focus();")
|
'RegistraScript("document.getElementById(""TxtSerie"").focus();")
|
||||||
RegistraScript("$('#DivSerie').modal();", "ModalLote")
|
RegistraScript("$('#DivSerie').modal();", "ModalLote")
|
||||||
|
|
||||||
|
|
||||||
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
|
||||||
GvSerie.DataBind()
|
GvSerie.DataBind()
|
||||||
|
|
||||||
'VALIDA QUE SIGA AGREGANDO
|
'VALIDA QUE SIGA AGREGANDO
|
||||||
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then
|
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then
|
||||||
BtnAgregarPS.Enabled = False
|
BtnAgregarPS.Enabled = True
|
||||||
If CerrarCompletado Then
|
If CerrarCompletado Then
|
||||||
RegistraScript("$('#DivSerie').modal('hide');")
|
RegistraScript("$('#DivSerie').modal('hide');")
|
||||||
End If
|
End If
|
||||||
@@ -1807,9 +1806,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
|
||||||
AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty), 1)
|
AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty), 1)
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub AgregaSerie(Serie As String, Tipo As Integer, Optional AlertaSonido As Boolean = True)
|
Private Sub AgregaSerie(Serie As String, Tipo As Integer, Optional AlertaSonido As Boolean = True, Optional CargaMasivaSeries As Boolean = False)
|
||||||
'SerieLote = SerieLote.Trim.Replace(" ", " ")
|
|
||||||
|
|
||||||
If Serie.Trim = "" Then
|
If Serie.Trim = "" Then
|
||||||
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -1820,10 +1817,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
'VALIDACION DE SERIES DUPLICADAS
|
'VALIDACION DE SERIES DUPLICADAS
|
||||||
Dim MensajeAlert As New StringBuilder
|
Dim MensajeAlert As New StringBuilder
|
||||||
Dim DtDuplicado As New DataTable
|
Dim DtDuplicado As New DataTable
|
||||||
Dim DtSeriesNuevas As New DataTable
|
|
||||||
DtSeriesNuevas.Columns.Add("Serie", GetType(String))
|
|
||||||
|
|
||||||
'If CvePSS > 0 And CvePSSerie = 0 Then CvePSSerie = CvePSS
|
|
||||||
|
|
||||||
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS
|
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS
|
||||||
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltroPrimero("", "PS")
|
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltroPrimero("", "PS")
|
||||||
@@ -1832,12 +1825,8 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
DtDuplicado = DtDatosDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{Serie}'")
|
DtDuplicado = DtDatosDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{Serie}'")
|
||||||
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
|
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
|
||||||
MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado ya se encuentra ingresado.")
|
MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado ya se encuentra ingresado.")
|
||||||
Continue For
|
TxtSerie.Text = ""
|
||||||
End If
|
TxtSerie.Focus()
|
||||||
|
|
||||||
DtDuplicado = DtSeriesNuevas.FiltraParametros($"Serie = '{Serie}'")
|
|
||||||
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
|
|
||||||
MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado se encuentra duplicado.")
|
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1846,19 +1835,14 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
MensajeAlert.Append($"<br/> El numero de Serie <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.")
|
MensajeAlert.Append($"<br/> El numero de Serie <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.")
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Row = DtSeriesNuevas.NewRow
|
|
||||||
Row("Serie") = Serie
|
|
||||||
DtSeriesNuevas.Rows.Add(Row)
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If MensajeAlert.ToString <> "" Then
|
If MensajeAlert.ToString <> "" Then
|
||||||
Alert(MensajeAlert.ToString, TipoMensaje.MsgAdvertencia)
|
Alert(MensajeAlert.ToString, TipoMensaje.ToastError)
|
||||||
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim MensajeSinExistencias As New StringBuilder
|
Dim MensajeSinExistencias As New StringBuilder
|
||||||
Dim ObjInventarios As New ClsInventarios
|
Dim ObjInventarios As New ClsInventarios
|
||||||
Dim Index = 0
|
Dim Index = 0
|
||||||
@@ -1866,7 +1850,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
For Each Serie In SeriesArreglo
|
For Each Serie In SeriesArreglo
|
||||||
If Serie <> "" Then
|
If Serie <> "" Then
|
||||||
|
|
||||||
|
|
||||||
Dim Row = DtDatosDetalle.NewRow
|
Dim Row = DtDatosDetalle.NewRow
|
||||||
|
|
||||||
Index = Index + 1
|
Index = Index + 1
|
||||||
@@ -1895,11 +1878,6 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dim AplicaCaducidad = False
|
|
||||||
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0) IsNot Nothing Then
|
|
||||||
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
|
|
||||||
'End If
|
|
||||||
|
|
||||||
Row("ConsecId") = CveConsecSerie
|
Row("ConsecId") = CveConsecSerie
|
||||||
Row("Consec") = DtDatosDetalle.Rows.Count + 1
|
Row("Consec") = DtDatosDetalle.Rows.Count + 1
|
||||||
Row("CvePS") = CvePSSerie
|
Row("CvePS") = CvePSSerie
|
||||||
@@ -1918,7 +1896,7 @@ Partial Class Inventarios_RecepcionAlmacen
|
|||||||
TxtSerie.Text = ""
|
TxtSerie.Text = ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
CargaSerie(Tipo, True)
|
If Not CargaMasivaSeries Then CargaSerie(Tipo, True)
|
||||||
|
|
||||||
If MensajeAlert.ToString <> "" Then
|
If MensajeAlert.ToString <> "" Then
|
||||||
If AlertaSonido Then RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
If AlertaSonido Then RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -979,11 +979,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
ErrorExistencia = True
|
ErrorExistencia = True
|
||||||
dr("EstatusExistencia") = "-1"
|
dr("EstatusExistencia") = "-1"
|
||||||
dr("Cantidad") = Existencia
|
dr("Cantidad") = Existencia
|
||||||
'If Existencia <= 0 Then
|
|
||||||
TextoExistencia.AppendFormat("- #{0} {1}<br/>", dr("No").ToString, dr("PS").ToString)
|
TextoExistencia.AppendFormat("- #{0} {1}<br/>", dr("No").ToString, dr("PS").ToString)
|
||||||
'Else
|
|
||||||
'Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgError)
|
|
||||||
'End If
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
@@ -1016,17 +1013,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad")
|
Dim TotalCantidad As Decimal = DtMovimientos.SUMD("Cantidad")
|
||||||
|
|
||||||
''[IPP-1Noviembre2018] SE COMENTA PORQUE NO TIENE NI PIES NI CABEZA. LE FALTA DESARROLLO
|
|
||||||
'If (TipoAlmacenOrigen = 14 Or TipoAlmacenDestino = 14) And TipoAlmacenOrigen <> TipoAlmacenDestino Then
|
|
||||||
' ObjInventario.Dispose()
|
|
||||||
' 'es consumo interno
|
|
||||||
' ConsumoInterno(TipoAlmacenOrigen, TipoAlmacenDestino)
|
|
||||||
'End If
|
|
||||||
|
|
||||||
'Inicia la transacción
|
'Inicia la transacción
|
||||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||||
Dim CveMovimientoSalida = 0
|
Dim CveMovimientoSalida As Integer = 0
|
||||||
Dim CveMovimientoEntrada = 0
|
Dim CveMovimientoEntrada = 0
|
||||||
Dim IDPoliza As Integer = 0
|
Dim IDPoliza As Integer = 0
|
||||||
Dim FolioSalida = 0
|
Dim FolioSalida = 0
|
||||||
@@ -1034,13 +1023,16 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Dim CveMovimientoVirtualSalida As Integer = 0
|
Dim CveMovimientoVirtualSalida As Integer = 0
|
||||||
Dim FolioVirtualEntrada As Integer = 0
|
Dim FolioVirtualEntrada As Integer = 0
|
||||||
Dim FolioVirtualSalida As Integer = 0
|
Dim FolioVirtualSalida As Integer = 0
|
||||||
Dim FolioEntrada = 0
|
Dim FolioEntrada As Integer = 0
|
||||||
Dim AlmacenEntrada = -1
|
|
||||||
Dim Fecha As Date = TxtFecha.Text.ToDate
|
Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||||
Dim ErrorMovInv As Boolean = False
|
Dim ErrorMovInv As Boolean = False
|
||||||
Dim ErrorAC As Boolean = False
|
Dim ErrorAC As Boolean = False
|
||||||
Dim TextoError = ""
|
Dim TextoError = ""
|
||||||
Dim TipoMovimientoSalida As Integer = 26 'If(ChkTransitorio.Checked, 26, If(TipoAlmacenOrigen = 24, 26, 26))
|
Dim TipoMovimientoSalida As Integer = 26
|
||||||
|
Dim CveAlmacenEntrada As Integer = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||||
|
|
||||||
|
Dim CveConceptoEntrada As Integer = 27
|
||||||
|
If Not ChkTransitorio.Checked Then CveConceptoEntrada = 27 Else CveConceptoEntrada = 9
|
||||||
|
|
||||||
'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
|
'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
|
||||||
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
CveMovimientoSalida = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, TipoMovimientoSalida, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||||
@@ -1066,15 +1058,69 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'ENTRADA
|
||||||
|
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, CveConceptoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
|
||||||
|
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
|
||||||
|
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
|
||||||
|
FolioEntrada = ObjInventario.Folio
|
||||||
|
If CveMovimientoEntrada <= 0 Then
|
||||||
|
TextoError = "Ocurrió un error al generar el movimiento de entrada"
|
||||||
|
ErrorMovInv = True
|
||||||
|
Else
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
|
Dim Cont As Integer = 0
|
||||||
|
Dim dttSalida As DataTable = ObjInventario.DtResultados
|
||||||
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
|
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Cont += 1
|
||||||
|
Next
|
||||||
|
|
||||||
'VIRTUAL SALIDA
|
Dim Concepto As String = TxtObservaciones.Text
|
||||||
If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualSalida > 0 Then
|
If Concepto = "" Then Concepto = "Traspaso"
|
||||||
|
|
||||||
'If TipoAlmacenOrigen = 27 Then
|
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
|
||||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
If Not ErrorMovInv Then
|
||||||
'Else
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
' CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
|
|
||||||
'End If
|
Dim importe As Decimal = dttSalida.SUMD("Total").RoundSQL
|
||||||
|
Dim Contabilizable As Boolean = False
|
||||||
|
|
||||||
|
If TipoAlmacenOrigen = 26 AndAlso TipoAlmacenDestino <> 26 Then Contabilizable = True 'IdCtaContableOrigen = IdCtaContableDestino AndAlso
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
'si el tipo de almacen de entrada es Almacen sin costo, se registra al costo, la salida.
|
||||||
|
If TipoAlmacenOrigen <> 26 AndAlso TipoAlmacenDestino = 26 Then
|
||||||
|
|
||||||
|
Dim tCveClasificacion As Integer = DtMovimientos.MAX("CveClasificacion").ToEntero
|
||||||
|
Dim dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=tCveClasificacion).FiltroPrimero("")
|
||||||
|
Dim IdCuentaCostos As Integer = -1
|
||||||
|
If dr IsNot Nothing Then IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
Contabilizable = False
|
||||||
|
importe = 0
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'VIRTUAL SALIDA/ENTRADA
|
||||||
|
If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualSalida > 0 AndAlso Not ErrorMovInv Then
|
||||||
|
|
||||||
Dim dtvirtual As DataTable = Nothing
|
Dim dtvirtual As DataTable = Nothing
|
||||||
|
|
||||||
@@ -1085,157 +1131,72 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
If dtvirtual.Rows.Count > 0 Then
|
If dtvirtual.Rows.Count > 0 Then
|
||||||
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenVirtualEntrada)
|
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida, CveAlmacenDestino:=CveAlmacenVirtualEntrada)
|
||||||
FolioVirtualSalida = ObjInventario.Folio
|
FolioVirtualSalida = ObjInventario.Folio
|
||||||
|
Dim Contabilizable As Boolean = False
|
||||||
|
Dim Concepto As String = TxtObservaciones.Text
|
||||||
|
|
||||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
If CveMovimientoVirtualSalida > 0 Then
|
||||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
|
||||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString.ToDecimal
|
|
||||||
Dim PU As Decimal = RowVirtual("Cargo").ToString().ToDecimal()
|
|
||||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||||
|
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||||
|
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString.ToDecimal
|
||||||
|
Dim PU As Decimal = RowVirtual("Cargo").ToString().ToDecimal()
|
||||||
|
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
'SALIDA VIRTUAL
|
||||||
|
Dim importevirtual As Decimal = 0
|
||||||
|
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtualSalida, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/S3", CveMovimientoRelacionado:=CveMovimientoEntrada, CveAlmacenDestino:=CveAlmacenVirtualEntrada)
|
||||||
|
FolioVirtualEntrada = ObjInventario.Folio
|
||||||
|
If CveMovimientoVirtualEntrada > 0 Then
|
||||||
|
Dim DtCostosVirtual As DataTable
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualSalida, UsuarioActual.CveEmpresa) Then
|
||||||
|
DtCostosVirtual = ObjInventario.DtResultados
|
||||||
|
importevirtual = DtCostosVirtual.SUMD("Total").RoundSQL
|
||||||
|
|
||||||
|
For Each RowVirtual As DataRow In DtCostosVirtual.Rows
|
||||||
|
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||||
|
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString.ToDecimal
|
||||||
|
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||||
|
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
TextoError = "Ocurrió un error al generar el movimiento de salida virtual"
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
|
||||||
End If
|
End If
|
||||||
Next
|
|
||||||
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TAVirt", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importevirtual, importevirtual, 68, TxtObservaciones.Text, TxtObservaciones.Text, IdCtaContableOrigen, CveMovimientoAlmacen:=CveMovimientoVirtualSalida, Contabilizable:=Contabilizable) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importevirtual, importevirtual, 68, TxtObservaciones.Text, TxtObservaciones.Text, IdCtaContableDestino, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, Contabilizable:=Contabilizable) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
TextoError = "Ocurrió un error al generar el movimiento de salida virtual"
|
||||||
|
ErrorMovInv = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
|
||||||
|
|
||||||
Dim TipoMovimientoEntrada As Integer = 27
|
|
||||||
If Not ChkTransitorio.Checked Then TipoMovimientoEntrada = 27 Else TipoMovimientoEntrada = 9
|
|
||||||
|
|
||||||
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
|
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
|
|
||||||
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
|
|
||||||
FolioEntrada = ObjInventario.Folio
|
|
||||||
If CveMovimientoEntrada <= 0 Then
|
|
||||||
TextoError = "Ocurrió un error al generar el movimiento de entrada"
|
|
||||||
ErrorMovInv = True
|
|
||||||
Else
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
|
||||||
Dim Cont As Integer = 0
|
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
|
||||||
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Cont += 1
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'AGREGAMOS LA ENTRADA
|
|
||||||
If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO
|
|
||||||
If Not ErrorMovInv Then
|
|
||||||
|
|
||||||
'VIRTUAL ENTRADA
|
|
||||||
If RealizarMovimientoVirtual AndAlso CveAlmacenVirtualEntrada > 0 Then
|
|
||||||
|
|
||||||
Dim dtvirtual As DataTable = Nothing
|
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
|
||||||
dtvirtual = ObjInventario.DtResultados
|
|
||||||
If dtvirtual.Rows.Count > 0 Then
|
|
||||||
''hay que verificar que se se tengan movimeintos por registrar
|
|
||||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtualEntrada, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S3")
|
|
||||||
FolioVirtualEntrada = ObjInventario.Folio
|
|
||||||
|
|
||||||
|
|
||||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
|
||||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
|
||||||
Dim CantidadUsado As Double = RowVirtual("Cantidad").ToString().ToDouble()
|
|
||||||
Dim PU As Decimal = RowVirtual("Cargo").ToString().ToDecimal()
|
|
||||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Concepto As String = TxtObservaciones.Text
|
|
||||||
If Concepto = "" Then Concepto = "Traspaso"
|
|
||||||
'AGREGAMOS PREPOLIZAS TRASPASO DIRECTO:
|
|
||||||
If Not ErrorMovInv Then
|
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
|
||||||
|
|
||||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
|
||||||
Dim importe As Decimal = resultado.SUMD("Total").RoundAD
|
|
||||||
Dim Contabilizable As Boolean = False
|
|
||||||
|
|
||||||
If TipoAlmacenOrigen = 26 AndAlso TipoAlmacenDestino <> 26 Then Contabilizable = True 'IdCtaContableOrigen = IdCtaContableDestino AndAlso
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableOrigen, -1, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
'si el tipo de almacen de entrada es Almacen sin costo, se registra al costo, la salida.
|
|
||||||
If TipoAlmacenOrigen <> 26 AndAlso TipoAlmacenDestino = 26 Then
|
|
||||||
|
|
||||||
Dim tCveClasificacion As Integer = DtMovimientos.MAX("CveClasificacion").ToEntero
|
|
||||||
Dim dr As DataRow = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=tCveClasificacion).FiltroPrimero("")
|
|
||||||
Dim IdCuentaCostos As Integer = -1
|
|
||||||
If dr IsNot Nothing Then
|
|
||||||
IdCuentaCostos = dr("IdCuentaCostos").ToString.ToEntero
|
|
||||||
End If
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 69, TxtObservaciones.Text, Fecha, IdCuentaCostos, -1, CveClasificacion:=tCveClasificacion, CveSubProyecto:=CveSubProyectoOrigen, CveMovimientoAlmacen:=CveMovimientoSalida, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
Contabilizable = False
|
|
||||||
importe = 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContableDestino, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, Contabilizable:=Contabilizable, ImporteMX:=importe) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
If Not ErrorMovInv Then
|
|
||||||
Dim Concepto As String = TxtObservaciones.Text
|
|
||||||
If Concepto = "" Then Concepto = "Traspaso"
|
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen2", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
|
||||||
|
|
||||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
|
||||||
Dim importe As Decimal = resultado.SUMD("Total").RoundAD
|
|
||||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
|
||||||
ErrorMovInv = True
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
''[IPP-1Noviembre2018] SE COMENTA PORQUE NO TIENE NI PIES NI CABEZA. LE FALTA DESARROLLO
|
|
||||||
''CONSUMO INTERNO
|
|
||||||
'If Not ErrorMovInv Then
|
|
||||||
' If (TipoAlmacenOrigen = 14 Or TipoAlmacenDestino = 14) And TipoAlmacenOrigen <> TipoAlmacenDestino Then
|
|
||||||
' ConsumoInterno(TipoAlmacenOrigen, TipoAlmacenDestino)
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
Dim SerieInsertadaTimbre As String = ""
|
Dim SerieInsertadaTimbre As String = ""
|
||||||
Dim FolioInsertadoTimbre As Integer = -1
|
Dim FolioInsertadoTimbre As Integer = -1
|
||||||
Dim CveTimbre As Integer = -1
|
Dim CveTimbre As Integer = -1
|
||||||
@@ -1292,18 +1253,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion, "")
|
Alert(MensajeAlert.ToString, TipoMensaje.MsgInformacion, "")
|
||||||
|
|
||||||
|
|
||||||
If ChkTransitorio.Checked AndAlso UsuarioActual.CveEmpresa.Contiene(72, 80) Then
|
If ChkTransitorio.Checked AndAlso UsuarioActual.CveEmpresa.Contiene(72, 80) Then
|
||||||
RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimientoSalida))
|
RegistraScript(String.Format("AbrirVentana('/General/PopUpPaqueteriasGuias.aspx?CveMovimiento={0}',800,620);", CveMovimientoSalida))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'If UsuarioActual.CveEmpresa.Contiene(72, 80) Then
|
|
||||||
' Dim Correo As String = "jorgegonzalez@compuproveedores.com"
|
|
||||||
' If GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {DdlAlmacenDestino.SelectedValue.ToEntero}").ToEntero = 16 Then
|
|
||||||
' MandaCorreo(CveMovimientoSalida, Correo)
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
LimpiaMovimiento()
|
LimpiaMovimiento()
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -1322,97 +1274,97 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Function ConsumoInterno(TipoAlmacenOrigen As Integer, TipoAlmacenDestino As Integer) As Boolean
|
'Function ConsumoInterno(TipoAlmacenOrigen As Integer, TipoAlmacenDestino As Integer) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
' Dim Retorno As Boolean = False
|
||||||
Dim ErrorMovInv As Boolean = False
|
' Dim ErrorMovInv As Boolean = False
|
||||||
Dim TextoError As String = ""
|
' Dim TextoError As String = ""
|
||||||
Dim Fecha As Date = TxtFecha.Text.ToDate
|
' Dim Fecha As Date = TxtFecha.Text.ToDate
|
||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios
|
' Dim ObjInventario As New ClsInventarios
|
||||||
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
' Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL())
|
||||||
Dim CveMovimiento As Integer = 0
|
' Dim CveMovimiento As Integer = 0
|
||||||
Dim TipoMovto = If(TipoAlmacenOrigen = 14, -1, 1)
|
' Dim TipoMovto = If(TipoAlmacenOrigen = 14, -1, 1)
|
||||||
Dim CveConceptoInventario As Integer = 8
|
' Dim CveConceptoInventario As Integer = 8
|
||||||
|
|
||||||
|
|
||||||
Dim CveAlmacenCI = If(TipoAlmacenOrigen = 14, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
' Dim CveAlmacenCI = If(TipoAlmacenOrigen = 14, DdlAlmacenOrigen.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
|
||||||
Dim DtCostos As DataTable = Nothing
|
' Dim DtCostos As DataTable = Nothing
|
||||||
Dim ValorInventario As Decimal = 0
|
' Dim ValorInventario As Decimal = 0
|
||||||
|
|
||||||
'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
|
' 'AGREGAMOS LA SALIDA DEL ALMACEN ORIGEN
|
||||||
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, CveConceptoInventario, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
' CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacenOrigen.SelectedValue.ToEntero, CveConceptoInventario, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||||
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""),
|
' Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, ""),
|
||||||
GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, Modulo:="TA/G4")
|
' GastoIndirecto:=If(ChkTransitorio.Checked And TxtGastoIndirecto.Text.ToDouble > 0, TxtGastoIndirecto.Text, "-1").ToDouble, Modulo:="TA/G4")
|
||||||
Dim FolioMov As Integer = ObjInventario.Folio
|
' Dim FolioMov As Integer = ObjInventario.Folio
|
||||||
|
|
||||||
If CveMovimiento <= 0 Then
|
' If CveMovimiento <= 0 Then
|
||||||
TextoError = "No se pudo generar el movimiento de salida correctamente"
|
' TextoError = "No se pudo generar el movimiento de salida correctamente"
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
Else
|
' Else
|
||||||
|
|
||||||
For Each Dr As DataRow In DtMovimientos.Rows
|
' For Each Dr As DataRow In DtMovimientos.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then
|
' If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
' TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
' If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||||
DtCostos = ObjInventario.DtResultados
|
' DtCostos = ObjInventario.DtResultados
|
||||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
' Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim IdCtaContable As Integer = 0
|
' Dim IdCtaContable As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
' Dim CveCuenta As Integer = 0
|
||||||
|
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
' If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim Concepto As String = $"Consumo Interno: {ObjInventario.Folio} - {TxtObservaciones.Text}"
|
' Dim Concepto As String = $"Consumo Interno: {ObjInventario.Folio} - {TxtObservaciones.Text}"
|
||||||
Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv/ConsumoInterno", 53, DtCostos.SUM("Total") * TipoMovto, DtCostos.SUM("Total") * TipoMovto, 1, TxtFecha.Text.ToDate, $"Consumo Interno: {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
' Dim CvePrePoliza = ObjConta.AddPrePolizas("Inv/ConsumoInterno", 53, DtCostos.SUM("Total") * TipoMovto, DtCostos.SUM("Total") * TipoMovto, 1, TxtFecha.Text.ToDate, $"Consumo Interno: {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
' For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal
|
' ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
' IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
' CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario * TipoMovto, Concepto, 181, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario * TipoMovto, CveCuenta:=CveCuenta) Then
|
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ValorInventario * TipoMovto, Concepto, 181, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario * TipoMovto, CveCuenta:=CveCuenta) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
|
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacenCI}").ToEntero
|
' IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={CveAlmacenCI}").ToEntero
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DtCostos.SUM("Total").ToDecimal * TipoMovto, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUM("Total").ToDecimal * TipoMovto) Then
|
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, DtCostos.SUM("Total").ToDecimal * TipoMovto, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUM("Total").ToDecimal * TipoMovto) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
End If
|
' End If
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
' If Not ErrorMovInv Then
|
||||||
|
|
||||||
ObjInventario.Commit()
|
' ObjInventario.Commit()
|
||||||
Dim Mensaje As StringBuilder = New StringBuilder
|
' Dim Mensaje As StringBuilder = New StringBuilder
|
||||||
|
|
||||||
Mensaje.Append("Se realizó el consumo interno.")
|
' Mensaje.Append("Se realizó el consumo interno.")
|
||||||
|
|
||||||
Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento)
|
' Mensaje.AppendFormat("<br/> Folio: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioMov, CveMovimiento)
|
||||||
|
|
||||||
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
' Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
|
||||||
Mensaje.Clear()
|
' Mensaje.Clear()
|
||||||
|
|
||||||
LimpiaMovimiento()
|
' LimpiaMovimiento()
|
||||||
|
|
||||||
Else
|
' Else
|
||||||
ObjInventario.RollBack()
|
' ObjInventario.RollBack()
|
||||||
Alert(TextoError, TipoMensaje.MsgError)
|
' Alert(TextoError, TipoMensaje.MsgError)
|
||||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
' RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||||
End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Return Retorno
|
' Return Retorno
|
||||||
|
|
||||||
End Function
|
'End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
@@ -2141,7 +2093,6 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
CveMovimientoSalidaTransitorio = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
||||||
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/G11")
|
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/G11")
|
||||||
|
|
||||||
|
|
||||||
If CveMovimientoSalidaTransitorio <= 0 Then
|
If CveMovimientoSalidaTransitorio <= 0 Then
|
||||||
TextoError = "No se pudo generar el movimiento de salida correctamente"
|
TextoError = "No se pudo generar el movimiento de salida correctamente"
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
@@ -2203,6 +2154,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
Cont += 1
|
Cont += 1
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
Dim Concepto As String = TxtObservacionesRecepcion.Text
|
Dim Concepto As String = TxtObservacionesRecepcion.Text
|
||||||
If Concepto = "" Then Concepto = "Recepción Traspaso"
|
If Concepto = "" Then Concepto = "Recepción Traspaso"
|
||||||
@@ -2213,14 +2165,11 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorioRecepcion.SelectedValue.ToEntero)).ToEntero
|
||||||
Dim tCveConcepto As Integer = 68
|
Dim tCveConcepto As Integer = 68
|
||||||
|
|
||||||
'If CveMovimientoSalidaTransitorio = 0 Then
|
|
||||||
' tCveConcepto = 289
|
|
||||||
'End If
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, tCveConcepto, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, tCveConcepto, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalidaTransitorio, ImporteMX:=importe, Contabilizable:=False) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -2229,9 +2178,9 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
|
|
||||||
'VIRTUAL ENTRADA
|
'VIRTUAL ENTRADA
|
||||||
Dim CveMovimientoVirtualEntrada As Integer = 0
|
Dim CveMovimientoVirtualEntrada, CveMovimientoVirtualSalida As Integer
|
||||||
Dim FolioVirtualEntrada As Integer = 0
|
Dim FolioVirtualEntrada, FolioVirtualSalida As Integer
|
||||||
If RealizarMovimientoVirtual Then
|
If RealizarMovimientoVirtual AndAlso Not ErrorMovInv Then
|
||||||
|
|
||||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenEntrada).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=CveAlmacenEntrada).FiltroPrimeroValor("CveAlmacenVirtual", "").ToEntero()
|
||||||
|
|
||||||
@@ -2239,18 +2188,19 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Dim dtvirtual As DataTable = Nothing
|
Dim dtvirtual As DataTable = Nothing
|
||||||
|
|
||||||
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
dtvirtual = ObjInventario.DtResultados
|
dtvirtual = ObjInventario.DtResultados
|
||||||
If dtvirtual.Rows.Count > 0 Then
|
If dtvirtual.Rows.Count > 0 Then
|
||||||
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S2")
|
|
||||||
FolioVirtualEntrada = ObjInventario.Folio
|
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalidaTransitorio, Modulo:="TA/S22")
|
||||||
|
FolioVirtualSalida = ObjInventario.Folio
|
||||||
For Each RowVirtual As DataRow In dtvirtual.Rows
|
For Each RowVirtual As DataRow In dtvirtual.Rows
|
||||||
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||||
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||||
Dim PU As Decimal = RowVirtual("Cargo").ToString().ToDecimal()
|
Dim PU As Decimal = RowVirtual("Cargo").ToString().ToDecimal()
|
||||||
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualSalida, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -2260,17 +2210,31 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Dim Concepto As String = TxtObservaciones.Text
|
Dim Concepto As String = TxtObservaciones.Text
|
||||||
If Concepto = "" Then Concepto = "Traspaso"
|
If Concepto = "" Then Concepto = "Traspaso"
|
||||||
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TA22", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TA22", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualEntrada, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualSalida, UsuarioActual.CveEmpresa) Then
|
||||||
|
|
||||||
Dim resultado As DataTable = ObjInventario.DtResultados
|
Dim resultado As DataTable = ObjInventario.DtResultados
|
||||||
Dim importe As Decimal = resultado.SUMD("Total").RoundAD
|
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S23")
|
||||||
|
FolioVirtualEntrada = ObjInventario.Folio
|
||||||
|
|
||||||
|
For Each RowVirtual As DataRow In resultado.Rows
|
||||||
|
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
|
||||||
|
Dim CantidadUsado As Decimal = RowVirtual("Cantidad").ToString().ToDecimal()
|
||||||
|
Dim PU As Decimal = RowVirtual("PU").ToString().ToDecimal()
|
||||||
|
Dim CveUM As Integer = RowVirtual("CveUM").ToString().ToEntero()
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtualEntrada, CantidadUsado, CveUM, CvePS, PU, -1, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
|
ErrorMovInv = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
|
||||||
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
|
Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualSalida, ImporteMX:=importe, Contabilizable:=False) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
If Not ErrorMovInv AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -2288,67 +2252,6 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
''AGREGAMOS LA ENTRADA
|
|
||||||
'If Not ErrorMovInv Then
|
|
||||||
' CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
|
|
||||||
' Observaciones:=TxtObservacionesRecepcion.Text.Trim, Recibio:=TxtRecibio.Text, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida)
|
|
||||||
' Folio = ObjInventario.Folio
|
|
||||||
|
|
||||||
' If CveMovimientoEntrada <= 0 Then
|
|
||||||
' TextoError = "No se pudo generar el movimiento de entrada correctamente"
|
|
||||||
' ErrorMovInv = True
|
|
||||||
' Else
|
|
||||||
|
|
||||||
' 'COSTO INDIRECTO
|
|
||||||
' Dim GastoIndirectoTotal As Double = GvDatosRecepcion.Rows(0).DataKey("GastoIndirectoSalida").ToDouble
|
|
||||||
' Dim Importe As Double = GvDatosRecepcion.Rows(0).DataKey("Importe").ToDouble
|
|
||||||
|
|
||||||
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
|
||||||
' Dim CostoIndirecto As Double
|
|
||||||
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
|
||||||
|
|
||||||
' CostoIndirecto = 0
|
|
||||||
' If GastoIndirectoTotal > 0 Then
|
|
||||||
' 'PRORRATEAMOS EL GASTO INDIRECTO
|
|
||||||
' CostoIndirecto = ((Dr("Total").ToString.ToDouble * GastoIndirectoTotal) / Importe) / Dr("Cantidad").ToString.ToDouble
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("Serie").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CostoIndirecto:=CostoIndirecto) Then
|
|
||||||
' ErrorMovInv = True
|
|
||||||
' TextoError = "Ocurrió un error al guardar los movimientos de entrada"
|
|
||||||
' Exit For
|
|
||||||
' End If
|
|
||||||
' Next
|
|
||||||
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
'AGREGAMOS LA ENTRADA VIEJO
|
|
||||||
'If Not ErrorMovInv Then
|
|
||||||
' 'Folio = ObjInventario.GetFolioSiguiente(9, UsuarioActual.CveEmpresa)
|
|
||||||
' CveMovimientoEntrada = ObjInventario.AddMovimiento(GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero, 9, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
|
|
||||||
|
|
||||||
' If CveMovimientoEntrada <= 0 Then
|
|
||||||
' TextoError = "No se pudo generar el movimiento de entrada correctamente"
|
|
||||||
' ErrorMovInv = True
|
|
||||||
' Else
|
|
||||||
|
|
||||||
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
|
||||||
|
|
||||||
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
|
||||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero) Then
|
|
||||||
' ErrorMovInv = True
|
|
||||||
' TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
|
||||||
' Exit For
|
|
||||||
' End If
|
|
||||||
' Next
|
|
||||||
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorMovInv Then
|
If Not ErrorMovInv Then
|
||||||
|
|||||||
@@ -577,9 +577,9 @@
|
|||||||
<asp:HyperLink ID="HypXml" ToolTip="Formato xml" Visible="false" CssClass="btn btn-circle btn- btn-xs blue mysmallbtn" NavigateUrl="#" runat="server"><i class="fa fa-file-o"></i></asp:HyperLink>
|
<asp:HyperLink ID="HypXml" ToolTip="Formato xml" Visible="false" CssClass="btn btn-circle btn- btn-xs blue mysmallbtn" NavigateUrl="#" runat="server"><i class="fa fa-file-o"></i></asp:HyperLink>
|
||||||
<asp:HyperLink ID="HypPDF" ToolTip="Formato Timbre" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Visible="false" NavigateUrl="#" runat="server"><i class="fa fa-file-pdf-o"></i></asp:HyperLink>
|
<asp:HyperLink ID="HypPDF" ToolTip="Formato Timbre" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Visible="false" NavigateUrl="#" runat="server"><i class="fa fa-file-pdf-o"></i></asp:HyperLink>
|
||||||
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm btn-xs blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
|
<asp:LinkButton runat="server" ID="LnkTimbrar" CssClass="btn btn-circle btn-sm btn-xs blue mysmallbtn" Text="<i class='fa fa-bell'></i>" OnClick="LnkTimbrar_Click" data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea Timbrar?" data-btn-ok-label="si" />
|
||||||
<asp:LinkButton runat="server" ID="Imgdesautorizar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="Imgdesautorizar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la autorizacion?" data-btn-ok-label="si" />
|
<asp:LinkButton runat="server" ID="Imgdesautorizar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="Imgdesautorizar_Click" CommandArgument='<%# Eval("CveNomina") %>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la autorizacion?" data-btn-ok-label="si" />
|
||||||
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && Eval("SeTimbro").ToString() == "False"? false :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la nómina?" data-btn-ok-label="si" />
|
<asp:LinkButton runat="server" ID="ImgDelete" CssClass="btn btn-circle btn-sm btn-xs red mysmallbtn" Text="<i class='icon-trash'></i>" OnClick="ImgDelete_Click" CommandArgument='<%# Eval("CveNomina") %>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea eliminar la nómina?" data-btn-ok-label="si" />
|
||||||
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' Visible='<%# (Eval("CveNomina").ToString() != "" && PermisoCancelarEmitido && Eval("SeTimbro").ToString() == "True"? true :false)%>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
|
<asp:LinkButton runat="server" ID="LnkCancelar" CssClass="btn btn-circle btn-sm btn-xs yellow-gold mysmallbtn" Text="<i class='fa fa-ban'></i>" OnClick="LnkCancelar_Click" CommandArgument='<%# Eval("CveNomina") %>' data-toggle="confirmation" data-popout="true" data-original-title="¿Está seguro que desea cancelar la nómina?" data-btn-ok-label="si" />
|
||||||
</div>
|
</div>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|||||||
@@ -1037,11 +1037,21 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
string SubProyecto = e.Row.DataKey("SubProyecto").ToString();
|
string SubProyecto = e.Row.DataKey("SubProyecto").ToString();
|
||||||
e.Row.FCHyperLink("LnkSobreRecibo").Attributes.Add("onclick", string.Format("GETSobreRecibo({0},{1})", cvePersonal, CvePeriodo));
|
e.Row.FCHyperLink("LnkSobreRecibo").Attributes.Add("onclick", string.Format("GETSobreRecibo({0},{1})", cvePersonal, CvePeriodo));
|
||||||
LnkTimbrar.Visible = false;
|
LnkTimbrar.Visible = false;
|
||||||
|
LinkButton ImgDelete = (LinkButton)e.Row.FindControl("ImgDelete");
|
||||||
|
LinkButton Imgdesautorizar = (LinkButton)e.Row.FindControl("Imgdesautorizar");
|
||||||
|
LinkButton LnkCancelar = (LinkButton)e.Row.FindControl("LnkCancelar");
|
||||||
|
ImgDelete.Visible = false;
|
||||||
|
Imgdesautorizar.Visible = false;
|
||||||
|
LnkCancelar.Visible = false;
|
||||||
if (cvePersonal > 0)
|
if (cvePersonal > 0)
|
||||||
{
|
{
|
||||||
|
LnkCancelar.Visible = PermisoCancelarEmitido && SeTimbro.ToUpper().Contiene("TRUE", "1");
|
||||||
|
|
||||||
LtlNombre.Text = String.Format("<a class=\"Texto sline\" href=\"/RH/Personal.aspx?CvePersonal={0}\"><span style=\"display:inline-block;min-width:31px;\">{2}</span> <span style=\"display:inline-block;\">{1}</span></a>", cvePersonal, Nombre, Codigo);
|
LtlNombre.Text = String.Format("<a class=\"Texto sline\" href=\"/RH/Personal.aspx?CvePersonal={0}\"><span style=\"display:inline-block;min-width:31px;\">{2}</span> <span style=\"display:inline-block;\">{1}</span></a>", cvePersonal, Nombre, Codigo);
|
||||||
if (CveNomina > 0)
|
if (CveNomina > 0)
|
||||||
{
|
{
|
||||||
|
Imgdesautorizar.Visible = NomAutorizado.ToUpper().Contiene("TRUE", "1") && !SeTimbro.ToUpper().Contiene("TRUE", "1");
|
||||||
|
ImgDelete.Visible = !NomAutorizado.ToUpper().Contiene("TRUE", "1") && !SeTimbro.ToUpper().Contiene("TRUE", "1");
|
||||||
if (NomAutorizado == "False")
|
if (NomAutorizado == "False")
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1207,6 +1217,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
LnkTimbrar.Visible = false;
|
LnkTimbrar.Visible = false;
|
||||||
gvRow.CssClass = "success";
|
gvRow.CssClass = "success";
|
||||||
gvRow.FindControl("ImgDelete").Visible = false;
|
gvRow.FindControl("ImgDelete").Visible = false;
|
||||||
|
gvRow.FindControl("Imgdesautorizar").Visible = false;
|
||||||
|
|
||||||
gvRow.FindControl("LnkCancelar").Visible = true;
|
gvRow.FindControl("LnkCancelar").Visible = true;
|
||||||
gvRow.FindControl("HypXml").Visible = true;
|
gvRow.FindControl("HypXml").Visible = true;
|
||||||
gvRow.FindControl("HypPDF").Visible = true;
|
gvRow.FindControl("HypPDF").Visible = true;
|
||||||
@@ -1335,6 +1347,8 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
}
|
}
|
||||||
Alert("Se ha timbrado correctamente");
|
Alert("Se ha timbrado correctamente");
|
||||||
gvRow.FindControl("ImgDelete").Visible = false;
|
gvRow.FindControl("ImgDelete").Visible = false;
|
||||||
|
gvRow.FindControl("Imgdesautorizar").Visible = false;
|
||||||
|
|
||||||
gvRow.FindControl("LnkCancelar").Visible = true;
|
gvRow.FindControl("LnkCancelar").Visible = true;
|
||||||
gvRow.FindControl("HypXml").Visible = true;
|
gvRow.FindControl("HypXml").Visible = true;
|
||||||
gvRow.FindControl("HypPDF").Visible = true;
|
gvRow.FindControl("HypPDF").Visible = true;
|
||||||
@@ -1563,10 +1577,17 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
continuar = true;
|
continuar = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
string msgerror = "Debe seleccionar los conceptos a cargar.";
|
||||||
|
if(dtConceptos == null || dtConceptos.Columns.Count <= 2)
|
||||||
|
{
|
||||||
|
msgerror = "Debe cargar el periodo antes de descargar la plantilla";
|
||||||
|
continuar = false;
|
||||||
|
}
|
||||||
if (continuar)
|
if (continuar)
|
||||||
{
|
{
|
||||||
|
|
||||||
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
|
ClosedXML.Excel.XLWorkbook wb = new ClosedXML.Excel.XLWorkbook();
|
||||||
|
|
||||||
var libro = wb.AddWorksheet("Nomina");
|
var libro = wb.AddWorksheet("Nomina");
|
||||||
int column = 1;
|
int column = 1;
|
||||||
libro.Row(1).Hide();
|
libro.Row(1).Hide();
|
||||||
@@ -1693,12 +1714,12 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Alert("Debe seleccionar los conceptos a cargar.", TipoMensaje.MsgAdvertencia);
|
Alert(msgerror, TipoMensaje.MsgAdvertencia);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Alert("Ocurrio un error al generar el Formato de nominas" + ex.ToString());
|
Alert("Ocurrio un error al generar el Formato de nominas" + ex.ToString(), TipoMensaje.MsgAdvertencia);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6001,9 +6022,9 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
int chkImporte = 1;
|
int chkImporte = 1;
|
||||||
int chkImporteGravado = 1;
|
int chkImporteGravado = 1;
|
||||||
int chkImporteValor = 1;
|
int chkImporteValor = 1;
|
||||||
string[] getcolumnas = new string[] { "CvePersonal", "CveMetodoPago", "SumaPercepciones", "Total", "SalarioDiario", "SalarioDiarioIMSS", "SalarioDiarioIntegrado", "DiasLaborados", "DiasFaltados", "DiasVacaciones", "DiasIncapacidad" };
|
string[] getcolumnas = new string[] { "CvePersonal", "Nombre", "CveMetodoPago", "SumaPercepciones", "Total", "SalarioDiario", "SalarioDiarioIMSS", "SalarioDiarioIntegrado", "DiasLaborados", "DiasFaltados", "DiasVacaciones", "DiasIncapacidad" };
|
||||||
|
|
||||||
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0 AND SumaPercepciones > 0", FiltroCvePersonal), "", getcolumnas);
|
DataTable dtr = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0 AND SumaPercepciones > 0 AND Total >0", FiltroCvePersonal), "", getcolumnas);
|
||||||
DataTable dtconp = null;
|
DataTable dtconp = null;
|
||||||
//int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
|
//int CvePeriodoSeleccionado = DdlPeriodo.SelectedValue.ToEntero();//cambiar reparar
|
||||||
|
|
||||||
@@ -6020,6 +6041,19 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
decimal ImporteConcepto = 0, ImporteGravadoConcepto = 0, ImporteExentoConcepto = 0, ImporteValor = 0;
|
decimal ImporteConcepto = 0, ImporteGravadoConcepto = 0, ImporteExentoConcepto = 0, ImporteValor = 0;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
string erroralturizar = "";
|
||||||
|
|
||||||
|
|
||||||
|
DataTable dtrFail = dtempleados.FiltraParametros(string.Format("(CvePersonal={0} OR {0}=-1) AND CvePersonal > 0 AND NomAutorizado =0 AND SumaPercepciones > 0 AND Total <=0", FiltroCvePersonal), "", getcolumnas);
|
||||||
|
StringBuilder strbuilder = new StringBuilder();
|
||||||
|
foreach (DataRow itf in dtrFail.Rows)
|
||||||
|
{
|
||||||
|
strbuilder.AppendLine(String.Format("<br/>{0} con neto a pagar {1} ", itf["Nombre"], itf["Total"]));
|
||||||
|
}
|
||||||
|
if(dtrFail.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
erroralturizar = string.Format("<br/> no se autorizaron los siguientes empleados con neto a pagar negativo para evitar inconsistencias{0}", strbuilder.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
using (ClsNominas objNomina = new ClsNominas())
|
using (ClsNominas objNomina = new ClsNominas())
|
||||||
{
|
{
|
||||||
@@ -6126,7 +6160,7 @@ public partial class Nomina_Nomina2 : ClsPaginas
|
|||||||
}
|
}
|
||||||
if (continuar)
|
if (continuar)
|
||||||
{
|
{
|
||||||
Alert("La nomina se autorizó correctamente.");
|
Alert(string.Format("La nomina se autorizó correctamente.{0}", erroralturizar));
|
||||||
cargaDatos();
|
cargaDatos();
|
||||||
}
|
}
|
||||||
return continuar;
|
return continuar;
|
||||||
|
|||||||
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}');");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -211,8 +211,6 @@
|
|||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" id="DvTamanio" runat="server" visible="false">
|
<div class="form-group form-md-line-input input-iconright" id="DvTamanio" runat="server" visible="false">
|
||||||
<asp:DropDownList ID="DdlTamanio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Tamaño" DataValueField="CveTamaño" Width="350px">
|
<asp:DropDownList ID="DdlTamanio" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" CausesValidation="true" DataTextField="Tamaño" DataValueField="CveTamaño" Width="350px">
|
||||||
<asp:ListItem Value="-1">Seleccione</asp:ListItem>
|
<asp:ListItem Value="-1">Seleccione</asp:ListItem>
|
||||||
@@ -228,13 +226,13 @@
|
|||||||
<label for="<%= DdlSATPS.ClientID.ToString()%>">Producto Servicio SAT:</label>
|
<label for="<%= DdlSATPS.ClientID.ToString()%>">Producto Servicio SAT:</label>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivPSAdicionalVigencia" visible="false">
|
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivPSAdicionalVigencia" visible="false">
|
||||||
<ADS:Dropdownlost runat="server" ID="DdlPSAdicionalVigencia" CssStyle="width: 46%;" CssClass="form-control input-sm select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
<ADS:Dropdownlost runat="server" ID="DdlPSAdicionalVigencia" CssStyle="width: 46%;" CssClass="form-control input-sm select2me" DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||||
<label for="<%= DdlPSAdicionalVigencia.ClientID.ToString()%>"><asp:Literal runat="server" Text="Producto de vigencia:" ID="LtlPSAdicionalVigencia"></asp:Literal> </label>
|
<label for="<%= DdlPSAdicionalVigencia.ClientID.ToString()%>"><asp:Literal runat="server" Text="Producto de vigencia:" ID="LtlPSAdicionalVigencia"></asp:Literal> </label>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivClasificacion2" visible="false">
|
<div class="form-group form-md-line-input input-iconright" runat="server" id="DivClasificacion2" visible="false">
|
||||||
<asp:DropDownList ID="DdlClasificacion2" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="false" CausesValidation="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="350px" Enabled="true">
|
<asp:DropDownList ID="DdlClasificacion2" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="false" CausesValidation="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="350px" Enabled="true">
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
@@ -250,11 +248,10 @@
|
|||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright col-xs-3">
|
<div class="form-group form-md-line-input input-iconright col-xs-3">
|
||||||
<asp:TextBox ID="TxtVentaMinima" CssClass="form-control " runat="server"></asp:TextBox>
|
<asp:TextBox ID="TxtVentaMinima" CssClass="form-control " runat="server"></asp:TextBox>
|
||||||
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
|
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
|
||||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtVentaMinima.ClientID.ToString()%>">Venta Mínima:</label>
|
<label class="truncate" style="padding-left: 1px;" for="<%= TxtVentaMinima.ClientID.ToString()%>">Venta Mínima:</label>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -272,8 +269,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="row">
|
<div class="row" runat="server" id="divRowRSCO" visible="false" >
|
||||||
<div class=" col-md-4">
|
<div class=" col-md-6">
|
||||||
|
|
||||||
<div runat="server" id="DivRegistroRSCO1" class="form-group form-md-line-input input-iconright" visible="false" style="width:100%!important">
|
<div runat="server" id="DivRegistroRSCO1" class="form-group form-md-line-input input-iconright" visible="false" style="width:100%!important">
|
||||||
<asp:TextBox ID="TxtRegistroRSCO" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
<asp:TextBox ID="TxtRegistroRSCO" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||||
@@ -283,19 +280,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-md-4" runat="server" id="DivRegistroRSCO2" visible="false">
|
<div class=" col-md-3" runat="server" id="DivRegistroRSCO2" visible="false">
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" runat="server" style="width: 200px">
|
<div class="form-group form-md-line-input input-iconright" runat="server" style="width: 125px">
|
||||||
<asp:CheckBox ID="ChkFechaIndeterminadaRSCO" runat="server" CssClass="form-control" OnCheckedChanged="ChkFechaIndeterminadaRSCO_CheckedChanged" AutoPostBack="true" />
|
<asp:CheckBox ID="ChkFechaIndeterminadaRSCO" runat="server" CssClass="form-control" OnCheckedChanged="ChkFechaIndeterminadaRSCO_CheckedChanged" AutoPostBack="true" />
|
||||||
<label for="<%= ChkFechaIndeterminadaRSCO.ClientID.ToString()%>">Fecha Indeterminada:</label>
|
<label for="<%= ChkFechaIndeterminadaRSCO.ClientID.ToString()%>">F. Indeterminada:</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class=" col-md-4">
|
<div class=" col-md-3">
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright" style="width: 160px!important" runat="server" id="DivRegistroRSCO3" visible="false">
|
<div class="form-group form-md-line-input input-iconright" style="width: 125px!important" runat="server" id="DivRegistroRSCO3" visible="false">
|
||||||
|
|
||||||
<asp:TextBox ID="TxtFechaVigenciaRSCO" CssClass="form-control" MaxLength="50" runat="server" Width="130px"></asp:TextBox>
|
<asp:TextBox ID="TxtFechaVigenciaRSCO" CssClass="form-control" MaxLength="20" runat="server" Width="100px"></asp:TextBox>
|
||||||
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
|
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
|
||||||
<asp:LinkButton ID="LnkTxtFechaVigenciaRSCO" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<asp:LinkButton ID="LnkTxtFechaVigenciaRSCO" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
</span>
|
</span>
|
||||||
@@ -304,62 +301,25 @@
|
|||||||
<asp:CompareValidator ID="CvTxtFechaVigenciaRSCO" runat="server" ControlToValidate="TxtFechaVigenciaRSCO" Display="None"
|
<asp:CompareValidator ID="CvTxtFechaVigenciaRSCO" runat="server" ControlToValidate="TxtFechaVigenciaRSCO" Display="None"
|
||||||
ErrorMessage="El campo <b>''Fecha de Cierre''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
|
ErrorMessage="El campo <b>''Fecha de Cierre''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
|
||||||
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="CvcTxtFechaVigenciaRSCO" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtFechaVigenciaRSCO" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
<%--<asp:RequiredFieldValidator ID="RfvTxtFechaVigenciaRSCO" runat="server" ControlToValidate="TxtFechaVigenciaRSCO" Display="None"
|
|
||||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Cierre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>--%>
|
|
||||||
|
|
||||||
<ajax:ValidatorCalloutExtender ID="CvcTxtFechaVigenciaRSCO" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtFechaVigenciaRSCO" Width="300px"></ajax:ValidatorCalloutExtender>
|
|
||||||
<%--<ajax:ValidatorCalloutExtender ID="VCETxtFechaVigenciaRSCO" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaVigenciaRSCO" Width="300px"></ajax:ValidatorCalloutExtender>--%>
|
|
||||||
|
|
||||||
<label for="<%= TxtFechaVigenciaRSCO.ClientID.ToString() %>">Fecha de Vigencia:</label>
|
<label for="<%= TxtFechaVigenciaRSCO.ClientID.ToString() %>">Fecha de Vigencia:</label>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright col-xs-3" id="divLitraje" visible="false" runat="server">
|
<div class="form-group form-md-line-input input-iconright col-xs-3" id="divLitraje" visible="false" runat="server">
|
||||||
<asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ></asp:TextBox>
|
<asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ></asp:TextBox>
|
||||||
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
|
<label class="truncate" style="padding-left: 16px;" for="<%= TxtLitraje.ClientID.ToString()%>">Litraje:</label>
|
||||||
<label class="truncate" style="padding-left: 16px;" for="<%= TxtLitraje.ClientID.ToString()%>">Litraje:</label>
|
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Aplica para Venta:</label>
|
<label>Aplica para Venta:</label>
|
||||||
<asp:CheckBox ID="ChkAplicaParaVenta" CssClass="make-switchsd" data-size="small" runat="server" Checked="True" />
|
<asp:CheckBox ID="ChkAplicaParaVenta" CssClass="make-switchsd" data-size="small" runat="server" Checked="True" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%-- <div class="form-group">
|
|
||||||
<label>Aplica para Concepto en la factura:</label>
|
|
||||||
<asp:CheckBox ID="ChkAplicaParaConcepto" CssClass="make-switchsd" data-size="small" runat="server" Checked="true" />
|
|
||||||
</div>--%>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1948,8 +1948,7 @@ Partial Class ProductosyServicios
|
|||||||
PS.Dispose()
|
PS.Dispose()
|
||||||
DdlCompuesto.DataBind()
|
DdlCompuesto.DataBind()
|
||||||
|
|
||||||
|
divRowRSCO.Visible = True
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -516,6 +516,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user