diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index bc113f964..0f23ec3c5 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -4973,6 +4973,25 @@ Partial Class PV
UpAjuste.Update()
End Sub
+ Private Sub CargaClienteAjuste()
+ DdlClientes.Items.Clear()
+
+ DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
+ DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1"))
+
+ DdlClientes.DataBind()
+ UpAjuste.Update()
+ End Sub
+
+ Private Sub CargaBCIAjuste()
+ Dim ObjGral As New ClsGenerales
+ If ObjGral.BCIUsadoGet(UsuarioActual.CveEmpresa) Then
+ DdlBCIAjuste.DataSource = ObjGral.DtResultados
+ End If
+ ObjGral.Dispose()
+ DdlBCIAjuste.DataBind()
+ End Sub
+
Private Sub CargaAjuste()
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.FoliosGarantiaGet(-1, UsuarioActual.CveEmpresa) Then
@@ -5007,7 +5026,8 @@ Partial Class PV
CreaDTmpDTAjustes()
CreaDTmpDTRecepcionUsados()
-
+ CargaClienteAjuste()
+ CargaBCIAjuste()
DivChkAjuste.Visible = True
End Sub
@@ -5206,7 +5226,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
@@ -5240,7 +5261,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
@@ -5297,7 +5318,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
@@ -5331,7 +5352,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
@@ -5718,15 +5739,33 @@ Partial Class PV
#End Region
Protected Sub BtnPDFHistorial_Click(sender As Object, e As EventArgs)
+
+ Dim ObjPS As New ClsProductosServicios
+ Dim MarcaPS As String = ""
+ If ObjPS.GetPS(DdlPSAjuste.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
+ MarcaPS = ObjPS.DtResultados.FiltroPrimeroValor("Marca", String.Format("CvePS = {0}", DdlPSAjuste.SelectedValue.ToEntero))
+ End If
+
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
Dim DtDatos As New DataTable
Dim params As New List(Of ReportParameter)
+
+ If DdlClientes.SelectedValue.ToEntero = -1 Then
+ params.Add(New ReportParameter("NombreCliente", LtlCliente.Text))
+ params.Add(New ReportParameter("CiudadEstado", LblCiudad.Text.Trim + ", " + LblEstado.Text))
+ params.Add(New ReportParameter("TelCliente", LblTelefono.Text))
+ Else
+ Dim DatosClienteSeleccionado As DataRow = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCliente = {0}", DdlClientes.SelectedValue.ToEntero))
+ Dim Ciudad As String = DatosClienteSeleccionado.Item("Ciudad").ToString 'GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Ciudad", String.Format("CveCliente = {0}", DdlClientes.SelectedValue.ToEntero)).Trim
+ Dim Estado As String = DatosClienteSeleccionado.Item("Estado").ToString 'GlobalDTCliente(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Estado", String.Format("CveCliente = {0}", DdlClientes.SelectedValue.ToEntero))
+ params.Add(New ReportParameter("NombreCliente", DdlClientes.SelectedItem.Text))
+ params.Add(New ReportParameter("CiudadEstado", String.Format("{0}, {1}", Ciudad.Trim, Estado)))
+ params.Add(New ReportParameter("TelCliente", DatosClienteSeleccionado.Item("Telefono").ToString))
+ End If
+
'Informacion Distribuidor
- params.Add(New ReportParameter("NombreCliente", LtlCliente.Text))
- params.Add(New ReportParameter("CiudadEstado", LblCiudad.Text.Trim + ", " + LblEstado.Text))
- params.Add(New ReportParameter("TelCliente", LblTelefono.Text))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Consec", TxtConsecutivoAjuste.Text.Trim))
params.Add(New ReportParameter("FolioAcuse", If(DdlFolioGarantia.SelectedValue.ToEntero = -1, "", DdlFolioGarantia.SelectedItem.Text)))
@@ -5742,6 +5781,8 @@ Partial Class PV
params.Add(New ReportParameter("CodEnsamble", TxtCodEnsamble.Text.Trim))
params.Add(New ReportParameter("CodLinea", TxtCodLinea.Text.Trim))
params.Add(New ReportParameter("CodInspeccion", TxtCodInspeccion.Text.Trim))
+ params.Add(New ReportParameter("Tipo", DdlBCIAjuste.SelectedItem.Text))
+ params.Add(New ReportParameter("Marca", MarcaPS))
'Informacion Vehiculo
params.Add(New ReportParameter("MarcaAuto", If(DdlPS.SelectedValue.ToEntero > 0, DtModelosAuto.FiltroPrimeroValor("Marca", $"CveModeloAuto ={DdlModeloAuto.SelectedValue}"), "")))
diff --git a/Ventas/Promociones.aspx b/Ventas/Promociones.aspx
index 8981c5be1..b1fe35644 100644
--- a/Ventas/Promociones.aspx
+++ b/Ventas/Promociones.aspx
@@ -3,6 +3,13 @@
<%@ Register Assembly="eWorld.UI" Namespace="eWorld.UI" TagPrefix="ew" %>
+
+
+
+ Generar a partir de
+
+
+
diff --git a/Ventas/Promociones.aspx.vb b/Ventas/Promociones.aspx.vb
index 4d76f7aa3..6b7e1941d 100644
--- a/Ventas/Promociones.aspx.vb
+++ b/Ventas/Promociones.aspx.vb
@@ -300,6 +300,11 @@ Partial Class Ventas_Promociones
Protected Sub ChkRestricciones_CheckedChanged(sender As Object, e As EventArgs)
DivRestricciones.Visible = ChkRestricciones.Checked
End Sub
+
+ Protected Sub BtnGenerarAPartir_Click(sender As Object, e As EventArgs)
+ CvePromocion = 0
+ End Sub
+
#End Region
diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx
index cedd77a67..806acee32 100644
--- a/Ventas/Ventas.aspx
+++ b/Ventas/Ventas.aspx
@@ -5995,7 +5995,7 @@
-
+
@@ -6378,7 +6378,7 @@
-
+
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 8c671edd1..7db533927 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -7259,27 +7259,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
@@ -7326,6 +7305,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
@@ -7497,7 +7500,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
@@ -8050,7 +8053,7 @@ Partial Class Ventas
ObjFactura.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
End If
ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero
- ObjFactura.Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
+ If HdnFolioFiscalNC.Value <> "0" And HdnFolioFiscalNC.Value <> "" Then ObjFactura.Timbre.CFDIRelacionados.UUID.Add(HdnFolioFiscalNC.Value)
End If
' cuando es refacturacoin es cfdirelacionado, con relacion 04
If ObjFactura.Timbre.Comprobante.TipoComprobante = "I" AndAlso NuevaFactura = 1 Then
@@ -9170,7 +9173,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
@@ -20879,16 +20883,18 @@ Partial Class Ventas
End Sub
Private Sub CargaRNC()
Dim ObjMovtos As New ClsMovimientos()
- If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1, TipoDocto:="RNC") Then
- GvRemisionesNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento")
+
+ If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
+ GvRemisionesNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
End If
ObjMovtos.Dispose()
GvRemisionesNC.DataBind()
End Sub
Private Sub CargaDescRNC()
+
Dim ObjMovtos As New ClsMovimientos()
- If ObjMovtos.GetCxCClienteDetalle(ViewState("CveCliente").ToString.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa, -1, TipoDocto:="RNC") Then
- GvDescNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'Act' AND CveVenta > 0", "Moneda, OrdenVencimiento, FechaVencimiento")
+ If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda:=-1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero) Then
+ GvDescNC.DataSource = ObjMovtos.DtResultados.FiltraParametros("Tipo = 'RNC' AND CveVenta > 0 and Saldo > 0", "Moneda,Fecha,Folio")
End If
ObjMovtos.Dispose()
GvDescNC.DataBind()
@@ -20930,6 +20936,7 @@ Partial Class Ventas
Exit Sub
End If
End If
+ DdlTipoComprobante.SelectedValue = "Egs"
AplicarNC(DdlNCPS.SelectedValue.ToEntero)
@@ -23464,19 +23471,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
@@ -23601,10 +23608,10 @@ Partial Class Ventas
Next
ObjProductosServicios.Dispose()
- End If
+ 'End If
- ObjAcum.Dispose()
- End If
+ ' ObjAcum.Dispose()
+ 'End If
End Sub