-- txto concepto pago prepoliza

This commit is contained in:
2023-05-29 17:37:53 -07:00
3 changed files with 85 additions and 267 deletions

View File

@@ -100,10 +100,12 @@
<div class="col-md-8"> <div class="col-md-8">
<%--<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" /> <%--<asp:HiddenField ID="HdnCveProveedor" runat="server" ClientIDMode="Static" Value="-1" />
<asp:Button ID="BtnBuscarProveedor" runat="server" ClientIDMode="Static" Text="Buscar Proveedor" Style="display: none;" class="btn btn-primary" /> <asp:Button ID="BtnBuscarProveedor" runat="server" ClientIDMode="Static" Text="Buscar Proveedor" Style="display: none;" class="btn btn-primary" />
<asp:TextBox ID="TxtPagueseA" CssClass="form-control input-sm" runat="server" MaxLength="70" Width="394px"></asp:TextBox>
<a ID="HplBuscar" class="btn btn-primary" runat="server" onclick="javascript:AbrirVentana('/Compras/PopUpBuscarProveedor.aspx?Opt=Poliza', 800, 547, 'N', 'PopUpBuscar')" ><i class="fa fa-search"></i> Buscar</a>--%> <a ID="HplBuscar" class="btn btn-primary" runat="server" onclick="javascript:AbrirVentana('/Compras/PopUpBuscarProveedor.aspx?Opt=Poliza', 800, 547, 'N', 'PopUpBuscar')" ><i class="fa fa-search"></i> Buscar</a>--%>
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 100%;" DataTextField="RazonSocial" DataValueField="CveProveedor" Visible="true" ></ADS:Dropdownlost>
<asp:DropDownList ID="DdlPersonal" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompletoNombre" DataValueField="CvePersonal" CssClass="form-control input-sm input-medium select2me" Visible="false" Width="100%" ></asp:DropDownList> <asp:TextBox ID="TxtPagueseA" CssClass="form-control input-sm" runat="server" MaxLength="70" Width="394px" > </asp:TextBox>
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssStyle="width: 394px;" DataTextField="RazonSocial" DataValueField="CveProveedor" Visible="true" Onselectedindexchange="DdlProveedores_selectedindexchange" ></ADS:Dropdownlost>
<asp:DropDownList ID="DdlPersonal" runat="server" AppendDataBoundItems="true" DataTextField="NombreCompletoNombre" DataValueField="CvePersonal" CssClass="form-control input-sm input-medium select2me" Visible="false" Width="394px" AutoPostBack="true" OnSelectedIndexChanged="DdlPersonal_SelectedIndexChanged" ></asp:DropDownList>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">

View File

