diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 1eeb43303..6e73cd85f 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -2457,6 +2457,8 @@ Partial Class Bancos_IE
If CveIE > 0 Then
If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque
+ If UsuarioActual.CveEmpresa = 119 Then FolioFijo = 0
+
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
'valida prepoliza
diff --git a/Bancos/PagoDeudor.aspx.cs b/Bancos/PagoDeudor.aspx.cs
index e837bbdfa..e2d5b27ef 100644
--- a/Bancos/PagoDeudor.aspx.cs
+++ b/Bancos/PagoDeudor.aspx.cs
@@ -844,7 +844,7 @@ public partial class Bancos_PagoDeudor : ClsPaginas
}
}
bool AutoConta = UsuarioActual.Empresa.Funcionalidad(200).Equals("1");
- if (UsuarioActual.CveEmpresa == 119) AutoConta = false;
+ //if (UsuarioActual.CveEmpresa == 119) AutoConta = false;
if (AutoConta && MsgError.Equals(""))
{
diff --git a/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc b/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc
new file mode 100644
index 000000000..0a0262614
--- /dev/null
+++ b/Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc
@@ -0,0 +1,969 @@
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ OC
+
+
+
+
+
+
+ Textbox28
+
+
+ Gray
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+ 7.36287cm
+
+
+ 3.6966cm
+
+
+ 2.91394cm
+
+
+ 1.65333cm
+
+
+ 2.5cm
+
+
+
+
+ 0.46771cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!RazonSocial.Value
+
+
+
+
+
+
+ RazonSocial
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Nombre.Value
+
+
+
+
+
+
+ Nombre
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!ImporteSol.Value
+
+
+
+
+
+
+ ImporteSol
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+ es-MX
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!FolioMov.Value
+
+
+
+
+
+
+ FolioMov
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Importe.Value
+
+
+
+
+
+
+ Importe
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+ 0.46771cm
+
+
+ true
+ true
+
+
+
+
+ Proveedor
+
+
+
+
+
+
+ Textbox6
+
+
+ Gray
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.46771cm
+
+
+ true
+ true
+
+
+
+
+ Usuario Solicitó
+
+
+
+
+
+
+ Textbox4
+
+
+ Gray
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.46771cm
+
+
+ true
+ true
+
+
+
+
+ Importe Solicitud
+
+
+
+
+
+
+ Textbox40
+
+
+ Gray
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.46771cm
+
+
+ true
+ true
+
+
+
+
+ Mov. Banc.
+
+
+
+
+
+
+ Textbox5
+
+
+ Gray
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+ =IIf(Parameters!Estatus.Value = "3",False,True)
+
+
+
+
+ 0.46771cm
+
+
+ true
+ true
+
+
+
+
+ Importe
+
+
+
+
+
+
+ Textbox18
+
+
+ Gray
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+ =IIf(Parameters!Estatus.Value = "3",False,True)
+
+
+
+
+
+
+
+
+
+ 1.60042cm
+
+
+ true
+ true
+
+
+
+
+ =Fields!Folio.Value
+
+
+
+
+
+
+ Folio
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+ DataSet1
+ 0.82931cm
+ 0.06614cm
+ 0.93542cm
+ 19.72716cm
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!AgrupadoPor.Value
+ HTML
+
+
+
+
+
+
+ Textbox1
+ 0.07056cm
+ 0.06614cm
+ 0.58236cm
+ 19.58715cm
+ 1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 0.79506in
+
+
+ 7.79264in
+
+
+ 2.22362cm
+ true
+
+
+ true
+ true
+
+
+
+
+ =Parameters!NombreEmpresa.Value
+
+
+
+
+
+
+ Textbox1
+ 2.43857cm
+ 0.6cm
+ 14.68354cm
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ REPORTE DE SOLICITUDES DE ANTICIPO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Textbox2
+ 0.63528cm
+ 2.40329cm
+ 0.52945cm
+ 14.68354cm
+ 1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ External
+ =Parameters!LogoPath.Value
+ FitProportional
+ 0.06614cm
+ 2.22362cm
+ 2.33715cm
+ 2
+
+
+
+
+
+
+
+
+
+
+ 1.61043cm
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ ="Página " & Globals.PageNumber & " de " & Globals.TotalPages
+
+
+
+
+
+
+ Textbox3
+ 0.40041cm
+ 16.97887cm
+ 0.68085cm
+ 2.06587cm
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ Usuario:
+
+
+
+
+
+
+ Textbox8
+ 0.40041cm
+ 0.06614cm
+ 0.68085cm
+ 1.60042cm
+ 1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!UsuarioImprimio.Value
+
+
+
+
+
+
+ Textbox9
+ 0.40041cm
+ 1.61047cm
+ 0.68085cm
+ 5.14936cm
+ 2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ Fecha Impresión:
+
+
+
+
+
+
+ Textbox10
+ 0.40041cm
+ 6.93622cm
+ 0.68085cm
+ 2.92333cm
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ Textbox11
+ 0.40041cm
+ 9.84544cm
+ 0.68085cm
+ 4.32745cm
+ 4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ IMPRESO EN SIG, Rep. Solicitudes Anticipo
+
+
+
+
+
+
+ Textbox9
+ 0.92958cm
+ 0.06614cm
+ 0.68085cm
+ 6.87008cm
+ 5
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 0.40041cm
+ 0.06614cm
+ 0cm
+ 19.58715cm
+ 6
+
+
+
+
+
+
+
+
+
+ 29.7cm
+ 21cm
+ 0.5cm
+ 0.5cm
+ 1cm
+ 1cm
+ 0.13cm
+
+
+ 0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ f55ecc33-47ff-4fc5-a233-35ea9bb1f578
+
+
+
+
+
+ DataSet
+ /* Local Query */
+
+
+
+ Folio
+ System.String
+
+
+ RazonSocial
+ System.String
+
+
+ Nombre
+ System.String
+
+
+ ImporteSol
+ System.String
+
+
+ FolioMov
+ System.String
+
+
+ Importe
+ System.String
+
+
+
+ DataSet
+ C:\Users\Caudillo\Documents\Visual Studio 2013\WebSites\WebSite9\App_Code\DataSet.xsd
+ DataTable1
+
+
+
+
+
+
+
+
+ String
+ true
+ true
+ ReportParameter1
+
+
+ String
+ true
+ true
+ ReportParameter1
+
+
+ String
+ true
+ true
+ ReportParameter1
+
+
+ String
+ true
+ true
+ ReportParameter1
+
+
+ String
+ true
+ true
+ ReportParameter1
+
+
+ es-MX
+ Cm
+ 40c94aad-a12a-44fb-ab0d-ea36a9656792
+
\ No newline at end of file
diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx
index cd25a6832..804c83873 100644
--- a/Inventarios/RecepcionUsados.aspx
+++ b/Inventarios/RecepcionUsados.aspx
@@ -324,6 +324,8 @@
+
+
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 96262ce47..1b073987b 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -1096,6 +1096,7 @@ Partial Class Inventarios_RecepcionUsados
EnvioCorreo()
+ CargaPendientesRecibir()
UPDatos.Update()
Else
@@ -1923,6 +1924,10 @@ Partial Class Inventarios_RecepcionUsados
End Sub
Protected Sub BtnConsultarPendientes_Click(sender As Object, e As EventArgs)
+ CargaPendientesRecibir()
+ End Sub
+
+ Private Sub CargaPendientesRecibir()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVentasUsados(-1, DdlSubProyectos.SelectedValue.ToEntero(), TxtFechaPendientes.Text.ToDateTime(), UsuarioActual.CveEmpresa) Then
GVPendientes.DataSource = ObjVentas.DtResultados
diff --git a/OC/RepSolicitudesAnticipo.aspx b/OC/RepSolicitudesAnticipo.aspx
index acd8fd09e..7b3187682 100644
--- a/OC/RepSolicitudesAnticipo.aspx
+++ b/OC/RepSolicitudesAnticipo.aspx
@@ -10,14 +10,12 @@
-<%--
-
-
-
- Generar PDF
-
-
- --%>
+
+ Generar PDF
+
+
+ Exporta Excel
+
diff --git a/OC/RepSolicitudesAnticipo.aspx.cs b/OC/RepSolicitudesAnticipo.aspx.cs
index 69d5fd3fe..b8cc189ea 100644
--- a/OC/RepSolicitudesAnticipo.aspx.cs
+++ b/OC/RepSolicitudesAnticipo.aspx.cs
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
+using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Extensiones;
+using Microsoft.Reporting.WebForms;
using static Extensiones.ModExtensiones;
public partial class OC_RepSolicitudesAnticipo : ClsPaginas
@@ -47,6 +49,11 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
ViewState["FechaF"] = value;
}
}
+ private DataTable DtDatos
+ {
+ get { return DtDatos = (DataTable)ViewState["DtDatos"]; }
+ set { ViewState["DtDatos"] = value; }
+ }
#endregion
protected void Page_Load(object sender, EventArgs e)
@@ -82,7 +89,8 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
if (ObjOC.GetRepSolicitudAnticipos(UsuarioActual.CveEmpresa, CveProveedor, FechaI, FechaF, DdlEstatus.SelectedValue.ToEntero()))
{
- GvSolicitudes.DataSource = ObjOC.DtResultados;
+ DtDatos = ObjOC.DtResultados;
+ GvSolicitudes.DataSource = DtDatos;
}
ObjOC.Dispose();
@@ -106,4 +114,51 @@ public partial class OC_RepSolicitudesAnticipo : ClsPaginas
}
CargaDatos();
}
+
+ protected void LnkExcel_Click(object sender, EventArgs e)
+ {
+ GenerarPDF("EXCEL");
+ }
+
+ protected void LnkPdf_Click(object sender, EventArgs e)
+ {
+ GenerarPDF("PDF");
+ }
+
+ protected void GenerarPDF(String Opcion)
+ {
+ String FechaI;
+ if (txtFechaI.Text == "" || txtFechaI.Text == "__/__/____") { FechaI = ""; } else { FechaI = $" Fecha Inicial: {txtFechaI.Text}"; }
+ String FechaF;
+ if (txtFechaF.Text == "" || txtFechaF.Text == "__/__/____") { FechaF = ""; } else { FechaF = $" Fecha Final: {txtFechaF.Text}"; }
+ String Proveedor;
+ if (DdlProveedor.SelectedValue != "-1") { Proveedor = $" Proveedor: {DdlProveedor.SelectedItem.Text}"; } else { Proveedor = ""; }
+ String Estatus;
+ if (DdlEstatus.SelectedValue != "1") { Estatus = $" Estatus: {DdlEstatus.SelectedItem.Text}"; } else { Estatus = ""; }
+
+ if (DtDatos.Rows.Count > 0)
+ {
+ System.IO.FileInfo Imagen = new System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta));
+ String logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa);
+ List para = new List();
+ para.Add(new ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa));
+ para.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Nombre));
+ para.Add(new ReportParameter("Estatus", DdlEstatus.SelectedValue));
+ String Agrupadores = $"{Proveedor}{FechaI}{FechaF}{Estatus}";
+ para.Add(new ReportParameter("AgrupadoPor", (Agrupadores == "" ? "": $"Agrupado Por: {Agrupadores}")));
+ if (Imagen.Exists)
+ {
+ para.Add(new ReportParameter("LogoPath", logouri));
+ }
+ else
+ {
+ para.Add(new ReportParameter("LogoPath", ""));
+ }
+ ImprimirPDF("Empresas/Grales/Formatos/RepSolicitudAnticipo.rdlc", DtDatos, para, "Reporte de Solicitudes de Anticipos", Opcion);
+ }
+ else
+ {
+ Alert("No hay datos consultados", ModExtensiones.TipoMensaje.MsgAdvertencia);
+ }
+ }
}
\ No newline at end of file
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index a76ce216c..e9d0fd0f7 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -3482,13 +3482,50 @@ Partial Class PV
Return False
End If
- Dim CantidadUsados As Decimal = 0
+
+ 'Validacion de Recepción de Usados
+ Dim Vendido As Decimal = 0
+ Dim Entregado As Decimal = 0
+ Dim UltimoEntregado As Decimal = 0
+
For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
If Gvr.RowType = DataControlRowType.DataRow Then
- CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero()
+ If Gvr.FCTextBox("TxtCantidad").Text.ToEntero() > 0 Then
+ Entregado += (Gvr.FCTextBox("TxtCantidad").Text.ToEntero * Gvr.DataKey("Cargo").ToDecimal)
+ UltimoEntregado = Gvr.DataKey("Cargo").ToDecimal
+ End If
End If
Next
+ If Entregado > 0 Then
+ 'Calcular Vendido
+ Dim DTTamanios As New DataTable
+ Dim ObjAcum As New ClsAcumuladores
+ If ObjAcum.TamañoGet(-1, UsuarioActual.CveEmpresa) Then
+ DTTamanios = ObjAcum.DtResultados
+ End If
+ ObjAcum.Dispose()
+ Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
+
+ If DTTamanios.Rows.Count > 0 And DTTamanios IsNot Nothing And DrPS("CveTamaño").ToString.ToEntero > 0 Then
+ Vendido = DTTamanios.FiltroPrimeroValor("Cargo", $" CveTamaño = { DrPS("CveTamaño") }").ToDecimal
+ End If
+
+ If Entregado > Vendido Then
+ If (Entregado - Vendido) >= UltimoEntregado Then
+ Alert("No puede entregar un cargo mayor a lo Vendido", TipoMensaje.MsgAdvertencia)
+ Return False
+ End If
+ End If
+ End If
+
+ 'Dim CantidadUsados As Decimal = 0
+ 'For Each Gvr As GridViewRow In GvRecepcionUsados.Rows
+ ' If Gvr.RowType = DataControlRowType.DataRow Then
+ ' CantidadUsados = CantidadUsados + Gvr.FCTextBox("TxtCantidad").Text.ToEntero()
+ ' End If
+ 'Next
+
'If CantidadUsados > TxtCantidad.Text.ToEntero() Then
' Alert("No puede tener una cantidad mayor a la de los cargos", TipoMensaje.MsgAdvertencia)
' Return False
@@ -4920,7 +4957,7 @@ Partial Class PV
TmpDTAjustes.Columns.Add("CveUM", GetType(Integer))
TmpDTAjustes.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDTAjustes.Columns.Add("CveVenta", GetType(Integer))
- TmpDTAjustes.Columns.Add("PUFactura", GetType(Integer))
+ TmpDTAjustes.Columns.Add("PUFactura", GetType(Double))
End Sub
@@ -5094,18 +5131,21 @@ Partial Class PV
End Sub
Private Sub CalculaMesesUso()
- Dim FechaI = TxtFechaAjuste.Text.ToDate.AddDays(1)
- Dim FechaF = Now
- 'Dim NumDiasAlMes As Double = (365 / 12)
- 'Dim DiasTranscurridos = DateDiff(DateInterval.Day, FechaI, FechaF)
- 'Dim MesesTranscurridos As Double = (DiasTranscurridos / NumDiasAlMes)
- 'Dim Diff = Math.Round(MesesTranscurridos - Math.Truncate(MesesTranscurridos), 2)
+ Dim FechaI As Date = TxtFechaAjuste.Text.ToDate.AddDays(1)
+ Dim FechaF As Date = Now
+ Dim FechaT As Date = String.Format("{0}/{1}/{2}", FechaI.Day, FechaF.Month, FechaF.Year).ToDate 'armo la fecha con el día del mes actual
- 'Dim NoMesesTrascurridos = Math.Ceiling(MesesTranscurridos)
- Dim NoMesesTrascurridos2 = DateDiff(DateInterval.Month, FechaI, FechaF)
+ Dim MesesTrascurridos As Integer = Math.Round(DateDiff(DateInterval.Day, FechaI, FechaT) / 30.4, 2).ToEntero 'saco los meses y lo redondeo
+
+ If FechaT > FechaF Then
+ 'todavía está en el mes actual.
+ MesesTrascurridos = MesesTrascurridos
+ Else
+ MesesTrascurridos = MesesTrascurridos + 1
+ End If
+
+ TxtMesesUso.Text = MesesTrascurridos.ToString
- 'TxtMesesUso.Text = If(Diff > 0.5, NoMesesTrascurridos, NoMesesTrascurridos2).ToString()
- TxtMesesUso.Text = NoMesesTrascurridos2.ToString
CalculaPorcentajeAjuste()
End Sub
@@ -5177,6 +5217,13 @@ Partial Class PV
End If
End If
+ 'el ajuste no puede ser mayor al precio de lo vendido de nuevo
+ If (TxtPrecio.Text.ToDouble - ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior))) < 0 Then
+ TxtDescuentoAjuste.Text = TxtPrecio.Text
+ TxtImporteAjuste.Text = "0.00"
+ CargoAnterior = CargoActual
+ End If
+
TxtDescuentoAjuste.Text = ((TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble) - (CargoActual - CargoAnterior)).FormatoNumero
TxtDescuentoAjuste.ToolTip = $"La diferencia de ajuste fue: {(TxtPrecio.Text.ToDouble - TxtImporteAjuste.Text.ToDouble).FormatoNumero()}. La diferencia de tamaños fue: {(CargoActual - CargoAnterior).FormatoNumero}."
End If
@@ -5294,6 +5341,7 @@ Partial Class PV
End If
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
Dim TotalCalculableImpuestos As Decimal = (Dr("Cantidad").ToString.ToDecimal * (Dr("PU").ToString.ToDecimal)) - Dr("Descuento").ToString.ToDecimal
Dr("ImporteIVA") = Math.Round(Dr("PorcentajeIVA").ToString.ToDecimal * TotalCalculableImpuestos, NumeroDecimales)
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index cb789b33b..fac523585 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -9576,24 +9576,24 @@ Partial Class Ventas
TCFluctuacion = GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal
End If
- If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
- ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
- ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
- ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
- ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
- Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion
- ImporteMN251 = Dr("Importe").ToString.ToDecimal
- Else
- ImporteMN251 = Dr("Importe").ToString.ToDecimal
- End If
+ If DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Not Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
+ ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
+ ElseIf DdlMoneda.SelectedValue.ToEntero = 2 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
+ ImporteMN251 = Dr("Importe").ToString.ToDecimal * TCFluctuacion
+ ElseIf DdlMoneda.SelectedValue.ToEntero = 1 AndAlso Dr("TCCambioValuacion").ToString.ToDecimal > 1 Then
+ Importe251 = Dr("Importe").ToString.ToDecimal / TCFluctuacion
+ ImporteMN251 = Dr("Importe").ToString.ToDecimal
+ Else
+ ImporteMN251 = Dr("Importe").ToString.ToDecimal
+ End If
- Importe251 = (Importe251 * Multiplicador).RoundSQL
+ Importe251 = Importe251.RoundSQL
- Importe91 = (Importe91 * ValorMultiplicador).RoundSQL
- ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL
- If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}"
+ Importe91 = (Importe91).RoundSQL
+ ImporteMN91 = (ImporteMN91 * Multiplicador).RoundSQL
+ If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${Importe91.FormatoNumero(2)}"
- CveUltimaVenta = Dr("CveVenta").ToString.ToEntero
+ CveUltimaVenta = Dr("CveVenta").ToString.ToEntero
Dim ImporteComplementarioIngreso As Decimal = 0
If UsaComplementariaClientes = True AndAlso tipoCambio > 1 Then
@@ -16679,7 +16679,7 @@ Partial Class Ventas
Private Function ValidaPagosContado() As Boolean
Dim Retorno = False
- If (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) Then
+ If (UsuarioActual.CveEmpresa = 140) AndAlso (Not PermiteCredito) AndAlso (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) And TxtTotal.Text.ToDecimal > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = True
End If