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

@@ -79,10 +79,10 @@
<div class="row" style="padding-top: 10px;"> <div class="row" style="padding-top: 10px;">
<label class="col-md-1 truncate">Tipo Folio:</label> <label class="col-md-1 truncate">Tipo Folio:</label>
<div class="col-md-2 "> <div class="col-md-2 ">
<%-- <asp:DropDownList ID="DdlSucursal" runat="server" CssClass="select2me" DataTextField="Sucursal" DataValueField="CveSucursal" Width="200px" ValidationGroup="GrpGuardar"></asp:DropDownList>--%> <%-- <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:DropDownList ID="DdlTipoFolio" runat="server" CssClass="select2me" Width="100px" ValidationGroup="GrpGuardar">
<asp:ListItem Text="Todos" Value="-1" Selected="True"></asp:ListItem> <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="optima">optima</asp:ListItem>
<asp:ListItem Value="motobateria">motobateria</asp:ListItem> <asp:ListItem Value="motobateria">motobateria</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
@@ -151,7 +151,7 @@
&nbsp;<asp:Literal ID="LblPuntos" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal> &nbsp;<asp:Literal ID="LblPuntos" runat="server" Text='<%# Eval("Estatus")%>'></asp:Literal>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </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"> <asp:TemplateField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" ItemStyle-Width="150px">
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:Literal ID="lblFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal> &nbsp;<asp:Literal ID="lblFecha" runat="server" Text='<%# Eval("FechaIng", "{0:d}")%>'></asp:Literal>
@@ -164,6 +164,13 @@
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </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"> <asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="ImgE" OnClick="Edit_ClickFolioGarantia" runat="server" AlternateText="Editar" CausesValidation="False" <asp:LinkButton ID="ImgE" OnClick="Edit_ClickFolioGarantia" runat="server" AlternateText="Editar" CausesValidation="False"
@@ -249,8 +256,9 @@
<%--<br />--%> <%--<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: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: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> <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> <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"> <div class="form-group form-md-line-input input-iconright">
<label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label></br> <label for="<%= ChkEstatus.ClientID.ToString()%>">Activo:</label></br>
<asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" /> <asp:CheckBox ID="ChkEstatus" runat="server" CssClass="make-switchsd" data-size="small" Text=" " Checked="true" />
<i></i> <i></i>
</div> </div>
<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="LblTipoFolio" for="<%= DdlTipoFolioModal.ClientID.ToString()%>">Tipo Folio:</asp:Label></br> <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: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="optima">Optima</asp:ListItem>
<asp:ListItem Value="motobateria">Motobateria</asp:ListItem> <asp:ListItem Value="motobateria">Motobateria</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
@@ -282,10 +293,11 @@
<label for="<%= TxtLimite.ClientID.ToString()%>">Límite:</label> <label for="<%= TxtLimite.ClientID.ToString()%>">Límite:</label>
<i></i> <i></i>
</div> </div>
<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="LblArea" for="<%= DdlArea.ClientID.ToString()%>">Área:</asp:Label></br> <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: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:ListItem Value="2">Almacén</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<i></i> <i></i>
@@ -340,6 +352,60 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </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>
<asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content9" ContentPlaceHolderID="JS" runat="Server">

View File

@@ -218,6 +218,28 @@ Partial Class Acumuladores_CatFoliosGarantia
End Sub 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 #End Region

View File

@@ -1126,6 +1126,25 @@ Public Class ClsAcumuladores
Return Retorno Return Retorno
End Function 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 " #Region " IDisposable Support "

View File

@@ -2021,7 +2021,7 @@ Public Class ClsClientes
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Vta_ClienteVentasPedidoEstatusUpdate") DataAdapter("PA_Vta_ClienteVentasPedidoEstatusUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -2029,6 +2029,7 @@ Public Class ClsClientes
.Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura .Add("@CveEstatusFactura", SqlDbType.Int).Value = CveEstatusFactura
.Add("@Dias", SqlDbType.Int).Value = Dias .Add("@Dias", SqlDbType.Int).Value = Dias
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveRemision", SqlDbType.Int).Value = CveRemision
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -2410,7 +2410,7 @@ Public Class ClsCompras
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Comp_CompararComplementoPagoGet") DataAdapter("PA_Comp_CompararComplementoPagoGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -2420,6 +2420,7 @@ Public Class ClsCompras
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@CveIE", SqlDbType.Int).Value = CveIE
.Add("@OP", SqlDbType.Int).Value = OP .Add("@OP", SqlDbType.Int).Value = OP
.Add("@CveFactura", SqlDbType.Int).Value = CveFactura
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

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

View File

@@ -446,6 +446,7 @@ Public Class ClsContratos
Return Retorno Return Retorno
End Function End Function
Public Function TerminarContrato(CveContrato As Integer, CveTipoEstatus As Integer, CveEmpresa As Integer) As Integer Public Function TerminarContrato(CveContrato As Integer, CveTipoEstatus As Integer, CveEmpresa As Integer) As Integer
Dim Retorno = -1 Dim Retorno = -1
@@ -515,6 +516,163 @@ Public Class ClsContratos
#End Region #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" #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 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 Dim Retorno As Boolean = False

View File

@@ -1308,7 +1308,11 @@ Public Class ClsInventarios
If Ex1.Message.Contains("50019") Then If Ex1.Message.Contains("50019") Then
Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Me.OnError(" El producto no tiene existencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Else Else
Me.OnError("Ocurrió un error al guardar los detalles del movimiento.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) 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 End If
Catch ex As Exception Catch ex As Exception
@@ -1480,7 +1484,9 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexAlmacenHorizontalGet") DataAdapter("PA_Inv_KardexAlmacenHorizontalGet")
@@ -1500,6 +1506,7 @@ Public Class ClsInventarios
.Add("@ExistenciasCondicion", SqlDbType.Int).Value = CondicionExistencias .Add("@ExistenciasCondicion", SqlDbType.Int).Value = CondicionExistencias
.Add("@Orden", SqlDbType.Int).Value = Orden .Add("@Orden", SqlDbType.Int).Value = Orden
.Add("@Marcas", SqlDbType.VarChar).Value = Marcas .Add("@Marcas", SqlDbType.VarChar).Value = Marcas
.Add("@IncluyeProyectado", SqlDbType.TinyInt).Value = IncluyeProyectado
End With End With
Try Try
@@ -5178,6 +5185,48 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function 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" #Region "SUGERENCIAS SALIDA DE ALMACEN"
Public Function GetSugerenciasSalidaAlmacen(CveVenta As Integer, CveAlmacen As Integer, CveEmpresa As Integer) As Boolean 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 Dim P As New ClsSubProyectos
If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados If P.GetSubProyectos(CveEmpresa:=CveEmpresa) Then Application(AppNombre) = P.DtResultados
P.Dispose() 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 End If
If CveProyecto <> -1 OrElse CveSubProyecto <> -1 OrElse CveEmpresa <> -1 OrElse Estatus <> -1 Then 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/PVRepCompras.aspx".ToUpper(), 272)
PaginaDict.Add("/PV/PVRepVentasCompras.aspx".ToUpper(), 273) 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 Return Retorno
End Function 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 Dim Retorno As Boolean = False
DataAdapter("PA_Gral_ProductosServiciosAliasRemove") DataAdapter("PA_Gral_ProductosServiciosAliasRemove")
SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS SqlAdapter.SelectCommand.Parameters.Add("@CvePS", SqlDbType.Int).Value = CvePS
SqlAdapter.SelectCommand.Parameters.Add("@PSAlias", SqlDbType.VarChar).Value = PSAlias SqlAdapter.SelectCommand.Parameters.Add("@PSAlias", SqlDbType.VarChar).Value = PSAlias
SqlAdapter.SelectCommand.Parameters.Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)
Retorno = True Retorno = True

View File

@@ -1285,6 +1285,8 @@ Public Class ClsVentas
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@EstatusDevolucion", SqlDbType.TinyInt).Value = EstatusDevolucion .Add("@EstatusDevolucion", SqlDbType.TinyInt).Value = EstatusDevolucion
.Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVenta", SqlDbType.Int).Value = CveVenta
'.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
'.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With End With
Try 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:element name="DtDatos" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_DataSetName="DtDatos" msprop:Generator_UserDSName="DtDatos">
<xs:complexType> <xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded"> <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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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="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="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="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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </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:complexType>
<xs:sequence> <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" /> <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 Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated. the code is regenerated.
</autogenerated>--> </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> <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: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" /> <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: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: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: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: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" /> <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> </Shapes>

View File

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

View File

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

View File

@@ -373,6 +373,11 @@ Partial Class Bancos_ProductosFinancieros
Next 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 '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 UsuarioActual.Empresa.Funcionalidad(200).ToEntero > 0 And Not ErrorTransaccion Then
If idCuentaContabilizacion > 0 Then If idCuentaContabilizacion > 0 Then
@@ -386,9 +391,6 @@ Partial Class Bancos_ProductosFinancieros
End If End If
End If End If
If Not ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
ErrorTransaccion = True
End If
End If End If

View File

@@ -11,6 +11,7 @@ Imports System.IO
Imports ADServerControl Imports ADServerControl
Imports System.Threading.Tasks Imports System.Threading.Tasks
Imports System.Diagnostics Imports System.Diagnostics
Imports System.Text.RegularExpressions
Partial Class Compras_Compras Partial Class Compras_Compras
Inherits ClsPaginas Inherits ClsPaginas
@@ -5384,6 +5385,7 @@ Partial Class Compras_Compras
'P R E P O L I Z A S 'P R E P O L I Z A S
Dim CveConceptoAfectacion As Integer = 5 'Proveedores Dim CveConceptoAfectacion As Integer = 5 'Proveedores
Dim CveConceptoOriginal As Integer
If CveTipoConcepto = 2 Then CveConceptoAfectacion = 305 'cuando es acreedor If CveTipoConcepto = 2 Then CveConceptoAfectacion = 305 'cuando es acreedor
If CveMoneda <> 1 Then If CveMoneda <> 1 Then
Select Case CveConceptoAfectacion Select Case CveConceptoAfectacion
@@ -5781,7 +5783,7 @@ Partial Class Compras_Compras
Dim CveSubProyectoInsertar As Integer = -1 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 TipoMovimiento As Boolean = If(Row("TipoMovto").ToString = "True", True, False)
Dim importeMovimiento As Decimal = 0 Dim importeMovimiento As Decimal = 0
Dim IdCtaContable As Integer = 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 Multiplicador As Integer = If(Row("Multiplicador").ToString.ToEntero = 1, 1, -1)
Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation Dim Referencia As String = $"{TxtSerie.Text}-{TxtFolio.Text}" ' concatenation interpolation
Dim PorcentajeImpuesto As Decimal = 0 Dim PorcentajeImpuesto As Decimal = 0
CveConceptoOriginal = ConceptoContable
Select Case ConceptoContable Select Case ConceptoContable
@@ -7185,7 +7187,7 @@ Partial Class Compras_Compras
importeMovimiento = importeMovimiento.Abs.RoundSQL() importeMovimiento = importeMovimiento.Abs.RoundSQL()
importeMN = importeMovimiento importeMN = importeMovimiento
If importeMovimiento <> 0 Then 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 ErrorPrepoliza = True
Exit For Exit For
End If End If
@@ -7631,8 +7633,8 @@ Partial Class Compras_Compras
If ErrorPrepoliza Then If ErrorPrepoliza Then
Exit For Exit For
End If End If
', 305, 306, 311 '5, 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 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 'Conta ContPAQ
If IdCtaContable = 0 Then If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString) CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", ConceptoContable))("ConceptoContable").ToString)
@@ -9340,7 +9342,11 @@ Partial Class Compras_Compras
ErrorMovtosCxP = 1 ErrorMovtosCxP = 1
Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError) Alert("No se pudo unificar la prepoliza", TipoMensaje.MsgError)
End If End If
CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva
If ObjConta.SeUnifico Then
CvePrePolizaNueva = CvePrepolizaPadre 'para que se unifique siempre la prepolizanueva
End If
End If End If
'Simplificacion de PrePolizas 'Simplificacion de PrePolizas
@@ -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 = 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 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 UsuarioActual.CveEmpresa = 119 And DdlTipoComprobante.SelectedValue = "Fac" Then
If Not VerificarProductosCompraConOC() Then ' If Not VerificarProductosCompraConOC() Then
Exit Sub ' Exit Sub
End If ' End If
End If 'End If
Dim SubTotalGV = 0.0D Dim SubTotalGV = 0.0D
Dim Amortizacion As Decimal = TmpDT.SUMD("Total") Dim Amortizacion As Decimal = TmpDT.SUMD("Total")
@@ -20312,7 +20318,6 @@ Partial Class Compras_Compras
Private Function VerificarProductosCompraConOC() As Boolean Private Function VerificarProductosCompraConOC() As Boolean
Dim ProductosNoValidados As New StringBuilder() Dim ProductosNoValidados As New StringBuilder()
Dim DtCompras As New DataTable() Dim DtCompras As New DataTable()
@@ -20338,7 +20343,12 @@ Partial Class Compras_Compras
Dim TipoPS As String = GvOCRow.DataKey("CveTipoPS") Dim TipoPS As String = GvOCRow.DataKey("CveTipoPS")
If TipoPS = "2" Then 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 PSOC As String = ProductoAisloadoString
Dim CantidadOC As String = GvOCRow.DataKey("CantidadF") Dim CantidadOC As String = GvOCRow.DataKey("CantidadF")
Dim PrecioUnitarioOC As String = GvOCRow.DataKey("Importe") Dim PrecioUnitarioOC As String = GvOCRow.DataKey("Importe")

