Merge branch 'master' of http://192.168.10.111:8383/SIG
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1244,7 +1244,7 @@ Public Class ClsVentas
|
||||
Public Function GetRepVentas(FechaI As Date, FechaF As Date, FechaIEjec As Date, FechaFEjec As Date, CveCliente As Integer, CveSubProyectoEjecucion As Integer,
|
||||
CveVendedor As String, CveUsuario As Integer, CveEstatus As String, IVA As String, CveEmpresa As Integer, Gpo As Integer, Optional TipoDocto As String = "-1",
|
||||
Optional CveProyecto As Integer = -1, Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveUsuarioConsulta As Integer = -1,
|
||||
Optional CveClienteClasificacion As Integer = -1) As Boolean
|
||||
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasGetRep")
|
||||
|
||||
@@ -1269,6 +1269,7 @@ Public Class ClsVentas
|
||||
.Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
|
||||
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||
End With
|
||||
|
||||
Try
|
||||
@@ -1372,7 +1373,7 @@ Public Class ClsVentas
|
||||
Vendedor As String, CveUsuario As Integer, CveEstatus As String, FechaI As Date, FechaF As Date, CveCorte As Integer, TipoDocto As String,
|
||||
CveSubProyectoEjecucion As Integer, CveEmpresa As Integer, FechaIEjec As Date, FechaFEjec As Date, Optional CveProyecto As Integer = -1,
|
||||
Optional CveSubProyecto As String = "-1", Optional TipoCambio As Integer = 1, Optional TCEspecifico As Decimal = -1, Optional CveMoneda As Integer = -1, Optional CveUsuarioConsulta As Integer = -1,
|
||||
Optional CveClienteClasificacion As Integer = -1) As Boolean
|
||||
Optional CveClienteClasificacion As Integer = -1, Optional CveCondicionesPago As Integer = -1) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_Vta_VentasGetRepDetalle")
|
||||
|
||||
@@ -1402,6 +1403,7 @@ Public Class ClsVentas
|
||||
.Add("@CveMoneda", SqlDbType.Int).Value = CveMoneda
|
||||
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
|
||||
.Add("@CveClienteClasificacion", SqlDbType.Int).Value = CveClienteClasificacion
|
||||
.Add("@CveCondicionesPago", SqlDbType.Int).Value = CveCondicionesPago
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -4512,7 +4512,7 @@ Namespace Modelos
|
||||
Private Function GeneraMovimientosVirtuales(CveVenta As Integer, ByRef ObjInventario As ClsInventarios) As Boolean
|
||||
Dim ErrorCancelar As Boolean = False
|
||||
Try
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
Dim CveMovimientoSalida As Integer = -1
|
||||
Dim CveAlmacenVirutal As Integer = -1
|
||||
|
||||
@@ -4535,7 +4535,7 @@ Namespace Modelos
|
||||
End If
|
||||
|
||||
If DtMovtosDev IsNot Nothing AndAlso DtMovtosDev.Rows.Count > 0 Then
|
||||
Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenVirutal, 18, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1)
|
||||
Dim CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacenVirutal, 18, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
For Each RowUsado As DataRow In DtMovtosDev.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
|
||||
<asp:HiddenField runat="server" ID="HdnFechasComprasVinculadas" Value="-1" ClientIDMode="Static" />
|
||||
|
||||
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,NoDeducible">
|
||||
<asp:GridView ID="GvCxP" GridLines="None" CssClass="table table-hover table-advance Widthall" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Cuentas por Pagar pendientes" DataKeyNames="CveCompra,FechaCompra,Proveedor,SerieFolio,Original,SubTotal,IVA,RetIVA,RetISR,IdCtaContProveedores,IdCtaContProveedoresSIG,CvePrePoliza,IdPoliza,CveRetIVAConcepto,CveRetISRConcepto,IVAPorcentaje,NoDeducible,IVADeducible,IVANoDeducible">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
|
||||
@@ -626,8 +626,6 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
ImportePagar = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
ImporteOriginal = gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
|
||||
Dim ConceptoDeducible As Integer = If(gvr.DataKey("NoDeducible").ToDecimal > 0, 280, 19)
|
||||
|
||||
If SaldoCheque > 0 Then
|
||||
ImporteMovto = If(ImportePagar > SaldoCheque, SaldoCheque, ImportePagar)
|
||||
CvePrePolizaPago = CvePrePolizaIERegistrado
|
||||
@@ -698,9 +696,18 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 14, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAXAcreditar > 0, IdCtaContIVAXAcreditar, IdCtaIVAxAcreditar), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAxAcreditar, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
MsgError = "Detalle"
|
||||
End If
|
||||
|
||||
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVA").ToDecimal * PorcentajePago
|
||||
'Agrego el IVA
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, ConceptoDeducible, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
MsgError = "Detalle"
|
||||
End If
|
||||
End If
|
||||
|
||||
If gvr.DataKey("NoDeducible") Then
|
||||
|
||||
Dim ImporteNOIVA As Decimal = gvr.DataKey("IVANoDeducible").ToDecimal * PorcentajePago
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, ImporteNOIVA, Referencia, 280, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEPago, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePrePolizaOriginal:=CvePrePolizaPagoOriginal, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
MsgError = "Detalle"
|
||||
End If
|
||||
End If
|
||||
@@ -1006,7 +1013,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
End If
|
||||
|
||||
'Agrego el IVA
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, False, gvr.DataKey("IVA").ToDecimal, Referencia, ConceptoDeducible, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal), ImporteMX:=(gvr.DataKey("IVA").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, False, gvr.DataKey("IVA").ToDecimal, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal), ImporteMX:=(gvr.DataKey("IVA").ToDecimal) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
MsgError = "Detalle"
|
||||
End If
|
||||
End If
|
||||
@@ -1017,7 +1024,7 @@ Partial Class Compras_ReembolsosComprobaciones
|
||||
End If
|
||||
|
||||
'Agrego el IVA
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, ConceptoDeducible, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaExcedente, False, gvr.DataKey("IVA").ToDecimal * PorcentajePago, Referencia, 19, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, If(IdCtaContIVAAcreditable > 0, IdCtaContIVAAcreditable, IdCtaIVAAcreditable), -1, CveIE:=CveIEExcedente, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.DataKey("IVA").ToDecimal * PorcentajePago), ImporteMX:=(gvr.DataKey("IVA").ToDecimal * PorcentajePago) * tipoCambio, CveCuenta:=CveCuentaIVAAcreditable, CvePersonal:=CvePersonal, PorcentajeImpuesto:=PorcentajeIVA) Then
|
||||
MsgError = "Detalle"
|
||||
End If
|
||||
End If
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4472
Empresas/146/Formatos/Remision.rdlc
Normal file
4472
Empresas/146/Formatos/Remision.rdlc
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -141,7 +141,7 @@
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="row" style="padding-top: 10px; position: relative;">
|
||||
|
||||
<asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate" style="max-width: 80px;">Producto:</asp:Label>
|
||||
<asp:Label runat="server" ID="LblPS" CssClass="col-md-1 truncate" Style="max-width: 80px;">Producto:</asp:Label>
|
||||
<div class="col-md-2 " style="min-width: 250px; max-width: 300px;">
|
||||
<ADS:Dropdownlost ID="ddlProducto2" runat="server" AutoPostBack="False" DataTextField="PSCodigo" IncluyeTodos="false" DataValueField="CvePS" CssClassDdl="select2me" CssStyle="width: 250px; "></ADS:Dropdownlost>
|
||||
</div>
|
||||
@@ -181,37 +181,49 @@
|
||||
<asp:CheckBox ID="ChkAgruparAlmacen" CssClass="md-checksd" runat="server" Text="Agrupar Almacenes" Checked="False" Visible="false" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Clasificación:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate">Unidad Medida:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:CheckBox ID="cbEntrada" CssClass="md-checksd" runat="server" Text="Entrada" Checked="True" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:CheckBox ID="cbSalida" CssClass="md-checksd" runat="server" Text="Salida" Checked="True" />
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#ModalTiposAlmacen">Filtrar tipos almacén</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="DivSerie" runat="server" visible="false">
|
||||
<label class="col-md-1 truncate" style="max-width: 80px;">Serie:</label>
|
||||
<div class="col-md-1 ">
|
||||
<asp:TextBox ID="TxtSerie" CssClass="form-control input-sm" runat="server" Width="90px" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" <%= IIf(chkexpand.Checked = True, "", "style=""display:none;""")%>>
|
||||
<div class="row">
|
||||
<label class="col-md-1 truncate">Clasificación:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClasificacion" CssClass="select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="Clasificacion" DataValueField="CveClasificacion" Class="table-group-action-input form-control input-inline input-small input-sm" Style="width: 250px !important;">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 truncate">Unidad Medida:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlUnidadMedida" runat="server" CssClass="select2me " Style="width: 200px !important;" DataTextField="UnidadMedida" DataValueField="CveUnidadMedida">
|
||||
<asp:ListItem Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<asp:CheckBox ID="cbEntrada" CssClass="md-checksd" runat="server" Text="Entrada" Checked="True" />
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<asp:CheckBox ID="cbSalida" CssClass="md-checksd" runat="server" Text="Salida" Checked="True" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#ModalTiposAlmacen">Filtrar tipos almacén</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
@@ -307,8 +319,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<asp:Literal ID="LtIndicador_Mensaje" Text="" runat="server" />
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6 text-left">
|
||||
<asp:Literal ID="LtIndicador_MensajeSerie" Text="" runat="server" />
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<asp:Literal ID="LtIndicador_Mensaje" Text="" runat="server" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
@@ -408,6 +425,7 @@
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
</asp:GridView>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:AsyncPostBackTrigger ControlID="btConsultar" EventName="Click" />
|
||||
@@ -454,7 +472,7 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,378 +1,402 @@
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_Kardex
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
'Public Property DtKardex As DataTable
|
||||
' Get
|
||||
' Return CType(ViewState("DtKardex"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DtKardex") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private Property CveMovimiento() As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveMovimiento")), -1, CInt(ViewState("CveMovimiento")))
|
||||
End Get
|
||||
Set
|
||||
ViewState("CveMovimiento") = Value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TxtFechaI.Text = Now.AddMonths(-1).ToShortDateString
|
||||
TxtFechaF.Text = Now.ToShortDateString
|
||||
CargaCombos()
|
||||
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 13, 66) Then
|
||||
GvM.Columns(6).Visible = True ' SerieLote
|
||||
GvM.Columns(7).Visible = True ' FCaducidad
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(258) Then GvM.Columns(1).Visible = True
|
||||
|
||||
ddlAlmacen.SelectedValue = If(Request("CveAlmacen") IsNot Nothing, Request("CveAlmacen").ToString, "-1")
|
||||
|
||||
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString
|
||||
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString
|
||||
|
||||
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
|
||||
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
|
||||
End If
|
||||
|
||||
CargaPermisos()
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_Kardex
|
||||
Inherits ClsPaginas
|
||||
#Region "P R O P I E D A D E S"
|
||||
'Public Property DtKardex As DataTable
|
||||
' Get
|
||||
' Return CType(ViewState("DtKardex"), DataTable)
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("DtKardex") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
Private Property CveMovimiento() As Integer
|
||||
Get
|
||||
Return If(IsNothing(ViewState("CveMovimiento")), -1, CInt(ViewState("CveMovimiento")))
|
||||
End Get
|
||||
Set
|
||||
ViewState("CveMovimiento") = Value
|
||||
End Set
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
TxtFechaI.Text = Now.AddMonths(-1).ToShortDateString
|
||||
TxtFechaF.Text = Now.ToShortDateString
|
||||
CargaCombos()
|
||||
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
If Not UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 13, 66) Then
|
||||
GvM.Columns(6).Visible = True ' SerieLote
|
||||
GvM.Columns(7).Visible = True ' FCaducidad
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(258) Then GvM.Columns(1).Visible = True
|
||||
|
||||
ddlAlmacen.SelectedValue = If(Request("CveAlmacen") IsNot Nothing, Request("CveAlmacen").ToString, "-1")
|
||||
|
||||
If Request("FechaI") IsNot Nothing AndAlso Request("FechaI") <> "-1" Then TxtFechaI.Text = Request("FechaI").ToString
|
||||
If Request("FechaF") IsNot Nothing AndAlso Request("FechaF") <> "-1" Then TxtFechaF.Text = Request("FechaF").ToString
|
||||
|
||||
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
|
||||
If Request("CvePS") IsNot Nothing And Request("CvePS") <> "-1" Then
|
||||
ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1")
|
||||
ddlProducto_SelectedIndexChanged(ddlProducto2, EventArgs.Empty)
|
||||
End If
|
||||
|
||||
CargaPermisos()
|
||||
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
LblPS.ToolTip = ddlProducto2.SelectedValue
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
|
||||
Private Sub CargaPermisos()
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
GvM.Columns(11).Visible = TienePermisoImportes ' costo
|
||||
GvM.Columns(12).Visible = TienePermisoImportes ' importe
|
||||
GvM.Columns(14).Visible = TienePermisoImportes ' valor
|
||||
End Sub
|
||||
|
||||
Private Function isWithFamily() As Boolean
|
||||
Return (UsuarioActual.CveEmpresa = 66)
|
||||
End Function
|
||||
Private Sub CargaCombos()
|
||||
|
||||
CargaFuncionalidad105()
|
||||
CargaPS()
|
||||
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
ddlAlmacen.DataBind()
|
||||
If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValueExist(Request("CveAlmacen").ToString)
|
||||
CargaClasificaciones()
|
||||
|
||||
CBLTiposAlmacen.DataSource = GlobalDTTipoAlmacen(-1)
|
||||
CBLTiposAlmacen.DataBind()
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
If item.Text = "Entrega Adelantado" Then
|
||||
item.Selected = False
|
||||
Else
|
||||
item.Selected = True
|
||||
End If
|
||||
|
||||
Next
|
||||
End Sub
|
||||
Private Sub CargaFuncionalidad105()
|
||||
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If ddlProducto2.UsaWebService Then
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
|
||||
'DdlClasificacion.AutoPostBack = False
|
||||
Else
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaClasificaciones()
|
||||
|
||||
Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing, Request("CveClasificacion").ToString, "-1")
|
||||
|
||||
If isWithFamily() Then
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
Else
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
||||
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
||||
' DdlClasificacion.DataBind()
|
||||
End If
|
||||
Else
|
||||
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
||||
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
||||
' DdlClasificacion.DataBind()
|
||||
End If
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
End If
|
||||
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", "Clasificacion")
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " CARGA PS "
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS()
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
If Not ddlProducto2.UsaWebService Then
|
||||
Dim Filtro = If(DdlClasificacion.SelectedValue.ToEntero > 0, String.Format("CveClasificacion={0} And CveTipoPS=2", DdlClasificacion.SelectedValue), "CveTipoPS=2")
|
||||
ddlProducto2.ddl.Items.Clear()
|
||||
ddlProducto2.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(Filtro, "PSCodigo")
|
||||
ddlProducto2.DataBind()
|
||||
ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
Else
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
ddlProducto2.SelectedText = ""
|
||||
ddlProducto2.SelectedValue = "-1"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
|
||||
DdlUnidadMedida.Items.Clear()
|
||||
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1)
|
||||
DdlUnidadMedida.DataBind()
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#Region " INICIALIZA VALORES "
|
||||
|
||||
Private Sub CargaPermisos()
|
||||
Dim TienePermisoImportes As Boolean = UsuarioActual.TienePermisoProceso(201)
|
||||
GvM.Columns(11).Visible = TienePermisoImportes ' costo
|
||||
GvM.Columns(12).Visible = TienePermisoImportes ' importe
|
||||
GvM.Columns(14).Visible = TienePermisoImportes ' valor
|
||||
End Sub
|
||||
|
||||
Private Function isWithFamily() As Boolean
|
||||
Return (UsuarioActual.CveEmpresa = 66)
|
||||
End Function
|
||||
Private Sub CargaCombos()
|
||||
|
||||
CargaFuncionalidad105()
|
||||
CargaPS()
|
||||
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
ddlAlmacen.DataBind()
|
||||
If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValueExist(Request("CveAlmacen").ToString)
|
||||
CargaClasificaciones()
|
||||
|
||||
CBLTiposAlmacen.DataSource = GlobalDTTipoAlmacen(-1)
|
||||
CBLTiposAlmacen.DataBind()
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
If item.Text = "Entrega Adelantado" Then
|
||||
item.Selected = False
|
||||
Else
|
||||
item.Selected = True
|
||||
End If
|
||||
|
||||
Next
|
||||
End Sub
|
||||
Private Sub CargaFuncionalidad105()
|
||||
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If ddlProducto2.UsaWebService Then
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
|
||||
'DdlClasificacion.AutoPostBack = False
|
||||
Else
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargaClasificaciones()
|
||||
|
||||
Dim CveClasificacion = If(Request("CveClasificacion") IsNot Nothing, Request("CveClasificacion").ToString, "-1")
|
||||
|
||||
If isWithFamily() Then
|
||||
|
||||
DdlClasificacion.DataSource = GlobalDTSubFamilias(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
|
||||
Else
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
||||
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
||||
' DdlClasificacion.DataBind()
|
||||
End If
|
||||
Else
|
||||
If ObjClasificaciones.GetClasificacionesExistencias(UsuarioActual.CveEmpresa) Then
|
||||
DdlClasificacion.DataSource = ObjClasificaciones.DtResultados
|
||||
' DdlClasificacion.DataBind()
|
||||
End If
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
End If
|
||||
|
||||
'DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", "Clasificacion")
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " CARGA PS "
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS()
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
If Not ddlProducto2.UsaWebService Then
|
||||
Dim Filtro = If(DdlClasificacion.SelectedValue.ToEntero > 0, String.Format("CveClasificacion={0} And CveTipoPS=2", DdlClasificacion.SelectedValue), "CveTipoPS=2")
|
||||
ddlProducto2.ddl.Items.Clear()
|
||||
ddlProducto2.DataSource = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros(Filtro, "PSCodigo")
|
||||
ddlProducto2.DataBind()
|
||||
ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
Else
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacion.SelectedValue)
|
||||
ddlProducto2.SelectedText = ""
|
||||
ddlProducto2.SelectedValue = "-1"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
|
||||
DdlUnidadMedida.Items.Clear()
|
||||
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1)
|
||||
DdlUnidadMedida.DataBind()
|
||||
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
|
||||
If UsuarioActual.CveUsuario = 100 Then
|
||||
LblPS.ToolTip = ddlProducto2.SelectedValue
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
|
||||
If CveProducto > 0 Then
|
||||
Dim DtTemp = CargarKardex(CveProducto)
|
||||
If DtTemp IsNot Nothing Then
|
||||
'CARGA INDICADORES
|
||||
If UsuarioActual.TienePermisoProceso(201) Then
|
||||
DivIndicadores.Visible = True
|
||||
|
||||
Dim Dr = DtTemp.FiltroUltimo("")
|
||||
Dim TC = If(GlobalTipoCambio(Now) > 0, GlobalTipoCambio(Now), 1)
|
||||
|
||||
LtIndicador_Existencia.Text = Dr("Existencias").ToString.FormatoNumero()
|
||||
|
||||
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
|
||||
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
|
||||
|
||||
Dim CostoPromedio = If(Dr("Existencias").ToString.ToDouble > 0, Dr("ValorInventario").ToString.ToDouble / Dr("Existencias").ToString.ToDouble, 0)
|
||||
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
|
||||
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
|
||||
|
||||
LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
|
||||
LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
|
||||
|
||||
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
|
||||
|
||||
UpIndicadores.Update()
|
||||
|
||||
GvM.Attributes.Add("data-heighterror", "430")
|
||||
Else
|
||||
GvM.Attributes.Add("data-heighterror", "270")
|
||||
End If
|
||||
GvM.DataSource = DtTemp
|
||||
GvM.DataBind()
|
||||
End If
|
||||
Else
|
||||
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CargarKardex(CvePS As Integer) As DataTable
|
||||
Dim dt As DataTable = Nothing
|
||||
|
||||
Dim Entrada As Boolean = cbEntrada.Checked
|
||||
Dim Salida As Boolean = cbSalida.Checked
|
||||
|
||||
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
|
||||
If CvePS > 0 Then ddlProducto2.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "")
|
||||
|
||||
Dim CveTiposAlmacen = ""
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
CveTiposAlmacen += If(item.Selected, $"{item.Value},", "")
|
||||
Next
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked) Then
|
||||
dt = ObjInventarios.DtResultados.Copy
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
Return dt
|
||||
End Function
|
||||
Protected Sub gvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.Cells(0).ToolTip = e.Row.DBCampo("FechaMovto")
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(201) Then 'PERMISO PARA VER IMPORTES
|
||||
If e.Row.DBCampo("CveCompra") <> "" Then
|
||||
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
||||
ElseIf e.Row.DBCampo("CveVenta") <> "" Then
|
||||
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"))
|
||||
ElseIf e.Row.DBCampo("CveOrdenCompra") <> "" Then
|
||||
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOrdenCompra"))
|
||||
End If
|
||||
End If
|
||||
|
||||
If GvM.Columns(1).Visible Then
|
||||
If Not e.Row.DBCampo("CveMovimiento").ToEntero > 0 Then
|
||||
e.Row.Cells(1).Text = ""
|
||||
End If
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Concepto").Contains("TOTAL GENERAL") Then
|
||||
e.Row.CssClass = "Totales"
|
||||
ElseIf e.Row.DBCampo("Concepto").Contains("SALDO INICIAL") Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " IMPRIMIR "
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
'Imprimir("Excel")
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
|
||||
Dim DtKardex As DataTable = Nothing
|
||||
DtKardex = CargarKardex(ddlProducto2.SelectedValue.ToEntero)
|
||||
If (Not IsNothing(DtKardex)) Then
|
||||
Dim params As New List(Of ReportParameter)
|
||||
If IO.File.Exists(String.Format("{0}/Formatos/Kardex.rdlc", UsuarioActual.Empresa.Ruta)) Then
|
||||
ImprimirPDF(String.Format("Empresas/{0}/Formatos/Kardex.rdlc", UsuarioActual.CveEmpresa), DtKardex, params, "ReporteKardex", reporte)
|
||||
Else
|
||||
ImprimirPDF("Empresas/Grales/Formatos/Kardex.rdlc", DtKardex, params, "Reporte Kardex", reporte)
|
||||
End If
|
||||
DtKardex.Dispose()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
Dim Movimientos As New ClsInventarios
|
||||
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
Dim Entrada As Boolean = cbEntrada.Checked
|
||||
Dim Salida As Boolean = cbSalida.Checked
|
||||
|
||||
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
|
||||
|
||||
|
||||
Dim Almacen = If(ddlAlmacen.SelectedValue = "-1", "", $" <b>Almacén:</b> {ddlAlmacen.SelectedItem.Text}")
|
||||
Dim UM = If(DdlUnidadMedida.SelectedValue = "-1", "", $" <b>Unidad de Medida:</b> {DdlUnidadMedida.SelectedItem.Text}")
|
||||
Dim FechaIn As String = If(TxtFechaI.Text = "", "", $" <b>Fecha Inicio:</b> {TxtFechaI.Text}")
|
||||
Dim FechaFn As String = If(TxtFechaF.Text = "", "", $" <b>Fecha Fin:</b> {TxtFechaF.Text}")
|
||||
Dim EntradaSalida As String = ""
|
||||
|
||||
If cbEntrada.Checked And cbSalida.Checked Then
|
||||
EntradaSalida = "Entradas y Salidas"
|
||||
ElseIf cbEntrada.Checked And cbSalida.Checked = False Then
|
||||
EntradaSalida = "Solo Entradas"
|
||||
ElseIf cbEntrada.Checked = False And cbSalida.Checked Then
|
||||
EntradaSalida = "Solo Salidas"
|
||||
End If
|
||||
|
||||
|
||||
If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, "1", DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked) Then
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim dt As DataTable = Movimientos.DtResultados
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||
params.Add(New ReportParameter("FechaFin", FechaF))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Producto", ddlProducto2.SelectedText))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {EntradaSalida}{Almacen}{UM}{FechaIn}{FechaFn}"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepKardex.rdlc", dt, params, "ReporteKardex", Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "EDITAR FECHA"
|
||||
|
||||
Protected Sub LnkEditarFecha_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
CveMovimiento = gvRow.DataKey("CveMovimiento").ToEntero
|
||||
TxtFecha.Text = gvRow.DataKey("FechaMovto").ToDateTime.ToString("yyyy-MM-ddTHH:mm")
|
||||
RegistraScript("$('#DModalEditarFecha').modal()")
|
||||
UpModalEditarFecha.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnEditarFecha_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
If ObjMov.UpdateMovimientoFecha(TxtFecha.Text.ToDateTime, CveMovimiento) Then
|
||||
Alert("Actualizada correctamente a : " + TxtFecha.Text.ToDateTime.ToString("yyyy-MM-dd HH:mm"))
|
||||
RegistraScript("$('#DModalEditarFecha').modal('hide')")
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End If
|
||||
ObjMov.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
End If
|
||||
|
||||
TxtSerie.Text = ""
|
||||
If ddlProducto2.SelectedValue.ToEntero > 0 Then
|
||||
Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, ddlProducto2.SelectedValue.ToEntero).FiltroPrimero("")
|
||||
If Dr IsNot Nothing Then
|
||||
If Dr("Inv_CveMetodoInventario").ToString.ToEntero = 5 Then
|
||||
DivSerie.Visible = True
|
||||
Else
|
||||
DivSerie.Visible = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
CargaDatos()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
|
||||
If CveProducto > 0 Then
|
||||
Dim DtTemp = CargarKardex(CveProducto)
|
||||
If DtTemp IsNot Nothing Then
|
||||
'CARGA INDICADORES
|
||||
If UsuarioActual.TienePermisoProceso(201) Then
|
||||
DivIndicadores.Visible = True
|
||||
|
||||
Dim Dr = DtTemp.FiltroUltimo("")
|
||||
Dim TC = If(GlobalTipoCambio(Now) > 0, GlobalTipoCambio(Now), 1)
|
||||
|
||||
LtIndicador_Existencia.Text = Dr("Existencias").ToString.FormatoNumero()
|
||||
|
||||
LtIndicador_ValorPesos.Text = Dr("ValorInventario").ToString.FormatoNumero()
|
||||
LtIndicador_ValorDolares.Text = (Dr("ValorInventario").ToString.ToDouble / TC).FormatoNumero()
|
||||
|
||||
Dim CostoPromedio = If(Dr("Existencias").ToString.ToDouble > 0, Dr("ValorInventario").ToString.ToDouble / Dr("Existencias").ToString.ToDouble, 0)
|
||||
LtIndicador_CPPesos.Text = CostoPromedio.FormatoNumero()
|
||||
LtIndicador_CPDolares.Text = (CostoPromedio / TC).FormatoNumero()
|
||||
|
||||
LtIndicador_UCPesos.Text = Dr("UltimoCosto").ToString.FormatoNumero()
|
||||
LtIndicador_UCDolares.Text = Dr("UltimoCostoUSD").ToString.FormatoNumero()
|
||||
|
||||
LtIndicador_Mensaje.Text = $"* Importes calculados con el tipo de cambio del dia <b> $ {TC.FormatoNumero(4)} </b>"
|
||||
|
||||
If TxtSerie.Text <> "" Then
|
||||
LtIndicador_MensajeSerie.Text = $"* Existencia y costos calculada por numero de serie: <b> {TxtSerie.Text} </b>"
|
||||
Else
|
||||
LtIndicador_MensajeSerie.Text = ""
|
||||
End If
|
||||
|
||||
UpIndicadores.Update()
|
||||
|
||||
GvM.Attributes.Add("data-heighterror", "430")
|
||||
Else
|
||||
GvM.Attributes.Add("data-heighterror", "270")
|
||||
End If
|
||||
GvM.DataSource = DtTemp
|
||||
GvM.DataBind()
|
||||
End If
|
||||
Else
|
||||
Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CargarKardex(CvePS As Integer) As DataTable
|
||||
Dim dt As DataTable = Nothing
|
||||
|
||||
Dim Entrada As Boolean = cbEntrada.Checked
|
||||
Dim Salida As Boolean = cbSalida.Checked
|
||||
|
||||
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
|
||||
If CvePS > 0 Then ddlProducto2.SelectedText = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimeroValor("PSCodigo", "")
|
||||
|
||||
Dim CveTiposAlmacen = ""
|
||||
For Each item As ListItem In CBLTiposAlmacen.Items
|
||||
CveTiposAlmacen += If(item.Selected, $"{item.Value},", "")
|
||||
Next
|
||||
|
||||
Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
|
||||
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
|
||||
dt = ObjInventarios.DtResultados.Copy
|
||||
End If
|
||||
ObjInventarios.Dispose()
|
||||
|
||||
Return dt
|
||||
End Function
|
||||
Protected Sub gvMovimientos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvM.RowDataBound
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
e.Row.Cells(0).ToolTip = e.Row.DBCampo("FechaMovto")
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(201) Then 'PERMISO PARA VER IMPORTES
|
||||
If e.Row.DBCampo("CveCompra") <> "" Then
|
||||
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
||||
ElseIf e.Row.DBCampo("CveVenta") <> "" Then
|
||||
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DBCampo("CveVenta"))
|
||||
ElseIf e.Row.DBCampo("CveOrdenCompra") <> "" Then
|
||||
e.Row.FCHyperLink("hlFolioD").NavigateUrl = String.Format("/OC/OC.aspx?OC={0}", e.Row.DBCampo("CveOrdenCompra"))
|
||||
End If
|
||||
End If
|
||||
|
||||
If GvM.Columns(1).Visible Then
|
||||
If Not e.Row.DBCampo("CveMovimiento").ToEntero > 0 Then
|
||||
e.Row.Cells(1).Text = ""
|
||||
End If
|
||||
End If
|
||||
|
||||
If e.Row.DBCampo("Concepto").Contains("TOTAL GENERAL") Then
|
||||
e.Row.CssClass = "Totales"
|
||||
ElseIf e.Row.DBCampo("Concepto").Contains("SALDO INICIAL") Then
|
||||
e.Row.CssClass = "SubTotales"
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region " IMPRIMIR "
|
||||
Protected Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
'Imprimir("Excel")
|
||||
GenerarPDF("Excel")
|
||||
End Sub
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
|
||||
Dim DtKardex As DataTable = Nothing
|
||||
DtKardex = CargarKardex(ddlProducto2.SelectedValue.ToEntero)
|
||||
If (Not IsNothing(DtKardex)) Then
|
||||
Dim params As New List(Of ReportParameter)
|
||||
If IO.File.Exists(String.Format("{0}/Formatos/Kardex.rdlc", UsuarioActual.Empresa.Ruta)) Then
|
||||
ImprimirPDF(String.Format("Empresas/{0}/Formatos/Kardex.rdlc", UsuarioActual.CveEmpresa), DtKardex, params, "ReporteKardex", reporte)
|
||||
Else
|
||||
ImprimirPDF("Empresas/Grales/Formatos/Kardex.rdlc", DtKardex, params, "Reporte Kardex", reporte)
|
||||
End If
|
||||
DtKardex.Dispose()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Private Sub ImgImprimir_Click(sender As Object, e As EventArgs) Handles ImgImprimir.Click
|
||||
GenerarPDF()
|
||||
End Sub
|
||||
Private Sub GenerarPDF(Optional Formato As String = "PDF")
|
||||
Dim Movimientos As New ClsInventarios
|
||||
Dim CvePS As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
Dim Entrada As Boolean = cbEntrada.Checked
|
||||
Dim Salida As Boolean = cbSalida.Checked
|
||||
|
||||
Dim FechaI As String = If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||
Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim CveAlmacen As Integer = ddlAlmacen.SelectedValue.ToEntero
|
||||
|
||||
|
||||
Dim Almacen = If(ddlAlmacen.SelectedValue = "-1", "", $" <b>Almacén:</b> {ddlAlmacen.SelectedItem.Text}")
|
||||
Dim UM = If(DdlUnidadMedida.SelectedValue = "-1", "", $" <b>Unidad de Medida:</b> {DdlUnidadMedida.SelectedItem.Text}")
|
||||
Dim FechaIn As String = If(TxtFechaI.Text = "", "", $" <b>Fecha Inicio:</b> {TxtFechaI.Text}")
|
||||
Dim FechaFn As String = If(TxtFechaF.Text = "", "", $" <b>Fecha Fin:</b> {TxtFechaF.Text}")
|
||||
Dim EntradaSalida As String = ""
|
||||
|
||||
If cbEntrada.Checked And cbSalida.Checked Then
|
||||
EntradaSalida = " Entradas y Salidas"
|
||||
ElseIf cbEntrada.Checked And cbSalida.Checked = False Then
|
||||
EntradaSalida = " Solo Entradas"
|
||||
ElseIf cbEntrada.Checked = False And cbSalida.Checked Then
|
||||
EntradaSalida = " Solo Salidas"
|
||||
End If
|
||||
|
||||
Dim Serie As String = If(TxtSerie.Text <> "", TxtSerie.Text, "-1")
|
||||
|
||||
Dim SerieAgrupado As String = If(TxtSerie.Text = "", "", $"<b>Existencia y costos calculada por numero de serie:</b> {TxtSerie.Text} ")
|
||||
|
||||
If Movimientos.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, "1", DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, ChkAgruparAlmacen.Checked, Serie) Then
|
||||
|
||||
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||
Dim dt As DataTable = Movimientos.DtResultados
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("FechaInicio", FechaI))
|
||||
params.Add(New ReportParameter("FechaFin", FechaF))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToDateTime.ToShortDateString))
|
||||
params.Add(New ReportParameter("Producto", ddlProducto2.SelectedText))
|
||||
params.Add(New ReportParameter("AgrupadoPor", $"<b>Agrupado Por:</b> {SerieAgrupado}{EntradaSalida}{Almacen}{UM}{FechaIn}{FechaFn}"))
|
||||
|
||||
If Imagen.Exists Then
|
||||
params.Add(New ReportParameter("LogoPath", logouri))
|
||||
Else
|
||||
params.Add(New ReportParameter("LogoPath", ""))
|
||||
End If
|
||||
ImprimirPDF("Empresas/Grales/Formatos/RepKardex.rdlc", dt, params, "ReporteKardex", Formato)
|
||||
Else
|
||||
Alert("No hay datos consultados", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "EDITAR FECHA"
|
||||
|
||||
Protected Sub LnkEditarFecha_Click(sender As Object, e As EventArgs)
|
||||
Dim gvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow)
|
||||
CveMovimiento = gvRow.DataKey("CveMovimiento").ToEntero
|
||||
TxtFecha.Text = gvRow.DataKey("FechaMovto").ToDateTime.ToString("yyyy-MM-ddTHH:mm")
|
||||
RegistraScript("$('#DModalEditarFecha').modal()")
|
||||
UpModalEditarFecha.Update()
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub BtnEditarFecha_Click(sender As Object, e As EventArgs)
|
||||
Dim ObjMov As New ClsMovimientos
|
||||
If ObjMov.UpdateMovimientoFecha(TxtFecha.Text.ToDateTime, CveMovimiento) Then
|
||||
Alert("Actualizada correctamente a : " + TxtFecha.Text.ToDateTime.ToString("yyyy-MM-dd HH:mm"))
|
||||
RegistraScript("$('#DModalEditarFecha').modal('hide')")
|
||||
CargaDatos()
|
||||
UPDatos.Update()
|
||||
End If
|
||||
ObjMov.Dispose()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -418,7 +418,7 @@
|
||||
|
||||
<%--GV DATOS--%>
|
||||
<asp:GridView ID="GvDatos" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowFooter="True" ShowHeader="true" ShowHeaderWhenEmpty="True"
|
||||
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,AplicaSerieLote,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveVentaDetalle,CveTamaño,PUVenta" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
DataKeyNames="Consec,CvePS,Codigo,CodigoBarras,AplicaSerieLote,CveUM,CantidadC,CantidadF,UM,PS,CveClasificacion,CveVentaDetalle,CveTamaño" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD gvInventario mysmallbtn" data-heighterror="450" data-freezerows="1" GridLines="None">
|
||||
<HeaderStyle Height="58px" />
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
|
||||
@@ -1584,32 +1584,6 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Try
|
||||
'VALIDA EXISTENCIA 2
|
||||
If TipoMovimiento = 1 Then
|
||||
|
||||
'For Each Dr As DataRow In DtDatos.Rows
|
||||
' If Dr("CantidadGV").ToString.ToDecimal > 0 Then
|
||||
' If Dr("Inv_CveMetodoInventario").ToString = "5" Then
|
||||
' DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
' For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
' If Not ObjInventario.GetExistenciasPS(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), SerieLote:=Dr1("SerieLote").ToString, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1) >= 1 Then
|
||||
' TextoError += String.Format(" - <b>{0}</b> Serie: <b>{1}</b> <br/>", Dr("PS"), Dr1("SerieLote"))
|
||||
' End If
|
||||
' Next
|
||||
' ElseIf Dr("Inv_CveMetodoInventario").ToString = "6" Then
|
||||
' DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
' For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
' If Not ObjInventario.GetExistenciasPS(Dr1("CvePS").ToString.ToEntero, Dr1("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), Lote:=Dr1("Lote").ToString, Batch:=Dr1("Batch").ToString, CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1) >= DtDatosDetalleLote.SUM("Cantidad", $"Lote = '{Dr1("Lote").ToString}' AND Batch = '{Dr1("Batch").ToString}'") Then
|
||||
' TextoError += String.Format(" - <b>{0}</b> Lote: <b>{1}</b> Batch: <b>{2}</b> <br/>", Dr("PS"), Dr1("Lote"), Dr1("Batch"))
|
||||
' End If
|
||||
' Next
|
||||
' Else
|
||||
'If Not ObjInventario.GetExistenciasPS(Dr("CvePS").ToString.ToEntero, Dr("CveUM").ToString.ToEntero, UsuarioActual.CveEmpresa, DdlAlmacen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveSubProyecto:=CveSubProyecto, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeApartados:=-1) >= Dr("CantidadGV").ToString.ToDecimal Then
|
||||
' TextoError += String.Format(" - {0} <br/>", Dr("PS"))
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' End If
|
||||
'Next
|
||||
|
||||
Dim StrXML As New StringBuilder
|
||||
StrXML.Append("<conceptos>")
|
||||
For Each Dr As DataRow In DtDatos.Rows
|
||||
@@ -1631,11 +1605,6 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Next
|
||||
StrXML.Append("</conceptos>")
|
||||
|
||||
'Alert(StrXML.ToString())
|
||||
'ObjInventario.RollBack()
|
||||
'ObjInventario.Dispose()
|
||||
'Exit Sub
|
||||
|
||||
Dim TieneErrorExistencia = False
|
||||
If ObjInventario.GetExistenciasPSXML(StrXML.ToString(), DdlAlmacen.SelectedValue.ToEntero, TxtFecha.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveSubProyecto, CveVendedor, If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), If(TipoEntrega = 2, 1, -1), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
If ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||
@@ -1661,45 +1630,6 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Else
|
||||
'If Not UsuarioActual.TienePermisoProceso(223) Then 'INVALIDA LA VALIDACION DE EXISTENCIA DE LA VENTA ORIGINAL
|
||||
' If DtExistencias IsNot Nothing Then
|
||||
' For Each Dr As DataRow In DtDatos.Rows
|
||||
' If Dr("CantidadGV").ToString.ToDecimal > 0 Then
|
||||
|
||||
' If Dr("Inv_CveMetodoInventario").ToString = "5" Then
|
||||
' DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
' For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
' If Not DtExistencias.SUM("Cantidad", $"CvePS = {Dr1("CvePS").ToString.ToEntero} AND CveUM = {Dr1("CveUM").ToString.ToEntero} AND SerieLote = '{Dr1("SerieLote").ToString}'") >= 1 Then
|
||||
' TextoError += String.Format("<b> - {0}</b> <br/>", Dr1("PS"))
|
||||
' End If
|
||||
' Next
|
||||
' ElseIf Dr("Inv_CveMetodoInventario").ToString = "6" Then
|
||||
' DtDetalle = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||
' For Each Dr1 As DataRow In DtDetalle.Rows
|
||||
' If Not DtExistencias.SUM("Cantidad", $"CvePS = {Dr1("CvePS").ToString.ToEntero} AND CveUM = {Dr1("CveUM").ToString.ToEntero} AND Lote = '{Dr1("Lote").ToString}' AND Batch = '{Dr1("Batch").ToString}'") >= DtDatosDetalleLote.SUM("Cantidad", $"Lote = '{Dr1("Lote").ToString}' AND Batch = '{Dr1("Batch").ToString}'") Then
|
||||
' TextoError += String.Format("<b> - {0}</b> <br/>", Dr1("PS"))
|
||||
' End If
|
||||
' Next
|
||||
' Else
|
||||
' If Not DtExistencias.SUM("Cantidad", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}") >= Dr("CantidadGV").ToString.ToDecimal Then
|
||||
' TextoError += String.Format("<b> - {0}</b> <br/>", Dr("PS"))
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' If TextoError <> "" Then
|
||||
' Alert($" Lo(s) siguiente(s) Productos <b>no tienen</b> existencia suficiente:<br/><br/> {TextoError}", TipoMensaje.MsgAdvertencia)
|
||||
' RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
|
||||
' ObjInventario.RollBack()
|
||||
' ObjInventario.Dispose()
|
||||
' ObjConta.Dispose()
|
||||
' ObjVentas.Dispose()
|
||||
' ObjEventos.Dispose()
|
||||
' Exit Sub
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
End If
|
||||
|
||||
'' TERMINA: VALIDACIONES
|
||||
@@ -1901,7 +1831,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
'' TERMINA: APARTADOS
|
||||
|
||||
' COMIENZA: GARANTIAS
|
||||
If TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.CveEmpresa = 140 AndAlso TipoMovimiento = 1 Then
|
||||
If TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso TipoMovimiento = 1 Then
|
||||
|
||||
Dim CveAlmacenGarantia As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 6).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim DtGarantias As DataTable = Nothing
|
||||
@@ -1928,54 +1858,82 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
' TERMINA: GARANTIAS
|
||||
|
||||
|
||||
' COMIENZA: VIRTUAL
|
||||
If TipoDocto.Contiene("Ing", "Rem") AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
If TipoDocto.Contiene("Ing") AndAlso UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
|
||||
Dim DtTamanios As New DataTable("DtTamanios")
|
||||
DtTamanios.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtTamanios.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtTamanios.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
||||
DtTamanios.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
||||
|
||||
Dim DtTamanios As DataTable = Nothing
|
||||
|
||||
If ObjAcumuladores.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
For Each Tam As DataRow In ObjAcumuladores.DtResultados.Rows
|
||||
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
|
||||
Dim Row As DataRow = DtTamanios.NewRow()
|
||||
|
||||
Row("CvePS") = Tam("CvePSCargo").ToString().ToEntero()
|
||||
Row("Cantidad") = GvRow.FCTextBox("TbCantidadF").Text.ToDecimal()
|
||||
Row("PU") = GvRow.DataKey("PUVenta").ToDecimal()
|
||||
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
|
||||
|
||||
DtTamanios.Rows.Add(Row)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
DtTamanios = ObjAcumuladores.DtResultados.Copy()
|
||||
End If
|
||||
|
||||
Dim CveAlmacenVirtual As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
Dim CveConceptoMovimientoVirtual As Integer = -1
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
Dim CveMovimientoRelacionadoVirtual As Integer = -1
|
||||
|
||||
If DtTamanios IsNot Nothing AndAlso DtTamanios.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 Then
|
||||
Dim CveConceptoMovimientoVirtual = If(TipoMovimiento = 1, 3, 18) 'CHECA SI ES ENTRADA O DEVOLUCION
|
||||
If TipoMovimiento = 1 Then
|
||||
For Each GvRow As GridViewRow In GvDatos.Rows
|
||||
If GvRow.RowType = DataControlRowType.DataRow Then
|
||||
|
||||
CveAlmacenVirutal = ObjInventario.AddMovimiento(CveAlmacenVirutal, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text)
|
||||
For Each Tam As DataRow In DtTamanios.Rows
|
||||
If Tam("CveTamaño").ToString() = GvRow.DataKey("CveTamaño") Then
|
||||
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
|
||||
Dim Row As DataRow = DtPSVirtual.NewRow()
|
||||
Row("CvePS") = CvePSCargo
|
||||
Row("Cantidad") = GvRow.FCTextBox("TbCantidadF").Text.ToDecimal()
|
||||
Row("PU") = 0
|
||||
Row("CveUM") = GvRow.DataKey("CveUM").ToEntero()
|
||||
|
||||
DtPSVirtual.Rows.Add(Row)
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
Next
|
||||
CveConceptoMovimientoVirtual = 3
|
||||
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
|
||||
|
||||
ElseIf TipoMovimiento = 2 Then
|
||||
Dim CveMovimientoSalidaDev As Integer = -1
|
||||
If ObjInventario.GetInv_Mov(CveVentaSurtir, UsuarioActual.CveEmpresa) Then
|
||||
Dim RowMovimiento As DataRow = ObjInventario.DtResultados.FiltroPrimero("CvePS IS NULL AND CveTipoAlmacen = 24 AND CveConcepto = 3 AND CveVenta > 0")
|
||||
CveMovimientoSalidaDev = RowMovimiento("CveMovimiento").ToString().ToEntero()
|
||||
CveAlmacenVirtual = RowMovimiento("CveAlmacen").ToString().ToEntero()
|
||||
CveMovimientoRelacionadoVirtual = CveMovimientoSalidaDev
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDev, UsuarioActual.CveEmpresa) Then
|
||||
DtPSVirtual = ObjInventario.DtResultados.Copy()
|
||||
Else
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
CveConceptoMovimientoVirtual = 18
|
||||
End If
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 AndAlso CveConceptoMovimientoVirtual > 0 Then
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVentaSurtir, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveMovimientoRelacionado:=CveMovimientoRelacionadoVirtual)
|
||||
FolioVirtual = ObjInventario.Folio
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtTamanios.Rows
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadEntrada As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveAlmacenVirutal, CantidadEntrada, CveUM, CvePS, PU, -1) Then
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
ErrorMovInv = True
|
||||
TextoError = "Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar."
|
||||
Exit For
|
||||
@@ -1989,7 +1947,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
|
||||
If DtTamanios.Rows.Count = 0 Then
|
||||
If DtPSVirtual.Rows.Count = 0 Then
|
||||
ErrorMovInv = True
|
||||
End If
|
||||
End If
|
||||
@@ -2286,123 +2244,6 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' SE REALIZARA AL MOMENTO DE CANCELAR LA FACTURA {
|
||||
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
|
||||
|
||||
'If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then
|
||||
' Dim DtDevRem As New DataTable
|
||||
' Dim DtMovtosDev As New DataTable
|
||||
' Dim CveAlmacenTraspasoDestinoDevRem = -1
|
||||
|
||||
' Dim CveVentaDetalleRem = -1
|
||||
' Dim CantidadDevolver As Decimal = 0
|
||||
' Dim CantidadRem As Decimal = 0
|
||||
|
||||
' 'CARGA REMISIONES DE LA VENTA DEVUELTA
|
||||
' If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then
|
||||
' DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen > 0")
|
||||
' Else
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
' 'CARGA CONCEPTOS DEVUELTOS EN LA VENTA
|
||||
' If ObjInventario.GetMovimientosDetalle(CveMovimiento, UsuarioActual.CveEmpresa) Then
|
||||
' DtMovtosDev = ObjInventario.DtResultados
|
||||
' Else
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
|
||||
' If Not ErrorMovInv Then
|
||||
' If DtDevRem.Rows.Count > 0 And DtMovtosDev.Rows.Count > 0 Then
|
||||
|
||||
' For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem", "CveAlmacenTraspasoDestino"}).Rows
|
||||
' CveAlmacenTraspasoDestinoDevRem = DrMovtos("CveAlmacenTraspasoDestino").ToString.ToEntero
|
||||
' If Not CveAlmacenTraspasoDestinoDevRem > 0 Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al obtener el almacén de devolucion de remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' 'SALIDA GENERAL
|
||||
' CveMovimientoSalidaDevRem = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, 8, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimiento, CveAlmacenDestino:=CveAlmacenTraspasoDestinoDevRem)
|
||||
' FolioMovimientoSalidaDevRem = ObjInventario.Folio
|
||||
|
||||
' 'ENTRADA ADELANTADO
|
||||
' CveMovimientoEntradaDevRem = ObjInventario.AddMovimiento(CveAlmacenTraspasoDestinoDevRem, 9, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObservaciones.Text.Trim, Guia:=TxtGuia.Text, CveContrato:=CveContrato, CveMovimientoRelacionado:=CveMovimientoSalidaDevRem, CveAlmacenDestino:=DdlAlmacen.SelectedValue.ToEntero)
|
||||
' FolioMovimientoEntradaDevRem = ObjInventario.Folio
|
||||
|
||||
' If Not (CveMovimientoSalidaDevRem > 0 And CveMovimientoEntradaDevRem > 0) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al generar los movimientos de devolución a remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
|
||||
' 'SALIDA POR TRAPASO DE GENERAL
|
||||
' For Each DrRem As DataRow In DtDevRem.FiltraParametros($"CveRem = {DrMovtos("CveRem")}").Rows
|
||||
' CveVentaDetalleRem = DrRem("CveVentaDetalleRem").ToString.ToEntero
|
||||
' CantidadRem = DrRem("CantidadFacturada").ToString.ToDecimal
|
||||
' 'CantidadDevolver = DtMovtosDev.FiltroPrimeroValor("Cantidad", $"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").ToDouble
|
||||
' 'If (Dr("Cantidad").ToString.ToDouble > CantidadRem, CantidadRem, Dr("Cantidad").ToString.ToDouble) Then
|
||||
|
||||
' If Not CveVentaDetalleRem > 0 Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al obtener la relación de la venta con la remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' For Each Dr As DataRow In DtMovtosDev.FiltraParametros($"CveVentaDetalle = {DrRem("CveVentaDetalle").ToString.ToEntero}").Rows
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalidaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDouble, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=CveVentaDetalleRem, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de salida de traspaso de devolucion de remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' If ErrorMovInv Then
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' If ErrorMovInv Then
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' 'ENTRADA POR TRAPASO A ENTREGA POR ADELANTADO
|
||||
' If ObjInventario.GetMovimientosDetalle(CveMovimientoSalidaDevRem, UsuarioActual.CveEmpresa) Then
|
||||
' For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntradaDevRem, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString) Then
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al guardar los movimientos de entrada de traspaso de devolucion de remisión."
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' If ErrorMovInv Then
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' Else
|
||||
' ErrorMovInv = True
|
||||
' TextoError = "Ocurrió un error al obtener los detalles de la devolución de almacén"
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
|
||||
' If Not ObjVentas.UpdateVentasDevolucionAlmacen(0, DrMovtos("CveRem").ToString.ToEntero) Then
|
||||
' TextoError = "Ocurrió un error al hacer la devolucion hacia la remision. Por favor vuelva a intentar."
|
||||
' ErrorMovInv = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' Next
|
||||
' End If
|
||||
' Else
|
||||
' TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar."
|
||||
' ErrorMovInv = True
|
||||
' End If
|
||||
'End If
|
||||
'}
|
||||
|
||||
'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER)
|
||||
If Not ErrorMovInv And EsDevolucionVenta = 1 Then
|
||||
@@ -2427,7 +2268,6 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ErrorMovInv = True
|
||||
OnError("Ocurrió un error al guardar", ex)
|
||||
@@ -2441,16 +2281,11 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Msg.AppendFormat("Movimiento Salida: <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimiento, Folio)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimiento)))
|
||||
|
||||
|
||||
'Msg.AppendFormat("<input type=""text"" id=""NumeroGuia""/>")
|
||||
'Dim script As String = "$('#TxtNumeroGuia').val($('#NumeroGuia').val());$('#BtnNumeroGuia').click();"
|
||||
|
||||
If CveMovimientoEntrada > 0 Then
|
||||
Msg.AppendFormat("<br/><br/> Movimiento Entrada (Traspaso): <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoEntrada, FolioEntrada)
|
||||
Msg.AppendFormat("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
|
||||
End If
|
||||
|
||||
|
||||
If DtTraspasos.Rows.Count > 0 Then
|
||||
Msg.AppendFormat("<br/><br/> Movimientos de Control (Apartados):")
|
||||
For Each Dr As DataRow In DtTraspasos.Rows
|
||||
@@ -2463,20 +2298,12 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoGarantia)))
|
||||
End If
|
||||
|
||||
'VIRTUAL
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
Msg.AppendFormat("<br/> Movimiento de Salida del Almacen Virtal: ")
|
||||
Msg.AppendFormat("<b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoVirtual, FolioVirtual)
|
||||
Msg.AppendFormat("<br/><br/> Movimiento de Salida del Almacen Virtual: ")
|
||||
Msg.AppendFormat("<b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoVirtual, FolioVirtual)
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoVirtual)))
|
||||
End If
|
||||
|
||||
'If CveMovimientoSalidaDevRem > 0 Then
|
||||
' Msg.AppendFormat(" < br /<> br /> Movimiento de salida de devolución (Traspaso): <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoSalidaDevRem, FolioMovimientoSalidaDevRem)
|
||||
' Msg.AppendFormat("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoSalidaDevRem)))
|
||||
|
||||
' Msg.AppendFormat("<br/><br/> Movimiento de entrada de devolución (Traspaso): <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoEntradaDevRem, FolioMovimientoEntradaDevRem)
|
||||
' Msg.AppendFormat("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntradaDevRem)))
|
||||
'End If
|
||||
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion)
|
||||
|
||||
Limpia()
|
||||
@@ -2492,6 +2319,7 @@ Partial Class Inventarios_RecepcionEntrega
|
||||
ObjConta.Dispose()
|
||||
ObjVentas.Dispose()
|
||||
ObjEventos.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub GuardaTraspaso()
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<div class="row" id="DivFactura" runat="server" visible="false">
|
||||
<label class="col-md-1 truncate" style="width: 110px">Factura:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlFactura" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="SerieFolio" DataValueField="CveVenta" OnSelectedIndexChanged="DdlFactura_SelectedIndexChanged">
|
||||
<asp:DropDownList ID="DdlFactura" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="max-width: 200px" DataTextField="SerieFolio" DataValueField="CveVenta">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -879,7 +879,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
If Valido And AgregarUsado Then
|
||||
|
||||
If ObjFactura IsNot Nothing AndAlso Not EsDistribuidor Then
|
||||
If ObjFactura IsNot Nothing AndAlso Me.CveRemisionRecibida > 0 Then
|
||||
Dim RowDetalle As DataRow = ObjFactura.DtDetalle.FiltroPrimero($"CvePS={CvePS}")
|
||||
|
||||
If RowDetalle IsNot Nothing Then
|
||||
@@ -981,9 +981,18 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click
|
||||
If ObjRemisionNC IsNot Nothing Then
|
||||
|
||||
'SI ES DISTRIBUIDOR Y NO VIENE DE REMISION, GENERA UNA REMISION DE NOTA DE CREDITO
|
||||
If EsDistribuidor AndAlso Me.CveRemisionRecibida <= 0 Then
|
||||
Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero()
|
||||
Dim CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue}").ToEntero
|
||||
|
||||
CreaRemisionNC(CveCliente, CveSubProyecto, 1)
|
||||
End If
|
||||
|
||||
If Me.ObjRemisionNC IsNot Nothing Then
|
||||
Dim sb As New StringBuilder()
|
||||
sb.Append($"Se va a generar un documento de tipo 'Remisión de nota de crédito'.<br> Serie-Folio:<b>{ObjRemisionNC.SerieFolio}</b>.<br> ¿Esta seguro que desea guardar?:<br/>")
|
||||
sb.Append($"Se va a generar un documento de tipo 'Remisión de nota de crédito'.<br> Serie-Folio:<b>{Me.ObjRemisionNC.SerieFolio}</b>.<br> ¿Esta seguro que desea guardar?:<br/>")
|
||||
|
||||
Alert(sb.ToString(), TipoMensaje.MsgConfirmacion, JSBtnAceptar:="GenerarRNC();", TextoConfirmacion:=" Si ", TextoCancelacion:=" No ")
|
||||
Else
|
||||
@@ -1030,8 +1039,6 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
If CveRemisionRecibida > 0 Then
|
||||
CveVenta = CveRemisionRecibida
|
||||
ElseIf DdlFactura.SelectedValue.ToEntero() > 0 Then
|
||||
CveVenta = DdlFactura.SelectedValue.ToEntero()
|
||||
End If
|
||||
|
||||
CveMovimiento = ObjInventario.AddMovimiento(DdlAlmacen.SelectedValue.ToEntero, CveConcepto, 1, Fecha, tFolio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta,
|
||||
@@ -1059,7 +1066,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
Exit For
|
||||
End If
|
||||
|
||||
If Not ObjVentas.UpdateVentaUsadoRecibido(CveRemisionRecibida, Dr("CvePS").ToString.ToEntero, True) Then
|
||||
If Not ObjVentas.UpdateVentaUsadoRecibido(CveVenta, Dr("CvePS").ToString.ToEntero, True) Then
|
||||
Mensaje = "Error al actualizar el recibo de los usados"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
@@ -1067,10 +1074,10 @@ Partial Class Inventarios_RecepcionUsados
|
||||
|
||||
Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2)
|
||||
|
||||
If RBLOpcion.SelectedValue.ToEntero <> 3 Then
|
||||
If RBLOpcion.SelectedValue.ToEntero <> 3 AndAlso Not GenerarRNC Then
|
||||
If EsDistribuidor Then
|
||||
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, -1, UsuarioActual.CveUsuario,
|
||||
UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
||||
UsuarioActual.CveEmpresa, CveVenta, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
|
||||
Mensaje = "Error al guardar Movimientos de distribuidor"
|
||||
ErrorMovInv = True
|
||||
Exit For
|
||||
@@ -1712,7 +1719,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
Private Sub CargaFacturasCliente()
|
||||
DivFactura.Visible = True
|
||||
'DivFactura.Visible = True
|
||||
Dim CveCliente As Integer = DdlClientes.SelectedValue.ToEntero()
|
||||
If CveCliente > 0 Then
|
||||
|
||||
@@ -1952,14 +1959,31 @@ Partial Class Inventarios_RecepcionUsados
|
||||
CveCliente = ObjVentas.DtResultados.Rows(0)("CveCliente").ToString().ToEntero()
|
||||
End If
|
||||
|
||||
'SI ES DISTRIBUIDOR VAMOS A GENERAR LA REMISION DE NOTA DE CREDITO
|
||||
If EsDistribuidor Then
|
||||
DivCliente.Visible = True
|
||||
DdlClientes.SelectedValueExist(CveCliente)
|
||||
DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
|
||||
DdlFactura.SelectedValueExist(CveRemisionRecibida)
|
||||
|
||||
If Me.ObjRemisionNC IsNot Nothing Then
|
||||
Me.ObjRemisionNC.Dispose()
|
||||
Me.ObjRemisionNC = Nothing
|
||||
End If
|
||||
|
||||
If Me.ObjFactura IsNot Nothing Then
|
||||
Me.ObjFactura.Dispose()
|
||||
Me.ObjFactura = Nothing
|
||||
End If
|
||||
|
||||
Me.ObjFactura = New Modelos.Factura(UsuarioActual, CveRemisionRecibida, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"))
|
||||
|
||||
If Me.ObjFactura IsNot Nothing Then
|
||||
'CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
|
||||
DivTotal.Visible = True
|
||||
End If
|
||||
Else
|
||||
DivCliente.Visible = False
|
||||
DivFactura.Visible = False
|
||||
'DivFactura.Visible = False
|
||||
End If
|
||||
|
||||
If ObjVentas.GetVentasUsadosDetalle(CveRemisionRecibida) Then
|
||||
@@ -1971,7 +1995,7 @@ Partial Class Inventarios_RecepcionUsados
|
||||
For Each RowUsado As DataRow In DtUsados.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
|
||||
Dim RowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0) '.FiltroPrimeroValor("CveTamaño", $"CvePS = { DdlProducto2.SelectedValue.ToEntero }").ToEntero
|
||||
Dim RowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS).Rows(0)
|
||||
Dim CveTamaño As Integer = RowPS("CveTamaño").ToString().ToEntero()
|
||||
|
||||
Dim PS As String = RowPS("PS").ToString()
|
||||
@@ -1988,36 +2012,36 @@ Partial Class Inventarios_RecepcionUsados
|
||||
UpGenerales.Update()
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlFactura_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
'Protected Sub DdlFactura_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
If Not EsDistribuidor AndAlso Me.CveRemisionRecibida <= 0 Then
|
||||
' If EsDistribuidor AndAlso Me.CveRemisionRecibida <= 0 Then
|
||||
|
||||
If ObjRemisionNC IsNot Nothing Then
|
||||
ObjRemisionNC.Dispose()
|
||||
ObjRemisionNC = Nothing
|
||||
End If
|
||||
' If Me.ObjRemisionNC IsNot Nothing Then
|
||||
' Me.ObjRemisionNC.Dispose()
|
||||
' Me.ObjRemisionNC = Nothing
|
||||
' End If
|
||||
|
||||
If ObjFactura IsNot Nothing Then
|
||||
ObjFactura.Dispose()
|
||||
ObjFactura = Nothing
|
||||
End If
|
||||
' If Me.ObjFactura IsNot Nothing Then
|
||||
' Me.ObjFactura.Dispose()
|
||||
' Me.ObjFactura = Nothing
|
||||
' End If
|
||||
|
||||
Dim CveVenta As Integer = DdlFactura.SelectedValue.ToEntero()
|
||||
' 'Dim CveVenta As Integer = DdlFactura.SelectedValue.ToEntero()
|
||||
|
||||
ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"))
|
||||
' 'ObjFactura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, DirectorioServidor:=Server.MapPath("/"))
|
||||
|
||||
If ObjFactura IsNot Nothing Then
|
||||
CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
|
||||
DivTotal.Visible = True
|
||||
End If
|
||||
End If
|
||||
' If Me.ObjFactura IsNot Nothing Then
|
||||
' CreaRemisionNC(ObjFactura.CveCliente, ObjFactura.CveSubProyecto, ObjFactura.CveMoneda)
|
||||
' DivTotal.Visible = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
UPDatos.Update()
|
||||
' UPDatos.Update()
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
Private Sub CreaRemisionNC(CveCliente As Integer, CveSubProyecto As Integer, CveMoneda As Integer)
|
||||
ObjRemisionNC = New Modelos.Factura(UsuarioActual)
|
||||
Me.ObjRemisionNC = New Modelos.Factura(UsuarioActual)
|
||||
|
||||
Dim Folio As String = ""
|
||||
Dim Serie As String = ""
|
||||
@@ -2033,102 +2057,102 @@ Partial Class Inventarios_RecepcionUsados
|
||||
End If
|
||||
ObjFolios.Dispose()
|
||||
|
||||
ObjRemisionNC.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
|
||||
ObjRemisionNC.Serie = Serie
|
||||
ObjRemisionNC.Folio = Folio.ToEntero()
|
||||
ObjRemisionNC.Version = "3.3"
|
||||
ObjRemisionNC.FolioFiscal = ""
|
||||
ObjRemisionNC.CveUsuario = UsuarioActual.CveUsuario
|
||||
ObjRemisionNC.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
ObjRemisionNC.TipoCambio = 1
|
||||
ObjRemisionNC.ConvertirPesos = False
|
||||
ObjRemisionNC.CveMoneda = CveMoneda
|
||||
ObjRemisionNC.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
|
||||
ObjRemisionNC.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
|
||||
ObjRemisionNC.TipoDocto = "RNC"
|
||||
ObjRemisionNC.RefDocto = ""
|
||||
ObjRemisionNC.CveMesa = -1
|
||||
ObjRemisionNC.Fecha = Now
|
||||
ObjRemisionNC.CvePrePoliza = -1
|
||||
ObjRemisionNC.FechaPago = Now
|
||||
ObjRemisionNC.MotivoDescuento = ""
|
||||
ObjRemisionNC.FechaEjecucion = Now
|
||||
ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario
|
||||
ObjRemisionNC.CveCondicionEntrega = -1
|
||||
ObjRemisionNC.CondicionEntrega = ""
|
||||
ObjRemisionNC.NumeroCuenta = ""
|
||||
ObjRemisionNC.CondicionesPago = 0
|
||||
ObjRemisionNC.FormaPago = 0
|
||||
ObjRemisionNC.PedidoContrato = ""
|
||||
ObjRemisionNC.NumeroContrato = ""
|
||||
ObjRemisionNC.DescripcionContrato = ""
|
||||
ObjRemisionNC.CveCorte = -1
|
||||
ObjRemisionNC.TipoDocumento = "Remisión"
|
||||
ObjRemisionNC.Alfa1 = ""
|
||||
ObjRemisionNC.Alfa2 = ""
|
||||
ObjRemisionNC.Alfa3 = ""
|
||||
ObjRemisionNC.CveContrato = -1
|
||||
ObjRemisionNC.ConvertirPesos = False
|
||||
ObjRemisionNC.CveSubProyecto = CveSubProyecto
|
||||
ObjRemisionNC.CveSubProyectoCobranza = CveSubProyecto
|
||||
ObjRemisionNC.CveSubProyectoEjecucion = CveSubProyecto
|
||||
ObjRemisionNC.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
|
||||
ObjRemisionNC.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
|
||||
Me.ObjRemisionNC.TipoMensajeRespuesta = Modelos.TipoMensajeRespuesta.HTML
|
||||
Me.ObjRemisionNC.Serie = Serie
|
||||
Me.ObjRemisionNC.Folio = Folio.ToEntero()
|
||||
Me.ObjRemisionNC.Version = "3.3"
|
||||
Me.ObjRemisionNC.FolioFiscal = ""
|
||||
Me.ObjRemisionNC.CveUsuario = UsuarioActual.CveUsuario
|
||||
Me.ObjRemisionNC.CveEmpresa = UsuarioActual.CveEmpresa
|
||||
Me.ObjRemisionNC.TipoCambio = 1
|
||||
Me.ObjRemisionNC.ConvertirPesos = False
|
||||
Me.ObjRemisionNC.CveMoneda = CveMoneda
|
||||
Me.ObjRemisionNC.Moneda = GlobalDTMonedas.FiltroPrimeroValor("Moneda", String.Format("CveMoneda = {0} ", CveMoneda))
|
||||
Me.ObjRemisionNC.MonedaSAT = GlobalDTMonedas.FiltroPrimeroValor("AbreviaturaSAT", String.Format("CveMoneda = {0} ", CveMoneda))
|
||||
Me.ObjRemisionNC.TipoDocto = "RNC"
|
||||
Me.ObjRemisionNC.RefDocto = ""
|
||||
Me.ObjRemisionNC.CveMesa = -1
|
||||
Me.ObjRemisionNC.Fecha = Now
|
||||
Me.ObjRemisionNC.CvePrePoliza = -1
|
||||
Me.ObjRemisionNC.FechaPago = Now
|
||||
Me.ObjRemisionNC.MotivoDescuento = ""
|
||||
Me.ObjRemisionNC.FechaEjecucion = Now
|
||||
Me.ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario
|
||||
Me.ObjRemisionNC.CveCondicionEntrega = -1
|
||||
Me.ObjRemisionNC.CondicionEntrega = ""
|
||||
Me.ObjRemisionNC.NumeroCuenta = ""
|
||||
Me.ObjRemisionNC.CondicionesPago = 0
|
||||
Me.ObjRemisionNC.FormaPago = 0
|
||||
Me.ObjRemisionNC.PedidoContrato = ""
|
||||
Me.ObjRemisionNC.NumeroContrato = ""
|
||||
Me.ObjRemisionNC.DescripcionContrato = ""
|
||||
Me.ObjRemisionNC.CveCorte = -1
|
||||
Me.ObjRemisionNC.TipoDocumento = "Remisión"
|
||||
Me.ObjRemisionNC.Alfa1 = ""
|
||||
Me.ObjRemisionNC.Alfa2 = ""
|
||||
Me.ObjRemisionNC.Alfa3 = ""
|
||||
Me.ObjRemisionNC.CveContrato = -1
|
||||
Me.ObjRemisionNC.ConvertirPesos = False
|
||||
Me.ObjRemisionNC.CveSubProyecto = CveSubProyecto
|
||||
Me.ObjRemisionNC.CveSubProyectoCobranza = CveSubProyecto
|
||||
Me.ObjRemisionNC.CveSubProyectoEjecucion = CveSubProyecto
|
||||
Me.ObjRemisionNC.SubProyecto = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1).FiltroPrimero(String.Format("CveSubProyecto = {0}", CveSubProyecto)))
|
||||
Me.ObjRemisionNC.SubProyectoMatriz = New Modelos.SubProyectoModel(GlobalDTSubProyectos(-1, CveSubProyecto:=-1, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("TipoSucursal=1"))
|
||||
|
||||
'CLIENTE
|
||||
ObjRemisionNC.CveCliente = CveCliente
|
||||
ObjRemisionNC.SetCliente()
|
||||
ObjRemisionNC.CveAlmacen = -1
|
||||
Me.ObjRemisionNC.CveCliente = CveCliente
|
||||
Me.ObjRemisionNC.SetCliente()
|
||||
Me.ObjRemisionNC.CveAlmacen = -1
|
||||
|
||||
Dim ObjCliente As New ClsClientes
|
||||
If ObjCliente.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, -1, TipoCliente:=-1) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
ObjRemisionNC.CveFormaPago33 = ObjCliente.CveFormaPago33
|
||||
ObjRemisionNC.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
|
||||
ObjRemisionNC.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
|
||||
Me.ObjRemisionNC.CveFormaPago33 = ObjCliente.CveFormaPago33
|
||||
Me.ObjRemisionNC.FormaPago33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("FormaPago", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
|
||||
Me.ObjRemisionNC.FormaPagoSAT33 = GlobalDTVtaFormaPago.FiltroPrimeroValor("ClaveFormaPagoSAT", String.Format("CveFormaPago = {0}", ObjCliente.CveFormaPago33))
|
||||
|
||||
ObjRemisionNC.CveMetodoPago33 = ObjCliente.CveMetodoPago33
|
||||
ObjRemisionNC.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
|
||||
ObjRemisionNC.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
|
||||
Me.ObjRemisionNC.CveMetodoPago33 = ObjCliente.CveMetodoPago33
|
||||
Me.ObjRemisionNC.MetodoPago33 = GlobalDTVtaMetodoPago.FiltroPrimeroValor("MetodoPago", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
|
||||
Me.ObjRemisionNC.ClaveMetodoPagoSAT = GlobalDTVtaMetodoPago.FiltroPrimeroValor("ClaveMetodoPagoSAT", String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago33))
|
||||
|
||||
ObjRemisionNC.CveUsoCFDI = ObjCliente.CveUsoCFDI
|
||||
ObjRemisionNC.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||
ObjRemisionNC.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||
Me.ObjRemisionNC.CveUsoCFDI = ObjCliente.CveUsoCFDI
|
||||
Me.ObjRemisionNC.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||
Me.ObjRemisionNC.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
|
||||
|
||||
ObjRemisionNC.CveMetodoPago = ObjCliente.CveMetodoPago
|
||||
Me.ObjRemisionNC.CveMetodoPago = ObjCliente.CveMetodoPago
|
||||
|
||||
If GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows.Count > 0 Then
|
||||
ObjRemisionNC.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows(0)("MetodoPago").ToString
|
||||
Me.ObjRemisionNC.MetodoPago = GlobalDTMetodosPago.FiltraParametros(String.Format("CveMetodoPago = {0}", ObjCliente.CveMetodoPago)).Rows(0)("MetodoPago").ToString
|
||||
Else
|
||||
ObjRemisionNC.CveMetodoPago = 1
|
||||
ObjRemisionNC.MetodoPago = "Efectivo"
|
||||
Me.ObjRemisionNC.CveMetodoPago = 1
|
||||
Me.ObjRemisionNC.MetodoPago = "Efectivo"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjCliente.GetSucursales(CveCliente) Then
|
||||
If ObjCliente.DtResultados.Rows.Count > 0 Then
|
||||
ObjRemisionNC.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
|
||||
Me.ObjRemisionNC.CveClienteSucursal = If(String.IsNullOrEmpty(ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'")), -1, ObjCliente.DtResultados.FiltroPrimeroValor("CveClienteSucursal", "Estatus = 'Activo'").ToEntero())
|
||||
Else
|
||||
ObjRemisionNC.CveClienteSucursal = -1
|
||||
Me.ObjRemisionNC.CveClienteSucursal = -1
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
|
||||
'DETALLES
|
||||
ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
|
||||
Me.ObjRemisionNC.DtDetalle = CreaDTDetalleRNC()
|
||||
|
||||
'VALIDA PROMOCIONES Y EXISTENCIAS
|
||||
Dim ObjVentas As New ClsVentas
|
||||
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, ObjRemisionNC.CveCliente, ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
|
||||
ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
|
||||
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
|
||||
Me.ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
|
||||
ObjRemisionNC.Observaciones = ""
|
||||
ObjRemisionNC.OrdenCompra = ""
|
||||
ObjRemisionNC.PedidoContrato = ""
|
||||
ObjRemisionNC.ObservacionesAlmacen = ""
|
||||
Me.ObjRemisionNC.Observaciones = ""
|
||||
Me.ObjRemisionNC.OrdenCompra = ""
|
||||
Me.ObjRemisionNC.PedidoContrato = ""
|
||||
Me.ObjRemisionNC.ObservacionesAlmacen = ""
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,22 +0,0 @@
|
||||
|
||||
.. PAC: 4 - Verificado : (5) 5 Certificado : (501) 506 Armado: (25) 531 Genera: (494) 1025 Timbrado: (748) 1773 ..20/08/2019:03:33 p. m.
|
||||
|
||||
.. PAC: 4 - Verificado : (2) 2 Certificado : (388) 390 Armado: (4) 394 Genera: (440) 834 Timbrado: (1030) 1864 Guardado: (361) 2225 Actualizado: (99) 2324 ..20/08/2019:03:39 p. m.
|
||||
|
||||
.. PAC: 2 - Verificado : (200) 200 Armado: (398) 598 Guardado: (564) 1162 Timbrado: (2342) 3504 Actualizado: (456) 3960 ..02/09/2019:11:00 a. m.
|
||||
|
||||
.. PAC: 2 - Verificado : (170) 170 Armado: (285) 455 Guardado: (333) 788 Timbrado: (1949) 2737 Actualizado: (20) 2757 ..02/09/2019:11:00 a. m.
|
||||
|
||||
.. PAC: 3 - Verificado : (37) 37 Armado: (43) 80 Genera: (0) 80 Timbrado: (7893) 7973 Actualizado: (19) 7992 ..05/09/2019:11:02 a. m.
|
||||
|
||||
.. PAC: 3 - Verificado : (36) 36 Armado: (32) 68 Genera: (0) 68 Timbrado: (10604) 10672 Actualizado: (16) 10688 ..05/09/2019:12:31 p. m.
|
||||
|
||||
.. PAC: 4 - Verificado : (12) 12 Certificado : (209) 221 Armado: (35) 256 Genera: (306) 562 Timbrado: (918) 1480 ..20/09/2019:05:37 p. m.
|
||||
|
||||
.. PAC: 4 - Verificado : (6) 6 Certificado : (384) 390 Armado: (27) 417 Genera: (390) 807 Timbrado: (2271) 3078 Guardado: (219) 3297 Actualizado: (902) 4199 ..01/10/2019:12:27 a. m.
|
||||
|
||||
.. PAC: 4 - Verificado : (0) 0 Certificado : (204) 204 Armado: (1) 205 Genera: (249) 454 Timbrado: (431) 885 ..01/10/2019:12:27 a. m.
|
||||
|
||||
.. PAC: 2 - Verificado : (32764) 32764 Armado: (660) 33424 Guardado: (445) 33869 Timbrado: (156762) 190631 ..06/11/2019:09:39 a. m.
|
||||
|
||||
.. PAC: 2 - Verificado : (2018) 2018 Armado: (96902) 98920 Guardado: (312) 99232 Timbrado: (1201) 100433 ..06/11/2019:09:41 a. m.
|
||||
@@ -2546,10 +2546,15 @@ Partial Class Clientes
|
||||
If DTVendedor.Rows.Count > 0 Then
|
||||
Dim _CorreoVendedor As String = DTVendedor(0)("Correo").ToString
|
||||
|
||||
If _CorreoVendedor.Length > 0 And UsuarioActual.Empresa.Funcionalidad(571).ToEntero > 0 Then
|
||||
Dim _CorreoAsistente As String = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltroPrimeroValor("Correo", "CveSuperior = " & DdlVendedor.SelectedValue.ToEntero)
|
||||
|
||||
Dim CveSuperior As Integer = DTVendedor(0)("CveSuperior").ToString.ToEntero
|
||||
Dim _CorreoCoordinador As String = GlobalDTVendedores(UsuarioActual.Empresa.CveEmpresa).FiltroPrimeroValor("Correo", "CveVendedor = " & CveSuperior)
|
||||
|
||||
If (_CorreoVendedor.Length > 0 Or _CorreoAsistente.Length > 0 Or _CorreoCoordinador.Length > 0) And UsuarioActual.Empresa.Funcionalidad(571).ToEntero > 0 Then
|
||||
|
||||
Dim Asunto As String = ""
|
||||
Dim Para As String = _CorreoVendedor
|
||||
Dim Para As String = If(_CorreoVendedor.Length > 0, _CorreoVendedor & ";", "") & If(_CorreoAsistente.Length > 0, _CorreoAsistente & ";", "") & _CorreoCoordinador
|
||||
Dim SBBody As New StringBuilder
|
||||
|
||||
If ChkEstado.Checked Then
|
||||
|
||||
@@ -1716,7 +1716,7 @@ Partial Class PV
|
||||
End If
|
||||
End If
|
||||
ObjCliente.Dispose()
|
||||
|
||||
UPCondicionesPago.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub CambiaSucursal()
|
||||
|
||||
@@ -283,6 +283,14 @@
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
|
||||
</div>
|
||||
<label title="Condiciones de Pago" data-toggle="tooltip" class="col-md-1 truncate">Condiciones Pago:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@ Partial Class RepVentaDetalle
|
||||
|
||||
|
||||
Private Sub InicializaValores()
|
||||
Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion As String
|
||||
Dim Grupo, CveCliente, CveSucursal, CveSubProyectoEjecucion, CveVendedor, CveUsuario, CveEstatusFactura, CveCorte, IVA, TipoDocto, CveClienteClasificacion, CveCondicionesPago As String
|
||||
Dim Anio, Mes, AnioMes, Fecha, FechaI, FechaF As String
|
||||
Dim AnioEjec, MesEjec, AnioMesEjec, FechaEjec, FechaIEjec, FechaFEjec As String
|
||||
'Dim CveSubProyecto As Integer
|
||||
@@ -148,11 +148,13 @@ Partial Class RepVentaDetalle
|
||||
CveSubProyecto = If(Request("CveSubProyecto") IsNot Nothing, Request("CveSubProyecto").ToString, "-1").ToString
|
||||
CveVendedor = If(Request("CveVendedor") IsNot Nothing AndAlso Request("CveVendedor") <> "", Request("CveVendedor"), "-1").ToString
|
||||
CveEstatusFactura = If(Request("CveEstatusFactura") IsNot Nothing AndAlso Request("CveEstatusFactura") <> "", Request("CveEstatusFactura"), "-1").ToString
|
||||
CveCondicionesPago = If(Request("CveCondicionesPago") IsNot Nothing AndAlso Request("CveCondicionesPago") <> "", Request("CveCondicionesPago"), "-1").ToString
|
||||
|
||||
DdlTipoComprobante.SelectedValuesIfExistM(TipoDocto)
|
||||
|
||||
CargaEstatus()
|
||||
DdlEstatus.SelectedValuesIfExistM(CveEstatusFactura)
|
||||
DdlCondicionesPago.SelectedValueExist(CveCondicionesPago)
|
||||
|
||||
DdlProyecto.SelectedValueExist(CveProyecto)
|
||||
If DivProyecto.Visible Then CargaSubProyecto()
|
||||
@@ -441,7 +443,8 @@ Partial Class RepVentaDetalle
|
||||
'PARAMETROS DE LOS LISTBOXS
|
||||
Dim TipoComprobante As String = If(DdlTipoComprobante.GetSelectedValuesM = "", "-1", DdlTipoComprobante.GetSelectedValuesM)
|
||||
Dim Sucursales As String = If(DdlSubProyecto.GetSelectedValuesM = "", "-1", DdlSubProyecto.GetSelectedValuesM)
|
||||
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
|
||||
Dim Estatus As String = If(DdlEstatus.GetSelectedValuesM = "", "-1", DdlEstatus.GetSelectedValuesM)
|
||||
Dim CveCondicionesPago As Integer = If(DdlCondicionesPago.SelectedValue = "", -1, DdlCondicionesPago.SelectedValue.ToEntero)
|
||||
Dim Vendedores As String = If(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM)
|
||||
Dim CveCliente As Integer = If(DdlClientes.SelectedValue = "", -1, DdlClientes.SelectedValue.ToEntero)
|
||||
|
||||
@@ -458,7 +461,7 @@ Partial Class RepVentaDetalle
|
||||
If ObjVentas.GetRepVentasDetalle(DdlGrupo.SelectedValue.ToEntero, Anio.ToEntero, Mes.ToEntero, AnioMes, Fecha, CveCliente,
|
||||
IVA, Vendedores, DdlUsuario.SelectedValue.ToEntero, Estatus, FechaI, FechaF,
|
||||
CveCorte.ToEntero, TipoComprobante, DdlSubProyectoEjecucion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, FechaIEjec, FechaFEjec,
|
||||
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
|
||||
CveProyecto, Sucursales, TipoCambio, TCEspecifico, CveMoneda, CveUsuarioConsulta:=UsuarioActual.CveUsuario, CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=CveCondicionesPago) Then
|
||||
DtVentas = AddRows(ObjVentas.DtResultados)
|
||||
ImgImprimir.Enabled = True
|
||||
GvDatos.DataSource = AddRows(ObjVentas.DtResultados)
|
||||
|
||||
@@ -276,6 +276,14 @@
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlClienteClasificacion" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteClasificacion_SelectedIndexChanged" runat="server" AppendDataBoundItems="true" CssClass="table-group-action-input form-control input-inline input-small input-sm select2me" DataTextField="ClienteClasificacion" DataValueField="CveClienteClasificacion"></asp:DropDownList>
|
||||
</div>
|
||||
<label title="Condiciones de Pago" data-toggle="tooltip" class="col-md-1 truncate">Condiciones Pago:</label>
|
||||
<div class="col-md-2">
|
||||
<asp:DropDownList ID="DdlCondicionesPago" runat="server" AppendDataBoundItems="true" Class="table-group-action-input form-control input-inline input-small input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
<asp:ListItem Text="Crédito" Value="1"></asp:ListItem>
|
||||
<asp:ListItem Text="Contado" Value="0"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -320,7 +320,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
If ObjVentas.GetRepVentas(FechaI, FechaF, FechaIEjec, FechaFEjec, CveCliente, DdlSubProyectoEjecucion.SelectedValue.ToEntero, Vendedores,
|
||||
DdlUsuario.SelectedValue.ToEntero, Estatus, "-1", UsuarioActual.CveEmpresa, DdlGrupo.SelectedValue.ToEntero, TipoComprobante, DdlProyecto.SelectedValue.ToEntero, Sucursales, RblTipoCambio.SelectedValue.ToEntero, TCEspecifico, CveUsuarioConsulta:=UsuarioActual.CveUsuario,
|
||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero) Then
|
||||
CveClienteClasificacion:=DdlClienteClasificacion.SelectedValue.ToEntero, CveCondicionesPago:=DdlCondicionesPago.SelectedValue.ToEntero) Then
|
||||
GvDatos.DataSource = ObjVentas.DtResultados
|
||||
DtVentas = ObjVentas.DtResultados
|
||||
Else
|
||||
@@ -420,7 +420,7 @@ Partial Class Ventas_RepVentas
|
||||
|
||||
|
||||
'LIGA A DETALLE
|
||||
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaI}&FechaF={FechaF}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}"
|
||||
Dim Liga As String = $"/Ventas/RepVentaDetalle.aspx?GPO={DdlGrupo.SelectedValue}&Anio={e.Row.DBCampo("Anio")}&Mes={e.Row.DBCampo("Mes")}&AnioMes={e.Row.DBCampo("AnioMes")}&Fecha={e.Row.DBCampo("Fecha")}&AnioEjec={e.Row.DBCampo("AnioEjec")}&MesEjec={e.Row.DBCampo("MesEjec")}&AnioMesEjec={e.Row.DBCampo("AnioMesEjec")}&FechaEjec={e.Row.DBCampo("FechaEjec")}&CveCliente={e.Row.DBCampo("CveCliente")}&CveVendedor={ e.Row.DBCampo("CveVendedor")}&CveUsuario={e.Row.DBCampo("CveUsuario")}&CveEstatusFactura={e.Row.DBCampo("CveEstatusFactura")}&FechaI={FechaI}&FechaF={FechaF}&FechaIEjec={FechaIEjec}&FechaFEjec={FechaFEjec}&IVA={e.Row.DBCampo("GPO_IVA")}&CveCorte={ e.Row.DBCampo("CveCorte")}&TipoDocto={ DdlTipoComprobante.GetSelectedValuesM}&CveSubProyectoEjecucion={e.Row.DBCampo("CveSubProyectoEjecucion")}&CveSubProyecto={CveSubProyecto}&CveProyecto={CveProyecto}&TipoCambio={TipoCambio}&TCEspecifico={TCEspecifico}&CveMoneda={CveMoneda}&CveClienteClasificacion={e.Row.DBCampo("CveClienteClasificacion")}&CveCondicionesPago={DdlCondicionesPago.SelectedValue}"
|
||||
|
||||
|
||||
e.Row.FCLiteral("LtlGrupo").Text = "<a class=""" & Css & """ href=""" & Liga & """>" & e.Row.FCLiteral("LtlGrupo").Text & "</a>"
|
||||
|
||||
@@ -1003,7 +1003,9 @@
|
||||
</table>
|
||||
<%--</asp:Panel>--%>
|
||||
|
||||
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False" DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle" CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
||||
<asp:GridView ID="GvPS" GridLines="None" runat="server" data-tableheader="#tbps" ShowHeader="true" AutoGenerateColumns="False"
|
||||
DataKeyNames="Consec,CvePS,Total, IEPS, CveClasificacion,CveUM,CveProyecto,CveSubProyecto,TipoDocto,PS,Obs,Cantidad,PU,Descuento,IVA,CantidadInventario,CantidadFacturadaRem,CveVentaDetalle"
|
||||
CssClass="table table-striped table-advance table-hover Widthall Sortable mysmallbtn ScrollAD" Style="min-width: 980px;">
|
||||
<Columns>
|
||||
<%--0--%>
|
||||
<asp:TemplateField ItemStyle-Font-Size="6pt">
|
||||
|
||||
@@ -101,6 +101,14 @@ Partial Class Ventas
|
||||
ViewState("TmpDT") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TmpDTDescNC As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("TmpDTDescNC")), Nothing, CType(ViewState("TmpDTDescNC"), DataTable))
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("TmpDTDescNC") = value
|
||||
End Set
|
||||
End Property
|
||||
Private Property TmpDTError As DataTable
|
||||
Get
|
||||
Return If(IsNothing(ViewState("TmpDTError")), Nothing, CType(ViewState("TmpDTError"), DataTable))
|
||||
@@ -2528,10 +2536,6 @@ Partial Class Ventas
|
||||
End If
|
||||
TxtFecha.Enabled = True
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" Then
|
||||
TbDescuentosRNC.Visible = True
|
||||
End If
|
||||
|
||||
CargaPorcentajeMarcas()
|
||||
End Sub
|
||||
|
||||
@@ -4224,10 +4228,12 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'Si es Empresa de Acumuladores
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
'Si ya se surtió y recibió
|
||||
If DbRowVenta("SaldoAlmacen").ToString.ToDecimal > 0 And (DtUsados Is Nothing Or DtUsados.Rows.Count = 0) Then
|
||||
If (DbRowVenta("SaldoAlmacen").ToString.ToDecimal > 0 And (DtUsados Is Nothing Or DtUsados.Rows.Count = 0)) OrElse (TmpDT.MAX("CveTipoPS") = "1") Then
|
||||
BtnsFacturar.Visible = True
|
||||
Else
|
||||
BtnsFacturar.Visible = False
|
||||
@@ -5682,12 +5688,12 @@ Partial Class Ventas
|
||||
'Dim TipoDescuento As Integer
|
||||
Dim Cantidad, PU, Descuento, CantidadInventario As Decimal
|
||||
Dim CuentaPredial As String
|
||||
|
||||
Cantidad = GvPS.Rows(e.RowIndex).FCTextBox("TxtCantidad").Text.ToDecimal
|
||||
PU = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtPrecio").Text.ToDecimal, 6)
|
||||
Descuento = Math.Round(GvPS.Rows(e.RowIndex).FCTextBox("TxtDescuento").Text.ToDecimal, NumeroDecimales)
|
||||
CuentaPredial = GvPS.Rows(e.RowIndex).FCTextBox("TxtPredial").Text.Trim
|
||||
|
||||
Dim CantidadOriginal As Decimal = GvPS.Rows(e.RowIndex).DataKey("Cantidad").ToDecimal()
|
||||
|
||||
Dim DatarowPS As DataRow = Nothing
|
||||
DatarowPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=TmpDT.Rows(e.RowIndex)("CvePS").ToString.ToEntero).FiltroPrimero("") ' Estado = -1
|
||||
@@ -5708,8 +5714,9 @@ Partial Class Ventas
|
||||
Dim CvePS As Integer = DatarowPS("CvePS").ToString.ToEntero
|
||||
|
||||
CantidadInventario = GvPS.Rows(e.RowIndex).DataKey("CantidadInventario").ToString.ToDecimal
|
||||
|
||||
Dim ValidaExistencia As Boolean = True
|
||||
If CantidadInventario > 0 Then 'si ya hay algo surtido, que no valide existencia
|
||||
If (CantidadInventario > 0) OrElse (Cantidad <= CantidadOriginal) Then 'si ya hay algo surtido, que no valide existencia
|
||||
ValidaExistencia = False
|
||||
End If
|
||||
|
||||
@@ -5747,7 +5754,7 @@ Partial Class Ventas
|
||||
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
|
||||
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
|
||||
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
|
||||
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -7234,18 +7241,7 @@ Partial Class Ventas
|
||||
|
||||
'DETALLES
|
||||
If NCDescuento Then
|
||||
ObjFacturaDevolucion.DtDetalle = CreaDTDetalleNCDescuento()
|
||||
|
||||
ObjFacturaDevolucion.SubTotal = ObjFacturaDevolucion.DtDetalle.SUM("Total").ToDecimal()
|
||||
ObjFacturaDevolucion.Descuento = ObjFacturaDevolucion.DtDetalle.SUM("Descuento").ToDecimal()
|
||||
ObjFacturaDevolucion.Amortizacion = 0
|
||||
ObjFacturaDevolucion.IVA = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIVA").ToDecimal()
|
||||
ObjFacturaDevolucion.RetIVA = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetIVA").ToDecimal()
|
||||
ObjFacturaDevolucion.RetISR = ObjFacturaDevolucion.DtDetalle.SUM("ImporteRetISR").ToDecimal()
|
||||
ObjFacturaDevolucion.IEPS = ObjFacturaDevolucion.DtDetalle.SUM("ImporteIEPS").ToDecimal()
|
||||
|
||||
Dim Total As Decimal = (ObjFacturaDevolucion.SubTotal + ObjFacturaDevolucion.IVA + ObjFacturaDevolucion.IEPS) - (ObjFacturaDevolucion.Descuento + ObjFacturaDevolucion.RetIVA + ObjFacturaDevolucion.RetISR + ObjFacturaDevolucion.Amortizacion)
|
||||
ObjFacturaDevolucion.Total = Total
|
||||
PreparaNCDescuento(ObjFacturaDevolucion)
|
||||
Else
|
||||
ObjFacturaDevolucion.DtDetalle = TmpDT
|
||||
|
||||
@@ -7403,8 +7399,9 @@ Partial Class Ventas
|
||||
DtVentasNC.Rows(0)("TCCambioValuacion") = factura.TipoCambio
|
||||
End If
|
||||
|
||||
ObjFacturaDevolucion.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
||||
factura.Timbre = PreParaTimbre(ObjFacturaDevolucion)
|
||||
|
||||
factura.CveVentaPadre = Me.CveVenta
|
||||
'Registramos la venta
|
||||
GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, factura, factura.DtDetalle, -1, ObjContPaq, ObjBancos, EsNCAmortizacion:=True, NCDescuento:=True)
|
||||
|
||||
@@ -13726,6 +13723,10 @@ Partial Class Ventas
|
||||
|
||||
If ValidaAgregarPS(CvePS, DdlUnidadMedida.SelectedValue.ToEntero, TxtPrecio.Text.Trim.ToDouble, HdnTipoPS.Value.ToEntero) Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" AndAlso Not TbDescuentosRNC.Visible Then
|
||||
TbDescuentosRNC.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(507) = DdlPS.SelectedValue Then
|
||||
CvePSAmortizacion = DdlPS.SelectedValue.ToEntero.ToEntero
|
||||
End If
|
||||
@@ -13760,8 +13761,57 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(TxtCantidad.Text.ToDecimal, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
|
||||
CvePS, "", TxtObsPS.Text.Trim, If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal), Descuento,
|
||||
Dim Cantidad As Decimal = TxtCantidad.Text.ToDecimal
|
||||
Dim PU As Decimal = If(CvePSAmortizacion > 0, TxtPrecio.Text.Trim.ToDecimal * -1, TxtPrecio.Text.Trim.ToDecimal)
|
||||
|
||||
Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
|
||||
|
||||
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
|
||||
If DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
|
||||
'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
|
||||
If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
|
||||
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
|
||||
'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
|
||||
If RowPorcentaje IsNot Nothing Then
|
||||
Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
|
||||
Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
|
||||
Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
|
||||
|
||||
Dim TotalInicial = (Cantidad * (PU)) - Descuento
|
||||
Dim TotalFinal = TotalInicial
|
||||
'SI APLICA EL PRIMER DESCUENTO
|
||||
If PorcentajeProducto > 0 Then
|
||||
Dim Descuento1 = TotalInicial * PorcentajeProducto
|
||||
Dim Total2 = (TotalInicial - Descuento1)
|
||||
|
||||
'SI APLICA EL SEGUNDO DESCUENTO
|
||||
If PorcentajeProducto2 > 0 Then
|
||||
Dim Descuento2 = Total2 * PorcentajeProducto2
|
||||
Dim Total3 = (Total2 - Descuento2)
|
||||
|
||||
'SI APLICA EL TERCER DESCUENTO
|
||||
If PorcentajeProducto3 > 0 Then
|
||||
Dim Descuento3 = Total3 * PorcentajeProducto3
|
||||
TotalFinal = Total3 - Descuento3
|
||||
Else
|
||||
TotalFinal = Total3
|
||||
End If
|
||||
Else
|
||||
TotalFinal = Total2
|
||||
End If
|
||||
Else
|
||||
TotalFinal = TotalInicial
|
||||
End If
|
||||
|
||||
Descuento += ((Cantidad * PU) - TotalFinal)
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero, DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text,
|
||||
CvePS, "", TxtObsPS.Text.Trim, PU, Descuento,
|
||||
DdlProyecto.SelectedValue.ToEntero, DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text,
|
||||
SerieLote:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS)
|
||||
|
||||
@@ -13987,49 +14037,49 @@ Partial Class Ventas
|
||||
DrPS("IEPSPorcentaje") = 0
|
||||
End If
|
||||
|
||||
'VERIFICA SI APLICAN CONDICIONES COMERCIALES
|
||||
If DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
|
||||
'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
|
||||
If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
|
||||
Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
|
||||
'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
|
||||
If RowPorcentaje IsNot Nothing Then
|
||||
Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
|
||||
Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
|
||||
Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
|
||||
''VERIFICA SI APLICAN CONDICIONES COMERCIALES
|
||||
'If DtPorcentajeMarcas IsNot Nothing AndAlso DtPorcentajeMarcas.Rows.Count > 0 Then
|
||||
' 'VERIFICA SI EL PRODUCTO TIENE ESPECIFICADA UNA MARCA
|
||||
' If Not String.IsNullOrEmpty(DrPS("CveMarca").ToString()) AndAlso DrPS("CveMarca").ToString().ToEntero() > 0 Then
|
||||
' Dim RowPorcentaje = DtPorcentajeMarcas.FiltroPrimero($"CveMarca={DrPS("CveMarca").ToString()}")
|
||||
' 'REALIZA LOS DESCUENTOS DE ACUERDO AL PORCENTAJE POR MARCA
|
||||
' If RowPorcentaje IsNot Nothing Then
|
||||
' Dim PorcentajeProducto = RowPorcentaje("PorcentajeProducto").ToString().ToDecimal() / 100D
|
||||
' Dim PorcentajeProducto2 = RowPorcentaje("PorcentajeProducto2").ToString().ToDecimal() / 100D
|
||||
' Dim PorcentajeProducto3 = RowPorcentaje("PorcentajeProducto3").ToString().ToDecimal() / 100D
|
||||
|
||||
Dim TotalInicial = (Cantidad * (PU)) - Descuento
|
||||
Dim TotalFinal = TotalInicial
|
||||
'SI APLICA EL PRIMER DESCUENTO
|
||||
If PorcentajeProducto > 0 Then
|
||||
Dim Descuento1 = TotalInicial * PorcentajeProducto
|
||||
Dim Total2 = (TotalInicial - Descuento1)
|
||||
' Dim TotalInicial = (Cantidad * (PU)) - Descuento
|
||||
' Dim TotalFinal = TotalInicial
|
||||
' 'SI APLICA EL PRIMER DESCUENTO
|
||||
' If PorcentajeProducto > 0 Then
|
||||
' Dim Descuento1 = TotalInicial * PorcentajeProducto
|
||||
' Dim Total2 = (TotalInicial - Descuento1)
|
||||
|
||||
'SI APLICA EL SEGUNDO DESCUENTO
|
||||
If PorcentajeProducto2 > 0 Then
|
||||
Dim Descuento2 = Total2 * PorcentajeProducto2
|
||||
Dim Total3 = (Total2 - Descuento2)
|
||||
' 'SI APLICA EL SEGUNDO DESCUENTO
|
||||
' If PorcentajeProducto2 > 0 Then
|
||||
' Dim Descuento2 = Total2 * PorcentajeProducto2
|
||||
' Dim Total3 = (Total2 - Descuento2)
|
||||
|
||||
'SI APLICA EL TERCER DESCUENTO
|
||||
If PorcentajeProducto3 > 0 Then
|
||||
Dim Descuento3 = Total3 * PorcentajeProducto3
|
||||
TotalFinal = Total3 - Descuento3
|
||||
Else
|
||||
TotalFinal = Total3
|
||||
End If
|
||||
Else
|
||||
TotalFinal = Total2
|
||||
End If
|
||||
Else
|
||||
TotalFinal = TotalInicial
|
||||
End If
|
||||
' 'SI APLICA EL TERCER DESCUENTO
|
||||
' If PorcentajeProducto3 > 0 Then
|
||||
' Dim Descuento3 = Total3 * PorcentajeProducto3
|
||||
' TotalFinal = Total3 - Descuento3
|
||||
' Else
|
||||
' TotalFinal = Total3
|
||||
' End If
|
||||
' Else
|
||||
' TotalFinal = Total2
|
||||
' End If
|
||||
' Else
|
||||
' TotalFinal = TotalInicial
|
||||
' End If
|
||||
|
||||
Descuento += ((Cantidad * PU) - TotalFinal)
|
||||
' Descuento += ((Cantidad * PU) - TotalFinal)
|
||||
|
||||
End If
|
||||
End If
|
||||
' End If
|
||||
' End If
|
||||
|
||||
End If
|
||||
'End If
|
||||
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
|
||||
|
||||
Row("PU") = PU
|
||||
@@ -15182,9 +15232,7 @@ Partial Class Ventas
|
||||
|
||||
If DtMovimientos.Rows.Count > 0 Then
|
||||
Dim GeneroMovimientoAlmacen As Boolean = False
|
||||
|
||||
For Each dr As DataRow In DtMovimientos.Rows
|
||||
|
||||
'Obtenemos los Movimientos de salida
|
||||
If ObjInventario.GetMovimientos(dr("CveMovimiento").ToString.ToEntero, ConceptoMovimiento, -1, UsuarioActual.CveEmpresa) Then
|
||||
|
||||
@@ -15210,32 +15258,69 @@ Partial Class Ventas
|
||||
If ErrorList.Count = 0 AndAlso MovDetalle.Rows.Count > 0 Then
|
||||
Dim CveMovimientoSalidaPorTraspaso As Integer = -1
|
||||
|
||||
'SALIDA DEFINITIVA DEL SISTEMA
|
||||
If UsuarioActual.Empresa.Funcionalidad(575) = "1" Then
|
||||
'Le damos salida normal
|
||||
If ConSalida Then
|
||||
|
||||
'Le damos salida de apartado por traspaso
|
||||
CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada)
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 40, CveMoneda, CveRemision, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
|
||||
|
||||
If Not CveMovimientoSalidaPorTraspaso > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
|
||||
'Le damos entrada al general por traspaso
|
||||
If Not OcurrioError Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 9, CveMoneda, CveRemision, CveMovimientoRelacionado:=CveMovimientoSalidaPorTraspaso) > 0
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, ObjFactura) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
'Le damos salida de apartado por traspaso
|
||||
CveMovimientoSalidaPorTraspaso = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenSalida, 8, CveMoneda, CveRemision, AplicaMovimientoDetalleEntrada:=AplicaMovimientoDetalleEntrada)
|
||||
|
||||
If Not CveMovimientoSalidaPorTraspaso > 0 Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
'Le damos salida normal
|
||||
If ConSalida AndAlso Not OcurrioError Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 3, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
|
||||
'Le damos entrada al general por traspaso
|
||||
If Not OcurrioError Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 9, CveMoneda, CveRemision, CveMovimientoRelacionado:=CveMovimientoSalidaPorTraspaso) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
'Le damos salida normal
|
||||
If ConSalida AndAlso Not OcurrioError Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, ObjFactura) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
GeneroMovimientoAlmacen = GenerarMovimientoAlmacen(ObjInventario, MovDetalle, CveAlmacenEntrada, 3, CveMoneda, ObjFactura.CveVenta, MovimientoPrePoliza:=True, ObjConta:=ObjConta) > 0
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not GeneroMovimientoAlmacen Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -15250,6 +15335,24 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
ElseIf ObjInventario.GetMovimientos(dr("CveMovimiento").ToString.ToEntero, 3, -1, UsuarioActual.CveEmpresa) Then
|
||||
'If UsuarioActual.Empresa.Funcionalidad(573) = "1" Then
|
||||
' Dim CveTipoAlmacen As Integer = ObjInventario.DtResultados.Rows(0)("CveTipoAlmacen").ToString().ToEntero()
|
||||
' If CveTipoAlmacen = 24 Then
|
||||
' Dim RowMov As DataRow = ObjInventario.DtResultados.Rows(0)
|
||||
|
||||
' Dim CveMovimientoSalida As Integer = RowMov("CveMovimiento").ToString().ToEntero()
|
||||
' Dim CveAlmacen As Integer = RowMov("CveAlmacen").ToString().ToEntero()
|
||||
' Dim CveMoneda As Integer = RowMov("CveMoneda").ToString().ToEntero()
|
||||
|
||||
' GeneroMovimientoAlmacen = GenerarMovimientoAlmacenVirtual(ObjInventario, CveMovimientoSalida, CveAlmacen, CveMoneda) > 0
|
||||
|
||||
' If Not GeneroMovimientoAlmacen Then
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
|
||||
'Esquema viejo, evitamos que aparezca por surtir
|
||||
If Not ObjInventario.ActualizarEsDevolucionVenta(ObjFactura.CveVenta, 2) Then
|
||||
OcurrioError = True
|
||||
@@ -15478,6 +15581,121 @@ Partial Class Ventas
|
||||
End If
|
||||
'Return Not OcurrioError
|
||||
|
||||
End Function
|
||||
Private Function GenerarMovimientoAlmacenVirtual(ByRef ObjInventario As ClsInventarios, ObjFactura As Modelos.Factura) As Integer
|
||||
Dim OcurrioError As Boolean = False
|
||||
Dim CveMovimientoVirtual As Integer = -1
|
||||
|
||||
Dim DtPSVirtual As New DataTable("DtTamanios")
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CvePS", GetType(Integer)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("Cantidad", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("PU", GetType(Decimal)))
|
||||
DtPSVirtual.Columns.Add(New DataColumn("CveUM", GetType(Integer)))
|
||||
|
||||
Dim DtTamanios As DataTable = Nothing
|
||||
Dim ObjAcumuladores As New ClsAcumuladores
|
||||
If ObjAcumuladores.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
|
||||
DtTamanios = ObjAcumuladores.DtResultados.Copy()
|
||||
End If
|
||||
ObjAcumuladores.Dispose()
|
||||
|
||||
Dim CveConceptoMovimientoVirtual As Integer = 3
|
||||
Dim CveAlmacenVirtual As Integer = -1
|
||||
|
||||
For Each GvRow As DataRow In ObjFactura.DtDetalle.Rows
|
||||
For Each Tam As DataRow In DtTamanios.Rows
|
||||
If Tam("CveTamaño").ToString() = GvRow("CveTamaño").ToString() Then
|
||||
Dim CvePSCargo = Tam("CvePSCargo").ToString().ToEntero()
|
||||
Dim Row As DataRow = DtPSVirtual.NewRow()
|
||||
|
||||
Row("CvePS") = CvePSCargo
|
||||
Row("Cantidad") = GvRow("Cantidad").ToString().ToDecimal()
|
||||
Row("PU") = 0
|
||||
Row("CveUM") = GvRow("CveUM").ToString().ToEntero()
|
||||
|
||||
DtPSVirtual.Rows.Add(Row)
|
||||
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
CveAlmacenVirtual = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 24).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={ObjFactura.CveSubProyecto}").ToEntero()
|
||||
|
||||
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 AndAlso CveAlmacenVirtual > 0 Then
|
||||
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, CveConceptoMovimientoVirtual, 1, TxtFecha.Text.ToDate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, ObjFactura.CveVenta, -1, -1)
|
||||
|
||||
If CveMovimientoVirtual > 0 Then
|
||||
For Each RowUsado As DataRow In DtPSVirtual.Rows
|
||||
Dim CvePS = RowUsado("CvePS").ToString().ToEntero()
|
||||
Dim CantidadUsado As Double = RowUsado("Cantidad").ToString().ToDouble()
|
||||
Dim PU As Double = RowUsado("PU").ToString().ToDouble()
|
||||
Dim CveUM As Integer = RowUsado("CveUM").ToString().ToEntero()
|
||||
|
||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoVirtual, CantidadUsado, CveUM, CvePS, PU, -1) Then
|
||||
OcurrioError = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
Else
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
If DtPSVirtual.Rows.Count = 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
|
||||
'Dim ContadorMovtosDetalles = 0
|
||||
|
||||
'Dim DtMovDetalle As DataTable = Nothing
|
||||
'If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||
' DtMovDetalle = ObjInventario.DtResultados.Copy()
|
||||
'End If
|
||||
|
||||
''Creamos el movimiento
|
||||
'Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, 2, CveMoneda, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, CveMovimientoRelacionado:=CveMovimientoSalida)
|
||||
|
||||
'If CveMovimientoInventario > 0 Then
|
||||
|
||||
' 'Agregamos los detalles
|
||||
' For Each MovDet As DataRow In DtMovDetalle.Rows
|
||||
' Dim Cantidad = MovDet("Cantidad").ToString.ToDecimal
|
||||
' Dim CveUnidad As Integer = MovDet("CveUM").ToString.ToEntero
|
||||
' Dim PU As Decimal = MovDet("PU").ToString.ToDecimal
|
||||
' Dim CveProducto As Integer = MovDet("CvePS").ToString.ToEntero
|
||||
' Dim SerieLote As String = MovDet("SerieLote").ToString
|
||||
|
||||
' If Cantidad < 0 Then
|
||||
' Alert("Ocurrió un Error al generar los movimientos de almacén. Por favor comuniquese con atención SIG.", TipoMensaje.MsgError)
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' If ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, PU, -1, SerieLote:=SerieLote) Then
|
||||
' ContadorMovtosDetalles += 1
|
||||
' Else
|
||||
' OcurrioError = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' 'VALIDA QUE SE HALLAN AGREGADO DETALLES AL MOVIMIENTO
|
||||
' If ContadorMovtosDetalles = 0 Then
|
||||
' OcurrioError = True
|
||||
' End If
|
||||
|
||||
'Else
|
||||
' OcurrioError = True
|
||||
'End If
|
||||
|
||||
If OcurrioError Then
|
||||
Return -1
|
||||
Else
|
||||
Return CveMovimientoVirtual
|
||||
End If
|
||||
|
||||
End Function
|
||||
Private Function SalidaAlmacenMateriales(ByRef ObjInventario As ClsInventarios, CveOS As Integer, ByRef ObjConta As ClsContabilidad, ConSalida As Boolean, ConceptoMovimiento As Integer) As Boolean
|
||||
Dim TieneError As Boolean = False
|
||||
@@ -16841,18 +17059,25 @@ Partial Class Ventas
|
||||
End Sub
|
||||
Private Function ValidaPagosContado() As Boolean
|
||||
Dim Retorno = False
|
||||
'SI TIENE SALDO PENDIENTE VALIDA SI TIENE PAGOS
|
||||
If Me.SaldoVenta > 0 Then
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso (UsuarioActual.Empresa.Funcionalidad(531) = "1") AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) And TxtTotal.Text.ToDecimal > 0 Then
|
||||
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Rem", "Ant") AndAlso (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) And TxtTotal.Text.ToDecimal > 0 Then
|
||||
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" Then
|
||||
Dim TotalNC As Decimal = If(ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0, ListaNCDesc.Sum(Function(f) f.TotalRemNCAplicado), 0)
|
||||
If TotalNC > 0 Then
|
||||
If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TotalNC Then
|
||||
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
If UsuarioActual.Empresa.Funcionalidad(572) = "1" Then
|
||||
Dim TotalNC As Decimal = If(ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0, LblTotalNC.Text.Trim().ToDecimal(), 0)
|
||||
If TotalNC > 0 Then
|
||||
If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TotalNC Then
|
||||
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
End If
|
||||
Else
|
||||
If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then
|
||||
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then
|
||||
@@ -16860,11 +17085,6 @@ Partial Class Ventas
|
||||
Retorno = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If (DtPagos.SUM("Importe").ToString.ToDecimal + Total - TxtCambio.Text.ToDecimal) > TxtTotal.Text.ToDecimal Then
|
||||
Alert("El importe de los pagos no puede exceder el importe de la factura. Por favor verifique.", TipoMensaje.MsgAdvertencia)
|
||||
Retorno = True
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Retorno
|
||||
@@ -20626,7 +20846,7 @@ Partial Class Ventas
|
||||
Private Sub CargaCxC()
|
||||
Dim ObjMovtos As New ClsMovimientos()
|
||||
If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, DdlSucursalCliente.SelectedValue.ToEntero) Then
|
||||
Dim DtTemporal As DataTable = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento")
|
||||
Dim DtTemporal As DataTable = ObjMovtos.DtResultados.FiltraParametros("TipoDocto <> 'RNC' AND Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento")
|
||||
GvCxC.DataSource = DtTemporal
|
||||
End If
|
||||
ObjMovtos.Dispose()
|
||||
@@ -20726,10 +20946,8 @@ Partial Class Ventas
|
||||
|
||||
If AplicaNCMasiva Then
|
||||
If NCDescuento Then
|
||||
For Each Gvr As GridViewRow In GvDescNC.Rows
|
||||
If Gvr.FCCheckBox("ChkAplicar").Checked Then
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(Gvr.DataKey("CveVenta").ToString.ToEntero, Gvr.FCTextBox("TxtImporte").Text.ToString.ToDecimal), True, MissingSchemaAction.Ignore)
|
||||
End If
|
||||
For Each RNC In ListaNCDesc
|
||||
DtImpuestos.Merge(CargaDtImpuestosNC(RNC.CveVenta, RNC.TotalRemNCAplicado, NCDescuento:=True), True, MissingSchemaAction.Ignore)
|
||||
Next
|
||||
Else
|
||||
For Each Gvr As GridViewRow In GvCxC.Rows
|
||||
@@ -20780,14 +20998,32 @@ Partial Class Ventas
|
||||
|
||||
AplicaNC = True
|
||||
|
||||
If Not NCDescuento Then
|
||||
If NCDescuento Then
|
||||
TmpDTDescNC = TmpDT.Clone()
|
||||
TmpDTDescNC.Clear()
|
||||
|
||||
For Each Dr As DataRow In DtImpuestos.Rows
|
||||
AgregaTempDT(TmpDTDescNC, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
|
||||
DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal,
|
||||
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1,
|
||||
DrPS("SATClavePS").ToString, DrPS("SATClaveUnidadMedida").ToString, -1, -1, -1, -1, -1, -1)
|
||||
Next
|
||||
|
||||
TrTipoRelacion.Visible = True
|
||||
DdlTiposRelacion.SelectedValueExist("1")
|
||||
|
||||
'verifica el tipo de cambio que se actualice
|
||||
If DdlMoneda.SelectedValue <> "1" Then
|
||||
TxtTipoCambio.Text = GlobalTipoCambio(Now).ToString
|
||||
End If
|
||||
Else
|
||||
If DdlTipoComprobante.SelectedValue = "Ant" Then CveAnticipo = CveVenta
|
||||
|
||||
DdlTipoComprobante.SelectedValueExist("Egs")
|
||||
|
||||
For Each Dr As DataRow In DtImpuestos.Rows
|
||||
AgregaTempDT(DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
|
||||
AgregaTempDT(TmpDT, DrPS("CvePS").ToString.ToEntero, DrPS("PS").ToString, DrPS("Codigo").ToString, DrPS("PSCodigo").ToString, DrPS("CveTipoPS").ToString.ToEntero, DrPS("Inv_CveMetodoInventario").ToString.ToEntero,
|
||||
DrPS("CveUM").ToString.ToEntero, DrPS("UnidadMedida").ToString, DrPS("CveClasificacion").ToString.ToEntero, DrPS("Clasificacion").ToString, CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
|
||||
TxtNCObservaciones.Text.Trim, 1, Dr("ImportePU").ToString.ToDecimal, Dr("PorcentajeIVA").ToString.ToDecimal, Dr("ImporteIVA").ToString.ToDecimal, Dr("PorcentajeRetIVA").ToString.ToDecimal, Dr("ImporteRetIVA").ToString.ToDecimal,
|
||||
Dr("PorcentajeRetISR").ToString.ToDecimal, Dr("ImporteRetISR").ToString.ToDecimal, Dr("PorcentajeIEPS").ToString.ToDecimal, Dr("ImporteIEPS").ToString.ToDecimal, -1, 0.0, Dr("ImporteTotal").ToString.ToDecimal, "", "", -1, -1,
|
||||
@@ -20817,14 +21053,14 @@ Partial Class Ventas
|
||||
|
||||
LBNotaCredito.Visible = False
|
||||
CambiaTipoDocto()
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal) As DataTable
|
||||
Private Function CargaDtImpuestosNC(CveVentaNC As Integer, Importe As Decimal, Optional NCDescuento As Boolean = False) As DataTable
|
||||
Dim Total As Decimal = 0, SubTotal As Decimal = 0, Saldo As Decimal = 0
|
||||
|
||||
Dim TmpDT As DataTable = Nothing
|
||||
Dim ObjVentas As New ClsVentas
|
||||
|
||||
If ObjVentas.GetVentaDetalle(CveVentaNC) Then
|
||||
@@ -20874,12 +21110,15 @@ Partial Class Ventas
|
||||
DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal") = DtImpuestosLocal.Rows(DtImpuestosLocal.Rows.Count - 1)("ImporteTotal").ToString.ToDecimal + difTmp
|
||||
End If
|
||||
|
||||
If Not NCDescuento Then
|
||||
Me.TmpDT = TmpDT
|
||||
End If
|
||||
'CARGA FACTURA A LA CUAL SE APLICA LA NC
|
||||
'CargaNCDT(CveVentaNC, Importe.ToDecimal)
|
||||
Return DtImpuestosLocal
|
||||
End Function
|
||||
|
||||
Private Sub AgregaTempDT(CvePS As Integer, PS As String, Codigo As String, CodigoPS As String, CveTipoPS As Integer, CveTipoInvPS As Integer, CveUM As Integer, UM As String,
|
||||
Private Sub AgregaTempDT(ByRef TmpDT As DataTable, CvePS As Integer, PS As String, Codigo As String, CodigoPS As String, CveTipoPS As Integer, CveTipoInvPS As Integer, CveUM As Integer, UM As String,
|
||||
CveClasificacion As Integer, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String,
|
||||
Obs As String, Cantidad As Double, PU As Double, PorcentajeIVA As Double, ImporteIVA As Double, PorcentajeRetIVA As Double, ImporteRetIVA As Double,
|
||||
PorcentajeRetISR As Double, ImporteRetISR As Double, PorcentajeIEPS As Double, ImporteIEPS As Double, TipoDescuento As Integer, Descuento As Double,
|
||||
@@ -21160,7 +21399,7 @@ Partial Class Ventas
|
||||
Dim ImporteRetISR As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeRetISR").ToString.ToDecimal
|
||||
Dim ImporteIEPS As Decimal = TotalImpuestos * Gv.DataKey("PorcentajeIEPS").ToString.ToDecimal
|
||||
|
||||
AgregaTempDT(Gv.DataKey("CvePS").ToString.ToEntero, Gv.DataKey("PS").ToString, Gv.DataKey("Codigo").ToString, Gv.DataKey("CodigoPS").ToString,
|
||||
AgregaTempDT(TmpDT, Gv.DataKey("CvePS").ToString.ToEntero, Gv.DataKey("PS").ToString, Gv.DataKey("Codigo").ToString, Gv.DataKey("CodigoPS").ToString,
|
||||
Gv.DataKey("CveTipoPS").ToString.ToEntero, Gv.DataKey("CveTipoInvPS").ToString.ToEntero,
|
||||
Gv.DataKey("CveUM").ToString.ToEntero, Gv.DataKey("UM").ToString, Gv.DataKey("CveClasificacion").ToString.ToEntero,
|
||||
Gv.DataKey("Clasificacion").ToString, Gv.DataKey("CveProyecto").ToString.ToEntero, Gv.DataKey("Proyecto").ToString,
|
||||
@@ -23412,7 +23651,7 @@ Partial Class Ventas
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "D E S C U E N T O S X R E M I S I O N D E N O T A D E C R E D I T O"
|
||||
Protected Sub BtnAplicarRemisionNC_Click(sender As Object, e As EventArgs)
|
||||
If ListaRemisionesNC Is Nothing Then
|
||||
ListaRemisionesNC = New List(Of Modelos.Factura)
|
||||
@@ -23498,107 +23737,32 @@ Partial Class Ventas
|
||||
|
||||
RegistraScript("$('#ModalAplicarDescuentoNC').modal('hide'); ")
|
||||
End Sub
|
||||
Protected Sub PreparaNCDescuento(ByRef factura As Modelos.Factura)
|
||||
If TmpDTDescNC IsNot Nothing Then
|
||||
factura.DtDetalle = TmpDTDescNC
|
||||
'**** IMPUESTOS LOCALES
|
||||
|
||||
Protected Function CreaDTDetalleNCDescuento() As DataTable
|
||||
Dim Dt As DataTable = TmpDT.Clone()
|
||||
Dt.Rows.Clear()
|
||||
Dim TotalSubTotal As Decimal = TmpDTDescNC.SUM("TotalImporte").ToDecimal
|
||||
Dim TotalDescuentos As Decimal = TmpDTDescNC.SUM("Descuento").ToDecimal
|
||||
|
||||
Dim CveSATNC = "84111506"
|
||||
Dim DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1).Rows(0)
|
||||
Dim TotalIVA As Decimal = TmpDTDescNC.SUM("ImporteIVA").ToDecimal
|
||||
Dim TotalIEPS As Decimal = TmpDTDescNC.SUM("ImporteIEPS").ToDecimal
|
||||
Dim TotalRetIVA As Decimal = TmpDTDescNC.SUM("ImporteRetIVA").ToDecimal
|
||||
Dim TotalRetISR As Decimal = TmpDTDescNC.SUM("ImporteRetISR").ToDecimal
|
||||
Dim Total As Decimal = 0
|
||||
Dim TotalImpuestosLocales As Decimal = 0
|
||||
Total = (TotalSubTotal - TotalDescuentos + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
|
||||
|
||||
factura.SubTotal = TotalSubTotal
|
||||
factura.Descuento = TotalDescuentos
|
||||
factura.IVA = TotalIVA
|
||||
factura.IEPS = TotalIEPS
|
||||
factura.RetIVA = TotalRetIVA
|
||||
factura.RetISR = TotalRetISR
|
||||
factura.Total = Total
|
||||
|
||||
If DrPS Is Nothing Then
|
||||
Alert("Ocurrió un error al cargar la información del Producto. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||
Return Dt
|
||||
End If
|
||||
Dim CvePS = DrPS("CvePS").ToString().ToEntero()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Dim TotalCalculableImpuestos As Decimal = 0
|
||||
Dim PU = Math.Round(ListaNCDesc.Sum(Function(RNC) RNC.TotalRemNCAplicado), 6) ' el precio unitario puede llevar hasta 6 decimales permitidos
|
||||
Dim Cantidad As Decimal = 1
|
||||
Dim Descuento As Decimal = 0
|
||||
|
||||
Dim Row As DataRow = Dt.NewRow()
|
||||
Row("CveProyecto") = DdlProyecto.SelectedValue.ToEntero()
|
||||
Row("Proyecto") = DdlProyecto.SelectedItem.Text
|
||||
Row("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToEntero()
|
||||
Row("SubProyecto") = DdlSubProyecto.SelectedItem.Text
|
||||
Row("SerieLote") = "-1"
|
||||
Row("TiempoEntrega") = ""
|
||||
Row("Orden") = Dt.Rows.Count + 1
|
||||
Row("Cantidad") = Cantidad
|
||||
Row("CveUM") = DrPS("CveUM").ToString().ToEntero()
|
||||
Row("UM") = ""
|
||||
Row("CveClasificacion") = DrPS("CveClasificacion").ToString().ToEntero()
|
||||
Row("Clasificacion") = ""
|
||||
Row("CvePS") = CvePS
|
||||
Row("Obs") = ""
|
||||
|
||||
TotalCalculableImpuestos = (Cantidad * (PU)) - Descuento
|
||||
|
||||
Row("PU") = PU
|
||||
Row("Codigo") = DrPS("Codigo")
|
||||
Row("NoIdentificacion") = DrPS("Codigo")
|
||||
Row("ClaveSATFraccionArancelaria") = DrPS("ClaveSATFraccionArancelaria")
|
||||
Row("ClaveSATUnidadAduana") = DrPS("ClaveSATUnidadAduana")
|
||||
Row("ClaveSATFraccionArancelariaDescripcion") = DrPS("ClaveSATFraccionArancelariaDescripcion")
|
||||
Row("ClaveSATUnidadAduanaDescripcion") = DrPS("ClaveSATUnidadAduanaDescripcion")
|
||||
|
||||
If Modalidad = "U" Then
|
||||
Row("Consec") = Index
|
||||
Else
|
||||
Row("Consec") = TmpDT.Rows.Count + 1
|
||||
End If
|
||||
|
||||
Row("PS") = DrPS("PS")
|
||||
Row("CodigoPS") = DrPS("PSCodigo").ToString
|
||||
Row("CveTipoPS") = DrPS("CveTipoPS")
|
||||
Row("CveTipoInvPS") = DrPS("Inv_CveMetodoInventario")
|
||||
Row("CveTamaño") = DrPS("CveTamaño")
|
||||
Row("CveClasificacion") = DrPS("CveClasificacion")
|
||||
Row("Clasificacion") = DrPS("Clasificacion")
|
||||
|
||||
If DrPS("IVA").ToString.Contiene("-1", "") Then
|
||||
Row("PorcentajeIVA") = PorcentajeIVA
|
||||
Else
|
||||
Row("PorcentajeIVA") = DrPS("IVA")
|
||||
End If
|
||||
|
||||
Row("IVA") = Row("PorcentajeIVA")
|
||||
Row("ImporteIVA") = Math.Round(Row("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
|
||||
Row("ImporteRetIVA") = Math.Round(ClienteRetIVA * TotalCalculableImpuestos, NumeroDecimales)
|
||||
Row("ImporteRetISR") = Math.Round(ClienteRetISR * TotalCalculableImpuestos, NumeroDecimales)
|
||||
Row("PorcentajeRetIVA") = ClienteRetIVA
|
||||
Row("PorcentajeRetISR") = ClienteRetISR
|
||||
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
|
||||
Row("ImporteIEPS") = Math.Round(DrPS("IEPSPorcentaje").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
|
||||
Row("IEPS") = Row("ImporteIEPS")
|
||||
Row("Descuento") = Math.Round(Descuento, NumeroDecimales)
|
||||
Row("TipoDescuento") = HdnTipoDescuento.Value
|
||||
Row("Total") = (Cantidad * PU)
|
||||
Row("TotalImporte") = Math.Round(Cantidad * PU, NumeroDecimales)
|
||||
|
||||
Row("SATClaveProdServ") = DrPS("SATClavePS")
|
||||
Row("SATClaveUM") = DrPS("SATClaveUnidadMedida")
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC Then
|
||||
Row("CvePresupuestoIngreso") = Me.DdlFuenteRecaudacion.SelectedValue
|
||||
End If
|
||||
|
||||
Row("EntregaDirecta") = -1
|
||||
'Contratos
|
||||
Row("CveContratoDetalle") = -1
|
||||
Row("CveVentaDetalle") = -1
|
||||
Row("CveMovimientoDetallePedido") = -1
|
||||
Row("CveOrdenCompraDetalle") = -1
|
||||
Row("CveVentaDetalleRemision") = -1
|
||||
Row("CveVentaDetalleCotizacion") = -1
|
||||
Row("CveVentaDetallePedido2") = -1
|
||||
Row("CuentaPredial") = "-1"
|
||||
Row("Consec") = 1
|
||||
|
||||
'RECARGAR GV
|
||||
Dt.Rows.Add(Row)
|
||||
|
||||
Return Dt
|
||||
End Function
|
||||
End Class
|
||||
Reference in New Issue
Block a user