Compras ret iva ret isr edcion y columnas en gridview, repcomplentos descarga de personalizado

This commit is contained in:
rakcsle
2025-04-29 23:44:58 -07:00
parent 87c9a0d115
commit c21b847ce0
6 changed files with 1949 additions and 1828 deletions

View File

@@ -978,6 +978,36 @@ Partial Class Compras_Compras
End Set
End Property
Private Property ProvRetIVA As Decimal
Get
If ViewState("ProvRetIVA") Is Nothing Then
ViewState("ProvRetIVA") = 0
End If
Return ViewState("ProvRetIVA").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("ProvRetIVA") = value
End Set
End Property
Private Property ProvRetISR As Decimal
Get
If ViewState("ProvRetISR") Is Nothing Then
ViewState("ProvRetISR") = 0
End If
Return ViewState("ProvRetISR").ToString.ToDecimal
End Get
Set(value As Decimal)
ViewState("ProvRetISR") = value
End Set
End Property
Private Property TotalOriginal As Decimal
Get
If ViewState("TotalOriginal") Is Nothing Then
@@ -1787,7 +1817,7 @@ Partial Class Compras_Compras
End If
MostrarOcultarColumnaIEPS()
MostrarOcultarColumnaIEPSRetIVARetISR()
End Sub
@@ -1886,7 +1916,7 @@ Partial Class Compras_Compras
#Region "C A R G A S"
Private Sub MostrarOcultarColumnaIEPS()
Private Sub MostrarOcultarColumnaIEPSRetIVARetISR()
If TxtIEPS.Text.ToDecimal <> 0 And TmpDT.SUM("IEPSPS") <> 0 Then
@@ -1896,6 +1926,25 @@ Partial Class Compras_Compras
GvPS.Columns(9).Visible = False
TD_Gvps_IEPS.Visible = False
End If
If TxtRetIVA.Text.ToDecimal <> 0 And TmpDT.SUM("RetIVA") <> 0 Then
GvPS.Columns(10).Visible = True
TdRetIVA.Visible = True
Else
GvPS.Columns(10).Visible = False
TdRetIVA.Visible = False
End If
If TxtRetISR.Text.ToDecimal <> 0 And TmpDT.SUM("RetISR") <> 0 Then
GvPS.Columns(11).Visible = True
TdRetISR.Visible = True
Else
GvPS.Columns(11).Visible = False
TdRetISR.Visible = False
End If
UpPS.Update()
End Sub
@@ -2954,6 +3003,11 @@ Partial Class Compras_Compras
TxtIVA.Text = dr("IVA").ToString.FormatoNumero(2)
TxtRetIVA.Text = dr("RetIVA").ToString.FormatoNumero(2)
TxtRetISR.Text = dr("RetISR").ToString.FormatoNumero(2)
RetIVAOriginal = dr("RetIVA").ToString.ToDecimal
RetISROriginal = dr("RetISR").ToString.ToDecimal
TxtIEPS.Text = dr("IEPS").ToString.FormatoNumero(2)
If dr("IEPS").ToString.ToDouble > 0 Then TrIEPS.Visible = True
If dr("RetIVA").ToString.ToDouble > 0 Then TrRetIVA.Visible = True
@@ -3777,6 +3831,9 @@ Partial Class Compras_Compras
End If
End If
ProvRetIVA = ObjProveedor.RetIVA.ToDecimal
ProvRetISR = ObjProveedor.RetISR.ToDecimal
If CveCompra <= 0 AndAlso CveFactura <= 0 Then 'si se está cargando una factura o compra no se carga
'LblRetIVA.Text = ObjProveedor.RetIVA.ToString.FormatoNumero(5)
'LblRetISR.Text = ObjProveedor.RetISR.ToString.FormatoNumero(5)
@@ -10739,12 +10796,12 @@ Partial Class Compras_Compras
If e.Row.RowIndex = 0 Then
If UsuarioActual.Empresa.UsaAC Then 'AndAlso (CveFactura > 0 Or CveCompra > 0)
e.Row.Cells(13).Width = Unit.Pixel(150)
e.Row.Cells(14).Width = Unit.Pixel(150)
e.Row.Cells(15).Width = Unit.Pixel(150)
e.Row.Cells(16).Width = Unit.Pixel(150)
e.Row.Cells(17).Width = Unit.Pixel(150)
e.Row.Cells(18).Width = Unit.Pixel(100)
e.Row.Cells(18).Width = Unit.Pixel(150)
e.Row.Cells(19).Width = Unit.Pixel(150)
e.Row.Cells(20).Width = Unit.Pixel(100)
End If
End If
@@ -10847,11 +10904,11 @@ Partial Class Compras_Compras
'CargaPresupuestosEgresos
If UsuarioActual.Empresa.UsaAC Then
e.Row.Cells(14).Visible = True
e.Row.Cells(15).Visible = True
e.Row.Cells(16).Visible = True
e.Row.Cells(17).Visible = True
e.Row.Cells(18).Visible = True
e.Row.Cells(19).Visible = True
e.Row.Cells(20).Visible = True
e.Row.FCDropDownList("DdlAC1").Items.Clear()
e.Row.FCDropDownList("DdlAC1").DataSource = DtPresupuestos.FiltraParametros("", DistinctColumns:={"CveProgramaOperativo", "ProgramaOperativo"})
@@ -10882,19 +10939,19 @@ Partial Class Compras_Compras
'SI EL PRESUPUESTO DE EGRESOS VIENE DESDE LA OC, SE BLOQUEA PE
If e.Row.DBCampo("CveOrdenCompraDetalle").ToEntero > 0 AndAlso e.Row.DBCampo("CvePresupuestoEgreso").ToEntero > 0 Then
e.Row.Cells(14).Enabled = False
e.Row.Cells(15).Enabled = False
e.Row.Cells(16).Enabled = False
e.Row.Cells(17).Enabled = False
e.Row.Cells(18).Enabled = False
e.Row.Cells(19).Enabled = False
e.Row.Cells(20).Enabled = False
End If
Else
e.Row.Cells(14).Visible = False
e.Row.Cells(15).Visible = False
e.Row.Cells(16).Visible = False
e.Row.Cells(17).Visible = False
e.Row.Cells(18).Visible = False
e.Row.Cells(19).Visible = False
e.Row.Cells(20).Visible = False
End If
End If
@@ -13049,12 +13106,12 @@ Partial Class Compras_Compras
'Seccion Grid
GvPS.Width = 1760
GvPS.Columns(13).Visible = True
GvPS.Columns(14).Visible = True
GvPS.Columns(15).Visible = True
GvPS.Columns(16).Visible = True
GvPS.Columns(17).Visible = True
GvPS.Columns(18).Visible = True
GvPS.Columns(19).Visible = True
GvPS.Columns(20).Visible = True
'Panel General
UpPresupuestosAC.Visible = True
@@ -17600,7 +17657,7 @@ Partial Class Compras_Compras
CargaRetISRConcepto()
Dim NumNoDed As Integer = TmpDT.COUNT("CvePS", "NoDeducible = True ")
If NumNoDed > 0 Then GvPS.Columns(11).Visible = True 'visualiza columnas de nodeducibles
If NumNoDed > 0 Then GvPS.Columns(13).Visible = True 'visualiza columnas de nodeducibles
'If DdlTipoComprobante.SelectedValue.Contiene("NC", "DEV") And CveFactura <= 0 Then
' InicializaAplicaNCFact()
@@ -18151,6 +18208,9 @@ Partial Class Compras_Compras
HdnPS.Value = PS("PSCodigo").ToString
LblUnidadMedida.Text = PS("UnidadMedida").ToString
Dim PsRetIVA As Decimal = PS("RetIVA").ToString.ToDecimal
Dim PsRetISR As Decimal = PS("RetISR").ToString.ToDecimal
ddlUM.Items.Clear()
If UsuarioActual.Empresa.UsaInventarios Then
ddlUM.DataSource = GlobalDTProductosServiciosEquivalencias(PS("CvePS").ToString.ToEntero, -1, UsuarioActual.CveEmpresa)
@@ -18230,6 +18290,19 @@ Partial Class Compras_Compras
TxtRetIVAModal.Text = FormatoNumero(ViewState("RetIVA").ToString().ToDouble * 100, 6)
TxtRetISRModal.Text = FormatoNumero(ViewState("RetISR").ToString().ToDouble * 100, 6)
'OIC 2025-04-29
If CveCompra > 0 AndAlso Modalidad = "A" Then
If ProvRetIVA > 0 Or ProvRetISR > 0 Then
TxtRetIVAModal.Text = FormatoNumero(ProvRetIVA, 6)
TxtRetISRModal.Text = FormatoNumero(ProvRetISR, 6)
ElseIf PsRetIVA > 0 Or PsRetISR > 0 Then
TxtRetIVAModal.Text = FormatoNumero(PsRetIVA, 6)
TxtRetISRModal.Text = FormatoNumero(PsRetISR, 6)
End If
End If
If (CveFactura > 0 Or CveCompra > 0) And TxtIEPS.Text.ToDecimal = 0 And PS("IEPSPorcentaje").ToString.ToDecimal > 0 Then
TxtIEPSModal.Text = "0"
Alert("El producto seleccionado contiene IEPS, pero el acumulado de la factura no contiene IEPS, por lo que no se agregara el impuesto.", TipoMensaje.MsgAdvertencia)
@@ -18518,7 +18591,7 @@ Partial Class Compras_Compras
UpPS.Update()
CargaGvPersonal()
MostrarOcultarColumnaIEPS()
MostrarOcultarColumnaIEPSRetIVARetISR()
End Sub
@@ -20300,7 +20373,7 @@ Partial Class Compras_Compras
Alert("Debe seleccionar al menos un impuesto", TipoMensaje.MsgAdvertencia)
End If
MostrarOcultarColumnaIEPS()
MostrarOcultarColumnaIEPSRetIVARetISR()
AddPS2()
End Sub
#End Region
@@ -21156,12 +21229,12 @@ Partial Class Compras_Compras
If ChkEsNoDeducible.Checked Then
EsNoDeducible = True
dvNoDeducible.Visible = True
GvPS.Columns(11).Visible = True
GvPS.Columns(13).Visible = True
DivEsNoDeducible.Visible = True
Else
EsNoDeducible = False
dvNoDeducible.Visible = False
GvPS.Columns(11).Visible = False
GvPS.Columns(13).Visible = False
DivEsNoDeducible.Visible = False
End If