This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-12-02 13:41:54 -07:00
26 changed files with 1156 additions and 294 deletions

View File

@@ -1415,6 +1415,33 @@ Public Class ClsContratos
Public Function UpdateContratosEstimacion(CveEstimacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, CveEstimacionEstatus As Integer) As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosEstimacionUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveEstimacion", SqlDbType.Int).Value = CveEstimacion
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstimacionEstatus", SqlDbType.Int).Value = CveEstimacionEstatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la estimacion.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveContratosAvance(CveContratoAvance As Integer, CveEmpresa As Integer) As Boolean Public Function RemoveContratosAvance(CveContratoAvance As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno = False Dim Retorno = False

View File

@@ -456,6 +456,26 @@ Public Class ClsMovimientos
Return Retorno Return Retorno
End Function End Function
Public Function GetRemisionesNCCliente(CveCliente As Integer, MostarDetalle As Boolean, Optional CveMoneda As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteRemisionesNC")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@MostarDetalle", SqlDbType.Bit).Value = MostarDetalle
.Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los Anticipos del Cliente.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean Public Function GetAnticiposClienteAuxiliar(CveCliente As Integer, CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -4860,6 +4860,7 @@ Public Class ClsPaginas
PaginaDict.Add("/RH/SolicitudViaticos.aspx".ToUpper(), 663) PaginaDict.Add("/RH/SolicitudViaticos.aspx".ToUpper(), 663)
PaginaDict.Add("/RH/ReporteViaticos.aspx".ToUpper(), 664) PaginaDict.Add("/RH/ReporteViaticos.aspx".ToUpper(), 664)
PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder PaginaDict.Add("/RH/MiPerfil.aspx".ToUpper(), -1) ' se dejará libre el módulo para que cualquier que tenga cvepersonal, pueda acceder
PaginaDict.Add("/RH/CatChecadores.aspx".ToUpper(), 694)
#End Region #End Region
#Region "Sistema" #Region "Sistema"
'Cargo las páginas que deben tener restricción 'Cargo las páginas que deben tener restricción
@@ -6753,7 +6754,7 @@ Public Class ClsPaginas
End If End If
'ECONOLLANTAS - AGREGAR QR DE DESCARGA 'ECONOLLANTAS - AGREGAR QR DE DESCARGA
If UsuarioActual.CveEmpresa = 141 Then If UsuarioActual.CveEmpresa.Contiene(141, 152, 159, 160, 161, 162, 163) Then
Dim QRDescarga As String = "" Dim QRDescarga As String = ""
Dim cfdi As New RVCFDI33.GeneraCFDI() Dim cfdi As New RVCFDI33.GeneraCFDI()

View File

@@ -6879,6 +6879,81 @@ chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo
#End Region #End Region
#Region "Checador"
Public Function GetChecadores(CveChecador As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al obtener el listado de checadores", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function AddChecadores(Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, CveUsuario As Integer, Optional CveModelo As Integer = 1, Optional Estatus As Integer = 1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@Checador", SqlDbType.NVarChar).Value = Checador
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal
.Add("@Puerto", SqlDbType.NVarChar).Value = Puerto
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
.Add("@Estatus", SqlDbType.Int).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateChecadores(CveChecador As Integer, Checador As String, CveSubProyecto As Integer, IPLocal As String, Puerto As String, Optional CveModelo As Integer = 1, Optional Estatus As Boolean = True) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
.Add("@Checador", SqlDbType.NVarChar).Value = Checador
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@IPLocal", SqlDbType.NVarChar).Value = IPLocal
.Add("@Puerto", SqlDbType.NVarChar).Value = Puerto
.Add("@CveModelo", SqlDbType.Int).Value = CveModelo
.Add("@Estatus", SqlDbType.Bit).Value = Estatus
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function RemoveChecadores(CveChecador As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveChecador", SqlDbType.Int).Value = CveChecador
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar el checador", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region
'Public msgsError As New StringBuilder() 'Public msgsError As New StringBuilder()
'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") 'Public Sub OnError(Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "")

View File

@@ -764,6 +764,25 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function UpdateVentaRNCUsado(CveVentaRNC As Integer, CveVenta As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentasRNCUsadosUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaRNC", SqlDbType.Int).Value = CveVentaRNC
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la relacion con el usado.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0) As Boolean Public Function UpdateCancelaVenta(CveVenta As Integer, FechaCancelacion As DateTime, SelloCancelacionSAT As String, CveEmpresa As Integer, Optional CvePAC As Integer = -1, Optional CveEstatusRefacturacion As Integer = 0) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -4788,6 +4807,26 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function AddVentaDetalleRNCFacturada(CveVentaDetalleRNC As Integer, CveVentaDetalle As Integer, CantidadFacturada As Decimal) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_VentaDetalleRNCFacturadaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveVentaDetalleRNC", SqlDbType.Int).Value = CveVentaDetalleRNC
.Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle
.Add("@CantidadFacturada", SqlDbType.Float).Value = CantidadFacturada
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al agregar lo facturado de la RNC.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region #End Region

View File

@@ -74,17 +74,17 @@
<div id="DivDatos" style="overflow-y: auto; width: 750px; max-height: 360px;"> <div id="DivDatos" style="overflow-y: auto; width: 750px; max-height: 360px;">
<asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-advance table-hover Widthall" AutoGenerateColumns="False" GridLines="None"> <asp:GridView ID="GvDatos" ClientIDMode="Static" runat="server" CssClass="table table-striped table-advance table-hover Widthall" AutoGenerateColumns="False" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="NumCuenta" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderText="Cuenta" /> <asp:BoundField DataField="NumCuenta" ItemStyle-Width="80px" HeaderText="Cuenta" />
<asp:BoundField DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Center" HeaderText="Fecha" /> <asp:BoundField DataField="FechaDocumento" DataFormatString="{0:d}" ItemStyle-Width="60px" HeaderText="Fecha" />
<asp:TemplateField HeaderText="Folio" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Folio" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:Literal ID="LtlFolio" runat="server"></asp:Literal> <asp:Literal ID="LtlFolio" runat="server"></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" /> <asp:BoundField DataField="Importe" DataFormatString="{0:N2}" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" HeaderText="Importe" />
<asp:BoundField DataField="Moneda" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center" HeaderText="Moneda" /> <asp:BoundField DataField="MonedaAbreviatura" ItemStyle-Width="40px" ItemStyle-HorizontalAlign="Center" HeaderText="Moneda" />
<asp:BoundField DataField="PagueseA" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderText="Beneficiario" /> <asp:BoundField DataField="PagueseA" HeaderText="Beneficiario" />
<asp:BoundField DataField="EstatusIE" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderText="Estatus" /> <asp:BoundField DataField="EstatusIE" ItemStyle-Width="50px" HeaderText="Estatus" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>

View File

@@ -632,6 +632,7 @@
<div class="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" title="Cambiar sucursal"><i class="fa fa-arrow-circle-down" style="color: green" aria-hidden="true"></i></div> <div class="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" title="Cambiar sucursal"><i class="fa fa-arrow-circle-down" style="color: green" aria-hidden="true"></i></div>
<asp:LinkButton ID="ImgSubProyecto" CssClass="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" ToolTip="Aplicar SubProyecto a productos" runat="server" Style="display: none;"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton> <asp:LinkButton ID="ImgSubProyecto" CssClass="btn btn-default btn-circle btn-xs " data-toggle="tooltip" data-placement="top" ToolTip="Aplicar SubProyecto a productos" runat="server" Style="display: none;"><i class="fa fa-arrow-circle-down" style="color:green" aria-hidden="true"></i></asp:LinkButton>
</span> </span>
</th> </th>
<th style="width: 80px">Tipo de Gasto <th style="width: 80px">Tipo de Gasto
@@ -675,6 +676,7 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</th> </th>
@@ -4284,8 +4286,19 @@
<%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator> <%--<asp:RequiredFieldValidator runat="server" Enabled="true" Display="None" ID="RFVSubProyecto" ControlToValidate="DdlSubProyecto" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor seleccione uno." ValidationGroup="GprAgregaPS"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%> <ajax:ValidatorCalloutExtender ID="VCORVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<label runat="server" id="LblSubProyecto" for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label> <label runat="server" id="LblSubProyecto" for="<%= DdlSubProyecto.ClientID.ToString()%>">SubProyecto:</label>
</div>
</div> </div>
<div class="col-md-3">
<div runat="server" id="DVCultivosCuadro" visible ="false" class="form-group form-md-line-input input-iconright" >
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
</asp:DropDownList>
<label runat="server" id="Label9" for="<%= DdlCultivosCuadro.ClientID.ToString()%>">Cultivo:</label>
</div> </div>
</div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>

View File

@@ -1319,6 +1319,15 @@ Partial Class Compras_Compras
DdlPersonal.DataBind() DdlPersonal.DataBind()
DdlPersonalReembolso.DataBind() DdlPersonalReembolso.DataBind()
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
DVCultivosCuadro.Visible = True
DdlSubProyecto.AutoPostBack = True
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If
'Carga Proveedor 'Carga Proveedor
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
@@ -17655,6 +17664,15 @@ Partial Class Compras_Compras
If Modalidad <> "U" Or Not CveFactura > 0 Then If Modalidad <> "U" Or Not CveFactura > 0 Then
DdlPSChange() DdlPSChange()
End If End If
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
DdlCultivosCuadro.Items.Clear()
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($" CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If
End Sub End Sub
Private Sub DdlPSChange() Private Sub DdlPSChange()
If CveProveedor > 0 Then If CveProveedor > 0 Then

View File

@@ -85,7 +85,7 @@
<div class="col-md-12"> <div class="col-md-12">
<asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance" <asp:GridView ID="GvEstimaciones" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron partidas para levantar avance"
DataKeyNames="CveContratoAvance,CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance,Fecha" DataKeyNames="CveContratoAvance,CveFamilias,CveSubFamilias,CveContratoDetalle,PS,Cantidad,Importe,Cantidad_Ultima,Importe_Ultima,PU,CantidadMax,Avance,Fecha,CveEstimacion"
CssClass="table GVEstimacion table-advance table-hover mysmallbtn" GridLines="None"> CssClass="table GVEstimacion table-advance table-hover mysmallbtn" GridLines="None">
<Columns> <Columns>
<asp:TemplateField HeaderText="" ItemStyle-Width="60%"> <asp:TemplateField HeaderText="" ItemStyle-Width="60%">
@@ -149,7 +149,7 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="text-center"> <div class="text-center">
<asp:Button id="BtnAutoriza" CssClass="btn btn-primary" runat="server" Text="Autorizar" Visible="false"/> <asp:Button id="BtnAutoriza" CssClass="btn btn-primary" runat="server" Text="Autorizar" Visible="false" OnClick="BtnAutoriza_Click" />
<asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/> <asp:Button id="BtnGuardarEstimacion" CssClass="btn btn-primary" runat="server" Text="Generar Estimacion" Visible="false"/>
<asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/> <asp:Button id="BtnDescargarGenerado" CssClass="btn btn-primary" runat="server" Text="Descarga Generador" Visible="false"/>

View File

@@ -216,6 +216,9 @@ Partial Class Contratos_ContratoObraAutorizacion
DTEstimaciones = ObjContratos.DtResultados DTEstimaciones = ObjContratos.DtResultados
CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero CveContratoEstimacion = DDlContratosEstimaciones.SelectedValue.ToEntero
If DTEstimaciones.Rows.Count > 0 Then
CveEstimacionActual = DTEstimaciones.FiltroPrimeroValor("CveEstimacion", "CveEstimacion > 0").ToString.ToEntero
End If
End If End If
@@ -652,6 +655,34 @@ Partial Class Contratos_ContratoObraAutorizacion
End Sub
Protected Sub BtnAutoriza_Click(sender As Object, e As EventArgs)
Dim ErrorProceso As Boolean = True
Dim ObjContrato As New ClsContratos
If ObjContrato.UpdateContratosEstimacion(CveEstimacionActual, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 3) Then
ErrorProceso = False
End If
ObjContrato.Dispose()
If Not ErrorProceso Then
CveEstimacionActual = -1
CargaAvancesParaEstimar()
Alert("Avance autorizado correctamente.")
End If
End Sub End Sub
End Class End Class

View File

@@ -27,6 +27,7 @@
CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None"> CssClass="table table-striped table-advance table-hover ScrollAD mysmallbtn" data-sort="true" Width="100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Marca" HeaderText="Marca" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="Modelo" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="Modelo" HeaderText="Modelo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField DataField="EstatusTexto" HeaderText="Estatus" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" /> <asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />

View File

@@ -853,7 +853,7 @@ Partial Class General_SaldosIniciales
If Codigo.Length > 0 Then If Codigo.Length > 0 Then
If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", CodigoBarras, Descripcion, Precio, -1, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,
CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño, CveTipoPS:=CveTipoPS, CveSATPS:=CveSATPS, CveMarca:=CveMarca, CveTamaño:=CveTamaño, CveMedida:=CveMedida, CveRinTamaño:=CveRinTamaño,
CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle) <= 0 Then CveModelo:=CveModelo, Litraje:=Litraje, IEPSPorcentaje:=IEPS, CveClasificacion2:=CveClasificacion2, CveClasificacionDetalle:=CveClasificacionDetalle) <= 0 Then
'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1, 'If ObjPS.AddPS(CveClasificacion, 1, CveUnidadMedida, Codigo, "", "", Descripcion, 0, 0, 0, False, 0, False, True, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 1, 1,

View File

@@ -229,7 +229,7 @@
<div class="row" style="margin-top: 5px;"> <div class="row" style="margin-top: 5px;">
<label class="col-md-4">Código.Barras</label> <label class="col-md-4">Código.Barras</label>
<div class="col-md-8"> <div class="col-md-8">
<asp:TextBox runat="server" ID="TxtCodigoBarras" ></asp:TextBox> <asp:TextBox runat="server" ID="TxtCodigoBarras"></asp:TextBox>
</div> </div>
</div> </div>
<div class="row" style="margin-top: 5px;" runat="server" id="divSerie" visible="false"> <div class="row" style="margin-top: 5px;" runat="server" id="divSerie" visible="false">
@@ -259,12 +259,22 @@
</div> </div>
</div> </div>
<div class="row" style="margin-top: 5px;"> <div class="row" style="margin-top: 5px" runat="server" id="divSeccion" visible="false">
<div class="col-md-12" style="text-align: center;"> <label class="col-md-4">Sección Almacén:</label>
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" /> <div class="col-md-8">
<asp:DropDownList runat="server" ID="DdlSeccionAlmacen" CssClass="select2me" DataTextField="SeccionAlmacen" DataValueField="CveSeccionAlmacen" Width="100%">
<%--<asp:ListItem Selected="True" Value="-1">Seleccione</asp:ListItem>--%>
</asp:DropDownList>
<asp:RequiredFieldValidator runat="server" ID="RfvSeccionAlmacen" ControlToValidate="DdlSeccionAlmacen" Enabled="false" ValidationGroup="GrpIngresar" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Seccion Almacen''</b> es necesario, por favor ingrése una." Display="Dynamic" InitialValue="-1"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VceSeccionAlmacen" runat="server" HighlightCssClass="vco" TargetControlID="RfvSeccionAlmacen" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div>
<div class="row" style="margin-top: 5px;">
<div class="col-md-12" style="text-align: center;">
<asp:Button ID="BtnGuardar" runat="server" ValidationGroup="GrpIngresar" Text="Ingresar" class="btn btn-primary" Enabled="false" />
</div> </div>
</div> </div>
</div>
</div> </div>
</asp:Panel> </asp:Panel>
</div> </div>

View File

@@ -40,6 +40,15 @@ Partial Class Inventarios_InventarioFisicoDetalle
ViewState("DtVentas") = value ViewState("DtVentas") = value
End Set End Set
End Property End Property
Private Property CveAlmacenes As String
Get
Return ViewState("CveAlmacenes").ToString
End Get
Set(value As String)
ViewState("CveAlmacenes") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -135,13 +144,16 @@ Partial Class Inventarios_InventarioFisicoDetalle
If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInventarioFisicoDetallesAlmacen(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = ObjInventario.DtResultados Dim dt As DataTable = ObjInventario.DtResultados
Dim str As New StringBuilder Dim str As New StringBuilder
Dim CveAlmacenesStr As New StringBuilder
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
For Each dr As DataRow In dt.Rows For Each dr As DataRow In dt.Rows
str.AppendFormat("{0},", dr("almacen")) str.AppendFormat("{0},", dr("almacen"))
CveAlmacenesStr.AppendFormat("{0},", dr("CveAlmacen"))
Next Next
End If End If
LblAlmacenes.Text = str.ToString LblAlmacenes.Text = str.ToString
CveAlmacenes = CveAlmacenesStr.ToString.Substring(0, CveAlmacenesStr.Length - 1)
End If End If
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
@@ -260,8 +272,9 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes Dim CodigoBarras As String = If(TxtCodigoBarras.Text.Trim <> "", TxtCodigoBarras.Text.Trim, "-1").Replace("'", "''") ' scanner cambian los guiones por apostrofes
Dim Serie As String = TxtCodigoSerie.Text.Trim Dim Serie As String = TxtCodigoSerie.Text.Trim
Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1") Dim Lote As String = If(TxtLote.Text.Length > 0, TxtLote.Text, "-1")
Dim FechaCaducidad As String=MinFecha.ToString Dim FechaCaducidad As String = MinFecha.ToString
Dim CveSeccionAlmacen As Integer = -1 Dim CveSeccionAlmacen As Integer = -1
Dim SeccionAlmacen As String = ""
Dim Cantidad = TxtCantidadProducto.Text.ToDouble Dim Cantidad = TxtCantidadProducto.Text.ToDouble
@@ -279,11 +292,13 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1" Dim AplicaCaducidad As Boolean = dr("AplicaCaducidad") = "1"
Dim AplicaLote As Boolean = dr("AplicaLote") = "1" Dim AplicaLote As Boolean = dr("AplicaLote") = "1"
Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1" Dim AplicaSerie As Boolean = dr("AplicaSerie") = "1"
Dim AplicaSeccion As Boolean = dr("AplicaSeccion") = "1"
'divSeccionAlmacen.Visible = AplicaSeccion 'divSeccionAlmacen.Visible = AplicaSeccion
divLote.Visible = AplicaLote divLote.Visible = AplicaLote
divFechaCaducidad.Visible = AplicaCaducidad divFechaCaducidad.Visible = AplicaCaducidad
divSerie.Visible = AplicaSerie divSerie.Visible = AplicaSerie
UPAgregarPro.Update() UPAgregarPro.Update()
If AplicaSerie And Serie = "" Then If AplicaSerie And Serie = "" Then
@@ -294,7 +309,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
RFVSerie.ValidationGroup = " " RFVSerie.ValidationGroup = " "
Exit Sub Exit Sub
End If End If
If AplicaLote And Lote = "" Then If AplicaLote And (Lote = "" Or Lote = "-1") Then
RFVLote.Enabled = True RFVLote.Enabled = True
RFVLote.Visible = True RFVLote.Visible = True
RFVLote.SetFocusOnError = True RFVLote.SetFocusOnError = True
@@ -313,6 +328,37 @@ Partial Class Inventarios_InventarioFisicoDetalle
End If End If
FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString) FechaCaducidad = If(TxtFechaCaducidad.Text.Length > 0, TxtFechaCaducidad.Text, MinFecha.ToString)
End If End If
If AplicaSeccion Then
Dim ObjInv As New ClsInventarios
Dim SeccionesAlmacenDelProducto As New DataTable
If ObjInv.GetProductosServiciosAlmacenSeccion(CveProducto, -1, -1, UsuarioActual.CveEmpresa) Then
SeccionesAlmacenDelProducto = ObjInv.DtResultados.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
End If
'Dim SeccionesAlmacenDelProducto As DataTable = (UsuarioActual.CveEmpresa, -1, CveProducto) '.FiltraParametros(String.Format("CveAlmacen IN ({0})", CveAlmacenes))
'Alert(SeccionesAlmacenDelProducto.Rows.Count.ToString)
If SeccionesAlmacenDelProducto.Rows.Count = 1 Then
CveSeccionAlmacen = SeccionesAlmacenDelProducto.FiltroPrimeroValor("CveSeccionAlmacen")
Else
divSeccion.Visible = AplicaSeccion
If DdlSeccionAlmacen.Items.Count = 0 Then
DdlSeccionAlmacen.DataSource = SeccionesAlmacenDelProducto
DdlSeccionAlmacen.DataBind()
DdlSeccionAlmacen.Items.Insert(0, New ListItem("Seleccione", "-1"))
End If
If DdlSeccionAlmacen.SelectedValue = "-1" Then
RfvSeccionAlmacen.Enabled = True
RfvSeccionAlmacen.Visible = True
RfvSeccionAlmacen.SetFocusOnError = True
RfvSeccionAlmacen.Validate()
RfvSeccionAlmacen.ValidationGroup = " "
Exit Sub
End If
CveSeccionAlmacen = DdlSeccionAlmacen.SelectedValue.ToEntero
End If
ObjInv.Dispose()
SeccionAlmacen = GlobalDTSeccionAlmacen(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("SeccionAlmacen", String.Format("CveSeccionAlmacen = {0}", CveSeccionAlmacen))
End If
RFVSerie.ValidationGroup = "GrpIngresar" RFVSerie.ValidationGroup = "GrpIngresar"
RFVSerie.Enabled = False RFVSerie.Enabled = False
@@ -320,6 +366,8 @@ Partial Class Inventarios_InventarioFisicoDetalle
RFVLote.Enabled = False RFVLote.Enabled = False
RFVCaducidad.ValidationGroup = "GrpIngresar" RFVCaducidad.ValidationGroup = "GrpIngresar"
RFVCaducidad.Enabled = False RFVCaducidad.Enabled = False
RfvSeccionAlmacen.ValidationGroup = "GrpIngresar"
RfvSeccionAlmacen.Enabled = False
'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS 'VALIDA QUE LA SERIE NO SEA IGUAL AL CODIGO O CODIGOBARRAS
If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then If Serie <> "" And (Serie.ToUpper = dr("Codigo").ToString.ToUpper Or Serie.ToUpper = dr("CodigoBarras").ToString.ToUpper) Then
@@ -331,7 +379,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
Using Inventarios As New ClsInventarios Using Inventarios As New ClsInventarios
If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario, If Inventarios.AddInventarioFisicoDetalle(CveInventarioFisico, CveProducto, CveUnidadMedida, If(AplicaSerie, 1, Cantidad), Serie, UsuarioActual.CveUsuario,
CveSeccionAlmacen:=-1, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, FechaCaducidad:=FechaCaducidad.ToDate) Then
GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0 GvIFDUltimoRegistrado.Columns(4).Visible = CveSeccionAlmacen > 0
GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> "" GvIFDUltimoRegistrado.Columns(5).Visible = Serie <> ""
@@ -344,7 +392,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString GvIFDUltimoRegistrado.Rows(0).Cells(1).Text = dr("CodigoBarras").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString GvIFDUltimoRegistrado.Rows(0).Cells(2).Text = dr("Codigo").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PSCodigo").ToString GvIFDUltimoRegistrado.Rows(0).Cells(3).Text = dr("PSCodigo").ToString
GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = "" GvIFDUltimoRegistrado.Rows(0).Cells(4).Text = SeccionAlmacen
GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim GvIFDUltimoRegistrado.Rows(0).Cells(5).Text = TxtCodigoSerie.Text.Trim
GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote GvIFDUltimoRegistrado.Rows(0).Cells(6).Text = Lote
GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad GvIFDUltimoRegistrado.Rows(0).Cells(7).Text = FechaCaducidad
@@ -371,6 +419,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
divLote.Visible = False divLote.Visible = False
divFechaCaducidad.Visible = False divFechaCaducidad.Visible = False
divSerie.Visible = False divSerie.Visible = False
divSeccion.Visible = False
RegistraScript("playsonidito('beep-07.wav')") RegistraScript("playsonidito('beep-07.wav')")
Else Else
TxtCodigoSerie.Text = "" TxtCodigoSerie.Text = ""
@@ -386,6 +435,7 @@ Partial Class Inventarios_InventarioFisicoDetalle
divLote.Visible = False divLote.Visible = False
divFechaCaducidad.Visible = False divFechaCaducidad.Visible = False
divSerie.Visible = False divSerie.Visible = False
divSeccion.Visible = False
TxtLote.Text = "" TxtLote.Text = ""
TxtFechaCaducidad.Text = "" TxtFechaCaducidad.Text = ""
Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError) Alert("No se encontró el producto, favor de escribirlo correctamente.", TipoMensaje.MsgError)

View File

@@ -2525,8 +2525,14 @@ Partial Class Inventarios_RecepcionUsados
If RblUsadosAjuste.SelectedValue = "1" Then If RblUsadosAjuste.SelectedValue = "1" Then
'agrego un registro extra del importe de ajuste 'agrego un registro extra del importe de ajuste
Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal Dim PU As Decimal = TxtImporteAjuste.Text.ToDecimal
Dim CveSATNC As String = "84111506" 'CONSULTA EL CONCEPTO DE NC
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).FiltroPrimero("") Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
If ArrayNC.Length > 5 Then
NCAjuste = ArrayNC(5).ToEntero()
End If
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCAjuste, AplicaParaVenta:=1).FiltroPrimero("")
If Dr IsNot Nothing Then If Dr IsNot Nothing Then
Dim CveUnidadMedida, CveClasificacion, CvePS As Integer Dim CveUnidadMedida, CveClasificacion, CvePS As Integer
@@ -2534,7 +2540,7 @@ Partial Class Inventarios_RecepcionUsados
CveClasificacion = Dr("CveClasificacion").ToString.ToEntero CveClasificacion = Dr("CveClasificacion").ToString.ToEntero
CvePS = Dr("CvePS").ToString.ToEntero CvePS = Dr("CvePS").ToString.ToEntero
Dim PorcentajeIVA As Decimal = 0.16D Dim PorcentajeIVA As Decimal = 0.16D
Dim Obs As String = "Descuento por garantía" Dim Obs As String = $"Descuento por garantía. BCI: {DdlBCIAjuste.SelectedValue}"
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "", AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
@@ -2806,13 +2812,6 @@ Partial Class Inventarios_RecepcionUsados
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString() Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
Select Case TipoFolio Select Case TipoFolio
Case "GENERAL" Case "GENERAL"
'20520 ACUM. AUTOMOTRIZ
'20522 ACUM. ESPECIALES
'20513 ACUM. ESTANDAR
'20521 ACUM. PESADO
'20512 ACUM. PREMIUM
'20514 ACUM. VALUE
'20229 Acumulador
ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ ListaClasificacionesPermitidas.Add(20520) 'ACUM. AUTOMOTRIZ
ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES ListaClasificacionesPermitidas.Add(20522) 'ACUM. ESPECIALES
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR

