- agregar IVA, incluyendo IEPS

This commit is contained in:
rrene
2019-12-03 18:41:31 -07:00
parent 16a4ab016c
commit 3e807fa19a
4 changed files with 27 additions and 17 deletions

View File

@@ -1071,6 +1071,7 @@ Partial Class PV
CargaSucursales()
CargaClasificaciones()
CargaPS(-1, DdlPS)
CargaPS(-1, DdlPSAjuste)
CargaEmpresa()
CreaDTVentas()
CargaMetodosPago()
@@ -5046,7 +5047,7 @@ Partial Class PV
End Sub
Private Sub CargaPSAjuste()
DdlPSAjuste.Items.Clear()
'DdlPSAjuste.Items.Clear()
DtPUFacturas.Rows.Clear()
If DdlFacturas.SelectedValue.ToEntero > 0 Then
@@ -5064,7 +5065,7 @@ Partial Class PV
DdlPSAjuste.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa)
End If
DdlPSAjuste.DataBind()
DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
' DdlPSAjuste.Items.Insert(0, New ListItem("Seleccione", "-1"))
DtPUFacturas.AcceptChanges()
UpAjuste.Update()
CalculaPorcentajeAjuste()
@@ -5099,7 +5100,7 @@ Partial Class PV
TxtPorcentajeAjuste.Text = ""
TxtPoliza.Text = ""
TxtImporteAjuste.Text = ""
DdlPSAjuste.SelectedIndex = -1
DdlPSAjuste.SelectedValue = "-1"
ChkAjuste.Checked = False
DivAjuste.Visible = False
End Sub
@@ -5130,7 +5131,7 @@ Partial Class PV
TxtImporteAjuste.Text = Dr("Importe").ToString
DdlFacturas.SelectedValueExist(Dr("CveVenta").ToString)
CargaPSAjuste()
DdlPSAjuste.SelectedValueExist(Dr("CvePS").ToString)
DdlPSAjuste.SelectedValue = (Dr("CvePS").ToString)
TxtFechaAjuste.Text = Dr("FechaAjuste").ToString.ToDate.ToShortDateString
TxtPrecio.Text = Dr("PUFactura").ToString.ToDecimal.FormatoNumero(2)
TxtPrecio.Enabled = Not Dr("CveVenta").ToString.ToEntero > 0
@@ -5164,7 +5165,7 @@ Partial Class PV
Protected Sub DdlPSAjuste_selectedindexchange(sender As Object, e As EventArgs)
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
Dim Index As Integer = DdlPSAjuste.SelectedIndex
Dim Contador As Integer = 1
Dim PUFactura As Decimal = 0
For Each Dr As DataRow In DtPUFacturas.Rows
@@ -5177,8 +5178,8 @@ Partial Class PV
End If
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso Not DdlFacturas.SelectedValue.ToEntero > 0 Then
Dim Index As Integer = DdlPSAjuste.SelectedIndex
If DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero <= 0 Then
Dim CvePSParametro As Integer = DdlPSAjuste.SelectedValue.ToEntero
Dim PrecioSugerido As Decimal = 0
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSParametro).FiltroPrimero("")
@@ -5189,9 +5190,9 @@ Partial Class PV
TxtPUFactura.Text = PrecioSugerido.FormatoNumero(2)
End If
End If
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
If Not DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso DdlFacturas.SelectedValue.ToEntero > 0 Then
TxtPUFactura.Text = ""
End If
@@ -5207,6 +5208,11 @@ Partial Class PV
End Sub
Private Sub CalculaPorcentajeAjuste()
If DdlPS.SelectedValue.ToEntero <= 0 Then
'Alert("No se ha especificado producto a entregar")
Exit Sub
End If
If DdlTipoUso.SelectedValue.ToEntero > 0 AndAlso DdlPSAjuste.SelectedValue.ToEntero > 0 AndAlso TxtMesesUso.Text <> "" AndAlso DdlPS.SelectedValue.ToEntero > 0 Then
Dim CveMarca As Integer = -1
If GlobalDTPS(UsuarioActual.CveEmpresa, DdlPSAjuste.SelectedValue.ToEntero).Rows.Count > 0 Then
@@ -5283,7 +5289,7 @@ Partial Class PV
Row("Importe") = TxtImporteAjuste.Text.ToDouble
Row("ConsecutivoVenta") = ConsecutivoVenta
Row("CvePS") = DdlPSAjuste.SelectedValue
Row("PS") = DdlPSAjuste.SelectedItem.Text
Row("PS") = DdlPSAjuste.SelectedText
Row("CveVenta") = DdlFacturas.SelectedValue
Row("PUFactura") = TxtPrecio.Text.ToDouble
Row("Cantidad") = 1
@@ -5313,7 +5319,7 @@ Partial Class PV
TmpDTAjustes.Rows(IndexAjuste)("Importe") = TxtImporteAjuste.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("ConsecutivoVenta") = ConsecutivoVenta
TmpDTAjustes.Rows(IndexAjuste)("CvePS") = DdlPSAjuste.SelectedValue
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedItem.Text
TmpDTAjustes.Rows(IndexAjuste)("PS") = DdlPSAjuste.SelectedText
TmpDTAjustes.Rows(IndexAjuste)("CveVenta") = DdlFacturas.SelectedValue
TmpDTAjustes.Rows(IndexAjuste)("PUFactura") = TxtPrecio.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("Cantidad") = 1