This commit is contained in:
rakcsle
2021-11-02 17:31:14 -07:00
12 changed files with 971 additions and 343 deletions

View File

@@ -3,14 +3,7 @@
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Catálogo de Choferes
@@ -212,12 +205,11 @@
<%--<asp:TextBox ID="TxtResidenciaFiscalOperador" runat="server" CssClass="form-control" CausesValidation="true" MaxLength="50"></asp:TextBox>--%>
<asp:DropDownList runat="server" ID="DdlResidenciaFiscalOperador" CssClass="form-control select2me" Width="100%" >
<asp:ListItem Value="-1">Seleccione una</asp:ListItem>
<asp:ListItem Value="">-</asp:ListItem>
<asp:ListItem Value="MEX">MEX</asp:ListItem>
<asp:ListItem Value="USA">USA</asp:ListItem>
<asp:ListItem Value="CAN">CAN</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlResidenciaFiscalOperador" InitialValue="-1" runat="server" CssClass="help-block errorimput" ControlToValidate="DdlResidenciaFiscalOperador" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Residencia Fiscal Operador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpObligatorio"></asp:RequiredFieldValidator>
<label for="<%= DdlResidenciaFiscalOperador.ClientID.ToString()%>">Residencia Fiscal Operador:</label>
<i></i>
</div>

View File

@@ -60,7 +60,6 @@
<li>
<asp:LinkButton runat="server" ID="BtnAgregarFolioGarantia" data-toggle="tooltip" data-placement="left" title="Agregar un Folio de Garantía" Text="<i class='fa fa-plus'></i> Agregar Folio "></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
@@ -71,12 +70,12 @@
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server" DefaultButton="BtnConsultar">
<div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle" style="min-height: 49px;">
<div class="portlet-title portlet-filterT smalltitle">
<div class="tools">
<asp:Button Text="Consultar" ID="BtnConsultar" CssClass="btn btn-primary" OnClick="BtnConsultar_Click" runat="server" />
</div>
<div class="titlefiltros caption ">
<div class="row" style="padding-top: 10px;">
<div class="row" style="padding-top: 0px;">
<label class="col-md-1 truncate">Tipo Folio:</label>
<div class="col-md-2 ">
<%-- <asp:DropDownList ID="DdlSucursal" runat="server" CssClass="select2me" DataTextField="Sucursal" DataValueField="CveSucursal" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>--%>
@@ -108,12 +107,12 @@
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpGral" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row">
<div class="Widthall" style="text-align: right!important; margin-top: 20px!important; margin-bottom: 2px!important">
<div class="Widthall" style="text-align: right!important; margin-top: 2px!important; margin-bottom: 2px!important">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFolioGarantia.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvFolioGarantia.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>

View File

@@ -1285,7 +1285,7 @@ Public Class ClsInventarios
Optional CveSeccionAlmacen As Integer = -1, Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha,
Optional Observaciones As String = "", Optional CveMovimientoDetalleEntrada As Integer = -1, Optional PUTC As Decimal = -1,
Optional CostoIndirecto As Decimal = 0, Optional CveCompraDetalle As Integer = -1, Optional CveOrdenCompraDetalle As Integer = -1, Optional CveVentaDetalle As Integer = -1,
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetallePadre As Integer = -1) As Boolean
Optional CveContratoDetalle As Integer = -1, Optional CveUsuarioModifico As Integer = -1, Optional EsInterno As Integer = -1, Optional CveVentaDetalleRemision As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_MovimientosDetalleAdd")
@@ -1311,7 +1311,7 @@ Public Class ClsInventarios
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
.Add("@EsInterno", SqlDbType.Int).Value = EsInterno
.Add("@CveVentaDetallePadre", SqlDbType.Int).Value = CveVentaDetallePadre
.Add("@CveVentaDetalleRemision", SqlDbType.Int).Value = CveVentaDetalleRemision
.Add("@CveMovimientoDetalle", SqlDbType.Int).Direction = ParameterDirection.Output
End With

