" style="display: inline-block; margin-right: -20px; width: 150px;" />
@@ -6449,7 +6460,7 @@
-
+
@@ -7084,7 +7095,7 @@
if (Chk.checked) {
let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
let ImportesAsignados = 0;
-
+
$('.ImportesRNCCargo').each(function () {
if ($(this).context.id != TxtImporte.id) {
ImportesAsignados += ToDouble($(this).val());
@@ -7107,7 +7118,7 @@
}
}
-
+
} else {
TxtImporte.value = "";
}
@@ -7128,14 +7139,14 @@
// if (TxtImporte.value != '') {
// Importe = parseFloat(TxtImporte.value);
// }
- //let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
- //let ImportesAsignados = 0;
- //$('.ImportesRNCCargo').each(function () {
- // if ($(this).context.id != TxtImporte.id) {
- // ImportesAsignados += ToDouble($(this).val());
- // }
- //});
-
+ //let SaldoMaximoUtilizable = ToDouble(HdnSaldoMaximoUsados.value)
+ //let ImportesAsignados = 0;
+ //$('.ImportesRNCCargo').each(function () {
+ // if ($(this).context.id != TxtImporte.id) {
+ // ImportesAsignados += ToDouble($(this).val());
+ // }
+ //});
+
// let ImporteDiferencia = SaldoMaximoUtilizable - ImportesAsignados;
// if (ImporteDiferencia < 0) {
@@ -7173,9 +7184,9 @@
let SaldoMaximoUtilizable = parseFloat(HdnSaldoMaximoUsados.value)
let ImportesAsignados = 0;
$('.ImportesRNCCargo').each(function () {
- if ($(this).context.id != TxtImporte.id) {
- ImportesAsignados += ToDouble($(this).val());
- }
+ if ($(this).context.id != TxtImporte.id) {
+ ImportesAsignados += ToDouble($(this).val());
+ }
});
let ImporteDiferencia = SaldoMaximoUtilizable - ImportesAsignados;
@@ -7320,6 +7331,17 @@
}
}
+ function CalculaPenalizacionDevolucion(TxtPenalizacion) {
+ const Porcentaje = ToDouble(TxtPenalizacion.value) / ToDouble(100);
+ if (Porcentaje <= 1) {
+ $('.ImporteDevolucion').each(function () {
+ const importe = ToDouble($(this).val());
+ const resta = importe * Porcentaje;
+ $(this).val(FormatoNumero((importe - resta), 2));
+ });
+ }
+ }
+
function displayToastr(x) {
toastr.options = {
@@ -8216,57 +8238,57 @@
function ConvertirPesosDlls() {
var totalPesos = FormatoNumero(ToDouble($get('TxtTotal').value) / ToDouble($get('TxtTipoCambioDlls').value), 2)
$('#<%= LblDolaresConvertidos.ClientID %>').text(totalPesos);
- $("#TrConversionDolaresTexto").show();
+ $("#TrConversionDolaresTexto").show();
+ }
+
+ function ConvertirDolares(ChkConvertirDolares) {
+ //LIMPIA
+ $('#<%= LblDolaresConvertidos.ClientID %>').text('');
+ $("#TrConversionDolaresTexto").hide();
+
+ //CALCULA
+ if (ChkConvertirDolares.checked) {
+ ConvertirPesosDlls();
+ }
}
- function ConvertirDolares(ChkConvertirDolares) {
- //LIMPIA
- $('#<%= LblDolaresConvertidos.ClientID %>').text('');
- $("#TrConversionDolaresTexto").hide();
+ //FUNCIONES PARA MODAL "ModalAplicarNC"
+ function CalculaImporteNC() {
+ var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
+ //var ImporteReferencia = ToDouble($get('TxtTotal').value);
- //CALCULA
- if (ChkConvertirDolares.checked) {
- ConvertirPesosDlls();
- }
- }
+ $get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2);
+ }
- //FUNCIONES PARA MODAL "ModalAplicarNC"
- function CalculaImporteNC() {
- var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
- //var ImporteReferencia = ToDouble($get('TxtTotal').value);
+ function CalculaPorcentajeNC() {
+ var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
+ //var ImporteReferencia = ToDouble($get('TxtTotal').value);
+ $get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4);
+ }
- $get('TxtNCImporte').value = FormatoNumero((ToDouble($get('TxtNCPorcentaje').value) * ImporteReferencia) / 100, 2);
- }
+ function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) {
+ debugger;
+ if (tipocambio.value.length > 0) {
- function CalculaPorcentajeNC() {
- var ImporteReferencia = (($('#C_DdlNCNivelImporte').val() == "1") ? ToDouble($get('TxtTotal').value) : ToDouble($get('TxtSubTotal').value));
- //var ImporteReferencia = ToDouble($get('TxtTotal').value);
- $get('TxtNCPorcentaje').value = FormatoNumero((ToDouble($get('TxtNCImporte').value) * 100) / ImporteReferencia, 4);
- }
+ if (CveMoneda == 1) {
+ txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2);
+ } else {
+ txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2);
- function CambioTipoMoneda(chk, saldo, txt, tipocambio, CveMoneda) {
- debugger;
- if (tipocambio.value.length > 0) {
+ }
+ }
+ }
- if (CveMoneda == 1) {
- txt.value = FormatoNumero(ToDouble(saldo / tipocambio.value), 2);
- } else {
- txt.value = FormatoNumero(ToDouble(saldo * tipocambio.value), 2);
+ function BuscarOCRegistrada() {
+ $('#btnBuscarOCRegistrada').click();
+ }
- }
- }
- }
+ function ValidaAnticipoBoton() {
- function BuscarOCRegistrada() {
- $('#btnBuscarOCRegistrada').click();
- }
+ var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2);
+ var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2);
- function ValidaAnticipoBoton() {
-
- var Descuentototal = ToDouble($('#LblDescuentos').text()).toFixed(2);
- var TotalAnticipos = ToDouble($('#LblTotalAnticipos').text()).toFixed(2);
-
- var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex'));
+ var IndexActualDdl = parseInt($('#<%= DdlTipoAmortizacionAnticipo.ClientID %>').prop('selectedIndex'));
if (IndexActualDdl == 1 && IndexActualDd2 > 0 && TotalAnticipos > 0) {
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index f61445dfc..48c051fe4 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -5563,7 +5563,7 @@ Partial Class Ventas
LnkCotizaciones.Visible = False
End If
UPCondicionesPago.Update()
- ElseIf UsuarioActual.CveEmpresa.Contiene(72, 119) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
+ ElseIf UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "Cot", "PA") AndAlso CveVenta < 1 Then
RBLPago.SelectedValue = "1"
RBLPago_SelectedIndexChanged(Nothing, Nothing)
UPCondicionesPago.Update()
@@ -7974,6 +7974,22 @@ Partial Class Ventas
ObjFacturaDevolucion.FormaPago = 0
ObjFacturaDevolucion.TipoDocto = "Egs"
+
+ If UsuarioActual.CveEmpresa = 140 Then
+ Dim ObjFolios As New ClsGralFolios()
+ Dim TipoDoctoConsulta As String = If(ObjFacturaDevolucion.TipoDocto = "Ant", "Ing", If(ObjFacturaDevolucion.TipoDocto = "PA", "Rem", ObjFacturaDevolucion.TipoDocto))
+
+ If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
+ Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
+ If DT.Rows.Count > 0 Then
+ ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
+ End If
+ DT.Dispose()
+ End If
+ ObjFolios.Dispose()
+
+ End If
+
ObjFacturaDevolucion.Fecha = Now
ObjFacturaDevolucion.Version = "3.3"
@@ -8236,6 +8252,21 @@ Partial Class Ventas
ObjFacturaBonificacion.FormaPago = 0
ObjFacturaBonificacion.TipoDocto = "Egs"
+
+ If UsuarioActual.CveEmpresa = 140 Then
+ Dim ObjFolios As New ClsGralFolios()
+ Dim TipoDoctoConsulta As String = If(ObjFacturaBonificacion.TipoDocto = "Ant", "Ing", If(ObjFacturaBonificacion.TipoDocto = "PA", "Rem", ObjFacturaBonificacion.TipoDocto))
+
+ If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
+ Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
+ If DT.Rows.Count > 0 Then
+ ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
+ End If
+ DT.Dispose()
+ End If
+ ObjFolios.Dispose()
+
+ End If
ObjFacturaBonificacion.Fecha = Now
ObjFacturaBonificacion.Version = "3.3"
@@ -8649,6 +8680,23 @@ Partial Class Ventas
'ObjFactura.Folio = If(ExFolioFactura, FolioXML.ToEntero(), -1)
ObjFactura.Serie = If(VistaPrevia, "VistaPrevia", LblSerie.Text)
+
+
+ If UsuarioActual.CveEmpresa = 140 Then
+ Dim ObjFolios As New ClsGralFolios()
+ Dim TipoDoctoConsulta As String = If(ObjFactura.TipoDocto = "Ant", "Ing", If(ObjFactura.TipoDocto = "PA", "Rem", ObjFactura.TipoDocto))
+
+ If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
+ Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
+ If DT.Rows.Count > 0 Then
+ ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
+ End If
+ DT.Dispose()
+ End If
+ ObjFolios.Dispose()
+
+ End If
+
ObjFactura.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
ObjFactura.CvePrePoliza = -1
ObjFactura.CveMetodoPago = 0 'DdlMetodoPago.SelectedValue.ToEntero()
@@ -9271,6 +9319,7 @@ Partial Class Ventas
'ObjFacturaDevolucion.RefDocto = TxtDocto.Text.Trim
'ObjFacturaDevolucion.Folio = If(ExFolioFactura, FolioXML.ToEntero(), -1)
ObjFacturaDevolucion.Serie = LblSerie.Text
+
ObjFacturaDevolucion.Fecha = New Date(TxtFecha.Text.Trim.ToDate.Year, TxtFecha.Text.Trim.ToDate.Month, TxtFecha.Text.Trim.ToDate.Day, Now.Hour, Now.Minute, Now.Second)
ObjFacturaDevolucion.CvePrePoliza = -1
ObjFacturaDevolucion.CveMetodoPago = 0 'DdlMetodoPago.SelectedValue.ToEntero()
@@ -9285,6 +9334,22 @@ Partial Class Ventas
ObjFacturaDevolucion.FormaPago = 0
'ObjFacturaDevolucion.SerieFolio = String.Format("{0}-{1}", LblSerie.Text, TxtFolio.Text)
ObjFacturaDevolucion.TipoDocto = "Egs"
+
+ If UsuarioActual.CveEmpresa = 140 Then
+ Dim ObjFolios As New ClsGralFolios()
+ Dim TipoDoctoConsulta As String = If(ObjFacturaDevolucion.TipoDocto = "Ant", "Ing", If(ObjFacturaDevolucion.TipoDocto = "PA", "Rem", ObjFacturaDevolucion.TipoDocto))
+
+ If ObjFolios.GetFolios(TipoDoctoConsulta, UsuarioActual.CveEmpresa) Then
+ Dim DT As DataTable = ObjFolios.DtResultados.FiltraParametros(String.Format(" CveSubProyecto = {0} And Estado = 'Activo'", DdlSubProyectoDatos.SelectedValue))
+ If DT.Rows.Count > 0 Then
+ ObjFactura.Serie = DT.Rows(0)("Serie").ToString()
+ End If
+ DT.Dispose()
+ End If
+ ObjFolios.Dispose()
+
+ End If
+
ObjFacturaDevolucion.Fecha = Now
@@ -15920,7 +15985,7 @@ Partial Class Ventas
Dim Row As DataRow = Nothing
Dim TotalCalculableImpuestos As Decimal = 0
Dim TotalCalculableImpuestosIVA As Decimal = 0
- PU = PU.RoundSQL(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
+ PU = PU.RoundAD(6) ' el precio unitario puede llevar hasta 6 decimales permitidos
Row = TmpDT.NewRow()
Row("CveProyecto") = CveProyecto
@@ -16046,19 +16111,19 @@ Partial Class Ventas
Row("IVA") = Row("PorcentajeIVA")
- Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundSQL(NumeroDecimales)
- Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
- Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
+ Row("ImporteIVA") = (Row("PorcentajeIVA").ToString().ToDecimal * TotalCalculableImpuestosIVA).RoundAD(NumeroDecimales)
+ Row("ImporteRetIVA") = (ClienteRetIVA * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
+ Row("ImporteRetISR") = (ClienteRetISR * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("PorcentajeRetIVA") = ClienteRetIVA
Row("PorcentajeRetISR") = ClienteRetISR
Row("PorcentajeIEPS") = DrPS("IEPSPorcentaje")
- Row("ImporteIEPS") = (DrPS("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos).RoundSQL(NumeroDecimales)
+ Row("ImporteIEPS") = (DrPS("IEPSPorcentaje").ToString().ToDecimal * TotalCalculableImpuestos).RoundAD(NumeroDecimales)
Row("IEPS") = Row("ImporteIEPS")
- Row("Descuento") = (Descuento).RoundSQL(NumeroDecimales)
+ Row("Descuento") = (Descuento).RoundAD(NumeroDecimales)
Row("TipoDescuento") = HdnTipoDescuento.Value
Row("CvePromocionDetalle") = CvePromocionDetalle
Row("Total") = (Cantidad * PU)
- Row("TotalImporte") = (Cantidad * PU).RoundSQL(NumeroDecimales)
+ Row("TotalImporte") = (Cantidad * PU).RoundAD(NumeroDecimales)
'Row("AsientoContableVentas") = DrPS("AsientoContableVentas")
' Row("IdCtaContVentas") = IdCtaContable
@@ -18929,7 +18994,15 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
DdlMetodoPago33.SelectedValueExist("3")
DdlMetodoPago33.Enabled = False
+
+ If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
+ DdlFormaPago33.Enabled = False
+ DdlFormaPago33.SelectedValueExist("20")
+ CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero())
+ End If
+
End If
+
Case 2 'CONTADO
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Or (UsuarioActual.Empresa.Funcionalidad(558).ToEntero() = 1 And DdlTipoComprobante.SelectedValue = "Cot") Then
DivContado.Visible = True
@@ -18940,6 +19013,12 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(589) = "1" Then
DdlMetodoPago33.SelectedValueExist("1")
DdlMetodoPago33.Enabled = False
+
+ If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
+ DdlFormaPago33.Enabled = True
+ CargaFormaPago(DdlMetodoPago33.SelectedValue.ToEntero())
+ End If
+
End If
Case 3 ' TERMINAL
DivTerminal.Visible = True
@@ -23348,9 +23427,18 @@ Partial Class Ventas
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
- DivSMU.Visible = False
- HdnSaldoMaximoUsados.Value = "0"
- LtlSMU.Text = "0"
+ Dim ObjAcum As New ClsAcumuladores
+ If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
+ Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
+ DivSMU.Visible = True
+ HdnSaldoMaximoUsados.Value = RowUsadosNC("Valor").ToString()
+ LtlSMU.Text = RowUsadosNC("Valor").ToString().ToDecimal().FormatoNumero(2)
+ Else
+ DivSMU.Visible = False
+ HdnSaldoMaximoUsados.Value = "0"
+ LtlSMU.Text = "0"
+ End If
+ ObjAcum.Dispose()
End If
UpModalRemisionesNC.Update()
@@ -23798,7 +23886,15 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 140 Then
CrearDTNCCargo(ListaNCDesc, DtImpuestos, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
- CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
+
+ 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO'
+ Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=360481).FiltroPrimero("")
+ If DrPSBonificacion IsNot Nothing Then
+ CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
+ Else
+ Alert("No se encontró el concepto de BONIFICACION POR USADO", TipoMensaje.MsgAdvertencia)
+ CrearDTNCBonificacion(ListaNCDesc, DtImpuestosBonificacion, TmpDTDescNC, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
+ End If
Else
For Each Dr As DataRow In DtImpuestos.Rows
@@ -23830,7 +23926,14 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 140 AndAlso ListaRemisionesNC.Count > 0 Then
CrearDTNCCargo(ListaRemisionesNC, DtImpuestos, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
- CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
+ 'EN LA NC DE BONIFICACION EL CONCEPTO DEBE SER SIEMPRE 'BONIFICACION POR USADO'
+ Dim DrPSBonificacion = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=360481).FiltroPrimero("")
+ If DrPSBonificacion IsNot Nothing Then
+ CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPSBonificacion, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
+ Else
+ Alert("No se encontró el concepto de BONIFICACION POR USADO", TipoMensaje.MsgAdvertencia)
+ CrearDTNCBonificacion(ListaRemisionesNC, DtImpuestosBonificacion, TmpDT, DrPS, CveProyecto, Proyecto, CveSubProyecto, SubProyecto)
+ End If
Else
For Each Dr As DataRow In DtImpuestos.Rows
@@ -24420,6 +24523,7 @@ Partial Class Ventas
e.Row.FCLabel("LblProyecto").Text = e.Row.FCLabel("LblSubProyecto").Text
e.Row.FCLabel("LblProyecto").Style.Clear()
e.Row.FCLabel("LblSubProyecto").Text = ""
+ 'e.Row.FCCheckBox("ChkAplicar").Attributes.Add("onclick", $"CalculaSaldoRNCChk({e.Row.FCTextBox("TxtImporte").ClientID},{e.Row.DBCampo("Saldo").ToDouble}, this);")
End If
End If
End Sub