diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index b94f14de9..4089af8a5 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -1952,12 +1952,18 @@ Public Class ClsPaginas
If ObjInventarios.GetCamiones(-1, UsuarioActual.CveEmpresa) Then Application(AppNombre) = ObjInventarios.DtResultados
ObjInventarios.Dispose()
End If
- Dim Str As New StringBuilder
- If CveCamion > 0 Then Str.AppendFormat("CveCamion = {0}", CveCamion)
- If CveTipoCamion > 0 Then Str.AppendFormat("CveTipoCamion = {0}", CveTipoCamion)
- Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
- GlobalDTInvCamiones = Dv.ToTable
- Dv.Dispose()
+
+ Dim filtros As New List(Of String)
+ If CveCamion >= 0 Then filtros.Add($"CveCamion = {CveCamion} ")
+ If CveTipoCamion >= 0 Then filtros.Add($"CveTipoCamion = {CveTipoCamion} ")
+ If filtros.Count > 0 Then
+ Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), String.Join(" AND ", filtros), "", DataViewRowState.CurrentRows)
+ GlobalDTInvCamiones = Dv.ToTable
+ Dv.Dispose()
+ Else
+ GlobalDTInvCamiones = DirectCast(HttpContext.Current.Application(AppNombre), DataTable)
+ End If
+
End Get
Set(value As DataTable)
Dim AppNombre As String = $"GlobalDTInvCamiones-{CveEmpresa}"
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 594d3d247..9c0166f39 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -6932,6 +6932,78 @@ Public Class ClsVentas
#End Region
+#Region "VENTAS MEDICAS COMISIONES ESPECIALES"
+
+ Public Function GetComisionesMedicasEsPeciales(CveMedico As Integer, CvePS As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ComisionesMedicasEspecialesGet")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener las comisiones especiales.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function AddComisionesMedicasEspeciales(CveMedico As Integer, CvePS As Integer, TipoComision As Integer, Comision As Decimal, CveUsuario As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ComisionesMedicasEspecialesAdd")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedico", SqlDbType.Int).Value = CveMedico
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@TipoComision", SqlDbType.Int).Value = TipoComision
+ .Add("@Comision", SqlDbType.Money).Value = Comision
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al agegar la comisión especial", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+ Public Function RemoveComisionesMedicasEspeciales(CveMedicoComision As Integer, CveEmpresa As Integer) As Boolean
+
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_ComisionesMedicasEspecialesRemove")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveMedicoComision", SqlDbType.Int).Value = CveMedicoComision
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al eliminar la comision especial.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End Try
+
+ Return Retorno
+
+ End Function
+
+#End Region
+
#Region "DEVOLUICON"
Public Function UpdateVentasDetalleCantidadDevolucion(CveVentaDetalle As Integer, CantidadDevolucion As Decimal) As Boolean
diff --git a/Bancos/ProveedoresAbonar.aspx b/Bancos/ProveedoresAbonar.aspx
index 1e7945306..1f8fa17e7 100644
--- a/Bancos/ProveedoresAbonar.aspx
+++ b/Bancos/ProveedoresAbonar.aspx
@@ -67,7 +67,7 @@
T.C.:
-
+
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index a1791b726..3c3ba9bb5 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -327,9 +327,21 @@ Partial Class Bancos_ProveedoresAbonar
Private Sub CambiaTipoMoneda()
If DivTC.Visible Then
+
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
- If ChkPagarDolares.Checked Then RegistraScript("CambiaPesosDolares();")
- If ChkPagarPesos.Checked Then RegistraScript("CambiaDolaresPesos();")
+
+ If ChkPagarDolares.Checked Then
+ 'RegistraScript("CambiaPesosDolares();")
+ RegistraScript("CambiaDolaresPesos();")
+
+ End If
+
+ If ChkPagarPesos.Checked Then
+ 'RegistraScript("CambiaDolaresPesos();")
+ RegistraScript("CambiaPesosDolares();")
+
+ End If
+
End If
UpDatos.Update()
End Sub
@@ -1343,6 +1355,7 @@ Partial Class Bancos_ProveedoresAbonar
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
+ TxtTC.Attributes.Add("onblur", "CambiaPesosDolares()")
Else
DivTC.Visible = False
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
@@ -1362,6 +1375,7 @@ Partial Class Bancos_ProveedoresAbonar
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
TxtFechaDocumento.Attributes.Add("onchange", "CambiaTC(this);")
TxtTC.Text = GlobalTipoCambio(TxtFechaDocumento.Text.ToDate).FormatoNumero(4)
+ TxtTC.Attributes.Add("onblur", "CambiaDolaresPesos()")
Else
'DivDolaresDolares.Visible = False
CargaCuentas(DdlTipoTransaccion.SelectedValue.ToEntero)
diff --git a/Contabilidad/RegPrePolizaS.aspx b/Contabilidad/RegPrePolizaS.aspx
index 6e0db8830..8034c63ca 100644
--- a/Contabilidad/RegPrePolizaS.aspx
+++ b/Contabilidad/RegPrePolizaS.aspx
@@ -187,8 +187,8 @@
diff --git a/Contabilidad/RegPrePolizaS.aspx.vb b/Contabilidad/RegPrePolizaS.aspx.vb
index f3cc6a70e..c8c47d2f5 100644
--- a/Contabilidad/RegPrePolizaS.aspx.vb
+++ b/Contabilidad/RegPrePolizaS.aspx.vb
@@ -324,7 +324,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True
- TxtUsuarioElaboro.Text = UsuarioActual.Nombre
+ LblUsuarioElaboro.Text = UsuarioActual.Nombre
End If
@@ -352,7 +352,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaDocumento.Text = NowADS().ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = NowADS().ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True
- TxtUsuarioElaboro.Text = UsuarioActual.Usuario
+ LblUsuarioElaboro.Text = UsuarioActual.Usuario
End If
@@ -453,13 +453,13 @@ Partial Class ContabilidadC_RegPrePolizaS
Folio = dr("FolioPoliza").ToString
TxtFolio.Text = dr("FolioPoliza").ToString
- TxtUsuarioElaboro.Text = dr("UsuarioNombre").ToString
+ LblUsuarioElaboro.Text = dr("UsuarioNombre").ToString
TxtFechaelaboracion.Text = dr("FechaIng").ToString.ToDate.ToString("dd/MM/yyyy")
TxtFechaelaboracion.ToolTip = dr("FechaIng").ToString.ToDate.ToString("HH:mm:ss")
CvePlantillaPoliza = dr("CvePlantillaPoliza").ToString.ToEntero
DdlPlantilla.SelectedValueExist(CvePlantillaPoliza)
- If UsuarioActual.CveRol = 1 Then TxtUsuarioElaboro.ToolTip = dr("Modulo").ToString
+ LblUsuarioElaboro.ToolTip = dr("Modulo").ToString
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.TienePermisoProceso(221) Then
LnkAddConcepto.Visible = True
diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb
index e162837a9..168218ffe 100644
--- a/OC/OC.aspx.vb
+++ b/OC/OC.aspx.vb
@@ -6,7 +6,6 @@ Imports System.Data.SqlClient
Imports System.IO
Imports Extensiones
Imports GemBox.Spreadsheet
-Imports Microsoft.Owin.Security.Provider
Imports Newtonsoft.Json
Partial Class OC_OC
@@ -926,13 +925,13 @@ Partial Class OC_OC
ChkEntregaDirecta.Checked = False
End If
- If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
- If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
- Alert("PrePoliza de Presupuesto Generada Correctamente")
- Else
- Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
- End If
- End If
+ 'If UsuarioActual.CveEmpresa.Contiene(13, 73) AndAlso CveOrdenCompra > 0 AndAlso Request("Conta") IsNot Nothing AndAlso Request("Conta").ToEntero = 1 Then
+ ' If GeneraPrePolizaPresupuesto(CveOrdenCompra, Nothing) Then
+ ' Alert("PrePoliza de Presupuesto Generada Correctamente")
+ ' Else
+ ' Alert("No Se Genero la PrePoliza de Presupuesto Generada Correctamente", TipoMensaje.MsgAdvertencia)
+ ' End If
+ 'End If
End If
@@ -2218,51 +2217,11 @@ Partial Class OC_OC
Exit Sub
End If
-
-
Dim ValImporte As Decimal = (TxtCant.Text.ToDecimal * txtPrecioUnitario.Text.ToDecimal).RoundSQL(2)
If Not ValidaPresupuesto(1, DdlSubProyecto.SelectedValue.ToEntero, DdlSubProyecto.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacion.SelectedItem.Text, ValImporte) Then
Exit Sub
End If
- 'If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
-
- 'Dim ObjCon As New ClsContratos
- 'Dim CvePresupuesto As Integer = 0
- 'Dim Autorizado As Decimal = 0
- 'Dim Ejercido As Decimal = 0
- 'If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then
- ' If ObjCon.DtResultados.Rows.Count > 0 Then
- ' CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero
- ' If CvePresupuesto > 0 Then
- ' If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then
- ' If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then
- ' Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDecimal
- ' End If
- ' End If
- ' If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{NowADS().Year - 1}".ToDate, NowADS(), UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero,
- ' DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then
- ' If ObjCon.DtResultados.Rows.Count > 0 Then
- ' Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDecimal
- ' End If
- ' End If
- ' End If
- ' End If
- 'End If
- 'ObjCon.Dispose()
-
- 'If CvePresupuesto > 0 And Autorizado > 0 Then
- ' Dim Diferencia As Decimal = (Ejercido + If(txtPrecioUnitario.Text.ToDecimal > 0, (txtPrecioUnitario.Text.ToDecimal * TxtCant.Text.ToDecimal) - TxtDescuentoAdd.Text.ToDecimal, 0)) - Autorizado
- ' If Diferencia > 0 Then
- ' Alert($"No hay presupuesto disponible en el subproyecto {DdlSubProyecto.SelectedItem.Text} y la clasificación {DdlClasificacion.SelectedItem.Text} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
- 'End If
- 'End If
-
-
-
-
Dim RetISR As Decimal = DrPS("RetISR").ToString.ToDecimal
Dim RetIVA As Decimal = DrPS("RetIVA").ToString.ToDecimal
Dim IvaPS As Decimal = DrPS("IVA").ToString.ToDecimal
@@ -3554,8 +3513,7 @@ Partial Class OC_OC
End If
-
- If UsuarioActual.CveEmpresa.Contiene(13, 73) Then
+ If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
If Not GeneraPrePolizaPresupuesto(objOrdenCompra.CveOrdenCompra, objOrdenCompra.IniciaTransacSQL) Then
HuboError = True
@@ -3563,7 +3521,6 @@ Partial Class OC_OC
End If
-
Catch ex As Exception
HuboError = True
End Try
@@ -3720,6 +3677,10 @@ Partial Class OC_OC
TieneError = True
End If
+ If (UsuarioActual.Empresa.Funcionalidad(532) = "1") Then
+ GeneraPrePolizaPresupuesto(CveOrdenCompra, objOrdenCompra.IniciaTransacSQL, True)
+ End If
+
If IDPolizaPresupuestal > 0 AndAlso UsuarioActual.Empresa.UsaAC Then
PolizaCancelacion = CancelarAC(ObjAC)
@@ -9190,32 +9151,24 @@ Partial Class OC_OC
End Function
-
- Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing) As Boolean
+ Private Function GeneraPrePolizaPresupuesto(CveOrdenCompraPresupuesto As Integer, Optional ByRef transaccion As SqlTransaction = Nothing, Optional EsCancelacion As Boolean = False) As Boolean
Dim Respuesta As Boolean = True
- If UsuarioActual.CveEmpresa.Contiene(13, 73) Then
+ If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then
Dim CveMonedaPresupuesto As Integer = DdlMoneda.SelectedValue.ToEntero
Dim TC As Decimal = If(CveMonedaPresupuesto = 1, 1, GlobalTipoCambio(TxtFecha.Text.ToDate).ToDecimal)
If CveMonedaPresupuesto > 1 AndAlso TC = 0 Then
- Alert($"No se genero la prepoliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia)
+ Alert($"No se genero la póliza de presupuesto, no se pudo obtener el Tipo de Cambio de la fecha {TxtFecha.Text}", TipoMensaje.MsgAdvertencia)
Return False
End If
- Dim ObjConta As New ClsContabilidad()
+ Dim ObjConta As New ClsContabilidad(transaccion)
+ Dim CvePrePolizaPresupuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
- If transaccion Is Nothing Then
- ObjConta = New ClsContabilidad()
- Else
- ObjConta = New ClsContabilidad(transaccion)
- End If
-
- Dim CvePrePolizaPreSuPuesto = ObjConta.AddPrePolizas("OC/OC-(Presupuesto)", 53, LblTotal.Text.ToDecimal, LblTotal.Text.ToDecimal, DdlMoneda.SelectedValue.ToEntero, TxtFecha.Text.ToDate, DdlProveedores.SelectedText, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
-
- If CvePrePolizaPreSuPuesto > 0 Then
+ If CvePrePolizaPresupuesto > 0 Then
Dim EnumAgrupado = (From row In DtDetalle.AsEnumerable()
Group row By
@@ -9235,37 +9188,28 @@ Partial Class OC_OC
For Each item In EnumAgrupado
Dim SerieFolio = $"OC: {Folio}, Clasificación: {item.Clasificacion}"
+ Dim Multiplicador As Decimal = If(EsCancelacion, -1, 1)
- Dim Importe As Decimal = item.TotalSum
- Dim ImporteME As Decimal = If(CveMonedaPresupuesto = 1, 0, item.TotalSum)
- Dim ImporteMN As Decimal = If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC)
+ Dim Importe As Decimal = Multiplicador * item.TotalSum
+ Dim ImporteME As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, 0, item.TotalSum)
+ Dim ImporteMN As Decimal = Multiplicador * If(CveMonedaPresupuesto = 1, item.TotalSum, item.TotalSum * TC)
- If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
- Respuesta = False
- Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPresupuesto, False, Importe, ImporteMN, 154, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
+ Respuesta = False : Exit For
End If
-
- If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPreSuPuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
- Respuesta = False
- Exit For
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaPresupuesto, True, Importe, ImporteMN, 152, SerieFolio, SerieFolio, ImporteME:=ImporteME, TipoCambio:=TC, CveProveedor:=DdlProveedores.SelectedValue.ToEntero, CveOC:=CveOrdenCompraPresupuesto, CveClasificacion:=item.CveClasificacion, CveSubProyecto:=item.CveSubProyecto, Contabilizable:=True) Then
+ Respuesta = False : Exit For
End If
-
Next
Else
Respuesta = False
End If
-
-
-
End If
-
Return Respuesta
End Function
-
-
#End Region
diff --git a/Ventas/RepComisionesSMS.aspx b/Ventas/RepComisionesSMS.aspx
index 90ecbd1d1..06a549484 100644
--- a/Ventas/RepComisionesSMS.aspx
+++ b/Ventas/RepComisionesSMS.aspx
@@ -19,6 +19,9 @@
+
+
+
Excel
@@ -280,6 +283,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Ventas/RepComisionesSMS.aspx.vb b/Ventas/RepComisionesSMS.aspx.vb
index ebee4433a..2e95951d9 100644
--- a/Ventas/RepComisionesSMS.aspx.vb
+++ b/Ventas/RepComisionesSMS.aspx.vb
@@ -248,4 +248,26 @@ Partial Class Ventas_RepComisionesSMS
End If
End Sub
+
+#Region "COMISIONES ESPECIALES"
+
+ Protected Sub LnkComisionesEspeciales_Click(sender As Object, e As EventArgs)
+
+ CargaComisionesEspeciales()
+ RegistraScript("$('#DvModalComisionesEspeciales').modal('show');")
+
+ End Sub
+
+ Private Sub CargaComisionesEspeciales()
+
+ End Sub
+
+ Protected Sub LnkEliminarComisionEspecial_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ End Sub
+
+#End Region
+
+
+
End Class
diff --git a/Ventas/RepVencimientosCredito.aspx b/Ventas/RepVencimientosCredito.aspx
index 4e0d07699..6e137229f 100644
--- a/Ventas/RepVencimientosCredito.aspx
+++ b/Ventas/RepVencimientosCredito.aspx
@@ -113,144 +113,38 @@
-
-
-
-
+
-
-
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <%-- MODAL COMPROBANTE --%>
-
- <%-- FIN MODAL COMPROBANTE --%>
-
-
-
-
-
+
diff --git a/Ventas/RepVencimientosCredito.aspx.cs b/Ventas/RepVencimientosCredito.aspx.cs
index 8c7d13ece..bcd923158 100644
--- a/Ventas/RepVencimientosCredito.aspx.cs
+++ b/Ventas/RepVencimientosCredito.aspx.cs
@@ -88,58 +88,20 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
LnkDescargaExcel.Visible = false;
ClsVentas objVentas = new ClsVentas();
-
- int CveProveedor = -1;
-
- if(TipoLinea == 1)
+
+ if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), -1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa))
{
- if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), 1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa))
- {
- GvD.DataSource = objVentas.DtResultados;
+ GvD.DataSource = objVentas.DtResultados;
- if (objVentas.DtResultados.Rows.Count > 0)
- {
- DTDatosGvD = objVentas.DtResultados;
- LnkDescargaExcel.Visible = true;
- UpAcciones.Update();
- }
- }
- else
+ if (objVentas.DtResultados.Rows.Count > 0)
{
- GvD.DataSource = null;
+ DTDatosGvD = objVentas.DtResultados;
+ LnkDescargaExcel.Visible = true;
+ UpAcciones.Update();
}
}
- else
- {
-
- if (DdlAgrupador.SelectedValue.ToEntero()== 1){
- GvLAPO.Columns[0].HeaderText = "Comercializador";
- }
- else
- {
- GvLAPO.Columns[0].HeaderText = "Cliente";
- }
-
- if (objVentas.RepLineasAdicionales(DdlAgrupador.SelectedValue.ToEntero(), -1, DdlClientes.SelectedValue.ToEntero(), CveProveedor, 2, -1, MinFecha, MaxFecha, DdlEstatus.SelectedValue.ToEntero(), UsuarioActual.CveEmpresa))
- {
- GvLAPO.DataSource = objVentas.DtResultados;
-
- if (objVentas.DtResultados.Rows.Count > 0)
- {
- DTDatosGvD = objVentas.DtResultados;
- LnkDescargaExcel.Visible = true;
- UpAcciones.Update();
- }
- }
- else
- {
- GvLAPO.DataSource = null;
- }
- }
-
objVentas.Dispose();
GvD.DataBind();
- GvLAPO.DataBind();
UpLineasAdicionales.Update();
}
@@ -155,116 +117,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
RegistraScript("$('#ModalComprobante').modal('show');","");
}
- protected void BtnAddComprobante_Click(object sender, EventArgs e)
- {
- bool errorCargaComprobante = false;
- string FileExtension = "-1";
- List filesgral = Anexo.getfiles().Archivos;
- string filemove = "";
- FileInfo fiNuevo;
-
- DirectoryInfo df = new DirectoryInfo($@"{UsuarioActual.Empresa.Ruta}\LineasAdicionales\");
-
- //Crea directorio si no existe
- if (!df.Exists)
- {
- try
- {
- Directory.CreateDirectory(df.FullName);
- }
- catch
- {
- errorCargaComprobante = true;
- }
- }
-
- //borrar archivo anterior
- if((!errorCargaComprobante) && LineaAdicionalComprobante.Length > 0)
- {
- FileInfo fiAnterior = new FileInfo($@"{df.FullName}{LineaAdicionalComprobante}");
- if (fiAnterior.Exists)
- {
- try
- {
- File.Delete(fiAnterior.FullName);
- }
- catch
- {
- errorCargaComprobante = true;
- }
- }
- }
-
- if(!errorCargaComprobante){
-
- string RutaArchivoTemp = "";
- foreach (Archivo fileItem in filesgral)
- {
- FileExtension = System.IO.Path.GetExtension(string.Format(@"{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, fileItem.filename)).Replace(".", "");
- filemove = fileItem.filename;
- RutaArchivoTemp = $@"{AppDomain.CurrentDomain.BaseDirectory}\Temp\{fileItem.filename}";
- break;
- }
-
- if((!errorCargaComprobante) && RutaArchivoTemp.Length > 0)
- {
- fiNuevo = new FileInfo(RutaArchivoTemp);
-
- if (fiNuevo.Exists)
- {
- try
- {
- if (File.Exists($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}"))
- {
- File.Delete($@"{df.FullName}\{CveVenta}{fiNuevo.Extension}");
- }
- File.Move(fiNuevo.FullName, $@"{df.FullName}\{CveVenta}{fiNuevo.Extension}");
- errorCargaComprobante = false;
- }
- catch
- {
- errorCargaComprobante = true;
- }
- if (!errorCargaComprobante)
- {
- ClsVentas objVentas = new ClsVentas();
- if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta, $@"{CveVenta}{fiNuevo.Extension}", -1, UsuarioActual.CveEmpresa))
- {
- errorCargaComprobante = true;
- }
- objVentas.Dispose();
- }
- }
- }
- }
-
- if (!errorCargaComprobante)
- {
- CargaDatos();
- Anexo.Text = "[]";
- RegistraScript("$('#ModalComprobante').modal('hide');", "");
- Alert("Comprobante actualizado correctamente.");
- }
- UpAddComprobancte.Update();
- }
-
- protected void LnkCambiarEstatus_Click(object sender, EventArgs e)
- {
- GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
- int CveLineaAdicionalActualzarEstatus = GvRow.DataKey("CveLineaAdicional").ToEntero();
- int CveVenta = GvRow.DataKey("CveVenta").ToEntero();
- bool errorCambioEstatus = false;
- ClsVentas objVentas = new ClsVentas();
- if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicional, CveVenta, "", 2, UsuarioActual.CveEmpresa))
- {
- errorCambioEstatus = true;
- }
- if (!errorCambioEstatus)
- {
- CargaDatos();
- }
- objVentas.Dispose();
- }
+
protected void LnkDescargaExcel_Click(object sender, EventArgs e)
{
@@ -273,14 +126,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
GridView gvTemp = GvD;
//gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150);
- }
- else if(TipoLinea == 2)
- {
- GridView gvTemp = GvLAPO;
- gvTemp.Columns[12].Visible = false;
- //gvTemp.ExportToExcelX("ReportePO" + NowADS().ToShortDateString());
- gvTemp.ExportToExcelGembox( "ReportePO", UsuarioActual, "Reporte PO ", AnchoImagen:150);
- }
+ }
}
protected void GvLAPO_RowDataBound(object sender, GridViewRowEventArgs e)
@@ -351,28 +197,6 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
}
}
- protected void GvLAPO_RowCommand(object sender, GridViewCommandEventArgs e)
- {
- if (e.CommandName == "Estatus")
- {
- GridViewRow GvRow = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
- int CveLineaAdicionalActualizarEstatus = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
- int CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
-
- bool errorCambioEstatus = false;
- //int cveestatus = e.CommandArgument.ToEntero() + 2; //pasar al siguiente estatus
-
- ClsVentas objVentas = new ClsVentas();
- if (!objVentas.UpdateVentaLineaAdicional(CveLineaAdicionalActualizarEstatus, CveVenta,"", 2, UsuarioActual.CveEmpresa))
- {
- errorCambioEstatus = true;
- }
- objVentas.Dispose();
- if (!errorCambioEstatus)
- {
- CargaDatos();
- }
- }
- }
+
}
\ No newline at end of file
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index f60a56934..69e23e574 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -36045,39 +36045,20 @@ Partial Class Ventas
DdlChofer.DataSource = GlobalDTChoferes(UsuarioActual.CveEmpresa)
DdlChofer.DataBind()
-
DdlChofer.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
- DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
- DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
-
- 'Using ObjInv As New ClsInventarios
-
- ' If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
- ' DdlUnidadCamion.DataSource = ObjInv.DtResultados
- ' End If
-
- ' If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
- ' DdlRemolque1.DataSource = ObjInv.DtResultados
- ' End If
-
- 'End Using
-
+ DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=1)
DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
- DdlRemolque1.DataBind()
- DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
-
- Using ObjGrales As New ClsGenerales
- If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
- DdlConfigAuto.DataSource = ObjGrales.DtResultados
- End If
- End Using
-
+ DdlConfigAuto.DataSource = GlobalDTGralCartaPorteConfigAutoTransportes
DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
+ DdlRemolque1.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2)
+ DdlRemolque1.DataBind()
+ DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
+
UpEmitirTransitorio.Update()
End Sub
@@ -36091,12 +36072,10 @@ Partial Class Ventas
DdlRemolque2.SelectedValueExist(-1)
If DdlUnidadCamion.SelectedValue.ToEntero > 0 Then
- Using ObjInv As New ClsInventarios
- If ObjInv.GetCamiones(DdlUnidadCamion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 1) Then
- DdlConfigAuto.SelectedValueExist(ObjInv.DtResultados.FiltroPrimeroValor("CveConfigAutoTransporte"))
- DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
- End If
- End Using
+
+ Dim CveConfig As String = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveCamion:=DdlUnidadCamion.SelectedValue.ToEntero, CveTipoCamion:=1).FiltroPrimeroValor("CveConfigAutoTransporte")
+ DdlConfigAuto.SelectedValueExist(CveConfig)
+ DdlConfigAuto_SelectedIndexChanged(Nothing, Nothing)
End If
UpEmitirTransitorio.Update()
@@ -36222,27 +36201,24 @@ Partial Class Ventas
If DdlConfigAuto.SelectedValue.ToEntero > 0 Then
- Using ObjGrales As New ClsGenerales
- If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
- Dim Remolque As String = ObjGrales.DtResultados.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
+ Dim Remolque As String = GlobalDTGralCartaPorteConfigAutoTransportes.FiltroPrimeroValor("Remolque", $" CveConfigAutoTransporte ='{DdlConfigAuto.SelectedValue}'")
+ If Remolque <> "" Then
- If Remolque = "1" Then
- RequiereRemolque = True
- MostrarRemolques = True
- End If
-
- If Remolque = "0, 1" Then
- RequiereRemolque = False
- MostrarRemolques = True
- End If
-
- If Remolque = "0" Then
- RequiereRemolque = False
- MostrarRemolques = False
- End If
+ If Remolque = "1" Then
+ RequiereRemolque = True
+ MostrarRemolques = True
End If
- End Using
+ If Remolque = "0, 1" Then
+ RequiereRemolque = False
+ MostrarRemolques = True
+ End If
+
+ If Remolque = "0" Then
+ RequiereRemolque = False
+ MostrarRemolques = False
+ End If
+ End If
Else
RequiereRemolque = False
MostrarRemolques = False
@@ -36266,13 +36242,7 @@ Partial Class Ventas
If DdlRemolque1.SelectedValue.ToEntero > 0 Then
DvRemolque2.Visible = True
-
- Using ObjInv As New ClsInventarios
- If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
- DdlRemolque2.DataSource = ObjInv.DtResultados.FiltraParametros($"CveCamion <> {DdlRemolque1.SelectedValue.ToEntero}")
- End If
- End Using
-
+ DdlRemolque2.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa, CveTipoCamion:=2)
DdlRemolque2.DataBind()
Else
DvRemolque2.Visible = False