diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 503feacc6..663b0e342 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -1945,7 +1945,7 @@ Partial Class Bancos_IE
ObjOtrosPagos.Add(New CFDINominaOtrosPagos With {.TipoOtroPago = "003",
.Clave = "003",
.Concepto = "Viáticos (entregados al trabajador).",
- .Importe = TxtImporte.Text.ToString.ToDouble
+ .Importe = TxtImporte.Text.ToString.ToDecimal
}
)
If ObjOtrosPagos IsNot Nothing AndAlso ObjOtrosPagos.Count > 0 Then cfdi.Nomina.OtrosPagos = ObjOtrosPagos
@@ -5678,15 +5678,31 @@ Partial Class Bancos_IE
Protected Sub GvComplementoPagos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvComplementoPagos.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
- e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
- If e.Row.DataKey("Estatus").Contiene("1", "3") Then
- e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
- Else
- e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False
+ If e.Row.DataKey("Tipo") = "Ing" Then
+ e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+ e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CVECOMPLEMENTOPAGO={1}&CVEIE={2}", e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("CveComplementoPago"), e.Row.DBCampo("CveIE"))))
+
+ If e.Row.DataKey("Estatus").Contiene("1", "3") Then
+ e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = True
+ Else
+ e.Row.FCLinkButton("LnkCancelarComplemetno").Visible = False
+ End If
+
+ ElseIf e.Row.DataKey("Tipo") = "Egs" Then
+
+ e.Row.Cells(3).Text = String.Format("", Encripta(String.Format("OP=Fact&EXT=xml&CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo(("RFCde").ToString.Replace("&", "%26%")))))
+ e.Row.Cells(4).Text = String.Format("", Encripta(String.Format("OP=Fact&EXT=pdf&CveFactura={0}&RFC={1}", e.Row.DBCampo("CveFactura"), e.Row.DBCampo("RFCde").ToString.Replace("&", "%26%"))))
+
+ GvComplementoPagos.Columns(6).Visible = False
+ GvComplementoPagos.Columns(7).Visible = False
+ GvComplementoPagos.Columns(8).Visible = False
+
End If
+
+
+
End If
End Sub
diff --git a/Bancos/PrestamoPersonal.aspx.cs b/Bancos/PrestamoPersonal.aspx.cs
index f9674a6bb..2ecb1b234 100644
--- a/Bancos/PrestamoPersonal.aspx.cs
+++ b/Bancos/PrestamoPersonal.aspx.cs
@@ -106,6 +106,17 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas
txtFechaF.Text = DateTime.Now.ToShortDateString();
TxtImporte.Attributes.Add("disabled", "disabled");
+ if(UsuarioActual.Empresa.Funcionalidad(281).ToEntero() == 1)
+ {
+ TxtFechaPrestamo.Enabled = false;
+ ImgCalendarioPrestamo.Visible = false;
+
+ TxtFechaDocumento.Enabled = false;
+ ImgCalendario.Visible = false;
+
+ }
+
+
}
}
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index 579c5f9a5..f2f1c99fe 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -1333,9 +1333,9 @@ Partial Class Compras_Compras
ViewState("CveFactura") = Request("CveFactura").ToEntero
Dim RFC As String = CargaFactura(CveFactura)
- If Not VerificarProductosSATPS() Then
- Exit Sub
- End If
+ 'If Not VerificarProductosSATPS() Then
+ ' Exit Sub
+ 'End If
If RFC.Trim <> String.Empty Then
DdlProveedor.Visible = False
HplProveedor.Visible = True
@@ -1663,14 +1663,10 @@ Partial Class Compras_Compras
If Not UsuarioActual.Empresa.Funcionalidad(529) = "1" Then
'verificacion doble, si no la han cancelado, ya tiene una validaci[on para que llegue aqui
-
-
-
Dim SWatch As New Stopwatch
SWatch.Start()
Dim ts As New TimeSpan
-
Dim Valida As New ClsValidaCFDi(dr("UUID").ToString(), dr("RFCDe").ToString, dr("RFCPara").ToString(), dr("Total").ToString.ToDecimal)
SWatch.Stop()
@@ -1764,6 +1760,21 @@ Partial Class Compras_Compras
SubTotalConceptos = Math.Round(TmpDT.SUM("Total"), 2).ToDecimal
AddPS2(False)
+
+ 'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
+ Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
+ For Each drr As DataRow In TmpDT.FiltraParametros("ClaveProdServ = '01010101'").Rows
+
+ ProductosCodigoSATNoPermitidos.AppendFormat("{0}", drr("PS"))
+
+ Next
+
+ If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
+ Dim mensajeAdvertencia As String = String.Format("El comprobante contiene productos con código SAT '01010101', revise los productos:{0}", ProductosCodigoSATNoPermitidos.ToString)
+ Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
+
+ End If
+
End If
Else
CargaConceptosXML(XMLDoc)
@@ -1785,8 +1796,6 @@ Partial Class Compras_Compras
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
ChkAplicaNotaCredito.Enabled = False
-
-
DdlTipoCompra.Items.Clear()
DdlTipoCompra.Items.Add(New ListItem("Seleccione", "-1"))
DdlTipoCompra.Items.Add(New ListItem("NC Con Productos", "6"))
@@ -4015,7 +4024,7 @@ Partial Class Compras_Compras
If UsuarioActual.Empresa.Funcionalidad(702) = "1" Then
If Not EstaAsociadoACajaChica And Not EstaAsociadoAPersonal Then
If Not CompraEstaVinculadaOC Then
- Alert("Debe de vincular una orden de compra para realizar esta factura")
+ Alert("Debe de vincular una orden de compra para registrar la factura")
Exit Sub
End If
End If
@@ -15469,21 +15478,21 @@ Partial Class Compras_Compras
Dim DiferenciaPermitida = 1
Dim Cont = 0
'Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
- 'For Each gvr As GridViewRow In GvOC1.Rows
- ' SubTotalGV += gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal
- ' If Cont = 0 Then DdlProveedorSucursal.SelectedValueExist(gvr.DataKey("CveProveedorSucursal").ToEntero())
- ' Cont = 1
- ' If GvOC1.Columns(6).Visible Then
- ' Dim SatPS As String = gvr.FCDropDownLost("DdlSATPS").SelectedText()
- ' Dim NombreProducto As String = gvr.FCLabel("LbProductoServicio").Text
- ' If SatPS.Contains("01010101") Then
- ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}", NombreProducto)
- ' 'Dim mensajeAdvertencia As String = String.Format("Al vincular una Orden de Compra no se permiten productos con Producto/Servicio SAT igual a '{0}', revise el producto '{1}' en Orden(es) de Compra Vinculada(s)", SatPS, NombreProducto)
- ' 'Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
+ For Each gvr As GridViewRow In GvOC1.Rows
+ SubTotalGV += gvr.FCTextBox("TxtTotalOC1").Text.ToDecimal
+ If Cont = 0 Then DdlProveedorSucursal.SelectedValueExist(gvr.DataKey("CveProveedorSucursal").ToEntero())
+ Cont = 1
+ ' If GvOC1.Columns(6).Visible Then
+ ' Dim SatPS As String = gvr.FCDropDownLost("DdlSATPS").SelectedText()
+ ' Dim NombreProducto As String = gvr.FCLabel("LbProductoServicio").Text
+ ' If SatPS.Contains("01010101") Then
+ ' ProductosCodigoSATNoPermitidos.AppendFormat("{0}", NombreProducto)
+ ' 'Dim mensajeAdvertencia As String = String.Format("Al vincular una Orden de Compra no se permiten productos con Producto/Servicio SAT igual a '{0}', revise el producto '{1}' en Orden(es) de Compra Vinculada(s)", SatPS, NombreProducto)
+ ' 'Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
- ' End If
- ' End If
- 'Next
+ ' End If
+ ' End If
+ Next
'If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
' Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:{0}", ProductosCodigoSATNoPermitidos.ToString)
' Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
@@ -20245,37 +20254,35 @@ Partial Class Compras_Compras
End Sub
- Private Function VerificarProductosSATPS() As Boolean
- Dim CvePSGRuposAux As New StringBuilder("")
- For Each gvr As GridViewRow In GvPS.Rows
- Dim CvePSIndividual As String = gvr.DataKey("CvePS")
- CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual)
- Next
+ 'Private Function VerificarProductosSATPS() As Boolean
+ ' Dim CvePSGRuposAux As New StringBuilder("")
+ ' For Each gvr As GridViewRow In GvPS.Rows
+ ' Dim CvePSIndividual As String = gvr.DataKey("CvePS")
+ ' CvePSGRuposAux.AppendFormat("{0},", CvePSIndividual)
+ ' Next
- If CvePSGRuposAux.Length > 0 Then
- Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1)
+ Dim CvePSGRupos As String = Left(CvePSGRuposAux.ToString, CvePSGRuposAux.Length - 1)
- Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux))
+ Dim PSSat As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CvePS IN ({0})", CvePSGRuposAux))
- Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
- For Each PS As GridViewRow In GvPS.Rows
- Dim PSIndividual As String = PS.DataKey("PS")
- Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual))
- If ClavePSSAT = "46920" Then
- ProductosCodigoSATNoPermitidos.AppendFormat("{0}", PSIndividual)
- End If
- Next
-
- If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
- Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:{0}", ProductosCodigoSATNoPermitidos.ToString)
- Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
- Return False
+ Dim ProductosCodigoSATNoPermitidos As New StringBuilder("")
+ For Each PS As GridViewRow In GvPS.Rows
+ Dim PSIndividual As String = PS.DataKey("PS")
+ Dim ClavePSSAT As String = PSSat.FiltroPrimeroValor("CveSATPS", String.Format("PS = '{0}'", PSIndividual))
+ If ClavePSSAT = "46920" Then
+ ProductosCodigoSATNoPermitidos.AppendFormat("{0}", PSIndividual)
End If
- End If
+ Next
- Return True
+ If ProductosCodigoSATNoPermitidos.ToString.Length > 0 Then
+ Dim mensajeAdvertencia As String = String.Format("No se permite vinculación de productos con código SAT '01010101', revise los productos:{0}", ProductosCodigoSATNoPermitidos.ToString)
+ Alert(mensajeAdvertencia, TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
- End Function
+ ' Return True
+
+ 'End Function
End Class
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 49ae7b3d6..25b566e4d 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -937,7 +937,10 @@ Partial Class PopUpVerFactura
'se rellena la sucursal
'Vta.Subproyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SucursalModel)
Dim CveSubProyecto As Integer = dtVentas(0)("CveSubProyecto").ToString().ToEntero()
- Vta.SubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto).Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
+
+ Dim DtSubProyecto = GlobalDTSubProyectos(-1, CveSubProyecto:=CveSubProyecto, CveEmpresa:=dtVentas(0)("CveEmpresa").ToString().ToEntero())
+
+ Vta.SubProyecto = DtSubProyecto.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
'Vta.SubProyecto = ObjVentas.DtResultados.Rows(0).DataRowToObject(Of Modelos.SubProyectoModel)
Vta.Cliente = New Modelos.ClienteModel
Vta.Cliente.Nombre = dtVentas(0)("ClienteNombre").ToString
diff --git a/Compras/ReembolsosComprobaciones.aspx b/Compras/ReembolsosComprobaciones.aspx
index 760c32799..02d0f7f59 100644
--- a/Compras/ReembolsosComprobaciones.aspx
+++ b/Compras/ReembolsosComprobaciones.aspx
@@ -292,7 +292,7 @@
+ DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContAcreedor,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,IVADeducible,IVANoDeducible,CveTipoConcepto,CveSubProyecto">
diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb
index 08040c50e..059f71e5b 100644
--- a/Inventarios/EntradasSalidas.aspx.vb
+++ b/Inventarios/EntradasSalidas.aspx.vb
@@ -275,6 +275,7 @@ Partial Class Inventarios_EntradasSalidas
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
+
If Not IsPostBack Then
CveMovimiento = -1
@@ -289,6 +290,7 @@ Partial Class Inventarios_EntradasSalidas
CreaDT()
CargaCombos()
TxtFecha.Text = Now.ToShortDateString
+ TxtFechaInvFisico.Text = Now.ToShortDateString
RVFecha.MaximumValue = Now.ToShortDateString
If Not UsuarioActual.CveEmpresa = 48 Then
@@ -350,7 +352,25 @@ Partial Class Inventarios_EntradasSalidas
PermisoVerImportes()
End If
+
+ If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
+
+ TxtFecha.Enabled = False
+ ImgFecha.Visible = False
+
+ TxtFechaInvFisico.Enabled = False
+ ImgFechaInvFisico.Visible = False
+
+ UpGenerales.Update()
+ UpModalInventarioFisico.Update()
+
+ End If
+
End If
+
+
+
+
End Sub
#Region " PERMISOS PAGINAS "
@@ -927,6 +947,21 @@ Partial Class Inventarios_EntradasSalidas
'BtnGuardar.Visible = False
End If
+
+ If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
+
+ TxtFecha.Enabled = False
+ ImgFecha.Visible = False
+
+ TxtFechaInvFisico.Enabled = False
+ ImgFechaInvFisico.Visible = False
+
+
+
+
+ End If
+
+ UpModalInventarioFisico.Update()
BloqueaEdicionEncabezado()
Mov.Dispose()
UpGenerales.Update()
diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index 6d6e99153..b3997b144 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -263,6 +263,14 @@ Partial Class Inventarios_EntregaAlmacen
InicializaValores()
CargaParametrosAD()
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True
+
+ If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
+
+ TxtFecha.Enabled = False
+ ImgFecha.Visible = False
+
+ End If
+
End If
End Sub
@@ -2040,12 +2048,13 @@ Partial Class Inventarios_EntregaAlmacen
CantidadPendiente = 1
- If CBool(Dr("AplicaSeccion")) Then
- CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen)
- Else
- CveSeccionAlmacen = -1
- End If
+ 'If CBool(Dr("AplicaSeccion")) Then
+ ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr2("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
+ ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr2("CveAlmacen"), Dr("CvePS"), CveSeccionAlmacen)
+ 'Else
+ ' CveSeccionAlmacen = -1
+ 'End If
+ CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, CantidadPendiente.ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, 0, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
@@ -2501,12 +2510,14 @@ Partial Class Inventarios_EntregaAlmacen
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
Exit For
End If
- If CBool(Dr("AplicaSeccion")) Then
- CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen)
- Else
- CveSeccionAlmacen = -1
- End If
+ 'If CBool(Dr("AplicaSeccion")) Then
+ ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenOrigen, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
+ ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", CveAlmacenOrigen, Dr("CvePS"), CveSeccionAlmacen)
+ 'Else
+ ' CveSeccionAlmacen = -1
+ 'End If
+ CveSeccionAlmacen = -3
+
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
TextoError.AppendFormat("Ocurrió un error al guardar los movimientos de control de apartados")
@@ -2535,12 +2546,13 @@ Partial Class Inventarios_EntregaAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
- If CBool(Dr("AplicaSeccion")) Then
- CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS"), CveSeccionAlmacen)
- Else
- CveSeccionAlmacen = -1
- End If
+ 'If CBool(Dr("AplicaSeccion")) Then
+ ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
+ ' Dim a As String = String.Format("CveAlmacen={0}-CvePS:{1}-CveseccionAlmacen={2}", Dr1("CveAlmacen").ToString.ToEntero, Dr("CvePS"), CveSeccionAlmacen)
+ 'Else
+ ' CveSeccionAlmacen = -1
+ 'End If
+ CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaApartado, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, CveSeccionAlmacen:=CveSeccionAlmacen) Then
ErrorMovInv = True
@@ -3124,11 +3136,12 @@ Partial Class Inventarios_EntregaAlmacen
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim CveSeccionAlmacen As Integer = -1
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
- If CBool(Dr("AplicaSeccion")) Then
- CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Else
- CveSeccionAlmacen = -1
- End If
+ 'If CBool(Dr("AplicaSeccion")) Then
+ ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
+ 'Else
+ ' CveSeccionAlmacen = -1
+ 'End If
+ CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
ErrorMovInv = True
diff --git a/Inventarios/PopUpExistenciasAlmacen.aspx b/Inventarios/PopUpExistenciasAlmacen.aspx
index eec03b6a6..2528fc984 100644
--- a/Inventarios/PopUpExistenciasAlmacen.aspx
+++ b/Inventarios/PopUpExistenciasAlmacen.aspx
@@ -46,7 +46,7 @@
-
+
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 5022d6ebb..ba9bcf526 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -399,6 +399,14 @@ Partial Class Inventarios_RecepcionAlmacen
CargaPermisos()
If UsuarioActual.CveEmpresa.Contiene(72, 80) Then DdlAlmacen.AutoPostBack = True
+ If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
+
+ TxtFecha.Enabled = False
+ ImgFecha.Visible = False
+
+ End If
+
+
End If
End Sub
@@ -2637,12 +2645,8 @@ Partial Class Inventarios_RecepcionAlmacen
ErrorMovInv = True
Exit For
End If
- If CBool(Dr("AplicaSeccion")) Then
- CveSeccionDestino = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenDestino, Dr("CvePS").ToString.ToEntero).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Else
- CveSeccionDestino = -1
- End If
+ CveSeccionDestino = -3 'se madna este dato, para que el trigger, obtenga la seccion automaticamente
If Not ObjInventario.AddMovimientoDetalle(CveMovtoEntradaActual, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=CveSeccionDestino, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
ErrorMovInv = True
diff --git a/Inventarios/RepApartados.aspx b/Inventarios/RepApartados.aspx
index 6cb599ee9..c9cbef7a0 100644
--- a/Inventarios/RepApartados.aspx
+++ b/Inventarios/RepApartados.aspx
@@ -1,116 +1,179 @@
-<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepApartados.aspx.vb" Inherits="Inventarios_RepApartados" %>
-
-
-
-
-
-
- Apartados | Reporte de apartados - Detalle
-
-
-
+
+
+
+
diff --git a/Inventarios/RepApartados.aspx.vb b/Inventarios/RepApartados.aspx.vb
index a5f0bd02d..cb2b86a4d 100644
--- a/Inventarios/RepApartados.aspx.vb
+++ b/Inventarios/RepApartados.aspx.vb
@@ -6,9 +6,9 @@ Imports Extensiones
Imports Microsoft.Reporting.WebForms
Partial Class Inventarios_RepApartados
- Inherits ClsPaginas
-
-
+ Inherits ClsPaginas
+
+
#Region " PROPIEDADES "
Private Property DtApartados As DataTable
Get
@@ -17,18 +17,18 @@ Partial Class Inventarios_RepApartados
Set(value As DataTable)
ViewState("DtApartados") = value
End Set
- End Property
+ End Property
#End Region
-
-
+
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
SetValues()
InicializaParam()
End If
- End Sub
-
-
+ End Sub
+
+
#Region " SET VALUES "
Private Sub SetValues()
DdlSubProyectos.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa)
@@ -42,6 +42,15 @@ Partial Class Inventarios_RepApartados
DdlClientesWS.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
DdlClientesWS.DataBind()
DdlClientesWS.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
+ End If
+
+ If UsuarioActual.CveEmpresa = 119 Then
+ DdlClienteTraspasar.setEsWebService(True)
+ Else
+ DdlClienteTraspasar.setEsWebService(False)
+ DdlClienteTraspasar.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa, -1)
+ DdlClienteTraspasar.DataBind()
+ DdlClienteTraspasar.ddl.Items.Insert(0, New ListItem("Todos", "-1"))
End If
Dim DTVendedores As New DataTable
@@ -68,9 +77,9 @@ Partial Class Inventarios_RepApartados
txtFechaI.Text = Now.FirstDayOfMonth.ToShortDateString
txtFechaF.Text = Now.ToShortDateString
- End Sub
+ End Sub
#End Region
-
+
Private Sub InicializaParam()
Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String
Dim CveCliente, CveVendedor, CveSucursal, CvePS As String
@@ -127,7 +136,10 @@ Partial Class Inventarios_RepApartados
Else
DdlClientesWS.SelectedValue = CveCliente
DdlClientesWS.SelectedText = "Todos"
- End If
+ End If
+
+ DdlClienteTraspasar.SelectedValue = "-1"
+ DdlClienteTraspasar.SelectedText = "Seleccione"
DdlVendedor.SelectedValueExist(CveVendedor)
DdlSubProyectos.SelectedValueExist(CveSucursal)
@@ -162,12 +174,18 @@ Partial Class Inventarios_RepApartados
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.ApartadosRep(CveAlmacenApartado, DdlClientesWS.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlPS.SelectedValue.ToEntero, txtFechaI.Text.ToDate, txtFechaF.Text.ToDate) Then
- GvDatos.DataSource = ObjInventarios.DtResultados
DtApartados = ObjInventarios.DtResultados
- GvDatos.DataBind()
- UpDatos.Update()
End If
- ObjInventarios.Dispose()
+ ObjInventarios.Dispose()
+
+ GvDatos.DataSource = DtApartados
+ If DdlSubProyectos.SelectedValue.ToEntero() > 0 AndAlso DtApartados.COUNT("CveVendedor", $"CveVendedor={UsuarioActual.CveVendedor}") > 0 Then
+ GvDatos.Columns(6).Visible = True
+ LnkTraspasarApartados.Visible = True
+ End If
+ GvDatos.DataBind()
+ UpDatos.Update()
+ UpTraspasar.Update()
End Sub
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
@@ -182,14 +200,17 @@ Partial Class Inventarios_RepApartados
End If
If e.Row.DBCampo("IDGPO").ToString.ToEntero = 3 Then
-
+ If e.Row.DBCampo("CveVendedor").ToEntero() = UsuarioActual.CveVendedor Then
+ e.Row.FCTextBox("TxtCantidad").Visible = True
+ e.Row.FCRangeValidator("RVCantidad").Visible = True
+ End If
End If
End If
- End Sub
-
+ End Sub
+
#Region "PDF"
-
+
Private Sub LnkPdf_Click(sender As Object, e As EventArgs) Handles LnkPdf.Click
If DtApartados IsNot Nothing Then
Dim StrFiltro As New StringBuilder
@@ -226,7 +247,229 @@ Partial Class Inventarios_RepApartados
Private Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
GvDatos.ExportToExcel("Reporte de Apartados" & Now.ToShortDateString)
- End Sub
-
+ End Sub
+
#End Region
+ Protected Sub LnkTraspasarApartados_Click(sender As Object, e As EventArgs)
+
+ LtlAlmacen.Text = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=9).FiltroPrimeroValor("Almacen", $"CveSubProyecto={DdlSubProyectos.SelectedValue.ToEntero()}")
+
+ TxtObs.Text = ""
+ DdlClienteTraspasar.SelectedValue = "-1"
+ DdlClienteTraspasar.SelectedText = "Seleccione"
+ UpTraspasar.Update()
+ UpGenerarTraspaso.Update()
+
+ RegistraScript("$('#ModalTraspaso').modal('show');")
+
+ End Sub
+ Protected Sub BtnTraspasar_Click(sender As Object, e As EventArgs)
+
+ If DdlClienteTraspasar.SelectedValue.ToEntero() <= 0 Then
+ Alert("No se ha seleccionado ningun cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If Not GvDatos.Rows.Cast(Of GridViewRow).Any(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0) Then
+ Alert("No se ha seleccionado ningun cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim ErrorMovInv As Boolean = False
+ Dim Mensaje As StringBuilder = New StringBuilder
+
+ Dim SalidasAlmacen As New List(Of MMovimientoAlmacen)
+ Dim EntradasAlmacen As New List(Of MMovimientoAlmacen)
+
+ Dim ObjInventario As New ClsInventarios
+ ObjInventario.IniciaTransacSQL()
+
+ Try
+ Dim CveClienteTraspasar As Integer = DdlClienteTraspasar.SelectedValue.ToEntero()
+ Dim CveAlmacenApartado As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveTipoAlmacen:=9).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={DdlSubProyectos.SelectedValue.ToEntero()}").ToEntero()
+
+ Dim DtTraspaso As DataTable = CrearDTTraspasosClientes()
+
+ 'SE VAN A REALIZAR LOS MOVIMIENTOS POR CADA CLIENTE CONSIDERADO
+ For Each Row As DataRow In DtTraspaso.FiltraParametros("", DistinctColumns:={"CveCliente", "CveVendedor"}).Rows
+ 'SACA LOS PS A TRASPASAR
+ Dim DtPSTraspasar As DataTable = DtTraspaso.FiltraParametros($"CveCliente={Row("CveCliente")} AND CveVendedor={Row("CveVendedor")}")
+
+ 'CUADRA LOS LOS PRODUCTOS CON LO QUE SE PUEDE DESAPARTAR
+ Dim DtDetalleTraspasar As DataTable = CuadrarMovimientosApartado(CveAlmacenApartado, Row("CveCliente").ToString().ToEntero(), Row("CveVendedor").ToString().ToEntero(), DtPSTraspasar, ObjInventario)
+
+ DtPSTraspasar.Dispose()
+
+ Dim MovSalida = GenerarMovimientoAlmacen(CveAlmacenApartado, 8, Row("CveVendedor").ToString().ToEntero(), Row("CveCliente").ToString().ToEntero(), -1, TxtObs.Text.Trim(), DtDetalleTraspasar, ObjInventario, "RepApar/1")
+
+ DtDetalleTraspasar.Dispose()
+
+ ErrorMovInv = MovSalida.CveMovimiento <= 0
+
+ If Not ErrorMovInv Then
+
+ SalidasAlmacen.Add(MovSalida)
+
+ Dim MovEntrada = GenerarMovimientoAlmacen(CveAlmacenApartado, 9, UsuarioActual.CveVendedor, CveClienteTraspasar, MovSalida.CveMovimiento, TxtObs.Text.Trim(), Nothing, ObjInventario, "RepApar/2")
+
+ ErrorMovInv = MovEntrada.CveMovimiento <= 0
+
+ If Not ErrorMovInv Then
+ EntradasAlmacen.Add(MovEntrada)
+ End If
+
+ End If
+
+ Next
+
+
+ If Not ErrorMovInv Then
+ Mensaje.Append("Se realizó con éxito el traspaso.")
+
+ For Each MovSalida In SalidasAlmacen
+ Mensaje.AppendFormat("
Folio de Salida: {0}", MovSalida.Folio, MovSalida.CveMovimiento)
+ Mensaje.AppendFormat(" Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", MovSalida.CveMovimiento)))
+ Next
+
+ For Each MovEntrada In EntradasAlmacen
+ Mensaje.AppendFormat("
Folio de Entrada: {0}", MovEntrada.Folio, MovEntrada.CveMovimiento)
+ Mensaje.AppendFormat(" Imprimir Reporte", Encripta(String.Format("OP=Alm&CveMovimiento={0}", MovEntrada.CveMovimiento)))
+ Next
+
+ End If
+
+ RegistraScript("$('#ModalTraspaso').modal('hide');")
+
+ Alert(Mensaje.ToString(), If(ErrorMovInv, TipoMensaje.MsgError, TipoMensaje.MsgInformacion))
+
+ Catch ex As Exception
+ ErrorMovInv = True
+ OnError("Ocurrió un error al realizar el traspaso", ex)
+ End Try
+
+ If ErrorMovInv Then
+ ObjInventario.RollBack()
+ Else
+ ObjInventario.Commit()
+ End If
+ ObjInventario.Dispose()
+
+ CargaDatos()
+ End Sub
+ Private Function CuadrarMovimientosApartado(CveAlmacenApartado As Integer, CveCliente As Integer, CveVendedor As Integer, DtPSTraspasar As DataTable, ByRef ObjInventarios As ClsInventarios) As DataTable
+ Dim DtRetorno As DataTable = Nothing
+
+ Dim DtDesapartado As DataTable = Nothing
+
+ If ObjInventarios.DesapartadosGet(CveAlmacenApartado, CveCliente, CveVendedor, UsuarioActual.CveEmpresa) Then
+ DtDesapartado = ObjInventarios.DtResultados.Copy()
+ DtRetorno = DtDesapartado.Clone()
+ End If
+
+ If DtRetorno IsNot Nothing Then
+ For Each RowCantidad As DataRow In DtPSTraspasar.Rows
+ Dim Filtro As New StringBuilder
+ Filtro.AppendFormat("CvePS={0}", RowCantidad("CvePS"))
+
+ 'SI TIENE SERIE LA AGREGA AL FILTRO
+ If Not String.IsNullOrEmpty(RowCantidad("Serie").ToString()) Then
+ Filtro.AppendFormat("AND Serie='{0}'", RowCantidad("Serie"))
+ Else
+ Filtro.AppendFormat("AND ISNULL(Serie,'') = ''")
+ End If
+
+ Dim RowDesapartado As DataRow = DtDesapartado.Select(Filtro.ToString()).FirstOrDefault()
+ RowDesapartado("Cantidad") = RowCantidad("Cantidad")
+
+ DtRetorno.Rows.Add(RowDesapartado.ItemArray)
+ Next
+ End If
+
+ Return DtRetorno
+ End Function
+
+ Private Function CrearDTTraspasosClientes() As DataTable
+ Dim Dt As New DataTable
+
+ Dt.Columns.Add(New DataColumn("Cantidad", GetType(Integer)))
+ Dt.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
+ Dt.Columns.Add(New DataColumn("Serie", GetType(String)))
+ Dt.Columns.Add(New DataColumn("CveCliente", GetType(Integer)))
+ Dt.Columns.Add(New DataColumn("CveVendedor", GetType(Integer)))
+
+ For Each GvRow As GridViewRow In GvDatos.Rows.Cast(Of GridViewRow).Where(Function(gvr) gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0)
+ Dim Row As DataRow = Dt.NewRow
+
+ Row("Cantidad") = GvRow.FCTextBox("TxtCantidad").Text.ToEntero()
+ Row("CvePS") = GvRow.DataKey("CvePS").ToEntero()
+ Row("Serie") = GvRow.DataKey("Serie")
+ Row("CveCliente") = GvRow.DataKey("CveCliente").ToEntero()
+ Row("CveVendedor") = GvRow.DataKey("CveVendedor").ToEntero()
+
+ Dt.Rows.Add(Row)
+ Next
+
+ Return Dt
+ End Function
+
+ Private Function GenerarMovimientoAlmacen(CveAlmacen As Integer, CveConceptoAlmacen As Integer, CveVendedor As Integer, CveCliente As Integer, CveMovimientoRelacionado As Integer, Obs As String, DtDetalle As DataTable, ObjInventario As ClsInventarios, Modulo As String) As MMovimientoAlmacen
+ Dim ErrorMovInv As Boolean = False
+ Dim Retorno As New MMovimientoAlmacen
+
+ Dim CveMovimiento As Integer = -1
+ Dim Folio As Integer = -1
+
+ CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, CveConceptoAlmacen, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1,
+ -1, -1, -1, Observaciones:=Obs,
+ MovimientoFijo:=True, CveMovimientoRelacionado:=CveMovimientoRelacionado, CveVendedor:=CveVendedor, CveCliente:=CveCliente, Modulo:=Modulo)
+ Folio = ObjInventario.Folio
+
+ If Not CveMovimiento > 0 Then
+ ErrorMovInv = True
+ End If
+
+ 'SI ES MOVIMIENTO DE SALIDA TOMA DE LA TABLA DONDE SE CUADRARON LOS MOVIMIENTOS
+ If Not ErrorMovInv AndAlso DtDetalle IsNot Nothing AndAlso CveMovimientoRelacionado <= 0 AndAlso CveConceptoAlmacen = 8 Then
+ For Each Dr As DataRow In DtDetalle.Rows
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal(), -1, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
+ ErrorMovInv = True
+ Exit For
+ End If
+ Next
+ 'SI ES MOVIMIENTO DE ENTRADA TOMA LOS DATOS DEL MOVIMIENTO DE SALIDA
+ ElseIf Not ErrorMovInv AndAlso DtDetalle Is Nothing AndAlso CveMovimientoRelacionado > 0 AndAlso CveConceptoAlmacen = 9 Then
+ Dim DtMovimientoDetalle As DataTable = Nothing
+
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoRelacionado, UsuarioActual.CveEmpresa) Then
+ DtMovimientoDetalle = ObjInventario.DtResultados.Copy()
+ Else
+ ErrorMovInv = True
+ End If
+
+ If Not ErrorMovInv AndAlso DtMovimientoDetalle IsNot Nothing Then
+ For Each Dr As DataRow In DtMovimientoDetalle.Rows
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero) Then
+ ErrorMovInv = True
+ Exit For
+ End If
+ Next
+ End If
+
+ DtMovimientoDetalle.Dispose()
+ End If
+
+ If Not ErrorMovInv Then
+ Retorno.CveMovimiento = CveMovimiento
+ Retorno.Folio = Folio
+ Retorno.CveConcepto = CveConceptoAlmacen
+ End If
+
+ Return Retorno
+ End Function
+End Class
+
+Public Class MMovimientoAlmacen
+ Public Property CveMovimiento As Integer
+ Public Property Folio As Integer
+ Public Property CveConcepto As Integer
End Class
\ No newline at end of file
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index edb1228f1..efb17de68 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -228,6 +228,18 @@ Partial Class Inventarios_TraspasoAlmacen
TipoSeccionAlmacen = 0
+
+
+ If UsuarioActual.Empresa.Funcionalidad(281).ToEntero = 1 Then
+
+ TxtFecha.Enabled = False
+ ImgFecha.Visible = False
+
+ TxtFechaRecepcion.Enabled = False
+ ImgFechaRecepcion.Visible = False
+
+ End If
+
Else
If ChkTransitorio.Checked Then
RegistraScript("$('#DivTransitorio').show(0);$('#DivGastoIndirecto').show(0);$('#DivDocChofer').show(0);")
diff --git a/Planeacion/CatSubProyectos.aspx.vb b/Planeacion/CatSubProyectos.aspx.vb
index f2d679fd2..9b1b67cba 100644
--- a/Planeacion/CatSubProyectos.aspx.vb
+++ b/Planeacion/CatSubProyectos.aspx.vb
@@ -81,12 +81,8 @@ Partial Class CatSubProyectos
End If
End Sub
- Private Sub RecargaGlobal()
- Dim ObjSubProyectos As New ClsSubProyectos
- If ObjSubProyectos.GetSubProyectos(UsuarioActual.CveEmpresa) Then
- GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = ObjSubProyectos.DtResultados
- End If
- ObjSubProyectos.Dispose()
+ Private Sub RecargaGlobal()
+ GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
End Sub
#Region "O R D E N A M I E N T O"
diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb
index 88f01e6ec..d37d08cc2 100644
--- a/Sistemas/CatSesiones.aspx.vb
+++ b/Sistemas/CatSesiones.aspx.vb
@@ -419,7 +419,7 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaBancosCuentas()
Dim Banc As New ClsBancos
- If Banc.GetBancosCuentasUsuarios(-1) Then Application("GlobalDTBancosCuentas") = Banc.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing
+ If Banc.GetBancosCuentasUsuarios(-1, UsuarioActual.CveEmpresa) Then Application("GlobalDTBancosCuentas") = Banc.DtResultados Else Application("GlobalDTBancosCuentas") = Nothing
Banc.Dispose()
End Sub
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index de17079a9..ad9f29627 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -1902,7 +1902,7 @@ Partial Class Clientes
GvDireccionesEnvio.DataBind()
If TxtRFC.Text = "XAXX010101000" Then
- GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente"
+ If GvDireccionesEnvio.HeaderRow IsNot Nothing AndAlso GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal") IsNot Nothing Then GvDireccionesEnvio.HeaderRow.FCLiteral("LtlNombreSucursal").Text = "Cliente"
LtlNombreSucursal.Text = "Cliente"
LtlNombreSucursalTitulo.Text = "Cliente"
LtlTituloSurcusalCliente.Text = "Datos del cliente"
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index f66c6c5ef..81c0b9d88 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5263,7 +5263,7 @@ Partial Class Ventas
DdlSucursalCliente.DataBind()
'SI UTILIZA EL RFC GENERICO PERMITE FACTURAR SUCURSAL
- If (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then
+ If (Not UsuarioActual.CveEmpresa.Contiene(141)) AndAlso (CveVenta <= 0 OrElse NuevaFactura = 1) AndAlso LblRFC.Text.Trim() = "XAXX010101000" Then
HabilitarFacturacionSucursal()
End If
@@ -5663,7 +5663,7 @@ Partial Class Ventas
End If
'SI EL CLIENTE TIENE RFC GENERICO Y LA SUCURSAL TIENE RFC DEBE FACTURAR LA SUCURSAL
- If LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then
+ If (Not UsuarioActual.CveEmpresa.Contiene(141)) AndAlso LblRFC.Text.Trim() = "XAXX010101000" AndAlso Not String.IsNullOrEmpty(ObjCliente.DtResultados.Rows(0)("RFC").ToString()) Then
Me.FacturarSucursal = True
LtlTitleRFCSucursal.Text = "RFC:"
@@ -12073,8 +12073,8 @@ Partial Class Ventas
Exit For
End If
End If
- Dim CveSeccionAlmacen As Integer = -1
- If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero
+ Dim CveSeccionAlmacen As Integer = -3
+ 'If AplicaSeccion Then CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacen, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen", "").ToEntero
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Dr("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
OcurrioError = True
@@ -14555,116 +14555,116 @@ Partial Class Ventas
If UsuarioActual.TienePermisoProceso(68) AndAlso Not PSCodigoSAT.Contiene("84111506", "80141610") Then TxtPrecio.Enabled = False
If TmpDT IsNot Nothing AndAlso TmpDT.Rows.Count = 0 Then
- DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString())
- CambiaMoneda()
+ DdlMoneda.SelectedValueExist(drPS("CveMoneda").ToString())
+ CambiaMoneda()
+ End If
+
+ 'SUGIERE PRECIO
+ Dim PrecioSugerido = 0.0
+ PrecioSugerido = drPS("Precio").ToString().ToDouble
+
+ If UsuarioActual.CveEmpresa.Contiene(1) Then
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetPorcentajeProductos(CveCliente) Then
+ Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
+ If PrecioAplicado > 0 Then
+ PrecioSugerido = PrecioAplicado
+ End If
+ End If
+ ObjPS.Dispose()
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
+ Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
+ ' si es 10. primero el cliente
+ Dim CvePrecioListaPS As Integer
+ Dim PorcentajePrecio As Double = 0
+
+ If TipoPrecioLista = 10 Then
+
+ CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
+ If CvePrecioListaPS <= 0 Then
+
+ CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
+
+ End If
+
+ Else
+
+ CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
+ If CvePrecioListaPS <= 0 Then
+
+ CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
+
+ End If
+
End If
- 'SUGIERE PRECIO
- Dim PrecioSugerido = 0.0
- PrecioSugerido = drPS("Precio").ToString().ToDouble
-
- If UsuarioActual.CveEmpresa.Contiene(1) Then
+ If CvePrecioListaPS > 0 Then
Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPorcentajeProductos(CveCliente) Then
- Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
- If PrecioAplicado > 0 Then
- PrecioSugerido = PrecioAplicado
- End If
+ If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
+ PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
+ PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
End If
ObjPS.Dispose()
End If
- If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
- Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
- ' si es 10. primero el cliente
- Dim CvePrecioListaPS As Integer
- Dim PorcentajePrecio As Double = 0
-
- If TipoPrecioLista = 10 Then
-
- CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
- If CvePrecioListaPS <= 0 Then
-
- CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
-
- End If
-
- Else
-
- CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
- If CvePrecioListaPS <= 0 Then
-
- CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
-
- End If
-
+ If PrecioSugerido = 0 Then
+ Dim ObjInventarios As New ClsInventarios
+ Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
+ 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
+ If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
+ ObjInventarios.Dispose()
+ If CostoPS > 0 And PorcentajePrecio > 0 Then
+ PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
End If
-
- If CvePrecioListaPS > 0 Then
- Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
- PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
- PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
- End If
- ObjPS.Dispose()
- End If
-
- If PrecioSugerido = 0 Then
- Dim ObjInventarios As New ClsInventarios
- Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
- 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
- If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
- ObjInventarios.Dispose()
- If CostoPS > 0 And PorcentajePrecio > 0 Then
- PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
- End If
- End If
- CvePrecioLista = CvePrecioListaPS
End If
+ CvePrecioLista = CvePrecioListaPS
+ End If
- 'Dim ObjClasificaciones As New ClsClasificaciones
- 'If ObjClasificaciones.GetClasificaciones() Then
- ' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
- 'End If
+ 'Dim ObjClasificaciones As New ClsClasificaciones
+ 'If ObjClasificaciones.GetClasificaciones() Then
+ ' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
+ 'End If
- If PrecioSugerido > 0 Then
- Dim PrecioBaseCosto As Decimal = 0
- PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
+ If PrecioSugerido > 0 Then
+ Dim PrecioBaseCosto As Decimal = 0
+ PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
- If PrecioBaseCosto > 0 Then
- PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
- End If
- TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
+ If PrecioBaseCosto > 0 Then
+ PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
End If
+ TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
+ End If
- If IsNumeric(TxtCantidad.Text.Trim) Then
- LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2)
+ If IsNumeric(TxtCantidad.Text.Trim) Then
+ LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2)
+ Else
+ LblTotalPS.Text = "0.00"
+ End If
+ LblPrecio1.Text = TxtPrecio.Text
+ UPPDescuento.Update()
+
+ HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString()
+ HdnIVARetAPS.Value = drPS("RetIVA").ToString()
+ HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString()
+ HdnCtaContable.Value = drPS("IdCtaContVentas").ToString()
+ HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString()
+ HdnCodigo.Value = drPS("Codigo").ToString()
+ If DdlClasificacion.SelectedIndex = 0 Then
+ If drPS("CveClasificacion").ToString() IsNot Nothing Then
+ DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString())
Else
- LblTotalPS.Text = "0.00"
- End If
- LblPrecio1.Text = TxtPrecio.Text
- UPPDescuento.Update()
-
- HdnIVAPS.Value = If(drPS("IVA").ToString() = "-1", ViewState("IVA"), drPS("IVA").ToString()).ToString()
- HdnIVARetAPS.Value = drPS("RetIVA").ToString()
- HdnAsientoContable.Value = drPS("AsientoContableVentas").ToString()
- HdnCtaContable.Value = drPS("IdCtaContVentas").ToString()
- HdnAplicaParaConcepto.Value = drPS("AplicaParaConcepto").ToString()
- HdnCodigo.Value = drPS("Codigo").ToString()
- If DdlClasificacion.SelectedIndex = 0 Then
- If drPS("CveClasificacion").ToString() IsNot Nothing Then
- DdlClasificacion.SelectedValueExist(drPS("CveClasificacion").ToString())
- Else
- Alert("El Productos/Servicio no tiene asignada una Clasificación.", TipoMensaje.MsgInformacion)
- End If
-
+ Alert("El Productos/Servicio no tiene asignada una Clasificación.", TipoMensaje.MsgInformacion)
End If
End If
- ElseIf CvePSParametro = -2 Then
+ End If
+
+ ElseIf CvePSParametro = -2 Then
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), Ddl)
End If
@@ -15774,7 +15774,7 @@ Partial Class Ventas
End If
'VERIFICA SI EN LA FACTURA PADRE SE DESGLOSO EL IEPS
- Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Me.ObjFacturaNC.VentaDesglosaIEPS))
+ Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Not Me.ObjFacturaNC.VentaDesglosaIEPS))
If Not ClienteDesglosaIEPS Then
If Not RegeneraIEPS AndAlso Not FacturaDesglosoIEPS Then
@@ -21609,11 +21609,12 @@ Partial Class Ventas
Return False
End If
- If AplicaSeccion Then
- CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Else
- CveSeccionAlmacen = -1
- End If
+ 'If AplicaSeccion Then
+ ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
+ 'Else
+ ' CveSeccionAlmacen = -1
+ 'End If
+ CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, 1, CveUnidad, CveProducto, 0, -1, Serie:=Dr2("Serie").ToString(), CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
@@ -21625,11 +21626,12 @@ Partial Class Ventas
Return False
End If
- If AplicaSeccion Then
- CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
- Else
- CveSeccionAlmacen = -1
- End If
+ 'If AplicaSeccion Then
+ ' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, CveAlmacenExistenciasContrato, CveProducto).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero
+ 'Else
+ ' CveSeccionAlmacen = -1
+ 'End If
+ CveSeccionAlmacen = -3
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaConsignacion, Cantidad, CveUnidad, CveProducto, 0, -1, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False