This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2020-10-22 08:07:56 -07:00
48 changed files with 9325 additions and 1052 deletions

View File

@@ -82,7 +82,7 @@
<%-- <asp:DropDownList ID="DdlSucursal" runat="server" CssClass="select2me" DataTextField="Sucursal" DataValueField="CveSucursal" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>--%>
<asp:DropDownList ID="DdlTipoFolio" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem>
<asp:ListItem Value="general" >general</asp:ListItem>
<asp:ListItem Value="general">general</asp:ListItem>
<asp:ListItem Value="optima">optima</asp:ListItem>
<asp:ListItem Value="motobateria">motobateria</asp:ListItem>
</asp:DropDownList>
@@ -151,7 +151,7 @@
&nbsp;<asp:Literal ID="LblPuntos" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="AreaTexto" ItemStyle-Width ="100px" HeaderText="Área" />
<asp:BoundField DataField="AreaTexto" ItemStyle-Width="100px" HeaderText="Área" />
<asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">
<ItemTemplate>
&nbsp;<asp:Literal ID="lblFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
@@ -164,6 +164,13 @@
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
<ItemTemplate>
<asp:LinkButton ID="ImgVer" OnClick="ImgVer_Click" runat="server" AlternateText="Editar" CausesValidation="False"
CssClass="btn btn-primary btn-circle btn-sm" Text="<i class='fa fa-bars'></i>" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
<ItemTemplate>
<asp:LinkButton ID="ImgE" OnClick="Edit_ClickFolioGarantia" runat="server" AlternateText="Editar" CausesValidation="False"
@@ -249,8 +256,9 @@
<%--<br />--%>
<div class="form-group form-md-line-input input-iconright" >
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="lblSubProyecto" for="<%= DdlSubProyectos.ClientID.ToString()%>">SubProyecto:</asp:Label></br>
<asp:DropDownList ID="DdlSubProyectos" runat="server" CssClass="form-control input-sm select2me" DataValueField="CveSubProyecto" DataTextField="SubProyecto" Class="table-group-action-input form-control input-inline input-small input-sm" Width="50%" AutoPostBack="true"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVProducto2" InitialValue="-1" runat="server" ControlToValidate="DdlSubProyectos" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''SubProyecto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpFolioGarantia"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEProducto2" runat="server" HighlightCssClass="vco" TargetControlID="RFVProducto2" Width="300px"></ajax:ValidatorCalloutExtender>
@@ -262,14 +270,17 @@
<div class="form-group form-md-line-input input-iconright">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label></br>
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
<i></i>
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblTipoFolio" for="<%= DdlTipoFolioModal.ClientID.ToString()%>">Tipo Folio:</asp:Label></br>
<asp:DropDownList ID="DdlTipoFolioModal" runat="server" CssClass="form-control input-sm select2me" Width="50%" ValidationGroup="GrpGuardar">
<asp:ListItem Value="general" Selected ="True">General</asp:ListItem>
<asp:ListItem Value="general" Selected="True">General</asp:ListItem>
<asp:ListItem Value="optima">Optima</asp:ListItem>
<asp:ListItem Value="motobateria">Motobateria</asp:ListItem>
</asp:DropDownList>
@@ -284,8 +295,9 @@
</div>
<div class="form-group form-md-line-input input-iconright">
<asp:Label runat="server" ID="LblArea" for="<%= DdlArea.ClientID.ToString()%>">Área:</asp:Label></br>
<asp:DropDownList ID="DdlArea" runat="server" CssClass="form-control input-sm select2me" Width="50%" ValidationGroup="GrpGuardar">
<asp:ListItem Value="1" Selected ="True">Piso</asp:ListItem>
<asp:ListItem Value="1" Selected="True">Piso</asp:ListItem>
<asp:ListItem Value="2">Almacén</asp:ListItem>
</asp:DropDownList>
<i></i>
@@ -340,6 +352,60 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpGarantiasDetalle" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="DivGarantiasDetalle" class="modal ADS fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Label Text="Ver Ajustes de garantía" runat="server" />
</h4>
</div>
<div class="modal-body">
<table>
<tr>
<td>Folio Garantia:</td>
<td>
<asp:Label ID="LblFolio" Text="" Font-Bold="true" runat="server" />
</td>
</tr>
</table>
<div class="row">
<div class="col-md-12">
<div style="overflow-y: auto; height: 400px; width:1200px;">
<asp:GridView ID="GvGarantiasDetalle" ClientIDMode="Static" runat="server" AutoGenerateColumns="false" Width="100%" EmptyDataText="No se encontraron datos" CssClass="table table-striped table-hover Widthall" BorderColor="#D3D3D3" GridLines="None">
<Columns>
<asp:BoundField DataField="Consecutivo" HeaderText="Consecutivo" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="FolioFactura" HeaderText="Factura" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" />
<asp:BoundField DataField="Cliente" HeaderText="Cliente" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%" />
<asp:BoundField DataField="CodigoPS" HeaderText="Producto" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%" />
<asp:BoundField DataField="TipoUso" HeaderText="Tipo Uso" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="CodigoEnsamble" HeaderText="Código Ensamble" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="CodigoLinea" HeaderText="Código Linea" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="CodigoInspeccion" HeaderText="Código Inspeccion" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="NumPoliza" HeaderText="Num.Póliza" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="5%" />
<asp:BoundField DataField="FechaAjuste" HeaderText="Fecha Ajuste" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" />
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<asp:UpdatePanel runat="server">
<ContentTemplate>
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -218,6 +218,28 @@ Partial Class Acumuladores_CatFoliosGarantia
End Sub
Public Sub ImgVer_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveFolioGarantia = GvRow.DataKey("CveFolioGarantia")
LblFolio.Text = GvRow.DataKey("FolioGarantia")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.GetFoliosGarantiasDetalle(CveFolioGarantia) Then
GvGarantiasDetalle.DataSource = ObjAcum.DtResultados
End If
End Using
GvGarantiasDetalle.DataBind()
UpGarantiasDetalle.Update()
RegistraScript("$('#DivGarantiasDetalle').modal('show');")
End Sub
#End Region

View File

