This commit is contained in:
2025-04-24 18:29:38 -07:00
4 changed files with 128 additions and 175 deletions

View File

@@ -1307,6 +1307,7 @@ Namespace Modelos
TmpDT.Columns.Add("Descuento", GetType(Decimal)) TmpDT.Columns.Add("Descuento", GetType(Decimal))
TmpDT.Columns.Add("TipoDescuento", GetType(Integer)) TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("TotalImporte", GetType(Decimal)) TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal)) TmpDT.Columns.Add("Total", GetType(Decimal))
TmpDT.Columns.Add("RetIVA", GetType(Decimal)) TmpDT.Columns.Add("RetIVA", GetType(Decimal))
TmpDT.Columns.Add("RetISR", GetType(Decimal)) TmpDT.Columns.Add("RetISR", GetType(Decimal))
@@ -1385,8 +1386,14 @@ Namespace Modelos
TmpDT.Columns.Add("CveViajePasajero", GetType(Integer)) TmpDT.Columns.Add("CveViajePasajero", GetType(Integer))
TmpDT.Columns("CveViajePasajero").DefaultValue = -1 TmpDT.Columns("CveViajePasajero").DefaultValue = -1
'COLUMNAS DE Ventas.aspx
TmpDT.Columns.Add("CantidadConversion", GetType(Decimal)) TmpDT.Columns.Add("CantidadConversion", GetType(Decimal))
TmpDT.Columns("CantidadConversion").DefaultValue = 0 TmpDT.Columns("CantidadConversion").DefaultValue = 0
TmpDT.Columns.Add("NumeroPedimento", GetType(String))
TmpDT.Columns.Add("CodigoAlterno", GetType(String))
TmpDT.Columns.Add("PSAlterno", GetType(String))
TmpDT.Columns.Add("Costo", GetType(Decimal))
TmpDT.Columns("Costo").DefaultValue = 0D
'COLUMNAS DE PV.aspx 'COLUMNAS DE PV.aspx
TmpDT.Columns.Add("PUOriginal", GetType(Decimal)) TmpDT.Columns.Add("PUOriginal", GetType(Decimal))

View File