View File

@@ -376,6 +376,67 @@ Public Class ClsMovimientos
OnError("Ocurrió un error al obtener el Reporte de CxC Detalle.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function AddNotificacionEdoCuentaCliente(CveCliente As Integer, Fecha As DateTime) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_NotificacionesEdoCuentaClienteAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al agregar notificaciones del estado de cuenta del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetNotificacionEdoCuentaCliente(CveEmpresa As Integer, CveCliente As Integer, Fecha As DateTime) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_NotificacionesEdoCuentaClienteGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@Fecha", SqlDbType.DateTime).Value = Fecha
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al obtener notificaciones del estado de cuenta del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateNotificacionEdoCuentaCliente(CveNotificacionBitacora As Integer, Notifico As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Sis_NotificacionesEdoCuentaClienteUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveNotificacionBitacora", SqlDbType.Int).Value = CveNotificacionBitacora
.Add("@Notifico", SqlDbType.Bit).Value = Notifico
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al actualizar notificaciones del estado de cuenta del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function

View File

@@ -3989,12 +3989,17 @@ Namespace Modelos
'COMIENZA: VENTADETALLE
'CUANDO SEA SALIDA VA POR LA VENTA DETALLE DE LA FACTURA DE LA REMISION - OJO!! SOLO FUNCIONA HASTA ORITA QUE SE HACE SALIDA SOLO CUANDO SE FACTURA LA REMISION
Dim CveVentaDetalle = If(ConceptoEntrada.Contiene(3, 40), DtDetalle.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero, MovDet("CveVentaDetalle").ToString.ToEntero)
Dim CveVentaDetalleRemision As Integer = -1
If ConceptoEntrada = 40 AndAlso MovDet("CveVentaDetalle").ToString().ToEntero() > 0 Then
CveVentaDetalleRemision = MovDet("CveVentaDetalle").ToString().ToEntero()
End If
'CUANDO LA VENTADETALLE NO TENGA VALOR DEBE MARCAR ERROR, NUEVA RESTRICCION DE ALMACEN
If CveVentaDetalle < 0 Then
OcurrioError = True
Exit For
End If
'TERMINA: VENTADETALLE
If Cantidad < 0 Then
ErrorList.Add("Ocurrió un Error al generar los movimientos de almacén. Por favor comuniquese con atención SIG.")
@@ -4002,7 +4007,7 @@ Namespace Modelos
Exit For
End If
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, CveVentaDetalle:=CveVentaDetalle) Then
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, Serie:=Serie, CveVentaDetalle:=CveVentaDetalle, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
ContadorMovtosDetalles += 1
Else
OcurrioError = True
@@ -5128,7 +5133,12 @@ Namespace Modelos
End If
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad) Then
Dim CveVentaDetalleRemision As Integer = -1
If CveConceptoMovimiento = 41 Then
CveVentaDetalleRemision = Dr("CveVentaDetalleRemision").ToString.ToEntero()
End If
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
@@ -7191,25 +7201,34 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTEmpresas") = value
End Set
End Property
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1) As DataTable
Property GlobalDTClasificaciones(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1, Optional UsoClasificacion As Integer = -1, Optional CveClasificacion As Integer = -1) As DataTable
Get
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjClasificaciones As New ClsClasificaciones
If ObjClasificaciones.GetClasificaciones(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjClasificaciones.DtResultados
ObjClasificaciones.Dispose()
End If
If CveEmpresa <> -1 Then
Dim Str As New StringBuilder
Str.AppendFormat("CveEmpresa = {0}", CveEmpresa)
If CveCategoria <> -1 Then Str.AppendFormat(" AND CveCategoria = {0}", CveCategoria)
If UsoClasificacion <> -1 Then Str.AppendFormat(" AND UsoClasificacion IN ({0},3) ", UsoClasificacion)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones"), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
If CveClasificacion <> -1 Then Str.AppendFormat(" AND CveClasificacion = {0}", CveClasificacion)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString(), "", DataViewRowState.CurrentRows)
GlobalDTClasificaciones = Dv.ToTable
Dv.Dispose()
Else
GlobalDTClasificaciones = DirectCast(HttpContext.Current.Application("GlobalDTClasificaciones"), DataTable)
GlobalDTClasificaciones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
End If
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTClasificaciones") = value
Dim AppNombre As String = String.Format("GlobalDTClasificaciones-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
End Property
Property GlobalDTClasificaciones2(Optional CveEmpresa As Integer = -1, Optional CveCategoria As Integer = -1) As DataTable

File diff suppressed because it is too large Load Diff

View File

@@ -736,6 +736,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
}
}
ObjVentas.Dispose();
}
private string DocumentoEntregaInterna()
@@ -849,8 +850,7 @@ public partial class General_PopUpPaqueteriasGuias : ClsPaginas
private void MandaCorreoNotificacionGuia(string Correos)
{
Correos.GuardaLog();
string body = DocumentoEntregaInterna();
ClsSisMail MailCls = new ClsSisMail();

View File

@@ -335,7 +335,7 @@ Partial Class Inventarios_EntradasSalidas
If Request("CveMovimiento") IsNot Nothing AndAlso Request("CveMovimiento").ToString.ToEntero > 0 Then
If UsuarioActual.CveUsuario = 100 AndAlso UsuarioActual.CveEmpresa = 140 Then
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 140 Then
LnkGenerarVirtual.Visible = True
End If

View File

@@ -2062,7 +2062,7 @@ Partial Class Inventarios_EntregaAlmacen
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
For Each Dr1 As DataRow In DtDetalle.Rows
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString().ToEntero(), Dr1("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr1("Serie").ToString(), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString().ToEntero(), Dr1("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Serie:=Dr1("Serie").ToString(), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-1) Then
Dim CveSeccionAlmacen As Integer = 0
For Each Dr2 As DataRow In ObjInventario.DtResultados.FiltraParametros("CveAlmacen > 0 AND ExistenciaFinal > 0").Rows
@@ -2120,7 +2120,7 @@ Partial Class Inventarios_EntregaAlmacen
DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
For Each Dr1 As DataRow In DtDetalle.Rows
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString().ToEntero(), Dr1("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString(), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
If ObjInventario.GetExistenciasProducto(Dr1("CvePS").ToString().ToEntero(), Dr1("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString(), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), CveSeccionAlmacen:=-1) Then
CantidadSaldo = Dr("CantidadGV").ToString().ToDecimal
@@ -2171,7 +2171,7 @@ Partial Class Inventarios_EntregaAlmacen
Else
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
If ObjInventario.GetExistenciasProducto(Dr("CvePS").ToString().ToEntero(), Dr("CveUM").ToString().ToEntero(), UsuarioActual.CveEmpresa, -1, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveTipoAlmacen:=9, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1, Caducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-1) Then
CantidadSaldo = Dr("CantidadGV").ToString().ToDecimal

View File

@@ -62,7 +62,7 @@ public partial class Inventarios_RepTraspasoEmitido : ClsPaginas
}
protected void LnkCancelarTraspaso_Click(object sender, EventArgs e)
{
{
GridViewRow Gvr = (GridViewRow)(((LinkButton)sender).NamingContainer);
Timbrado ObjCancelacion = new Timbrado();
DateTime CancelacionFecha=MinFecha;

View File

@@ -6921,27 +6921,29 @@ Partial Class OC
Dim tmpDTPS As DataTable = DtDetalle
Dim DTAlmacen = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltraParametros($" CveTipoAlmacen IN (1,9) ") 'AND CveSucursal = {CveSucursal}")
Dim objInv As New ClsInventarios
Dim consulta As New StringBuilder
'Dim consulta As New StringBuilder
consulta.Append(" ")
consulta.Append(" DECLARE @TEMP TABLE (CvePS INT, CveSubProyecto INT);")
For Each row As DataRow In tmpDTPS.Rows
consulta.AppendFormat("INSERT INTO @TEMP VALUES ({0},{1});", row("CvePS"), row("CveSubProyecto"))
Next
consulta.Append(" SELECT CASE WHEN LEN (ISNULL (P.Codigo, '')) = 0 THEN P.PS ELSE CONCAT( P.Codigo, ' - ', P.PS) END AS Producto, SUM(OCPR.Cantidad) AS [Por Recibir] ")
For Each row As DataRow In DTAlmacen.Rows
consulta.AppendFormat(" ,SUM(CASE WHEN CS.CveAlmacen={0} THEN CS.Existencia - ISNULL(INV.Cantidad,0) ELSE 0 END) AS [{1}] ", row("CveAlmacen"), row("Almacen"))
Next
consulta.Append(" FROM @TEMP T ")
consulta.Append(" INNER JOIN [ProductosServicios] P ON P.CvePS = T.CvePS ")
consulta.Append(" LEFT JOIN [Inv_ExistenciasProductos] CS ON P.CvePS = CS.CvePS ")
consulta.Append(" LEFT JOIN Vw_InventarioPorSurtir INV ON INV.CvePS = P.CvePS AND INV.CveAlmacen = CS.CveAlmacen ")
consulta.Append(" LEFT JOIN Vw_OC_PorRecibir OCPR ON OCPR.CvePS = P.CvePS AND OCPR.CveAlmacen = CS.CveAlmacen AND OCPR.CveSubProyecto = T.CveSubProyecto")
consulta.Append(" WHERE P.CveTipoPS = 2")
consulta.Append(" GROUP BY P.CvePS,P.Codigo,P.PS")
'consulta.Append(" ")
'consulta.Append(" DECLARE @TEMP TABLE (CvePS INT, CveSubProyecto INT);")
'For Each row As DataRow In tmpDTPS.Rows
' consulta.AppendFormat("INSERT INTO @TEMP VALUES ({0},{1});", row("CvePS"), row("CveSubProyecto"))
'Next
'consulta.Append(" SELECT CASE WHEN LEN (ISNULL (P.Codigo, '')) = 0 THEN P.PS ELSE CONCAT( P.Codigo, ' - ', P.PS) END AS Producto, SUM(OCPR.Cantidad) AS [Por Recibir] ")
'For Each row As DataRow In DTAlmacen.Rows
' consulta.AppendFormat(" ,SUM(CASE WHEN CS.CveAlmacen={0} THEN CS.Existencia - ISNULL(INV.Cantidad,0) ELSE 0 END) AS [{1}] ", row("CveAlmacen"), row("Almacen"))
'Next
'consulta.Append(" FROM @TEMP T ")
'consulta.Append(" INNER JOIN [ProductosServicios] P ON P.CvePS = T.CvePS ")
'consulta.Append(" LEFT JOIN [Inv_ExistenciasProductos] CS ON P.CvePS = CS.CvePS ")
'consulta.Append(" LEFT JOIN Vw_InventarioPorSurtir INV ON INV.CvePS = P.CvePS AND INV.CveAlmacen = CS.CveAlmacen ")
'consulta.Append(" LEFT JOIN Vw_OC_PorRecibir OCPR ON OCPR.CvePS = P.CvePS AND OCPR.CveAlmacen = CS.CveAlmacen AND OCPR.CveSubProyecto = T.CveSubProyecto")
'consulta.Append(" WHERE P.CveTipoPS = 2")
'consulta.Append(" GROUP BY P.CvePS,P.Codigo,P.PS")
objInv.GetQuery(consulta.ToString())
'objInv.GetQuery(consulta.ToString())
objInv.GetExistenciasAlmacenDT(CveOrdenCompra, UsuarioActual.CveEmpresa)
' limpio los almacenes donde no tiene ningun producto existencia
For i = objInv.DtResultados.Columns.Count - 1 To 1 Step -1

View File

@@ -3654,7 +3654,7 @@ Partial Class Ventas
'VALIDA EXISTENCIAS DE ALMACÉN
'Dim DrPS = GlobalDTProductosServicios(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero()).FiltroPrimero("")
Dim DrPS = GlobalDTPS(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero()).FiltroPrimero("")
Dim DrPS = GlobalDTPSSimplificado(CveEmpresa:=UsuarioActual.CveEmpresa, CvePS:=Row.DataKey("CvePS").ToEntero()).FiltroPrimero("")
If DrPS IsNot Nothing Then
Dim CveTipoPS As Integer = DrPS("CveTipoPS").ToString().ToEntero()
@@ -6364,12 +6364,18 @@ Partial Class Ventas
Else
' el cliente tiene crédito disponible, no tiene bloqueo
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
Dim EsCotizacion As Boolean = False
If IfNull(Request("Op"), "").ToString() = "Cot" OrElse (DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0) Then
EsCotizacion = True
End If
If UsuarioActual.TienePermisoProceso(199) Then DdlTipoComprobante.SelectedValueExistInsert("Rem", "Remisión") ' puede remisionar
If UsuarioActual.TienePermisoProceso(60) Then DdlTipoComprobante.SelectedValueExistInsert("Ing", "Ingresos") 'puede facturar
DdlTipoComprobante.SelectedValueExist(UsuarioActual.CveTipoDocumento)
If EsCotizacion Then
DdlTipoComprobante.SelectedValueExistInsert("Cot", "Cotización")
End If
TxtFechaPago.Text = If(DdlTipoComprobante.SelectedValue = "Rem", Now.AddDays(PlazoCobranzaRemision), Now.AddDays(PlazoCobranza)).ToShortDateString
End If
@@ -7124,6 +7130,10 @@ Partial Class Ventas
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").ToolTip = "No se puede editar el descuento porque viene de una promoción"
End If
If Me.CveVenta > 0 AndAlso UsuarioActual.CveEmpresa = 119 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Cot") Then
GvPS.Rows(e.NewEditIndex).FCTextBox("TxtDescuento").Enabled = False
End If
End Sub
Protected Sub GvPS_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvPS.RowCancelingEdit
GvPS.EditIndex = -1
@@ -19328,7 +19338,10 @@ Partial Class Ventas
'COMIENZA: VENTADETALLE
'CUANDO SEA SALIDA VA POR LA VENTA DETALLE DE LA FACTURA DE LA REMISION - OJO!! SOLO FUNCIONA HASTA ORITA QUE SE HACE SALIDA SOLO CUANDO SE FACTURA LA REMISION
Dim CveVentaDetalle = If(ConceptoEntrada.Contiene(3, 40), TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero(), MovDet("CveVentaDetalle").ToString().ToEntero())
Dim CveVentaDetallePadre As Integer = -1
Dim CveVentaDetalleRemision As Integer = -1
If ConceptoEntrada = 40 AndAlso MovDet("CveVentaDetalle").ToString().ToEntero() > 0 Then
CveVentaDetalleRemision = MovDet("CveVentaDetalle").ToString().ToEntero()
End If
'If ConceptoEntrada = 3 Then
' CveVentaDetalle = TmpDT.FiltroPrimeroValor("CveVentaDetalle", $"Consec={Consec}").ToEntero()
@@ -19365,7 +19378,7 @@ Partial Class Ventas
CveMovimientoDetalleEntrada = MovDet("CveMovimientoDetalle").ToString().ToEntero()
End If
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, CveVentaDetallePadre:=CveVentaDetallePadre) Then
If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveVentaDetalle:=CveVentaDetalle, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, CveVentaDetalleRemision:=CveVentaDetalleRemision) Then
ContadorMovtosDetalles += 1
Else
OcurrioError = True