@@ -1126,6 +1126,25 @@ Public Class ClsAcumuladores
Return Retorno
End Function
Public Function GetFoliosGarantiasDetalle(CveFolioGarantia As Integer) As Boolean
Dim Retorno As Boolean = False
SqlDataAdapter("PA_Acum_GarantiasDetalleFolioGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As SqlException
OnError("Ocurrió un error al consultar los movimientos. ", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#Region " IDisposable Support "

View File

@@ -2021,7 +2021,7 @@ Public Class ClsClientes
Return Retorno
End Function
Public Function UpdateEstatusPedido(CveVenta As Integer, CveEstatusFactura As Integer, Dias As Integer, CveUsuario As Integer) As Boolean
Public Function UpdateEstatusPedido(CveVenta As Integer, CveEstatusFactura As Integer, Dias As Integer, CveUsuario As Integer, Optional CveRemision As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteVentasPedidoEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters
@@ -2029,6 +2029,7 @@ Public Class ClsClientes
.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
.Add("@Dias", SqlDbType.Int).Value = Dias
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveRemision", SqlDbType.Int).Value = CveRemision
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -2410,7 +2410,7 @@ Public Class ClsCompras
End Function
Public Function GetCompararComplementoPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer, Optional CveIE As Integer = -1, Optional OP As Integer = 1) As Boolean
Public Function GetCompararComplementoPago(CveProveedor As Integer, Monto As Decimal, XMLPagos As String, CveEmpresa As Integer, Optional CveIE As Integer = -1, Optional OP As Integer = 1, Optional CveFactura As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Comp_CompararComplementoPagoGet")
With SqlAdapter.SelectCommand.Parameters
@@ -2420,6 +2420,7 @@ Public Class ClsCompras
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveIE", SqlDbType.Int).Value = CveIE
.Add("@OP", SqlDbType.Int).Value = OP
.Add("@CveFactura", SqlDbType.Int).Value = CveFactura
End With
Try
SqlAdapter.Fill(Data)

View File

@@ -68,6 +68,11 @@ Public Class ClsContabilidad
Public Property ValorPolizaDescuadre As Integer
Public Property MensajePolizaDescuadre As String
Public Property ValorDiferencia As String
Public Property SeUnifico As Boolean = False
Public Property YaEstabaUnifida As Boolean = False
Public Property EstaContabilizada As Boolean = False
#End Region
Public Function IniciaTransacSQL() As SqlTransaction
@@ -756,16 +761,30 @@ Public Class ClsContabilidad
Dim Retorno As Boolean = False
SeUnifico = False
YaEstabaUnifida = False
EstaContabilizada = False
DataAdapter("PA_Conta_PrePolizaUnificacion")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePrePoliza", SqlDbType.Int).Value = CvePrePoliza
.Add("@CvePrePolizaVieja", SqlDbType.Int).Value = CvePrePolizaVieja
.Add("@SeUnifico", SqlDbType.Bit).Direction = ParameterDirection.Output
.Add("@YaEstabaUnifida", SqlDbType.Bit).Direction = ParameterDirection.Output
.Add("@EstaContabilizada", SqlDbType.Bit).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
SeUnifico = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@SeUnifico").Value.ToString)
YaEstabaUnifida = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@YaEstabaUnifida").Value.ToString)
EstaContabilizada = Boolean.Parse(SqlAdapter.SelectCommand.Parameters("@EstaContabilizada").Value.ToString)
Retorno = True
Catch ex1 As SqlException
OnError("Ocurrió un error al actualizar la Poliza Original", ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
Catch ex As Exception
@@ -773,6 +792,7 @@ Public Class ClsContabilidad
End Try
Return Retorno
End Function
Public Function PrePolizaSimplificacion(CvePrePoliza As Integer, CveEmpresa As Integer) As Boolean

View File

@@ -446,6 +446,7 @@ Public Class ClsContratos
Return Retorno
End Function
Public Function TerminarContrato(CveContrato As Integer, CveTipoEstatus As Integer, CveEmpresa As Integer) As Integer
Dim Retorno = -1
@@ -515,6 +516,163 @@ Public Class ClsContratos
#End Region
#Region "CONTRATO OBRA"
Public Function AddContratosObra(NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime,
Ubicacion As String, Responsable As String, CveProyecto As Integer, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String,
Geom As String, CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CvePeriodo As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "") As Integer
Dim Retorno As Integer = -1
DataAdapter("PA_Con_ContratosObraAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@NumeroContrato", SqlDbType.VarChar).Value = NumeroContrato
.Add("@DescripcionContrato", SqlDbType.VarChar).Value = DescripcionContrato
.Add("@NumeroLicitacion", SqlDbType.VarChar).Value = NumeroLicitacion
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProspecto", SqlDbType.Int).Value = CveProspecto
.Add("@FechaInicial", SqlDbType.DateTime).Value = FechaInicial
.Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal
.Add("@Ubicacion", SqlDbType.VarChar).Value = Ubicacion
.Add("@Responsable", SqlDbType.VarChar).Value = Responsable
.Add("@CveProyecto", SqlDbType.Int).Value = CveProyecto
.Add("@CveContratosEstatus", SqlDbType.Int).Value = CveContratosEstatus
.Add("@PorIVA", SqlDbType.Float).Value = PorIVA
.Add("@PorAnticipo", SqlDbType.Float).Value = PorAnticipo
.Add("@PorAmortizacionAnticipo", SqlDbType.Float).Value = PorAmortizacionAnticipo
.Add("@PorGarantia", SqlDbType.Float).Value = PorGarantia
'.Add("@EstatusContrato", SqlDbType.Bit).Value = EstatusContrato
.Add("@Archivo", SqlDbType.VarChar).Value = Archivo
.Add("@Geom", SqlDbType.VarChar).Value = Geom
.Add("@CveContratoPadre", SqlDbType.Int).Value = CveContratoPadre
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@EsPresupuestal", SqlDbType.Int).Value = EsPresupuestal
.Add("@CveContratoTipo", SqlDbType.SmallInt).Value = CveContratoTipo
.Add("@ImporteMin", SqlDbType.Money).Value = Minimo
.Add("@ImporteMax", SqlDbType.Money).Value = Maximo
.Add("@Importe", SqlDbType.Money).Value = Importe
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@TipoCambio", SqlDbType.Money).Value = TipoCambio
.Add("@ModalidadDetalle", SqlDbType.TinyInt).Value = ModalidadDetalle
.Add("@CveSucursalCliente", SqlDbType.Int).Value = CveSucursalCliente
.Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen
.Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino
.Add("@PorcentajeComision", SqlDbType.Int).Value = PorcentajeComision
.Add("@TipoGarantia", SqlDbType.Int).Value = TipoGarantia
.Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@FechaVenc", SqlDbType.Date).Value = FechaVenc
.Add("@EstatusFianza", SqlDbType.Int).Value = EstatusFianza
.Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo
.Add("@CveCuentaEquipo", SqlDbType.Int).Value = CveCuentaEquipo
.Add("@CveContratoPlantilla", SqlDbType.Int).Value = CveContratoPlantilla
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
.Add("@CveContrato", SqlDbType.Int).Direction = ParameterDirection.Output
End With
Try
SqlAdapter.Fill(Data)
Retorno = CInt(SqlAdapter.SelectCommand.Parameters("@CveContrato").Value)
Catch ex As Exception
If ex.Message.Contains("Número: 2601;") Then
Alert("Ya existe un contrato con el mismo número de contrato registrado: " & NumeroContrato & ".", TipoMensaje.MsgAdvertencia)
Else
OnError("Ocurrió un error al agregar el Contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End Try
Return Retorno
End Function
Public Function UpdateContratosObra(CveContrato As Integer, NumeroContrato As String, DescripcionContrato As String, NumeroLicitacion As String, CveProveedor As Integer, CveCliente As Integer, CveProspecto As Integer, FechaInicial As DateTime, FechaFinal As DateTime,
Ubicacion As String, Responsable As String, PorIVA As Double, PorAnticipo As Double, PorAmortizacionAnticipo As Double, PorGarantia As Double, Archivo As String, Geom As String,
CveContratoPadre As Integer, CveUsuario As Integer, CveEmpresa As Integer, EsPresupuestal As Boolean, Minimo As Double, Maximo As Double, Importe As Double, CveMoneda As Integer, ModalidadDetalle As Integer,
Optional CveContratosEstatus As Integer = -1, Optional CveContratoTipo As Integer = -1, Optional TipoCambio As Double = 1.0, Optional CveSucursalCliente As Integer = -1, Optional CveAlmacenOrigen As Integer = -1, Optional CveAlmacenDestino As Integer = -1, Optional PorcentajeComision As Integer = -1,
Optional TipoGarantia As Integer = -1, Optional Folio As Integer = -1, Optional FechaVenc As Date = Nothing, Optional EstatusFianza As Integer = -1, Optional CveContratoPlantilla As Integer = -1, Optional CveCuentaEquipo As Integer = -1,
Optional CveVendedor As Integer = -1, Optional Observaciones As String = "", Optional CveDireccionEnvio As Integer = -1, Optional AplicaImpuestosLocales As Boolean = False, Optional CorreoNotificacionPedDev As String = "") As Boolean
Dim Retorno = False
DataAdapter("PA_Con_ContratosObraUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveContrato", SqlDbType.Int).Value = CveContrato
.Add("@NumeroContrato", SqlDbType.VarChar).Value = NumeroContrato
.Add("@DescripcionContrato", SqlDbType.VarChar).Value = DescripcionContrato
.Add("@NumeroLicitacion", SqlDbType.VarChar).Value = NumeroLicitacion
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveProspecto", SqlDbType.Int).Value = CveProspecto
.Add("@FechaInicial", SqlDbType.DateTime).Value = FechaInicial
.Add("@FechaFinal", SqlDbType.DateTime).Value = FechaFinal
.Add("@Ubicacion", SqlDbType.VarChar).Value = Ubicacion
.Add("@Responsable", SqlDbType.VarChar).Value = Responsable
.Add("@CveContratosEstatus", SqlDbType.Int).Value = CveContratosEstatus
.Add("@PorIVA", SqlDbType.Float).Value = PorIVA
.Add("@PorAnticipo", SqlDbType.Float).Value = PorAnticipo
.Add("@PorAmortizacionAnticipo", SqlDbType.Float).Value = PorAmortizacionAnticipo
.Add("@PorGarantia", SqlDbType.Float).Value = PorGarantia
'.Add("@EstatusContrato", SqlDbType.Bit).Value = EstatusContrato
.Add("@Archivo", SqlDbType.VarChar).Value = Archivo
.Add("@Geom", SqlDbType.VarChar).Value = Geom
.Add("@CveContratoPadre", SqlDbType.Int).Value = CveContratoPadre
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@EsPresupuestal", SqlDbType.Int).Value = EsPresupuestal
.Add("@ImporteMin", SqlDbType.Money).Value = Minimo
.Add("@ImporteMax", SqlDbType.Money).Value = Maximo
.Add("@Importe", SqlDbType.Money).Value = Importe
.Add("@CveContratoTipo", SqlDbType.SmallInt).Value = CveContratoTipo
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
.Add("@TipoCambio", SqlDbType.Money).Value = TipoCambio
.Add("@ModalidadDetalle", SqlDbType.TinyInt).Value = ModalidadDetalle
.Add("@CveSucursalCliente", SqlDbType.Int).Value = CveSucursalCliente
.Add("@CveAlmacenOrigen", SqlDbType.Int).Value = CveAlmacenOrigen
.Add("@CveAlmacenDestino", SqlDbType.Int).Value = CveAlmacenDestino
.Add("@PorcentajeComision", SqlDbType.Int).Value = PorcentajeComision
.Add("@TipoGarantia", SqlDbType.Int).Value = TipoGarantia
.Add("@Folio", SqlDbType.Int).Value = Folio
.Add("@FechaVenc", SqlDbType.Date).Value = FechaVenc
.Add("@EstatusFianza", SqlDbType.Int).Value = EstatusFianza
.Add("@CveContratoPlantilla", SqlDbType.Int).Value = CveContratoPlantilla
.Add("@CveCuentaEquipo", SqlDbType.Int).Value = CveCuentaEquipo
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveDireccionEnvio", SqlDbType.Int).Value = CveDireccionEnvio
.Add("@AplicaImpuestosLocales", SqlDbType.Bit).Value = If(AplicaImpuestosLocales, 1, 0)
.Add("@CorreoNotificacionPedDev", SqlDbType.VarChar).Value = CorreoNotificacionPedDev
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
If ex.Message.Contains("Número: 2601;") Then
Alert("Ya existe un contrato con el mismo número de contrato registrado: " & NumeroContrato & ".", TipoMensaje.MsgAdvertencia)
Else
OnError("Ocurrió un error al actualizar el Contrato.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End Try
Return Retorno
End Function
#End Region
#Region "C I C L O C O M E R C I A L"
Public Function CicloComercialAdd(CveContrato As Integer, CveCotizacion As Integer, CveCliente As Integer, FueFacturado As Boolean, CveFactura As Integer, Estatus As Integer, CveEmpresa As Integer, FechaVenc As Date) As Boolean
Dim Retorno As Boolean = False

View File

@@ -1307,9 +1307,13 @@ Public Class ClsInventarios
Catch Ex1 As SqlException
If Ex1.Message.Contains("50019") Then
Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
If Ex1.Message.Contains("50021") Then
Me.OnError(" El producto ingresado previamente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else
Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
End If
Catch ex As Exception
@@ -1480,7 +1484,9 @@ Public Class ClsInventarios
Return Retorno
End Function
Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer, IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0, Optional Orden As Integer = -1, Optional Marcas As String = "-1") As Boolean
Public Function GetKardexAlmacenHorizontal(CvePS As Integer, FechaFin As Date, CveAlmacen As Integer, CveUnidadMedida As Integer, CveProveedor As Integer, CveTipoAlmacen As Integer,
IncluyeTransitorios As Integer, CveClasificacion As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional CondicionExistencias As Integer = 0,
Optional Orden As Integer = -1, Optional Marcas As String = "-1", Optional IncluyeProyectado As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexAlmacenHorizontalGet")
@@ -1500,6 +1506,7 @@ Public Class ClsInventarios
.Add("@ExistenciasCondicion", SqlDbType.Int).Value = CondicionExistencias
.Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@Marcas", SqlDbType.VarChar).Value = Marcas
.Add("@IncluyeProyectado", SqlDbType.TinyInt).Value = IncluyeProyectado
End With
Try
@@ -5178,6 +5185,48 @@ Public Class ClsInventarios
Return Retorno
End Function
#Region "Proyeccion"
Public Function AddMovimientosProyectados(CvePS As Integer, Cantidad As Decimal, TipoMovto As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("Inv_MovimientosProyectadosAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePS", SqlDbType.Int).Value = CvePS
.Add("@Cantidad", SqlDbType.Money).Value = Cantidad
.Add("@TipoMovto", SqlDbType.TinyInt).Value = TipoMovto
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al agregar la proyección.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function DeleteMovimientosProyectados(TipoMovto As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("Inv_MovimientosProyectadosDelete")
With SqlAdapter.SelectCommand.Parameters
.Add("@TipoMovto", SqlDbType.TinyInt).Value = TipoMovto
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al eliminar la proyección.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
#End Region
#Region "SUGERENCIAS SALIDA DE ALMACEN"
Public Function GetSugerenciasSalidaAlmacen(CveVenta As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean

View File

@@ -986,13 +986,6 @@ Public Class ClsPaginas
Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose()
Dim msg As String = "aqui no se carga subproyectos"
If Request IsNot Nothing Then
msg = msg & Request.ServerVariables("URL")
End If
msg.GuardaLog()
End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then
@@ -4985,9 +4978,7 @@ Public Class ClsPaginas
PaginaDict.Add("/PV/PVRepCompras.aspx".ToUpper(), 272)
PaginaDict.Add("/PV/PVRepVentasCompras.aspx".ToUpper(), 273)
PaginaDict.Add("/Contratos/ContratoObra.aspx".ToUpper(), -1)

View File

@@ -1355,13 +1355,15 @@ Public Class ClsProductosServicios
Return Retorno
End Function
Public Function RemovePSAlias(CvePS As Integer, PSAlias As String) As Boolean
Public Function RemovePSAlias(CvePS As Integer, PSAlias As String, CveUsuarioModifico As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosAliasRemove")
SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
SqlAdapter.SelectCommand.Parameters.Add("@PSAlias", SqlDbType.VarChar).Value = PSAlias
SqlAdapter.SelectCommand.Parameters.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
Try
SqlAdapter.Fill(Data)
Retorno = True

View File

@@ -1285,6 +1285,8 @@ Public Class ClsVentas
With SqlAdapter.SelectCommand.Parameters
.Add("@EstatusDevolucion", SqlDbType.TinyInt).Value = EstatusDevolucion
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
'.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
'.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try

View File

@@ -12,7 +12,7 @@
<xs:element name="DtDatos" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="DtDatos" msprop:Generator_UserDSName="DtDatos">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="DataTable1" msprop:Generator_TableClassName="DataTable1DataTable" msprop:Generator_TableVarName="tableDataTable1" msprop:Generator_RowChangedName="DataTable1RowChanged" msprop:Generator_TablePropName="DataTable1" msprop:Generator_RowDeletingName="DataTable1RowDeleting" msprop:Generator_RowChangingName="DataTable1RowChanging" msprop:Generator_RowEvHandlerName="DataTable1RowChangeEventHandler" msprop:Generator_RowDeletedName="DataTable1RowDeleted" msprop:Generator_RowClassName="DataTable1Row" msprop:Generator_UserTableName="DataTable1" msprop:Generator_RowEvArgName="DataTable1RowChangeEvent">
<xs:element name="DataTable1" msprop:Generator_TableClassName="DataTable1DataTable" msprop:Generator_TableVarName="tableDataTable1" msprop:Generator_TablePropName="DataTable1" msprop:Generator_RowDeletingName="DataTable1RowDeleting" msprop:Generator_RowChangingName="DataTable1RowChanging" msprop:Generator_RowEvHandlerName="DataTable1RowChangeEventHandler" msprop:Generator_RowDeletedName="DataTable1RowDeleted" msprop:Generator_UserTableName="DataTable1" msprop:Generator_RowChangedName="DataTable1RowChanged" msprop:Generator_RowEvArgName="DataTable1RowChangeEvent" msprop:Generator_RowClassName="DataTable1Row">
<xs:complexType>
<xs:sequence>
<xs:element name="SerieFolio" msprop:Generator_ColumnVarNameInTable="columnSerieFolio" msprop:Generator_ColumnPropNameInRow="SerieFolio" msprop:Generator_ColumnPropNameInTable="SerieFolioColumn" msprop:Generator_UserColumnName="SerieFolio" type="xs:string" minOccurs="0" />
@@ -28,7 +28,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="VentaUtilidadDetalle" msprop:Generator_TableClassName="VentaUtilidadDetalleDataTable" msprop:Generator_TableVarName="tableVentaUtilidadDetalle" msprop:Generator_TablePropName="VentaUtilidadDetalle" msprop:Generator_RowDeletingName="VentaUtilidadDetalleRowDeleting" msprop:Generator_RowChangingName="VentaUtilidadDetalleRowChanging" msprop:Generator_RowEvHandlerName="VentaUtilidadDetalleRowChangeEventHandler" msprop:Generator_RowDeletedName="VentaUtilidadDetalleRowDeleted" msprop:Generator_UserTableName="VentaUtilidadDetalle" msprop:Generator_RowChangedName="VentaUtilidadDetalleRowChanged" msprop:Generator_RowEvArgName="VentaUtilidadDetalleRowChangeEvent" msprop:Generator_RowClassName="VentaUtilidadDetalleRow">
<xs:element name="VentaUtilidadDetalle" msprop:Generator_TableClassName="VentaUtilidadDetalleDataTable" msprop:Generator_TableVarName="tableVentaUtilidadDetalle" msprop:Generator_RowChangedName="VentaUtilidadDetalleRowChanged" msprop:Generator_TablePropName="VentaUtilidadDetalle" msprop:Generator_RowDeletingName="VentaUtilidadDetalleRowDeleting" msprop:Generator_RowChangingName="VentaUtilidadDetalleRowChanging" msprop:Generator_RowEvHandlerName="VentaUtilidadDetalleRowChangeEventHandler" msprop:Generator_RowDeletedName="VentaUtilidadDetalleRowDeleted" msprop:Generator_RowClassName="VentaUtilidadDetalleRow" msprop:Generator_UserTableName="VentaUtilidadDetalle" msprop:Generator_RowEvArgName="VentaUtilidadDetalleRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CantVta" msprop:Generator_ColumnVarNameInTable="columnCantVta" msprop:Generator_ColumnPropNameInRow="CantVta" msprop:Generator_ColumnPropNameInTable="CantVtaColumn" msprop:Generator_UserColumnName="CantVta" type="xs:decimal" minOccurs="0" />
@@ -46,7 +46,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RepClientesCxC" msprop:Generator_TableClassName="RepClientesCxCDataTable" msprop:Generator_TableVarName="tableRepClientesCxC" msprop:Generator_TablePropName="RepClientesCxC" msprop:Generator_RowDeletingName="RepClientesCxCRowDeleting" msprop:Generator_RowChangingName="RepClientesCxCRowChanging" msprop:Generator_RowEvHandlerName="RepClientesCxCRowChangeEventHandler" msprop:Generator_RowDeletedName="RepClientesCxCRowDeleted" msprop:Generator_UserTableName="RepClientesCxC" msprop:Generator_RowChangedName="RepClientesCxCRowChanged" msprop:Generator_RowEvArgName="RepClientesCxCRowChangeEvent" msprop:Generator_RowClassName="RepClientesCxCRow">
<xs:element name="RepClientesCxC" msprop:Generator_TableClassName="RepClientesCxCDataTable" msprop:Generator_TableVarName="tableRepClientesCxC" msprop:Generator_RowChangedName="RepClientesCxCRowChanged" msprop:Generator_TablePropName="RepClientesCxC" msprop:Generator_RowDeletingName="RepClientesCxCRowDeleting" msprop:Generator_RowChangingName="RepClientesCxCRowChanging" msprop:Generator_RowEvHandlerName="RepClientesCxCRowChangeEventHandler" msprop:Generator_RowDeletedName="RepClientesCxCRowDeleted" msprop:Generator_RowClassName="RepClientesCxCRow" msprop:Generator_UserTableName="RepClientesCxC" msprop:Generator_RowEvArgName="RepClientesCxCRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="SerieFolio" msprop:Generator_ColumnVarNameInTable="columnSerieFolio" msprop:Generator_ColumnPropNameInRow="SerieFolio" msprop:Generator_ColumnPropNameInTable="SerieFolioColumn" msprop:Generator_UserColumnName="SerieFolio" type="xs:string" minOccurs="0" />
@@ -64,7 +64,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LibroMayor" msprop:Generator_TableClassName="LibroMayorDataTable" msprop:Generator_TableVarName="tableLibroMayor" msprop:Generator_RowChangedName="LibroMayorRowChanged" msprop:Generator_TablePropName="LibroMayor" msprop:Generator_RowDeletingName="LibroMayorRowDeleting" msprop:Generator_RowChangingName="LibroMayorRowChanging" msprop:Generator_RowEvHandlerName="LibroMayorRowChangeEventHandler" msprop:Generator_RowDeletedName="LibroMayorRowDeleted" msprop:Generator_RowClassName="LibroMayorRow" msprop:Generator_UserTableName="LibroMayor" msprop:Generator_RowEvArgName="LibroMayorRowChangeEvent">
<xs:element name="LibroMayor" msprop:Generator_TableClassName="LibroMayorDataTable" msprop:Generator_TableVarName="tableLibroMayor" msprop:Generator_TablePropName="LibroMayor" msprop:Generator_RowDeletingName="LibroMayorRowDeleting" msprop:Generator_RowChangingName="LibroMayorRowChanging" msprop:Generator_RowEvHandlerName="LibroMayorRowChangeEventHandler" msprop:Generator_RowDeletedName="LibroMayorRowDeleted" msprop:Generator_UserTableName="LibroMayor" msprop:Generator_RowChangedName="LibroMayorRowChanged" msprop:Generator_RowEvArgName="LibroMayorRowChangeEvent" msprop:Generator_RowClassName="LibroMayorRow">
<xs:complexType>
<xs:sequence>
<xs:element name="Fecha" msprop:Generator_ColumnVarNameInTable="columnFecha" msprop:Generator_ColumnPropNameInRow="Fecha" msprop:Generator_ColumnPropNameInTable="FechaColumn" msprop:Generator_UserColumnName="Fecha" type="xs:dateTime" minOccurs="0" />
@@ -87,7 +87,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LibroDiario" msprop:Generator_TableClassName="LibroDiarioDataTable" msprop:Generator_TableVarName="tableLibroDiario" msprop:Generator_RowChangedName="LibroDiarioRowChanged" msprop:Generator_TablePropName="LibroDiario" msprop:Generator_RowDeletingName="LibroDiarioRowDeleting" msprop:Generator_RowChangingName="LibroDiarioRowChanging" msprop:Generator_RowEvHandlerName="LibroDiarioRowChangeEventHandler" msprop:Generator_RowDeletedName="LibroDiarioRowDeleted" msprop:Generator_RowClassName="LibroDiarioRow" msprop:Generator_UserTableName="LibroDiario" msprop:Generator_RowEvArgName="LibroDiarioRowChangeEvent">
<xs:element name="LibroDiario" msprop:Generator_TableClassName="LibroDiarioDataTable" msprop:Generator_TableVarName="tableLibroDiario" msprop:Generator_TablePropName="LibroDiario" msprop:Generator_RowDeletingName="LibroDiarioRowDeleting" msprop:Generator_RowChangingName="LibroDiarioRowChanging" msprop:Generator_RowEvHandlerName="LibroDiarioRowChangeEventHandler" msprop:Generator_RowDeletedName="LibroDiarioRowDeleted" msprop:Generator_UserTableName="LibroDiario" msprop:Generator_RowChangedName="LibroDiarioRowChanged" msprop:Generator_RowEvArgName="LibroDiarioRowChangeEvent" msprop:Generator_RowClassName="LibroDiarioRow">
<xs:complexType>
<xs:sequence>
<xs:element name="Fecha" msprop:Generator_ColumnVarNameInTable="columnFecha" msprop:Generator_ColumnPropNameInRow="Fecha" msprop:Generator_ColumnPropNameInTable="FechaColumn" msprop:Generator_UserColumnName="Fecha" type="xs:dateTime" minOccurs="0" />
@@ -111,7 +111,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RepBalanzaComprobacion" msprop:Generator_TableClassName="RepBalanzaComprobacionDataTable" msprop:Generator_TableVarName="tableRepBalanzaComprobacion" msprop:Generator_TablePropName="RepBalanzaComprobacion" msprop:Generator_RowDeletingName="RepBalanzaComprobacionRowDeleting" msprop:Generator_RowChangingName="RepBalanzaComprobacionRowChanging" msprop:Generator_RowEvHandlerName="RepBalanzaComprobacionRowChangeEventHandler" msprop:Generator_RowDeletedName="RepBalanzaComprobacionRowDeleted" msprop:Generator_UserTableName="RepBalanzaComprobacion" msprop:Generator_RowChangedName="RepBalanzaComprobacionRowChanged" msprop:Generator_RowEvArgName="RepBalanzaComprobacionRowChangeEvent" msprop:Generator_RowClassName="RepBalanzaComprobacionRow">
<xs:element name="RepBalanzaComprobacion" msprop:Generator_TableClassName="RepBalanzaComprobacionDataTable" msprop:Generator_TableVarName="tableRepBalanzaComprobacion" msprop:Generator_RowChangedName="RepBalanzaComprobacionRowChanged" msprop:Generator_TablePropName="RepBalanzaComprobacion" msprop:Generator_RowDeletingName="RepBalanzaComprobacionRowDeleting" msprop:Generator_RowChangingName="RepBalanzaComprobacionRowChanging" msprop:Generator_RowEvHandlerName="RepBalanzaComprobacionRowChangeEventHandler" msprop:Generator_RowDeletedName="RepBalanzaComprobacionRowDeleted" msprop:Generator_RowClassName="RepBalanzaComprobacionRow" msprop:Generator_UserTableName="RepBalanzaComprobacion" msprop:Generator_RowEvArgName="RepBalanzaComprobacionRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" msprop:Generator_UserColumnName="Id" type="xs:string" minOccurs="0" />
@@ -137,7 +137,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CatPS" msprop:Generator_TableClassName="CatPSDataTable" msprop:Generator_TableVarName="tableCatPS" msprop:Generator_RowChangedName="CatPSRowChanged" msprop:Generator_TablePropName="CatPS" msprop:Generator_RowDeletingName="CatPSRowDeleting" msprop:Generator_RowChangingName="CatPSRowChanging" msprop:Generator_RowEvHandlerName="CatPSRowChangeEventHandler" msprop:Generator_RowDeletedName="CatPSRowDeleted" msprop:Generator_RowClassName="CatPSRow" msprop:Generator_UserTableName="CatPS" msprop:Generator_RowEvArgName="CatPSRowChangeEvent">
<xs:element name="CatPS" msprop:Generator_TableClassName="CatPSDataTable" msprop:Generator_TableVarName="tableCatPS" msprop:Generator_TablePropName="CatPS" msprop:Generator_RowDeletingName="CatPSRowDeleting" msprop:Generator_RowChangingName="CatPSRowChanging" msprop:Generator_RowEvHandlerName="CatPSRowChangeEventHandler" msprop:Generator_RowDeletedName="CatPSRowDeleted" msprop:Generator_UserTableName="CatPS" msprop:Generator_RowChangedName="CatPSRowChanged" msprop:Generator_RowEvArgName="CatPSRowChangeEvent" msprop:Generator_RowClassName="CatPSRow">
<xs:complexType>
<xs:sequence>
<xs:element name="Clasificacion" msprop:Generator_ColumnVarNameInTable="columnClasificacion" msprop:Generator_ColumnPropNameInRow="Clasificacion" msprop:Generator_ColumnPropNameInTable="ClasificacionColumn" msprop:Generator_UserColumnName="Clasificacion" type="xs:string" minOccurs="0" />
@@ -153,7 +153,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RepProveedorCxP" msprop:Generator_TableClassName="RepProveedorCxPDataTable" msprop:Generator_TableVarName="tableRepProveedorCxP" msprop:Generator_TablePropName="RepProveedorCxP" msprop:Generator_RowDeletingName="RepProveedorCxPRowDeleting" msprop:Generator_RowChangingName="RepProveedorCxPRowChanging" msprop:Generator_RowEvHandlerName="RepProveedorCxPRowChangeEventHandler" msprop:Generator_RowDeletedName="RepProveedorCxPRowDeleted" msprop:Generator_UserTableName="RepProveedorCxP" msprop:Generator_RowChangedName="RepProveedorCxPRowChanged" msprop:Generator_RowEvArgName="RepProveedorCxPRowChangeEvent" msprop:Generator_RowClassName="RepProveedorCxPRow">
<xs:element name="RepProveedorCxP" msprop:Generator_TableClassName="RepProveedorCxPDataTable" msprop:Generator_TableVarName="tableRepProveedorCxP" msprop:Generator_RowChangedName="RepProveedorCxPRowChanged" msprop:Generator_TablePropName="RepProveedorCxP" msprop:Generator_RowDeletingName="RepProveedorCxPRowDeleting" msprop:Generator_RowChangingName="RepProveedorCxPRowChanging" msprop:Generator_RowEvHandlerName="RepProveedorCxPRowChangeEventHandler" msprop:Generator_RowDeletedName="RepProveedorCxPRowDeleted" msprop:Generator_RowClassName="RepProveedorCxPRow" msprop:Generator_UserTableName="RepProveedorCxP" msprop:Generator_RowEvArgName="RepProveedorCxPRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="SerieFolio" msprop:Generator_ColumnVarNameInTable="columnSerieFolio" msprop:Generator_ColumnPropNameInRow="SerieFolio" msprop:Generator_ColumnPropNameInTable="SerieFolioColumn" msprop:Generator_UserColumnName="SerieFolio" type="xs:string" minOccurs="0" />
@@ -170,7 +170,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ResumenNC" msprop:Generator_TableClassName="ResumenNCDataTable" msprop:Generator_TableVarName="tableResumenNC" msprop:Generator_TablePropName="ResumenNC" msprop:Generator_RowDeletingName="ResumenNCRowDeleting" msprop:Generator_RowChangingName="ResumenNCRowChanging" msprop:Generator_RowEvHandlerName="ResumenNCRowChangeEventHandler" msprop:Generator_RowDeletedName="ResumenNCRowDeleted" msprop:Generator_UserTableName="ResumenNC" msprop:Generator_RowChangedName="ResumenNCRowChanged" msprop:Generator_RowEvArgName="ResumenNCRowChangeEvent" msprop:Generator_RowClassName="ResumenNCRow">
<xs:element name="ResumenNC" msprop:Generator_TableClassName="ResumenNCDataTable" msprop:Generator_TableVarName="tableResumenNC" msprop:Generator_RowChangedName="ResumenNCRowChanged" msprop:Generator_TablePropName="ResumenNC" msprop:Generator_RowDeletingName="ResumenNCRowDeleting" msprop:Generator_RowChangingName="ResumenNCRowChanging" msprop:Generator_RowEvHandlerName="ResumenNCRowChangeEventHandler" msprop:Generator_RowDeletedName="ResumenNCRowDeleted" msprop:Generator_RowClassName="ResumenNCRow" msprop:Generator_UserTableName="ResumenNC" msprop:Generator_RowEvArgName="ResumenNCRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="SerieFolio" msprop:Generator_ColumnVarNameInTable="columnSerieFolio" msprop:Generator_ColumnPropNameInRow="SerieFolio" msprop:Generator_ColumnPropNameInTable="SerieFolioColumn" msprop:Generator_UserColumnName="SerieFolio" type="xs:string" minOccurs="0" />
@@ -179,7 +179,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ProgramarRecursos" msprop:Generator_TableClassName="ProgramarRecursosDataTable" msprop:Generator_TableVarName="tableProgramarRecursos" msprop:Generator_TablePropName="ProgramarRecursos" msprop:Generator_RowDeletingName="ProgramarRecursosRowDeleting" msprop:Generator_RowChangingName="ProgramarRecursosRowChanging" msprop:Generator_RowEvHandlerName="ProgramarRecursosRowChangeEventHandler" msprop:Generator_RowDeletedName="ProgramarRecursosRowDeleted" msprop:Generator_UserTableName="ProgramarRecursos" msprop:Generator_RowChangedName="ProgramarRecursosRowChanged" msprop:Generator_RowEvArgName="ProgramarRecursosRowChangeEvent" msprop:Generator_RowClassName="ProgramarRecursosRow">
<xs:element name="ProgramarRecursos" msprop:Generator_TableClassName="ProgramarRecursosDataTable" msprop:Generator_TableVarName="tableProgramarRecursos" msprop:Generator_RowChangedName="ProgramarRecursosRowChanged" msprop:Generator_TablePropName="ProgramarRecursos" msprop:Generator_RowDeletingName="ProgramarRecursosRowDeleting" msprop:Generator_RowChangingName="ProgramarRecursosRowChanging" msprop:Generator_RowEvHandlerName="ProgramarRecursosRowChangeEventHandler" msprop:Generator_RowDeletedName="ProgramarRecursosRowDeleted" msprop:Generator_RowClassName="ProgramarRecursosRow" msprop:Generator_UserTableName="ProgramarRecursos" msprop:Generator_RowEvArgName="ProgramarRecursosRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="CveCompra" msprop:Generator_ColumnVarNameInTable="columnCveCompra" msprop:Generator_ColumnPropNameInRow="CveCompra" msprop:Generator_ColumnPropNameInTable="CveCompraColumn" msprop:Generator_UserColumnName="CveCompra" type="xs:short" minOccurs="0" />
@@ -215,7 +215,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RepIVA" msprop:Generator_TableClassName="RepIVADataTable" msprop:Generator_TableVarName="tableRepIVA" msprop:Generator_TablePropName="RepIVA" msprop:Generator_RowDeletingName="RepIVARowDeleting" msprop:Generator_RowChangingName="RepIVARowChanging" msprop:Generator_RowEvHandlerName="RepIVARowChangeEventHandler" msprop:Generator_RowDeletedName="RepIVARowDeleted" msprop:Generator_UserTableName="RepIVA" msprop:Generator_RowChangedName="RepIVARowChanged" msprop:Generator_RowEvArgName="RepIVARowChangeEvent" msprop:Generator_RowClassName="RepIVARow">
<xs:element name="RepIVA" msprop:Generator_TableClassName="RepIVADataTable" msprop:Generator_TableVarName="tableRepIVA" msprop:Generator_RowChangedName="RepIVARowChanged" msprop:Generator_TablePropName="RepIVA" msprop:Generator_RowDeletingName="RepIVARowDeleting" msprop:Generator_RowChangingName="RepIVARowChanging" msprop:Generator_RowEvHandlerName="RepIVARowChangeEventHandler" msprop:Generator_RowDeletedName="RepIVARowDeleted" msprop:Generator_RowClassName="RepIVARow" msprop:Generator_UserTableName="RepIVA" msprop:Generator_RowEvArgName="RepIVARowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="TipoDocto" msprop:Generator_ColumnVarNameInTable="columnTipoDocto" msprop:Generator_ColumnPropNameInRow="TipoDocto" msprop:Generator_ColumnPropNameInTable="TipoDoctoColumn" msprop:Generator_UserColumnName="TipoDocto" type="xs:string" minOccurs="0" />
@@ -240,7 +240,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DtVentaDetalle" msprop:Generator_TableClassName="DtVentaDetalleDataTable" msprop:Generator_TableVarName="tableDtVentaDetalle" msprop:Generator_RowChangedName="DtVentaDetalleRowChanged" msprop:Generator_TablePropName="DtVentaDetalle" msprop:Generator_RowDeletingName="DtVentaDetalleRowDeleting" msprop:Generator_RowChangingName="DtVentaDetalleRowChanging" msprop:Generator_RowEvHandlerName="DtVentaDetalleRowChangeEventHandler" msprop:Generator_RowDeletedName="DtVentaDetalleRowDeleted" msprop:Generator_RowClassName="DtVentaDetalleRow" msprop:Generator_UserTableName="DtVentaDetalle" msprop:Generator_RowEvArgName="DtVentaDetalleRowChangeEvent">
<xs:element name="DtVentaDetalle" msprop:Generator_TableClassName="DtVentaDetalleDataTable" msprop:Generator_TableVarName="tableDtVentaDetalle" msprop:Generator_TablePropName="DtVentaDetalle" msprop:Generator_RowDeletingName="DtVentaDetalleRowDeleting" msprop:Generator_RowChangingName="DtVentaDetalleRowChanging" msprop:Generator_RowEvHandlerName="DtVentaDetalleRowChangeEventHandler" msprop:Generator_RowDeletedName="DtVentaDetalleRowDeleted" msprop:Generator_UserTableName="DtVentaDetalle" msprop:Generator_RowChangedName="DtVentaDetalleRowChanged" msprop:Generator_RowEvArgName="DtVentaDetalleRowChangeEvent" msprop:Generator_RowClassName="DtVentaDetalleRow">
<xs:complexType>
<xs:sequence>
<xs:element name="Cantidad" msprop:Generator_ColumnVarNameInTable="columnCantidad" msprop:Generator_ColumnPropNameInRow="Cantidad" msprop:Generator_ColumnPropNameInTable="CantidadColumn" msprop:Generator_UserColumnName="Cantidad" type="xs:string" minOccurs="0" />
@@ -256,7 +256,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RepIVAAcreditable" msprop:Generator_TableClassName="RepIVAAcreditableDataTable" msprop:Generator_TableVarName="tableRepIVAAcreditable" msprop:Generator_TablePropName="RepIVAAcreditable" msprop:Generator_RowDeletingName="RepIVAAcreditableRowDeleting" msprop:Generator_RowChangingName="RepIVAAcreditableRowChanging" msprop:Generator_RowEvHandlerName="RepIVAAcreditableRowChangeEventHandler" msprop:Generator_RowDeletedName="RepIVAAcreditableRowDeleted" msprop:Generator_UserTableName="RepIVAAcreditable" msprop:Generator_RowChangedName="RepIVAAcreditableRowChanged" msprop:Generator_RowEvArgName="RepIVAAcreditableRowChangeEvent" msprop:Generator_RowClassName="RepIVAAcreditableRow">
<xs:element name="RepIVAAcreditable" msprop:Generator_TableClassName="RepIVAAcreditableDataTable" msprop:Generator_TableVarName="tableRepIVAAcreditable" msprop:Generator_RowChangedName="RepIVAAcreditableRowChanged" msprop:Generator_TablePropName="RepIVAAcreditable" msprop:Generator_RowDeletingName="RepIVAAcreditableRowDeleting" msprop:Generator_RowChangingName="RepIVAAcreditableRowChanging" msprop:Generator_RowEvHandlerName="RepIVAAcreditableRowChangeEventHandler" msprop:Generator_RowDeletedName="RepIVAAcreditableRowDeleted" msprop:Generator_RowClassName="RepIVAAcreditableRow" msprop:Generator_UserTableName="RepIVAAcreditable" msprop:Generator_RowEvArgName="RepIVAAcreditableRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="TipoDocto" msprop:Generator_ColumnVarNameInTable="columnTipoDocto" msprop:Generator_ColumnPropNameInRow="TipoDocto" msprop:Generator_ColumnPropNameInTable="TipoDoctoColumn" msprop:Generator_UserColumnName="TipoDocto" type="xs:string" minOccurs="0" />
@@ -291,10 +291,11 @@
<xs:element name="PorcentajeIVA" msprop:Generator_ColumnVarNameInTable="columnPorcentajeIVA" msprop:Generator_ColumnPropNameInRow="PorcentajeIVA" msprop:Generator_ColumnPropNameInTable="PorcentajeIVAColumn" msprop:Generator_UserColumnName="PorcentajeIVA" type="xs:double" minOccurs="0" />
<xs:element name="Fecha" msprop:Generator_ColumnVarNameInTable="columnFecha" msprop:Generator_ColumnPropNameInRow="Fecha" msprop:Generator_ColumnPropNameInTable="FechaColumn" msprop:Generator_UserColumnName="Fecha" type="xs:dateTime" minOccurs="0" />
<xs:element name="FolioFiscal" msprop:Generator_ColumnVarNameInTable="columnFolioFiscal" msprop:Generator_ColumnPropNameInRow="FolioFiscal" msprop:Generator_ColumnPropNameInTable="FolioFiscalColumn" msprop:Generator_UserColumnName="FolioFiscal" type="xs:string" minOccurs="0" />
<xs:element name="IVANoDeducible" msprop:Generator_ColumnVarNameInTable="columnIVANoDeducible" msprop:Generator_ColumnPropNameInRow="IVANoDeducible" msprop:Generator_ColumnPropNameInTable="IVANoDeducibleColumn" msprop:Generator_UserColumnName="IVANoDeducible" type="xs:double" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IEPSPorcentaje" msprop:Generator_TableClassName="IEPSPorcentajeDataTable" msprop:Generator_TableVarName="tableIEPSPorcentaje" msprop:Generator_TablePropName="IEPSPorcentaje" msprop:Generator_RowDeletingName="IEPSPorcentajeRowDeleting" msprop:Generator_RowChangingName="IEPSPorcentajeRowChanging" msprop:Generator_RowEvHandlerName="IEPSPorcentajeRowChangeEventHandler" msprop:Generator_RowDeletedName="IEPSPorcentajeRowDeleted" msprop:Generator_UserTableName="IEPSPorcentaje" msprop:Generator_RowChangedName="IEPSPorcentajeRowChanged" msprop:Generator_RowEvArgName="IEPSPorcentajeRowChangeEvent" msprop:Generator_RowClassName="IEPSPorcentajeRow">
<xs:element name="IEPSPorcentaje" msprop:Generator_TableClassName="IEPSPorcentajeDataTable" msprop:Generator_TableVarName="tableIEPSPorcentaje" msprop:Generator_RowChangedName="IEPSPorcentajeRowChanged" msprop:Generator_TablePropName="IEPSPorcentaje" msprop:Generator_RowDeletingName="IEPSPorcentajeRowDeleting" msprop:Generator_RowChangingName="IEPSPorcentajeRowChanging" msprop:Generator_RowEvHandlerName="IEPSPorcentajeRowChangeEventHandler" msprop:Generator_RowDeletedName="IEPSPorcentajeRowDeleted" msprop:Generator_RowClassName="IEPSPorcentajeRow" msprop:Generator_UserTableName="IEPSPorcentaje" msprop:Generator_RowEvArgName="IEPSPorcentajeRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="PorcentajeIEPS" msprop:Generator_ColumnVarNameInTable="columnPorcentajeIEPS" msprop:Generator_ColumnPropNameInRow="PorcentajeIEPS" msprop:Generator_ColumnPropNameInTable="PorcentajeIEPSColumn" msprop:Generator_UserColumnName="PorcentajeIEPS" type="xs:string" minOccurs="0" />
@@ -304,7 +305,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="IVAPorcentaje" msprop:Generator_TableClassName="IVAPorcentajeDataTable" msprop:Generator_TableVarName="tableIVAPorcentaje" msprop:Generator_TablePropName="IVAPorcentaje" msprop:Generator_RowDeletingName="IVAPorcentajeRowDeleting" msprop:Generator_RowChangingName="IVAPorcentajeRowChanging" msprop:Generator_RowEvHandlerName="IVAPorcentajeRowChangeEventHandler" msprop:Generator_RowDeletedName="IVAPorcentajeRowDeleted" msprop:Generator_UserTableName="IVAPorcentaje" msprop:Generator_RowChangedName="IVAPorcentajeRowChanged" msprop:Generator_RowEvArgName="IVAPorcentajeRowChangeEvent" msprop:Generator_RowClassName="IVAPorcentajeRow">
<xs:element name="IVAPorcentaje" msprop:Generator_TableClassName="IVAPorcentajeDataTable" msprop:Generator_TableVarName="tableIVAPorcentaje" msprop:Generator_RowChangedName="IVAPorcentajeRowChanged" msprop:Generator_TablePropName="IVAPorcentaje" msprop:Generator_RowDeletingName="IVAPorcentajeRowDeleting" msprop:Generator_RowChangingName="IVAPorcentajeRowChanging" msprop:Generator_RowEvHandlerName="IVAPorcentajeRowChangeEventHandler" msprop:Generator_RowDeletedName="IVAPorcentajeRowDeleted" msprop:Generator_RowClassName="IVAPorcentajeRow" msprop:Generator_UserTableName="IVAPorcentaje" msprop:Generator_RowEvArgName="IVAPorcentajeRowChangeEvent">
<xs:complexType>
<xs:sequence>
<xs:element name="PorcentajeIVA" msprop:Generator_ColumnVarNameInTable="columnPorcentajeIVA" msprop:Generator_ColumnPropNameInRow="PorcentajeIVA" msprop:Generator_ColumnPropNameInTable="PorcentajeIVAColumn" msprop:Generator_UserColumnName="PorcentajeIVA" type="xs:string" minOccurs="0" />

View File

@@ -4,7 +4,7 @@
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</autogenerated>-->
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="86" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<DiagramLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" ex:showrelationlabel="False" ViewPortX="-10" ViewPortY="127" xmlns:ex="urn:schemas-microsoft-com:xml-msdatasource-layout-extended" xmlns="urn:schemas-microsoft-com:xml-msdatasource-layout">
<Shapes>
<Shape ID="DesignTable:DataTable1" ZOrder="15" X="511" Y="201" Height="143" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="139" />
<Shape ID="DesignTable:VentaUtilidadDetalle" ZOrder="14" X="679" Y="199" Height="257" Width="187" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="253" />
@@ -18,7 +18,7 @@
<Shape ID="DesignTable:ProgramarRecursos" ZOrder="6" X="484" Y="563" Height="257" Width="206" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="253" />
<Shape ID="DesignTable:RepIVA" ZOrder="5" X="315" Y="564" Height="295" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="291" />
<Shape ID="DesignTable:DtVentaDetalle" ZOrder="4" X="280" Y="34" Height="219" Width="154" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="215" />
<Shape ID="DesignTable:RepIVAAcreditable" ZOrder="3" X="94" Y="508" Height="256" Width="175" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="252" />
<Shape ID="DesignTable:RepIVAAcreditable" ZOrder="3" X="94" Y="508" Height="257" Width="175" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="253" />
<Shape ID="DesignTable:IEPSPorcentaje" ZOrder="2" X="700" Y="594" Height="105" Width="152" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="101" />
<Shape ID="DesignTable:IVAPorcentaje" ZOrder="1" X="702" Y="709" Height="86" Width="150" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="82" />
</Shapes>

View File

@@ -1366,10 +1366,6 @@ Namespace Modelos
End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta, ObjVentas, factura.TipoDocto) Then
ErrorList.Add("Error al guardar usados")
End If
If ErrorList.Count = 0 AndAlso ObjVentas.CveVenta > 0 Then
@@ -1379,6 +1375,11 @@ Namespace Modelos
factura.Timbre.Comprobante.Serie = ObjVentas.Serie
factura.Timbre.Comprobante.Folio = ObjVentas.Folio.ToString
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas, factura) Then
ErrorList.Add("Error al guardar usados")
End If
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then
InicializaDTVentasNC()
@@ -1909,31 +1910,32 @@ Namespace Modelos
DtVentasNC.Rows.Add(Dr)
End If
End Sub
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer, ByRef ObjVentas As ClsVentas, TipoDocto As String) As Boolean
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, ByRef ObjVentas As ClsVentas, factura As Modelos.Factura) As Boolean
Dim Resultado As Boolean = True
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso TipoDocto.Contiene("Ing", "Ant", "Rem") Then
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero > 0 AndAlso factura.TipoDocto.Contiene("Ing", "Rem") Then
If factura.TipoDocto = "Ing" AndAlso factura.Cliente.EsDistribuidor Then
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
For Each drow As DataRow In DtDetalle.Rows
For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If ObjAcum.DistribuidorMovtosAdd(CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, CveVenta, UsuarioActual.CveUsuario,
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0D, "") Then
Else
Resultado = False
Exit For
End If
Else
Resultado = True
End If
Next
If TipoDocto.Contiene("Rem") Then
If DtRecepcionUsados IsNot Nothing Then
For Each drow As DataRow In DtRecepcionUsados.Rows
If Not ObjVentas.AddVentaUsado(CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("CveBCIUsado").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero) Then
End If
If factura.TipoDocto.Contiene("Rem") Then
If factura.DtRecepcionUsados IsNot Nothing Then
For Each drow As DataRow In factura.DtRecepcionUsados.Rows
If Not ObjVentas.AddVentaUsado(factura.CveVenta, drow("CvePS").ToString.ToEntero, drow("Cantidad").ToString.ToDecimal, drow("PU").ToString.ToDecimal, drow("CveBCIUsado").ToString.ToEntero, drow("CveModeloAuto").ToString.ToEntero) Then
Resultado = False
Exit For
End If
@@ -3330,7 +3332,7 @@ Namespace Modelos
'SI ES FACTURACION DE UNA REMISION CANCELAMOS, TRASPASAMOS SALDOS Y AGREGAMOS EVENTO A LA BITACORA
'NO DEBE ENTRAR SI SE ESTA CANCELANDO UNA FACTURA
If ValorMultiplicador <> -1 AndAlso (DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0 Then
If ValorMultiplicador <> -1 AndAlso ((DtRemisionesRelacionadas IsNot Nothing AndAlso DtRemisionesRelacionadas.Rows.Count > 0) OrElse ObjFactura.RemisionesLista.Count > 0) Then
If Not ObjFactura.TipoDocto.Contiene("Ing", "Ant") Then
ErrorPrepoliza = True
@@ -7501,20 +7503,48 @@ Namespace Modelos
HttpContext.Current.Application("GlobalDTSeccionAlmacen") = value
End Set
End Property
Property GlobalDTAlmacen(CveEmpresa As Integer) As DataTable
Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable
Get
If CveEmpresa <> -1 Then
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable
Dv.Dispose()
Else
GlobalDTAlmacen = DirectCast(HttpContext.Current.Application("GlobalDTAlmacen"), DataTable)
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
'sino existe, recarga los datos
If HttpContext.Current.Application(AppNombre) Is Nothing Then
Dim ObjUsr As New ClsInventarios
If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then HttpContext.Current.Application(AppNombre) = ObjUsr.DtResultados
ObjUsr.Dispose()
End If
Dim Str As New StringBuilder
Str.Append("1=1 AND ")
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
Dim Dv As New DataView(DirectCast(HttpContext.Current.Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTAlmacen = Dv.ToTable
Dv.Dispose()
End Get
Set(value As DataTable)
HttpContext.Current.Application("GlobalDTAlmacen") = value
Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa)
HttpContext.Current.Application(AppNombre) = value
End Set
'Get
' Dim Str As New StringBuilder
' Str.Append("1=1 AND ")
' If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
' If CveTipoAlmacen > 0 Then Str.AppendFormat("AND CveTipoAlmacen = {0}", CveTipoAlmacen)
' If CveEstatus > 0 Then Str.AppendFormat("AND CveEstatus = {0}", CveEstatus)
' If CveAlmacen > 0 Then Str.AppendFormat("AND CveAlmacen = {0}", CveAlmacen)
' Dim Dv As New DataView(DirectCast(Application("GlobalDTAlmacen"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
' GlobalDTAlmacen = Dv.ToTable
' Dv.Dispose()
'End Get
'Set(value As DataTable)
' Application("GlobalDTAlmacen") = value
'End Set
End Property
Property GlobalDTAlmacenUsuarios(CveUsuario As Integer, CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = 1) As DataTable
Get
@@ -9302,6 +9332,7 @@ Namespace Modelos
Public Property ClaveSATMunicipio As String
Public Property ClaveSATColonia As String
Public Property ClaveSATCP As String
Public Property EsDistribuidor As Boolean
End Class

View File

@@ -509,7 +509,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
'End If
'ObjClientes.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NombreComercial like '%{0}%' OR Nombre like '%{0}%' ", Name))
End If
@@ -557,7 +557,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
' DtRetorno = ObjProveedores.DtResultados
'End If
'ObjProveedores.Dispose()
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable).FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
Dim dt As DataTable = DirectCast(context.Application(AppNombre), DataTable) '.FiltraParametros(String.Format("CveEmpresa = {0}", CveEmpresa))
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
DtRetorno = dt.FiltraParametros(String.Format("NombreCortoProveedor like '%{0}%'", Name))
End If
@@ -661,6 +661,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153) Then
UsaGlobal = False
If CveEmpresa = 140 And Pagina.Contiene("ventas/ventas") Then
AplicaParaVenta = 1
End If
Dim objInv As New ClsInventarios
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa) Then

View File

@@ -373,6 +373,11 @@ Partial Class Bancos_ProductosFinancieros
Next
If Not ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
ErrorTransaccion = True
End If
'Por el momento no hay movimiento para estas plantillas y no debe entrar aqui
If UsuarioActual.Empresa.Funcionalidad(200).ToEntero > 0 And Not ErrorTransaccion Then
If idCuentaContabilizacion > 0 Then
@@ -386,9 +391,6 @@ Partial Class Bancos_ProductosFinancieros
End If
End If
If Not ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
ErrorTransaccion = True
End If
End If

View File

@@ -11,6 +11,7 @@ Imports System.IO
Imports ADServerControl
Imports System.Threading.Tasks
Imports System.Diagnostics
Imports System.Text.RegularExpressions
Partial Class Compras_Compras
Inherits ClsPaginas
@@ -5384,6 +5385,7 @@ Partial Class Compras_Compras
'P R E P O L I Z A S
Dim CveConceptoAfectacion As Integer = 5 'Proveedores
Dim CveConceptoOriginal As Integer
If CveTipoConcepto = 2 Then CveConceptoAfectacion = 305 'cuando es acreedor
If CveMoneda <> 1 Then
Select Case CveConceptoAfectacion
@@ -5781,7 +5783,7 @@ Partial Class Compras_Compras
Dim CveSubProyectoInsertar As Integer = -1
Dim ConceptoContable = Row("CveConcepto").ToString.ToEntero
Dim ConceptoContable As Integer = Row("CveConcepto").ToString.ToEntero
Dim TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
Dim importeMovimiento As Decimal = 0
Dim IdCtaContable As Integer = 0
@@ -5791,7 +5793,7 @@ Partial Class Compras_Compras
Dim Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1)
Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation
Dim PorcentajeImpuesto As Decimal = 0
CveConceptoOriginal = ConceptoContable
Select Case ConceptoContable
@@ -7185,7 +7187,7 @@ Partial Class Compras_Compras
importeMovimiento = importeMovimiento.Abs.RoundSQL()
importeMN = importeMovimiento
If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveIE:=CveIE, ImporteMX:=importeMN, CvePrePolizaOriginal:=CvePrePoliza, ImporteME:=0, CveCuenta:=CveCuenta, Contabilizable:=SeContabiliza, CveSubProyecto:=CveSubProyecto) Then
ErrorPrepoliza = True
Exit For
End If
@@ -7631,8 +7633,8 @@ Partial Class Compras_Compras
If ErrorPrepoliza Then
Exit For
End If
', 305, 306, 311
If importeMovimiento <> 0 Or (ConceptoContable.Contiene(5) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac", "Ant")) Or (ConceptoContable.Contiene(18) AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not GuardoConcepto18) Then
'5, 305, 306, 311
If importeMovimiento <> 0 Or (CveConceptoOriginal = 5 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Fac", "Ant")) Or (ConceptoContable.Contiene(18) AndAlso DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") AndAlso Not GuardoConcepto18) Then
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
@@ -9340,9 +9342,13 @@ Partial Class Compras_Compras
ErrorMovtosCxP = 1
Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError)
End If
If ObjConta.SeUnifico Then
CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva
End If
End If
'Simplificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePolizaNueva, UsuarioActual.CveEmpresa) Then
@@ -15489,11 +15495,11 @@ Partial Class Compras_Compras
'If DdlOCVinculaInv.SelectedValue.ToEntero = 237 And Not CveFlete > 0 Then Alert("Necesita vincular un flete si selecciona Factura de Flete", TipoMensaje.MsgAdvertencia) : Exit Sub
'If DdlOCVinculaInv.SelectedValue.ToEntero = 240 And Not CveImportacion > 0 Then Alert("Necesita vincular una Importación si selecciona Factura de Importación", TipoMensaje.MsgAdvertencia) : Exit Sub
If UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then
If Not VerificarProductosCompraConOC() Then
Exit Sub
End If
End If
'If UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then
' If Not VerificarProductosCompraConOC() Then
' Exit Sub
' End If
'End If
Dim SubTotalGV = 0.0D
Dim Amortizacion As Decimal = TmpDT.SUMD("Total")
@@ -20312,7 +20318,6 @@ Partial Class Compras_Compras
Private Function VerificarProductosCompraConOC() As Boolean
Dim ProductosNoValidados As New StringBuilder()
Dim DtCompras As New DataTable()
@@ -20338,7 +20343,12 @@ Partial Class Compras_Compras
Dim TipoPS As String = GvOCRow.DataKey("CveTipoPS")
If TipoPS = "2" Then
Dim ProductoAisloadoString As String = GvOCRow.DataKey("PS").Split("-"c)(1).Trim()
Dim ProductoAisloadoString As String = ""
If CveFactura > 0 Then
ProductoAisloadoString = Regex.Replace(GvOCRow.DataKey("PS"), "^\d*\s-\s", "")
Else
ProductoAisloadoString = GvOCRow.DataKey("PS")
End If
Dim PSOC As String = ProductoAisloadoString
Dim CantidadOC As String = GvOCRow.DataKey("CantidadF")
Dim PrecioUnitarioOC As String = GvOCRow.DataKey("Importe")

View File

@@ -1281,10 +1281,10 @@ Partial Class PopUpVerFactura
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero()
If CveConcepto.Contiene(3, 26) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
If CveConcepto.Contiene(2, 3, 26, 27) AndAlso ObjInventarios.DtResultados.FiltroPrimeroValor("CveMovimientoVirtual").ToEntero() > 0 Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
CveConceptoMovtoRelacionado = 37
ElseIf CveConcepto = 37 Then
ElseIf CveConcepto.Contiene(36, 37) Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
CveConceptoMovtoRelacionado = 3
End If
@@ -1413,7 +1413,7 @@ Partial Class PopUpVerFactura
ImprimirPDF("Empresas/Grales/Formatos/Inicial.rdlc", DtMovimientos, params, String.Format("Inventario Inicial - {0}", Folio), RDSName:="DsInventarios")
End If
Case 2, 32, 33 ' E N T R A D A S
Case 2, 32, 33, 36 ' E N T R A D A S
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -1501,7 +1501,39 @@ Partial Class PopUpVerFactura
End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Entradas.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio), RDSName:="DsInventarios")
ElseIf UsuarioActual.CveEmpresa = 140 Then
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
If Imagen.Exists Then
params.Add(New ReportParameter("LogoPath", logouri))
Else
params.Add(New ReportParameter("LogoPath", ""))
End If
Dim concepto As String = ""
If CveConcepto.Contiene(2, 32, 33) Then
concepto = "ENTRADA DE ALMACÉN"
ElseIf CveConcepto.Contiene(36) Then
concepto = "ENTRADA VIRTUAL"
End If
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Concepto", concepto))
params.Add(New ReportParameter("Almacen", Almacen))
params.Add(New ReportParameter("Fecha", Fecha))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("Folio", Folio))
params.Add(New ReportParameter("FacturadoA", NombreCliente))
params.Add(New ReportParameter("FacturaProveedor", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("SerieFolio").ToString, "")))
params.Add(New ReportParameter("Descuentos", If(CveCompra > 0 AndAlso dr IsNot Nothing, (dr("Descuentos").ToString.ToDouble).FormatoNumero(2), "")))
params.Add(New ReportParameter("IVA", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("IVA").ToString.FormatoNumero(2), "")))
params.Add(New ReportParameter("Total", If(CveCompra > 0 AndAlso dr IsNot Nothing, dr("Total").ToString.FormatoNumero(2), "")))
'params.Add(New ReportParameter("NombreEntrego", String.Format("ENTREGÓ{0}{1}", vbCrLf, Capturo)))
params.Add(New ReportParameter("NombreRecibio", String.Format("RECIBIÓ{0}{1}", vbCrLf, Recibio)))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
ImprimirPDF(String.Format("{0}Formatos/Entradas.rdlc", UsuarioActual.Empresa.Ruta), DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio.ToString), RDSName:="DsInventarios")
Else
params.Add(New ReportParameter("TipoDocumento", String.Format("Compras {0}", Almacen)))
params.Add(New ReportParameter("Fecha", If(CveCompra > 0, dr("Fecha").ToString.ToDate.ToShortDateString, "")))
params.Add(New ReportParameter("Folio", Folio.ToString))
@@ -2256,6 +2288,8 @@ Partial Class PopUpVerFactura
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
End If