View File

@@ -198,6 +198,7 @@
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" /> <asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />
@@ -232,6 +233,7 @@
<asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Código Barras" DataField="CodigoBarras" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Sección Almacén" DataField="SeccionAlmacen"/>
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" /> <asp:BoundField HeaderText="FechaCaducidad" DataField="FechaCaducidad" ItemStyle-HorizontalAlign="Left" DataFormatString="{0:d}" />

View File

@@ -194,6 +194,9 @@ Partial Class Inventarios_RepAnomalias
e.Row.Cells(8).Text = "0" e.Row.Cells(8).Text = "0"
End If End If
If e.Row.Cells(7).Text = MinFecha Then
e.Row.Cells(7).Text = ""
End If
e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1 e.Row.FCLabel("Lblc").Text = e.Row.RowIndex + 1
End If End If
@@ -273,9 +276,10 @@ Partial Class Inventarios_RepAnomalias
#End Region #End Region
Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable) Private Sub BanderaSerieLoteCad(Gv As GridView, resultado As DataTable)
Gv.Columns(4).Visible = resultado.MAX("Serie") <> "" Gv.Columns(4).Visible = resultado.MAX("CveSeccionAlmacen").ToEntero > 0
Gv.Columns(5).Visible = resultado.MAX("Lote") <> "" Gv.Columns(5).Visible = resultado.MAX("Serie") <> ""
Gv.Columns(6).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha Gv.Columns(6).Visible = resultado.MAX("Lote") <> ""
Gv.Columns(7).Visible = resultado.MAX("FechaCaducidad").ToDate > MinFecha
End Sub End Sub
End Class End Class

