Correciones de restricciones de credito

This commit is contained in:
2021-11-29 16:59:53 -07:00
parent abab73cb74
commit 439610d888
2 changed files with 39 additions and 65 deletions

View File

@@ -10,7 +10,7 @@
padding: 0px 5px;
}
.nolineheight {line-height: 1;
.nolineheight { line-height: 1;
}
.claseesconder {
@@ -1048,7 +1048,6 @@
<asp:Literal Text="" runat="server" ID="LtlClienteMsg"></asp:Literal>
</p>
</div>
</th>
<%--<th style="text-align: center;">
<asp:LinkButton ID="LbVerInventario" ClientIDMode="Static" runat="server" CssClass="btn btn-circle btn-sm purple" Text="<i class='icon-magnifier'></i>"></asp:LinkButton>
@@ -6438,9 +6437,6 @@
DataKeyNames="CveVenta,CveMetodoPago33,CveFormaPago33" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" GridLines="None">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="ChkAllCxC" CssClass="gvcxcAllChe" onclick="chkSeleccionarNC();" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="ChkCxC" CssClass="gvcxcChe" runat="server" />
</ItemTemplate>
@@ -7658,12 +7654,6 @@
<script src="/Metronic/assets/global/scripts/jquery-sortable.js"></script>
<script type="text/javascript">
//$('body').on('click', '.gvcxcAllChe input', function () { });
function chkSeleccionarNC() {
$(".gvcxcChe input").not(this).click();
}
//FUNCIONES PARA COMERCIO EXTERIOR
function CalculaTotalUSD(TotalUSD, ValorUnitario, TxtCantidad) {
TotalUSD.innerText = FormatoNumero(ToDouble(ValorUnitario.value) * ToDouble(TxtCantidad.value), 2);
@@ -8315,17 +8305,6 @@
Entro = 1;
}
<%-- if ('<%= UsuarioActual.Empresa.Funcionalidad(344) %>' == '1') {
let ImporteRestante = ToDouble($get('TxtImportesRemisionesNC').value) - ToDouble($get('TxtNCImporte').value)
if (ImporteRestante > 0) {
if (ImporteRestante < ImporteNuevo) {
ImporteNuevo = ImporteRestante;
}
Entro = 1;
}else {
ImporteNuevo = 0;
}
}--%>
if (ImporteNuevo > Saldo) {
ImporteNuevo = Saldo;

View File

@@ -2471,15 +2471,15 @@ Partial Class Ventas
LnkImprimirFormatoTelcel.Visible = True
End If
'If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
' Dim ObjInventario As New ClsInventarios
' If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
' If ObjInventario.DtResultados.Rows.Count > 0 Then
' DivDevAlm.Visible = True
' End If
' End If
' ObjInventario.Dispose()
'End If
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
Dim ObjInventario As New ClsInventarios
If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
DivDevAlm.Visible = True
End If
End If
ObjInventario.Dispose()
End If
End If
@@ -2806,7 +2806,7 @@ Partial Class Ventas
CargaFormatoSucursal()
InicializaDevolucionAlmacen()
'CargaOtrosConceptos()
CargaOtrosConceptos()
CargaFacturaOC()
'SELECCIONA SUCURSAL DEL USUARIO CUANDO SEA VENTA NUEVA Y SIN CLIENTE
@@ -5652,6 +5652,7 @@ Partial Class Ventas
EnviarCorreoCliente = ObjCliente.EnviarFactura
EstatusCliente = ObjCliente.Estatus
Me.PermiteCredito = ObjCliente.PermiteCredito
LnkAgregarCliente.Visible = False
ClienteEsDistribuidor = Boolean.Parse(ObjCliente.DtResultados.Rows(0)("EsDistribuidor").ToString())
@@ -5744,17 +5745,10 @@ Partial Class Ventas
ImprimeNombreSucursal = ObjCliente.ImprimeNombreSucursal
'ViewState("NumCtaPago") = ObjCliente.NumCtaPago
ViewState("ClienteDesglosaIEPS") = ObjCliente.DesglosaIEPS
ViewState("ClienteNODesglosaIVA") = ObjCliente.NoDesglosaIVA
If Not ClienteDesglosaIEPS Then
DivClienteMsg.Visible = True
LtlClienteMsg.Text = "Cálculo sin desglose de IEPS"
End If
If ClienteNODesglosaIVA Then
DivClienteMsg.Visible = True
LtlClienteMsg.Text += "Cálculo NO desglosa IVA"
End If
ViewState("CargoUsado") = ObjCliente.CargoUsados
Dim dr As DataRow = Nothing
@@ -5772,7 +5766,7 @@ Partial Class Ventas
End If
'HABILITA LA OPCION DE DIRECCION DE ENVIO
If UsuarioActual.CveEmpresa.Contiene(1, 72, 119, 140) Then
If UsuarioActual.CveEmpresa.Contiene(1, 72, 119) Then
trDireccionEnvio.Visible = True
CargaDireccionesEnvio()
End If
@@ -6006,7 +6000,7 @@ Partial Class Ventas
TrAtencionA.Visible = True
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
Me.PermiteCredito = ObjCliente.PermiteCredito
LbAgregar.Enabled = True
LnkAgregarPyME.Enabled = True
@@ -6086,6 +6080,8 @@ Partial Class Ventas
UpModalRemisionesNC.Update()
End If
CargaFacturasARelacionar()
If RequiereOC Then
Dim Documentacion As String = ""
'RegistraScript("$('#DivDocsCliente').modal({ backdrop: 'static', keyboard: false });", "ModalArchivos")
@@ -6352,7 +6348,9 @@ Partial Class Ventas
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Ant"))
End If
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("Rem"))
If Opcion = 1 Then
'SI ES AUTORIZACION DEBE PERMITIR GENERARLA
If Opcion = 1 AndAlso (Not DdlTipoComprobante.SelectedValue.Contiene("PA")) Then
BtnEmitirImprimir.Visible = False
BtnsFacturar.Visible = False
LBFacturarAnticipo.Visible = UsuarioActual.TienePermisoProceso(274)
@@ -6361,6 +6359,7 @@ Partial Class Ventas
LnkCotizaciones.Visible = False
LnkOCs.Visible = False
End If
Else
' el cliente tiene crédito disponible, no tiene bloqueo
DdlTipoComprobante.Items.Remove(DdlTipoComprobante.Items.FindByValue("PA"))
@@ -6511,9 +6510,10 @@ Partial Class Ventas
Vta.Dispose()
If Opcion > 0 Then
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
BtnsFacturar.Visible = False
BtnGenerarRemision.Visible = False
End If
End If
@@ -6868,7 +6868,7 @@ Partial Class Ventas
Dim CveSATNC = "84111506"
Dim dtt As New DataTable
dtt = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CodigoSATPS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
dtt = GlobalDTPS(UsuarioActual.CveEmpresa, SATClavePS:=CveSATNC, AplicaParaVenta:=1) ', SATClavePS:=CveSATNC
If dtt IsNot Nothing Then
DdlNCPS.DataSource = dtt
@@ -12577,7 +12577,7 @@ Partial Class Ventas
CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2.DataKey("CveVenta").ToEntero(), CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
Else
@@ -12601,7 +12601,7 @@ Partial Class Ventas
CveSubProyectoContabilizar = CveSubProyectoVenta
If importeMovimiento <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=CveVentaAnticipo, CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, ImporteMX:=importeMovimiento, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveSubProyecto:=CveSubProyectoContabilizar, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
Exit For
Else
@@ -13612,7 +13612,7 @@ Partial Class Ventas
Exit For
End If
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140, 141}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
If CveConceptoAlmacen = 3 AndAlso UsuarioActual.CveEmpresa.Contiene({72, 80, 119,140}) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem", "Ing") AndAlso Dr("EntregaDirecta").ToString().ToEntero() < 1 Then
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
If Existencia < Cantidad Then
OcurrioError = True
@@ -16875,7 +16875,7 @@ Partial Class Ventas
If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then
'VALIDA EXISTENCIA
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 140, 153}) Then
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153,140}) Then
If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then
Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia)
Return False
@@ -21621,19 +21621,17 @@ Partial Class Ventas
If ObjInv.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then
If ObjInv.DtResultados.Rows.Count > 0 Then
CargaGVInv(ObjInv.DtResultados)
If UsuarioActual.TienePermisoProceso(269) AndAlso Not DevolucionAlmacen = 2 Then
DivDevAlm.Visible = True
End If
End If
End If
ObjInv.Dispose()
'si es la empresa 119, Candado, no permiter refacturar, si no se ha surtido, para que cancele la factura mejor.
If UsuarioActual.CveEmpresa = 119 AndAlso LkRefacturacion.Visible AndAlso VentaSaldoAlmacen = 0 Then
'si es la empresa 119, Candado, no permite refacturar, si no se ha surtido y que no sea refacturación, para que cancele la factura mejor.
If UsuarioActual.CveEmpresa = 119 AndAlso LkRefacturacion.Visible AndAlso VentaSaldoAlmacen = 0 And CveVentaPadre <= 0 Then
LkRefacturacion.Visible = False
End If
If UsuarioActual.CveEmpresa = 119 AndAlso CveVenta = 620098 Then
LkRefacturacion.Visible = True
End If
End Sub
Private Sub CargaGVInv(DtTemporal As DataTable)
@@ -21781,7 +21779,7 @@ Partial Class Ventas
DdlDireccionEnvio.Items.Clear()
If ObjClientes.DireccionEnvioGet(-1, CveCliente, CveClienteSucursal) Then
DdlDireccionEnvio.DataSource = ObjClientes.DtResultados.FiltraParametros(String.Format("Estatus = 1"))
DdlDireccionEnvio.DataBind()
'DdlDireccionEnvio.Items.Insert(0, New ListItem("Seleccione", "-1"))
TmpDTEnvioDireccion = ObjClientes.DtResultados
Else
@@ -21793,7 +21791,6 @@ Partial Class Ventas
End If
ObjClientes.Dispose()
DdlDireccionEnvio.DataBind()
UpCliente.Update()
End Sub
@@ -23559,15 +23556,13 @@ Partial Class Ventas
End If
DdlMarca.Items.Clear()
DdlMarcaPSDes.Items.Clear()
Dim dt As DataTable = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataSource = dt
DdlMarcaPSDes.DataSource = dt
Dim ObjMarcas As New ClsProductosServicios
ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa)
DdlMarca.DataSource = ObjMarcas.DtResultados
DdlMarcaPSDes.DataSource = ObjMarcas.DtResultados
ObjMarcas.Dispose()
DdlMarca.DataBind()
DdlMarcaPSDes.DataBind()
dt.Dispose()
End If
DdlMarca.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlMarcaPSDes.Items.Insert(0, New ListItem("Seleccione", "-1"))