View File

@@ -2653,6 +2653,8 @@ Partial Class Compras_eFacturas
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
Dim CveFacturaComplemento As Integer = gvRow.DataKey("CveFactura").ToString.ToEntero
Dim CveComplementoPagoCompra As Integer = gvRow.DataKey("CveComplementoPagoCompra").ToString.ToEntero
If CveComplementoPagoCompra > 0 Then
@@ -2773,7 +2775,7 @@ Partial Class Compras_eFacturas
Dim ObjCompraFolios As New ClsCompras
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=2) Then
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
'
'.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
If ObjCompraFolios.DtResultados.Rows.Count > 0 Then

2679
Contratos/ContratoObra.aspx Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -434,6 +434,9 @@
</TablixMember>
<TablixMember>
<Group Name="Details" />
<TablixMembers>
<TablixMember />
</TablixMembers>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
@@ -465,8 +468,8 @@
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Top>1.39318cm</Top>
<Left>0.25984cm</Left>
<Top>1.99643cm</Top>
<Left>0.22809cm</Left>
<Height>0.6cm</Height>
<Width>11.36782cm</Width>
<ZIndex>1</ZIndex>
@@ -480,8 +483,40 @@
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
<Textbox Name="Textbox28">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>= "Total: " &amp; FormatNumber(Sum(Fields!Cantidad.Value, "DsInventarios"),0)</Value>
<Style>
<FontWeight>Bold</FontWeight>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox28</rd:DefaultName>
<Top>1.33674cm</Top>
<Left>0.22985cm</Left>
<Height>0.6cm</Height>
<Width>2.5cm</Width>
<ZIndex>2</ZIndex>
<Style>
<Border>
<Style>None</Style>
</Border>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</ReportItems>
<Height>0.82291in</Height>
<Height>1.05208in</Height>
<Style />
</Body>
<Width>8.1198in</Width>