View File

@@ -1281,10 +1281,10 @@ Partial Class PopUpVerFactura
'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO 'VERIFICA SI TIENE MOVIMIENTO VIRTUAL RELACIONADO
If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then If UsuarioActual.CveEmpresa = 140 AndAlso ObjInventarios.DtResultados.Rows.Count > 0 Then
CveMovimientoRelacionado = ObjInventarios.DtResultados.Rows(0)("CveMtoRel").ToString().ToEntero() 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") FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioVirtual")
CveConceptoMovtoRelacionado = 37 CveConceptoMovtoRelacionado = 37
ElseIf CveConcepto = 37 Then ElseIf CveConcepto.Contiene(36, 37) Then
FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado") FolioRelacionado = ObjInventarios.DtResultados.FiltroPrimeroValor("FolioRelacionado")
CveConceptoMovtoRelacionado = 3 CveConceptoMovtoRelacionado = 3
End If 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") ImprimirPDF("Empresas/Grales/Formatos/Inicial.rdlc", DtMovimientos, params, String.Format("Inventario Inicial - {0}", Folio), RDSName:="DsInventarios")
End If 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 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)) Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -1501,7 +1501,39 @@ Partial Class PopUpVerFactura
End If End If
ImprimirPDF(UsuarioActual.Empresa.Ruta & "Formatos/Entradas.rdlc", DtMovimientos, params, String.Format("Entrada de Almacen - {0}", Folio), RDSName:="DsInventarios") 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 Else
params.Add(New ReportParameter("TipoDocumento", String.Format("Compras {0}", Almacen))) 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("Fecha", If(CveCompra > 0, dr("Fecha").ToString.ToDate.ToShortDateString, "")))
params.Add(New ReportParameter("Folio", Folio.ToString)) 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("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre)) params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa)) params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("CveConceptoMovRelacionado", CveConceptoMovRelacionado.ToString()))
params.Add(New ReportParameter("FolioRelacionado", FolioRelacionado))
End If End If

View File

@@ -2653,6 +2653,8 @@ Partial Class Compras_eFacturas
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) 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 Dim CveComplementoPagoCompra As Integer = gvRow.DataKey("CveComplementoPagoCompra").ToString.ToEntero
If CveComplementoPagoCompra > 0 Then If CveComplementoPagoCompra > 0 Then
@@ -2773,7 +2775,7 @@ Partial Class Compras_eFacturas
Dim ObjCompraFolios As New ClsCompras 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 '.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
If ObjCompraFolios.DtResultados.Rows.Count > 0 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>
<TablixMember> <TablixMember>
<Group Name="Details" /> <Group Name="Details" />
<TablixMembers>
<TablixMember />
</TablixMembers>
</TablixMember> </TablixMember>
</TablixMembers> </TablixMembers>
</TablixRowHierarchy> </TablixRowHierarchy>
@@ -465,8 +468,8 @@
</Paragraph> </Paragraph>
</Paragraphs> </Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName> <rd:DefaultName>Textbox2</rd:DefaultName>
<Top>1.39318cm</Top> <Top>1.99643cm</Top>
<Left>0.25984cm</Left> <Left>0.22809cm</Left>
<Height>0.6cm</Height> <Height>0.6cm</Height>
<Width>11.36782cm</Width> <Width>11.36782cm</Width>
<ZIndex>1</ZIndex> <ZIndex>1</ZIndex>
@@ -480,8 +483,40 @@
<PaddingBottom>2pt</PaddingBottom> <PaddingBottom>2pt</PaddingBottom>
</Style> </Style>
</Textbox> </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> </ReportItems>
<Height>0.82291in</Height> <Height>1.05208in</Height>
<Style /> <Style />
</Body> </Body>
<Width>8.1198in</Width> <Width>8.1198in</Width>

View File

@@ -217,7 +217,7 @@ Partial Class Inventarios_CatAlmacenes
GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing GlobalDTAlmacen(UsuarioActual.CveEmpresa) = Nothing
'Dim ObjAlmacen As New ClsInventarios 'Dim ObjAlmacen As New ClsInventarios
'If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then 'If ObjAlmacen.GetAlmacenes(-1, -1, -1, -1) Then
' GlobalDTAlmacen(-1) = ObjAlmacen.DtResultados ' Application("GlobalDTAlmacen") = ObjAlmacen.DtResultados
'End If 'End If
'ObjAlmacen.Dispose() 'ObjAlmacen.Dispose()
End Sub 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) 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 If CveMovimiento <= 0 OrElse CvePrePoliza <= 0 Then
@@ -1961,7 +1961,7 @@ Partial Class Inventarios_EntradasSalidas
Dim ObjInv As New ClsInventarios Dim ObjInv As New ClsInventarios
If CveMovimiento <= 0 Then 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 End If
ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote) ObjInv.AddMovimientoDetalle(CveMovimiento, Cantidad, CveUM, CvePS, CostoPromedio, -1, Serie:=SerieLote)
@@ -3837,7 +3837,7 @@ Partial Class Inventarios_EntradasSalidas
'MOVIMIENTO DE ENTRADA 'MOVIMIENTO DE ENTRADA
If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then If DtMovimientosEntradaInvFisico.Rows.Count > 0 Then
Dim FolioEntrada As Integer = ObjInventario.GetFolioSiguiente(32, UsuarioActual.CveEmpresa) 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 Else
CveMovimientoEntrada = -1 CveMovimientoEntrada = -1
End If End If
@@ -3845,7 +3845,7 @@ Partial Class Inventarios_EntradasSalidas
'MOVIMIENTO DE SALIDA 'MOVIMIENTO DE SALIDA
If DtMovimientosSalidaInvFisico.Rows.Count > 0 Then If DtMovimientosSalidaInvFisico.Rows.Count > 0 Then
Dim FolioSalida As Integer = ObjInventario.GetFolioSiguiente(34, UsuarioActual.CveEmpresa) 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 End If
@@ -4132,19 +4132,21 @@ Partial Class Inventarios_EntradasSalidas
End Sub End Sub
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String) Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
Dim dt As New DataTable Dim dt As New DataTable
Dim Conexion As Odbc.OdbcConnection = Nothing 'Dim Conexion As Odbc.OdbcConnection = Nothing
Dim ErrorArchivo = False Dim ErrorArchivo = False
Dim n As Integer = 0 Dim n As Integer = 0
Try Try
Select Case Tipo Select Case Tipo
Case "EXCEL" Case "EXCEL"
Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";") dt = ReadExcelFile(Ruta + FileName, True)
Conexion.Open() dt = dt.FiltraParametros("Cantidad <> '' ")
Dim cmd = Conexion.CreateCommand() 'Conexion = New Odbc.OdbcConnection("Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + Ruta + FileName + ";")
cmd.CommandType = CommandType.Text 'Conexion.Open()
cmd.CommandText = "Select * FROM [Hoja1$]" 'Dim cmd = Conexion.CreateCommand()
Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd) 'cmd.CommandType = CommandType.Text
DataAdapter.Fill(dt) 'cmd.CommandText = "Select * FROM [Hoja1$]"
'Dim DataAdapter = New Odbc.OdbcDataAdapter(cmd)
'DataAdapter.Fill(dt)
Case Else Case Else
Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError) Alert("El archivo no tiene el formato correcto", TipoMensaje.MsgError)
Exit Sub Exit Sub
@@ -4153,7 +4155,7 @@ Partial Class Inventarios_EntradasSalidas
ErrorArchivo = True ErrorArchivo = True
OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex) OnError("Ocurrio un Error al leer el archivo <br/>" & ex.Message, ex)
End Try End Try
Conexion.Close() ' Conexion.Close()
If Not ErrorArchivo Then If Not ErrorArchivo Then
If Not dt.Columns(0).ColumnName = "Cantidad" Then If Not dt.Columns(0).ColumnName = "Cantidad" Then
Alert("El nombre de la primera columna debe ser 'Cantidad'.Favor de corregirlo", TipoMensaje.MsgError) 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 StrReturn As String = String.Empty
Dim CvePS As Integer = 0 Dim CvePS As Integer = 0
Dim Condicion As String = String.Format("{0} = '{1}'", Opt, Valor) Dim Condicion As String = String.Format("{0} = '{1}'", Opt, Valor)
CvePS = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", Condicion).ToString.ToEntero 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 If CvePS > 0 Then
StrReturn = "True|" & CvePS.ToString StrReturn = "True|" & CvePS.ToString
Else 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("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 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) '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") 'ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1") ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty) ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
CargaDatos()
End If End If
CargaPermisos() CargaPermisos()
@@ -257,7 +258,14 @@ Partial Class Inventarios_Kardex
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1") Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
Dim CveAlmacen As Integer = -1 Dim CveAlmacen As Integer = -1
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues() 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 = "" Dim CveTiposAlmacen = ""
For Each item As ListItem In CBLTiposAlmacen.Items For Each item As ListItem In CBLTiposAlmacen.Items

View File

@@ -92,6 +92,9 @@
<li> <li>
<asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton> <asp:LinkButton ID="LnkExportar" runat="server"><i class="fa fa-ad-excel"></i> Generar Excel</asp:LinkButton>
</li> </li>
<li>
<asp:LinkButton runat="server" ID="LnkProyectos" OnClick="LnkProyectos_Click" Text="Proyectos" />
</li>
</asp:Content> </asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server"> <asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
@@ -175,7 +178,7 @@
</div> </div>
</div> </div>
<asp:Panel ID="pnlOrden" runat="server" CssClass="row"> <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"> <div class="col-md-2">
<asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%"> <asp:DropDownList ID="DdlOrden" runat="server" CssClass="select2me" Width="100%">
<asp:ListItem Text="Seleccione" Value="-1" Selected="True" /> <asp:ListItem Text="Seleccione" Value="-1" Selected="True" />
@@ -186,14 +189,21 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="row"> <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"> <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:ListItem Text="Todas" Value="-1"></asp:ListItem>
</asp:ListBox> </asp:ListBox>
</div> </div>
</div> </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> </asp:Panel>
</div> </div>
</div> </div>
@@ -250,6 +260,40 @@
</td> </td>
</tr> </tr>
</table> </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>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server"> <asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -13,9 +13,15 @@ Partial Class Inventarios_KardexAlmacen
TxtFechaF.Text = Now.ToShortDateString TxtFechaF.Text = Now.ToShortDateString
CargaCombos() CargaCombos()
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) 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 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 DdlOrden.SelectedValue = 2
End If End If
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero) 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 CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM) 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 If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
dt = ObjMovimientos.DtResultados dt = ObjMovimientos.DtResultados
Dim ListaBorrar As New List(Of DataColumn) Dim ListaBorrar As New List(Of DataColumn)
@@ -337,6 +343,137 @@ Partial Class Inventarios_KardexAlmacen
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx") excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
End Sub 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) Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub End Sub
End Class End Class

