-- corrección 8.5
-- max en retisr, retiva
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
<%@ Page Title="Compras - Registro de Facturas" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" ValidateRequest="false" CodeFile="Compras.aspx.vb" Inherits="Compras_Compras" EnableEventValidation="false" %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UppAddAcciones" runat="server">
|
||||
<ContentTemplate>
|
||||
@@ -284,9 +282,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="Center" style="width: 100px">Fecha Factura:</td>
|
||||
@@ -322,12 +318,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group whitoutcol" style="width: 280px;">
|
||||
<span class="whitoutcol linewhitsize comprasdfleft">Descripción: </span>
|
||||
<div class="whitoutcol whitoutcol comprasdfleftvar">
|
||||
@@ -348,18 +339,7 @@
|
||||
<div class="whitoutcol whitoutcol comprasdfleftvar">
|
||||
<asp:CheckBox ID="ChkEsNoDeducible" runat="server" OnCheckedChanged="ChkEsNoDeducible_CheckedChanged1" AutoPostBack="true" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<%-- <div class="form-group whitoutcol" style="width: 320px;">
|
||||
<span class="whitoutcol linewhitsize comprasdfleft">Tipo Gasto: </span>
|
||||
<div class="whitoutcol whitoutcol comprasdfleftvar">
|
||||
<asp:DropDownList ID="DdlTipoGasto" runat="server" DataTextField="TipoGasto" DataValueField="CveTipoGasto" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me">
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
</div>--%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1141,7 +1121,7 @@
|
||||
<div class="col-md-6 ">
|
||||
<asp:Button runat="server" ID="btnProrateo" Visible="false" Text="Prorratear" CommandArgument="Compras" CssClass="btn btn-success" />
|
||||
<asp:Button runat="server" ID="btnProrateo2" Visible="false" Text="Prorratear Nomina" CommandArgument="Nomina" CssClass="btn btn-success" />
|
||||
<asp:Button runat="server" ID="BtnProrateoDeducible" Visible="true" Text="Prorratear 8.5%" CommandArgument="Prorratear Deducible" CssClass="btn btn-success" />
|
||||
<asp:Button runat="server" ID="BtnProrateoDeducible" Visible="false" Text="Prorratear 8.5%" CommandArgument="Prorratear Deducible" CssClass="btn btn-success" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -4572,9 +4552,9 @@
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<br />
|
||||
<asp:UpdatePanel ID="UpEsNoDeduciblePS" runat="server" UpdateMode="Conditional" Visible="false">
|
||||
<asp:UpdatePanel ID="UpEsNoDeduciblePS" runat="server" UpdateMode="Conditional" >
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="row" runat="server" id="divNoDeducibleModal" visible="false">
|
||||
<div class="col-md-6">
|
||||
<label>¿Es No Deducible? </label>
|
||||
<asp:CheckBox ID="ChkEsNoDeduciblePS" runat="server" />
|
||||
@@ -4586,14 +4566,7 @@
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<asp:Label ID="Label11" runat="server" Text="Total:"></asp:Label>  $
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<asp:Label ID="Label11" runat="server" Text="Total:"></asp:Label>  $
|
||||
<asp:Label ID="LblTotalPS" ClientIDMode="Static" runat="server" Text="0.00"></asp:Label>
|
||||
</div>
|
||||
|
||||
@@ -4603,13 +4576,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ Imports Newtonsoft.Json
|
||||
Imports Extensiones
|
||||
Imports MoreLinq
|
||||
|
||||
|
||||
Partial Class Compras_Compras
|
||||
Inherits ClsPaginas
|
||||
|
||||
@@ -1061,7 +1062,7 @@ Partial Class Compras_Compras
|
||||
If ViewState("TotalOriginal") Is Nothing Then
|
||||
Return 0
|
||||
Else
|
||||
Return ViewState("TotalOriginal").ToString.Todecimal
|
||||
Return ViewState("TotalOriginal").ToString.ToDecimal
|
||||
End If
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
@@ -2074,7 +2075,6 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
|
||||
SubTotal2 = SubTotalReal - Descuentos
|
||||
|
||||
If Descuentos > 0 Then
|
||||
@@ -2118,10 +2118,8 @@ Partial Class Compras_Compras
|
||||
|
||||
HFDiferenciaCompra.Value = TxtTotal.Text
|
||||
|
||||
|
||||
LblRetIVA.Text = (If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = (If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
|
||||
'LblRetIVA.Text = TmpDT.MAX("PorcentajeRetIVA").ToString '(If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
'LblRetISR.Text = TmpDT.MAX("PorcentajeRetISR").ToString '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
|
||||
'ASIGNA VALORES ORIGINALES PARA GUARDAR
|
||||
AsignaValoresOriginales(SubTotal, SubTotal2, IVA, RetencionIVA, RetencionISR, Total)
|
||||
@@ -2247,12 +2245,8 @@ Partial Class Compras_Compras
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("Resico", "5"))
|
||||
DdlRetIVAConcepto.Items.Add(New ListItem("General.", "6"))
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
UpPS.Update()
|
||||
|
||||
End Sub
|
||||
@@ -2423,13 +2417,12 @@ Partial Class Compras_Compras
|
||||
HdnCompraSaldo.Value = TotalTemp.ToString
|
||||
CompraSaldo = TotalTemp
|
||||
|
||||
LblRetIVA.Text = (If(Subtotal2Temp > 0, (RetIVATemp / Subtotal2Temp), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = (If(Subtotal2Temp > 0, (RetISRTemp / Subtotal2Temp), 0) * 100).FormatoNumero(3)
|
||||
LblRetIVA.Text = If(RetIVATemp > 0, (TmpDT.MAX("RetIVAPorcentaje").ToDecimal() * 100).FormatoNumero(3), "")
|
||||
LblRetISR.Text = If(RetISRTemp > 0, (TmpDT.MAX("RetISRPorcentaje").ToDecimal() * 100).FormatoNumero(3), "")
|
||||
|
||||
'ASIGNA VALORES ORIGINALES PARA GUARDAR
|
||||
AsignaValoresOriginales(SubtotalTemp, Subtotal2Temp, IVATemp, RetIVATemp, RetISRTemp, Total)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
@@ -2634,8 +2627,8 @@ Partial Class Compras_Compras
|
||||
LblUsuarioCaptura.Text = dr("Usuario").ToString
|
||||
LitFechCaptura.Text = dr("FechaIng").ToString.ToDate.ToShortDateString
|
||||
LitFechCaptura.ToolTip = dr("FechaIng").ToString
|
||||
LblRetIVA.Text = Math.Round((dr("RetIVA").ToString.ToDouble / TxtSubTotal2.Text.ToDouble) * 100, 4).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = Math.Round((dr("RetISR").ToString.ToDouble / TxtSubTotal2.Text.ToDouble) * 100, 4).FormatoNumero(3)
|
||||
LblRetIVA.Text = If(dr("RetIVA").ToString.ToDecimal > 0, TmpDT.MAX("RetIVAPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(3) '(If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = If(dr("RetISR").ToString.ToDecimal > 0, TmpDT.MAX("RetISRPorcentaje").ToDecimal * 100, 0).ToString.FormatoNumero(3) '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
If dr("TipoFactura").ToString <> "CFDi" Then LblTipoFact.Text = dr("TipoFactura").ToString : divTipoFactura.Visible = True
|
||||
ViewState("CveFactura") = dr("CveFactura").ToString.ToEntero
|
||||
ViewState("IdPoliza") = dr("IdPoliza").ToString.ToEntero
|
||||
@@ -16288,9 +16281,8 @@ Partial Class Compras_Compras
|
||||
UpAnticipos.Update()
|
||||
End If
|
||||
|
||||
|
||||
LblRetIVA.Text = (If(SubTotal2 > 0, (RetIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = (If(SubTotal2 > 0, (RetISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
LblRetIVA.Text = TmpDT.MAX("RetIVAPorcentaje").ToString '(If(SubTotal2 > 0, (RetencionIVA / SubTotal2), 0) * 100).FormatoNumero(3) + "%"
|
||||
LblRetISR.Text = TmpDT.MAX("RetISRPorcentaje").ToString '(If(SubTotal2 > 0, (RetencionISR / SubTotal2), 0) * 100).FormatoNumero(3)
|
||||
|
||||
'IMPORTES DE RESTRICCION
|
||||
TxtDocumentoImporteFE.Text = Total.ToString.FormatoNumero(2)
|
||||
@@ -19606,34 +19598,22 @@ Partial Class Compras_Compras
|
||||
|
||||
#Region "ES NO DEDUCIBLE"
|
||||
Protected Sub ChkEsNoDeducible_CheckedChanged1(sender As Object, e As EventArgs)
|
||||
AplicarNoDeducible()
|
||||
End Sub
|
||||
|
||||
Private Sub AplicarNoDeducible()
|
||||
If ChkEsNoDeducible.Checked Then
|
||||
EsNoDeducible = True
|
||||
dvNoDeducible.Visible = True
|
||||
GvPS.Columns(11).Visible = True
|
||||
UpEsNoDeduciblePS.Visible = True
|
||||
DivEsNoDeducible.Visible = True
|
||||
Else
|
||||
EsNoDeducible = False
|
||||
dvNoDeducible.Visible = False
|
||||
GvPS.Columns(11).Visible = False
|
||||
UpEsNoDeduciblePS.Visible = False
|
||||
DivEsNoDeducible.Visible = False
|
||||
End If
|
||||
'DivEsNoDeducible.Visible = False
|
||||
'For Each Dr As DataRow In TmpDT.Rows
|
||||
' Dim Total As Double = Dr("IVA").ToString.ToDouble - (Dr("RetIVA").ToString.ToDouble + Dr("RetISR").ToString.ToDouble) + Dr("IEPSPS").ToString.ToDouble + Dr("IEPSPSIVA").ToString.ToDouble
|
||||
' Dr("Total") = Dr("Total").ToString.ToDouble + Total
|
||||
' Dr("PU") = Dr("Total").ToString.ToDouble / Dr("Cantidad").ToString.ToDouble
|
||||
' Dr("IVA") = 0
|
||||
' Dr("IVAPorcentaje") = 0
|
||||
' Dr("RetIVA") = 0
|
||||
' Dr("RetIVAPorcentaje") = 0
|
||||
' Dr("RetISR") = 0
|
||||
' Dr("RetISRPorcentaje") = 0
|
||||
' Dr("IEPSPS") = 0
|
||||
' Dr("IEPSPSPorcentaje") = 0
|
||||
' Dr("IEPSPSIVA") = 0
|
||||
' Dr("IEPSPSIVAPorcentaje") = 0
|
||||
'Next
|
||||
'TmpDT.AcceptChanges()
|
||||
|
||||
AddPS2(EsNoDeducible:=EsNoDeducible)
|
||||
UpPS.Update()
|
||||
End Sub
|
||||
@@ -20293,8 +20273,6 @@ Partial Class Compras_Compras
|
||||
|
||||
Protected Sub BtnModalEliminarCompra_Click(sender As Object, e As EventArgs)
|
||||
|
||||
|
||||
|
||||
Dim ObjAC As ClsContPAQi = Nothing
|
||||
Dim Comp As New ClsCompras()
|
||||
Dim ObjEventos As New ClsOIEventos(Comp.IniciaTransacSQL())
|
||||
@@ -20327,8 +20305,6 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Try
|
||||
If ObjInventarios.GetInv_ComprasMov(CveCompra, UsuarioActual.CveEmpresa) Then
|
||||
Dim DTInventarios As DataTable = ObjInventarios.DtResultados
|
||||
@@ -20402,9 +20378,6 @@ Partial Class Compras_Compras
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
If Not ErrorCompra Then
|
||||
If Not Comp.DeleteCompra(CveCompra, False) Then
|
||||
ErrorCompra = True
|
||||
@@ -20427,17 +20400,14 @@ Partial Class Compras_Compras
|
||||
ObjConta.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "PRORATEAR DEDUCIBLE"
|
||||
#Region "PRORATEAR 8.5%"
|
||||
Private Sub Proratear85Deducible()
|
||||
|
||||
Private Sub ProratearDeducible()
|
||||
|
||||
ChkEsNoDeducible_CheckedChanged1(Nothing, Nothing)
|
||||
ChkEsNoDeducible.Checked = True
|
||||
AplicarNoDeducible()
|
||||
|
||||
Dim Consec As Integer = 1
|
||||
|
||||
@@ -20464,7 +20434,6 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
|
||||
Dim psCvePs As Integer = 700562
|
||||
Dim rowPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, psCvePs).Rows(0)
|
||||
|
||||
@@ -20477,7 +20446,6 @@ Partial Class Compras_Compras
|
||||
For Each drIva As DataRow In DT_IVAS.Rows
|
||||
|
||||
Dim nRowAgrupado As DataRow = DT_Agrupado.NewRow
|
||||
|
||||
Dim drIVAPorcentaje As Decimal = drIva("IVAPorcentaje").ToString.ToDecimal
|
||||
Dim drRetIVAPorcentaje As Decimal = drIva("RetIVAPorcentaje").ToString.ToDecimal
|
||||
Dim drRetISRPorcentaje As Decimal = drIva("RetISRPorcentaje").ToString.ToDecimal
|
||||
@@ -20570,13 +20538,13 @@ Partial Class Compras_Compras
|
||||
TmpDT = DTProtateo
|
||||
|
||||
BtnProrateoDeducible.Visible = False
|
||||
|
||||
UpParametros.Update()
|
||||
AddPS2(True)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub BtnProrateoDeducible_Click(sender As Object, e As EventArgs) Handles BtnProrateoDeducible.Click
|
||||
ProratearDeducible()
|
||||
Proratear85Deducible()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
@@ -20585,8 +20553,6 @@ Partial Class Compras_Compras
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
|
||||
Public Class MMensajeDevolucion
|
||||
Public Property CveMovimiento As Integer
|
||||
Public Property TieneError As Boolean
|
||||
|
||||
Reference in New Issue
Block a user