View File

@@ -217,7 +217,7 @@ Partial Class Inventarios_CatAlmacenes
GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjAlmacen As New ClsInventarios
'If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then
' GlobalDTAlmacen(-1) = ObjAlmacen.DtResultados
' Application("GlobalDTAlmacen") = ObjAlmacen.DtResultados
'End If
'ObjAlmacen.Dispose()
End Sub

View File

@@ -1519,7 +1519,7 @@ Partial Class Inventarios_EntradasSalidas
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inv/ES", 53, 0, 0, 1, TxtFecha.Text.ToDate, obs, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=3)
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, DdlConcepto.SelectedValue.ToEntero, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor)
CveMovimiento = ObjInventario.AddMovimiento(CveAlmacen, DdlConcepto.SelectedValue.ToEntero, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, SubProyecto, ActivoFijo, Guia:=TxtGuia.Text, Observaciones:=TxtObservaciones.Text, CvePersonal:=DdlPersonal.SelectedValue.ToEntero, Recibio:=TxtResponsable.Text.Trim, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, DepartamentoEntrega:=TxtDepartamentoEntrega.Text, PedidoContrato:=TxtPedidoContrato.Text, CveProveedor:=tCveProveedor, Modulo:="ES/1")
If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
@@ -1961,7 +1961,7 @@ Partial Class Inventarios_EntradasSalidas
Dim ObjInv As New ClsInventarios
If CveMovimiento <= 0 Then
CveMovimiento = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, 1, TxtFecha.Text.ToDate, TxtFolio.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1)
CveMovimiento = ObjInv.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, DdlConcepto.SelectedValue.ToEntero, 1, TxtFecha.Text.ToDate, TxtFolio.Text.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Modulo:="ES/CS1")
End If
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote)
@@ -3837,7 +3837,7 @@ Partial Class Inventarios_EntradasSalidas
'MOVIMIENTO DE ENTRADA
If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then
Dim FolioEntrada As Integer = ObjInventario.GetFolioSiguiente(32, UsuarioActual.CveEmpresa)
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 32, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtIFDescripcion.Text.Trim)
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 32, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtIFDescripcion.Text.Trim, Modulo:="ES/AJ1")
Else
CveMovimientoEntrada = -1
End If
@@ -3845,7 +3845,7 @@ Partial Class Inventarios_EntradasSalidas
'MOVIMIENTO DE SALIDA
If DtMovimientosSalidaInvFisico.Rows.Count > 0 Then
Dim FolioSalida As Integer = ObjInventario.GetFolioSiguiente(34, UsuarioActual.CveEmpresa)
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 34, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoEntrada, Observaciones:=TxtIFDescripcion.Text.Trim)
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 34, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimientoEntrada, Observaciones:=TxtIFDescripcion.Text.Trim, Modulo:="ES/AJ2")
End If
@@ -4132,19 +4132,21 @@ Partial Class Inventarios_EntradasSalidas
End Sub
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable
Dim Conexion As Odbc.OdbcConnection = Nothing
'Dim Conexion As Odbc.OdbcConnection = Nothing
Dim ErrorArchivo = False
Dim n As Integer = 0
Try
Select Case Tipo
Case "EXCEL"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
Conexion.Open()
Dim cmd = Conexion.CreateCommand()
cmd.CommandType = CommandType.Text
cmd.CommandText = "Select * FROM [Hoja1$]"
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
DataAdapter.Fill(dt)
dt = ReadExcelFile(Ruta + FileName, True)
dt = dt.FiltraParametros("Cantidad <> '' ")
'Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
'Conexion.Open()
'Dim cmd = Conexion.CreateCommand()
'cmd.CommandType = CommandType.Text
'cmd.CommandText = "Select * FROM [Hoja1$]"
'Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
'DataAdapter.Fill(dt)
Case Else
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
Exit Sub
@@ -4153,7 +4155,7 @@ Partial Class Inventarios_EntradasSalidas
ErrorArchivo = True
OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex)
End Try
Conexion.Close()
' Conexion.Close()
If Not ErrorArchivo Then
If Not dt.Columns(0).ColumnName = "Cantidad" Then
Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError)
@@ -4299,7 +4301,12 @@ Partial Class Inventarios_EntradasSalidas
Dim StrReturn As String = String.Empty
Dim CvePS As Integer = 0
Dim Condicion As String = String.Format("{0} = '{1}'", Opt, Valor)
If Opt = "Codigo" Then
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=Valor).FiltroPrimeroValor("CvePS", "").ToString.ToEntero
Else
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Condicion).ToString.ToEntero
End If
If CvePS > 0 Then
StrReturn = "True|" & CvePS.ToString
Else

View File

@@ -41,12 +41,13 @@ Partial Class Inventarios_Kardex
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
'If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
'ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
CargaDatos()
End If
CargaPermisos()
@@ -257,7 +258,14 @@ Partial Class Inventarios_Kardex
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
Dim CveAlmacen As Integer = -1
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
If CvePS > 0 Then ddlProducto2.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "")
If CvePS > 0 Then
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If dr IsNot Nothing Then
ddlProducto2.SelectedText = dr("PSCodigo").ToString
ddlProducto2.SelectedValue = CvePS.ToString
End If
End If
Dim CveTiposAlmacen = ""
For Each item As ListItem In CBLTiposAlmacen.Items

View File