View File

@@ -72,11 +72,11 @@ Partial Class OC_CatEstatus
CargaUsuarios() CargaUsuarios()
'SOLO MUESTRA SUBPROYECTO 'SOLO MUESTRA SUBPROYECTO
If UsuarioActual.Empresa.GralSoloProyecto Then
'TdProyecto.Visible = False
'TdSubProyectoTitulo.Visible = False
DivProyecto.Visible = False 'TdProyecto.Visible = False
'TdSubProyectoTitulo.Visible = False
DivProyecto.Visible = False
LblSubproyecto.Visible = False LblSubproyecto.Visible = False
@@ -85,7 +85,7 @@ Partial Class OC_CatEstatus
CboSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1")) CboSubProyecto.Items.Insert(0, New ListItem("Seleccione", "-1"))
CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty) CboSubProyecto_SelectedIndexChanged(CboSubProyecto, EventArgs.Empty)
End If
chkMostrarLimites.Attributes.Add("onchange", "javascript:chkMostrarLimitesCambio();") chkMostrarLimites.Attributes.Add("onchange", "javascript:chkMostrarLimitesCambio();")
MaintainScrollPositionOnPostBack = True MaintainScrollPositionOnPostBack = True
@@ -614,7 +614,7 @@ Partial Class OC_CatEstatus
'Insertar el nuevo registro 'Insertar el nuevo registro
Else Else
If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True) Then If Not objEstatusOC.AddEstatusUsuarios(CveEstatus, CveSubProyecto, Row.DataKey("CveUsuario").ToString.ToEntero, True, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboErrores = True HuboErrores = True
Exit For Exit For
End If End If
@@ -699,6 +699,7 @@ Partial Class OC_CatEstatus
If Not HuboErrores Then If Not HuboErrores Then
objEstatusOC.Commit() objEstatusOC.Commit()
GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion) Alert("Se guardaron los Cambios exitosamente", TipoMensaje.MsgInformacion)
Else Else
objEstatusOC.RollBack() objEstatusOC.RollBack()

View File

