This commit is contained in:
Antonio Gonzalez
2019-11-29 15:44:51 -07:00
10 changed files with 119 additions and 56 deletions

View File

@@ -5221,7 +5221,8 @@ Partial Class PV
If ObjAcum.GarantiasMesesGet(-1, UsuarioActual.CveEmpresa, CveMarca, DdlTipoUso.SelectedValue.ToEntero, TxtMesesUso.Text.ToEntero) Then
If ObjAcum.DtResultados.Rows.Count > 0 Then
TxtPorcentajeAjuste.Text = (ObjAcum.DtResultados.Rows(0)("Valor").ToString.ToDouble / 100).ToString
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDouble * TxtPUFactura.Text.ToDouble).FormatoNumero
TxtImporteAjuste.Text = (TxtPorcentajeAjuste.Text.ToDecimal * TxtPUFactura.Text.ToDecimal).FormatoNumero
Dim CargoVendido As Decimal = 0
Dim CargoGarantia As Decimal = 0
@@ -5255,7 +5256,7 @@ Partial Class PV
CargoGarantia = CargoVendido
End If
TxtImporteAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoVendido - CargoGarantia).FormatoNumero}."
TxtImporteAjuste.Text = ((TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
TxtImporteAjuste.Text = ((TxtPUFactura.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoVendido - CargoGarantia)).FormatoNumero
End If
End If
@@ -5312,7 +5313,7 @@ Partial Class PV
TmpDTAjustes.Rows(IndexAjuste)("Consecutivo") = TxtConsecutivoAjuste.Text
TmpDTAjustes.Rows(IndexAjuste)("FechaAjuste") = TxtFechaAjuste.Text.ToDate
TmpDTAjustes.Rows(IndexAjuste)("Meses") = TxtMesesUso.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("PorcentajeAjuste") = TxtPorcentajeAjuste.Text
TmpDTAjustes.Rows(IndexAjuste)("PorcentajeAjuste") = TxtPorcentajeAjuste.Text.ToDecimal
TmpDTAjustes.Rows(IndexAjuste)("NumPoliza") = TxtPoliza.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("Importe") = TxtImporteAjuste.Text.ToDouble
TmpDTAjustes.Rows(IndexAjuste)("ConsecutivoVenta") = ConsecutivoVenta
@@ -5346,7 +5347,7 @@ Partial Class PV
End If
End If
Dr("Descuento") = Math.Round(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble, NumeroDecimales)
Dr("Descuento") = Math.Round(TxtImporteAjuste.Text.ToDouble, NumeroDecimales)
'Dr("Descuento") = Math.Round((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) + (CargoActual - CargoAnterior), NumeroDecimales)
If Dr("Descuento").ToString.ToDouble > TxtPrecio.Text.ToDouble Then Dr("Descuento") = TxtPrecio.Text.ToDouble

View File

@@ -7237,27 +7237,6 @@ Partial Class Ventas
ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim
ObjFacturaDevolucion.MonedaAbreviatura = ""
'DETALLES
If NCDescuento Then
PreparaNCDescuento(ObjFacturaDevolucion)
Else
ObjFacturaDevolucion.DtDetalle = TmpDT
ObjFacturaDevolucion.SubTotal = TxtSubTotal.Text.ToDecimal
ObjFacturaDevolucion.Descuento = LblDescuentos.Text.Trim.ToDecimal
ObjFacturaDevolucion.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
ObjFacturaDevolucion.IVA = TxtIVA.Text.ToDecimal
ObjFacturaDevolucion.RetIVA = TxtRetIVA.Text.ToDecimal
ObjFacturaDevolucion.RetISR = TxtRetISR.Text.ToDecimal
ObjFacturaDevolucion.IEPS = TxtIEPS.Text.ToDecimal
ObjFacturaDevolucion.Total = TxtTotal.Text.ToDecimal
End If
'Totales, Y se llena TmpDTImpuestos
'ObjFactura.BZDescripcion = TxtBZDescripcion.Text.Trim
'ObjFactura.BZNombreCorto = TxtBZNombreCorto.Text.Trim
'ObjFactura.BZTotalLetra = TxtBZTotalLetra.Text.Trim
If TmpDTImpuestos Is Nothing Then
CreaDTImpuestos()
Else
@@ -7304,6 +7283,30 @@ Partial Class Ventas
ObjFacturaDevolucion.DtDeduccion = TmpDTImpuestos.FiltraParametros("", Orderby:="Orden ASC")
'DETALLES
If NCDescuento Then
PreparaNCDescuento(ObjFacturaDevolucion)
Else
ObjFacturaDevolucion.DtDetalle = TmpDT
ObjFacturaDevolucion.SubTotal = TxtSubTotal.Text.ToDecimal
ObjFacturaDevolucion.Descuento = LblDescuentos.Text.Trim.ToDecimal
ObjFacturaDevolucion.Amortizacion = LblAmortizacion.Text.Trim.ToDecimal
ObjFacturaDevolucion.IVA = TxtIVA.Text.ToDecimal
ObjFacturaDevolucion.RetIVA = TxtRetIVA.Text.ToDecimal
ObjFacturaDevolucion.RetISR = TxtRetISR.Text.ToDecimal
ObjFacturaDevolucion.IEPS = TxtIEPS.Text.ToDecimal
ObjFacturaDevolucion.TotalImpuestoLocal = ObjFacturaDevolucion.DtDeduccion.SUMD("Importe", "TipoImpuesto = 1")
ObjFacturaDevolucion.Total = TxtTotal.Text.ToDecimal
End If
'Totales, Y se llena TmpDTImpuestos
'ObjFactura.BZDescripcion = TxtBZDescripcion.Text.Trim
'ObjFactura.BZNombreCorto = TxtBZNombreCorto.Text.Trim
'ObjFactura.BZTotalLetra = TxtBZTotalLetra.Text.Trim
'otros
ObjFacturaDevolucion.Det_FechaOrdenCompra = TxtDet_FechaOrdenCompra.Text.Trim
ObjFacturaDevolucion.Det_OrdenCompra = TxtDet_OrdenCompra.Text.Trim
@@ -7475,7 +7478,7 @@ Partial Class Ventas
Dim TotalRetIVA As Decimal = tmpcon.SUM("ImporteRetIVA").ToDecimal
Dim TotalRetISR As Decimal = tmpcon.SUM("ImporteRetISR").ToDecimal
Dim Total As Decimal = 0
Dim TotalImpuestosLocales As Decimal = 0
Dim TotalImpuestosLocales As Decimal = factura.TotalImpuestoLocal.ToString.ToDecimal
Total = (TotalSubTotal - TotalDescuentos + TotalIVA + TotalIEPS - TotalRetIVA - TotalRetISR - TotalImpuestosLocales)
factura.SubTotal = TotalSubTotal
@@ -9148,7 +9151,8 @@ Partial Class Ventas
'Contratos
If factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing") Then
GuardarContratoAvanceEstimaciones(ObjContr, factura, ErrorList, 1)
ElseIf factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") Then
'CUANDO ES NOTA DE CRÉDITO, NO DEBE DE CONSIDERAR AVANCE, CUANDO ES NOTA DE CRÉDITO POR AMORTIZACIÓN
ElseIf factura.CveContrato > 0 AndAlso DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then
GuardarContratoAvanceEstimaciones(ObjContr, factura, ErrorList, -1)
End If
@@ -23442,19 +23446,19 @@ Partial Class Ventas
Private Sub CalculaUsados()
If ClienteEsDistribuidor Then
'' If ClienteEsDistribuidor Then
Dim DTTamanios As New DataTable
Dim ObjAcum As New ClsAcumuladores
Dim DTTamanios As DataTable = Nothing
' Dim ObjAcum As New ClsAcumuladores
If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
'If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
DTTamanios = ObjAcum.DtResultados
DTTamanios = GlobalDTAcumTamaños() 'ObjAcum.DtResultados
Dim DTCvePSCostos As New DataTable
DTCvePSCostos = ObjAcum.DtResultados.FiltraParametros("", "", {"CvePSCargo"})
Dim DTCvePSCostos As DataTable
DTCvePSCostos = DTTamanios.FiltraParametros("", "", {"CvePSCargo"})
If Not TmpDT.Columns.Contains("Eliminar") Then
If Not TmpDT.Columns.Contains("Eliminar") Then
TmpDT.Columns.Add("Eliminar", GetType(Integer))
End If
@@ -23579,10 +23583,10 @@ Partial Class Ventas
Next
ObjProductosServicios.Dispose()
End If
'End If
ObjAcum.Dispose()
End If
' ObjAcum.Dispose()
'End If
End Sub