@@ -92,6 +92,9 @@
<li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li>
<li>
<asp:LinkButton runat="server" ID="LnkProyectos" OnClick="LnkProyectos_Click" Text="Proyectos" />
</li>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
@@ -175,7 +178,7 @@
</div>
</div>
<asp:Panel ID="pnlOrden" runat="server" CssClass="row">
<label class="col-md-1 truncate">Orden:</label>
<asp:Label runat="server" ID="LblOrden" class="col-md-1 truncate">Orden:</asp:Label>
<div class="col-md-2">
<asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
@@ -186,14 +189,21 @@
</div>
<div class="col-md-3">
<div class="row">
<label class="col-md-3 truncate">Marca:</label>
<asp:Label runat="server" ID="LblMarca" class="col-md-3 truncate">Marca:</asp:Label>
<div class="col-md-9">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height:50px !important;">
<asp:ListBox ID="DdlMarca" runat="server" DataTextField="Marca" DataValueField="CveMarca" data-text="Todos" SelectionMode="Multiple" CssClass="form-control ddlFiltros input-sm select2me Widthall" Style="width: 100%; height: 50px !important;">
<asp:ListItem Text="Todas" Value="-1"></asp:ListItem>
</asp:ListBox>
</div>
</div>
</div>
<asp:Label runat="server" ID="LblProyectado" Text="Incluir Proyectados" class="col-md-1 truncate" />
<div class="col-md-2">
<asp:DropDownList ID="DdlProyeccionFiltro" runat="server" CssClass="select2me" Width="100%" >
<asp:ListItem Text="Si" Value="1" Selected="True" />
<asp:ListItem Text="No" Value="2" />
</asp:DropDownList>
</div>
</asp:Panel>
</div>
</div>
@@ -250,6 +260,40 @@
</td>
</tr>
</table>
<div id="DivProyeccion" 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">Proyección:</asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row" style="width: 100%; text-align: center">
<asp:Label runat="server" ID="LblProyeccionOpcion" />
<asp:RadioButtonList ID="RblProyeccionOpcion" runat="server" RepeatDirection="Horizontal" Width="50%" Style="margin: 0 25% 0 25%">
<asp:ListItem Text="Entrada" Value="1" Selected="True" />
<asp:ListItem Text="Salida" Value="2" />
</asp:RadioButtonList>
<asp:Button runat="server" ID="BtnDescargarFormato" OnClick="BtnDescargarFormato_Click" Text="Descargar formato" CssClass="btn btn-warning" />
</div>
<asp:Label runat="server" ID="Label1" Text="Subir Proyección:" Style="font-size: 15px" />
<br />
<asp:TextBox ID="TxtProyeccionExcel" CssClass="ADSdropzone hidden" runat="server" Style="height: 100px"></asp:TextBox>
<br />
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarProyeccion" OnClick="BtnAgregarProyeccion_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>
<Triggers>
<asp:PostBackTrigger ControlID="BtnDescargarFormato" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -13,9 +13,15 @@ Partial Class Inventarios_KardexAlmacen
TxtFechaF.Text = Now.ToShortDateString
CargaCombos()
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
pnlOrden.Visible = False
LblOrden.Visible = False
DdlOrden.Visible = False
LblMarca.Visible = False
DdlMarca.Visible = False
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
pnlOrden.Visible = True
LblOrden.Visible = True
DdlOrden.Visible = True
LblMarca.Visible = True
DdlMarca.Visible = True
DdlOrden.SelectedValue = 2
End If
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
@@ -134,7 +140,7 @@ Partial Class Inventarios_KardexAlmacen
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas) Then
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, CveAlmacen, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), DdlIncluyeTransitorios.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue, Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero) Then
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn)
@@ -337,6 +343,137 @@ Partial Class Inventarios_KardexAlmacen
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
End Sub
Protected Sub LnkProyectos_Click(sender As Object, e As EventArgs)
RegistraScript(String.Format("$('#{0}').modal();", "DivProyeccion"))
End Sub
Protected Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs)
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\KardexProyeccion.xlsx"
Dim Archivo As New IO.FileInfo(Directorio)
If Archivo.Exists Then
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.AddHeader("Content-Disposition", "attachment; filename=" + Archivo.Name)
Response.AddHeader("Content-Length", Archivo.Length.ToString())
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Response.Flush()
Response.TransmitFile(Archivo.FullName)
Response.End()
End If
End Sub
Protected Sub BtnAgregarProyeccion_Click(sender As Object, e As EventArgs)
If TxtProyeccionExcel.getfiles().Archivos.Count > 0 Then
Dim file As Archivo = TxtProyeccionExcel.getfiles().Archivos(0)
Dim Directorio As String = Server.MapPath("~") & file.patch
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
CargarArchivo(Directorio, file.filename, Tipo)
Else
Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError)
End If
End Sub
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable
dt = ReadExcelFile(Ruta + FileName, True)
If Not dt.Columns(0).ColumnName = "Código" Then
Alert("La primera columna del archivo debe ser 'Código'", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
If Not dt.Columns(1).ColumnName = "Cantidad" Then
Alert("La primera columna del archivo debe ser 'Cantidad'", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
AgregarProyeccion(dt)
End Sub
Private Sub AgregarProyeccion(dt As DataTable)
Dim TieneError As Boolean = False
Dim ObjInventarios As New ClsInventarios
ObjInventarios.IniciaTransacSQL()
Dim TipoMovot As Integer = If(RblProyeccionOpcion.SelectedValue = "1", 0, 1)
If ObjInventarios.DeleteMovimientosProyectados(TipoMovot) Then
Dim DtProductosEmpresas As DataTable = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
For Each dtRow As DataRow In dt.Rows
Dim Codigo As String = dtRow("Código").ToString
Dim CvePS As Integer = DtProductosEmpresas.FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", Codigo))
Dim Cantidad As Decimal = dtRow("Cantidad").ToString.ToDecimal
If Not ObjInventarios.AddMovimientosProyectados(CvePS, Cantidad, RblProyeccionOpcion.SelectedValue.ToEntero()) Then
TieneError = True
Exit For
End If
Next
Else
TieneError = True
End If
If TieneError Then
ObjInventarios.RollBack()
Else
ObjInventarios.Commit()
End If
ObjInventarios.Dispose()
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion"))
Alert("Se ha agregado la proyección de productos correctamente")
End Sub
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
Dim unnamed As Integer = 0
Dim cols As Integer
Dim columns As String()
Dim curRow As Integer = 0
Dim curCol As Integer = 0
Dim dataTable As DataTable = New DataTable()
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
If firstRowHasHeaders Then
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim)
Else
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
End If
curRow = 1
Else
dataTable.Columns.Add("Column " & (cols + 1))
End If
Next
While curRow < worksheet.Rows.Count
columns = New String(cols - 1) {}
For curCol = 0 To cols - 1
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
columns(curCol) = ""
Else
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
End If
Next
dataTable.Rows.Add(columns)
curRow += 1
End While
Return dataTable
End Function
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub
End Class

View File

@@ -935,7 +935,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If
If CveTipoCompra = 9 Then
CargaAlmacenes(-1, "21", CveTipoCompra)
CargaAlmacenes(-1, "27", CveTipoCompra)
End If
If CveTipoCompra = 10 Then
@@ -972,9 +972,12 @@ Partial Class Inventarios_RecepcionAlmacen
CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero
'SI ES MOTOBATERIA NO GENERA MOVIMIENTO VIRTUAL
If UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso (DtRecepcion.COUNT("CveTamaño", "CveTamaño > 0 AND CveTamaño <> 16") > 0 OrElse CargaSoloUsados) Then
If UsuarioActual.Empresa.Funcionalidad(573) = "1" AndAlso (DtRecepcion.COUNT("CveTamaño", "CveTamaño > 0 AND CveTamaño <> 16") > 0) Then
RealizarMovimientoVirtual = True
DivVirtualAdvertencia.Visible = True
Else
RealizarMovimientoVirtual = False
DivVirtualAdvertencia.Visible = False
End If
If TipoMovimiento = 2 AndAlso CveAlmacenDevolucionProveedor > 0 Then
@@ -2879,6 +2882,12 @@ Partial Class Inventarios_RecepcionAlmacen
End If
End If
If UsuarioActual.CveEmpresa = 140 AndAlso TipoMovimiento = 3 Then
If Not ObjCompras.UpdateEstatusAlmacen(CveCompraSurtir, 2, UsuarioActual.CveUsuario) Then
ErrorMovInv = True
End If
End If
'AGREGA BITACORA TEMPORAL
If DtBitacora IsNot Nothing AndAlso DtBitacora.Rows.Count > 0 Then
ErrorMovInv = GuardaBitacoraTemporal(ObjBitacora, CveMovimiento)

View File

@@ -2077,6 +2077,8 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.TipoDocumento = "Remisión"
'NUM 1- CARGO 2- BONIFICACION
Me.ObjRemisionNC.Num1 = 1
'NUM 0- USADO 1- AJUSTE/GARANTIA
Me.ObjRemisionNC.Num2 = RblUsadosAjuste.SelectedValue.ToEntero()
Me.ObjRemisionNC.Alfa1 = ""
Me.ObjRemisionNC.Alfa2 = ""
Me.ObjRemisionNC.Alfa3 = ""
@@ -2093,8 +2095,6 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.SetCliente()
Me.ObjRemisionNC.CveAlmacen = -1
Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then
@@ -2133,6 +2133,9 @@ Partial Class Inventarios_RecepcionUsados
'DETALLES
Me.ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
'GUARDAR AJUSTES
Me.ObjRemisionNC.DtAjustes = TmpDTAjustes
'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
@@ -2517,37 +2520,6 @@ Partial Class Inventarios_RecepcionUsados
TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer))
TmpDTAjustes.Columns.Add("PUFactura", GetType(Double))
End Sub
Private Sub CargaAjusteDetalle()
Dim Dr As DataRow = Nothing
IndexAjuste = 0
For Each Dr2 As DataRow In TmpDTAjustes.Rows
If Dr2("ConsecutivoVenta").ToString.ToEntero = ConsecutivoVenta Then
Dr = Dr2
Exit For
End If
IndexAjuste += 1
Next
If Dr IsNot Nothing Then
IndexAjuste = TmpDTAjustes.Rows.IndexOf(Dr)
DdlFolioGarantia.SelectedValueExist(Dr("CveFolioGarantia").ToString)
TxtConsecutivoAjuste.Text = Dr("Consecutivo").ToString
TxtCodEnsamble.Text = Dr("CodigoEnsamble").ToString
DdlTipoUso.SelectedValueExist(Dr("CveTipoUso").ToString)
TxtCodLinea.Text = Dr("CodigoLinea").ToString
TxtCodInspeccion.Text = Dr("CodigoInspeccion").ToString
TxtMesesUso.Text = Dr("Meses").ToString
DdlTipoDefecto.SelectedValueExist(Dr("CveTipoDefecto").ToString)
TxtPorcentajeAjuste.Text = Dr("PorcentajeAjuste").ToString
TxtPoliza.Text = Dr("NumPoliza").ToString
TxtImporteAjuste.Text = Dr("Importe").ToString
'DdlFacturas.SelectedValueExist(Dr("CveVenta").ToString)
CargaPSAjuste()
DdlPSAjuste.SelectedValue = (Dr("CvePS").ToString)
TxtFechaAjuste.Text = Dr("FechaAjuste").ToString.ToDate.ToShortDateString
txtPrecio.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(2)
txtPrecio.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
End If
End Sub
Private Sub CargaPSAjuste()
DdlPSAjuste.setEsWebService(True)
End Sub
@@ -2561,7 +2533,14 @@ Partial Class Inventarios_RecepcionUsados
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
If drPS IsNot Nothing Then
PrecioSugerido = drPS("Precio").ToString.ToDecimal
Dim CvePrecioListaPS As Integer = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=DdlClientes.SelectedValue.ToEntero).FiltroPrimeroValor("CvePrecioLista").ToEntero()
If CvePrecioListaPS > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
End If
ObjPS.Dispose()
End If
Dim PS As String = drPS("PS").ToString
CveMarca = drPS("CveMarca").ToString.ToEntero
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
@@ -2637,11 +2616,71 @@ Partial Class Inventarios_RecepcionUsados
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo")
TxtConsecutivoAjuste.Text = (resultado.ToEntero + 1).ToString
UpAjuste.Update()
End If
ObjAcumuladores.Dispose()
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
End If
End Sub
Private Function ValidaFolioGarantia(CvePS As Integer, CveFolioGarantia As Integer) As MFolioGarantiaMensaje
Dim Retorno As New MFolioGarantiaMensaje
Dim Valido As Boolean = False
Dim TipoFolio As String = ""
Dim ListaClasificacionesPermitidas As New List(Of Integer)
Dim ObjAcumuladores As New ClsAcumuladores
If ObjAcumuladores.FoliosGarantiaGet(CveFolioGarantia, UsuarioActual.CveEmpresa, Area:=-1) AndAlso ObjAcumuladores.DtResultados.Rows.Count > 0 Then
Dim Row As DataRow = ObjAcumuladores.DtResultados.Rows(0)
TipoFolio = Row("tipoFolio").ToString().ToUpper()
End If
ObjAcumuladores.Dispose()
Dim CveClasificacionPS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion").ToEntero()
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
Select Case TipoFolio
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(20522) 'ACUM. ESPECIALES
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR
ListaClasificacionesPermitidas.Add(20521) 'ACUM. PESADO
ListaClasificacionesPermitidas.Add(20512) 'ACUM. PREMIUM
ListaClasificacionesPermitidas.Add(20514) 'ACUM. VALUE
ListaClasificacionesPermitidas.Add(20229) 'Acumulador
Case "OPTIMA"
'20511 ACUM. OPTIMA
ListaClasificacionesPermitidas.Add(20511) 'ACUM. OPTIMA
Case "MOTOBATERIA"
'20517 MOTOBATERIAS
ListaClasificacionesPermitidas.Add(20517) 'MOTOBATERIAS
End Select
If ListaClasificacionesPermitidas.Contains(CveClasificacionPS) Then
Valido = True
End If
Retorno.CvePS = CvePS
Retorno.CveFolioGarantia = CveFolioGarantia
Retorno.CveClasificacionPS = CveClasificacionPS
Retorno.ClasificacionPS = ClasificacionPS
Retorno.TipoFolio = TipoFolio
Retorno.Valido = Valido
Return Retorno
End Function
Protected Sub CargaTipoDeUso()
DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
@@ -2720,7 +2759,45 @@ Partial Class Inventarios_RecepcionUsados
UpAjuste.Update()
End Sub
Private Sub GuardaAjuste()
Dim CargoAnterior As Double = 0
Dim CargoActual As Double = 0
Dim Row As DataRow = Nothing
Row = TmpDTAjustes.NewRow
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
Row("CveTipoDefecto") = DdlTipoDefecto.SelectedValue.ToEntero
Row("CodigoEnsamble") = TxtCodEnsamble.Text
Row("CodigoLinea") = TxtCodLinea.Text
Row("CodigoInspeccion") = TxtCodInspeccion.Text
Row("Consecutivo") = TxtConsecutivoAjuste.Text
Row("FechaAjuste") = TxtFechaAjuste.Text.ToDate
Row("Meses") = TxtMesesUso.Text.ToEntero
Row("PorcentajeAjuste") = TxtPorcentajeAjuste.Text.ToDouble
Row("NumPoliza") = TxtPoliza.Text
Row("Importe") = TxtImporteAjuste.Text.ToDouble
Row("ConsecutivoVenta") = TxtConsecutivoAjuste.Text.ToEntero()
Row("CvePS") = DdlPSAjuste.SelectedValue
Row("PS") = DdlPSAjuste.SelectedText
Row("CveVenta") = -1
Row("PUFactura") = TxtPUFactura.Text.ToDouble
Row("Cantidad") = 1
Dim CveUM As Integer = -1
If DdlPSAjuste.SelectedValue.ToEntero > 0 Then
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).Rows(0)
If Dr IsNot Nothing Then
CveUM = Dr("CveUnidadMedida").ToString.ToEntero
CargoAnterior = Dr("Cargo").ToString.ToDouble
End If
End If
Row("CveUM") = CveUM
Row("CveVentaDetalle") = -1
TmpDTAjustes.Rows.Add(Row)
End Sub
Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
CalculaMesesUso()
End Sub
@@ -2750,6 +2827,14 @@ Partial Class Inventarios_RecepcionUsados
Protected Sub BtnAgregarProductoAjuste_Click(sender As Object, e As EventArgs)
Dim CvePS As Integer = DdlPSAjuste.SelectedValue.ToEntero
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(CvePS, DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjPS As New ClsProductosServicios
Dim CveTamaño As Integer = -1
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then
@@ -2774,6 +2859,8 @@ Partial Class Inventarios_RecepcionUsados
Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If
ObjPS.Dispose()
GuardaAjuste()
End Sub
Protected Sub CargarDescuento()
@@ -2790,4 +2877,14 @@ Partial Class Inventarios_RecepcionUsados
InicializaClientes(ChkClientesTodos.Checked)
End Sub
Partial Class MFolioGarantiaMensaje
Public Property CvePS As Integer
Public Property CveClasificacionPS As Integer
Public Property ClasificacionPS As String
Public Property CveFolioGarantia As Integer
Public Property TipoFolio As String
Public Property Valido As Boolean
End Class
End Class

View File

@@ -171,16 +171,8 @@
<asp:Label ID="LtlAlmacen" runat="server" Text='<%# Eval("TipoAlmacen")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Existencia" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LtlExist" runat="server" Text='<%# Eval("Existencia", "{0:#,###.##}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:Label ID="LtlTotal" runat="server" Text='<%# Eval("Total", "{0:#,##0.00}")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="Existencia" DataField="Existencia" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
<asp:BoundField HeaderText="Total" DataField="Total" DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right" />
</Columns>
</asp:GridView>
</ContentTemplate>

View File

@@ -4,6 +4,8 @@ Option Explicit On
Imports Extensiones
Imports System.Data
Imports Microsoft.Reporting.WebForms
Imports GemBox.Spreadsheet
Imports System.IO
Partial Class Inventarios_RepAlmacen
Inherits ClsPaginas
@@ -77,7 +79,7 @@ Partial Class Inventarios_RepAlmacen
#Region "I M P R I M I R <i class='fa fa-print'></i>"
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
'GVAlmacen.ExportToExcel("RepFacturas_" & Now.ToShortDateString())
GenerarPDF("EXCEL")
End Sub

View File

@@ -157,7 +157,7 @@
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
</div>
<asp:Label AssociatedControlID="ChkEmitirTimbrado" runat="server" Text="Emitir Timbrado:" ID="LblEmitirTimbrado" CssClass="col-md-2 " Visible="false"></asp:Label>
<asp:Panel id="DivEmitirTimbrado" runat="server" Visible="false" class="col-md-2">
<asp:Panel ID="DivEmitirTimbrado" runat="server" Visible="false" class="col-md-2">
<asp:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " />
</asp:Panel>
@@ -167,8 +167,8 @@
<div id="DivTransitorio2" class="rowpadding" runat="server" visible="false">
<div class="row">
<asp:Label AssociatedControlID="TxtGastoIndirecto" Visible="false" id="LblGastoIndirecto" runat="server" Text="Gasto Indirecto:" CssClass="col-md-2"></asp:Label>
<div class="col-md-2" id="divGastoIndirecto" Visible="false" runat="server">
<asp:Label AssociatedControlID="TxtGastoIndirecto" Visible="false" ID="LblGastoIndirecto" runat="server" Text="Gasto Indirecto:" CssClass="col-md-2"></asp:Label>
<div class="col-md-2" id="divGastoIndirecto" visible="false" runat="server">
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtGastoIndirecto" />
</div>
<label class="col-md-2">Chofer:</label>
@@ -194,7 +194,7 @@
<div class="row">
<label class="col-md-1">Unidad:</label>
<div class="col-md-1 ">
<asp:HyperLink runat="server" ID="HplNuevaUnidad" CssClass ="btn btn-sm btn-primary" NavigateUrl="#" data-toggle="modal" data-target="#DivAgregarNuevoCamion"><i class='fa fa-plus'></i></asp:HyperLink>
<asp:HyperLink runat="server" ID="HplNuevaUnidad" CssClass="btn btn-sm btn-primary" NavigateUrl="#" data-toggle="modal" data-target="#DivAgregarNuevoCamion"><i class='fa fa-plus'></i></asp:HyperLink>
</div>
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="Placa"></asp:DropDownList>
@@ -621,7 +621,6 @@
</div>
<br />
<asp:UpdatePanel ID="UPDivCodigoSeriePSRecepcion" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="row" runat="server" id="DivCodigoSeriePSRecepcion" visible="false">
@@ -647,7 +646,8 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="row">
<div class="col-md-12">
<asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatosRecepcion" DataKeyNames="CveMovimiento,CveUM,CvePS,PS,CveAF,CodigoBarras,CveAlmacen,CveAlmacenDestino,AplicaSerie,CveMovimientoDetalle,PU,CveAlmacenSalida,CveMovimientoSalida,Serie,Lote,FechaCaducidad,Cantidad, GastoIndirectoSalida, Importe,Codigo" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" ToolTip="Listado de Movimientos" CssClass="table table-hover Widthall" GridLines="None">
@@ -685,8 +685,8 @@
<br />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</ContentTemplate>
</ajax:TabPanel>

View File

@@ -859,7 +859,13 @@ Partial Class Inventarios_TraspasoAlmacen
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenOrigen.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
Dim CveAlmacenVirtual As Integer = -1
If TipoAlmacenOrigen = 27 Then
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 25).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
Else
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyectoOrigen}").ToEntero()
End If
CveMovimientoVirtualSalida = ObjInventario.AddMovimiento(CveAlmacenVirtual, 37, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="TA/V", CveMovimientoRelacionado:=CveMovimientoSalida)
FolioVirtualSalida = ObjInventario.Folio
@@ -883,13 +889,10 @@ Partial Class Inventarios_TraspasoAlmacen
End If
End If
'AGREGAMOS LA ENTRADA
If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO
If Not ErrorMovInv Then
Dim TipoMovimientoEntrada = 27
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
'Dim TipoAlmacenEntrada As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {AlmacenEntrada}").ToEntero()
Dim TipoMovimientoEntrada As Integer = 27
If Not ChkTransitorio.Checked Then TipoMovimientoEntrada = 27 Else TipoMovimientoEntrada = 9
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
@@ -912,13 +915,25 @@ Partial Class Inventarios_TraspasoAlmacen
Next
End If
End If
'AGREGAMOS LA ENTRADA
If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO
If Not ErrorMovInv Then
'VIRTUAL ENTRADA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
'SI EL ALMACEN DESTINO ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
Dim CveAlmacenVirtual As Integer = -1
If TipoAlmacenDestino = 27 Then
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
Else
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyectoDestino }").ToEntero()
End If
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/S3")
CveMovimientoVirtualEntrada = ObjInventario.AddMovimiento(CveAlmacenVirtual, 36, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, CveMovimientoRelacionado:=CveMovimientoEntrada, Modulo:="TA/S3")
FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing
@@ -984,7 +999,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Not ErrorMovInv Then
Dim Concepto As String = TxtObservaciones.Text
If Concepto = "" Then Concepto = "Traspaso"
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen2", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
@@ -995,7 +1010,7 @@ Partial Class Inventarios_TraspasoAlmacen
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=importe, Contabilizable:=False) Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 289, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=importe, Contabilizable:=False) Then
ErrorMovInv = True
End If
End If
@@ -1021,12 +1036,12 @@ Partial Class Inventarios_TraspasoAlmacen
MensajeAlert.AppendFormat("<br/> Folio de Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioSalida, CveMovimientoSalida)
MensajeAlert.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida)))
If CveMovimientoVirtualSalida > 0 Then MensajeAlert.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a>&nbsp;<a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Salida Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualSalida)), CveMovimientoVirtualSalida, FolioVirtualSalida)
If CveMovimientoVirtualSalida > 0 Then MensajeAlert.AppendFormat("<br/>Folio Virtual: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a></b>&nbsp;<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Salida Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualSalida)), CveMovimientoVirtualSalida, FolioVirtualSalida)
If Not ChkTransitorio.Checked Then
MensajeAlert.AppendFormat("<br/><br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", FolioEntrada, CveMovimientoEntrada)
MensajeAlert.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
If CveMovimientoVirtualEntrada > 0 Then MensajeAlert.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a>&nbsp;<a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
If CveMovimientoVirtualEntrada > 0 Then MensajeAlert.AppendFormat("<br/>Folio Virtual: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a></b>&nbsp;<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
End If
@@ -1666,7 +1681,15 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
Dim CveTipoAlmacenOrigen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero).FiltroPrimeroValor("CveTipoAlmacen").ToEntero()
'SI EL ALMACEN ORIGEN ES DE APOPYO LOGISTICO EL ALMACEN VIRTUAL DEBE SER DE APOYO LOGISTICO
Dim CveAlmacenVirtual As Integer = -1
If CveTipoAlmacenOrigen = 27 Then
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
Else
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
End If
If CveAlmacenVirtual > 0 Then
@@ -1733,7 +1756,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la cancelación. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoEntrada)
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada))) 'onclick='ImprimirTraslado()'
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/>Folio: <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a>&nbsp;<a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/>Folio Virtual: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a></b>&nbsp;<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Entrada Virtual</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada)
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
@@ -1794,11 +1817,16 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim CveAlmacenEntrada As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero
Dim CveAlmacenSalida As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero
Dim TipoAlmacenDestino As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenEntrada}").ToEntero()
'AGREGAMOS LA SALIDA
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenSalida, 8, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, Modulo:="TA/G11")
'AGREGAMOS LA ENTRADA
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenEntrada, 27, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1,
Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1")
Folio = ObjInventario.Folio
@@ -1831,11 +1859,18 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For
End If
Dim PrecioEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, gvr.DataKey("PU").ToString.ToDecimal)
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
'MOV, Alm, Transito
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For
End If
ElseIf cantidadDisponibleValidacion < 0 Then
TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString)
ErrorMovInv = True
@@ -1846,7 +1881,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Recepción Traspaso"
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TraspasoAlmacen", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
@@ -1870,7 +1905,12 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenRecepcion.SelectedValue}").ToEntero()
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
Dim CveAlmacenVirtual As Integer = -1
If TipoAlmacenDestino = 27 Then
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =25 AND CveSubProyecto={CveSubProyecto}").ToEntero()
Else
CveAlmacenVirtual = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $" CveTipoAlmacen =24 AND CveSubProyecto={CveSubProyecto}").ToEntero()
End If
If CveAlmacenVirtual > 0 Then
@@ -1878,7 +1918,7 @@ Partial Class Inventarios_TraspasoAlmacen
FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
If CveMovimientoVirtualEntrada > 0 AndAlso ObjInventario.GetMovimientosDetalleVirtual(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
dtvirtual = ObjInventario.DtResultados
For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
@@ -1974,7 +2014,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Mensaje As StringBuilder = New StringBuilder
Mensaje.AppendFormat("Se realizo correctamente la recepción. <br/> Folio de Entrada: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{0}</a></b>", Folio, CveMovimientoSalida)
Mensaje.AppendFormat("<br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalida))) 'onclick='ImprimirTraslado()'
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/>Virtual<a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
If CveMovimientoVirtualEntrada > 0 Then Mensaje.AppendFormat("<br/><br/><br/>Folio Virtual <b> <a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={1}"" target=""_blank"">{2}</a> </b> <br/><a target='_blank' href='/Compras/PopUpVerFactura.aspx?P={0}'>Imprimir Reporte</a>", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtualEntrada)), CveMovimientoVirtualEntrada, FolioVirtualEntrada) 'onclick='ImprimirTraslado()'
Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)

