-
<%--
--%>
diff --git a/Inventarios/CatUnidades.aspx.vb b/Inventarios/CatUnidades.aspx.vb
index 8478b71dd..38720e266 100644
--- a/Inventarios/CatUnidades.aspx.vb
+++ b/Inventarios/CatUnidades.aspx.vb
@@ -37,10 +37,9 @@ Partial Class Inventarios_CatUnidades
Public Sub CargaDatos()
-
Dim ObjInventarios As New ClsInventarios
- If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then
+ If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa, Estatus:=-1) Then
GvDatos.DataSource = ObjInventarios.DtResultados
Else
GvDatos.DataSource = Nothing
@@ -110,6 +109,7 @@ Partial Class Inventarios_CatUnidades
TxtNumeroTrailer.Text = ""
TxtSCAC.Text = ""
TxtCAAT.Text = ""
+ ChkEstatus.Checked = False
RdTipoUnidad.SelectedValue = "1"
LtlTituloModal.Text = "Agregar Unidad"
@@ -153,6 +153,7 @@ Partial Class Inventarios_CatUnidades
TxtLineaTransportacion.Text = GvRow.DataKey("LineaTransportacion")
TxtSCAC.Text = GvRow.DataKey("SCAC")
TxtCAAT.Text = GvRow.DataKey("CAAT")
+ ChkEstatus.Checked = If(Boolean.Parse(GvRow.DataKey("Estatus")), True, False)
'ChkesRemolque.Checked = (GvRow.DataKey("CveTipoCamion") = "2")
@@ -206,14 +207,14 @@ Partial Class Inventarios_CatUnidades
If CveCamion <= 0 Then
If ObjInventarios.AddCamiones(TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, UsuarioActual.CveEmpresa, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario,
- TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text) Then
+ TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked) Then
Alert("Unidad agregada correctamente")
Else
ErrorPrceso = True
End If
Else
If ObjInventarios.UpdateCamiones(CveCamion, TxtPlacaNuevo.Text, TxtEspecificacionNuevo.Text, DdlConfigAuto.SelectedValue.ToEntero, TxtAnio.Text.ToEntero(), DdlTipoPermisoSCT.SelectedValue.ToEntero(), TxtNumermisoSCT.Text, TxtNombreAseguradora.Text, TxtNumPolizaSeguro.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
- TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text) Then
+ TxtNombreAseguradoraMedioAmbiente.Text, TxtNumPolizaSeguroMedioAmbiente.Text, TxtNombreAseguradoraCarga.Text, TxtNumPolizaSeguroCarga.Text, CveTipoCamion, TxtLongitudCaja.Text, TxtLineaTransportacion.Text, TxtSCAC.Text, TxtCAAT.Text, DdlTiposRemolque.SelectedValue.ToEntero(), TxtNumeroTrailer.Text, ChkEstatus.Checked) Then
Alert("Unidad actualizada correctamente")
Using objbase = New ClsClaseBase()
objbase.runQuerystr(String.Format("UPDATE Inv_Camiones SET CveProveedor={1} WHERE CveCamion={0}", CveCamion, DdlProveedor.SelectedValue))
diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb
index 2c7a86278..13e274982 100644
--- a/Inventarios/RecepcionAlmacen.aspx.vb
+++ b/Inventarios/RecepcionAlmacen.aspx.vb
@@ -36,6 +36,14 @@ Partial Class Inventarios_RecepcionAlmacen
ViewState("ValidaLoteCaducidad") = value
End Set
End Property
+ Private Property CveTipoAlmacen As Integer
+ Get
+ Return CType(ViewState("CveTipoAlmacen"), Integer)
+ End Get
+ Set(value As Integer)
+ ViewState("CveTipoAlmacen") = value
+ End Set
+ End Property
Private Property DtInv As DataTable
Get
If ViewState("DtInv") Is Nothing Then
@@ -557,18 +565,26 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub
Private Sub RecargaporAlmacenes()
-
+ CveTipoAlmacen = -1
If DdlAlmacen.SelectedValue <> "-1" Then
- Dim CveSubProyecto As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimeroValor("CveSubProyecto").ToEntero
- 'RMF condición temporal
- If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
- ValidaLoteCaducidad = True
- Else
- ValidaLoteCaducidad = False
+ Dim drr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero).FiltroPrimero("")
+ If drr IsNot Nothing Then
+ '("CveSubProyecto").ToEntero
+ Dim CveSubProyecto As Integer = drr("CveSubProyecto").ToString.ToEntero
+ 'RMF condición temporal
+ If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto.ToString.Contiene(UsuarioActual.Empresa.Funcionalidad(347).Split(","c)) Then
+ ValidaLoteCaducidad = True
+ Else
+ ValidaLoteCaducidad = False
+ End If
+
+ CveTipoAlmacen = drr("CveTipoAlmacen").ToString.ToEntero
+
End If
+
CargaGVInv()
'For Each Gvr As GridViewRow In GvInv.Rows
' If Gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue = "-1" Then
@@ -1421,6 +1437,16 @@ Partial Class Inventarios_RecepcionAlmacen
e.Row.FCCheckBox("cbInv").Enabled = False
Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DataKey("Consec"))).Rows.Count
e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
+
+ '' Empresa Acumuladores
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ If CveTipoAlmacen = 21 Then
+ e.Row.FCButton("BtnSerie").Visible = False
+ e.Row.FCTextBox("TbCantidadF").Enabled = True
+ e.Row.FCCheckBox("cbInv").Enabled = True
+ End If
+ End If
+
'ElseIf e.Row.DBCampo("CveMetodoInventario").ToString = "6" Then
' e.Row.FCButton("BtnLote").Visible = True
' e.Row.FCButton("BtnLote").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PU"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"))
diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs
index 6d5380160..a58cccd61 100644
--- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs
+++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs
@@ -279,7 +279,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
{
ClsInventarios ObjInventarios = new ClsInventarios();
- if (ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) && ObjInventarios.DtResultados.Rows.Count > 0)
+ if (ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa,Estatus:1) && ObjInventarios.DtResultados.Rows.Count > 0)
{
DdlModalCamion.DataSource = ObjInventarios.DtResultados;
}
@@ -532,11 +532,16 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, DateTime.Now, CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
{
- //regenero el tmbre
+ //regenero el timbre
if (TimbreTipoDocto == "Tra")
{
CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
}
+ //regenero el timbre
+ if (TimbreTipoDocto == "Ent")
+ {
+ CveTimbre = ObjGenerales.AddGralTimbre("Ent", CveSubProyecto, DateTime.Now, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
+ }
ProcesoOK = true;
}
}
@@ -829,7 +834,7 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
using (ClsInventarios ObjInv = new ClsInventarios())
{
- if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2))
+ if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2,Estatus:1))
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero()}");
}
try
@@ -868,10 +873,10 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
using (ClsInventarios ObjInv = new ClsInventarios())
{
- if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1))
+ if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus : 1))
DdlModalCamion.DataSource = ObjInv.DtResultados;
- if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2))
+ if (ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus: 1))
DdlRemolque1.DataSource = ObjInv.DtResultados;
}
diff --git a/Inventarios/TraspasoAlmacen.aspx.vb b/Inventarios/TraspasoAlmacen.aspx.vb
index cf368ca73..e597081fc 100644
--- a/Inventarios/TraspasoAlmacen.aspx.vb
+++ b/Inventarios/TraspasoAlmacen.aspx.vb
@@ -2255,6 +2255,27 @@ Partial Class Inventarios_TraspasoAlmacen
Exit For
End If
Next
+
+ If Not ErrorMovInv Then
+ Dim Concepto As String = TxtObservaciones.Text
+ If Concepto = "" Then Concepto = "Traspaso"
+ Dim CvePrePoliza As Integer = ObjConta.AddPrePolizas("Inventario/TA22", 53, 0, 0, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If ObjInventario.GetMovimientosDetalle(CveMovimientoVirtualEntrada, UsuarioActual.CveEmpresa) Then
+
+ Dim resultado As DataTable = ObjInventario.DtResultados
+ Dim importe As Decimal = resultado.SUMD("Total").RoundAD
+ Dim IdCtaContable As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", DdlAlmacenTransitorio.SelectedValue.ToEntero)).ToEntero
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then
+ ErrorMovInv = True
+ End If
+
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, importe, TxtObservaciones.Text, 68, TxtObservaciones.Text, Fecha, IdCtaContable, -1, CveMovimientoAlmacen:=CveMovimientoVirtualEntrada, ImporteMX:=importe, Contabilizable:=False) Then
+ ErrorMovInv = True
+ End If
+ End If
+ End If
+
End If
Else
@@ -3023,12 +3044,12 @@ Partial Class Inventarios_TraspasoAlmacen
Using ObjInv As New ClsInventarios
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then
+ If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
+ If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque1.DataSource = ObjInv.DtResultados
End If
@@ -3334,7 +3355,7 @@ Partial Class Inventarios_TraspasoAlmacen
DvRemolque2.Visible = True
Using ObjInv As New ClsInventarios
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
+ If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
End If
End Using
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index 3a61273de..911dc6847 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -1068,7 +1068,7 @@ Partial Class Ventas_ClientesAbonar
End If
'se calcula la fluctuación de la aplicación del anticipo, para sumarla en el concepto de fluctuación más abajo
FluctuacionAnticipo = ((TCP - tipoCambioVenta) * gvr.FCTextBox("TxtAmort").Text.ToDecimal).RoundSQL
- MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVenta)
+ MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, gvr.FCDropDownList("DdlAnti").SelectedValue.ToEntero, gvr.FCTextBox("TxtAmort").Text.ToDecimal, TCP, tipoCambioVenta, gvr.DataKey("SerieFolio").ToString)
End If
@@ -1450,7 +1450,7 @@ Partial Class Ventas_ClientesAbonar
If RblTipoPago.SelectedValue = "3" AndAlso MsgError = "" Then
- MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta)
+ MsgError = RegistraAmortizacionAnticipo(ObjMov, CvePrePoliza, CveIE, TxtImporte.Text.ToDecimal, tipoCambioPago, tipoCambioVenta, TxtObservaciones.Text)
'If CveMonedaPago = 2 Then
' 'rmf faltan las cuentas
@@ -1684,7 +1684,7 @@ Partial Class Ventas_ClientesAbonar
End Sub
- Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal) As String
+ Private Function RegistraAmortizacionAnticipo(ByRef ObjMov As ClsContabilidad, CvePrePoliza As Integer, CveIE As Integer, Importe As Decimal, tipoCambioPago As Decimal, tipoCambioVenta As Decimal, Referencia As String) As String
Dim MsgError As String = ""
If CveMonedaPago = 2 Then
'rmf faltan las cuentas
@@ -1695,11 +1695,11 @@ Partial Class Ventas_ClientesAbonar
tipoCambioPago = TxtTCDolaresDolares.Text.ToDecimal
End If
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=Importe, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
- MsgError = "No se pudo insertar la póliza"
- End If
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, Importe, TxtObservaciones.Text, 92, Referencia, TxtFechaDocumento.Text, IdCtaContMonedaExtranjeraAnticipo, -1, CveIE, -1, -1, -1, CveCliente, ImporteMX:=Importe, TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
+ MsgError = "No se pudo insertar la póliza"
+ End If
- If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), TxtObservaciones.Text, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
+ If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, If(CveMoneda = 1 AndAlso TxtTC.Visible, Importe / TxtTC.Text.ToDecimal, Importe), Referencia, 227, TxtObservaciones.Text + If(TxtTC.Visible, $" TC:{TxtTC.Text}", If(CveMoneda = 2, $" TC:{tipoCambioVenta}", "")), TxtFechaDocumento.Text, IdCtaContMonedaComplementariaAnticipo, -1, CveIE, -1, -1, -1, ViewState("CveCliente").ToString.ToEntero, ImporteMX:=If(CveMoneda = 2, (Importe * tipoCambioPago) - Importe, Importe), ImporteME:=If(CveMoneda = 2, Importe, 0), TipoCambio:=tipoCambioPago, TipoCambioPago:=tipoCambioPago) Then
MsgError = "No se pudo insertar la póliza"
End If
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index 1f22a90b7..dd24d323b 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -697,7 +697,7 @@ Partial Class PV
Get
Return New Dictionary(Of Integer, Decimal) From {
{20516, 0.23D}, 'Descuento para lubricantes LTH
- {20515, 0.274D} 'Descuento para filtros LTH
+ {20515, 0.25D} 'Descuento para filtros LTH
}
End Get
End Property
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 521472341..302d66ca7 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -12030,13 +12030,13 @@ Partial Class Ventas
factura.Alfa3 = "DEV"
factura.DevolucionImportePagado = ObjFacturaNC.Total / ObjFacturaNC.PagadoBancos 'falta tomar el dato
End If
- Dim tCvePlantillaPoliza As Integer = factura.CvePlantillaPoliza
+ Dim tCveTipoPoliza As Integer = -1
If UsuarioActual.CveEmpresa = 140 Then
- tCvePlantillaPoliza = 1 ' que sea siempre ingreso.
+ tCveTipoPoliza = 1 ' que sea siempre ingreso.
End If
- factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", tCvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa)
+ factura.CvePrePoliza = ObjConta.AddPrePolizas("Ventas/GuardarVenta", factura.CvePlantillaPoliza, factura.Total, factura.Total, factura.CveMoneda, factura.Fecha, If(CveEmpresaCRM > 0, LblEmpresaCRM.Text, factura.Cliente.Nombre), factura.CveUsuario, factura.CveEmpresa, CveTipoPoliza:=tCveTipoPoliza)
Dim RFCReceptor As String = ""
@@ -16800,84 +16800,14 @@ Partial Class Ventas
End If
'SUGIERE PRECIO
- Dim PrecioSugerido = 0.0
- PrecioSugerido = drPS("Precio").ToString().ToDouble
+ Dim PrecioSugerido As Decimal = 0
+ Dim tPrecioSugerido As Decimal = 0
+ tPrecioSugerido = drPS("Precio").ToString().ToDecimal
+ PrecioSugerido = CalculaPrecioSugerido(CvePSParametro, drPS("CveClasificacion").ToString().ToEntero())
- If UsuarioActual.CveEmpresa.Contiene(1) Then
- Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPorcentajeProductos(CveCliente) Then
- Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDouble
- If PrecioAplicado > 0 Then
- PrecioSugerido = PrecioAplicado
- End If
- End If
- ObjPS.Dispose()
- End If
-
- If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
- Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
- ' si es 10. primero el cliente
- Dim CvePrecioListaPS As Integer
- Dim PorcentajePrecio As Double = 0
-
- If TipoPrecioLista = 10 Then
-
- CvePrecioListaPS = Me.CvePrecioListaCliente 'GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
- If CvePrecioListaPS <= 0 Then
-
- CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
-
- End If
-
- Else
-
- CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
- If CvePrecioListaPS <= 0 Then
-
- CvePrecioListaPS = Me.CvePrecioListaCliente 'GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
-
- End If
-
- End If
-
- If CvePrecioListaPS > 0 Then
- Dim ObjPS As New ClsProductosServicios
- If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
- PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDouble
- PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDouble
- End If
- ObjPS.Dispose()
- End If
-
- If PrecioSugerido = 0 Then
- Dim ObjInventarios As New ClsInventarios
- Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
- 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
- If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
- ObjInventarios.Dispose()
- If CostoPS > 0 And PorcentajePrecio > 0 Then
- PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
- End If
- End If
- CvePrecioLista = CvePrecioListaPS
- End If
-
-
- 'Dim ObjClasificaciones As New ClsClasificaciones
- 'If ObjClasificaciones.GetClasificaciones() Then
- ' PrecioBaseCosto = ObjClasificaciones.DtResultados.FiltroPrimeroValor("PrecioBaseCosto", $"CveEmpresa = {UsuarioActual.CveEmpresa} AND CveClasificacion = {drPS("CveClasificacion")}").ToDecimal
- 'End If
-
- If PrecioSugerido > 0 Then
- Dim PrecioBaseCosto As Decimal = 0
- PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=drPS("CveClasificacion").ToString().ToEntero()).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
-
- If PrecioBaseCosto > 0 Then
- PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
- End If
- TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
- End If
+ If PrecioSugerido <= 0 Then PrecioSugerido = tPrecioSugerido
+ TxtPrecio.Text = PrecioSugerido.ToString("#,###.####") ' que muestre hasta los 4 digitos si lo requiere
If IsNumeric(TxtCantidad.Text.Trim) Then
LblTotalPS.Text = (TxtCantidad.Text.Trim.ToDouble * TxtPrecio.Text.ToDouble).ToString().FormatoNumero(2)
@@ -16912,6 +16842,76 @@ Partial Class Ventas
UpPS.Update()
End Sub
+
+ Private Function CalculaPrecioSugerido(CvePSParametro As Integer, CveClasificacion As Integer) As Decimal
+ Dim PrecioSugerido As Decimal = 0
+
+ If UsuarioActual.CveEmpresa.Contiene(1) Then
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetPorcentajeProductos(CveCliente) Then
+ Dim PrecioAplicado = ObjPS.DtResultados.FiltraParametros($"CvePS = {CvePSParametro}").FiltroPrimeroValor("PrecioA").ToDecimal
+ If PrecioAplicado > 0 Then
+ PrecioSugerido = PrecioAplicado
+ End If
+ End If
+ ObjPS.Dispose()
+ End If
+
+ If UsuarioActual.Empresa.Funcionalidad(404).ToEntero > 0 Then 'cuando el valor es 10.- secuencia Cliente/Sucursal, 20 - sucursal/cliente
+ Dim TipoPrecioLista As Integer = UsuarioActual.Empresa.Funcionalidad(404).ToEntero
+ ' si es 10. primero el cliente
+ Dim CvePrecioListaPS As Integer
+ Dim PorcentajePrecio As Decimal = 0
+
+ If TipoPrecioLista = 10 Then
+
+ CvePrecioListaPS = Me.CvePrecioListaCliente
+ If CvePrecioListaPS <= 0 Then
+ CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
+
+ End If
+ Else
+ CvePrecioListaPS = GlobalDTSubProyectos(-1, CveSubProyecto:=DdlSubProyectoDatos.SelectedValue.ToEntero(), CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePrecioLista", "").ToEntero()
+ If CvePrecioListaPS <= 0 Then
+ CvePrecioListaPS = Me.CvePrecioListaCliente 'GlobalDTCliente(UsuarioActual.CveEmpresa, Estatus:=-1, CveCliente:=CveCliente).FiltroPrimeroValor("CvePrecioLista").ToEntero()
+
+ End If
+
+ End If
+
+ If CvePrecioListaPS > 0 Then
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSParametro) Then
+ PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal
+ PorcentajePrecio = ObjPS.DtResultados.FiltroPrimeroValor("Porcentaje").ToDecimal
+ End If
+ ObjPS.Dispose()
+ End If
+
+ If PrecioSugerido = 0 Then
+ Dim ObjInventarios As New ClsInventarios
+ Dim CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
+ 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
+ If CostoPS = 0 Then CostoPS = ObjInventarios.GetCostoPS(CvePSParametro, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
+ ObjInventarios.Dispose()
+ If CostoPS > 0 And PorcentajePrecio > 0 Then
+ PrecioSugerido = ((PorcentajePrecio / 100) + 1) * CostoPS
+ End If
+ End If
+ CvePrecioLista = CvePrecioListaPS
+ End If
+
+
+ If PrecioSugerido > 0 Then
+ Dim PrecioBaseCosto As Decimal = 0
+ PrecioBaseCosto = GlobalDTClasificaciones(UsuarioActual.CveEmpresa, CveClasificacion:=CveClasificacion).FiltroPrimeroValor("PrecioBaseCosto", "").ToDecimal
+
+ If PrecioBaseCosto > 0 Then
+ PrecioSugerido = PrecioSugerido * ((PrecioBaseCosto / 100) + 1)
+ End If
+ End If
+ Return PrecioSugerido
+ End Function
Protected Sub DdlPS_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DdlPS.selectedindexchange
DdlPSIndexChange(DdlPS.SelectedValue.ToEntero(), DdlPS)
End Sub
@@ -18127,15 +18127,6 @@ Partial Class Ventas
Row("Orden") = ConsecutivoActual + 1
End If
- Row("Cantidad") = Cantidad
- Row("CveUM") = CveUM
- Row("UM") = UM
- Row("CveClasificacion") = CveClasificacion
- Row("Clasificacion") = Clasificacion
- Row("CvePS") = CvePS
- Row("Obs") = Obs
-
-
Dim DrPS As DataRow = Nothing
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("") ' Estado = -1
@@ -18179,6 +18170,14 @@ Partial Class Ventas
End If
End If
+ Row("Cantidad") = Cantidad
+ Row("CveUM") = CveUM
+ Row("UM") = DrPS("UnidadMedida")
+ Row("CveClasificacion") = DrPS("CveClasificacion")
+ Row("Clasificacion") = DrPS("Clasificacion")
+ Row("CvePS") = CvePS
+ Row("Obs") = Obs
+
'VERIFICA SI EN LA FACTURA PADRE SE DESGLOSO EL IEPS
Dim FacturaDesglosoIEPS As Boolean = ((CveDevolucion > 0 AndAlso NuevaFactura = 1) AndAlso (Me.ObjFacturaNC IsNot Nothing AndAlso Not Me.ObjFacturaNC.VentaDesglosaIEPS))
@@ -24284,6 +24283,7 @@ Partial Class Ventas
Dim Observaciones As String = Row("Observaciones").ToString().Trim.ToUpper
Dim TiempoEntrega As String = Row("Tiempo Entrega").ToString()
Dim CvePS As Integer = 0
+ Dim CveClasificacion As Integer = 0
Dim CveUM As Integer = 0
Dim CodigoPS As Integer = 0
Dim DrProyecto As DataRow
@@ -24311,7 +24311,7 @@ Partial Class Ventas
If ObjPS.CvePS > 0 Then
CvePS = ObjPS.CvePS
CveUM = ObjPS.CveUnidadMedida
-
+ CveClasificacion = ObjPS.CveClasificacion
Else
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados)
End If
@@ -24320,14 +24320,6 @@ Partial Class Ventas
End If
End Using
- 'Dim StrArray() As String = GetPS("Codigo", Codigo).Split("|"c)
- 'If StrArray.Length > 0 Then
- ' If CBool(StrArray(0)) = True Then
- ' CvePS = StrArray(1).ToEntero()
- ' Else
- ' RowNoEncontrados &= StrArray(1) & "<\BR>"
- ' End If
- 'End If
ElseIf CodigoBarras <> "" Then
Using ObjPS As New ClsProductosServicios
@@ -24335,7 +24327,7 @@ Partial Class Ventas
If ObjPS.CvePS > 0 Then
CvePS = ObjPS.CvePS
CveUM = ObjPS.CveUnidadMedida
-
+ CveClasificacion = ObjPS.CveClasificacion
Else
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados)
End If
@@ -24343,14 +24335,7 @@ Partial Class Ventas
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados)
End If
End Using
- 'Dim StrArray() As String = GetPS("CodigoBarras", CodigoBarras).Split("|"c)
- 'If StrArray.Length > 0 Then
- ' If CBool(StrArray(0)) = True Then
- ' CvePS = StrArray(1).ToEntero()
- ' Else
- ' RowNoEncontrados &= StrArray(1) & "<\BR>"
- ' End If
- 'End If
+
ElseIf ProductoServicio <> "" Then
Using ObjPS As New ClsProductosServicios
@@ -24358,6 +24343,7 @@ Partial Class Ventas
If ObjPS.CvePS > 0 Then
CvePS = ObjPS.CvePS
CveUM = ObjPS.CveUnidadMedida
+ CveClasificacion = ObjPS.CveClasificacion
Else
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>", Codigo, NumRow, "Codigo", RowNoEncontrados)
End If
@@ -24365,50 +24351,23 @@ Partial Class Ventas
RowNoEncontrados = String.Format("{3} - No se encontró {0} en la fila {1}, columna {2}<\BR>(NoBD)", Codigo, NumRow, "Codigo", RowNoEncontrados)
End If
End Using
- 'Dim StrArray() As String = GetPS("PS", ProductoServicio).Split("|"c)
- 'If StrArray.Length > 0 Then
- ' If CBool(StrArray(0)) = True Then
- ' CvePS = StrArray(1).ToEntero()
- ' Else
- ' RowNoEncontrados &= StrArray(1) & "<\BR>"
- ' End If
- 'End If
Else
RowNoEncontrados &= "<\BR> - En la fila " & NumRow & " no se especificó código, código de barras ó descripción."
End If
If CvePS > 0 Then
- 'CveUM = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveUnidadMedida", $"CvePS = '{CvePS}'").ToString().ToEntero()
+
+ If PrecioUnitario <= 0 Then
+ PrecioUnitario = CalculaPrecioSugerido(CvePS, CveClasificacion)
+ End If
AgregarProductoServicio(Cantidad, CveUM, UM, -1, "",
CvePS, HdnPS.Value, Observaciones, PrecioUnitario, HdnDescuento.Value.ToDecimal,
CveProyecto, Proyecto, CveSubProyecto, SubProyecto,
TiempoEntrega:=TiempoEntrega)
-
-
- 'If TmpDT IsNot Nothing Then
- ' Dim dr As DataRow = TmpDT.NewRow
- ' TxtCantidad.Text = Cantidad.ToString()
- ' DdlPS.SelectedValue = CvePS.ToString()
- ' DdlPS_SelectedIndexChanged(Nothing, Nothing)
- ' DdlUnidadMedida.SelectedValueExist(CveUM.ToString())
- ' TxtObsPS.Text = Observaciones
- ' DdlProyecto.SelectedValue = CveProyecto.ToString()
- ' DdlProyecto_SelectedIndexChanged(Nothing, Nothing)
- ' DdlSubProyecto.SelectedValue = CveSubProyecto.ToString()
- ' TxtPrecio.Text = PrecioUnitario.ToString()
- ' TxtTiempoEntrega.Text = TiempoEntrega.ToString()
- ' RegistraScript("Recalcula();")
- ' LbAgregar_Click(Nothing, Nothing)
- ' NumAgregados = NumAgregados + 1
- 'End If
End If
-
-
Next
-
-
CalculaTotalesVenta()
If RowNoEncontrados.Length > 0 Then
@@ -34126,12 +34085,12 @@ Partial Class Ventas
Using ObjInv As New ClsInventarios
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1) Then
+ If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
+ If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque1.DataSource = ObjInv.DtResultados
End If
@@ -34265,7 +34224,7 @@ Partial Class Ventas
DvRemolque2.Visible = True
Using ObjInv As New ClsInventarios
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2) Then
+ If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
End If
End Using