@@ -1580,12 +1580,14 @@
HdnSobranteFaltante.value = "0"; HdnSobranteFaltante.value = "0";
//HdnCambioFaltante.value = "1"; //HdnCambioFaltante.value = "1";
let cambio = total - totalVenta; let cambio = total - totalVenta;
if (cambio > 1) { if (cambio > 1 || totalEfectivo > 0) {
$get("TxtFaltante").value = ""; $get("TxtFaltante").value = "";
$get("ChkSobFaltante").checked = false; $get("ChkSobFaltante").checked = false;
$get("TxtCambio").value = FormatoNumero(cambio); $get("TxtCambio").value = FormatoNumero(cambio);
} else { } else {
//SOLO ACTIVAR SI NO HAY EFECTIVO
if (totalEfectivo == 0) {
if (cambio == 'NaN') { if (cambio == 'NaN') {
$get("TxtFaltante").value = "0.00"; $get("TxtFaltante").value = "0.00";
} else { } else {
@@ -1596,6 +1598,8 @@
$get("TxtCambio").value = ""; $get("TxtCambio").value = "";
} }
}
} else { } else {
C_lblCambio.innerHTML = "Faltante:"; C_lblCambio.innerHTML = "Faltante:";
HdnSobranteFaltante.value = "1"; HdnSobranteFaltante.value = "1";
@@ -1627,6 +1631,13 @@
sobFaltantePermitido = 10; sobFaltantePermitido = 10;
} }
let totalEfectivo = $get("TxtImporteEfectivo") ? ToDouble($get("TxtImporteEfectivo").value) : 0;
if (totalEfectivo > 0) {
sobFaltantePermitido = 0;
}
if (sobFaltantePermitido > 0) {
if (ToDouble($get("TxtFaltante").value) > sobFaltantePermitido) { if (ToDouble($get("TxtFaltante").value) > sobFaltantePermitido) {
alert("El sobrante/faltante no debe ser mayor a " + sobFaltantePermitido); alert("El sobrante/faltante no debe ser mayor a " + sobFaltantePermitido);
$get("TxtFaltante").value = ""; $get("TxtFaltante").value = "";
@@ -1634,6 +1645,13 @@
} else { } else {
$get("ChkSobFaltante").checked = true; $get("ChkSobFaltante").checked = true;
} }
} else {
alert("El sobrante/faltante no esta permitido");
$get("TxtFaltante").value = "";
$get("ChkSobFaltante").checked = false;
}
} }
function CargaSobranteFaltante() { function CargaSobranteFaltante() {
@@ -1644,6 +1662,14 @@
if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) { if (<%= If(UsuarioActual.Empresa.CveEmpresa = 189, 1, 0)%> == 1) {
sobFaltantePermitido = 10; sobFaltantePermitido = 10;
} }
let totalEfectivo = $get("TxtImporteEfectivo") ? ToDouble($get("TxtImporteEfectivo").value) : 0;
if (totalEfectivo > 0) {
sobFaltantePermitido = 0;
}
if (sobFaltantePermitido > 0) {
if (ToDouble($get("TxtCambio").value) > sobFaltantePermitido) { if (ToDouble($get("TxtCambio").value) > sobFaltantePermitido) {
alert("El sobrante/faltante no debe ser mayor a " + sobFaltantePermitido) alert("El sobrante/faltante no debe ser mayor a " + sobFaltantePermitido)
$get("ChkSobFaltante").checked = false; $get("ChkSobFaltante").checked = false;
@@ -1654,6 +1680,13 @@
$get("TxtFaltante").value = $get("TxtCambio").value; $get("TxtFaltante").value = $get("TxtCambio").value;
} }
} }
} else {
alert("El sobrante/faltante no esta permitido");
$get("TxtFaltante").value = "";
$get("ChkSobFaltante").checked = false;
}
} }
else { else {

View File

@@ -673,9 +673,11 @@ Partial Class Ventas_PVCobranza
End If End If
End If End If
Dim tCveCorte As Integer = CveCorte Dim DebeTenerCorteCaja As Boolean = UsuarioActual.TienePermisoProceso(371) ' Usa Cortes de Caja - en Cajas
If tCveCorte <= 0 Then Dim tCveCorte As Integer = If(DebeTenerCorteCaja, Me.CveCorte, -1)
If DebeTenerCorteCaja AndAlso tCveCorte <= 0 Then
Alert("No se puede realizar el pago. Debe tener un corte activo", TipoMensaje.MsgAdvertencia) Alert("No se puede realizar el pago. Debe tener un corte activo", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
@@ -897,7 +899,7 @@ Partial Class Ventas_PVCobranza
MsgError = "Tiene saldo pendiente por aplicar" MsgError = "Tiene saldo pendiente por aplicar"
End If End If
If UsuarioActual.CveRol <> 1 Then If DebeTenerCorteCaja Then
If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
MsgError = "Error al aplicar el corte" MsgError = "Error al aplicar el corte"
End If End If
@@ -1704,12 +1706,9 @@ Partial Class Ventas_PVCobranza
If ChkSobFaltante.Checked AndAlso SobranteFaltante <> 0 Then If ChkSobFaltante.Checked AndAlso SobranteFaltante <> 0 Then
'SOBRANTE 'SOBRANTE
If SobranteFaltante > 0 Then If SobranteFaltante > 0 Then
'SI ES EL SOBRANTE EN EFECTIVO SUMAR EL SOBRANTE/FALTANTE 'EL SOBRANTE/FALTANTE NO PUEDE SER EN EFECTIVO
If Metodo = 13 Then If Metodo = 13 Then
ImporteIE += SobranteFaltante Retorno = "Error en aplicación de sobrante/faltante"
Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal()
'LIMPIAR SOBRANTE/FALTANTE
SobranteFaltante = 0
Else Else
'AJUSTAR DONDE EL IMPORTE A BANCOS SEA MAYOR EN EL DE LA VENTA 'AJUSTAR DONDE EL IMPORTE A BANCOS SEA MAYOR EN EL DE LA VENTA
If ImporteBancos.RoundSQL(2) >= ImporteAbonoVenta.RoundSQL(2) Then If ImporteBancos.RoundSQL(2) >= ImporteAbonoVenta.RoundSQL(2) Then
@@ -1722,7 +1721,10 @@ Partial Class Ventas_PVCobranza
'FALTANTE 'FALTANTE
If SobranteFaltante < 0 Then If SobranteFaltante < 0 Then
'METER LO QUE FALTA COMO GASTO 'EL SOBRANTE/FALTANTE NO PUEDE SER EN EFECTIVO
If Metodo = 13 Then
Retorno = "Error en aplicación de sobrante/faltante"
Else 'METER LO QUE FALTA COMO GASTO
If (ImporteBancos.RoundSQL(2) + Math.Abs(SobranteFaltante)) = ImporteAbonoVenta.RoundSQL(2) Then If (ImporteBancos.RoundSQL(2) + Math.Abs(SobranteFaltante)) = ImporteAbonoVenta.RoundSQL(2) Then
Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal() Pago.OtroGastoIngreso = SobranteFaltante.ToString().ToDecimal()
@@ -1738,6 +1740,9 @@ Partial Class Ventas_PVCobranza
End If End If
End If
If String.IsNullOrEmpty(Retorno) Then
CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto) CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImporteIE, 1, 1, Obs, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCorte:=tCveCorte, CveAutorizacion:=CveAutorizacion, CveSubProyecto:=CveSubProyecto)
If CveIEPago > 0 Then If CveIEPago > 0 Then
Dim tImportePago As Decimal = If(ImporteBancos > ImporteAbonoVenta, ImporteAbonoVenta, ImporteBancos) 'toma el importe menor para la factura Dim tImportePago As Decimal = If(ImporteBancos > ImporteAbonoVenta, ImporteAbonoVenta, ImporteBancos) 'toma el importe menor para la factura
@@ -1768,6 +1773,8 @@ Partial Class Ventas_PVCobranza
Retorno = "Pago en Bancos no registrado" Retorno = "Pago en Bancos no registrado"
ErrorConta = True ErrorConta = True
End If End If
End If
Else Else
Retorno = "No se ha especificado la cuenta" Retorno = "No se ha especificado la cuenta"
End If End If

View File

@@ -37861,7 +37861,7 @@ Partial Class Ventas
ObjFacturaProntoPago.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) ObjFacturaProntoPago.UsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("Descripcion", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFacturaProntoPago.ClaveUsoCFDISAT = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI)) ObjFacturaProntoPago.ClaveUsoCFDISAT = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", String.Format("CveUsoCFDI = {0}", ObjCliente.CveUsoCFDI))
ObjFacturaProntoPago.DtDetalle = CreaDTDetalleNCProntoPago() ObjFacturaProntoPago.DtDetalle = Modelos.Factura.CreaDTFactura() 'CreaDTDetalleNCProntoPago()
CargaImpuestosProntoPago(ObjFacturaProntoPago, ObjFactura, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA.ToDecimal, ObjCliente.RetISR.ToDecimal) CargaImpuestosProntoPago(ObjFacturaProntoPago, ObjFactura, ObjCliente.DesglosaIEPS, ObjCliente.RetIVA.ToDecimal, ObjCliente.RetISR.ToDecimal)
@@ -38156,100 +38156,6 @@ Partial Class Ventas
Return query.QueryToDataTable(False) Return query.QueryToDataTable(False)
End Function End Function
Protected Function CreaDTDetalleNCProntoPago() As DataTable
Dim TmpDT As New DataTable
TmpDT.Columns.Add("CveVenta", GetType(Integer))
TmpDT.Columns.Add("Consec", GetType(Integer))
TmpDT.Columns.Add("Cantidad", GetType(Decimal))
TmpDT.Columns.Add("Codigo", GetType(String))
TmpDT.Columns.Add("CveUM", GetType(Integer))
TmpDT.Columns.Add("UM", GetType(String))
TmpDT.Columns.Add("SATClaveUM", GetType(String))
TmpDT.Columns.Add("CveClasificacion", GetType(Integer))
TmpDT.Columns.Add("Clasificacion", GetType(String))
TmpDT.Columns.Add("CvePS", GetType(Integer))
TmpDT.Columns.Add("PS", GetType(String))
TmpDT.Columns.Add("CodigoPS", GetType(String))
TmpDT.Columns.Add("SATClaveProdServ", GetType(String))
TmpDT.Columns.Add("NoIdentificacion", GetType(String))
TmpDT.Columns.Add("CveTipoPS", GetType(Integer))
TmpDT.Columns.Add("CveTipoInvPS", GetType(Integer))
TmpDT.Columns.Add("Serie", GetType(String))
TmpDT.Columns.Add("CuentaPredial", GetType(String))
TmpDT.Columns.Add("Obs", GetType(String))
TmpDT.Columns.Add("TiempoEntrega", GetType(String))
TmpDT.Columns.Add("PU", GetType(Decimal))
TmpDT.Columns.Add("IVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetIVA", GetType(Decimal))
TmpDT.Columns.Add("ImporteRetISR", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetIVA", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeRetISR", GetType(Decimal))
TmpDT.Columns.Add("ImporteIEPS", GetType(Decimal))
TmpDT.Columns.Add("IEPS", GetType(Decimal))
TmpDT.Columns.Add("PorcentajeIEPS", GetType(Decimal))
TmpDT.Columns.Add("Descuento", GetType(Decimal))
TmpDT.Columns.Add("TipoDescuento", GetType(Integer))
TmpDT.Columns.Add("TotalImporte", GetType(Decimal))
TmpDT.Columns.Add("Total", GetType(Decimal))
'Para uso del módulo contable
TmpDT.Columns.Add("CveProyecto", GetType(Integer))
TmpDT.Columns.Add("Proyecto", GetType(String))
TmpDT.Columns.Add("CveSubProyecto", GetType(Integer))
TmpDT.Columns.Add("SubProyecto", GetType(String))
TmpDT.Columns.Add("CveVentaDetallePadre", GetType(Integer))
'TipoDescuento: 1 = Descuento * PU; 2 = Descuento por Total del concepto
TmpDT.Columns.Add("CvePresupuestoIngreso", GetType(Integer))
TmpDT.Columns.Add("CveFuenteRecaudacion", GetType(Integer))
'Contratos
TmpDT.Columns.Add("CveContratoDetalle", GetType(Integer))
'Remisiones a Facturas
TmpDT.Columns.Add("CveVentaDetalle", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRemision", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleCotizacion", GetType(Integer))
'Pedido2 a Facturas
TmpDT.Columns.Add("CveVentaDetallePedido2", GetType(Integer))
TmpDT.Columns.Add("Origen", GetType(Integer))
'Ordenes Servicio
TmpDT.Columns.Add("CveOS", GetType(Integer))
TmpDT.Columns.Add("CveOSDetalle", GetType(Integer))
TmpDT.Columns.Add("SeFacturara", GetType(Integer))
TmpDT.Columns.Add("Folio", GetType(Integer))
TmpDT.Columns.Add("Estatus", GetType(String))
'Ordenamiento
TmpDT.Columns.Add("Orden", GetType(Integer))
TmpDT.Columns.Add("TipoDocto", GetType(String))
'OC
TmpDT.Columns.Add("CveOrdenCompraDetalle", GetType(Integer))
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CantidadFacturadaRem", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaCot", GetType(Decimal))
TmpDT.Columns.Add("CantidadFacturadaPed2", GetType(Decimal))
TmpDT.Columns.Add("CantidadInventario", GetType(Decimal))
TmpDT.Columns.Add("ClaveSATFraccionArancelaria", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduana", GetType(String))
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
TmpDT.Columns.Add("CodigoObjetoImpuesto", GetType(String))
TmpDT.Columns.Add("CveTamaño", GetType(Integer))
TmpDT.Columns.Add("EsCargo", GetType(Boolean))
TmpDT.Columns.Add("CveMarca", GetType(Integer))
TmpDT.Columns.Add("CvePrecioLista", GetType(Integer))
TmpDT.Columns.Add("PrecioLista", GetType(String))
TmpDT.Columns.Add("CveActivoFijo", GetType(Integer))
TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal))
TmpDT.Columns.Add("AFValorInicial", GetType(Decimal))
TmpDT.Columns.Add("NumTurnos", GetType(Decimal))
TmpDT.Columns("NumTurnos").DefaultValue = 0D
TmpDT.Columns.Add("NumeroPedimento", GetType(String))
TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal))
TmpDT.Columns.Add("Costo", GetType(Decimal))
TmpDT.Columns("Costo").DefaultValue = 0D
Return TmpDT
End Function
Private Function InicializaDTVentasNCProntoPago() As DataTable Private Function InicializaDTVentasNCProntoPago() As DataTable
Dim DtVentasNC As New DataTable Dim DtVentasNC As New DataTable
DtVentasNC.Columns.Add("CveVenta", GetType(Integer)) DtVentasNC.Columns.Add("CveVenta", GetType(Integer))