View File

@@ -167,10 +167,18 @@
<asp:LinkButton ID="BtnPDFHistorial" OnClick="LbPDFHistorial_Click" runat="server" ToolTip="Imprime PDF del Historial" Style="float: right;"><i class="fa fa-print" style="margin-right: 10px;"></i></asp:LinkButton>
<asp:LinkButton ID="BtnExcelHistorial" OnClick="BtnExcelHistorial_Click" runat="server" ToolTip="Descarga Excel del Historial" Style="float: right;"><i style="margin-right: 10px;" class='fa fa-download'></i></asp:LinkButton>
</legend>
<div class="text-right" style="margin-top: -5px!important">
<div style="width:100%" class="row">
<div class="col-md-1 text-left" style="margin-top: -5px!important;width:50%">
<div class="row" runat="server" id="DivSucursalCxC">
<asp:Label runat="server" ID="lblSucursal" Text="Sucursal:" class="col-sm-1" Style="Width:85px" />
<asp:DropDownList ID="DdlProveedorSucursalCxCSucursal" DataValueField="CveProveedorSucursal" DataTextField="ProveedorSucursal" AutoPostBack="true" runat="server" OnSelectedIndexChanged="DdlProveedorSucursalCxCSucursal_Changed" CssClass="col-md-1 form-control input-sm input-small" />
</div>
</div>
<div class="col-md-1 text-right" style="margin-top: -5px!important;width:50%" runat="server" id="DivSearch">
<input type="text" id="TxtBusqueda1" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda1','{0}')", GvCxP.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="FiltrarTabla('TxtBusqueda1','C_Tab_TabCxP_GvCxPPanelItem')" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UPPCxP" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCxP" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas X Cobrar Pendientes" CssClass="ScrollAD table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
@@ -185,6 +193,7 @@
<asp:BoundField DataField="PorPagado" DataFormatString="{0:N2}%" HeaderText="% Abonado" />
<asp:BoundField DataField="Saldo" DataFormatString="{0:N2}" HeaderText="Saldo" />
<asp:BoundField DataField="PorXPagar" DataFormatString="{0:N2}%" HeaderText="% A Cobrar" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="AplicaNC" HeaderText="Aplica NC" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
@@ -205,10 +214,18 @@
<asp:LinkButton ID="BtnPDFPagadas" OnClick="LbPDFPagadas_Click" runat="server" ToolTip="Imprime PDF del Historial" Style="float: right;"><i class="fa fa-print" style="margin-right: 10px;"></i></asp:LinkButton>
<asp:LinkButton ID="BtnExcelPagadas" OnClick="BtnExcelPagadas_Click" runat="server" ToolTip="Descarga Excel del Historial" Style="float: right;"><i style="margin-right: 10px;" class='fa fa-download'></i></asp:LinkButton>
</legend>
<div class="text-right">
<div style="width:100%" class="row">
<div class="col-md-1 text-left" style="margin-top: -5px!important;width:50%">
<%--<div class="row" runat="server" id="DivProveedorSucursalHistorial">
<asp:Label runat="server" ID="lblProveedorSucursalHistorial" Text="Sucursal: " class="col-md-1" Style="Width:85px" />
<asp:DropDownList ID="DdlProveedorSucursalPHistorial" DataValueField="CveProveedorSucursal" DataTextField="ProveedorSucursal" runat="server" CssClass="col-md-1 form-control input-sm input-small" />
</div>--%>
</div>
<div class="col-md-1 text-right" style="width:100%">
<input type="text" id="TxtBusqueda2" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvCxPHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda2','{0}')", GvCxPHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div>
</div>
<asp:UpdatePanel ID="UPGvCxPHistorial" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvCxPHistorial" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontró Historial de Cuentas X Cobrar" CssClass="ScrollAD table table-striped table-advance table-hover Widthall" Style="text-align: center;" GridLines="None">
@@ -223,6 +240,7 @@
<asp:BoundField DataField="PorPagado" DataFormatString="{0:N2}%" HeaderText="% Abonado" />
<asp:BoundField DataField="FolioPago" DataFormatString="{0:N2}" HeaderText="Cheque" />
<asp:BoundField DataField="PorXPagar" DataFormatString="{0:N2}%" HeaderText="% A Cobrar" />
<asp:BoundField DataField="AplicaNC" HeaderText="Aplica NC" ItemStyle-Width="10%"/>
</Columns>
</asp:GridView>

View File

@@ -250,6 +250,7 @@ Partial Class Portal_PortalProveedor
If Not IsPostBack Then
CveProveedor = UsuarioActual.CveProveedor
CargarSucursalesProveedor()
Session("FileUpload") = ""
ViewState("Orden") = ""
@@ -355,7 +356,7 @@ Partial Class Portal_PortalProveedor
Private Sub CargaCxP()
Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1) Then
If ObjMovtos.GetCxPProveedor(CveProveedor, "-1", "-1", -1, -1, -1, -1, -1, -1, DdlProveedorSucursalCxCSucursal.SelectedValue.ToEntero, -1) Then
GvCxP.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda,OrdenVencimiento, FechaVencimiento")
@@ -1817,5 +1818,30 @@ Partial Class Portal_PortalProveedor
#End Region
#Region "Sucursales del proveedor"
Private Sub CargarSucursalesProveedor()
Dim ObjProveedores As New ClsCompProveedores()
If ObjProveedores.GetSucursales(CveProveedor, UsuarioActual.CveEmpresa) Then
If ObjProveedores.DtResultados.Rows.Count > 0 Then
DdlProveedorSucursalCxCSucursal.DataSource = ObjProveedores.DtResultados
'DdlProveedorSucursalPHistorial.DataSource = ObjProveedores.DtResultados
Else
DivSucursalCxC.Visible = False
DivSearch.Attributes("style") = "width:100%"
'DivProveedorSucursalHistorial.Visible = False
End If
End If
ObjProveedores.Dispose()
DdlProveedorSucursalCxCSucursal.DataBind()
'DdlProveedorSucursalPHistorial.DataBind()
DdlProveedorSucursalCxCSucursal.Items.Insert(0, New ListItem("Todas", "-1"))
'DdlProveedorSucursalPHistorial.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub
Protected Sub DdlProveedorSucursalCxCSucursal_Changed(sender As Object, e As EventArgs)
CargaCxP()
End Sub
#End Region
End Class

View File