View File

@@ -935,7 +935,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
If CveTipoCompra = 9 Then If CveTipoCompra = 9 Then
CargaAlmacenes(-1, "21", CveTipoCompra) CargaAlmacenes(-1, "27", CveTipoCompra)
End If End If
If CveTipoCompra = 10 Then If CveTipoCompra = 10 Then
@@ -972,9 +972,12 @@ Partial Class Inventarios_RecepcionAlmacen
CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero CveAlmacenDevolucionProveedor = DtRecepcion.Rows(0)("CveAlmacenDevolucionProveedor").ToString.ToEntero
'SI ES MOTOBATERIA NO GENERA MOVIMIENTO VIRTUAL '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 RealizarMovimientoVirtual = True
DivVirtualAdvertencia.Visible = True DivVirtualAdvertencia.Visible = True
Else
RealizarMovimientoVirtual = False
DivVirtualAdvertencia.Visible = False
End If End If
If TipoMovimiento = 2 AndAlso CveAlmacenDevolucionProveedor > 0 Then If TipoMovimiento = 2 AndAlso CveAlmacenDevolucionProveedor > 0 Then
@@ -2879,6 +2882,12 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
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 'AGREGA BITACORA TEMPORAL
If DtBitacora IsNot Nothing AndAlso DtBitacora.Rows.Count > 0 Then If DtBitacora IsNot Nothing AndAlso DtBitacora.Rows.Count > 0 Then
ErrorMovInv = GuardaBitacoraTemporal(ObjBitacora, CveMovimiento) ErrorMovInv = GuardaBitacoraTemporal(ObjBitacora, CveMovimiento)

View File

@@ -2077,6 +2077,8 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.TipoDocumento = "Remisión" Me.ObjRemisionNC.TipoDocumento = "Remisión"
'NUM 1- CARGO 2- BONIFICACION 'NUM 1- CARGO 2- BONIFICACION
Me.ObjRemisionNC.Num1 = 1 Me.ObjRemisionNC.Num1 = 1
'NUM 0- USADO 1- AJUSTE/GARANTIA
Me.ObjRemisionNC.Num2 = RblUsadosAjuste.SelectedValue.ToEntero()
Me.ObjRemisionNC.Alfa1 = "" Me.ObjRemisionNC.Alfa1 = ""
Me.ObjRemisionNC.Alfa2 = "" Me.ObjRemisionNC.Alfa2 = ""
Me.ObjRemisionNC.Alfa3 = "" Me.ObjRemisionNC.Alfa3 = ""
@@ -2093,8 +2095,6 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.SetCliente() Me.ObjRemisionNC.SetCliente()
Me.ObjRemisionNC.CveAlmacen = -1 Me.ObjRemisionNC.CveAlmacen = -1
Dim ObjCliente As New ClsClientes Dim ObjCliente As New ClsClientes
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
If ObjCliente.DtResultados.Rows.Count > 0 Then If ObjCliente.DtResultados.Rows.Count > 0 Then
@@ -2133,6 +2133,9 @@ Partial Class Inventarios_RecepcionUsados
'DETALLES 'DETALLES
Me.ObjRemisionNC.DtDetalle = CreaDTDetalleRNC() Me.ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
'GUARDAR AJUSTES
Me.ObjRemisionNC.DtAjustes = TmpDTAjustes
'VALIDA PROMOCIONES Y EXISTENCIAS 'VALIDA PROMOCIONES Y EXISTENCIAS
Dim ObjVentas As New ClsVentas Dim ObjVentas As New ClsVentas
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then 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("CveVenta", GetType(Integer))
TmpDTAjustes.Columns.Add("PUFactura", GetType(Double)) TmpDTAjustes.Columns.Add("PUFactura", GetType(Double))
End Sub 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() Private Sub CargaPSAjuste()
DdlPSAjuste.setEsWebService(True) DdlPSAjuste.setEsWebService(True)
End Sub End Sub
@@ -2561,7 +2533,14 @@ Partial Class Inventarios_RecepcionUsados
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("") Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
If drPS IsNot Nothing Then 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 Dim PS As String = drPS("PS").ToString
CveMarca = drPS("CveMarca").ToString.ToEntero CveMarca = drPS("CveMarca").ToString.ToEntero
CveClasificacion = drPS("CveClasificacion").ToString.ToEntero CveClasificacion = drPS("CveClasificacion").ToString.ToEntero
@@ -2637,11 +2616,71 @@ Partial Class Inventarios_RecepcionUsados
If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then If ObjAcumuladores.GetNuevoConsecutivoFolio(DdlFolioGarantia.SelectedValue.ToEntero) Then
Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo") Dim resultado As String = ObjAcumuladores.DtResultados.FiltroPrimeroValor("NuevoConsecutivo")
TxtConsecutivoAjuste.Text = (resultado.ToEntero + 1).ToString TxtConsecutivoAjuste.Text = (resultado.ToEntero + 1).ToString
UpAjuste.Update()
End If End If
ObjAcumuladores.Dispose() 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 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() Protected Sub CargaTipoDeUso()
DdlTipoUso.Items.Clear() DdlTipoUso.Items.Clear()
DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}") DdlTipoUso.DataSource = GlobalDTAcumTiposUso.FiltraParametros($"CveEmpresa = {UsuarioActual.CveEmpresa}")
@@ -2720,7 +2759,45 @@ Partial Class Inventarios_RecepcionUsados
UpAjuste.Update() UpAjuste.Update()
End Sub 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) Protected Sub BtnCalculaMesesUso_Click(sender As Object, e As EventArgs)
CalculaMesesUso() CalculaMesesUso()
End Sub End Sub
@@ -2750,6 +2827,14 @@ Partial Class Inventarios_RecepcionUsados
Protected Sub BtnAgregarProductoAjuste_Click(sender As Object, e As EventArgs) Protected Sub BtnAgregarProductoAjuste_Click(sender As Object, e As EventArgs)
Dim CvePS As Integer = DdlPSAjuste.SelectedValue.ToEntero 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 ObjPS As New ClsProductosServicios
Dim CveTamaño As Integer = -1 Dim CveTamaño As Integer = -1
If ObjPS.GetPS(CvePS, -1, UsuarioActual.CveEmpresa) Then 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) Alert("No se pudo cargar el producto", TipoMensaje.MsgError)
End If End If
ObjPS.Dispose() ObjPS.Dispose()
GuardaAjuste()
End Sub End Sub
Protected Sub CargarDescuento() Protected Sub CargarDescuento()
@@ -2790,4 +2877,14 @@ Partial Class Inventarios_RecepcionUsados
InicializaClientes(ChkClientesTodos.Checked) InicializaClientes(ChkClientesTodos.Checked)
End Sub 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 End Class

View File

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

View File

@@ -4,6 +4,8 @@ Option Explicit On
Imports Extensiones Imports Extensiones
Imports System.Data Imports System.Data
Imports Microsoft.Reporting.WebForms Imports Microsoft.Reporting.WebForms
Imports GemBox.Spreadsheet
Imports System.IO
Partial Class Inventarios_RepAlmacen Partial Class Inventarios_RepAlmacen
Inherits ClsPaginas 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>" #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 Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
'GVAlmacen.ExportToExcel("RepFacturas_" & Now.ToShortDateString())
GenerarPDF("EXCEL") GenerarPDF("EXCEL")
End Sub End Sub

View File

