GDiaz - Compras Prontos Pagos
This commit is contained in:
@@ -9010,6 +9010,22 @@ Public Class ClsPaginas
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, ConPrepAplicacion.CveConcepto, Pago.Referencia, Concepto, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Pago.TipoPago.Contiene("RNC") AndAlso Not ErrorMovtos Then ' R E M I S I Ó N D E N O T A D E C R E D I T O
|
||||
'371
|
||||
Dim ConPrepAplicacion As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(15, Pago.CveMonedaPago, True, CompraActual.CveTipoConceptoProveedor)
|
||||
|
||||
If Pago.CveMonedaPago > 1 Then
|
||||
'Agregamos la Extranjera
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 371, Pago.Referencia, Concepto, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
ImporteMN = (Pago.ImportePago * TCValuacionPago - Pago.ImportePago).RoundSQL
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, ImporteMN, ConPrepAplicacion.CveConceptoComplementario, Pago.Referencia, Concepto, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, ImporteME:=Pago.ImportePago, TipoCambio:=TCValuacionPago, CveSubProyecto:=CompraActual.CveSubProyecto) Then ErrorMovtos = True
|
||||
Else
|
||||
'Agregamos Nacional
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Pago.ImportePago, Pago.ImportePago, 371, Pago.Referencia, Concepto, CveCompra:=Pago.CveCompraAmortizacion, CveCompraAmortizacion:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal) Then ErrorMovtos = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Pago.TipoPago = "DD" AndAlso Not ErrorMovtos Then ' D E U D O R D I V E R S O
|
||||
Dim ConPrepAplicacion As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(17, Pago.CveMonedaPago, True, CompraActual.CveTipoConceptoProveedor)
|
||||
If Pago.CveMonedaPago > 1 Then
|
||||
|
||||
@@ -524,7 +524,7 @@
|
||||
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 133px !important; margin-top: -5px; margin-left: -10px;">
|
||||
<asp:TextBox ID="TxtFechaDocumento" runat="server" CssClass="form-control" Width="99%"></asp:TextBox>
|
||||
<span class="input-group-btn">
|
||||
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default" ><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="ImgCalendario" class="btn default" type="button" ><i class="fa fa-calendar"></i></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtFechaDocumento" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
|
||||
@@ -1679,13 +1679,6 @@ Partial Class Bancos_PopIECompras
|
||||
UpGuardar.Update()
|
||||
End Sub
|
||||
|
||||
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
|
||||
Calendario.EndDate = NowADS()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs)
|
||||
|
||||
@@ -1721,15 +1714,22 @@ Partial Class Bancos_PopIECompras
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
Calendario.EndDate = NowADS().AddDays(2)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ValidaFechaDocumentoDiasPosteriores()
|
||||
|
||||
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
Calendario.EndDate = NowADS().AddDays(2)
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 6 meses de la fecha actual"
|
||||
|
||||
If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 16) Then
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(30).ToShortDateString
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 6 meses de la fecha actual"
|
||||
Calendario.EndDate = NowADS().AddDays(30)
|
||||
End If
|
||||
|
||||
|
||||
@@ -338,7 +338,13 @@
|
||||
<asp:CheckBox Text=" No Validar ante SAT" ID="ChkNoValidaSAT" CssClass="md-checksd" runat="server" Checked="false" Visible="false" />
|
||||
<asp:ValidationSummary ID="VS" runat="server" DisplayMode="BulletList" ShowSummary="true" ValidationGroup="GrpGuardar" />
|
||||
<asp:CheckBox Text="Descuento" ID="chkaplicaDescuento" CssClass="md-checksd" runat="server" Checked="false" OnCheckedChanged="chkaplicaDescuento_CheckedChanged" AutoPostBack="true" Visible="false" />
|
||||
|
||||
|
||||
<asp:Button ID="Button1" runat="server" Text="Valida" OnClick="Button1_Click" Visible="false" />
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -317,6 +317,9 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
chkaplicaDescuento.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
tmpValida()
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1607,10 +1610,10 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
#End Region
|
||||
|
||||
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().ToShortDateString
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MinimumValue = NowADS().AddMonths(-38).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().ToShortDateString
|
||||
Calendario.EndDate = NowADS()
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
Calendario.EndDate = NowADS().AddDays(2)
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1620,17 +1623,17 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(2).ToShortDateString
|
||||
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior 2 días de la fecha actual"
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 6 meses de la fecha actual"
|
||||
|
||||
Calendario.EndDate = NowADS().AddDays(2)
|
||||
|
||||
If DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(1, 16) Then
|
||||
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(30).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(30).ToShortDateString
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior 30 días de la fecha actual"
|
||||
RVTxtFechaDocumento.MaximumValue = NowADS().AddDays(182).ToShortDateString
|
||||
RVTxtFechaDocumentoMenor.MaximumValue = NowADS().AddDays(182).ToShortDateString
|
||||
RVTxtFechaDocumento.ErrorMessage = "<b><span style='text-decoration: underline'>ERROR:</span></b> <br/> La fecha del documento no puede ser superior a 6 meses de la fecha actual"
|
||||
|
||||
Calendario.EndDate = NowADS().AddDays(30)
|
||||
Calendario.EndDate = NowADS().AddDays(182)
|
||||
End If
|
||||
|
||||
UpDatos.Update()
|
||||
@@ -1645,5 +1648,75 @@ Partial Class Bancos_ProveedoresAbonar
|
||||
UPCompras.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub tmpValida()
|
||||
|
||||
Dim ValidaSAT As Boolean = True
|
||||
Dim ImporteSeleccionado As Decimal = 0
|
||||
'If UsuarioActual.Empresa.Funcionalidad(529) = "1" OrElse ChkNoValidaSAT.Checked Then ValidaSAT = False
|
||||
|
||||
If ValidaSAT Then
|
||||
Dim Validada As Boolean = False
|
||||
Dim MsgValidadas As New StringBuilder
|
||||
Dim Valida As New ClsValidaCFDi()
|
||||
'verifico ante el SAT las compras que voy a pagar
|
||||
For Each gvr As GridViewRow In GvCxP.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
|
||||
ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
If gvr.DataKey("UUID") <> "" Then
|
||||
|
||||
Valida.Verificar(gvr.DataKey("UUID"), gvr.DataKey("RFC"), UsuarioActual.Empresa.RFC, gvr.DataKey("TotalOriginal").ToDecimal)
|
||||
|
||||
If Not UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa < 2 Then
|
||||
Valida.EsValida = 1
|
||||
End If
|
||||
|
||||
If Valida.EsValida <> 1 Then
|
||||
|
||||
Validada = False
|
||||
If Valida.EsValida = 2 Then 'Cancelada
|
||||
'estatus inventario, no surtida
|
||||
If gvr.DataKey("EstatusInventario") = "1" Then
|
||||
MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} , relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
|
||||
Else
|
||||
MsgValidadas.AppendFormat("Factura Cancelada: {0} - {1} con movimientos de almacen, relacione su factura nueva para descontar saldo<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
|
||||
End If
|
||||
Else
|
||||
MsgValidadas.AppendFormat("Factura No se pudo Validar: {0} - {1}<br>", gvr.DataKey("SerieFolio"), gvr.DataKey("Descripcion"))
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Valida.Dispose()
|
||||
|
||||
'verificacion doble, si no la han cancelado, ya tiene una validaci[on para que llegue aqui
|
||||
|
||||
If MsgValidadas.Length > 0 Then
|
||||
Alert(String.Format("<br>Las Facturas presentan la siguiente situación ante el SAT. <br>{0}", MsgValidadas.ToString), TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
For Each gvr As GridViewRow In GvCxP.Rows
|
||||
If gvr.FCCheckBox("Chk").Checked Then
|
||||
ImporteSeleccionado += gvr.FCTextBox("TxtAbonar").Text.ToDecimal
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If ImporteSeleccionado <= 0 Then
|
||||
Alert("Seleccione facturas", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Protected Sub Button1_Click(sender As Object, e As EventArgs)
|
||||
tmpValida()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
@@ -1511,6 +1511,11 @@ Partial Class Compras_Compras
|
||||
|
||||
ElseIf Request("CveCompra") IsNot Nothing AndAlso IsNumeric(Request("CveCompra")) AndAlso Request("CveCompra").ToEntero > 0 Then
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
DdlTipoComprobante.Items.Clear()
|
||||
DdlTipoComprobante.Items.Add(New ListItem("Remisión de Nota de Crédito", "RNC"))
|
||||
End If
|
||||
|
||||
ViewState("CveCompra") = Request("CveCompra")
|
||||
CargaCompra()
|
||||
BtnGuardar.Enabled = False
|
||||
@@ -3235,6 +3240,13 @@ Partial Class Compras_Compras
|
||||
BtnRegenerarPrePolizaAlmacen_Click(Nothing, Nothing)
|
||||
End If
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "RNC" And CompraSaldo <> TxtTotal.Text.ToDecimal Then
|
||||
BtnCancelarCompra.Visible = False
|
||||
BtnEliminarCompra.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Else
|
||||
Alert("La compra solicitada no se encontró. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
@@ -7012,7 +7024,7 @@ Partial Class Compras_Compras
|
||||
Pago.Referencia = CompraActual.SerieFolio
|
||||
Pago.TCPago = CompraActual.TC
|
||||
Pago.AplicaAcreditable = False
|
||||
Pago.TipoPago = "NC"
|
||||
Pago.TipoPago = "RNC"
|
||||
Pago.Fecha = CompraActual.Fecha 'toma la misma fecha de la provisión en el pago de NC
|
||||
|
||||
Dim CompraPago As New Compra
|
||||
@@ -7029,19 +7041,19 @@ Partial Class Compras_Compras
|
||||
|
||||
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraPago, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
If Not ErrorPrepoliza Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, 371, Referencia, Concepto, CveCompra:=DdlRemisionNotaCredito.SelectedValue.ToEntero, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
|
||||
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
'If Not ErrorPrepoliza Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteRNCSaldar, ImporteRNCSaldar, 371, Referencia, Concepto, CveCompra:=DdlRemisionNotaCredito.SelectedValue.ToEntero, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
|
||||
' CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
|
||||
' ErrorPrepoliza = True
|
||||
' End If
|
||||
|
||||
If Not ErrorPrepoliza Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 372, Referencia, Concepto, CveCompra:=DdlRemisionNotaCredito.SelectedValue.ToEntero, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
|
||||
CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
|
||||
ErrorPrepoliza = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
' If Not ErrorPrepoliza Then
|
||||
' If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImporteRNCSaldar, ImporteRNCSaldar, 372, Referencia, Concepto, CveCompra:=DdlRemisionNotaCredito.SelectedValue.ToEntero, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, ImporteRNCSaldar), TipoCambio:=TipoCambio,
|
||||
' CveClasificacion:=-1, CveSubProyecto:=CompraActual.CveSubProyecto, Contabilizable:=True) Then
|
||||
' ErrorPrepoliza = True
|
||||
' End If
|
||||
' End If
|
||||
'End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
@@ -172,9 +172,9 @@
|
||||
<label class="col-md-1 truncate" style="max-width: 80px;" id="lblAlm" runat="server">Almacén:</label>
|
||||
<div class="col-md-2">
|
||||
<%--<asp:DropDownList ID="ddlAlmacen" runat="server" CssClass="select2me " Style="width: 175px !important;" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:DropDownList>--%>
|
||||
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
|
||||
|
||||
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
|
||||
</div>
|
||||
|
||||
|
||||
<label class="col-md-1" style="max-width: 85px;">Fecha Inicio:</label>
|
||||
<div class="col-md-1" style="min-width: 115px;">
|
||||
@@ -192,6 +192,7 @@
|
||||
<ajax:ValidatorCalloutExtender ID="vcoCvFI" runat="server" HighlightCssClass="vco" TargetControlID="cvFechaI" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label class="col-md-1 " style="max-width: 70px;">Fecha Fin:</label>
|
||||
<div class="col-md-1" style="min-width: 115px;">
|
||||
@@ -254,6 +255,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-1" runat="server" id="DVNavegar" visible="false">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton runat="server" ID="LnkPSAntyerior" OnClick="LnkPSAntyerior_Click" CssClass="btn btn-primary" ><</asp:LinkButton>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<asp:LinkButton runat="server" ID="LnkPSSiguiente" OnClick="LnkPSSiguiente_Click" CssClass="btn btn-primary" >></asp:LinkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,10 +25,60 @@ Partial Class Inventarios_Kardex
|
||||
ViewState("CveMovimiento") = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property IndiceNavegacionActual As Integer
|
||||
Get
|
||||
|
||||
If ViewState("IndiceNavegacionActual") Is Nothing Then
|
||||
ViewState("IndiceNavegacionActual") = 0
|
||||
End If
|
||||
Return ViewState("IndiceNavegacionActual").ToString.ToEntero
|
||||
End Get
|
||||
Set
|
||||
ViewState("IndiceNavegacionActual") = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTPSNavegacion As DataTable
|
||||
Get
|
||||
If ViewState("DTPSNavegacion") Is Nothing Then
|
||||
ViewState("DTPSNavegacion") = New DataTable
|
||||
End If
|
||||
|
||||
Return DirectCast(ViewState("DTPSNavegacion"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPSNavegacion") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property NavegacionTieneDatos As Boolean
|
||||
Get
|
||||
|
||||
If ViewState("NavegacionTieneDatos") Is Nothing Then
|
||||
ViewState("NavegacionTieneDatos") = False
|
||||
End If
|
||||
Return Boolean.Parse(ViewState("NavegacionTieneDatos").ToString)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("NavegacionTieneDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
CreaDTPSNavegacion()
|
||||
DVNavegar.Visible = True
|
||||
End If
|
||||
|
||||
TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString
|
||||
TxtFechaF.Text = NowADS().ToShortDateString
|
||||
CargaCombos()
|
||||
@@ -200,7 +250,7 @@ Partial Class Inventarios_Kardex
|
||||
|
||||
#Region " CARGA DATOS "
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
CargaDatos()
|
||||
CargaDatos(True)
|
||||
Dim almacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
If almacenes = "" Then
|
||||
almacenes = "-1"
|
||||
@@ -208,12 +258,25 @@ Partial Class Inventarios_Kardex
|
||||
ImprimirQR.NavigateUrl = String.Format("/Compras/PopUpVerFactura.aspx?P={0}", Encripta(String.Format("OP=Etiqueta2&CvePS={0}&PS={1}&CveAlmacen={2}&Modalidad={3}", ddlProducto2.SelectedValue.ToEntero, ddlProducto2.SelectedText.ToString, almacenes, "Individual")))
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDatos()
|
||||
Private Sub CargaDatos(Optional validaInidiceActual As Boolean = False)
|
||||
|
||||
NavegacionTieneDatos = False
|
||||
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
|
||||
If validaInidiceActual Then
|
||||
EstablecerIndiceActaual(CveProducto)
|
||||
End If
|
||||
|
||||
|
||||
If CveProducto > 0 Then
|
||||
Dim DtTemp = CargarKardex(CveProducto)
|
||||
|
||||
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 1 Then
|
||||
NavegacionTieneDatos = True
|
||||
End If
|
||||
|
||||
If DtTemp IsNot Nothing AndAlso DtTemp.Rows.Count > 0 Then
|
||||
|
||||
Dim AplicaSeccion, AplicaLote, AplicaCaducidad, AplicaSerie As Boolean
|
||||
AplicaSerie = DtTemp.MAX("Serie") <> ""
|
||||
AplicaSeccion = DtTemp.MAX("SeccionAlmacen") <> ""
|
||||
@@ -370,8 +433,8 @@ Partial Class Inventarios_Kardex
|
||||
Dim ObjInventarios As New ClsInventarios
|
||||
If ObjInventarios.GetExistenciasCaducidad(ddlProducto2.SelectedValue.ToEntero(), -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, almacenes) Then
|
||||
GvProductoCaducidad.DataSource = ObjInventarios.DtResultados
|
||||
GvProductoCaducidad.columns(2).visible = ObjInventarios.DtResultados.max("Serie") <> ""
|
||||
GvProductoCaducidad.columns(3).visible = ObjInventarios.DtResultados.max("Lote") <> ""
|
||||
GvProductoCaducidad.Columns(2).Visible = ObjInventarios.DtResultados.MAX("Serie") <> ""
|
||||
GvProductoCaducidad.Columns(3).Visible = ObjInventarios.DtResultados.MAX("Lote") <> ""
|
||||
GvProductoCaducidad.Columns(4).Visible = ObjInventarios.DtResultados.MAX("FechaCaducidad").ToDate > MinFecha
|
||||
If Not String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147)) Then GvProductoCaducidad.Columns(4).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||
|
||||
@@ -535,6 +598,81 @@ Partial Class Inventarios_Kardex
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub EstablecerIndiceActaual(CveProducto As Integer)
|
||||
|
||||
IndiceNavegacionActual = 0
|
||||
For Each drow As DataRow In DTPSNavegacion.Rows
|
||||
If drow("CvePS").ToString.ToEntero = CveProducto Then
|
||||
Exit Sub
|
||||
End If
|
||||
IndiceNavegacionActual = IndiceNavegacionActual + 1
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CreaDTPSNavegacion()
|
||||
DTPSNavegacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltraParametros("", "Codigo", {"CvePS", "CodigoPS", "Codigo"})
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPSAntyerior_Click(sender As Object, e As EventArgs)
|
||||
|
||||
NavegacionTieneDatos = False
|
||||
|
||||
For x As Integer = IndiceNavegacionActual - 1 To 0 Step -1
|
||||
|
||||
|
||||
If x <= 0 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
End If
|
||||
|
||||
ddlProducto2.SelectedValue = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.SelectedText = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
ddlProducto2.txtValue.Value = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.txtText.Value = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
CargaDatos()
|
||||
|
||||
If x <= 0 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
UPDatos.Update()
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkPSSiguiente_Click(sender As Object, e As EventArgs)
|
||||
|
||||
NavegacionTieneDatos = False
|
||||
|
||||
For x As Integer = IndiceNavegacionActual + 1 To DTPSNavegacion.Rows.Count - 1 Step 1
|
||||
|
||||
|
||||
If x >= DTPSNavegacion.Rows.Count - 1 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
End If
|
||||
|
||||
ddlProducto2.SelectedValue = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.SelectedText = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
ddlProducto2.txtValue.Value = DTPSNavegacion.Rows(x)("CvePS").ToString
|
||||
ddlProducto2.txtText.Value = DTPSNavegacion.Rows(x)("CodigoPS").ToString
|
||||
CargaDatos()
|
||||
|
||||
If x >= DTPSNavegacion.Rows.Count - 1 Or NavegacionTieneDatos Then
|
||||
IndiceNavegacionActual = x
|
||||
UPFiltros.Update()
|
||||
UPDatos.Update()
|
||||
Exit Sub
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user