@@ -321,7 +321,7 @@ Partial Class Sistemas_PopUpAddUsuario
If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkD").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkD").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked) Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboError = True
Exit For
End If
@@ -329,7 +329,7 @@ Partial Class Sistemas_PopUpAddUsuario
Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkP").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkP").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked) Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboError = True
Exit For
End If
@@ -340,7 +340,7 @@ Partial Class Sistemas_PopUpAddUsuario
If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkDenegar").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkDenegar").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked) Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkDenegar").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboError = True
Exit For
End If
@@ -348,7 +348,7 @@ Partial Class Sistemas_PopUpAddUsuario
Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkPermitir").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkPermitir").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkPermitir").Checked) Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkPermitir").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboError = True
Exit For
End If
@@ -490,7 +490,7 @@ Partial Class Sistemas_PopUpAddUsuario
If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkD").Checked OrElse Row.DataKey("Permitir") = "0" AndAlso Row.FCCheckBox("ChkD").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked) Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Not Row.FCCheckBox("ChkD").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboError = True
Exit For
End If
@@ -498,7 +498,7 @@ Partial Class Sistemas_PopUpAddUsuario
Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario
If Row.DataKey("Permitir") = "" AndAlso Row.FCCheckBox("ChkP").Checked OrElse Row.DataKey("Permitir") = "1" AndAlso Row.FCCheckBox("ChkP").Checked = False Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked) Then
If Not ObjUsuarios.UpdateUsuariosProcesos(CveUsuario, Row.DataKey("CveProceso").ToEntero, Row.FCCheckBox("ChkP").Checked, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
HuboError = True
Exit For
End If

Binary file not shown.

View File

@@ -11,6 +11,7 @@ using GemBox.Spreadsheet;
using System.Data;
using System.Text;
using System.Collections.Generic;
using ClosedXML;
public class TareasJam : IHttpHandler
{
@@ -63,6 +64,13 @@ public class TareasJam : IHttpHandler
string RutaClientes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Clientes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
string RutaAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }Temp\Almacenes{DateTime.Now.ToString("yyyyMMdd")}.xlsx";
string FormatoVentas = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoVentas.xlsx";
string FormatoClientes = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoClientes.xlsx";
string FormatoAlmacenes = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoAlmacenes.xlsx";
string FormatoProductos = $@"{ HttpContext.Current.Server.MapPath("~") }\TareasProgramadas\FormatosThalamus\FormatoProductos.xlsx";
try
{
if (File.Exists(RutaProductos))
@@ -91,14 +99,14 @@ public class TareasJam : IHttpHandler
}
string FTPServer = "ftp://127.0.0.1/";
string TFPUsr = "Toor";
string FTPPass = "agj-3500";
//string FTPServer = "ftp://127.0.0.1/";
//string TFPUsr = "Toor";
//string FTPPass = "agj-3500";
//string FTPServer = "ftp://us2.hostedftp.com";
//string TFPUsr = "agrojam";
//string FTPPass = "A12345678";
string FTPServer = "ftp://us2.hostedftp.com";
string TFPUsr = "agrojam";
string FTPPass = "A12345678";
bool ErrorProceso = false;
@@ -158,7 +166,7 @@ public class TareasJam : IHttpHandler
try
{
DTProductos.Columns[0].ColumnName = "Código Producto Interno ";
DTProductos.Columns[0].ColumnName = "Código Producto Interno";
DTProductos.Columns[1].ColumnName = "Nombre del Producto";
DTProductos.Columns[2].ColumnName = "Presentación";
DTProductos.AcceptChanges();
@@ -196,9 +204,6 @@ public class TareasJam : IHttpHandler
DataTable dtCloned = DTVentas.Clone();
dtCloned.Columns[3].DataType = typeof(string);
@@ -210,7 +215,7 @@ public class TareasJam : IHttpHandler
DTVentas = dtCloned;
foreach (DataRow dRow in DTVentas.Rows)
{
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");//.ToDate().ToString("yyyy/MM/dd").ToDate();
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
dRow[3] = tmpDate;
}
@@ -228,106 +233,98 @@ public class TareasJam : IHttpHandler
DTAlmacenes = dtCloned;
foreach (DataRow dRow in DTAlmacenes.Rows)
{
//DateTime tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd").ToDate();
string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
dRow[3] = tmpDate;
}
DTAlmacenes.AcceptChanges();
}
catch (Exception e)
{
SBLog.AppendLine("<b>Error al renombrar columnas</b>");
}
}
if (!ErrorProceso)
{
int contador = 0;
SpreadsheetInfo.SetLicense(Extensiones.ModExtensiones.SerialGemBoxSpreadsheet());
//////////////////////////////////////////////////////////////
int count = 2;
var wbVentas = new ClosedXML.Excel.XLWorkbook(FormatoVentas);
var wsVentas = wbVentas.Worksheet(1);
var workbookAlmacenes = new ExcelFile();
var worksheetAlmacenes = workbookAlmacenes.Worksheets.Add("Almacenes");
worksheetAlmacenes.InsertDataTable(DTAlmacenes, new InsertDataTableOptions()
foreach (DataRow DRow in DTVentas.Rows)
{
ColumnHeaders = true,
StartRow = 0
});
wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
wsVentas.Cell(count, 2).Value = DRow["Branch"].ToString();
wsVentas.Cell(count, 3).Value = "'" + DRow["Code"].ToString();
wsVentas.Cell(count, 4).Value = "'" + DRow["Sale Date"].ToString();
wsVentas.Cell(count, 5).Value = DRow["Quantity"].ToString();
wsVentas.Cell(count, 6).Value = DRow["Amount"].ToString();
wsVentas.Cell(count, 7).Value = DRow["Transaction ID"].ToString();
count++;
}
wbVentas.SaveAs(RutaVentas);
var wbAlmacenes = new ClosedXML.Excel.XLWorkbook(FormatoAlmacenes);
var wsAlmacenes = wbAlmacenes.Worksheet(1);
count = 2;
foreach (DataRow DRow in DTAlmacenes.Rows)
{
//contador++;
//var cell = worksheetAlmacenes.Cells[contador, 3];
//cell.Style.WrapText = true;
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
wsAlmacenes.Cell(count, 4).Value = "'" + DRow["Stock Date"].ToString();
count++;
}
//worksheetAlmacenes.Columns[3].Style.NumberFormat = "yyyy/MM/dd";
workbookAlmacenes.Save(RutaAlmacenes);
wbAlmacenes.SaveAs(RutaAlmacenes);
var workbookProductos = new ExcelFile();
var worksheetProductos = workbookProductos.Worksheets.Add("Productos");
worksheetProductos.InsertDataTable(DTProductos, new InsertDataTableOptions()
var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
var wsClientes = wbAClientes.Worksheet(1);
count = 2;
foreach (DataRow DRow in DTClientes.Rows)
{
ColumnHeaders = true,
StartRow = 0
});
workbookProductos.Save(RutaProductos);
var workbookVentas = new ExcelFile();
var worksheetVentas = workbookVentas.Worksheets.Add("Ventas");
worksheetVentas.InsertDataTable(DTVentas, new InsertDataTableOptions()
{
ColumnHeaders = true,
StartRow = 0
});
contador = 0;
foreach (DataRow DRow in DTVentas.Rows)
{
//var value = DateTime.Now;
contador++;
var cell = worksheetVentas.Cells[contador, 3];
cell.Style.WrapText = false;
cell.Style.IsTextVertical = false;
cell.Style.Font.Italic = false;
//cell.Style.NumberFormat = "h:mm AM/PM"; // "yyyy-MM-dd";
//cell.SetValue(value);
wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
wsClientes.Cell(count, 11).Value = DRow["phone.intCode"].ToString();
wsClientes.Cell(count, 12).Value = DRow["phone.areaCode"].ToString();
wsClientes.Cell(count, 13).Value = "'" + DRow["phone.number"].ToString();
wsClientes.Cell(count, 14).Value = DRow["salesman"].ToString();
count++;
}
wbAClientes.SaveAs(RutaClientes);
//worksheetVentas.Columns[3].Style.NumberFormat = "yyyy/MM/dd";
var wbProductos= new ClosedXML.Excel.XLWorkbook(FormatoProductos);
var wsProductos = wbProductos.Worksheet(1);
workbookVentas.Save(RutaVentas);
count = 2;
var workbookClientes = new ExcelFile();
var worksheetClientes = workbookClientes.Worksheets.Add("Clientes");
worksheetClientes.InsertDataTable(DTClientes, new InsertDataTableOptions()
foreach (DataRow DRow in DTProductos.Rows)
{
ColumnHeaders = true,
StartRow = 0
});
workbookClientes.Save(RutaClientes);
wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
count++;
}
wbProductos.SaveAs(RutaProductos);
/////////////////////////////////////////////////////////////
var FInfoProductos = new FileInfo(RutaProductos);
var FInfoVentas = new FileInfo(RutaVentas);
@@ -370,7 +367,8 @@ public class TareasJam : IHttpHandler
if (CargaVentas)
{
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
}else
}
else
{
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
}
@@ -387,12 +385,13 @@ public class TareasJam : IHttpHandler
if (CargaClientes)
{
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
}else
}
else
{
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>");
}
if (CargaProductos & CargaVentas& CargaClientes )
if (CargaProductos & CargaVentas & CargaClientes)
{
CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
if (CargaClientes)
@@ -404,7 +403,8 @@ public class TareasJam : IHttpHandler
if (CargaAlmacenes)
{
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
}else
}
else
{
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>");
}
@@ -431,8 +431,6 @@ public class TareasJam : IHttpHandler
string Cuerpo = Respuesta ? $"<b>Correcto</b><br>Tarea de carga de archios Corteva realizada correctamente<br> {SBLog.ToString()}" : $"<b>Error</b><br> Error tarea de carga de archios Corteva<br> {SBLog.ToString()}" ;
MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes);
return Respuesta;
@@ -458,13 +456,6 @@ public class TareasJam : IHttpHandler
Clientes.Ruta = RutaClientes;
Almacenes.Ruta = RutaAlmacenes;
//FileInfo FIp = new FileInfo(RutaProductos);
//FileInfo FIv = new FileInfo(RutaVentas);
//FileInfo FIc = new FileInfo(RutaClientes);
//FileInfo FIa = new FileInfo(RutaAlmacenes);
ListaArchivos.Add(Productos);
ListaArchivos.Add(Ventas);
ListaArchivos.Add(Clientes);
@@ -472,8 +463,8 @@ public class TareasJam : IHttpHandler
ClsSisMail Correo = new ClsSisMail();
// string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
string Para = "oscar.irigoyen@adssistemas.mx";
string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
//string Para = "oscar.irigoyen@adssistemas.mx";
string Asunto = ErrorProceso ? $"Carga Layout Corteva {DateTime.Now.ToString("yyyy-MM-dd")}" : $"Carga Layout Corteva Error {DateTime.Now.ToString("yyyy-MM-dd")}";
Correo.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Cuerpo, Archivos:ListaArchivos);
@@ -488,7 +479,7 @@ public class TareasJam : IHttpHandler
private bool CargarArchivos(FileInfo FInfo, string FTPServer, string FTPUsr, string FTPPass )
{
bool Respuesta;
//var FInfo = new FileInfo(RutaArchivo);
if (FInfo.Exists)
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");

View File

@@ -378,7 +378,7 @@
<i></i>
</div>
<div class="form-group form-md-line-input">
<asp:TextBox ID="TxtCodigo" runat="server" CssClass="form-control" MaxLength="25"></asp:TextBox>
<asp:TextBox ID="TxtCodigo" runat="server" OnTextChanged="TxtCodigo_TextChanged" AutoPostBack="true" CssClass="form-control" MaxLength="25"></asp:TextBox>
<label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
</div>
<div class="form-group form-md-line-input">

View File

@@ -847,6 +847,12 @@ Partial Class Clientes
CargaDatosCRM()
End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ' Funcionalidad Es Distribuidor
DivEsDistribuidor.Visible = True
DivCargoUsado.Visible = True
DivBonificacionUsado.Visible = True
End If
ChecaPermiteCredito()
@@ -1114,9 +1120,9 @@ Partial Class Clientes
Select Case HdnCuenta.Value
Case "1"
CargaDdlCuentasContables(DdlCtaContableClientes, UsuarioActual.Empresa.Funcionalidad(246).ToEntero)
CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).ToEntero
Case "2"
CargaDdlCuentasContables(DdlCtaContableAnticipos, UsuarioActual.Empresa.Funcionalidad(237).ToEntero)
CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).ToEntero
Case "3"
CargaDdlCuentasContables(DdlCtaContableRetIVA, -1)
Case "4"
@@ -1124,13 +1130,13 @@ Partial Class Clientes
Case "5"
CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1)
Case "6"
CargaDdlCuentasContables(DdlCtaContableCompClientes, UsuarioActual.Empresa.Funcionalidad(248).ToEntero)
CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).ToEntero
Case "7"
CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1)
Case "8"
CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, UsuarioActual.Empresa.Funcionalidad(247).ToEntero)
CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).ToEntero
Case "9"
CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, UsuarioActual.Empresa.Funcionalidad(542).ToEntero)
CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).ToEntero
End Select
UpFiscalContable.Update()
@@ -2752,7 +2758,7 @@ Partial Class Clientes
'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}"
Dim Liga As String = String.Format("< a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">", e.Row.DBCampo("CveVenta"))
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
HLSendMail.HRef = String.Format("javascript:(function mail(){{$get('HdnTipoDocto').value='{0}';$get('HdnCveVenta').value='{1}';$get('HdnFolioVenta').value='{2}';$get('TxtParaMail').value='{3}';$get('HdnSerieFolio').value='{4}';$get('HdnSubProyecto').value='{5}';$('#ModalDivMail').modal();return false;}})();", e.Row.DBCampo("TipoDocto"), e.Row.DBCampo("CveVenta"), e.Row.DBCampo("folio"), e.Row.DBCampo("Correo"), e.Row.DBCampo("SerieFolio"), e.Row.DBCampo("SubProyecto"))
e.Row.FCLiteral("LtlFactura").Text = String.Format("<a class=""Texto"" href=""/Ventas/Ventas.aspx?CveVenta={0}"">{1}</a>", e.Row.DBCampo("CveVenta"), e.Row.DBCampo("Folio"))
UpSendMail.Update()
@@ -9076,7 +9082,14 @@ Partial Class Clientes
e.Row.FCCheckBox("ChkBonificacion").Visible = False
Else
e.Row.FCCheckBox("ChkBonificacion").Checked = False
'VERIFICA SI ES USADO O AJUSTE/GARANTIA
'SI ES USADO
If e.Row.DBCampo("EsUsadoAjuste") = "0" Then
e.Row.FCCheckBox("ChkBonificacion").Visible = True
'SI ES AJUSTE/GARANTIA
ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then
e.Row.FCCheckBox("ChkBonificacion").Visible = False
End If
End If
Else
@@ -10191,5 +10204,17 @@ Partial Class Clientes
End If
ObjBancos.Dispose()
End Sub
Protected Sub TxtCodigo_TextChanged(sender As Object, e As EventArgs)
If CveCliente <= 0 AndAlso UsuarioActual.CveEmpresa = 140 Then
DdlTipoCliente.SelectedValueExist("1")
ChkEsDistribuidor.Checked = True
ChkCargoUsado.Checked = True
ChkBonificacionUsado.Checked = True
End If
UpDatos.Update()
End Sub
End Class

View File

@@ -1,4 +1,4 @@
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PV.aspx.vb" Inherits="PV" EnableEventValidation="false"%>
<%@ Page Title="Ventas - Facturación" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="PV.aspx.vb" Inherits="PV" EnableEventValidation="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%--Necesario para el modal que no se cierra--%>
@@ -2960,16 +2960,19 @@
</div>
</div>
</div>
<div class="row" style="margin-top: 17px;">
<div class="col-md-2">
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<asp:TextBox ID="TxtPoliza" CssClass="form-control" runat="server" MaxLength="50" Width="100%"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVPoliza" runat="server" ControlToValidate="TxtPoliza" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Póliza''</b> es incorrecto, por favor ingréselo correctamente." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
<%--<asp:RequiredFieldValidator ID="RFVPoliza" runat="server" ControlToValidate="TxtPoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Poliza''</b> es necesario, por favor ingréselo." ValidationGroup="VGMAjuste"></asp:RequiredFieldValidator>--%>
<%--<ajax:ValidatorCalloutExtender ID="VCEPoliza" runat="server" HighlightCssClass="vco" TargetControlID="RFVPoliza"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtPoliza.ClientID.ToString()%>">Poliza:</label>
<label for="<%= TxtPoliza.ClientID.ToString()%>">Póliza:</label>
</div>
</div>
<div class="col-md-4">
</div>
<div class="row" style="margin-top: 17px;">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
@@ -2978,7 +2981,7 @@
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
</div>
</div>
<div class="col-md-4">
<div class="col-md-6">
<asp:Button ID="BtnCalcularImporteAjuste" CssClass="btn green-haze btn-outline btn-circle btn-sm" OnClick="BtnCalcularImporteAjuste_Click" runat="server" Text="Recalcular" UseSubmitBehavior="false" />
</div>
</div>
@@ -2991,7 +2994,7 @@
<div class="modal-footer">
<asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<%-- <asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
<%-- <asp:Button ID="BtnCalculaMesesUso" Text="" OnClick="BtnCalculaMesesUso_Click" ClientIDMode="Static" Style="display: none;" runat="server" />--%>
<asp:Button ClientIDMode="Static" ID="LnkAgregarPS" OnClick="LnkAgregarPS_Click" runat="server" CssClass="btn btn-primary" Text="Agregar" ValidationGroup="GrpAddVenta" UseSubmitBehavior="false" />
<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate>

View File

@@ -2306,6 +2306,10 @@ Partial Class PV
DdlEstadoSAT.DataBind()
DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa = 140 AndAlso ClaveSATPais = "MEX" Then
DdlEstadoSAT.SelectedValueExist("26")
End If
End Sub
Protected Sub DdlSATPais_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEstados(DdlSATPais.SelectedValue)
@@ -2768,6 +2772,18 @@ Partial Class PV
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString)
End If
'SELECCIONA VENDEDOR DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE
If UsuarioActual.CveVendedor > 0 Then
If CveVenta = -1 AndAlso Not DdlVendedor.SelectedValue.ToEntero() > 0 Then DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString())
If DdlVendedor.SelectedValue.ToEntero() > 0 AndAlso Not UsuarioActual.TienePermisoProceso(161) Then
DdlVendedor.Enabled = False
End If
'multiples vendedores visible
If UsuarioActual.TienePermisoProceso(153) Then
DdlVendedor.Enabled = True
End If
End If
End Sub
Private Sub ObtenerFechaVencimientoCER()
Try
@@ -4655,6 +4671,15 @@ Partial Class PV
RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta")
End Sub
Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs)
If ChkAjuste.Checked Then
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
If AgregarPS() Then
If ChkAjuste.Checked Then GuardaAjuste()
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
@@ -6174,6 +6199,46 @@ Partial Class PV
CveTamanio = drPS("CveTamaño").ToString.ToEntero
End If
If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
' si es 10. primero el cliente
Dim CvePrecioListaPS As Integer
Dim PorcentajePrecio As Decimal = 0
If TipoPrecioLista = 10 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
If CvePrecioListaPS <= 0 Then
CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
End If
Else
CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
If CvePrecioListaPS <= 0 Then
CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
End If
End If
If CvePrecioListaPS > 0 Then
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal
End If
ObjPS.Dispose()
End If
If PrecioSugerido = 0 Then
Dim ObjInventarios As New ClsInventarios
Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose()
If CostoPS > 0 And PorcentajePrecio > 0 Then
PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
End If
End If
'CvePrecioLista = CvePrecioListaPS
End If
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then
@@ -6455,6 +6520,12 @@ Partial Class PV
UpAjuste.Update()
End If
ObjAcumuladores.Dispose()
Dim FolioGarantia As MFolioGarantiaMensaje = ValidaFolioGarantia(DdlPSAjuste.SelectedValue.ToEntero(), DdlFolioGarantia.SelectedValue.ToEntero())
If Not FolioGarantia.Valido Then
Alert($"El folio de garantía no es valido.<br/> Clasificacion del Producto:{FolioGarantia.ClasificacionPS}.<br/>Tipo Folio:{FolioGarantia.TipoFolio}", TipoMensaje.MsgAdvertencia)
End If
End Sub
#End Region
@@ -6935,4 +7006,68 @@ Partial Class PV
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
End Sub
Private Function ValidaFolioGarantia(CvePS As Integer, CveFolioGarantia As Integer) As MFolioGarantiaMensaje
Dim Retorno As New MFolioGarantiaMensaje
Dim Valido As Boolean = False
Dim TipoFolio As String = ""
Dim ListaClasificacionesPermitidas As New List(Of Integer)
Dim ObjAcumuladores As New ClsAcumuladores
If ObjAcumuladores.FoliosGarantiaGet(CveFolioGarantia, UsuarioActual.CveEmpresa, Area:=-1) AndAlso ObjAcumuladores.DtResultados.Rows.Count > 0 Then
Dim Row As DataRow = ObjAcumuladores.DtResultados.Rows(0)
TipoFolio = Row("tipoFolio").ToString().ToUpper()
End If
ObjAcumuladores.Dispose()
Dim CveClasificacionPS As Integer = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("CveClasificacion").ToEntero()
Dim ClasificacionPS As String = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacionPS).FiltroPrimeroValor("Clasificacion").ToString()
Select Case TipoFolio
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(20522) 'ACUM. ESPECIALES
ListaClasificacionesPermitidas.Add(20513) 'ACUM. ESTANDAR
ListaClasificacionesPermitidas.Add(20521) 'ACUM. PESADO
ListaClasificacionesPermitidas.Add(20512) 'ACUM. PREMIUM
ListaClasificacionesPermitidas.Add(20514) 'ACUM. VALUE
ListaClasificacionesPermitidas.Add(20229) 'Acumulador
Case "OPTIMA"
'20511 ACUM. OPTIMA
ListaClasificacionesPermitidas.Add(20511) 'ACUM. OPTIMA
Case "MOTOBATERIA"
'20517 MOTOBATERIAS
ListaClasificacionesPermitidas.Add(20517) 'MOTOBATERIAS
End Select
If ListaClasificacionesPermitidas.Contains(CveClasificacionPS) Then
Valido = True
End If
Retorno.CvePS = CvePS
Retorno.CveFolioGarantia = CveFolioGarantia
Retorno.CveClasificacionPS = CveClasificacionPS
Retorno.ClasificacionPS = ClasificacionPS
Retorno.TipoFolio = TipoFolio
Retorno.Valido = Valido
Return Retorno
End Function
Partial Class MFolioGarantiaMensaje
Public Property CvePS As Integer
Public Property CveClasificacionPS As Integer
Public Property ClasificacionPS As String
Public Property CveFolioGarantia As Integer
Public Property TipoFolio As String
Public Property Valido As Boolean
End Class
End Class

View File

@@ -424,10 +424,10 @@
</td>
</tr>--%>
<tr runat="server" id="trsucursalciente" visible="false">
<td align="left" ><b>
<td align="left"><b>
<asp:Label ID="LblSucursal" runat="server" Text="Sucursal"></asp:Label>
:</b></td>
<td align="left" >
<td align="left">
<div class="row align-items-start">
<div class="col-md-10">
<asp:DropDownList ID="DdlSucursalCliente" runat="server" AutoPostBack="true" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="SucursalCliente" DataValueField="CveClienteSucursal">
@@ -438,11 +438,11 @@
</div>
</div>
</td>
<td align="left" >
<td align="left">
<b>
<asp:Label ID="LtlTitleRFCSucursal" runat="server" Text=""></asp:Label></b>
</td>
<td align="left" >
<td align="left">
<asp:Label ID="LtlRFCSucursal" runat="server" Text=""></asp:Label>
</td>
</tr>
@@ -1575,7 +1575,7 @@
</div>
</div>
</div>
<asp:HiddenField ID="HdnTotalRNC" runat="server" ClientIDMode="Static" Value="0" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
@@ -4316,23 +4316,18 @@
<div class="portlet-title">
<div class="caption font-green">
<%--<i class="fa fa-users font-green"></i>--%>
<span class="caption-subject bold uppercase">Bitacora</span>
</div>
<div class="actions">
<div class="btn-group">
<%--<div class=" font-green" style="cursor: pointer;" runat="server" id="ImgAddObs" visible="false">
<i class="fa fa-commenting font-green"></i>
<span class="caption-subject bold">Agregar</span>
</div>--%>
<asp:HyperLink ID="ImgAddObs" CssClass="caption-subject bold" data-toggle="modal" data-target="#ModalBitacora" runat="server" Text=" <i class='fa fa-commenting font-green' style='font-weight: 700 !important;' ><span class='caption-subject bold'>Agregar</span></i>" Style="cursor: pointer;" ToolTip="Observaciones"></asp:HyperLink><br />
<asp:HyperLink ID="HlEvento" CssClass="thickbox caption-subject bold" runat="server" Visible="false" Style="cursor: pointer; text-decoration: none;" ToolTip="Agendar"><i class='fa fa-calendar-plus-o font-green' style='font-weight: 700 !important;' ></i> <span class="caption-subject bold font-green">Agendar</span></asp:HyperLink><br />
<asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" id="TareaNueva" />
<script> function OnAddedTareaNueva() {
<script>
function OnAddedTareaNueva() {
$('.btnupEventoBitacora').click();
}
</script>
</div>
</div>
@@ -6240,8 +6235,8 @@
</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlVentaUsado" runat="server" AutoPostBack="true" AppendDataBoundItems="true" DataTextField="Folio" DataValueField="CveVenta" Width="100%" CssClass="select2me" OnSelectedIndexChanged="DdlVentaUsado_SelectedIndexChanged"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>
<%-- <asp:RequiredFieldValidator ID="RFVVentaUsado" runat="server" InitialValue="-1" ControlToValidate="DdlVentaUsado" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Factura''</b> es necesario, por favor ingréselo." ValidationGroup="VGAplicarRNC"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div>
</div>
</div>
@@ -6298,14 +6293,14 @@
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>
<div class="row">
<div class="row" id="DivSMU" runat="server" visible="false">
<div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<tr align="right">
@@ -6800,7 +6795,7 @@
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" />
<asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
@@ -6877,8 +6872,6 @@
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
@@ -6895,6 +6888,9 @@
</div>
</div>
</div>
</div>
<asp:HiddenField ID="HdnSaldoMaximoUsados" runat="server" ClientIDMode="Static" Value="0" />
</div>
<div class="modal-footer">
<button id="CancelarAplicarDescNC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<asp:Button Text="Aplicar Descuento" ID="BtnAplicarDesc" OnClick="BtnAplicarDesc_Click" CssClass="btn btn-primary" runat="server" />
@@ -7084,13 +7080,116 @@
}
function CalculaSaldoRNCChk(TxtImporte, Saldo, Chk) {
//ImportesRNCCargo
if (Chk.checked) {
let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
let ImportesAsignados = 0;
$('.ImportesRNCCargo').each(function () {
if ($(this).context.id != TxtImporte.id) {
ImportesAsignados += ToDouble($(this).val());
}
});
let Importe = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > 0) {
if (Saldo > Importe) {
TxtImporte.value = FormatoNumero(Importe, 2);
} else {
TxtImporte.value = FormatoNumero(Saldo, 2);
}
} else {
TxtImporte.value = "";
Chk.checked = false;
}
} else {
TxtImporte.value = "";
}
}
function LimitaSaldoRNCChk(TxtImporte, Saldo) {
//var Importe = 0;
//if (TxtImporte.value.includes('.')) {
// return;
//}
//if (TxtImporte.value.includes(',')) {
// return;
//}
//var regex = new RegExp("^\d*\.?\d*$");
//if (regex.test(TxtImporte.value.trim())) {
// if (TxtImporte.value != '') {
// Importe = parseFloat(TxtImporte.value);
// }
//let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
//let ImportesAsignados = 0;
//$('.ImportesRNCCargo').each(function () {
// if ($(this).context.id != TxtImporte.id) {
// ImportesAsignados += ToDouble($(this).val());
// }
//});
// let ImporteDiferencia = SaldoMaximoUtilizable - ImportesAsignados;
// if (ImporteDiferencia < 0) {
// ImporteDiferencia = 0;
// }
// if (ImporteDiferencia > 0) {
// if (ImporteDiferencia > Importe) {
// TxtImporte.value = FormatoNumero(Importe, 2);
// } else {
// TxtImporte.value = FormatoNumero(ImporteDiferencia, 2);
// }
// } else {
// TxtImporte.value = "";
// }
//}
var Importe = 0;
if (TxtImporte.value.includes('.')) {
return;
}
if (TxtImporte.value.includes(',')) {
return;
}
var regex = new RegExp("^[-+]?[0-9]+\.[0-9]+$");
if (regex.test(TxtImporte.value)) {
if (TxtImporte.value != '') {
Importe = parseFloat(TxtImporte.value);
}
let SaldoMaximoUtilizable = parseFloat(HdnSaldoMaximoUsados.value)
let ImportesAsignados = 0;
$('.ImportesRNCCargo').each(function () {
if ($(this).context.id != TxtImporte.id) {
ImportesAsignados += ToDouble($(this).val());
}
});
let ImporteDiferencia = SaldoMaximoUtilizable - ImportesAsignados;
if (Importe > ImporteDiferencia) {
TxtImporte.value = FormatoNumero(ImporteDiferencia, 2);
} else {
TxtImporte.value = FormatoNumero(Importe, 2);;
}
}
}
function CalculaSaldoRNCBonChk(TxtImporte, Saldo, Chk) {
if (Chk.checked) {
TxtImporte.value = FormatoNumero(Saldo, 2);
} else {
TxtImporte.value = "";
}
}
function LimitaSaldoRNCChk(TxtImporte, Saldo) {
function LimitaSaldoRNCBonChk(TxtImporte, Saldo) {
var Importe = 0;
if (TxtImporte.value.includes('.')) {
@@ -7543,6 +7642,7 @@
var totalDebito = ToDouble($get("TxtImporteDebito").value);
var totalCheque = ToDouble($get("TxtImporteCheque").value);
var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
var totalRNC = ToDouble($get("HdnTotalRNC").value);
var TotalOtrosContado = 0;
@@ -7552,7 +7652,7 @@
}
} catch (e) { }
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado;
var total = totalEfectivo + totalCredito + totalDebito + totalCheque + totalTransferencia + TotalOtrosContado + totalRNC;
var totalVenta = ToDouble($get('TxtTotal').value);
if (total > totalVenta) {
@@ -7561,7 +7661,7 @@
$get("TxtCambio").value = "0.00";
}
$get("TxtImporteContado").value = total;
$get("TxtImporteContado").value = total - totalRNC;
}
// ****************************************************************************************************************************************************************************

