@@ -3129,7 +3132,7 @@
var Descuento = parseFloat($get("TxtDescP").value);
$get("TxtPorDescP").value = Descuento * 100 / Monto * 10
- $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
+ $get("LblPrecioFinal").innerText = formato_numero(Monto - Descuento, 2, '.', ',');
$get("TxtPrecio").value = formato_numero(parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", "")), 2, '.', ',');
var Total = Monto - parseFloat($get("LblPrecioFinal").innerText.replace(",", "").replace(",", ""));
$get("LblDescuento").innerText = formato_numero(Total, 2, '.', ',');
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 0f5e6b350..19b37d41b 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -8,6 +8,7 @@ Imports System.Linq
Imports System.Security.Cryptography.X509Certificates
Imports System.Globalization
Imports System.Net.Http
+Imports Microsoft.Reporting.WebForms
Partial Class PV
Inherits ClsPaginas
@@ -5654,6 +5655,43 @@ Partial Class PV
End Sub
#End Region
+ Protected Sub BtnPDFHistorial_Click(sender As Object, e As EventArgs)
+ 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)
+ '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)))
+
+ 'Informacion de Garantia o ajuste
+ params.Add(New ReportParameter("Fecha", TxtFechaAjuste.Text.Trim))
+ params.Add(New ReportParameter("Defecto", If(DdlTipoDefecto.SelectedValue.ToEntero = -1, "", DdlTipoDefecto.SelectedItem.Text)))
+ params.Add(New ReportParameter("MesesUso", TxtMesesUso.Text.Trim))
+ params.Add(New ReportParameter("PorcentajeAjuste", TxtPorcentajeAjuste.Text.Trim))
+
+ 'Informacion Acumulador
+ 'Informacion Vehiculo
+ params.Add(New ReportParameter("MarcaAuto", ""))
+ params.Add(New ReportParameter("TipoAuto", ""))
+
+ 'Informacion Consumidor
+
+
+ If Imagen.Exists Then
+ params.Add(New ReportParameter("LogoPath", logouri))
+ Else
+ params.Add(New ReportParameter("LogoPath", ""))
+ End If
+
+ ImprimirPDF("Empresas/Grales/Formatos/Ajuste.rdlc", DtDatos, params, "Reporte de Ajuste", "PDF")
+
+ End Sub
End Class
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 65f4b3433..c483557e1 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -1335,6 +1335,17 @@ Partial Class Ventas
ViewState("CveOC") = value
End Set
End Property
+
+ Private Property RegistroxOC As Boolean
+ Get
+ Return CBool(IfNull(ViewState("RegistroxOC"), False))
+ End Get
+ Set(value As Boolean)
+ ViewState("RegistroxOC") = value
+ End Set
+ End Property
+
+
Private Property EnviarCorreoCliente As Boolean
Get
Return CBool(ViewState("EnviarCorreoCliente").ToString)
@@ -5662,7 +5673,7 @@ Partial Class Ventas
End If
- If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
+ If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False AndAlso Not RegistroxOC Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS}") < TxtCantidad.Text.ToDouble Then
@@ -6550,8 +6561,12 @@ Partial Class Ventas
actualindex = actualindex + 1
Next
End If
+ Dim EsNCAmortizacion As Boolean = False
+ If DdlTipoComprobante.SelectedValue = "Egs" AndAlso ChkAplicaNCAnticipo.Checked Then
+ EsNCAmortizacion = True
+ End If
- GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes)
+ GuardarVenta(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjFactura, TmpDT, ObjFactura.CveNCaVincular, ObjContPaq, ObjBancos, ObjOS, ObjEventos, ObjCGame, ObjClientes, EsNCAmortizacion:=EsNCAmortizacion)
'SI ES REFACTURACION
Dim ObjNC As List(Of Object) = Nothing
@@ -6574,57 +6589,9 @@ Partial Class Ventas
End If
End If
- ''[IPP]
- ''DATATABLES A USAR
- 'Dim DtSites As New DataTable
- 'Dim DtExcel As New DataTable
- ''CARGAS EXCEL EN DATATABLE
- 'DtExcel = TmpDT
-
- ''CARGAS LOS SITES REGISTRADOS
- 'If ObjBancos.GetBancos() Then
- ' DtSites = ObjBancos.DtResultados
- 'End If
-
- ''PROCESAS EXCEL
- 'Dim CveSiteActual = -1
- 'For Each Row As DataRow In TmpDT.Rows
-
- ' 'VALIDA QUE EXISTA EL SITE
- ' If DtExcel.Select($"Site = {Row("SITE")}").Count = 0 Then 'SI NO EXISTE AGREGA EL SITE
- ' CveSiteActual = ObjBancos.AddComplementoPago(-1, -1, "", -1, -1, -1)
-
- ' 'VALIDAS QUE SE HALLA AGREGADO
- ' If CveSiteActual > 0 Then
- ' 'AGREGA NUEVO SITE AL DATATABLE TEMPORAL DE SITES
- ' Dim DrNuevoSite = DtExcel.NewRow
- ' DrNuevoSite("CVE") = CveSiteActual
- ' DrNuevoSite("SITE") = Row("SITE")
- ' Else
- ' Alert("ERROR AL AGREGAR EL SITE")
- ' Exit For
- ' End If
-
- ' ElseIf DtExcel.Select($"Site = {Row("SITE")}").Count = 1 Then 'SI EXISTE OBTIENES CVE
- ' CveSiteActual = DtExcel.Select($"Site = {Row("SITE")}")(0)("Cve").ToString.ToEntero
- ' Else
- ' Alert("ERROR SOLO DEBE DAR RESULTADO 0 ó 1")
- ' Exit For
- ' End If
-
- ' 'AGREGA A TABLA CON LA DE MAS INFORMACION
- ' If Not ObjBancos.AddBancos_EstatusIE(CveSiteActual, Row("CAMPOS").ToString, Row("CAMPOS_EXTRA").ToString.ToEntero) Then
- ' Alert("ERROR AL GUARDAR")
- ' Exit For
- ' End If
-
- 'Next
-
-
-
- 'SI ES amortizacion 3.3
- Dim Obj2 As New List(Of Object)
+ 'SI ES amortizacion 3.3
+ Dim Obj2 As New List(Of Object)
If ErrorList.Count = 0 Then
' cambiar la condicion para saber si hay seleccionado
@@ -8008,7 +7975,7 @@ Partial Class Ventas
End If
If ObjFactura.TipoDocto.Contiene("Ing", "Ant") AndAlso DdlTipoRelacionAnticipo.SelectedValue.ToEntero > 0 Then ' refacturación
- ObjFactura.CveTipoRelacion = DdlTiposRelacion.SelectedValue.ToEntero
+ ObjFactura.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero
If GVAnticipos.Rows.Count > 0 Then
For Each gvr As GridViewRow In GVAnticipos.Rows
If gvr.FCCheckBox(String.Format("Chk{0}", gvr.RowIndex)).Checked AndAlso gvr.DataKey("CveConceptoContable") = "12" Then ' solo notas de crédito
@@ -8773,6 +8740,7 @@ Partial Class Ventas
If GVOC.Rows.Count > 0 Or GvOCPS.Rows.Count > 0 Then
'Checa las facturas selecionadas
VerificaOrdenesCompra(DTOrdenesCompra)
+ RegistroxOC = False
Dim dtSeleccionadas As DataTable = DTOrdenesCompra.FiltraParametros("Aplicado = True")
If GvPS.Rows.Count > 0 Then
@@ -8815,7 +8783,7 @@ Partial Class Ventas
sb.Remove(sb.Length - 1, 1)
If ObjClientes.GetVentasOCTotales(CveCliente, sb.ToString, If(ChkPSOC.Checked, 2, 1)) Then
DTOrdenesCompraPS = ObjClientes.DtResultados
-
+ RegistroxOC = True
Dim tCantidad As Decimal = 0
For Each Dr As DataRow In DTOrdenesCompraPS.Select()
tCantidad = If(ChkPSOC.Checked, GvOCPS.Rows(IndiceGVDataKey(GvOCPS, "CveOrdenCompraDetalle", $"{Dr("CveOrdenCompraDetalle")}")).FCTextBox("TxtCantidadOC").Text, Dr("Cantidad")).ToString.ToDecimal
@@ -9252,7 +9220,7 @@ Partial Class Ventas
If ErrorList.Count = 0 Then
'prepoliza
- GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos)
+ GuardarVentaPrePolizas(ObjConta, factura, TmpDTDetalle, CveNCaVincular, objContPaqi, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion)
If ErrorList.Count = 0 Then
'inventarios
If Not EsNCAmortizacion Then
@@ -9300,7 +9268,7 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue <> "Cot" Then
If factura.CvePrePoliza > 0 Then
- If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas, ObjEventos:=ObjEventos) Then
+ If ProcesoPrepolizas(ObjConta, factura, CveIE, TmpDTDetalleMovimientos, objContPaqi, 1, ObjBancos, ObjVentas, ObjEventos:=ObjEventos, EsNCAmortizacion:=EsNCAmortizacion) Then
ErrorList.Add("Ocurrió un error al agregar los Movimientos de la prepoliza.
Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
End If
@@ -9558,9 +9526,8 @@ Partial Class Ventas
TipoCambioNC = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
End If
- If Not EsNCAmortizacion Then
- 'APLICA NC SALDOS DIRECTOS
- If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
+ 'APLICA NC SALDOS DIRECTOS
+ If DtVentasNC IsNot Nothing AndAlso DtVentasNC.Rows.Count > 0 Then
For Each Dr As DataRow In DtVentasNC.Rows
@@ -9698,8 +9665,6 @@ Partial Class Ventas
Exit For
End If
End If
- End If
-
'APLICA DEVOLUCION SALDOS DIRECTOS
If AplicaDevolucion Then
@@ -10101,20 +10066,12 @@ Partial Class Ventas
importeMovimiento = 0
Case 150 'Descuento sobre ventas
- If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then
+ If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then
Dim ConceptoContableAplicar = 150
Dim CveVentaAplicar = ObjFactura.CveVenta
Dim CveVentaAmortizacionAplicar = -1
- 'cuando es NC, por amortización de anticipo, no debe de registrar el concepto 11,
- 'pero cuando es NC y se aplicó anticipo, debe de restarle el importe
- If ObjFactura.TipoDocto.Contiene("Egs") And CveAnticipo > 0 AndAlso (DdlTipoComprobante.SelectedValue = "Ing" Or (DdlTipoComprobante.SelectedValue = "Egs" AndAlso ChkAplicaNCAnticipo.Checked = True)) Then
- ConceptoContableAplicar = 11
- CveVentaAplicar = CveAnticipo
- CveVentaAmortizacionAplicar = ObjFactura.CveVenta
- End If
-
If UsuarioActual.CveEmpresa = 119 Then
'código fijo en base el porcentaje iva, que se afecten las clasificaciones
@@ -10123,16 +10080,6 @@ Partial Class Ventas
'se excluyen las clasificaciones anteriores para que se asignen las de ingreso
If Not TmpDTDetalle(i)("CveClasificacion").ToString.Contiene("19958", "19933", "18097") Then
- 'If TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal > 0 Then
- ' If TmpDTDetalle(i)("PorcentajeIVA").ToString.ToDecimal = 0.08 Then
- ' TmpDTDetalle(i)("CveClasificacion") = 20242 'clasif: ventas tasa 8%
- ' Else
- ' TmpDTDetalle(i)("CveClasificacion") = 19929 'clasif: ventas tasa 16%
- ' End If
- 'Else
- ' TmpDTDetalle(i)("CveClasificacion") = 19930 'clasif: ventas tasa 0%
- 'End If
-
If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows.Count > 0 Then
TmpDTDetalle(i)("CveClasificacion") = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveClasificacion").ToString
End If
@@ -15879,6 +15826,10 @@ Partial Class Ventas
TxtOrdenCompra.Enabled = True
TxtPedidoContrato.Enabled = True
TxtObsAlmacen.Enabled = True
+ DdlUsoCFDI.Enabled = True
+ DdlMetodoPago33.Enabled = True
+ DdlFormaPago33.Enabled = True
+ UPCondicionesPago.Update()
ModalidadEdicion = True