@@ -8,7 +8,6 @@ Imports Stimulsoft.Report.BarCodes
Partial Class Bancos_PolizaCheque Partial Class Bancos_PolizaCheque
Inherits ClsPaginas Inherits ClsPaginas
' Private Shared missing As Object = System.Reflection.Missing.Value
#Region "Propiedades" #Region "Propiedades"
Private Property NombreArchivo As String Private Property NombreArchivo As String
@@ -191,8 +190,7 @@ Partial Class Bancos_PolizaCheque
End If End If
''DdlProveedores.txtText.Value = "" DdlProveedores.txtText.Value = "Seleccione"
DdlProveedores.txtText.Value = "Seleccione un proveedor"
DdlProveedores.txtValue.Value = "-1" DdlProveedores.txtValue.Value = "-1"
DdlProveedores.setEsWebService(True) DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores") DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
@@ -203,32 +201,10 @@ Partial Class Bancos_PolizaCheque
End If End If
End Sub End Sub
'Protected Sub BtnBuscarProveedor_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnBuscarProveedor.Click
' ViewState("CveProveedor") = HdnCveProveedor.Value.ToEntero
' CargaProveedor(HdnCveProveedor.Value.ToEntero, "-1")
' DdlPlantilla_SelectedIndexChanged(DdlPlantilla, e)
'End Sub
'Private Sub CargaProveedor(ByVal CveProveedor As Integer, RFC As String)
' Dim ObjProveedor As New ClsCompProveedores()
' If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, CveProveedor, "-1", "-1", "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa) Then
' If ObjProveedor.DtResultados.Rows.Count > 0 Then
' TxtPagueseA.Text = ObjProveedor.RazonSocial
' TxtNotificarA.Text = ObjProveedor.NotificarA.Trim
' Else
' Alert("El Proveedor solicitado no existe, por favor intente de nuevo.", TipoMensaje.MsgAdvertencia)
' End If
' End If
' ObjProveedor.Dispose()
'End Sub
Private Sub CargaPlantillas(TipoPlantilla As Integer) Private Sub CargaPlantillas(TipoPlantilla As Integer)
'GvPlantillas.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
'GvPlantillas.DataBind()
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla) DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
DdlPlantilla.DataBind() DdlPlantilla.DataBind()
@@ -264,13 +240,12 @@ Partial Class Bancos_PolizaCheque
End Sub End Sub
Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged Protected Sub DdlTipoTransaccion_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoTransaccion.SelectedIndexChanged
'CargaFolio()
CargaCuenta() CargaCuenta()
End Sub End Sub
Private Sub CargaFolio() Private Sub CargaFolio()
If HdnTipoTransaccion.Value = "" Then CargaHdnTipoTransaccion() If HdnTipoTransaccion.Value = "" Then CargaHdnTipoTransaccion()
'If HdnTipoTransaccion.Value = "Egs" Then
If DdlTipoTransaccion.SelectedValue.ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then If DdlTipoTransaccion.SelectedValue.ToEntero > 0 AndAlso UsuarioActual.Empresa.Funcionalidad(505) <> "1" Then
If UsuarioActual.CveEmpresa = 119 AndAlso IfNull(Request("Tipo"), "") = "Ing" Then If UsuarioActual.CveEmpresa = 119 AndAlso IfNull(Request("Tipo"), "") = "Ing" Then
Dim ObjFolios As New ClsGralFolios Dim ObjFolios As New ClsGralFolios
@@ -289,9 +264,7 @@ Partial Class Bancos_PolizaCheque
TxtFolio.Text = Folio.ToString TxtFolio.Text = Folio.ToString
End If End If
End If End If
'Else
'TxtFolio.Text = ""
'End If
Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue)) Dim dr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuenta.SelectedValue))
If dr IsNot Nothing Then If dr IsNot Nothing Then
@@ -319,11 +292,6 @@ Partial Class Bancos_PolizaCheque
<WebMethodAttribute()> <Script.Services.ScriptMethodAttribute()> <WebMethodAttribute()> <Script.Services.ScriptMethodAttribute()>
Public Shared Function wsGetCuentas(ByVal prefixText As String, ByVal count As Integer) As String() Public Shared Function wsGetCuentas(ByVal prefixText As String, ByVal count As Integer) As String()
'Dim dt As DataTable = CType(Session("DtCuentas"), DataTable)
'Dim Conta As New ClsContPAQi(UsuarioActual.Empresa)
'dt = Conta.getCuentasCheque(Prefijo)
'Conta.Dispose()
Dim items As New List(Of String)(count) Dim items As New List(Of String)(count)
Dim dbrows As DataRow() Dim dbrows As DataRow()
@@ -357,8 +325,10 @@ Partial Class Bancos_PolizaCheque
Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged Protected Sub DdlPlantilla_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPlantilla.SelectedIndexChanged
DdlPersonal.SelectedValueExist(-1) DdlPersonal.SelectedValueExist(-1)
DdlProveedores.txtText.Value = "Seleccione un proveedor" DdlProveedores.txtText.Value = "Seleccione"
DdlProveedores.txtValue.Value = "-1" DdlProveedores.txtValue.Value = "-1"
TxtPagueseA.Text = ""
If DdlPlantilla.SelectedValue.ToEntero = 56 Then If DdlPlantilla.SelectedValue.ToEntero = 56 Then
DdlProveedores.Visible = False DdlProveedores.Visible = False
@@ -422,7 +392,7 @@ Partial Class Bancos_PolizaCheque
CveCuenta = drt("CveCuenta").ToString.ToEntero CveCuenta = drt("CveCuenta").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
End If End If
EsComodin = 0 EsComodin = 0
End If End If
@@ -434,7 +404,7 @@ Partial Class Bancos_PolizaCheque
IdCuenta = drt("IdCtaContable").ToString.ToEntero IdCuenta = drt("IdCtaContable").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
End If End If
EsComodin = 0 EsComodin = 0
@@ -447,7 +417,6 @@ Partial Class Bancos_PolizaCheque
IdCuenta = drr("Id").ToString.ToEntero IdCuenta = drr("Id").ToString.ToEntero
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
' Cuenta = drr("Nombre").ToString()
EsComodin = 1 EsComodin = 1
End If End If
End If End If
@@ -458,7 +427,7 @@ Partial Class Bancos_PolizaCheque
IdCuenta = IdCtaFondoGarantia IdCuenta = IdCtaFondoGarantia
CodigoCuenta = drr("CuentaFormato").ToString() CodigoCuenta = drr("CuentaFormato").ToString()
NombreCuenta = drr("Nombre").ToString() NombreCuenta = drr("Nombre").ToString()
'Cuenta = drr("Nombre").ToString()
EsComodin = 0 EsComodin = 0
End If End If
@@ -471,7 +440,7 @@ Partial Class Bancos_PolizaCheque
dr("IdCuenta") = IdCuenta dr("IdCuenta") = IdCuenta
dr("CveCuenta") = CveCuenta dr("CveCuenta") = CveCuenta
dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta
dr("Cuenta") = Cuenta 'TxtCuentaContable.Text dr("Cuenta") = Cuenta
dr("RazonSocial") = drt("RazonSocial") dr("RazonSocial") = drt("RazonSocial")
dr("Concepto") = TxtObservaciones.Text dr("Concepto") = TxtObservaciones.Text
dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1) dr("TipoMovto") = If(drt("TipoMovto").ToString = "False", 0, 1)
@@ -483,7 +452,7 @@ Partial Class Bancos_PolizaCheque
dr("Proyecto") = drt("Proyecto") dr("Proyecto") = drt("Proyecto")
dr("Personal") = drt("Personal") dr("Personal") = drt("Personal")
dr("CvePersonal") = drt("CvePersonal") dr("CvePersonal") = drt("CvePersonal")
'dr("CveConcepto") = drt("CveConcepto")
DtMovimientos.Rows.Add(dr) DtMovimientos.Rows.Add(dr)
@@ -766,8 +735,6 @@ Partial Class Bancos_PolizaCheque
If e.Row.RowIndex = 0 Then If e.Row.RowIndex = 0 Then
e.Row.Cells(0).Width = Unit.Pixel(110) e.Row.Cells(0).Width = Unit.Pixel(110)
e.Row.Cells(1).Width = Unit.Pixel(200) e.Row.Cells(1).Width = Unit.Pixel(200)
'e.Row.Cells(2).Width = Unit.Pixel(150)
'e.Row.Cells(3).Width = Unit.Pixel(150)
e.Row.Cells(2).Width = Unit.Pixel(120) e.Row.Cells(2).Width = Unit.Pixel(120)
e.Row.Cells(3).Width = Unit.Pixel(303) e.Row.Cells(3).Width = Unit.Pixel(303)
e.Row.Cells(4).Width = Unit.Pixel(72) e.Row.Cells(4).Width = Unit.Pixel(72)
@@ -804,43 +771,15 @@ Partial Class Bancos_PolizaCheque
Dim CvePrePoliza As Integer Dim CvePrePoliza As Integer
Dim ValidaConcepto30 As Boolean = False Dim ValidaConcepto30 As Boolean = False
Dim PaguesA As String = "" Dim PaguesA As String = TxtPagueseA.Text.Trim
Dim CveProveedorSeleccionado As Integer = -1 Dim CveProveedorSeleccionado As Integer = -1
Dim CvePersonalSeleccionado As Integer = -1 Dim CvePersonalSeleccionado As Integer = -1
If DdlPlantilla.SelectedValue.ToEntero = 56 Then If DdlPlantilla.SelectedValue.ToEntero = 56 Then
CvePersonalSeleccionado = DdlPersonal.SelectedValue.ToEntero CvePersonalSeleccionado = DdlPersonal.SelectedValue.ToEntero
'If Not CvePersonalSeleccionado > 0 Then
' Alert("Debe de seleccionar un personal.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
PaguesA = DdlPersonal.SelectedItem.Text
Else Else
CveProveedorSeleccionado = DdlProveedores.txtValue.Value.ToEntero CveProveedorSeleccionado = DdlProveedores.txtValue.Value.ToEntero
'If Not CveProveedorSeleccionado > 0 Then
' Alert("Debe de seleccionar un proveedor.", TipoMensaje.MsgAdvertencia)
' Exit Sub
'End If
If CveProveedorSeleccionado > 0 Then
PaguesA = DdlProveedores.txtText.Value
Else
PaguesA = TxtObservaciones.Text.Trim
If TxtObservaciones.Text.Length = 0 Then
Alert("Debe de proporsionar las Observaciones.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
End If
End If End If
@@ -854,9 +793,6 @@ Partial Class Bancos_PolizaCheque
End If End If
For Each Gvr As GridViewRow In GvMov.Rows For Each Gvr As GridViewRow In GvMov.Rows
TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal TotalCargos += Gvr.FCTextBox("TxtCargo").Text.ToDecimal
@@ -894,22 +830,12 @@ Partial Class Bancos_PolizaCheque
Dim ObjIE As New ClsBancos() Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL) Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL) Dim ObjNom As New ClsNominas(ObjIE.IniciaTransacSQL)
'Dim Conta As ClsContPAQi = Nothing
Dim IDPoliza As Integer = 0 Dim IDPoliza As Integer = 0
Dim CveIE As Integer Dim CveIE As Integer
Dim MsgError As String = "" Dim MsgError As String = ""
Dim idCuentaContabilizacion As Long = 1 Dim idCuentaContabilizacion As Long = 1
'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then
' Conta = New ClsContPAQi(UsuarioActual.Empresa)
' Conta.IniciaTransacSQL()
' IDPoliza = Conta.AddPoliza(2, TxtObservaciones.Text, TotalCargos, TotalAbonos, UsuarioActual.CveUsuario, TxtFechaDocumento.Text.ToDate)
' 'inserto la póliza
' NumPoliza = Conta.Folio
' If IDPoliza = 0 Then
' MsgError = "No se pudo insertar la póliza contable."
' End If
'End If
If MsgError = "" Then If MsgError = "" Then
@@ -966,16 +892,8 @@ Partial Class Bancos_PolizaCheque
CvePersonalSeleccionado = gvr.DataKey("CvePersonal").ToEntero CvePersonalSeleccionado = gvr.DataKey("CvePersonal").ToEntero
End If End If
'CveProveedor = gvr.DataKey("CveProveedor").ToEntero
'If HdnCveProveedor.Value.ToEntero > 0 Then CveProveedor = HdnCveProveedor.Value.ToEntero
If Importe <> 0 Then If Importe <> 0 Then
'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then
' If Not Conta.AddMovimiento(IDPoliza, gvr.DataKey("IDCuenta").ToEntero, TipoMovto, Importe, gvr.FCLiteral("LtlReferencia").Text, gvr.FCTextBox("TxtConcepto").Text, 0, TxtFechaDocumento.Text.ToDate, "") Then
' MsgError = "No se pudo insertar movimiento contable"
' Exit For
' End If
'End If
If MsgError = "" Then If MsgError = "" Then
@@ -1022,8 +940,6 @@ Partial Class Bancos_PolizaCheque
MsgError = "No se pudo actualizar el periodo de la nómina" MsgError = "No se pudo actualizar el periodo de la nómina"
End If End If
'Generamos el Layout
'GeneraLayout()
End If End If
Else Else
@@ -1041,7 +957,6 @@ Partial Class Bancos_PolizaCheque
If MsgError = "" Then If MsgError = "" Then
If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then If ObjMov.ValidacionPrePolizaCuadre(CvePrePoliza, -1) Then
If ObjMov.ValorPolizaDescuadre > 0 Then If ObjMov.ValorPolizaDescuadre > 0 Then
' MsgError = ObjMov.MensajePolizaDescuadre
GuardaLogAD($"PolizaCheque/Guardar Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"PolizaCheque/Guardar Error:{ObjMov.MensajePolizaDescuadre} Diferencia:{ObjMov.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
End If End If
Else Else
@@ -1053,7 +968,6 @@ Partial Class Bancos_PolizaCheque
If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
'Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
IDPoliza = ObjMov.ContaIdPoliza IDPoliza = ObjMov.ContaIdPoliza
Else Else
MsgError = "Error al contabilizar" MsgError = "Error al contabilizar"
@@ -1066,7 +980,6 @@ Partial Class Bancos_PolizaCheque
If MsgError = "" Then If MsgError = "" Then
ObjIE.Commit() ObjIE.Commit()
'If Conta IsNot Nothing Then Conta.Commit()
If filemove <> "" Then If filemove <> "" Then
filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False) filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
@@ -1081,7 +994,7 @@ Partial Class Bancos_PolizaCheque
DdlCuenta.SelectedValue = "-1" DdlCuenta.SelectedValue = "-1"
TxtFechaDocumento.Text = "" TxtFechaDocumento.Text = ""
TxtImporte.Text = "" TxtImporte.Text = ""
'TxtPagueseA.Text = "" TxtPagueseA.Text = ""
TxtObservaciones.Text = "" TxtObservaciones.Text = ""
Dim StrMsg As New StringBuilder Dim StrMsg As New StringBuilder
StrMsg.AppendFormat("El Movimiento se guardo correctamente <br><br> <a href=""/Bancos/IE.aspx?CveIE={0}"" target=""_blank"" class='Texto'>Movimiento</a><br/>", CveIE) StrMsg.AppendFormat("El Movimiento se guardo correctamente <br><br> <a href=""/Bancos/IE.aspx?CveIE={0}"" target=""_blank"" class='Texto'>Movimiento</a><br/>", CveIE)
@@ -1095,145 +1008,26 @@ Partial Class Bancos_PolizaCheque
Else Else
Alert(MsgError.ToString, TipoMensaje.MsgError) Alert(MsgError.ToString, TipoMensaje.MsgError)
ObjIE.RollBack() ObjIE.RollBack()
'If Conta IsNot Nothing Then Conta.RollBack()
End If End If
Else Else
Alert("Debe de llevar un importe", TipoMensaje.MsgAdvertencia) Alert("Debe de llevar un importe", TipoMensaje.MsgAdvertencia)
'If Conta IsNot Nothing Then Conta.RollBack()
End If End If
Else
'If Conta IsNot Nothing Then Conta.RollBack()
End If End If
ObjIE.Dispose() ObjIE.Dispose()
ObjMov.Dispose() ObjMov.Dispose()
ObjNom.Dispose() ObjNom.Dispose()
'If Conta IsNot Nothing Then Conta.Dispose()
Else Else
Alert("La suma de los movimientos no son iguales", TipoMensaje.MsgAdvertencia) Alert("La suma de los movimientos no son iguales", TipoMensaje.MsgAdvertencia)
End If End If
End Sub End Sub
'' -------------------------------------- codigo para generar la poliza del cheque
'If pIDPoliza > 0 Then
'Dim ObjPoliza As New ClsContPAQi(UsuarioActual.Empresa)
' If ObjPoliza.GetPoliza(pIDPoliza, -1, -1, -1, -1) Then
' dtMovs = ObjPoliza.DtResultados
' End If
' ObjPoliza.Dispose()
' ''Movimientos Póliza
' If dtMovs IsNot Nothing Then
'Dim TotalAbonos, TotalCargos As Double
' TotalAbonos = 0 : TotalCargos = 0
' For Each Row As DataRow In dtMovs.Rows
''Cantidad
''If Row("AplicaParaConcepto").ToString.ToEntero > 0 Then
' Hoja.Range("B" & CeldaF & ": B" & CeldaF).Value = Row("CuentaFormato").ToString
''Unidad
''If Row("AplicaParaConcepto").ToString.ToEntero > 0 Then
' Hoja.Range("C" & CeldaF & ":C" & CeldaF).Value = Row("Nombre").ToString
''Concepto y Descripción
' Hoja.Range("F" & CeldaF & ":F" & CeldaF).Value = If(Row("Cargo").ToString.ToDouble > 0, Row("Cargo").ToString.ToDouble.FormatoNumero, "")
''P Unitario
''Morro el precio unitario si va a ir?
' Hoja.Range("G" & CeldaF & ":G" & CeldaF).Value = If(Row("Abono").ToString.ToDouble > 0, Row("Abono").ToString.ToDouble.FormatoNumero, "")
' TotalCargos += Row("Cargo").ToString.ToDouble
' TotalAbonos += Row("Abono").ToString.ToDouble
' If dtMovs.Rows.Count > 1 AndAlso CeldaF - CeldaI < dtMovs.Rows.Count - 1 Then
' CeldaF = CeldaF + 1
' Libro.Application.Run("AddRow", (CeldaF - 1).ToString, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing,
' missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing)
' Libro.Save()
' Libro.Application.DisplayAlerts = False
' Libro.Application.ScreenUpdating = False
' End If
' Next
'Dim AddedRow As Integer = CeldaF - CeldaI
' Hoja.Range("F" & (50 + AddedRow).ToString & ":F" & (50 + AddedRow).ToString).Value = TotalCargos.FormatoNumero
' Hoja.Range("G" & (50 + AddedRow).ToString & ":G" & (50 + AddedRow).ToString).Value = TotalAbonos.FormatoNumero
' Hoja.Range("C" & (52 + AddedRow).ToString & ":C" & (52 + AddedRow).ToString).Value = UsuarioRegistro
''Hoja.Range("E" & (13 + AddedRow).ToString & ":E" & (13 + AddedRow).ToString).Value = LblAmortizacion.Text.Trim.ToDouble(TC).FormatoNumero
''Hoja.Range("E" & (14 + AddedRow).ToString & ":E" & (14 + AddedRow).ToString).Value = TxtSubTotal2.Text.Trim.ToDouble(TC).FormatoNumero
''Hoja.Range("E" & (15 + AddedRow).ToString & ":E" & (15 + AddedRow).ToString).Value = TxtIVA.Text.Trim.ToDouble(TC).FormatoNumero
' End If
' End If
'Protected Sub LnkAgregar_Click(sender As Object, e As EventArgs) Handles LnkAgregar.Click
' If HdnCveCuenta.Value.ToEntero = 0 Then
' Alert("Seleccione una cuenta contable")
' Exit Sub
' End If
' If TxtCargoImporte.Text = "" AndAlso TxtAbonoImporte.Text = "" Then
' Alert("Ingrese un importe.")
' Exit Sub
' End If
' If HdnCveCuenta.Value.ToEntero > 0 AndAlso (TxtCargoImporte.Text.ToDouble > 0 Or TxtAbonoImporte.Text.ToDouble > 0) Then
' Dim Cuenta As String = ""
' Dim CodigoCuenta As String = ""
' If DdlCuentaContable.SelectedValue.ToEntero > 0 Then 'DtCuentasContables
' Dim drr As DataRow = DtCuentasContables.FiltroPrimero("Id=" & DdlCuentaContable.SelectedValue)
' If drr IsNot Nothing Then
' CodigoCuenta = drr("CuentaFormato").ToString()
' Cuenta = drr("Nombre").ToString()
' End If
' End If
' Dim dr As DataRow = DtMovimientos.NewRow
' dr("IdCuenta") = HdnCveCuenta.Value.ToEntero
' dr("CodigoCuenta") = CodigoCuenta
' dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
' dr("Referencia") = TxtReferencia.Text
' dr("Concepto") = TxtConceptoContable.Text
' dr("Cargo") = TxtCargoImporte.Text.ToDouble
' dr("Abono") = TxtAbonoImporte.Text.ToDouble
' DtMovimientos.Rows.Add(dr)
' TxtTotalAbonos.Text = DtMovimientos.SUM("Abono").FormatoNumero
' TxtTotalCargos.Text = DtMovimientos.SUM("Cargo").FormatoNumero
' 'ArregloMovs.Add(Mov)
' GvMov.DataSource = DtMovimientos
' GvMov.DataBind()
' 'saco de la póliza el importe del cheque, que coincida la cuenta contable con la bancaria
' If DdlCuenta.SelectedValue.ToEntero > 0 Then
' Dim drr As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltroPrimero("CveCuenta=" & DdlCuenta.SelectedValue)
' If drr IsNot Nothing Then
' TxtImporte.Text = (DtMovimientos.SUM("Abono", "IdCuenta =" & drr("IdCtaContable").ToString) - DtMovimientos.SUM("Cargo", "IdCuenta =" & drr("IdCtaContable").ToString)).ToString.FormatoNumero
' UPPDocumento.Update()
' End If
' End If
' HdnCveCuenta.Value = "0"
' DdlCuentaContable.SelectedValue = "0"
' TxtReferencia.Text = ""
' TxtConceptoContable.Text = ""
' TxtCargoImporte.Text = ""
' TxtAbonoImporte.Text = ""
' End If
'End Sub
Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting Protected Sub GvMov_RowDeleting(sender As Object, e As GridViewDeleteEventArgs) Handles GvMov.RowDeleting
@@ -1281,10 +1075,22 @@ Partial Class Bancos_PolizaCheque
Protected Sub CargaDDLPersonal() Protected Sub CargaDDLPersonal()
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa) DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
DdlPersonal.DataBind() DdlPersonal.DataBind()
DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1")) DdlPersonal.Items.Insert(0, New ListItem("Seleccione", "-1"))
End Sub End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs)
TxtPagueseA.Text = DdlPersonal.SelectedItem.Text
UPPDocumento.Update()
End Sub
Protected Sub DdlProveedores_selectedindexchange(sender As Object, e As EventArgs)
TxtPagueseA.Text = DdlProveedores.txtText.Value
UPPDocumento.Update()
End Sub
End Class End Class