View File

@@ -1791,6 +1791,15 @@ Partial Class Ventas
End Set
End Property
Private Property SerieVenta As String
Get
Return IfNull(ViewState("SerieVenta"), "", ViewState("SerieVenta")).ToString()
End Get
Set(value As String)
ViewState("SerieVenta") = value
End Set
End Property
#End Region
'#Region "AuxiliarConta"
@@ -1985,6 +1994,7 @@ Partial Class Ventas
DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat")
DivPSSAT.Visible = True
SetValues()
CvePresupuesto = 0
@@ -2150,6 +2160,7 @@ Partial Class Ventas
'Carga Venta
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then
ViewState("CveVenta") = Request("CveVenta")
If CargaVenta() Then
'DdlSucursal.Enabled = False
@@ -2684,7 +2695,7 @@ Partial Class Ventas
TrPedido.Visible = False
' TrKilometrajeTxt.Visible = True
End If
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""'></i> Tarea</a>", CveVenta)
LtlTareaNueva.Text = String.Format("<a class=""caption-subject bold font-green"" onclick=""OpenModalNewTareaUserControl(1,-1,{{CveVenta:{0}}});""> <i class=""fa fa-plus""></i> Tarea</a>", CveVenta)
End If
@@ -3671,6 +3682,10 @@ Partial Class Ventas
DdlEstadoSAT.DataBind()
DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa = 140 AndAlso ClaveSATPais = "MEX" Then
DdlEstadoSAT.SelectedValueExist("26")
End If
End Sub
Protected Sub DdlSATPais_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEstados(DdlSATPais.SelectedValue)
@@ -4065,7 +4080,9 @@ Partial Class Ventas
ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString()
LblSerie.Text = DbRowVenta("Serie").ToString()
SerieVenta = DbRowVenta("Serie").ToString()
LblSerie.Text = SerieVenta
ViewState("Serie") = DbRowVenta("Serie").ToString()
ViewState("Folio") = DbRowVenta("Folio").ToString().ToEntero()
TxtFolio.Text = DbRowVenta("Folio").ToString()
@@ -5399,7 +5416,7 @@ Partial Class Ventas
DdlVentaUsado.DataBind()
DdlVentaUsado.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlVentaUsado.Items.Insert(0, New ListItem("No Aplica", "-1"))
UpModalRemisionesNC.Update()
End If
@@ -8305,6 +8322,7 @@ Partial Class Ventas
If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then
Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue.ToEntero()))
If DT.Rows.Count > 0 Then
factura.Serie = DT.Rows(0)("Serie").ToString()
factura.Folio = DT.Rows(0)("FActual").ToString().ToEntero()
Else
ProcesoCorrecto = False
@@ -8492,6 +8510,11 @@ Partial Class Ventas
ObjFactura.FacturarSucursal = (Me.FacturarSucursal AndAlso DdlSucursalCliente.SelectedValue.ToEntero() > 0 AndAlso (Me.ClienteSucursal IsNot Nothing AndAlso Not String.IsNullOrEmpty(Me.ClienteSucursal.RFC)))
ObjFactura.VentaDesglosaIEPS = Me.VentaDesglosaIEPS
'ObjFactura.RefDocto = TxtDocto.Text.Trim
If EsCreaApartirDe Then
ViewState("EstablecioFolio") = False
End If
'si es cancelacion, debe de conservar el folio actual
If Not EsCancelacion Then ObjFactura.Folio = If(EstablecioFolio Or VistaPrevia Or (CveVenta > 0 And (NuevaFactura.Contiene(0, 2))), TxtFolio.Text.Trim.ToEntero(), -1)
@@ -10090,11 +10113,6 @@ Partial Class Ventas
End If
End If
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, ObjVentas.CveVenta) Then
ErrorList.Add("Error al guardar usados")
End If
If ErrorList.Count = 0 AndAlso ObjVentas.CveVenta > 0 Then
factura.CveVenta = ObjVentas.CveVenta
@@ -10104,6 +10122,10 @@ Partial Class Ventas
factura.Timbre.Comprobante.Serie = ObjVentas.Serie
factura.Timbre.Comprobante.Folio = ObjVentas.Folio.ToString()
If Not GuardarUsados(ObjVentas.IniciaTransacSQL, factura) Then
ErrorList.Add("Error al guardar usados")
End If
If factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then
InicializaDTVentasNC()
@@ -10169,7 +10191,7 @@ Partial Class Ventas
'PedidoA'
If ObjVentas.CveVenta > 0 And CvePedidoA > 0 And DdlTipoComprobante.SelectedValue.Contiene("Rem") Then
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario) Then
If Not ObjCliente.UpdateEstatusPedido(CvePedidoA, 18, -1, UsuarioActual.CveUsuario, CveRemision:=factura.CveVenta) Then
ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA")
End If
End If
@@ -15061,7 +15083,11 @@ Partial Class Ventas
'ViewState("NumAprobacion") = CLng(DT.Rows(0)("Aprobacion").ToString())
'ViewState("FechaAprobacion") = DT.Rows(0)("FechaAprobacion").ToString().ToDate
ViewState("FolioActual") = DT.Rows(0)("FActual").ToString()
If UsuarioActual.CveEmpresa = 140 AndAlso CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
LblSerie.Text = SerieVenta
Else
LblSerie.Text = DT.Rows(0)("Serie").ToString()
End If
TxtFolio.Text = DT.Rows(0)("FActual").ToString()
BtnCrearApartirDe.Enabled = True
BtnEmitirImprimir.Visible = True
@@ -15116,7 +15142,13 @@ Partial Class Ventas
'ViewState("SubProyectoPorcentajeIVA") = dr("IVA")
ViewState("TipoFormato") = dr("TipoFormato")
ViewState("Serie") = dr("Serie")
If UsuarioActual.CveEmpresa = 140 AndAlso Me.CveVenta > 0 AndAlso Not EsCreaApartirDe AndAlso Not String.IsNullOrEmpty(SerieVenta) Then
LblSerie.Text = SerieVenta
Else
LblSerie.Text = dr("Serie").ToString()
End If
If SerieXML <> "" Then LblSerie.Text = SerieXML
Dim CveSubProyecto As Integer = GetSubProyectoSucursal()
If CveSubProyecto > 0 Then CargaSubProyecto(CveSubProyecto)
@@ -21285,11 +21317,6 @@ Partial Class Ventas
Return
End If
If DdlSATPS.SelectedValue = "" OrElse DdlSATPS.SelectedValue = "46920" Then
Alert("Producto SAT no valido", TipoMensaje.MsgAdvertencia)
Return
End If
Dim CveMetodoInventario As Integer = 0
If ChkRequiereSerie.Checked Then CveMetodoInventario = 5 Else CveMetodoInventario = 1
@@ -21667,18 +21694,18 @@ Partial Class Ventas
End If
'SALIDA GENERAL
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
If CveMovimientoEntradaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then
CveMovimientoSalidaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7")
If CveMovimientoSalidaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaGeneral, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaGeneral, Dr("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString().ToEntero(), Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
Return False
End If
Next
End If
'GENERAR PREPOLIZA
If Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoEntradaGeneral, CveAlmacenOrigenContrato) Then
If Not GeneraPrePolizaMovimientoAlmacen(ObjInventario, ObjConta, ObjContPaq, ObjFactura, ObjFactura.CvePrePoliza, CveMovimientoSalidaGeneral, CveAlmacenOrigenContrato) Then
Return False
End If
Else
@@ -22990,12 +23017,14 @@ Partial Class Ventas
Exit Sub
End If
If DeshabilitarAplicarNotaDeCredito(LblRFC.Text) Then
Exit Sub
End If
AplicaNCMasiva = False
AplicaNC = False
LBNotaCredito.Visible = True
'LkNotaCredito.Visible = False
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNC();")
TxtNCImporte.Attributes.Add("onkeyup", "CalculaPorcentajeNC();")
@@ -23083,19 +23112,26 @@ Partial Class Ventas
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))
GvRemisionesNC.DataBind()
GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then
DivSMU.Visible = True
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa)
LtlSMU.Text = String.Format("{0:N2}", FacUsado.DtDetalle.SUM("Total", "EsCargo = True").ToDecimal())
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
LtlSMU.Text = String.Format("{0:N2}", 0)
DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
UpModalRemisionesNC.Update()
UpDescNC.Update()
End Sub
Private Sub CargaDescRNC()
Dim DtNC As DataTable = Nothing
@@ -23112,12 +23148,16 @@ Partial Class Ventas
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))
GvDescNCCargos.DataBind()
GvDescNCBonificaciones.DataBind()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal())
Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados)
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
UpDescNC.Update()
End Sub
@@ -23130,28 +23170,52 @@ Partial Class Ventas
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If
Dim CveVentaBonificacion As Integer = -1
Dim ImporteBonificacion As Decimal = 0
Dim ListaBon As New List(Of VentasBonificaciones)
Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then
Dim RowMovto As DataRow = ObjAcum.DtResultados.FiltroPrimero("")
CveVentaBonificacion = RowMovto("CveVentaBonificacion").ToString().ToEntero()
ImporteBonificacion = RowMovto("ImporteBonificacion").ToString().ToDecimal()
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If CveVentaBonificacion > 0 Then
Dim RowBonificacion As DataRow = Me.TmpDTRNCBonificacionesCliente.FiltroPrimero($"CveVenta = {CveVentaBonificacion}")
RowBonificacion("ImporteBonificacion") = ImporteBonificacion
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero
Into x = Group
Select New With {
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
}
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
End If
If ListaBon.Count > 0 Then
Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString())
For Each RowBonificacion As DataRow In Bonificaciones
Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero())
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").ToEntero()
If ChkAplicarRNC.Checked Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
Dim RowEliminar As DataRow = Me.TmpDTRNCBonificacionesSeleccionadas.Select($"CveVenta = {CveVentaBonificacion}").FirstOrDefault()
TmpDTRNCBonificacionesSeleccionadas.Rows.Remove(RowEliminar)
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If
@@ -23165,7 +23229,7 @@ Partial Class Ventas
GvDescNCBonificaciones.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvDescNCBonificaciones.DataBind()
LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal())
LblSaldoMaximoBonificacion.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal())
UpDescNC.Update()
@@ -23178,28 +23242,52 @@ Partial Class Ventas
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If
Dim CveVentaBonificacion As Integer = -1
Dim ImporteBonificacion As Decimal = 0
Dim ListaBon As New List(Of VentasBonificaciones)
Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then
Dim RowMovto As DataRow = ObjAcum.DtResultados.FiltroPrimero("")
CveVentaBonificacion = RowMovto("CveVentaBonificacion").ToString().ToEntero()
ImporteBonificacion = RowMovto("ImporteBonificacion").ToString().ToDecimal()
DtBon = ObjAcum.DtResultados.Copy()
End If
End Using
If CveVentaBonificacion > 0 Then
Dim RowBonificacion As DataRow = Me.TmpDTRNCBonificacionesCliente.FiltroPrimero($"CveVenta = {CveVentaBonificacion}")
RowBonificacion("ImporteBonificacion") = ImporteBonificacion
If DtBon IsNot Nothing Then
Dim queryBonificacion = From dr In DtBon
Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero
Into x = Group
Select New With {
.CveVentaBonificacion = CveVentaBonificacion,
.ImporteBonificacion = x.Sum(Function(s) s("ImporteBonificacion").ToString().ToDecimal),
.IVABonificacion = x.Sum(Function(s) s("IVABonificacion").ToString().ToDecimal)
}
For Each bon In queryBonificacion
SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Next
SbFiltro.Remove(SbFiltro.Length - 1, 1)
SbFiltro.Append(")")
End If
If ListaBon.Count > 0 Then
Dim Bonificaciones = Me.TmpDTRNCBonificacionesCliente.Select(SbFiltro.ToString())
For Each RowBonificacion As DataRow In Bonificaciones
Dim RNCBonificacion = ListaBon.Where(Function(x) x.CveVentaBonificacion = RowBonificacion("CveVenta").ToString().ToEntero())
RowBonificacion("ImporteBonificacion") = RNCBonificacion.Sum(Function(x) x.ImporteBonificacion)
RowBonificacion("IVABonificacion") = RNCBonificacion.Sum(Function(x) x.IVABonificacion)
RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").ToEntero()
If ChkAplicarRNC.Checked Then
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray)
Else
Dim RowEliminar As DataRow = Me.TmpDTRNCBonificacionesSeleccionadas.Select($"CveVenta = {CveVentaBonificacion}").FirstOrDefault()
TmpDTRNCBonificacionesSeleccionadas.Rows.Remove(RowEliminar)
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If
@@ -23213,7 +23301,7 @@ Partial Class Ventas
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNCBon.DataBind()
LtlSMUBon.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal())
LtlSMUBon.Text = String.Format("{0:N2}", Me.TmpDTRNCBonificacionesSeleccionadas.SUM("ImporteBonificacion").ToDecimal() + Me.TmpDTRNCBonificacionesSeleccionadas.SUM("IVABonificacion").ToDecimal())
UpModalRemisionesNC.Update()
@@ -23226,8 +23314,8 @@ Partial Class Ventas
End Sub
Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({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});")
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If
End Sub
@@ -23239,8 +23327,8 @@ Partial Class Ventas
End Sub
Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaTotalRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaCantidadRNCMasivo({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({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 Sub
@@ -23575,7 +23663,7 @@ Partial Class Ventas
Dim UltimoRenglonRNC As Integer = 1
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
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
Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
@@ -23620,7 +23708,7 @@ Partial Class Ventas
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
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 Obs = RowCargo("CodigoPS").ToString()
@@ -26510,29 +26598,21 @@ Partial Class Ventas
End If
End Sub
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, CveVenta As Integer) As Boolean
Private Function GuardarUsados(SqlTransaccion As SqlClient.SqlTransaction, factura As Modelos.Factura) As Boolean
Dim Resultado As Boolean = True
If ClienteEsDistribuidor Then
'If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
' Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero()
If ClienteEsDistribuidor AndAlso factura.TipoDocto.Contiene("Ing") Then
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
For Each drow As DataRow In TmpDT.Rows
If drow("CveTamaño").ToString().ToEntero() > 0 Then
Dim TempDTAcums = GlobalDTAcumTamaños.FiltraParametros("CvePSCargo = " & drow("CvePS").ToString())
If TempDTAcums IsNot Nothing AndAlso TempDTAcums.Rows.Count > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(CveCliente, drow("Cantidad").ToString().ToEntero(), drow("CveTamaño").ToString().ToEntero(), 2, CveVenta, UsuarioActual.CveUsuario,
For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
UsuarioActual.CveEmpresa, 0D, "") Then
Resultado = False
Exit For
End If
Else
Resultado = True
End If
TempDTAcums.Dispose()
End If
Next
Else
@@ -26650,6 +26730,7 @@ Partial Class Ventas
RegistraScript("$('#ModalAplicarDescuentoNC').modal('show'); ")
End Sub
Protected Sub BtnAplicarDesc_Click(sender As Object, e As EventArgs)
Try
Dim CveSATNC = "84111506"
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
@@ -26691,7 +26772,7 @@ Partial Class Ventas
End If
Next
Dim LimiteUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal()
Dim LimiteUsados As Decimal = LblSaldoMaximoUsados.Text.Trim().ToDecimal()
'VERIFICA EL LIMITE DE LOS USADOS
If TotalRemNCAplicado > LimiteUsados Then
@@ -26700,6 +26781,7 @@ Partial Class Ventas
Exit Sub
End If
For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
@@ -26719,12 +26801,25 @@ Partial Class Ventas
End If
Next
Dim LimiteBonficaciones As Decimal = LblSaldoMaximoBonificacion.Text.Trim().ToDecimal()
'VERIFICA EL LIMITE DE LOS USADOS
If ListaNCBonificacion.Sum(Function(x) x.TotalRemNCAplicado) > LimiteBonficaciones Then
Alert($"La suma de las remisiones de nota de crédito de tipo 'Cargo' no debe superar el total de Usados.<br/>Total RNC: {TotalRemNCAplicado:N2}.<br/>Total Usados: {LimiteUsados:N2}", TipoMensaje.MsgAdvertencia)
ListaNCDesc.Clear()
Exit Sub
End If
HdnTotalRNC.Value = TotalRemNCAplicado.ToString()
LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero
LblTotalNC.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado).FormatoNumero
Dim CvePS = DrPS("CvePS").ToString().ToEntero()
AplicarNC(CvePS, True)
Catch ex As Exception
OnError("Ocurrió un error al aplicar remisiones de nota de crédito", ex)
End Try
UpPS.Update()
@@ -27198,14 +27293,15 @@ Partial Class Ventas
ObjVentas.Dispose()
End Sub
Private Sub DeshabilitarAplicarNotaDeCredito(RFC As String)
Private Function DeshabilitarAplicarNotaDeCredito(RFC As String) As Boolean
Dim Retorno As Boolean = False
If UsuarioActual.CveEmpresa = 119 AndAlso RFC.Contiene("XAXX010101000", "XEXX010101000") Then
LBNotaCredito.Visible = False
UpnTools.Update()
Retorno = True
End If
End Sub
Return Retorno
End Function
#Region "Auxiliar"
Private Sub CargarSaldoAuxiliar(CveCliente As Integer)
@@ -27326,12 +27422,11 @@ Partial Class Ventas
#End Region
Protected Sub DdlClasificacionPS_SelectedIndex(sender As Object, e As EventArgs) Handles DdlClasificacionPS.SelectedIndexChanged
Dim SATPS As DataTable = GlobalDTClasificaciones(CveEmpresa:=UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionPS.SelectedValue.ToEntero)
Dim CveSATPS As String = SATPS.FiltroPrimeroValor("CveSATPS")
Dim SatPSText As String = SATPS.FiltroPrimeroValor("SATClaveProductoServicio")
DdlSATPS.SelectedValue = CveSATPS
DdlSATPS.SelectedText = SatPSText
End Sub
Partial Class VentasBonificaciones
Public CveVentaRNCCargo As Integer = -1
Public CveVentaBonificacion As Integer = -1
Public ImporteBonificacion As Decimal = 0
Public IVABonificacion As Decimal = 0
End Class
End Class

View File

@@ -411,7 +411,7 @@ Public Class WSGPSApp
Public Function AddTramaApp(DevID As String, Lat As Double, Lng As Double, FechaTrama As DateTime, SO As String, Speed As Double) As Boolean
Dim Retorno As Boolean = False
Using ObjGPS As New ClsGPS
Retorno = ObjGPS.AddTrama(DevID,"", Lat, Lng, FechaTrama, Speed, String.Format("App{0}", SO))
Retorno = ObjGPS.AddTrama(DevID, "", Lat, Lng, FechaTrama, Speed)
End Using
Return Retorno
End Function