@@ -811,6 +811,7 @@
<ajax:ValidatorCalloutExtender ID="VCORFVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCORFVSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
<div runat="server" id="DVCultivosCuadro" visible ="false"> <div runat="server" id="DVCultivosCuadro" visible ="false">
Cultivo:
<asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;" <asp:DropDownList ID="DdlCultivosCuadro" CssClass=" form-control input-sm select2me" runat="server" DataTextField="Cuadro" Style="width: 100%; max-width: 600px;"
DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar"> DataValueField="CveCultivoCuadroDetalle" ValidationGroup="GrpDetalleGuardar">
</asp:DropDownList> </asp:DropDownList>
@@ -942,8 +943,6 @@
<asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# String.Format("{0}<br/>{1}{2}", Eval("Proyecto"), Eval("SubProyecto"), If(Eval("CveCultivoCuadroDetalle").ToString <> "" And Eval("CveCultivoCuadroDetalle").ToString <> "0" And Eval("CveCultivoCuadroDetalle").ToString <> "-1", String.Format("<br/>{0}", Eval("Cuadro")), "")) %>'></asp:Literal> <asp:Literal ID="LtlSubProyecto" runat="server" Text='<%# String.Format("{0}<br/>{1}{2}", Eval("Proyecto"), Eval("SubProyecto"), If(Eval("CveCultivoCuadroDetalle").ToString <> "" And Eval("CveCultivoCuadroDetalle").ToString <> "0" And Eval("CveCultivoCuadroDetalle").ToString <> "-1", String.Format("<br/>{0}", Eval("Cuadro")), "")) %>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
<EditItemTemplate> <EditItemTemplate>

View File

@@ -801,6 +801,9 @@ Partial Class OC
If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then If UsuarioActual.Empresa.Funcionalidad(590).ToString.ToEntero = 1 Then
DVCultivosCuadro.Visible = True DVCultivosCuadro.Visible = True
DdlSubProyecto.AutoPostBack = True
DdlCultivosCuadro.DataSource = GlobalDTCultivosCuadro(UsuarioActual.CveEmpresa).FiltraParametros($"CveSubProyecto = {DdlSubProyecto.SelectedValue}")
DdlCultivosCuadro.DataBind()
DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1")) DdlCultivosCuadro.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
End If End If
@@ -3562,7 +3565,9 @@ Partial Class OC
If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then
If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then If UsuarioActual.Empresa.Tipo_CentroCosto = 1 Or UsuarioActual.Empresa.Tipo_CentroCosto = 2 Then
e.Row.FCLiteral("LtlSubProyecto").Text = e.Row.DBCampo("SubProyecto") Dim Str As String = e.Row.DBCampo("SubProyecto")
If e.Row.DBCampo("Cuadro") <> "" Then Str = String.Format("{0}<br/>{1}", Str, e.Row.DBCampo("Cuadro"))
e.Row.FCLiteral("LtlSubProyecto").Text = Str
End If End If
End If End If

101
RH/CatChecadores.aspx Normal file
View File

@@ -0,0 +1,101 @@
<%@ Page Title="RH - Catálogo de Checadores" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatChecadores.aspx.cs" Inherits="RH_CatChecadores" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<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="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Catálogo de Checadores
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="BtnAgregarChecador" OnClick="BtnAgregarChecador_Click" data-toggle="tooltip" data-placement="left" title="Agregar un Checador" Text="<i class='fa fa-plus'></i>Agregar Checador"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CveChecador,Checador,CveModelo,CveSubProyecto,SubProyecto,CveUsuario,Estatus,FechaIng,IPLocal,Puerto" EmptyDataText="No se encontraron Tipo Gasto" ToolTip="Listado de Tipo Gasto " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Checador" DataField="Checador" />
<asp:BoundField HeaderText="SubProyecto" DataField="SubProyecto" />
<asp:BoundField HeaderText="IP Local" DataField="IPLocal" />
<asp:BoundField HeaderText="Puerto" DataField="Puerto" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
<asp:BoundField HeaderText="Estatus" DataField="Estatus" />
<asp:BoundField HeaderText="Fecha" DataField="FechaIng" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-Width="13%" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
<ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Subir" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Reasignar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivAgregarTiposD" class="modal ADS fade" role="dialog">
<div class="modal-dialog" style="width: 450px;">
<asp:UpdatePanel runat="server" class="modal-content" ID="UpModalTiposD" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">
<asp:Literal ID="LtlTituloModalTiposD" runat="server">Checadores</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtChecador" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RequiredFieldValidator ID="RfvTxtChecador" runat="server" ControlToValidate="TxtChecador" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Checador''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD"></asp:RequiredFieldValidator>
<label for="TxtChecador">Checador:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<label for="DdlSubProyecto">Subproyecto:</label>
<asp:DropDownList ID="DdlSubProyecto" Width="100%" runat="server" AppendDataBoundItems="true" DataValueField="CveSubProyecto" DataTextField="SubProyecto" ValidationGroup="GrpGuardar" CssClass="select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVDdlSubProyecto" runat="server" ControlToValidate="DdlSubProyecto" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Sub Proyecto''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCODdlSubProyecto" runat="server" HighlightCssClass="vco" TargetControlID="RFVDdlSubProyecto" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtIPLocal" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="RfvTxtIPLocal" runat="server"
ValidationExpression="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
ControlToValidate="TxtIPLocal" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''IP Local''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD" />
<label for="TxtChecador">IP Local:</label>
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPuerto" CssClass="form-control " runat="server" MaxLength="70" CausesValidation="true"></asp:TextBox>
<asp:RegularExpressionValidator ID="RfvTxtPuerto" runat="server" ValidationExpression="\d*" ControlToValidate="TxtPuerto" CssClass="help-block errorimput"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Puerto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpTiposD" />
<label for="TxtPuerto">Puerto:</label>
<i></i>
</div>
<div id="divChkEstatus" runat="server" class="form-group form-md-line-input input-iconright">
<label for="ChkEstatus">Estatus:</label>
<asp:CheckBox runat="server" ID="ChkEstatus" CssClass="make-switchsd" data-size="small" Text=" " />
</div>
</div>
</br>
<div class="modal-footer">
<asp:Button ID="BtnChecadorAgregar" OnClick="BtnChecadorAgregar_Click" runat="server" class="btn btn-success" Text="Agregar" ValidationGroup="GrpTiposD" />
<button id="Button3" runat="server" type="button" class="btn default" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

115
RH/CatChecadores.aspx.cs Normal file
View File

@@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
using System.Data;
public partial class RH_CatChecadores : ClsPaginas
{
private int CveChecador
{
get
{
return ViewState["CveChecador"].ToString().ToEntero();
}
set
{
ViewState["CveChecador"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CargaDatos();
CargaSubProyectos();
}
}
private void CargaDatos()
{
ClsRH ObjRH = new ClsRH();
if (ObjRH.GetChecadores(-1, UsuarioActual.CveEmpresa))
{
GvDatos.DataSource = ObjRH.DtResultados;
}
ObjRH.Dispose();
GvDatos.DataBind();
}
private void CargaSubProyectos()
{
DdlSubProyecto.DataSource = get_GlobalDTSubProyectos(-1, CveEmpresa: UsuarioActual.CveEmpresa);
DdlSubProyecto.DataBind();
}
protected void BtnAgregarChecador_Click(object sender, EventArgs e)
{
TxtChecador.Text = "";
DdlSubProyecto.SelectedValue = "-1";
TxtIPLocal.Text = "";
TxtPuerto.Text = "";
BtnChecadorAgregar.Text = "Agregar";
divChkEstatus.Visible = false;
UpModalTiposD.Update();
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
}
protected void BtnChecadorAgregar_Click(object sender, EventArgs e)
{
ClsRH ObjRH = new ClsRH();
if (BtnChecadorAgregar.Text == "Agregar")
{
if (ObjRH.AddChecadores(TxtChecador.Text, DdlSubProyecto.SelectedValue.ToEntero(), TxtIPLocal.Text, TxtPuerto.Text, UsuarioActual.CveUsuario))
{
Alert("Checador agregado correctamente");
}
}
else
{
if (ObjRH.UpdateChecadores(CveChecador,TxtChecador.Text,DdlSubProyecto.SelectedValue.ToEntero(),TxtIPLocal.Text,TxtPuerto.Text,Estatus: ChkEstatus.Checked))
{
Alert("Checador actualizado correctamente");
}
}
ObjRH.Dispose();
CargaDatos();
UpDatos.Update();
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"));
}
protected void LnkEditar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
CveChecador = GvRow.DataKey("CveChecador").ToEntero();
TxtChecador.Text = GvRow.DataKey("Checador");
DdlSubProyecto.SelectedValue = GvRow.DataKey("CveSubProyecto");
TxtIPLocal.Text = GvRow.DataKey("IPLocal");
TxtPuerto.Text = GvRow.DataKey("Puerto");
BtnChecadorAgregar.Text = "Actualizar";
ChkEstatus.Checked = GvRow.DataKey("Estatus") == "Activo";
divChkEstatus.Visible = true;
UpModalTiposD.Update();
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposD"));
}
protected void LnkEliminar_Click(object sender, EventArgs e)
{
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
ClsRH ObjRH = new ClsRH();
if (ObjRH.RemoveChecadores(GvRow.DataKey("CveChecador").ToEntero()))
{
Alert("Checador eliminado correctamente");
CargaDatos();
UpDatos.Update();
}
ObjRH.Dispose();
}
}

View File

@@ -9161,7 +9161,7 @@ Partial Class Clientes
End If End If
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate, TxtFechaFUsados.Text.ToDate) Then If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
GvUsadosResumen.DataSource = ObjAcum.DtResultados GvUsadosResumen.DataSource = ObjAcum.DtResultados
End If End If
GvUsadosResumen.DataBind() GvUsadosResumen.DataBind()

View File

@@ -1257,7 +1257,7 @@ Partial Class ProductosyServicios
End If End If
Next Next
End If End If
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True) TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, True)
End If End If
@@ -1323,7 +1323,7 @@ Partial Class ProductosyServicios
Next Next
End If End If
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then If UsuarioActual.Empresa.Funcionalidad(563) <> "" AndAlso ChkAplicaParaVenta.Checked Then
TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False) TieneError = GuardarProductoEnFranquicia(ObjProductosServicios, PSS, CveMetodoInv, EsPaquete, False)
End If End If

View File