View File

@@ -13670,8 +13670,14 @@ Partial Class Compras_Compras
End If End If
End Sub End Sub
Protected Sub BtnCancelarCompra2_Click(sender As Object, e As EventArgs) Protected Sub BtnCancelarCompra2_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DivCancelarCompra').modal('hide');") RegistraScript("$('#DivCancelarCompra').modal('hide');")
If (Not UsuarioActual.TienePermisoProceso(315)) And GvInvMov.Rows.Count > 0 Then
Alert("La compra no se puede cancelar debido a que tiene movimientos de almacén.", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
Dim ObjComprasComprobacion As New ClsCompras Dim ObjComprasComprobacion As New ClsCompras
If ObjComprasComprobacion.GetComprasPagosConciliados(CveCompra, UsuarioActual.CveEmpresa) Then If ObjComprasComprobacion.GetComprasPagosConciliados(CveCompra, UsuarioActual.CveEmpresa) Then
@@ -13694,6 +13700,9 @@ Partial Class Compras_Compras
ObjComprasComprobacion.Dispose() ObjComprasComprobacion.Dispose()
Dim cvemovimientoentrada As Integer = -1 Dim cvemovimientoentrada As Integer = -1
'DEVOLUCIÓN AUTOMATICA 'DEVOLUCIÓN AUTOMATICA
If CheckDevAuto.Checked Then If CheckDevAuto.Checked Then
Dim ErrorMovInv As Boolean = False Dim ErrorMovInv As Boolean = False
@@ -13757,6 +13766,7 @@ Partial Class Compras_Compras
ObjCompra.Dispose() ObjCompra.Dispose()
End If End If
Dim ObjAC As ClsContPAQi = Nothing Dim ObjAC As ClsContPAQi = Nothing
If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then If (UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1") AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then
ObjAC = New ClsContPAQi(UsuarioActual.Empresa) ObjAC = New ClsContPAQi(UsuarioActual.Empresa)