Merge branch 'master' of http://jperez@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -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}"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
<div class="col-md-5" runat="server" id="DivTC" visible="false">
|
||||
T.C.:
|
||||
<asp:TextBox ID="TxtTC" runat="server" Text="1" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" onblur="CambiaPesosDolares();" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||
<asp:TextBox ID="TxtTC" runat="server" Text="1" placeholder="Tipo de Cambio" CssClass="form-control input-sm" MaxLength="12" onblur="CambiaDolaresPesos();" Width="70px" ClientIDMode="Static" Style="text-align: right; display: inline-block;" />
|
||||
<asp:RequiredFieldValidator ID="RFVTC" Enabled="false" runat="server" ControlToValidate="TxtTC" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo de Cambio''</b> es necesario, por favor seleccione uno." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCETC" runat="server" HighlightCssClass="vco" TargetControlID="RFVTC" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:Label ID="LbImporteME" Text="" ClientIDMode="Static" runat="server" />
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -187,8 +187,8 @@
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox CssClass="form-control" ID="TxtUsuarioElaboro" runat="server" MaxLength="15" Enabled="false"></asp:TextBox>
|
||||
<label for="<%= TxtUsuarioElaboro.ClientID.ToString()%>">Usuario Elaboró: </label>
|
||||
<asp:Label CssClass="form-control" ID="LblUsuarioElaboro" runat="server" MaxLength="15" ></asp:Label>
|
||||
<label for="<%= LblUsuarioElaboro.ClientID.ToString()%>">Usuario Elaboró: </label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
|
||||
108
OC/OC.aspx.vb
108
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 <b>{DdlSubProyecto.SelectedItem.Text}</b> y la clasificación <b>{DdlClasificacion.SelectedItem.Text}</b> se excede por <b>{Diferencia.FormatoNumero}</b>", 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
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkComisiones" OnClick="LnkComisiones_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkComisionesEspeciales" OnClick="LnkComisionesEspeciales_Click" data-toggle="tooltip" data-placement="left" title="Comisiones" Text="<i class='fa fa-money'></i> Comisiones Especiales"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExportar" runat="server" Visible="false"><i class="fa fa-file-excel-o"></i> Excel</asp:LinkButton>
|
||||
@@ -280,6 +283,79 @@
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DvModalComisionesEspeciales" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog" style="width: 900px;">
|
||||
<asp:UpdatePanel runat="server" class="modal-content" ID="UpdatePanel1" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">
|
||||
<asp:Literal ID="Literal2" runat="server">Comisiones Especiales</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="row" style="margin-left: 0px; margin-top: 5px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusquedaComicionesEspeciales" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusquedaComiciones','{0}')", GvComisionesEspeciales.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusquedaComicionesEspeciales','{0}')", GvComisionesEspeciales.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<asp:GridView ID="GvComisionesEspeciales" runat="server" AutoGenerateColumns="False"
|
||||
DataKeyNames="CveMedicoComision,CveMedico,CvePS,TipoComision,Comision,CveUsuario"
|
||||
data-sort="true"
|
||||
EmptyDataText="No se encontraron Comisiones" ToolTip="Listado de Medicos" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" GridLines="None">
|
||||
<Columns>
|
||||
|
||||
<asp:TemplateField HeaderText="Médico" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlMedico" runat="server" Text='<%# Eval("Medico") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Código/Producto" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlCodigoPS" runat="server" Text='<%# Eval("CodigoPS") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="TipoComision" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoComision" runat="server" Text='<%# Eval("TipoComisionStr") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Comision" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoComision" runat="server" Text='<%# Eval("Comision") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-HorizontalAlign="center" HeaderText="Opciones" ItemStyle-Width="60px">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEliminarComisionEspecial" OnClick="LnkEliminarComisionEspecial_Click" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False"
|
||||
CssClass="btn btn-circle btn-sm red" Text="<i title='Reasignar' class='icon-trash' title='Eliminar' ></i>"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="si" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button id="Button2" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -113,144 +113,38 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpLineasAdicionales" runat="server" RenderMode="Inline" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row " runat="server" visible ="false" id="DvLinea">
|
||||
<div class=" col-md-12" style="text-align: right!important">
|
||||
<input type="text" id="TxtBuscarLineaAdicional" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvD.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvD.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row " runat="server" visible ="false" id="DvLineaPO">
|
||||
<div class=" col-md-12" style="text-align: right!important">
|
||||
<input type="text" id="TxtBuscarLineaAdicionalpo" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvLAPO.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBuscarLineaAdicional','{0}')", GvLAPO.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row ">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None" Visible="false"
|
||||
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveCategoria,FechaIng,CveLineaAdicionalEstatus,Proveedor,LineaAdicionalComprobante,DiasVencimiento,CveVenta"
|
||||
<asp:GridView ID="GvD" Width="100%" runat="server" GridLines="None"
|
||||
DataKeyNames="CveLineaAdicional,LineaAdicional,CveCliente,CveProveedor,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveUsuario,CveCategoria,FechaIng,Proveedor,DiasVencimiento"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD input-sm " ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False">
|
||||
<Columns>
|
||||
<asp:BoundField DataField="LineaAdicional" HeaderText="Linea Adicional" />
|
||||
<asp:BoundField DataField="NombreCliente" HeaderText="Cliente" />
|
||||
<asp:HyperLinkField DataTextField="NombreCliente" DataNavigateUrlFields="CveCliente" DataNavigateUrlFormatString="/Ventas/Clientes.aspx?CveCliente={0}" HeaderText="Cliente" />
|
||||
<asp:BoundField DataField="Proveedor" HeaderText="Comercializador" />
|
||||
<asp:BoundField DataField="TipoLineaSTR" HeaderText="Tipo Linea" />
|
||||
<asp:BoundField DataField="Importe" HeaderText="Importe" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="Moneda" />
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Serie Folio" />
|
||||
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="DiasVencimiento" HeaderText="Dias de Venc." />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" />
|
||||
<asp:BoundField DataField="FechaVencimiento" HeaderText="F. Vencimiento" DataFormatString="{0:d}" />
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
<asp:GridView ID="GvLAPO" Width="100%" runat="server" GridLines="None" Visible="false"
|
||||
DataKeyNames="CveLineaAdicional,TipoLinea,Importe,CveMoneda,FechaVencimiento,CveLineaAdicionalEstatus,LineaAdicionalComprobante,CveVenta,CveCliente,CveProveedor"
|
||||
CssClass="table table-striped table-advance table-hover ScrollAD input-sm mysmallbtn" ShowHeader="True" EmptyDataText="No se encontraron resultados." ShowHeaderWhenEmpty="true"
|
||||
AutoGenerateColumns="False" AllowPaging="False" ShowFooter="False"
|
||||
OnRowCommand="GvLAPO_RowCommand"
|
||||
OnRowDataBound="GvLAPO_RowDataBound">
|
||||
<Columns>
|
||||
<asp:BoundField DataField ="Agrupador" HeaderText="Agrupador" />
|
||||
<asp:BoundField DataField="LineaAdicional" HeaderText="PO" />
|
||||
<asp:BoundField DataField="Importe" HeaderText="Importe PO" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="Abreviatura" HeaderText="Mon" />
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" HeaderText="Serie Folio" />
|
||||
<asp:BoundField DataField="Saldo" HeaderText="Saldo" DataFormatString="{0:n}" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="DiasVencimiento" HeaderText="D.Plazo" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="DiasTranscurridos" HeaderText="D.Trans" ItemStyle-HorizontalAlign="Right" />
|
||||
<asp:BoundField DataField="FechaVenta" HeaderText="F. Venta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="FechaVencimientoVenta" HeaderText="F. Venc. Venta" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="Estatus" HeaderText="Estatus" />
|
||||
<asp:BoundField DataField="FechaEnvio" HeaderText="F. Envío" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:TemplateField HeaderText="Opciones" ItemStyle-Width="75px" HeaderStyle-Width="75px">
|
||||
<ItemTemplate>
|
||||
<div class="row" >
|
||||
<div class="col-md-4" style="max-width:26px!important">
|
||||
<asp:LinkButton ID="LnkCargarComprobante" Visible="false" runat="server" AlternateText="Editar" CausesValidation="False"
|
||||
CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-upload'></i>" OnClick="LnkCargarComprobante_Click"
|
||||
ToolTip="Cargar Comprobante" />
|
||||
<asp:LinkButton ID="LnkDescargaComprobante" Visible="false" runat="server" AlternateText="Descarga" CausesValidation="False"
|
||||
CssClass="btn btn-circle btn-sm yellow" Text="<i class='fa fa-download'></i>" OnClick="LnkDescargaComprobante_Click"
|
||||
ToolTip="Descargar Comprobante" />
|
||||
</div>
|
||||
<div class="col-md-4" style="max-width:26px!important" title="Cambiar estatus a Enviado">
|
||||
<asp:LinkButton ID="LnkCambiarEstatus" runat="server" Visible="false" AlternateText="CambiarEstatus"
|
||||
CommandName="Estatus" CommandArgument='<%# Eval("CveLineaAdicionalEstatus") %>' CausesValidation="False"
|
||||
CssClass="btn btn-circle btn-sm blue" Text="<i class='fa fa-arrow-right'></i>"
|
||||
data-toggle="confirmation" data-popout="true" data-original-title="¿Cambiar Estado?" data-btn-ok-label="si"
|
||||
ToolTip="Cambiar estatus a Enviado" />
|
||||
</div>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%-- MODAL COMPROBANTE --%>
|
||||
<div id="ModalComprobante" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content" style="width: 700px;">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Agregar Comprbante</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpAddComprobancte" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div>
|
||||
<asp:TextBox ID="Anexo" CssClass="ADSdropzone hidden" data-maxFile="1" Text="" runat="server"></asp:TextBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:Button ID="BtnAddComprobante" runat="server" ClientIDMode="Static" Text="Guardar" CssClass="btn btn-primary" OnClick="BtnAddComprobante_Click" />
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- FIN MODAL COMPROBANTE --%>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" Runat="Server">
|
||||
|
||||
@@ -88,58 +88,20 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
|
||||
|
||||
private void CargaDatos()
|
||||
{
|
||||
DTDatosGvD = new DataTable();
|
||||
LnkDescargaExcel.Visible = false;
|
||||
|
||||
ClsVentas objVentas = new ClsVentas();
|
||||
DTDatosGvD = new DataTable();
|
||||
LnkDescargaExcel.Visible = false;
|
||||
|
||||
int CveProveedor = -1;
|
||||
|
||||
if(TipoLinea == 1)
|
||||
ClsVentas objVentas = new ClsVentas();
|
||||
|
||||
if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), 1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
GvD.DataSource = objVentas.DtResultados;
|
||||
|
||||
if (objVentas.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DTDatosGvD = objVentas.DtResultados;
|
||||
LnkDescargaExcel.Visible = true;
|
||||
if (objVentas.GetLineasAdicionalesVencimientos( DdlClientes.SelectedValue.ToEntero(), -1, txtFechaI.Text.ToDate(), txtFechaF.Text.ToDate(), 1, UsuarioActual.CveEmpresa))
|
||||
{
|
||||
}
|
||||
GvD.DataSource = objVentas.DtResultados;
|
||||
|
||||
if (objVentas.DtResultados.Rows.Count > 0)
|
||||
{
|
||||
DTDatosGvD = objVentas.DtResultados;
|
||||
{
|
||||
GvD.DataSource = null;
|
||||
}
|
||||
}
|
||||
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
|
||||
{
|
||||
LnkDescargaExcel.Visible = true;
|
||||
UpAcciones.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
objVentas.Dispose();
|
||||
@@ -155,116 +117,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
|
||||
CveLineaAdicional = GvRow.DataKey("CveLineaAdicional").ToString().ToEntero();
|
||||
CveVenta = GvRow.DataKey("CveVenta").ToString().ToEntero();
|
||||
LineaAdicionalComprobante = GvRow.DataKey("LineaAdicionalComprobante").ToString();
|
||||
|
||||
RegistraScript("$('#ModalComprobante').modal('show');","");
|
||||
}
|
||||
|
||||
protected void BtnAddComprobante_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool errorCargaComprobante = false;
|
||||
string FileExtension = "-1";
|
||||
List<Archivo> 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)
|
||||
{
|
||||
|
||||
RegistraScript("$('#ModalComprobante').modal('show');","");
|
||||
}
|
||||
|
||||
@@ -273,14 +126,7 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
|
||||
protected void LnkDescargaExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(TipoLinea == 1)
|
||||
{
|
||||
GridView gvTemp = GvD;
|
||||
//gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
|
||||
gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150);
|
||||
}
|
||||
else if(TipoLinea == 2)
|
||||
{
|
||||
GridView gvTemp = GvLAPO;
|
||||
{
|
||||
GridView gvTemp = GvD;
|
||||
//gvTemp.ExportToExcelX("RepLineasAdicionales" + NowADS().ToShortDateString());
|
||||
gvTemp.ExportToExcelGembox("RepLineasAdicionales", UsuarioActual, "Rep Lineas Adicionales", AnchoImagen: 150);
|
||||
@@ -351,28 +197,6 @@ public partial class Ventas_RepVencimientosCredito : ClsPaginas
|
||||
Response.ContentType = "text/octet-stream";
|
||||
Response.Flush();
|
||||
Response.TransmitFile(fi.FullName);
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user