@@ -147,7 +147,7 @@
<div id="DivTransitorio" style="display: none;"> <div id="DivTransitorio" style="display: none;">
<div class="row"> <div class="row">
<asp:Label AssociatedControlID="TxtResponsable" ID="LblResponsable" runat="server" Text="Responsable:" CssClass="col-md-2"></asp:Label> <asp:Label AssociatedControlID="TxtResponsable" ID="LblResponsable" runat="server" Text="Responsable:" CssClass="col-md-2"></asp:Label>
<asp:Panel CssClass="col-md-2" ID="divResponsable" runat="server"> <asp:Panel CssClass="col-md-2" ID="divResponsable" runat="server">
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtResponsable" /> <asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtResponsable" />
</asp:Panel> </asp:Panel>
@@ -156,8 +156,8 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList> <asp:DropDownList ID="DdlAlmacenTransitorio" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen" CssClass="form-control input-sm select2me" Width="100%"></asp:DropDownList>
</div> </div>
<asp:Label AssociatedControlID="ChkEmitirTimbrado" runat="server" Text="Emitir Timbrado:" ID="LblEmitirTimbrado" CssClass="col-md-2 " Visible="false"></asp:Label> <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:CheckBox ID="ChkEmitirTimbrado" runat="server" CssClass="chksino" Text=" " />
</asp:Panel> </asp:Panel>
@@ -167,8 +167,8 @@
<div id="DivTransitorio2" class="rowpadding" runat="server" visible="false"> <div id="DivTransitorio2" class="rowpadding" runat="server" visible="false">
<div class="row"> <div class="row">
<asp:Label AssociatedControlID="TxtGastoIndirecto" Visible="false" id="LblGastoIndirecto" runat="server" Text="Gasto Indirecto:" CssClass="col-md-2"></asp:Label> <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"> <div class="col-md-2" id="divGastoIndirecto" visible="false" runat="server">
<asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtGastoIndirecto" /> <asp:TextBox runat="server" Text="" CssClass="form-control" ID="TxtGastoIndirecto" />
</div> </div>
<label class="col-md-2">Chofer:</label> <label class="col-md-2">Chofer:</label>
@@ -194,7 +194,7 @@
<div class="row"> <div class="row">
<label class="col-md-1">Unidad:</label> <label class="col-md-1">Unidad:</label>
<div class="col-md-1 "> <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>
<div class="col-md-2"> <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> <asp:DropDownList runat="server" ID="DdlUnidadCamion" AutoPostBack="true" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" DataValueField="CveCamion" DataTextField="Placa"></asp:DropDownList>
@@ -391,7 +391,7 @@
<th width="160px">Comandos</th> <th width="160px">Comandos</th>
</tr> </tr>
</thea> </thea>
<tr> <tr>
<td></td> <td></td>
<td align="center"> <td align="center">
@@ -621,7 +621,6 @@
</div> </div>
<br /> <br />
<asp:UpdatePanel ID="UPDivCodigoSeriePSRecepcion" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPDivCodigoSeriePSRecepcion" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<div class="row" runat="server" id="DivCodigoSeriePSRecepcion" visible="false"> <div class="row" runat="server" id="DivCodigoSeriePSRecepcion" visible="false">
@@ -647,46 +646,47 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="row">
<asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional"> <div class="col-md-12">
<ContentTemplate> <asp:UpdatePanel runat="server" ID="UpDatosRecepcion" UpdateMode="Conditional">
<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"> <ContentTemplate>
<Columns> <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">
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center"> <Columns>
<%--<HeaderTemplate> <asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
<%--<HeaderTemplate>
<input type="checkbox" id="ChkAll" onclick="CheckAll();" /> <input type="checkbox" id="ChkAll" onclick="CheckAll();" />
</HeaderTemplate>--%> </HeaderTemplate>--%>
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="Chk" Checked="true" runat="server"></asp:CheckBox> <asp:CheckBox ID="Chk" Checked="true" runat="server"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0"></asp:TextBox> <asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0"></asp:TextBox>
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." /> <ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,##0.00####}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" /> <asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" /> <asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" />
<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="15%" />
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false"> <asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
<ItemTemplate> <ItemTemplate>
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true"> <asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
</asp:DropDownList> </asp:DropDownList>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<br /> <br />
<br /> <br />
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div>
</div>
</ContentTemplate> </ContentTemplate>
</ajax:TabPanel> </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 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) 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 FolioVirtualSalida = ObjInventario.Folio
@@ -883,42 +889,51 @@ Partial Class Inventarios_TraspasoAlmacen
End If End If
End If End If
AlmacenEntrada = If(ChkTransitorio.Checked, DdlAlmacenTransitorio.SelectedValue.ToEntero, DdlAlmacenDestino.SelectedValue.ToEntero)
Dim TipoMovimientoEntrada As Integer = 27
If Not ChkTransitorio.Checked Then TipoMovimientoEntrada = 27 Else TipoMovimientoEntrada = 9
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
TextoError = "Ocurrió un error al generar el movimiento de entrada"
ErrorMovInv = True
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim Cont As Integer = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
Cont += 1
Next
End If
End If
'AGREGAMOS LA ENTRADA 'AGREGAMOS LA ENTRADA
If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO If Not ChkTransitorio.Checked Then 'SI NO ES TRANSITORIO SE HACE LA RECEPCION DE INMEDIATO
If Not ErrorMovInv Then 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()
CveMovimientoEntrada = ObjInventario.AddMovimiento(AlmacenEntrada, TipoMovimientoEntrada, 1, Fecha, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, -1, -1,
Observaciones:=TxtObservaciones.Text.Trim, Recibio:=If(ChkTransitorio.Checked, TxtResponsable.Text.Trim, "-1"),
CveAlmacenDestino:=If(ChkTransitorio.Checked, DdlAlmacenDestino.SelectedValue.ToEntero, -1), CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G3")
FolioEntrada = ObjInventario.Folio
If CveMovimientoEntrada <= 0 Then
TextoError = "Ocurrió un error al generar el movimiento de entrada"
ErrorMovInv = True
Else
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim Cont As Integer = 0
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
Dim CostoEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, Dr("PU").ToString.ToDecimal())
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, CostoEntrada, CveAF:=Dr("CveAF").ToString.ToEntero, CveSeccionAlmacen:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, FechaCaducidad:=Dr("FechaCaducidad").ToString.ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, Observaciones:=Dr("Observaciones").ToString) Then
ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de entrada"
Exit For
End If
Cont += 1
Next
End If
End If
'VIRTUAL ENTRADA 'VIRTUAL ENTRADA
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
'Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenDestino.SelectedValue}").ToEntero() '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 FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing Dim dtvirtual As DataTable = Nothing
@@ -984,7 +999,7 @@ Partial Class Inventarios_TraspasoAlmacen
If Not ErrorMovInv Then If Not ErrorMovInv Then
Dim Concepto As String = TxtObservaciones.Text Dim Concepto As String = TxtObservaciones.Text
If Concepto = "" Then Concepto = "Traspaso" If Concepto = "" Then Concepto = "Traspaso"
Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/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 If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
Dim resultado As DataTable = ObjInventario.DtResultados Dim resultado As DataTable = ObjInventario.DtResultados
@@ -995,7 +1010,7 @@ Partial Class Inventarios_TraspasoAlmacen
ErrorMovInv = True ErrorMovInv = True
End If 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 ErrorMovInv = True
End If End If
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/> 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))) 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 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/><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))) 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 End If
@@ -1666,7 +1681,15 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then 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 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 If CveAlmacenVirtual > 0 Then
@@ -1733,7 +1756,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Mensaje As StringBuilder = New StringBuilder 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("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()' 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) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)
@@ -1794,11 +1817,16 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate Dim Fecha As Date = TxtFechaRecepcion.Text.ToDate
Dim CveAlmacenEntrada As Integer = GvDatosRecepcion.Rows(0).DataKey("CveAlmacenDestino").ToEntero 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() 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 '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") Observaciones:=TxtObservacionesRecepcion.Text.Trim, CveAlmacenDestino:=GvDatosRecepcion.Rows(0).DataKey("CveAlmacenSalida").ToEntero, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="TA/G1")
Folio = ObjInventario.Folio Folio = ObjInventario.Folio
@@ -1831,11 +1859,18 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For Exit For
End If End If
Dim PrecioEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, gvr.DataKey("PU").ToString.ToDecimal) 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 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 ErrorMovInv = True
TextoError = "Ocurrió un error al guardar los movimientos de salida" TextoError = "Ocurrió un error al guardar los movimientos de salida"
Exit For Exit For
End If End If
ElseIf cantidadDisponibleValidacion < 0 Then ElseIf cantidadDisponibleValidacion < 0 Then
TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString) TextoError = String.Format("Se exceden la cantidad disponibles para {0}", gvr.DataKey("PS").ToString)
ErrorMovInv = True ErrorMovInv = True
@@ -1846,7 +1881,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Concepto As String = TxtObservacionesRecepcion.Text Dim Concepto As String = TxtObservacionesRecepcion.Text
If Concepto = "" Then Concepto = "Recepción Traspaso" If Concepto = "" Then Concepto = "Recepción Traspaso"
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/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 resultado As DataTable = ObjInventario.DtResultados
Dim importe As Decimal = resultado.SUMD("Total").RoundSQL Dim importe As Decimal = resultado.SUMD("Total").RoundSQL
@@ -1870,7 +1905,12 @@ Partial Class Inventarios_TraspasoAlmacen
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen= {DdlAlmacenRecepcion.SelectedValue}").ToEntero() 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 If CveAlmacenVirtual > 0 Then
@@ -1878,7 +1918,7 @@ Partial Class Inventarios_TraspasoAlmacen
FolioVirtualEntrada = ObjInventario.Folio FolioVirtualEntrada = ObjInventario.Folio
Dim dtvirtual As DataTable = Nothing 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 dtvirtual = ObjInventario.DtResultados
For Each RowVirtual As DataRow In dtvirtual.Rows For Each RowVirtual As DataRow In dtvirtual.Rows
Dim CvePS = RowVirtual("CvePS").ToString().ToEntero() Dim CvePS = RowVirtual("CvePS").ToString().ToEntero()
@@ -1974,7 +2014,7 @@ Partial Class Inventarios_TraspasoAlmacen
Dim Mensaje As StringBuilder = New StringBuilder 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("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()' 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) Alert(Mensaje.ToString, TipoMensaje.MsgInformacion)

View File

@@ -167,9 +167,17 @@
<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="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> <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> </legend>
<div class="text-right" style="margin-top: -5px!important"> <div style="width:100%" class="row">
<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;" /> <div class="col-md-1 text-left" style="margin-top: -5px!important;width:50%">
<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 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> </div>
<asp:UpdatePanel ID="UPPCxP" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPPCxP" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -185,6 +193,7 @@
<asp:BoundField DataField="PorPagado" DataFormatString="{0:N2}%" HeaderText="% Abonado" /> <asp:BoundField DataField="PorPagado" DataFormatString="{0:N2}%" HeaderText="% Abonado" />
<asp:BoundField DataField="Saldo" DataFormatString="{0:N2}" HeaderText="Saldo" /> <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="PorXPagar" DataFormatString="{0:N2}%" HeaderText="% A Cobrar" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="AplicaNC" HeaderText="Aplica NC" ItemStyle-Width="10%" />
</Columns> </Columns>
</asp:GridView> </asp:GridView>
@@ -205,9 +214,17 @@
<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="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> <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> </legend>
<div class="text-right"> <div style="width:100%" class="row">
<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;" /> <div class="col-md-1 text-left" style="margin-top: -5px!important;width:50%">
<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 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> </div>
<asp:UpdatePanel ID="UPGvCxPHistorial" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UPGvCxPHistorial" runat="server" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
@@ -223,6 +240,7 @@
<asp:BoundField DataField="PorPagado" DataFormatString="{0:N2}%" HeaderText="% Abonado" /> <asp:BoundField DataField="PorPagado" DataFormatString="{0:N2}%" HeaderText="% Abonado" />
<asp:BoundField DataField="FolioPago" DataFormatString="{0:N2}" HeaderText="Cheque" /> <asp:BoundField DataField="FolioPago" DataFormatString="{0:N2}" HeaderText="Cheque" />
<asp:BoundField DataField="PorXPagar" DataFormatString="{0:N2}%" HeaderText="% A Cobrar" /> <asp:BoundField DataField="PorXPagar" DataFormatString="{0:N2}%" HeaderText="% A Cobrar" />
<asp:BoundField DataField="AplicaNC" HeaderText="Aplica NC" ItemStyle-Width="10%"/>
</Columns> </Columns>
</asp:GridView> </asp:GridView>

View File

@@ -250,6 +250,7 @@ Partial Class Portal_PortalProveedor
If Not IsPostBack Then If Not IsPostBack Then
CveProveedor = UsuarioActual.CveProveedor CveProveedor = UsuarioActual.CveProveedor
CargarSucursalesProveedor()
Session("FileUpload") = "" Session("FileUpload") = ""
ViewState("Orden") = "" ViewState("Orden") = ""
@@ -355,7 +356,7 @@ Partial Class Portal_PortalProveedor
Private Sub CargaCxP() Private Sub CargaCxP()
Dim ObjMovtos As New ClsMovimientos() 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") GvCxP.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act'", "Moneda,OrdenVencimiento, FechaVencimiento")
@@ -1817,5 +1818,30 @@ Partial Class Portal_PortalProveedor
#End Region #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 End Class

View File

@@ -321,7 +321,7 @@ Partial Class Sistemas_PopUpAddUsuario
If Row.DataKey("CveProcesoAcceso") <> "" Then If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados '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 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 HuboError = True
Exit For Exit For
End If End If
@@ -329,7 +329,7 @@ Partial Class Sistemas_PopUpAddUsuario
Else Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario '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 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 HuboError = True
Exit For Exit For
End If End If
@@ -340,7 +340,7 @@ Partial Class Sistemas_PopUpAddUsuario
If Row.DataKey("CveProcesoAcceso") <> "" Then If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados '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 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 HuboError = True
Exit For Exit For
End If End If
@@ -348,7 +348,7 @@ Partial Class Sistemas_PopUpAddUsuario
Else Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario '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 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 HuboError = True
Exit For Exit For
End If End If
@@ -490,7 +490,7 @@ Partial Class Sistemas_PopUpAddUsuario
If Row.DataKey("CveProcesoAcceso") <> "" Then If Row.DataKey("CveProcesoAcceso") <> "" Then
'checo si el permiso que tiene es del rol, de ser así, nada más actualizo los denegados '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 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 HuboError = True
Exit For Exit For
End If End If
@@ -498,7 +498,7 @@ Partial Class Sistemas_PopUpAddUsuario
Else Else
'permisos que el rol, no le está otorgando, y serán únicos para el usuario '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 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 HuboError = True
Exit For Exit For
End If End If

Binary file not shown.

View File