@@ -2746,7 +2746,8 @@
<table> <table>
<tr> <tr>
<td>Contrato:</td> <td>Contrato:</td>
<td><asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="select2me" ></asp:DropDownList></td> <td>
<asp:DropDownList ID="DdlContrato" runat="server" AppendDataBoundItems="true" Width="350px" AutoPostBack="true" DataTextField="NumeroContrato" DataValueField="CveContrato" CssClass="select2me"></asp:DropDownList></td>
</tr> </tr>
</table> </table>
@@ -2793,14 +2794,18 @@
<div class="row" style="margin-bottom: 10px;"> <div class="row" style="margin-bottom: 10px;">
<div class="col-md-6"> <div class="col-md-6">
<table> <table>
<tr> <tr>
<td><asp:Label runat="server" Text="Contrato:"></asp:Label></td> <td>
<td><asp:DropDownList runat="server" ID="DdlContratosModal" AutoPostBack="true" CssClass=" form-control input-sm select2me text-left" Width="400px" DataTextField="ContratoCompleto" DataValueField="CveContrato" /></td> <asp:Label runat="server" Text="Contrato:"></asp:Label></td>
<td>
<asp:DropDownList runat="server" ID="DdlContratosModal" AutoPostBack="true" CssClass=" form-control input-sm select2me text-left" Width="400px" DataTextField="ContratoCompleto" DataValueField="CveContrato" /></td>
</tr> </tr>
<tr runat="server" id="DVEstimacionesObra" visible="false"> <tr runat="server" id="DVEstimacionesObra" visible="false">
<td> Estimacion:</td> <td>Estimacion:</td>
<td> <asp:DropDownList ID="DdlEstimacionesObra" runat="server" AppendDataBoundItems="true" Width="400px" AutoPostBack="true" DataTextField="NumeroEstimacion" DataValueField="CveEstimacion" CssClass="select2me"></asp:DropDownList> </td> <td>
<asp:DropDownList ID="DdlEstimacionesObra" runat="server" AppendDataBoundItems="true" Width="400px" AutoPostBack="true" DataTextField="NumeroEstimacion" DataValueField="CveEstimacion" CssClass="select2me"></asp:DropDownList>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -2819,7 +2824,7 @@
<asp:ListItem Text="Venta" Value="2" Selected="True" /> <asp:ListItem Text="Venta" Value="2" Selected="True" />
<asp:ListItem Text="Suministro" Value="1" /> <asp:ListItem Text="Suministro" Value="1" />
<%--<asp:ListItem Text="Consignación" Value="3" Enabled="false" />--%> <%--<asp:ListItem Text="Consignación" Value="3" Enabled="false" />--%>
<asp:ListItem Text="Obra" Value="4" /> <asp:ListItem Text="Obra" Value="4" />
</asp:RadioButtonList> </asp:RadioButtonList>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
@@ -6289,6 +6294,11 @@
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRNCCargos','{0}')", GvRemisionesNC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaRNCCargos','{0}')", GvRemisionesNC.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12">
<asp:CheckBox ID="ChkMostarProductosRNC" runat="server" AutoPostBack="true" Text="Mostrar Productos" OnCheckedChanged="ChkMostarProductosRNC_CheckedChanged" />
</div>
</div>
<div class="row" id="DivRNCCargos" runat="server" visible="false">
<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="GvRemisionesNC" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvRemisionesNC" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None"> DataKeyNames="CveVenta" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
@@ -6320,6 +6330,35 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
<div class="row" id="DivRNCCargosDetalle" runat="server" visible="false">
<div class="col-md-12" style="max-height: 440px; overflow: auto">
<asp:GridView ID="GvRemisionesNCDetalle" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveVenta,CveVentaDetalleRNC,CvePS,PU,PorcentajeIVA" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="ChkAplicar" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad">
<ItemTemplate>
<asp:TextBox ID="TxtCantidadRNC" runat="server" Text='<%#Eval("CantidadPendiente").ToString%>' MaxLength="12" Width="46px" Height="24px"></asp:TextBox>
<asp:RangeValidator ID="RVCantRNC" runat="server" Type="Double" MinimumValue="0" MaximumValue='<%#Eval("CantidadPendiente").ToString%>' ErrorMessage="Cantidad Excedida" ControlToValidate="TxtCantidadRNC" Display="None" ValidationGroup="VGAplicarRNC"></asp:RangeValidator>
<ajax:ValidatorCalloutExtender ID="VCECantidad3" runat="server" HighlightCssClass="vco" TargetControlID="RVCantRNC" Width="300px"></ajax:ValidatorCalloutExtender>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:HyperLinkField DataNavigateUrlFields="CveVenta" Target="_blank" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" DataTextField="Folio" HeaderText="Folio" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha" DataField="Fecha" DataFormatString="{0:d}" ItemStyle-HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Literal ID="TtlTotal" runat="server" Text='<%# Eval("Total", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row" id="DivSMU" runat="server" visible="false"> <div class="row" id="DivSMU" runat="server" visible="false">
<div class="col-md-12"> <div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server"> <table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
@@ -6439,7 +6478,7 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:Button ID="BtnCalcularPenalizacion" runat="server" CssClass="btn btn-primary btn-sm" Text="Calcular" OnClick="BtnCalcularPenalizacion_Click" /> <asp:Button ID="BtnCalcularPenalizacion" runat="server" CssClass="btn btn-primary btn-sm" Text="Calcular" OnClick="BtnCalcularPenalizacion_Click" />
</div> </div>
<div class="col-md-6"> </div> <div class="col-md-6"></div>
</div> </div>
<div class="row" style="margin-bottom: 10px;"> <div class="row" style="margin-bottom: 10px;">
<div class="text-right col-md-offset-8 col-md-4"> <div class="text-right col-md-offset-8 col-md-4">
@@ -7988,65 +8027,65 @@
} }
function FnCambiaAnt(chk, txt, saldo) { function FnCambiaAnt(chk, txt, saldo) {
debugger; debugger;
var Total = ToDouble($get('TxtSubTotal').value); var Total = ToDouble($get('TxtSubTotal').value);
let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val(); let TipoAnticipo = $('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').val();
let importeTxt = parseFloat(txt.value.replace(/,/g, '')); let importeTxt = parseFloat(txt.value.replace(/,/g, ''));
if (isNaN(importeTxt)) { if (isNaN(importeTxt)) {
importeTxt = 0;
} else {
if (importeTxt <= 0) {
importeTxt = 0; importeTxt = 0;
chk.checked = false; } else {
return; if (importeTxt <= 0) {
importeTxt = 0;
chk.checked = false;
return;
}
} }
saldo = (importeTxt > saldo) ? saldo : importeTxt;
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) {
chk.checked = true;
} else {
chk.checked = false;
}
if (ToDouble(txt.value) > saldo) {
txt.value = saldo;
alert("El Importe no debe de exceder a el saldo");
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
} }
saldo = (importeTxt > saldo) ? saldo : importeTxt; function FnSumaValoresAnt() {
debugger;
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
var SaldoCompra = (Total - FnSumaValoresAnt() + ToDouble(txt.value)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnVentaSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txt.value;
//minimo entre saldocompra y el saldoanticipo
if (SaldoCompra < saldo) saldo = SaldoCompra;
if (ToDouble(txt.value) > 0) { return Math.round(totalPoints * 100) / 100;
chk.checked = true;
} else {
chk.checked = false;
} }
if (ToDouble(txt.value) > saldo) { function LimpiaModal() {
txt.value = saldo; $('#<%= TxtDireccion.ClientID %>').val('');
alert("El Importe no debe de exceder a el saldo");
}
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$get('HdnVentaSaldo').value = Total - FnSumaValoresAnt();
}
function FnSumaValoresAnt() {
debugger;
var totalPoints = 0;
var t = '';
$('input[name*=TxtAnticipo]').each(function () {
totalPoints += ToDouble($(this).val());
});
return Math.round(totalPoints * 100) / 100;
}
function LimpiaModal() {
$('#<%= TxtDireccion.ClientID %>').val('');
$('#<%= TxtColonia.ClientID %>').val(''); $('#<%= TxtColonia.ClientID %>').val('');
$('#<%= TxtCiudad.ClientID %>').val(''); $('#<%= TxtCiudad.ClientID %>').val('');
$('#<%= TxtEstado.ClientID %>').val(''); $('#<%= TxtEstado.ClientID %>').val('');
@@ -8271,68 +8310,68 @@
function ConvertirDolares(ChkConvertirDolares) { function ConvertirDolares(ChkConvertirDolares) {
//LIMPIA //LIMPIA
$('#<%= LblDolaresConvertidos.ClientID %>').text(''); $('#<%= LblDolaresConvertidos.ClientID %>').text('');
$("#TrConversionDolaresTexto").hide(); $("#TrConversionDolaresTexto").hide();
//CALCULA //CALCULA
if (ChkConvertirDolares.checked) { if (ChkConvertirDolares.checked) {
ConvertirPesosDlls(); ConvertirPesosDlls();
} }
} }
//FUNCIONES PARA MODAL "ModalAplicarNC" //FUNCIONES PARA MODAL "ModalAplicarNC"
function CalculaImporteNC() { function CalculaImporteNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value)); var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value); //var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2); $get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2);
} }
function CalculaPorcentajeNC() { function CalculaPorcentajeNC() {
var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value)); var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
//var ImporteReferencia = ToDouble($get('TxtTotal').value); //var ImporteReferencia = ToDouble($get('TxtTotal').value);
$get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4); $get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4);
} }
function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) { function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) {
debugger; debugger;
if (tipocambio.value.length > 0) { if (tipocambio.value.length > 0) {
if (CveMoneda == 1) { if (CveMoneda == 1) {
txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2); txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2);
} else { } else {
txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2); txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2);
} }
} }
} }
function BuscarOCRegistrada() { function BuscarOCRegistrada() {
$('#btnBuscarOCRegistrada').click(); $('#btnBuscarOCRegistrada').click();
} }
function ValidaAnticipoBoton() { function ValidaAnticipoBoton() {
var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2); var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2);
var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2); var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2);
var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex')); var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex'));
if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) { if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) {
if (TotalAnticipos > 0) { if (TotalAnticipos > 0) {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', false);
} else { } else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
} }
} else { } else {
$('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true); $('#<%= BtnAceptarAnticipos.ClientID %>').prop('disabled', true);
} }
} }
function showDivEC() { function showDivEC() {
$('#<%= TxtRFCCliente.ClientID %>').val(''); $('#<%= TxtRFCCliente.ClientID %>').val('');
$('#<%= TxtNombreCliente.ClientID %>').val(''); $('#<%= TxtNombreCliente.ClientID %>').val('');
$('#<%= TxtDireccionCliente.ClientID %>').val(''); $('#<%= TxtDireccionCliente.ClientID %>').val('');
$('#<%= TxtNumExtCliente.ClientID %>').val(''); $('#<%= TxtNumExtCliente.ClientID %>').val('');

View File

@@ -144,6 +144,22 @@ Partial Class Ventas
ViewState("TmpDTRNCBonificacionesSeleccionadas") = value ViewState("TmpDTRNCBonificacionesSeleccionadas") = value
End Set End Set
End Property End Property
Private Property TmpDTRNCDetalle As DataTable
Get
Return If(IsNothing(ViewState("TmpDTRNCDetalle")), Nothing, CType(ViewState("TmpDTRNCDetalle"), DataTable))
End Get
Set(value As DataTable)
ViewState("TmpDTRNCDetalle") = value
End Set
End Property
Private Property TmpDTRNCDetalleSelecciondas As DataTable
Get
Return If(IsNothing(ViewState("TmpDTRNCDetalleSelecciondas")), Nothing, CType(ViewState("TmpDTRNCDetalleSelecciondas"), DataTable))
End Get
Set(value As DataTable)
ViewState("TmpDTRNCDetalleSelecciondas") = value
End Set
End Property
Private Property TmpDTError As DataTable Private Property TmpDTError As DataTable
Get Get
Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable)) Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable))
@@ -1861,6 +1877,22 @@ Partial Class Ventas
ViewState("SerieVenta") = value ViewState("SerieVenta") = value
End Set End Set
End Property End Property
Private Property AplicaDocumentoNuevoNC As Boolean
Get
Return CBool(IfNull(ViewState("AplicaDocumentoNuevoNC"), "False", ViewState("AplicaDocumentoNuevoNC")))
End Get
Set(value As Boolean)
ViewState("AplicaDocumentoNuevoNC") = value
End Set
End Property
Private Property AplicaRNCXDetalle As Boolean
Get
Return CBool(IfNull(ViewState("AplicaRNCXDetalle"), "False", ViewState("AplicaRNCXDetalle")))
End Get
Set(value As Boolean)
ViewState("AplicaRNCXDetalle") = value
End Set
End Property
#End Region #End Region
@@ -3928,6 +3960,7 @@ Partial Class Ventas
TmpDT = ObjVentas.DtResultados TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer)) TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
GvPS.DataSource = ObjVentas.DtResultados GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind() GvPS.DataBind()
@@ -5618,7 +5651,7 @@ Partial Class Ventas
Dim ObjClientes As New ClsClientes Dim ObjClientes As New ClsClientes
If ObjClientes.GetHistorialVentas(CveCliente, 1000, CveClienteSucursal:=-1, TipoDocto:="Ing", CveEstatusFactura:=-1, FechaI:=Now.AddMonths(-1)) Then If ObjClientes.GetHistorialVentas(CveCliente, 1000, CveClienteSucursal:=-1, TipoDocto:="Ing", CveEstatusFactura:=-1, FechaI:=Now.AddMonths(-1)) Then
DdlVentaUsado.DataSource = ObjClientes.DtResultados DdlVentaUsado.DataSource = ObjClientes.DtResultados.FiltraParametros("UsadoMarcado = 0")
End If End If
ObjClientes.Dispose() ObjClientes.Dispose()
@@ -6664,6 +6697,7 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteIVA") = (TmpDT.Rows(e.RowIndex)("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteIEPS") = (TmpDT.Rows(e.RowIndex)("PorcentajeIEPS").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales) TmpDT.Rows(e.RowIndex)("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA TmpDT.Rows(e.RowIndex)("PorcentajeRetIVA") = ClienteRetIVA
TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR TmpDT.Rows(e.RowIndex)("PorcentajeRetISR") = ClienteRetISR
@@ -8577,7 +8611,7 @@ Partial Class Ventas
End If End If
'SI NO ES REFACTURACION 'SI NO ES REFACTURACION
If NuevaFactura <> 1 Then If NuevaFactura <> 1 AndAlso Not AplicaDocumentoNuevoNC Then
If DtVentasNC Is Nothing Then InicializaDTVentasNC() If DtVentasNC Is Nothing Then InicializaDTVentasNC()
Dim Drt = DtVentasNC.NewRow Dim Drt = DtVentasNC.NewRow
Drt("CveVenta") = ObjFactura.CveVenta Drt("CveVenta") = ObjFactura.CveVenta
@@ -10499,6 +10533,15 @@ Partial Class Ventas
Catch ex As Exception Catch ex As Exception
End Try End Try
'SI SE FACTURA UNA RNC SE MUESTRA
If UsuarioActual.CveEmpresa = 140 AndAlso factura.TipoDocto = "Egs" Then
If Row("CveVentaDetalleRNC").ToString().ToEntero() > 0 Then
If Not ObjVentas.AddVentaDetalleRNCFacturada(Row("CveVentaDetalleRNC").ToString().ToEntero(), ObjVentas.CveVentaDetalle, Row("Cantidad").ToString().ToDecimal()) Then
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
End If
End If
End If
End If End If
Next Next
@@ -11591,6 +11634,13 @@ Partial Class Ventas
CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera CveCuenta = ObjFactura.Cliente.CveCuentaMonedaExtranjera
End If End If
'ACTUALIZA SI LA VENTA FUE MARCADA CON OTRA PARA EL FILTRO DE USADOS
If ObjRNC.Num3 > 0 Then
If Not ObjVentas.UpdateVentaRNCUsado(ObjRNC.CveVenta, ObjRNC.Num3.ToEntero()) Then
ErrorPrepoliza = True
End If
End If
IdCtaContableCliente = IdCtaContable IdCtaContableCliente = IdCtaContable
CveCuentaCliente = CveCuenta CveCuentaCliente = CveCuenta
@@ -16259,6 +16309,7 @@ Partial Class Ventas
Row("IVA") = Row("PorcentajeIVA") Row("IVA") = Row("PorcentajeIVA")
Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales) Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("RetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales) Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR Row("PorcentajeRetISR") = ClienteRetISR
@@ -16510,6 +16561,7 @@ Partial Class Ventas
TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean)) TmpDT.Columns.Add("EsOutSourcing", GetType(Boolean))
TmpDT.Columns.Add("EsCargo", GetType(Boolean)) TmpDT.Columns.Add("EsCargo", GetType(Boolean))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns("EsOutSourcing").DefaultValue = False TmpDT.Columns("EsOutSourcing").DefaultValue = False
TmpDT.Columns("EsCargo").DefaultValue = False TmpDT.Columns("EsCargo").DefaultValue = False
@@ -23572,6 +23624,18 @@ Partial Class Ventas
ObjMovtos.Dispose() ObjMovtos.Dispose()
GvCxC.DataBind() GvCxC.DataBind()
End Sub End Sub
Protected Sub ChkMostarProductosRNC_CheckedChanged(sender As Object, e As EventArgs)
If ChkMostarProductosRNC.Checked Then
DivRNCCargos.Visible = False
DivRNCCargosDetalle.Visible = True
CargaRNCDetalle(DdlVentaUsado.SelectedValue.ToEntero())
Else
DivRNCCargos.Visible = True
DivRNCCargosDetalle.Visible = False
CargaRNC(DdlVentaUsado.SelectedValue.ToEntero())
End If
UpModalRemisionesNC.Update()
End Sub
Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1) Private Sub CargaRNC(Optional CveVentaUsado As Integer = -1)
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
@@ -23605,8 +23669,58 @@ Partial Class Ventas
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("Valor").ToString() HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("Valor").ToString().ToDecimal().FormatoNumero(2) LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
UpModalRemisionesNC.Update()
UpDescNC.Update()
End Sub
Private Sub CargaRNCDetalle(Optional CveVentaUsado As Integer = -1)
Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
Me.TmpDTRNCDetalle = ObjMovtos.DtResultados.Copy()
End If
ObjMovtos.Dispose()
Me.TmpDTRNCDetalle.Columns.Add(New DataColumn("CveVentaDetalleNCGenerada", GetType(Integer)))
Me.TmpDTRNCDetalleSelecciondas = Nothing
Me.TmpDTRNCDetalleSelecciondas = TmpDTRNCDetalle.Clone()
Me.TmpDTRNCDetalleSelecciondas.Clear()
GvRemisionesNCDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 1")
'GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
'Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
'Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
'Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
'Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
GvRemisionesNCDetalle.DataBind()
'GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then
DivSMU.Visible = True
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa)
Dim SaldoMaximoUsados As Decimal = FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal() + FacUsado.DtDetalle.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else Else
DivSMU.Visible = False DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
@@ -23816,6 +23930,15 @@ Partial Class Ventas
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);") e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
End If End If
End Sub End Sub
Protected Sub GvRemisionesNCDetalle_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNCDetalle.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.DBCampo("CveVentaDetalleRNC").ToEntero() = 0 Then
e.Row.CssClass = "Totales"
e.Row.FCCheckBox("ChkAplicar").Visible = False
e.Row.FCTextBox("TxtCantidadRNC").Visible = False
End If
End If
End Sub
Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlNCNivelImporte_SelectedIndexChanged(sender As Object, e As EventArgs)
Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0 Dim ImporteReferencia As Double = 0, PorcentajeMaximo As Double = 0
@@ -23844,7 +23967,7 @@ Partial Class Ventas
'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR 'SOLO APLICA SI NO HAY DOCUMENTOS QUE SELECCIONAR
If UsuarioActual.CveEmpresa = 140 Then If UsuarioActual.CveEmpresa = 140 Then
If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then If GvCxC.Rows.Count = 0 OrElse GvCxC.Rows.Cast(Of GridViewRow)().Count(Function(gvr) gvr.FCCheckBox("ChkCxC").Checked) = 0 Then
Alert("No se ha seleccionado ninguna nota de crédito, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;") Alert("No se ha seleccionado ninguna factura, en caso de no seleccionar ninguna se creará una nueva nota de crédito. ¿Está seguro de realizar esta acción?", TipoMensaje.MsgConfirmacion, JSBtnAceptar:="BtnAplicaNuevaNC();", TextoConfirmacion:="&nbsp;&nbsp;&nbsp;&nbsp;Si&nbsp;&nbsp;&nbsp;&nbsp;", TextoCancelacion:="&nbsp;&nbsp;&nbsp;&nbsp;No&nbsp;&nbsp;&nbsp;&nbsp;")
Else Else
AplicarNotaCreditoDesdeVenta() AplicarNotaCreditoDesdeVenta()
End If End If
@@ -23900,6 +24023,7 @@ Partial Class Ventas
Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False, Optional AplicoNCFacturaActual As Boolean = False) Private Sub AplicarNC(CvePS As Integer, Optional NCDescuento As Boolean = False, Optional EsNCAmortizacion As Boolean = False, Optional AplicaImpuestosLocales As Boolean = True, Optional AplicaNuevoDocumento As Boolean = False, Optional AplicoNCFacturaActual As Boolean = False)
Try Try
Me.AplicaDocumentoNuevoNC = AplicaNuevoDocumento
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del producto. Por favor comuniquese con asistencia SIG", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar la información del producto. Por favor comuniquese con asistencia SIG", TipoMensaje.MsgError)
@@ -24068,11 +24192,22 @@ Partial Class Ventas
TmpDTDescNC.Clear() TmpDTDescNC.Clear()
If UsuarioActual.CveEmpresa = 140 Then If UsuarioActual.CveEmpresa = 140 Then
If AplicaRNCXDetalle Then
CrearDTNCCargoDetalle(ListaNCDesc, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else
CrearDTNCCargo(ListaNCDesc, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
End If
CrearDTNCCargo(ListaNCDesc, DtImpuestos, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCBonificacion As Integer = 0
If ArrayNC.Length > 4 Then
NCBonificacion = ArrayNC(4).ToEntero()
End If
'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO' 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO'
Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=360481).FiltroPrimero("") Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("")
If DrPSBonificacion IsNot Nothing Then If DrPSBonificacion IsNot Nothing Then
CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else Else
@@ -24109,9 +24244,20 @@ Partial Class Ventas
'DEBE AGREGAR LOS USADOS DE LA REMISION EN LA NOTA DE CREDITO 'DEBE AGREGAR LOS USADOS DE LA REMISION EN LA NOTA DE CREDITO
If UsuarioActual.CveEmpresa = 140 AndAlso (ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0) Then If UsuarioActual.CveEmpresa = 140 AndAlso (ListaRemisionesNC IsNot Nothing AndAlso ListaRemisionesNC.Count > 0) Then
CrearDTNCCargo(ListaRemisionesNC, DtImpuestos, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) If AplicaRNCXDetalle Then
CrearDTNCCargoDetalle(ListaRemisionesNC, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else
CrearDTNCCargo(ListaRemisionesNC, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
End If
'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO' 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO'
Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=360481).FiltroPrimero("") 'CONSULTA EL CONCEPTO DE NC
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCBonificacion As Integer = 0
If ArrayNC.Length > 4 Then
NCBonificacion = ArrayNC(4).ToEntero()
End If
Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCBonificacion).FiltroPrimero("")
If DrPSBonificacion IsNot Nothing Then If DrPSBonificacion IsNot Nothing Then
CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto) CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
Else Else
@@ -24172,42 +24318,104 @@ Partial Class Ventas
UPCondicionesPago.Update() UPCondicionesPago.Update()
End Sub End Sub
Private Sub CrearDTNCCargo(ListaNC As List(Of Modelos.Factura), DtImpuestos As DataTable, ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) Private Sub CrearDTNCCargo(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String)
For Each Dr As DataRow In DtImpuestos.Rows For Each RNC In ListaNC
For Each RNC In ListaNC Dim UltimoRenglonRNC As Integer = 1
Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0
For Each RowUsado As DataRow In RNC.DtDetalle.Rows
Dim PorcentajeUsado = ((RowUsado("Total").ToString().ToDecimal() - RowUsado("Descuento").ToString().ToDecimal() + RowUsado("ImporteIVA").ToString().ToDecimal() + RowUsado("ImporteIEPS").ToString().ToDecimal() - RowUsado("ImporteRetIVA").ToString().ToDecimal() - RowUsado("ImporteRetISR").ToString().ToDecimal()) / RNC.Total) / ListaNC.Count For Each RowUsado As DataRow In RNC.DtDetalle.Rows
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then Dim PorcentajeAplicado = (RNC.TotalRemNCAplicado / RNC.Total)
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
End If
Dim ImportePU = RowUsado("PU").ToString().ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteIEPS = (TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetISR = (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
Dim ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
ImporteIVA += Ajuste
End If End If
End If
UltimoRenglonRNC += 1
Dim ImportePU = Dr("ImportePU").ToString().ToDecimal * PorcentajeUsado AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
Dim ImporteIVA = Dr("ImporteIVA").ToString().ToDecimal * PorcentajeUsado
Dim ImporteRetIVA = Dr("ImporteRetIVA").ToString().ToDecimal * PorcentajeUsado
Dim ImporteRetISR = Dr("ImporteRetISR").ToString().ToDecimal * PorcentajeUsado
Dim ImporteIEPS = Dr("ImporteIEPS").ToString().ToDecimal * PorcentajeUsado
Dim ImporteTotal = Dr("ImporteTotal").ToString().ToDecimal * PorcentajeUsado
'If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
' ImportePU += Ajuste
'End If
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, 1, ImportePU, Dr("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, Dr("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowUsado("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
Dr("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, Dr("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowUsado("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowUsado("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalle").ToString().ToEntero())
UltimoRenglonRNC += 1
Next
Next Next
Next Next
End Sub End Sub
Private Sub CrearDTNCCargoDetalle(ListaNC As List(Of Modelos.Factura), ByRef TmpDTCargo As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String)
For Each RNC In ListaNC
Dim UltimoRenglonRNC As Integer = 1
Dim TotalAcumuladoRNC As Decimal = 0
For Each RowUsado As DataRow In Me.TmpDTRNCDetalleSelecciondas.FiltraParametros($"CveVenta={RNC.CveVenta}").Rows
Dim Cantidad As Decimal = RowUsado("Cantidad").ToString().ToDecimal()
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
End If
Dim ImportePU = RowUsado("PU").ToString().ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
Dim ImporteIVA = (TotalCalculableImpuestos * RowUsado("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteIEPS = 0 '(TotalCalculableImpuestos * RowUsado("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetIVA = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetISR = 0 ' (TotalCalculableImpuestos * RowUsado("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
Dim ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA)
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNC.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNC.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNC.TotalRemNCAplicado - TotalAcumuladoRNC
ImporteIVA += Ajuste
End If
End If
UltimoRenglonRNC += 1
AgregaTempDT(TmpDTCargo, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, Cantidad, ImportePU, RowUsado("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, 0, ImporteRetIVA,
0, ImporteRetISR, 0, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1, CveVentaDetalleRNC:=RowUsado("CveVentaDetalleRNC").ToString().ToEntero())
Next
Next
End Sub
Private Sub CrearDTNCBonificacion(ListaNC As List(Of Modelos.Factura), DtImpuestosBonificacion As DataTable, ByRef TmpDTNC As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String) Private Sub CrearDTNCBonificacion(ListaNC As List(Of Modelos.Factura), DtImpuestosBonificacion As DataTable, ByRef TmpDTNC As DataTable, DrPS As DataRow, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String)
'SI TIENE DE BONIFICACION LOS AGREGA 'SI TIENE DE BONIFICACION LOS AGREGA
If DtImpuestosBonificacion IsNot Nothing AndAlso ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0 Then If DtImpuestosBonificacion IsNot Nothing AndAlso ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0 Then
@@ -24215,39 +24423,54 @@ Partial Class Ventas
TmpDTDescNCBonificacion = TmpDTNC.Clone() TmpDTDescNCBonificacion = TmpDTNC.Clone()
TmpDTDescNCBonificacion.Clear() TmpDTDescNCBonificacion.Clear()
For Each Dr As DataRow In DtImpuestosBonificacion.Rows For Each RNCBonificacion In ListaNCBonificacion
For Each RNC In ListaNCBonificacion Dim UltimoRenglonRNC As Integer = 1
Dim UltimoRenglonRNC As Integer = 1 Dim TotalAcumuladoRNC As Decimal = 0
Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNC.CveVentaRNCCargo).FirstOrDefault() Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows
Dim PorcentajeCargo = ((RowCargo("Total").ToString().ToDecimal() - RowCargo("Descuento").ToString().ToDecimal() + RowCargo("ImporteIVA").ToString().ToDecimal() + RowCargo("ImporteIEPS").ToString().ToDecimal() - RowCargo("ImporteRetIVA").ToString().ToDecimal() - RowCargo("ImporteRetISR").ToString().ToDecimal()) / RNCCargo.Total) / ListaNCBonificacion.Count Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total)
Dim Obs = RowCargo("CodigoPS").ToString() Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then Dim Obs = RowCargo("CodigoPS").ToString()
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
Obs = String.Format("{0} - {1}", Obs, TxtNCObservaciones.Text.Trim())
End If
Dim ImportePU = RowCargo("PUBonificacion").ToString().ToDecimal
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
Dim ImporteIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteIEPS = (TotalCalculableImpuestos * RowCargo("PorcentajeIEPS").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetIVA = (TotalCalculableImpuestos * RowCargo("PorcentajeRetIVA").ToString().ToDecimal).RoundSQL(2)
Dim ImporteRetISR = (TotalCalculableImpuestos * RowCargo("PorcentajeRetISR").ToString().ToDecimal).RoundSQL(2)
Dim ImporteTotal = TotalCalculableImpuestos
TotalAcumuladoRNC += (TotalCalculableImpuestos + ImporteIVA + ImporteIEPS - ImporteRetIVA - ImporteRetISR)
'SI ES EL ULTIMO REGLON REALIZA UN AJUSTE
If UltimoRenglonRNC = RNCCargo.DtDetalle.Rows.Count Then
Dim Ajuste As Decimal = 0
If Math.Abs(RNCBonificacion.TotalRemNCAplicado - TotalAcumuladoRNC) > 0.00 Then
Ajuste = RNCBonificacion.TotalRemNCAplicado - TotalAcumuladoRNC
ImporteIVA += Ajuste
End If End If
End If
UltimoRenglonRNC += 1
Dim ImportePU = Dr("ImportePU").ToString().ToDecimal * PorcentajeCargo AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
Dim ImporteIVA = Dr("ImporteIVA").ToString().ToDecimal * PorcentajeCargo
Dim ImporteRetIVA = Dr("ImporteRetIVA").ToString().ToDecimal * PorcentajeCargo
Dim ImporteRetISR = Dr("ImporteRetISR").ToString().ToDecimal * PorcentajeCargo
Dim ImporteIEPS = Dr("ImporteIEPS").ToString().ToDecimal * PorcentajeCargo
Dim ImporteTotal = Dr("ImporteTotal").ToString().ToDecimal * PorcentajeCargo
AgregaTempDT(TmpDTDescNCBonificacion, DrPS("CvePS").ToString().ToEntero(), DrPS("PS").ToString(), DrPS("Codigo").ToString(), DrPS("PSCodigo").ToString(), DrPS("CveTipoPS").ToString().ToEntero(), DrPS("Inv_CveMetodoInventario").ToString().ToEntero(),
DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto, DrPS("CveUM").ToString().ToEntero(), DrPS("UnidadMedida").ToString(), DrPS("CveClasificacion").ToString().ToEntero(), DrPS("Clasificacion").ToString(), CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
Obs, 1, ImportePU, Dr("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, Dr("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA, Obs, Cantidad, ImportePU, RowCargo("PorcentajeIVA").ToString().ToDecimal, ImporteIVA, RowCargo("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA,
Dr("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, Dr("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1, RowCargo("PorcentajeRetISR").ToString().ToDecimal, ImporteRetISR, RowCargo("PorcentajeIEPS").ToString().ToDecimal, ImporteIEPS, -1, 0.0, ImporteTotal, "", "", -1, -1,
DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1) DrPS("SATClavePS").ToString(), DrPS("SATClaveUnidadMedida").ToString(), -1, -1, -1, -1, -1, -1)
UltimoRenglonRNC += 1
Next
Next Next
Next Next
End If End If
End Sub End Sub
@@ -24362,7 +24585,7 @@ Partial Class Ventas
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double, PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double,
Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String, Total As Double, Serie As String, TiempoEntrega As String, CvePresupuestoIngreso As Integer, EntregaDirecta As Integer, SATClaveProdServ As String,
SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer, SATClaveUM As String, CveContratoDetalle As Integer, CveVentaDetalle As Integer, CveMovimientoDetallePedido As Integer, CveOrdenCompraDetalle As Integer,
CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1) CveVentaDetalleRemision As Integer, CveVentaDetalleCotizacion As Integer, Optional CveTamaño As Integer = -1, Optional CveVentaDetalleRNC As Integer = -1)
Dim Row As DataRow = Nothing Dim Row As DataRow = Nothing
Row = TmpDT.NewRow() Row = TmpDT.NewRow()
@@ -24422,6 +24645,7 @@ Partial Class Ventas
Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion Row("CveVentaDetalleCotizacion") = CveVentaDetalleCotizacion
Row("CveTamaño") = CveTamaño Row("CveTamaño") = CveTamaño
Row("CveVentaDetalleRNC") = CveVentaDetalleRNC
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
End Sub End Sub
@@ -25469,7 +25693,8 @@ Partial Class Ventas
If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(), If Not ObjVentas.AddVentaDetalle(CveVenta, Row("CvePS").ToString().ToEntero(), Row("Cantidad").ToString().ToDouble, Row("CveUM").ToString().ToEntero(),
Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6), Row("PU").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("ImporteIVA").ToString().ToDouble, Math.Round((Row("Total").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)) * (1 + Row("PorcentajeIVA").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)))), 6),
Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(), Row("Obs").ToString(), Row("Descuento").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), Row("TipoDescuento").ToString().ToEntero(), Row("CveSubProyecto").ToString().ToEntero(), Row("CvePresupuestoIngreso").ToString().ToEntero(),
PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString()) Then PorcentajeIVA:=Row("PorcentajeIVA").ToString().ToDecimal, IEPS:=Row("ImporteIEPS").ToString().ToDouble(If(ChkConvertirDoctoPesos.Checked, TxtTipoCambio.Text.ToDecimal, 1)), PorcentajeIEPS:=Row("PorcentajeIEPS").ToString().ToDouble, TiempoEntrega:=Row("TiempoEntrega").ToString(),
PorcentajeRetIVA:=Row("PorcentajeRetIVA").ToString().ToDecimal, ImporteRetIVA:=Row("ImporteRetIVA").ToString().ToDecimal) Then
MensajeError = "Ocurrió un error al guardar las partidas de la cotización" MensajeError = "Ocurrió un error al guardar las partidas de la cotización"
OcurrioError = True OcurrioError = True
Exit For Exit For
@@ -27237,6 +27462,8 @@ Partial Class Ventas
#Region "D E S C U E N T O S X R E M I S I O N D E N O T A D E C R E D I T O" #Region "D E S C U E N T O S X R E M I S I O N D E N O T A D E C R E D I T O"
Protected Sub BtnAplicarRemisionNC_Click(sender As Object, e As EventArgs) Protected Sub BtnAplicarRemisionNC_Click(sender As Object, e As EventArgs)
Me.AplicaRNCXDetalle = False
If ListaRemisionesNC Is Nothing Then If ListaRemisionesNC Is Nothing Then
ListaRemisionesNC = New List(Of Modelos.Factura) ListaRemisionesNC = New List(Of Modelos.Factura)
Else Else
@@ -27250,69 +27477,139 @@ Partial Class Ventas
End If End If
Dim TotalRemNCAplicado As Decimal = 0 Dim TotalRemNCAplicado As Decimal = 0
For Each GvRow As GridViewRow In GvRemisionesNC.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then If ChkMostarProductosRNC.Checked Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaRemisionesNC.Clear() Me.AplicaRNCXDetalle = True
Exit Sub
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
For Each row In Rows
row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToEntero()
TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
Next
End If End If
ListaRemisionesNC.Add(RemNC)
End If
End If
Next
'SI TIENE ALGUN AJUSTE O GARANTIA
If ListaRemisionesNC.Any(Function(RNC) RNC.Num2 = 1) Then
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DdlNCPS.SelectedValueExist(443174)
DdlNCPS.Enabled = False
Salir = True
Else
DdlNCPS.SelectedValueExist(443173)
DdlNCPS.Enabled = False
End If
End If
End Using
If Salir Then
Exit For
End If End If
Next Next
For Each Dr As DataRow In TmpDTRNCDetalleSelecciondas.FiltraParametros("", DistinctColumns:={"CveVenta"}).Rows
Dim RemNC As New Modelos.Factura(UsuarioActual, Dr("CveVenta").ToString().ToEntero(), UsuarioActual.CveEmpresa)
Dim TotalRNC As Decimal = 0
For Each GvRow As GridViewRow In GvRemisionesNCDetalle.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
Dim PU = GvRow.DataKey("PU").ToDecimal()
Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
TotalRNC += TotalRNCDetalle
End If
End If
Next
RemNC.TotalRemNCAplicado = TotalRNC
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaRemisionesNC.Clear()
Exit Sub
End If
ListaRemisionesNC.Add(RemNC)
Next
Else Else
DdlNCPS.Enabled = True
End If
For Each GvRow As GridViewRow In GvRemisionesNC.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
'MARCA LA VENTA QUE FUE USADA PARA EL FILTRO
RemNC.Num3 = DdlVentaUsado.SelectedValue.ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows If RemNC.TotalRemNCAplicado <= 0 Then
If GvRow.RowType = DataControlRowType.DataRow Then Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
If GvRow.FCCheckBox("ChkAplicar").Checked Then ListaRemisionesNC.Clear()
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa) Exit Sub
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal() End If
RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then ListaRemisionesNC.Add(RemNC)
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia) End If
ListaNCBonificacion.Clear() End If
Exit Sub Next
'SI TIENE ALGUN AJUSTE O GARANTIA
If ListaRemisionesNC.Any(Function(RNC) RNC.Num2 = 1) Then
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
Dim NCAjuste As Integer = -1
Dim NCGarantiaTotal As Integer = -1
If ArrayNC.Length > 2 Then
NCAjuste = ArrayNC(1).ToEntero()
NCGarantiaTotal = ArrayNC(2).ToEntero()
End If End If
ListaNCBonificacion.Add(RemNC) Using ObjAcum As New ClsAcumuladores
End If If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DdlNCPS.SelectedValueExist(NCGarantiaTotal)
DdlNCPS.Enabled = False
Salir = True
Else
DdlNCPS.SelectedValueExist(NCAjuste)
DdlNCPS.Enabled = False
End If
End If
End Using
If Salir Then
Exit For
End If
Next
Else
DdlNCPS.Enabled = True
End If End If
Next
For Each GvRow As GridViewRow In GvRemisionesNCBon.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCBonificacion.Clear()
Exit Sub
End If
ListaNCBonificacion.Add(RemNC)
End If
End If
Next
End If
TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero TxtImportesRemisionesNC.Text = TotalRemNCAplicado.FormatoNumero
TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero TxtNCImporte.Text = TotalRemNCAplicado.FormatoNumero
@@ -27332,6 +27629,12 @@ Partial Class Ventas
Dim CveSATNC = "84111506" Dim CveSATNC = "84111506"
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0) Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
Dim ArrayNC As String() = UsuarioActual.Empresa.Funcionalidad(591).Split(",".ToCharArray())
If ArrayNC.Length > 0 Then
Dim CvePSNC As Integer = ArrayNC(0).ToEntero()
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSNC, AplicaParaVenta:=1).Rows(0)
End If
If DrPS Is Nothing Then If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -27374,14 +27677,22 @@ Partial Class Ventas
If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then If ListaNCDesc.Any(Function(RNC) RNC.Num2 = 1) Then
For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1) For Each RNC In ListaRemisionesNC.Where(Function(x) x.Num2 = 1)
Dim Salir As Boolean = False Dim Salir As Boolean = False
Dim NCAjuste As Integer = -1
Dim NCGarantiaTotal As Integer = -1
If ArrayNC.Length > 2 Then
NCAjuste = ArrayNC(1).ToEntero()
NCGarantiaTotal = ArrayNC(2).ToEntero()
End If
Using ObjAcum As New ClsAcumuladores Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then If ObjAcum.GetGarantiasDetalle(RNC.CveVenta) Then
'SI ES GARANTIA TOTAL 'SI ES GARANTIA TOTAL
If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then If ObjAcum.DtResultados.MAX("PorcentajeAjuste") = "1" Then
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=443174, AplicaParaVenta:=1).Rows(0) DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCGarantiaTotal, AplicaParaVenta:=1).Rows(0)
Salir = True Salir = True
Else Else
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=443173, AplicaParaVenta:=1).Rows(0) DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=NCAjuste, AplicaParaVenta:=1).Rows(0)
End If End If
End If End If
End Using End Using
@@ -27501,7 +27812,7 @@ Partial Class Ventas
#End Region #End Region
Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs) Protected Sub BtnModalAplicarRemisionesNC_Click(sender As Object, e As EventArgs)
CargaRNC() ChkMostarProductosRNC_CheckedChanged(ChkMostarProductosRNC, EventArgs.Empty)
RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });") RegistraScript("$('#ModalAplicarRemisionesNC').modal({backdrop: 'static', keyboard: false });")
End Sub End Sub
@@ -28098,4 +28409,5 @@ Partial Class Ventas
Public ImporteBonificacion As Decimal = 0 Public ImporteBonificacion As Decimal = 0
Public IVABonificacion As Decimal = 0 Public IVABonificacion As Decimal = 0
End Class End Class
End Class End Class