@@ -11,6 +11,7 @@ using GemBox.Spreadsheet;
using System.Data; using System.Data;
using System.Text; using System.Text;
using System.Collections.Generic; using System.Collections.Generic;
using ClosedXML;
public class TareasJam : IHttpHandler 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 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 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 try
{ {
if (File.Exists(RutaProductos)) if (File.Exists(RutaProductos))
@@ -91,14 +99,14 @@ public class TareasJam : IHttpHandler
} }
string FTPServer = "ftp://127.0.0.1/"; //string FTPServer = "ftp://127.0.0.1/";
string TFPUsr = "Toor"; //string TFPUsr = "Toor";
string FTPPass = "agj-3500"; //string FTPPass = "agj-3500";
//string FTPServer = "ftp://us2.hostedftp.com"; string FTPServer = "ftp://us2.hostedftp.com";
//string TFPUsr = "agrojam"; string TFPUsr = "agrojam";
//string FTPPass = "A12345678"; string FTPPass = "A12345678";
bool ErrorProceso = false; bool ErrorProceso = false;
@@ -158,7 +166,7 @@ public class TareasJam : IHttpHandler
try 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[1].ColumnName = "Nombre del Producto";
DTProductos.Columns[2].ColumnName = "Presentación"; DTProductos.Columns[2].ColumnName = "Presentación";
DTProductos.AcceptChanges(); DTProductos.AcceptChanges();
@@ -196,9 +204,6 @@ public class TareasJam : IHttpHandler
DataTable dtCloned = DTVentas.Clone(); DataTable dtCloned = DTVentas.Clone();
dtCloned.Columns[3].DataType = typeof(string); dtCloned.Columns[3].DataType = typeof(string);
@@ -210,7 +215,7 @@ public class TareasJam : IHttpHandler
DTVentas = dtCloned; DTVentas = dtCloned;
foreach (DataRow dRow in DTVentas.Rows) 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; dRow[3] = tmpDate;
} }
@@ -228,106 +233,98 @@ public class TareasJam : IHttpHandler
DTAlmacenes = dtCloned; DTAlmacenes = dtCloned;
foreach (DataRow dRow in DTAlmacenes.Rows) 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"); string tmpDate = dRow[3].ToString().ToDate().ToString("yyyy/MM/dd");
dRow[3] = tmpDate; dRow[3] = tmpDate;
} }
DTAlmacenes.AcceptChanges(); DTAlmacenes.AcceptChanges();
} }
catch (Exception e) catch (Exception e)
{ {
SBLog.AppendLine("<b>Error al renombrar columnas</b>"); SBLog.AppendLine("<b>Error al renombrar columnas</b>");
} }
} }
if (!ErrorProceso) 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(); foreach (DataRow DRow in DTVentas.Rows)
var worksheetAlmacenes = workbookAlmacenes.Worksheets.Add("Almacenes");
worksheetAlmacenes.InsertDataTable(DTAlmacenes, new InsertDataTableOptions()
{ {
ColumnHeaders = true, wsVentas.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
StartRow = 0 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) foreach (DataRow DRow in DTAlmacenes.Rows)
{ {
wsAlmacenes.Cell(count, 1).Value = "'" + DRow["Code"].ToString();
//contador++; wsAlmacenes.Cell(count, 2).Value = DRow["Quantity"].ToString();
//var cell = worksheetAlmacenes.Cells[contador, 3]; wsAlmacenes.Cell(count, 3).Value = DRow["Description"].ToString();
//cell.Style.WrapText = true; wsAlmacenes.Cell(count, 4).Value = "'" + DRow["Stock Date"].ToString();
count++;
} }
//worksheetAlmacenes.Columns[3].Style.NumberFormat = "yyyy/MM/dd"; wbAlmacenes.SaveAs(RutaAlmacenes);
workbookAlmacenes.Save(RutaAlmacenes);
var workbookProductos = new ExcelFile(); var wbAClientes = new ClosedXML.Excel.XLWorkbook(FormatoClientes);
var worksheetProductos = workbookProductos.Worksheets.Add("Productos"); var wsClientes = wbAClientes.Worksheet(1);
worksheetProductos.InsertDataTable(DTProductos, new InsertDataTableOptions()
count = 2;
foreach (DataRow DRow in DTClientes.Rows)
{ {
ColumnHeaders = true, wsClientes.Cell(count, 1).Value = "'" + DRow["systemId"].ToString();
StartRow = 0 wsClientes.Cell(count, 2).Value = DRow["fiscalIdMex"].ToString();
}); wsClientes.Cell(count, 3).Value = DRow["fiscalName"].ToString();
workbookProductos.Save(RutaProductos); wsClientes.Cell(count, 4).Value = DRow["email"].ToString();
wsClientes.Cell(count, 5).Value = DRow["address.countryId"].ToString();
var workbookVentas = new ExcelFile(); wsClientes.Cell(count, 6).Value = DRow["address.stateId"].ToString();
var worksheetVentas = workbookVentas.Worksheets.Add("Ventas"); wsClientes.Cell(count, 7).Value = DRow["address.city"].ToString();
worksheetVentas.InsertDataTable(DTVentas, new InsertDataTableOptions() wsClientes.Cell(count, 8).Value = DRow["address.street1"].ToString();
{ wsClientes.Cell(count, 9).Value = DRow["address.street2"].ToString();
ColumnHeaders = true, wsClientes.Cell(count, 10).Value = "'" + DRow["address.postalCode"].ToString();
StartRow = 0 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();
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);
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;
foreach (DataRow DRow in DTProductos.Rows)
var workbookClientes = new ExcelFile();
var worksheetClientes = workbookClientes.Worksheets.Add("Clientes");
worksheetClientes.InsertDataTable(DTClientes, new InsertDataTableOptions()
{ {
ColumnHeaders = true, wsProductos.Cell(count, 1).Value = "'" + DRow["Código Producto Interno"].ToString();
StartRow = 0 wsProductos.Cell(count, 2).Value = DRow["Nombre del Producto"].ToString();
}); wsProductos.Cell(count, 3).Value = DRow["Presentación"].ToString();
workbookClientes.Save(RutaClientes);
count++;
}
wbProductos.SaveAs(RutaProductos);
/////////////////////////////////////////////////////////////
var FInfoProductos = new FileInfo(RutaProductos); var FInfoProductos = new FileInfo(RutaProductos);
var FInfoVentas = new FileInfo(RutaVentas); var FInfoVentas = new FileInfo(RutaVentas);
@@ -363,21 +360,22 @@ public class TareasJam : IHttpHandler
CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass); CargaVentas = CargarArchivos(FInfoVentas, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
if (CargaVentas) if (CargaVentas)
{ {
CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass); CargaVentas = VerificarArchivo(FInfoVentas, FInfoVentas.Length, $"{FTPServer}/Ventas", TFPUsr, FTPPass);
} }
} }
if (CargaVentas) if (CargaVentas)
{ {
SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>"); SBLog.AppendLine($"<tr><td>Ventas</td><td>ok</td></tr>");
}else }
else
{ {
SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>"); SBLog.AppendLine($"<tr><td>Ventas</td><td>Error carga</td></tr>");
} }
if (CargaProductos & CargaVentas) if (CargaProductos & CargaVentas)
{ {
CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass); CargaClientes = CargarArchivos(FInfoClientes, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
if (CargaClientes) if (CargaClientes)
{ {
CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass); CargaClientes = VerificarArchivo(FInfoClientes, FInfoClientes.Length, $"{FTPServer}/Clientes", TFPUsr, FTPPass);
@@ -387,12 +385,13 @@ public class TareasJam : IHttpHandler
if (CargaClientes) if (CargaClientes)
{ {
SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>"); SBLog.AppendLine($"<tr><td>Clientes</td><td>ok</td></tr>");
}else }
else
{ {
SBLog.AppendLine($"<tr><td>Clientes</td><td>Error carga</td></tr>"); 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); CargaAlmacenes = CargarArchivos(FInfoAlmacenes, $"{FTPServer}/Stock", TFPUsr, FTPPass);
if (CargaClientes) if (CargaClientes)
@@ -404,7 +403,8 @@ public class TareasJam : IHttpHandler
if (CargaAlmacenes) if (CargaAlmacenes)
{ {
SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>"); SBLog.AppendLine($"<tr><td>Almacenes</td><td>ok</td></tr>");
}else }
else
{ {
SBLog.AppendLine($"<tr><td>Almacenes</td><td>Error carga</td></tr>"); 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()}" ; 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); MandaCorreo(Cuerpo, Respuesta, RutaProductos, RutaVentas, RutaClientes, RutaAlmacenes);
return Respuesta; return Respuesta;
@@ -458,13 +456,6 @@ public class TareasJam : IHttpHandler
Clientes.Ruta = RutaClientes; Clientes.Ruta = RutaClientes;
Almacenes.Ruta = RutaAlmacenes; 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(Productos);
ListaArchivos.Add(Ventas); ListaArchivos.Add(Ventas);
ListaArchivos.Add(Clientes); ListaArchivos.Add(Clientes);
@@ -472,8 +463,8 @@ public class TareasJam : IHttpHandler
ClsSisMail Correo = new ClsSisMail(); ClsSisMail Correo = new ClsSisMail();
// string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx"; string Para = "julian@adssistemas.mx;rene.molina@adssistemas.mx;oscar.irigoyen@adssistemas.mx";
string Para = "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")}"; 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); 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 ) private bool CargarArchivos(FileInfo FInfo, string FTPServer, string FTPUsr, string FTPPass )
{ {
bool Respuesta; bool Respuesta;
//var FInfo = new FileInfo(RutaArchivo);
if (FInfo.Exists) if (FInfo.Exists)
{ {
FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}"); FtpWebRequest request = (FtpWebRequest)WebRequest.Create($"{FTPServer}/{FInfo.Name}");

View File

@@ -378,7 +378,7 @@
<i></i> <i></i>
</div> </div>
<div class="form-group form-md-line-input"> <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> <label for="<%= TxtCodigo.ClientID.ToString()%>">Código:</label>
</div> </div>
<div class="form-group form-md-line-input"> <div class="form-group form-md-line-input">

View File

@@ -847,6 +847,12 @@ Partial Class Clientes
CargaDatosCRM() CargaDatosCRM()
End If End If
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then ' Funcionalidad Es Distribuidor
DivEsDistribuidor.Visible = True
DivCargoUsado.Visible = True
DivBonificacionUsado.Visible = True
End If
ChecaPermiteCredito() ChecaPermiteCredito()
@@ -1114,9 +1120,9 @@ Partial Class Clientes
Select Case HdnCuenta.Value Select Case HdnCuenta.Value
Case "1" Case "1"
CargaDdlCuentasContables(DdlCtaContableClientes, UsuarioActual.Empresa.Funcionalidad(246).ToEntero) CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).ToEntero
Case "2" Case "2"
CargaDdlCuentasContables(DdlCtaContableAnticipos, UsuarioActual.Empresa.Funcionalidad(237).ToEntero) CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).ToEntero
Case "3" Case "3"
CargaDdlCuentasContables(DdlCtaContableRetIVA, -1) CargaDdlCuentasContables(DdlCtaContableRetIVA, -1)
Case "4" Case "4"
@@ -1124,13 +1130,13 @@ Partial Class Clientes
Case "5" Case "5"
CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1) CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1)
Case "6" Case "6"
CargaDdlCuentasContables(DdlCtaContableCompClientes, UsuarioActual.Empresa.Funcionalidad(248).ToEntero) CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).ToEntero
Case "7" Case "7"
CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1) CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1)
Case "8" Case "8"
CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, UsuarioActual.Empresa.Funcionalidad(247).ToEntero) CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).ToEntero
Case "9" Case "9"
CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, UsuarioActual.Empresa.Funcionalidad(542).ToEntero) CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).ToEntero
End Select End Select
UpFiscalContable.Update() UpFiscalContable.Update()
@@ -2752,7 +2758,7 @@ Partial Class Clientes
'HLRemision.HRef = $"/Ventas/Ventas.aspx?CveRemision={e.Row.DBCampo("CveVenta")}" '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")) 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")) 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() UpSendMail.Update()
@@ -9076,7 +9082,14 @@ Partial Class Clientes
e.Row.FCCheckBox("ChkBonificacion").Visible = False e.Row.FCCheckBox("ChkBonificacion").Visible = False
Else Else
e.Row.FCCheckBox("ChkBonificacion").Checked = False e.Row.FCCheckBox("ChkBonificacion").Checked = False
e.Row.FCCheckBox("ChkBonificacion").Visible = True '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 End If
Else Else
@@ -10191,5 +10204,17 @@ Partial Class Clientes
End If End If
ObjBancos.Dispose() ObjBancos.Dispose()
End Sub 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 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" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%--Necesario para el modal que no se cierra--%> <%--Necesario para el modal que no se cierra--%>
@@ -2374,25 +2374,25 @@
<label for="<%= TxtLocalidadCliente.ClientID.ToString()%>">Localidad:</label> <label for="<%= TxtLocalidadCliente.ClientID.ToString()%>">Localidad:</label>
</div> </div>
</div> </div>
<div id="DivEstadoPaisCliente" runat="server" visible="false" class="row" style="padding-left: 16px;"> <div id="DivEstadoPaisCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
<div class="form-group form-md-line-input input-iconright col-xs-6"> <div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:DropDownList ID="DdlSATPais" runat="server" CssClass="form-control input-sm select2me" OnSelectedIndexChanged="DdlSATPais_SelectedIndexChanged" AutoPostBack="true"> <asp:DropDownList ID="DdlSATPais" runat="server" CssClass="form-control input-sm select2me" OnSelectedIndexChanged="DdlSATPais_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
<asp:ListItem Value="MEX" Text="México" Selected="True"></asp:ListItem> <asp:ListItem Value="MEX" Text="México" Selected="True"></asp:ListItem>
<asp:ListItem Value="USA" Text="USA"></asp:ListItem> <asp:ListItem Value="USA" Text="USA"></asp:ListItem>
<asp:ListItem Value="CAN" Text="Canada"></asp:ListItem> <asp:ListItem Value="CAN" Text="Canada"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVSATPais" runat="server" InitialValue="-1" ControlToValidate="DdlSATPais" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pais''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVSATPais" runat="server" InitialValue="-1" ControlToValidate="DdlSATPais" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pais''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= DdlSATPais.ClientID.ToString()%>">Pais:</label> <label for="<%= DdlSATPais.ClientID.ToString()%>">Pais:</label>
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-6"> <div class="form-group form-md-line-input input-iconright col-xs-6">
<asp:DropDownList ID="DdlEstadoSAT" DataTextField="NombreEstado" DataValueField="CveSATEstado" runat="server" CssClass="form-control input-sm select2me"> <asp:DropDownList ID="DdlEstadoSAT" DataTextField="NombreEstado" DataValueField="CveSATEstado" runat="server" CssClass="form-control input-sm select2me">
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RfvDdlEstadoSAT" runat="server" InitialValue="-1" ControlToValidate="DdlEstadoSAT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estado''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RfvDdlEstadoSAT" runat="server" InitialValue="-1" ControlToValidate="DdlEstadoSAT" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Estado''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCliente"></asp:RequiredFieldValidator>
<label for="<%= DdlEstadoSAT.ClientID.ToString()%>">Estado:</label> <label for="<%= DdlEstadoSAT.ClientID.ToString()%>">Estado:</label>
</div> </div>
</div> </div>
<div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;"> <div id="DivCorreoCuentaCliente" runat="server" visible="false" class="row" style="padding-left: 16px;">
@@ -2768,7 +2768,7 @@
</div> </div>
<div class="col-md-6" align="right" id="divagregrarotrops" runat="server"> <div class="col-md-6" align="right" id="divagregrarotrops" runat="server">
<label>Agregar otro Producto:</label> <label>Agregar otro Producto:</label>
<asp:CheckBox ID="ChkAgregar" runat="server" Checked="true" /> <asp:CheckBox ID="ChkAgregar" runat="server" Checked="true" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -2960,16 +2960,19 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row" style="margin-top: 17px;"> <div class="row">
<div class="col-md-2"> <div class="col-md-12">
<div class="form-group form-md-line-input input-iconright"> <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>--%> <%--<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>--%> <%--<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> </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"> <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: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> <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> <label for="<%= TxtImporteAjuste.ClientID.ToString()%>">Importe:</label>
</div> </div>
</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" /> <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>
</div> </div>
@@ -2991,7 +2994,7 @@
<div class="modal-footer"> <div class="modal-footer">
<asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional"> <asp:UpdatePanel ID="UpAgregar" runat="server" UpdateMode="Conditional">
<ContentTemplate> <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" /> <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> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
</ContentTemplate> </ContentTemplate>
@@ -3018,12 +3021,12 @@
let regex = new RegExp("^[0-9]+$"); let regex = new RegExp("^[0-9]+$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
//MARCA MOTOBATERIAS //MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") { } else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
let regex = new RegExp("^[1X]"); let regex = new RegExp("^[1X]");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
//AUTOMOTRIZ-ACUMULADORES //AUTOMOTRIZ-ACUMULADORES
} else { } else {
let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$"); let regex = new RegExp("^[1X]|^[0-9][A-HJ-M][0-3][0-9][A-Z][ACEN][2-5]$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
@@ -3045,12 +3048,12 @@
var regex = new RegExp("^\d{4}$|^[A-L][0-9][1-9A-Z][A-HJ-M]$"); var regex = new RegExp("^\d{4}$|^[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
//MARCA MOTOBATERIAS //MARCA MOTOBATERIAS
} else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") { } else if ((CveMarca == "1090" || CveMarca == "1091") || CveClasificacion == "20517") {
var regex = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$"); var regex = new RegExp("^[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);
return; return;
//AUTOMOTRIZ-ACUMULADORES //AUTOMOTRIZ-ACUMULADORES
} else { } else {
var regex = new RegExp("^[X]|^[x]|[A-L][0-9][1-9A-Z][A-HJ-M]$"); var regex = new RegExp("^[X]|^[x]|[A-L][0-9][1-9A-Z][A-HJ-M]$");
arguments.IsValid = regex.test(arguments.Value); arguments.IsValid = regex.test(arguments.Value);

View File

@@ -2306,6 +2306,10 @@ Partial Class PV
DdlEstadoSAT.DataBind() DdlEstadoSAT.DataBind()
DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa = 140 AndAlso ClaveSATPais = "MEX" Then
DdlEstadoSAT.SelectedValueExist("26")
End If
End Sub End Sub
Protected Sub DdlSATPais_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlSATPais_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEstados(DdlSATPais.SelectedValue) CargaEstados(DdlSATPais.SelectedValue)
@@ -2768,6 +2772,18 @@ Partial Class PV
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString) DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor.ToString)
End If 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 End Sub
Private Sub ObtenerFechaVencimientoCER() Private Sub ObtenerFechaVencimientoCER()
Try Try
@@ -4655,6 +4671,15 @@ Partial Class PV
RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta") RegistraScript("$('#DivAddVenta').modal({backdrop: 'static', keyboard: false});", "EdicionVenta")
End Sub End Sub
Protected Sub LnkAgregarPS_Click(sender As Object, e As EventArgs) 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 AgregarPS() Then
If ChkAjuste.Checked Then GuardaAjuste() If ChkAjuste.Checked Then GuardaAjuste()
AddPolizaVirtual(DdlPS.SelectedValue.ToEntero()) AddPolizaVirtual(DdlPS.SelectedValue.ToEntero())
@@ -6174,6 +6199,46 @@ Partial Class PV
CveTamanio = drPS("CveTamaño").ToString.ToEntero CveTamanio = drPS("CveTamaño").ToString.ToEntero
End If 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) TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then If DTBCIUsados IsNot Nothing AndAlso CveTamanio > 0 Then
@@ -6455,6 +6520,12 @@ Partial Class PV
UpAjuste.Update() UpAjuste.Update()
End If End If
ObjAcumuladores.Dispose() 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 Sub
#End Region #End Region
@@ -6935,4 +7006,68 @@ Partial Class PV
ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF") ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
End Sub 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 End Class

View File

@@ -424,10 +424,10 @@
</td> </td>
</tr>--%> </tr>--%>
<tr runat="server" id="trsucursalciente" visible="false"> <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> <asp:Label ID="LblSucursal" runat="server" Text="Sucursal"></asp:Label>
:</b></td> :</b></td>
<td align="left" > <td align="left">
<div class="row align-items-start"> <div class="row align-items-start">
<div class="col-md-10"> <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"> <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>
</div> </div>
</td> </td>
<td align="left" > <td align="left">
<b> <b>
<asp:Label ID="LtlTitleRFCSucursal" runat="server" Text=""></asp:Label></b> <asp:Label ID="LtlTitleRFCSucursal" runat="server" Text=""></asp:Label></b>
</td> </td>
<td align="left" > <td align="left">
<asp:Label ID="LtlRFCSucursal" runat="server" Text=""></asp:Label> <asp:Label ID="LtlRFCSucursal" runat="server" Text=""></asp:Label>
</td> </td>
</tr> </tr>
@@ -1575,7 +1575,7 @@
</div> </div>
</div> </div>
</div> </div>
<asp:HiddenField ID="HdnTotalRNC" runat="server" ClientIDMode="Static" Value="0" />
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
</div> </div>
@@ -4316,23 +4316,18 @@
<div class="portlet-title"> <div class="portlet-title">
<div class="caption font-green"> <div class="caption font-green">
<%--<i class="fa fa-users font-green"></i>--%>
<span class="caption-subject bold uppercase">Bitacora</span> <span class="caption-subject bold uppercase">Bitacora</span>
</div> </div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <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="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: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> <asp:Literal ID="LtlTareaNueva" runat="server"></asp:Literal>
<UserControl:TareaNueva runat="server" id="TareaNueva" /> <UserControl:TareaNueva runat="server" id="TareaNueva" />
<script> function OnAddedTareaNueva() { <script>
$('.btnupEventoBitacora').click(); function OnAddedTareaNueva() {
} $('.btnupEventoBitacora').click();
}
</script> </script>
</div> </div>
</div> </div>
@@ -6240,8 +6235,8 @@
</div> </div>
<div class="col-md-10"> <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: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> <%-- <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> <ajax:ValidatorCalloutExtender ID="VCEVentaUsado" runat="server" HighlightCssClass="vco" TargetControlID="RFVVentaUsado" Width="350px"></ajax:ValidatorCalloutExtender>--%>
</div> </div>
</div> </div>
</div> </div>
@@ -6298,14 +6293,14 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" /> <asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
<div class="row"> <div class="row" id="DivSMU" runat="server" visible="false">
<div class="col-md-12"> <div class="col-md-12">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server"> <table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<tr align="right"> <tr align="right">
@@ -6800,7 +6795,7 @@
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
<asp:TextBox ID="TxtImporte" CssClass="myvalue" runat="server" Width="75px" /> <asp:TextBox ID="TxtImporte" CssClass="myvalue ImportesRNCCargo" runat="server" Width="75px" />
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
@@ -6877,23 +6872,24 @@
</asp:GridView> </asp:GridView>
</div> </div>
</div> </div>
</div> <div class="row">
</div> <div class="col-md-12">
<div class="row"> <table border="0" rules="none" class="well TextTab" style="float: right;" runat="server">
<div class="col-md-12"> <tr align="right">
<table border="0" rules="none" class="well TextTab" style="float: right;" runat="server"> <td style="border: 1px none white"><b>Saldo Maximo Utilizable.:</b></td>
<tr align="right"> <td>
<td style="border: 1px none white"><b>Saldo Maximo Utilizable.:</b></td> <asp:Label ID="LblSaldoMaximoBonificacion" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00"></asp:Label></td>
<td> <td align="right">&nbsp;
<asp:Label ID="LblSaldoMaximoBonificacion" ClientIDMode="Static" runat="server" Style="text-align: right;" Text="0.00"></asp:Label></td> </td>
<td align="right">&nbsp; </tr>
</td> </table>
</tr> </div>
</table> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<asp:HiddenField ID="HdnSaldoMaximoUsados" runat="server" ClientIDMode="Static" Value="0" />
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="CancelarAplicarDescNC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button> <button id="CancelarAplicarDescNC" type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
@@ -7084,13 +7080,116 @@
} }
function CalculaSaldoRNCChk(TxtImporte, Saldo, Chk) { 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) { if (Chk.checked) {
TxtImporte.value = FormatoNumero(Saldo, 2); TxtImporte.value = FormatoNumero(Saldo, 2);
} else { } else {
TxtImporte.value = ""; TxtImporte.value = "";
} }
} }
function LimitaSaldoRNCChk(TxtImporte, Saldo) { function LimitaSaldoRNCBonChk(TxtImporte, Saldo) {
var Importe = 0; var Importe = 0;
if (TxtImporte.value.includes('.')) { if (TxtImporte.value.includes('.')) {
@@ -7543,6 +7642,7 @@
var totalDebito = ToDouble($get("TxtImporteDebito").value); var totalDebito = ToDouble($get("TxtImporteDebito").value);
var totalCheque = ToDouble($get("TxtImporteCheque").value); var totalCheque = ToDouble($get("TxtImporteCheque").value);
var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value); var totalTransferencia = ToDouble($get("TxtImporteTransferencia").value);
var totalRNC = ToDouble($get("HdnTotalRNC").value);
var TotalOtrosContado = 0; var TotalOtrosContado = 0;
@@ -7552,7 +7652,7 @@
} }
} catch (e) { } } 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); var totalVenta = ToDouble($get('TxtTotal').value);
if (total > totalVenta) { if (total > totalVenta) {
@@ -7561,7 +7661,7 @@
$get("TxtCambio").value = "0.00"; $get("TxtCambio").value = "0.00";
} }
$get("TxtImporteContado").value = total; $get("TxtImporteContado").value = total - totalRNC;
} }
// **************************************************************************************************************************************************************************** // ****************************************************************************************************************************************************************************
@@ -8100,23 +8200,23 @@
function ConvertirPesos(ChkConvertirDoctoPesos) { function ConvertirPesos(ChkConvertirDoctoPesos) {
//LIMPIA //LIMPIA
$('#<%= LtlTotalConvertido.ClientID %>').text(''); $('#<%= LtlTotalConvertido.ClientID %>').text('');
$("#TrConversionPesosTexto").hide(); $("#TrConversionPesosTexto").hide();
//CALCULA //CALCULA
if (ChkConvertirDoctoPesos.checked) { if (ChkConvertirDoctoPesos.checked) {
ConvertirDllsPesos(); ConvertirDllsPesos();
} }
}
function ConvertirPesosDlls() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
$('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
$("#TrConversionDolaresTexto").show();
} }
function ConvertirDolares(ChkConvertirDolares) { function ConvertirPesosDlls() {
//LIMPIA var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
$('#<%= LblDolaresConvertidos.ClientID %>').text(''); $('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
$("#TrConversionDolaresTexto").show();
}
function ConvertirDolares(ChkConvertirDolares) {
//LIMPIA
$('#<%= LblDolaresConvertidos.ClientID %>').text('');
$("#TrConversionDolaresTexto").hide(); $("#TrConversionDolaresTexto").hide();
//CALCULA //CALCULA

View File

@@ -1791,6 +1791,15 @@ Partial Class Ventas
End Set End Set
End Property 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 #End Region
'#Region "AuxiliarConta" '#Region "AuxiliarConta"
@@ -1985,6 +1994,7 @@ Partial Class Ventas
DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat") DdlSATPS.setEsWebService(True) : DdlSATPS.Attributes.Add("data-metodo", "getpssat")
DivPSSAT.Visible = True DivPSSAT.Visible = True
SetValues() SetValues()
CvePresupuesto = 0 CvePresupuesto = 0
@@ -2150,6 +2160,7 @@ Partial Class Ventas
'Carga Venta 'Carga Venta
If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then If Request("CveVenta") IsNot Nothing AndAlso IsNumeric(Request("CveVenta")) AndAlso Request("CveVenta").ToEntero() > 0 Then
ViewState("CveVenta") = Request("CveVenta") ViewState("CveVenta") = Request("CveVenta")
If CargaVenta() Then If CargaVenta() Then
'DdlSucursal.Enabled = False 'DdlSucursal.Enabled = False
@@ -2684,7 +2695,7 @@ Partial Class Ventas
TrPedido.Visible = False TrPedido.Visible = False
' TrKilometrajeTxt.Visible = True ' TrKilometrajeTxt.Visible = True
End If 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 End If
@@ -3671,6 +3682,10 @@ Partial Class Ventas
DdlEstadoSAT.DataBind() DdlEstadoSAT.DataBind()
DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlEstadoSAT.Items.Insert(0, New ListItem("Seleccione", "-1"))
If UsuarioActual.CveEmpresa = 140 AndAlso ClaveSATPais = "MEX" Then
DdlEstadoSAT.SelectedValueExist("26")
End If
End Sub End Sub
Protected Sub DdlSATPais_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlSATPais_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaEstados(DdlSATPais.SelectedValue) CargaEstados(DdlSATPais.SelectedValue)
@@ -4065,7 +4080,9 @@ Partial Class Ventas
ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString() ViewState("FolioFiscal") = DbRowVenta("FolioFiscal").ToString()
LblSerie.Text = DbRowVenta("Serie").ToString()
SerieVenta = DbRowVenta("Serie").ToString()
LblSerie.Text = SerieVenta
ViewState("Serie") = DbRowVenta("Serie").ToString() ViewState("Serie") = DbRowVenta("Serie").ToString()
ViewState("Folio") = DbRowVenta("Folio").ToString().ToEntero() ViewState("Folio") = DbRowVenta("Folio").ToString().ToEntero()
TxtFolio.Text = DbRowVenta("Folio").ToString() TxtFolio.Text = DbRowVenta("Folio").ToString()
@@ -5399,7 +5416,7 @@ Partial Class Ventas
DdlVentaUsado.DataBind() DdlVentaUsado.DataBind()
DdlVentaUsado.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlVentaUsado.Items.Insert(0, New ListItem("No Aplica", "-1"))
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
End If End If
@@ -8305,6 +8322,7 @@ Partial Class Ventas
If ObjFolios.GetFolios(factura.TipoDocto, UsuarioActual.CveEmpresa) Then 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())) Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue.ToEntero()))
If DT.Rows.Count > 0 Then If DT.Rows.Count > 0 Then
factura.Serie = DT.Rows(0)("Serie").ToString()
factura.Folio = DT.Rows(0)("FActual").ToString().ToEntero() factura.Folio = DT.Rows(0)("FActual").ToString().ToEntero()
Else Else
ProcesoCorrecto = False 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.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.VentaDesglosaIEPS = Me.VentaDesglosaIEPS
'ObjFactura.RefDocto = TxtDocto.Text.Trim 'ObjFactura.RefDocto = TxtDocto.Text.Trim
If EsCreaApartirDe Then
ViewState("EstablecioFolio") = False
End If
'si es cancelacion, debe de conservar el folio actual '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) 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
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 If ErrorList.Count = 0 AndAlso ObjVentas.CveVenta > 0 Then
factura.CveVenta = ObjVentas.CveVenta factura.CveVenta = ObjVentas.CveVenta
@@ -10104,6 +10122,10 @@ Partial Class Ventas
factura.Timbre.Comprobante.Serie = ObjVentas.Serie factura.Timbre.Comprobante.Serie = ObjVentas.Serie
factura.Timbre.Comprobante.Folio = ObjVentas.Folio.ToString() 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 factura.TipoDocto = "Egs" AndAlso NuevaFactura = 1 Then
If DtVentasNC Is Nothing Then If DtVentasNC Is Nothing Then
InicializaDTVentasNC() InicializaDTVentasNC()
@@ -10169,7 +10191,7 @@ Partial Class Ventas
'PedidoA' 'PedidoA'
If ObjVentas.CveVenta > 0 And CvePedidoA > 0 And DdlTipoComprobante.SelectedValue.Contiene("Rem") Then 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") ErrorList.Add("Ocurrió un error al actualizar el estatus del pedidoA")
End If End If
End If End If
@@ -15061,7 +15083,11 @@ Partial Class Ventas
'ViewState("NumAprobacion") = CLng(DT.Rows(0)("Aprobacion").ToString()) 'ViewState("NumAprobacion") = CLng(DT.Rows(0)("Aprobacion").ToString())
'ViewState("FechaAprobacion") = DT.Rows(0)("FechaAprobacion").ToString().ToDate 'ViewState("FechaAprobacion") = DT.Rows(0)("FechaAprobacion").ToString().ToDate
ViewState("FolioActual") = DT.Rows(0)("FActual").ToString() ViewState("FolioActual") = DT.Rows(0)("FActual").ToString()
LblSerie.Text = DT.Rows(0)("Serie").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() TxtFolio.Text = DT.Rows(0)("FActual").ToString()
BtnCrearApartirDe.Enabled = True BtnCrearApartirDe.Enabled = True
BtnEmitirImprimir.Visible = True BtnEmitirImprimir.Visible = True
@@ -15116,7 +15142,13 @@ Partial Class Ventas
'ViewState("SubProyectoPorcentajeIVA") = dr("IVA") 'ViewState("SubProyectoPorcentajeIVA") = dr("IVA")
ViewState("TipoFormato") = dr("TipoFormato") ViewState("TipoFormato") = dr("TipoFormato")
ViewState("Serie") = dr("Serie") ViewState("Serie") = dr("Serie")
LblSerie.Text = dr("Serie").ToString()
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 If SerieXML <> "" Then LblSerie.Text = SerieXML
Dim CveSubProyecto As Integer = GetSubProyectoSucursal() Dim CveSubProyecto As Integer = GetSubProyectoSucursal()
If CveSubProyecto > 0 Then CargaSubProyecto(CveSubProyecto) If CveSubProyecto > 0 Then CargaSubProyecto(CveSubProyecto)
@@ -21285,11 +21317,6 @@ Partial Class Ventas
Return Return
End If 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 Dim CveMetodoInventario As Integer = 0
If ChkRequiereSerie.Checked Then CveMetodoInventario = 5 Else CveMetodoInventario = 1 If ChkRequiereSerie.Checked Then CveMetodoInventario = 5 Else CveMetodoInventario = 1
@@ -21667,18 +21694,18 @@ Partial Class Ventas
End If End If
'SALIDA GENERAL 'SALIDA GENERAL
CveMovimientoEntradaGeneral = ObjInventario.AddMovimiento(CveAlmacenOrigenContrato, 3, 1, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:="Vta/E7") CveMovimientoSalidaGeneral = 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 CveMovimientoSalidaGeneral > 0 Then
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaConsignacion, UsuarioActual.CveEmpresa) Then If ObjInventario.GetMovimientosDetalle(CveMovimientoEntradaGeneral, UsuarioActual.CveEmpresa) Then
For Each Dr As DataRow In ObjInventario.DtResultados.Rows 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 Return False
End If End If
Next Next
End If End If
'GENERAR PREPOLIZA '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 Return False
End If End If
Else Else
@@ -22990,12 +23017,14 @@ Partial Class Ventas
Exit Sub Exit Sub
End If End If
If DeshabilitarAplicarNotaDeCredito(LblRFC.Text) Then
Exit Sub
End If
AplicaNCMasiva = False AplicaNCMasiva = False
AplicaNC = False AplicaNC = False
LBNotaCredito.Visible = True LBNotaCredito.Visible = True
'LkNotaCredito.Visible = False 'LkNotaCredito.Visible = False
DeshabilitarAplicarNotaDeCredito(LblRFC.Text)
TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNC();") TxtNCPorcentaje.Attributes.Add("onkeyup", "CalculaImporteNC();")
TxtNCImporte.Attributes.Add("onkeyup", "CalculaPorcentajeNC();") TxtNCImporte.Attributes.Add("onkeyup", "CalculaPorcentajeNC();")
@@ -23083,19 +23112,26 @@ Partial Class Ventas
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2") Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
GvRemisionesNC.DataBind() GvRemisionesNC.DataBind()
GvRemisionesNCBon.DataBind() GvRemisionesNCBon.DataBind()
If CveVentaUsado > 0 Then If CveVentaUsado > 0 Then
DivSMU.Visible = True
Dim FacUsado As New Modelos.Factura(UsuarioActual, CveVentaUsado, UsuarioActual.CveEmpresa) 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 Else
LtlSMU.Text = String.Format("{0:N2}", 0) DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
UpDescNC.Update()
End Sub End Sub
Private Sub CargaDescRNC() Private Sub CargaDescRNC()
Dim DtNC As DataTable = Nothing Dim DtNC As DataTable = Nothing
@@ -23112,12 +23148,16 @@ Partial Class Ventas
Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2") Me.TmpDTRNCBonificacionesCliente = DtNC.FiltraParametros("TipoRNC = 2")
Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("ImporteBonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("IVABonificacion", GetType(Decimal))
Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer)) Me.TmpDTRNCBonificacionesCliente.Columns.Add("CveVentaRNCCargo", GetType(Integer))
GvDescNCCargos.DataBind() GvDescNCCargos.DataBind()
GvDescNCBonificaciones.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() UpDescNC.Update()
End Sub End Sub
@@ -23130,28 +23170,52 @@ Partial Class Ventas
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone() TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If End If
Dim CveVentaBonificacion As Integer = -1 Dim ListaBon As New List(Of VentasBonificaciones)
Dim ImporteBonificacion As Decimal = 0 Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then
Dim RowMovto As DataRow = ObjAcum.DtResultados.FiltroPrimero("") DtBon = ObjAcum.DtResultados.Copy()
CveVentaBonificacion = RowMovto("CveVentaBonificacion").ToString().ToEntero()
ImporteBonificacion = RowMovto("ImporteBonificacion").ToString().ToDecimal()
End If End If
End Using End Using
If CveVentaBonificacion > 0 Then If DtBon IsNot Nothing Then
Dim RowBonificacion As DataRow = Me.TmpDTRNCBonificacionesCliente.FiltroPrimero($"CveVenta = {CveVentaBonificacion}") Dim queryBonificacion = From dr In DtBon
RowBonificacion("ImporteBonificacion") = ImporteBonificacion Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero
RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").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)
}
If ChkAplicarRNC.Checked Then For Each bon In queryBonificacion
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray) SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
Else ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Dim RowEliminar As DataRow = Me.TmpDTRNCBonificacionesSeleccionadas.Select($"CveVenta = {CveVentaBonificacion}").FirstOrDefault() Next
TmpDTRNCBonificacionesSeleccionadas.Rows.Remove(RowEliminar) SbFiltro.Remove(SbFiltro.Length - 1, 1)
End If 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
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If End If
@@ -23165,7 +23229,7 @@ Partial Class Ventas
GvDescNCBonificaciones.DataSource = TmpDTRNCBonificacionesSeleccionadas GvDescNCBonificaciones.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvDescNCBonificaciones.DataBind() 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() UpDescNC.Update()
@@ -23178,28 +23242,52 @@ Partial Class Ventas
TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone() TmpDTRNCBonificacionesSeleccionadas = Me.TmpDTRNCBonificacionesCliente.Clone()
End If End If
Dim CveVentaBonificacion As Integer = -1 Dim ListaBon As New List(Of VentasBonificaciones)
Dim ImporteBonificacion As Decimal = 0 Dim DtBon As DataTable = Nothing
Dim SbFiltro As New StringBuilder()
SbFiltro.Append("CveVenta IN(")
Using ObjAcum As New ClsAcumuladores Using ObjAcum As New ClsAcumuladores
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, CveVentaRNCCargo:=GvRow.DataKey("CveVenta").ToEntero()) Then
Dim RowMovto As DataRow = ObjAcum.DtResultados.FiltroPrimero("") DtBon = ObjAcum.DtResultados.Copy()
CveVentaBonificacion = RowMovto("CveVentaBonificacion").ToString().ToEntero()
ImporteBonificacion = RowMovto("ImporteBonificacion").ToString().ToDecimal()
End If End If
End Using End Using
If CveVentaBonificacion > 0 Then If DtBon IsNot Nothing Then
Dim RowBonificacion As DataRow = Me.TmpDTRNCBonificacionesCliente.FiltroPrimero($"CveVenta = {CveVentaBonificacion}") Dim queryBonificacion = From dr In DtBon
RowBonificacion("ImporteBonificacion") = ImporteBonificacion Group By CveVentaBonificacion = dr("CveVentaBonificacion").ToString().ToEntero
RowBonificacion("CveVentaRNCCargo") = GvRow.DataKey("CveVenta").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)
}
If ChkAplicarRNC.Checked Then For Each bon In queryBonificacion
TmpDTRNCBonificacionesSeleccionadas.Rows.Add(RowBonificacion.ItemArray) SbFiltro.AppendFormat("'{0}',", bon.CveVentaBonificacion)
Else ListaBon.Add(New VentasBonificaciones() With {.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero(), .CveVentaBonificacion = bon.CveVentaBonificacion, .ImporteBonificacion = bon.ImporteBonificacion, .IVABonificacion = bon.IVABonificacion})
Dim RowEliminar As DataRow = Me.TmpDTRNCBonificacionesSeleccionadas.Select($"CveVenta = {CveVentaBonificacion}").FirstOrDefault() Next
TmpDTRNCBonificacionesSeleccionadas.Rows.Remove(RowEliminar) SbFiltro.Remove(SbFiltro.Length - 1, 1)
End If 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
For Each RowEliminar In Me.TmpDTRNCBonificacionesSeleccionadas.Select(SbFiltro.ToString())
RowEliminar.Delete()
Next
End If
Next
End If End If
@@ -23213,7 +23301,7 @@ Partial Class Ventas
GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas GvRemisionesNCBon.DataSource = TmpDTRNCBonificacionesSeleccionadas
GvRemisionesNCBon.DataBind() 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() UpModalRemisionesNC.Update()
@@ -23226,8 +23314,8 @@ Partial Class Ventas
End Sub End Sub
Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound Protected Sub GvDescNCBonificaciones_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDescNCBonificaciones.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then 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.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCBonChk({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.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCBonChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble});")
End If End If
End Sub End Sub
@@ -23239,8 +23327,8 @@ Partial Class Ventas
End Sub End Sub
Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound Protected Sub GvRemisionesNC_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvRemisionesNC.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then 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.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({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.FCTextBox("TxtImporte").Attributes.Add("onkeyup", $"LimitaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
End If End If
End Sub End Sub
@@ -23575,7 +23663,7 @@ Partial Class Ventas
Dim UltimoRenglonRNC As Integer = 1 Dim UltimoRenglonRNC As Integer = 1
For Each RowUsado As DataRow In RNC.DtDetalle.Rows 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() Dim Obs = RowUsado("CodigoPS").ToString()
If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then If Not String.IsNullOrEmpty(TxtNCObservaciones.Text.Trim()) Then
@@ -23620,7 +23708,7 @@ Partial Class Ventas
For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows For Each RowCargo As DataRow In RNCCargo.DtDetalle.Rows
Dim PorcentajeCargo = (RowCargo("Total").ToString().ToDecimal() - RowCargo("Descuento").ToString().ToDecimal() + RowCargo("ImporteIVA").ToString().ToDecimal() + RowCargo("ImporteIEPS").ToString().ToDecimal() - RowCargo("ImporteRetIVA").ToString().ToDecimal() - RowCargo("ImporteRetISR").ToString().ToDecimal()) / RNCCargo.Total 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() Dim Obs = RowCargo("CodigoPS").ToString()
@@ -26510,29 +26598,21 @@ Partial Class Ventas
End If End If
End Sub 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 Dim Resultado As Boolean = True
If ClienteEsDistribuidor Then If ClienteEsDistribuidor AndAlso factura.TipoDocto.Contiene("Ing") Then
'If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
' Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero()
Dim ObjAcum As New ClsAcumuladores(SqlTransaccion) Dim ObjAcum As New ClsAcumuladores(SqlTransaccion)
Dim CvePSPSA As Integer = UsuarioActual.Empresa.Funcionalidad(533).ToEntero
For Each drow As DataRow In TmpDT.Rows For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString().ToEntero() > 0 Then If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
Dim TempDTAcums = GlobalDTAcumTamaños.FiltraParametros("CvePSCargo = " & drow("CvePS").ToString()) If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToEntero, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
If TempDTAcums IsNot Nothing AndAlso TempDTAcums.Rows.Count > 0 Then UsuarioActual.CveEmpresa, 0D, "") Then
If Not ObjAcum.DistribuidorMovtosAdd(CveCliente, drow("Cantidad").ToString().ToEntero(), drow("CveTamaño").ToString().ToEntero(), 2, CveVenta, UsuarioActual.CveUsuario, Resultado = False
UsuarioActual.CveEmpresa, 0D, "") Then Exit For
Resultado = False
Exit For
End If
Else
Resultado = True
End If End If
TempDTAcums.Dispose()
End If End If
Next Next
Else Else
@@ -26650,81 +26730,96 @@ Partial Class Ventas
RegistraScript("$('#ModalAplicarDescuentoNC').modal('show'); ") RegistraScript("$('#ModalAplicarDescuentoNC').modal('show'); ")
End Sub End Sub
Protected Sub BtnAplicarDesc_Click(sender As Object, e As EventArgs) Protected Sub BtnAplicarDesc_Click(sender As Object, e As EventArgs)
Dim CveSATNC = "84111506" Try
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0) Dim CveSATNC = "84111506"
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
If DrPS Is Nothing Then If DrPS Is Nothing Then
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
Exit Sub Exit Sub
End If
AplicaNCMasiva = True
If ListaNCDesc Is Nothing Then
ListaNCDesc = New List(Of Modelos.Factura)
Else
ListaNCDesc.Clear()
End If
If ListaNCBonificacion Is Nothing Then
ListaNCBonificacion = New List(Of Modelos.Factura)
Else
ListaNCBonificacion.Clear()
End If
Dim TotalRemNCAplicado As Decimal = 0
For Each GvRow As GridViewRow In GvDescNCCargos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCDesc.Clear()
Exit Sub
End If
ListaNCDesc.Add(RemNC)
End If
End If End If
Next
Dim LimiteUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() AplicaNCMasiva = True
'VERIFICA EL LIMITE DE LOS USADOS If ListaNCDesc Is Nothing Then
If TotalRemNCAplicado > LimiteUsados Then ListaNCDesc = New List(Of Modelos.Factura)
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) Else
ListaNCDesc.Clear() ListaNCDesc.Clear()
Exit Sub
End If
For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCBonificacion.Clear()
Exit Sub
End If
ListaNCBonificacion.Add(RemNC)
End If
End If End If
Next
LblDescuentosRNC.Text = TotalRemNCAplicado.FormatoNumero If ListaNCBonificacion Is Nothing Then
LblTotalNC.Text = (TxtTotal.Text.ToDecimal() - TotalRemNCAplicado).FormatoNumero ListaNCBonificacion = New List(Of Modelos.Factura)
Else
ListaNCBonificacion.Clear()
End If
Dim CvePS = DrPS("CvePS").ToString().ToEntero() Dim TotalRemNCAplicado As Decimal = 0
For Each GvRow As GridViewRow In GvDescNCCargos.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCDesc.Clear()
Exit Sub
End If
ListaNCDesc.Add(RemNC)
End If
End If
Next
Dim LimiteUsados As Decimal = LblSaldoMaximoUsados.Text.Trim().ToDecimal()
'VERIFICA EL LIMITE DE LOS USADOS
If TotalRemNCAplicado > LimiteUsados 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
For Each GvRow As GridViewRow In GvDescNCBonificaciones.Rows
If GvRow.RowType = DataControlRowType.DataRow Then
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim RemNC As New Modelos.Factura(UsuarioActual, GvRow.DataKey("CveVenta").ToEntero(), UsuarioActual.CveEmpresa)
RemNC.TotalRemNCAplicado = GvRow.FCTextBox("TxtImporte").Text.ToDecimal()
RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVentaRNCCargo").ToEntero()
TotalRemNCAplicado += RemNC.TotalRemNCAplicado
If RemNC.TotalRemNCAplicado <= 0 Then
Alert($"Debe asignar un importe en la siguiente remisión: <b>{RemNC.SerieFolio}</b>", TipoMensaje.MsgAdvertencia)
ListaNCBonificacion.Clear()
Exit Sub
End If
ListaNCBonificacion.Add(RemNC)
End If
End If
Next
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
AplicarNC(CvePS, True)
UpPS.Update() UpPS.Update()
@@ -27198,14 +27293,15 @@ Partial Class Ventas
ObjVentas.Dispose() ObjVentas.Dispose()
End Sub 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 If UsuarioActual.CveEmpresa = 119 AndAlso RFC.Contiene("XAXX010101000", "XEXX010101000") Then
LBNotaCredito.Visible = False LBNotaCredito.Visible = False
UpnTools.Update() UpnTools.Update()
Retorno = True
End If End If
Return Retorno
End Sub End Function
#Region "Auxiliar" #Region "Auxiliar"
Private Sub CargarSaldoAuxiliar(CveCliente As Integer) Private Sub CargarSaldoAuxiliar(CveCliente As Integer)
@@ -27326,12 +27422,11 @@ Partial Class Ventas
#End Region #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 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 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 Dim Retorno As Boolean = False
Using ObjGPS As New ClsGPS 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 End Using
Return Retorno Return Retorno
End Function End Function