This commit is contained in:
2023-06-14 12:47:05 -07:00
10 changed files with 170 additions and 71 deletions

View File

@@ -4217,12 +4217,15 @@ Public Class ClsBancos
#Region "CONCILIACIÓN BANCARIA" #Region "CONCILIACIÓN BANCARIA"
Public Function UpdateConciliacionBancaria(CveIE As Integer, FechaAplicado As Date, CveUsuario As Integer) As Boolean Public Function UpdateConciliacionBancaria(CveIE As Integer, FechaAplicado As Date, CveIEEstadoCuenta As Integer, FueConciliado As Integer, Opcion As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Banc_ConciliacionBancariaUpdate") DataAdapter("PA_Banc_ConciliacionBancariaUpdate")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveIE", SqlDbType.Int).Value = CveIE .Add("@CveIE", SqlDbType.Int).Value = CveIE
.Add("@FechaAplicado", SqlDbType.Date).Value = FechaAplicado .Add("@FechaAplicado", SqlDbType.Date).Value = FechaAplicado
.Add("@CveIEEstadoCuenta", SqlDbType.Int).Value = CveIEEstadoCuenta
.Add("@FueConciliado", SqlDbType.Int).Value = FueConciliado
.Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With End With
Try Try

View File

@@ -178,8 +178,8 @@ Partial Class Bancos_ConciliacionesBancariasaspx
If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then
For Each DrE As DataRow In DtDatosEdoCuenta.Rows For Each DrE As DataRow In DtDatosEdoCuenta.Rows
If ((Dr("FechaDocumento").ToString.ToDate = DrE("FechaDocumento").ToString.ToDate And Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 1) Or (Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 2)) And Not CBool(DrE("Seleccionado").ToString) And Not CBool(DrE("FueConciliado").ToString) And Not CBool(Dr("Seleccionado").ToString) Then If ((Dr("FechaDocumento").ToString.ToDate = DrE("FechaDocumento").ToString.ToDate And Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 1) Or (Dr("Importe").ToString.ToDouble = DrE("Importe").ToString.ToDouble And Dr("Tipo").ToString = DrE("Tipo").ToString And DdlCriterio.SelectedValue.ToEntero = 2)) And Not CBool(DrE("Seleccionado").ToString) And Not CBool(DrE("FueConciliado").ToString) And Not CBool(Dr("Seleccionado").ToString) Then
If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate), UsuarioActual.CveUsuario) Or Not ObjBancos.UpdateIEEstadoCuenta(DrE("CveIEEstadoCuenta").ToString.ToEntero, DrE("Importe").ToString.ToDouble, True, Dr("CveIE").ToString.ToEntero, If Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate), -1, 1, 1, UsuarioActual.CveUsuario) Or
DrE("Referencia").ToString, DrE("Tipo").ToString, DrE("FechaDocumento").ToString.ToDate, DrE("CveCuenta").ToString.ToEntero) Then Not ObjBancos.UpdateConciliacionBancaria(Dr("CveIE").ToString.ToEntero, If(Dr("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Dr("FechaDocumento").ToString.ToDate), DrE("CveIEEstadoCuenta").ToString.ToEntero, 1, 2, UsuarioActual.CveUsuario) Then
ErrorTrans = True ErrorTrans = True
Else Else
If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Dr("CveIE").ToString.ToEntero) Then If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Dr("CveIE").ToString.ToEntero) Then
@@ -283,7 +283,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
Dim CveIE As Integer = 0 Dim CveIE As Integer = 0
For Each Gvr As GridViewRow In GvDatos.Rows For Each Gvr As GridViewRow In GvDatos.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), UsuarioActual.CveUsuario) Then If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), -1, 1, 1, UsuarioActual.CveUsuario) Then
ErrorTrans = True ErrorTrans = True
Else Else
If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then
@@ -350,7 +350,7 @@ Partial Class Bancos_ConciliacionesBancariasaspx
For Each Gvr As GridViewRow In GvDatos.Rows For Each Gvr As GridViewRow In GvDatos.Rows
If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then
Selecciono = True Selecciono = True
If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), UsuarioActual.CveUsuario) Then If Not ObjBancos.UpdateConciliacionBancaria(Gvr.DataKey("CveIE").ToEntero, If(Gvr.DataKey("FechaDocumento").ToString.ToDate < txtFechaI.Text.ToDate, TxtFechaAplicado.Text.ToDate, Gvr.DataKey("FechaDocumento").ToString.ToDate), -1, 1, 1, UsuarioActual.CveUsuario) Then
ErrorTrans = True ErrorTrans = True
Else Else
If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then

View File

@@ -1297,13 +1297,23 @@
<div class="row"> <div class="row">
<div class="col-md-2">Acreedor:</div> <div class="col-md-2">Acreedor:</div>
<div class="col-md-10"> <div class="col-md-10">
<asp:DropDownList ID="DdlAcreedorPrePoliza" runat="server" CssClass="select2me" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Width="300px"> <asp:DropDownList ID="DdlAcreedorPrePoliza" runat="server" CssClass="select2me" AppendDataBoundItems="true" DataTextField="RazonSocial" DataValueField="CveProveedor" Width="300px" AutoPostBack="true">
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem> <asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVAcreedorPrePoliza" runat="server" ControlToValidate="DdlAcreedorPrePoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Acreedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAplicarSaldo"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="RFVAcreedorPrePoliza" runat="server" ControlToValidate="DdlAcreedorPrePoliza" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Acreedor''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAplicarSaldo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCEAcreedorPrePoliza" runat="server" HighlightCssClass="vco" TargetControlID="RFVAcreedorPrePoliza" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEAcreedorPrePoliza" runat="server" HighlightCssClass="vco" TargetControlID="RFVAcreedorPrePoliza" Width="300px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-2">Compra:</div>
<div class="col-md-10">
<asp:DropDownList ID="DdlCompras" runat="server" CssClass="select2me" AppendDataBoundItems="true" DataTextField="SerieFolio" DataValueField="CveCompra" Width="300px" >
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVCompra" runat="server" ControlToValidate="DdlCompras" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compra''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpAplicarSaldo"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" HighlightCssClass="vco" TargetControlID="RFVCompra" Width="300px"></ajax:ValidatorCalloutExtender>
</div>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

@@ -2,7 +2,9 @@
Option Explicit On Option Explicit On
Imports System.Data Imports System.Data
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
Imports Extensiones Imports Extensiones
Imports Stimulsoft.Report.StiOptions.Export
Partial Class Bancos_Creditos Partial Class Bancos_Creditos
Inherits ClsPaginas Inherits ClsPaginas
@@ -423,8 +425,8 @@ Partial Class Bancos_Creditos
LbSaldo.Text = $"Saldo <b>Acreedor</b> " LbSaldo.Text = $"Saldo <b>Acreedor</b> "
If ObjPrepoliza.GetPrePolizasDetalle(ObjCreditos.CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjPrepoliza.DtResultados.Rows.Count > 0 Then If ObjPrepoliza.GetPrePolizasDetalle(ObjCreditos.CvePrePoliza, UsuarioActual.CveEmpresa) AndAlso ObjPrepoliza.DtResultados.Rows.Count > 0 Then
LbSaldoAcreedor.Text = ObjPrepoliza.DtResultados.FiltraParametros("CveConceptoContable = 42").Rows(0)("Importe").ToString.FormatoNumero LbSaldoAcreedor.Text = ObjPrepoliza.DtResultados.FiltroPrimeroValor("Importe", "CveConceptoContable = 42").FormatoNumero
LbSaldoDocxPagar.Text = ObjPrepoliza.DtResultados.FiltraParametros("CveConceptoContable = 50").Rows(0)("Importe").ToString.FormatoNumero LbSaldoDocxPagar.Text = ObjPrepoliza.DtResultados.FiltroPrimeroValor("Importe", "CveConceptoContable = 50").FormatoNumero
End If End If
Else Else
@@ -1572,65 +1574,111 @@ Partial Class Bancos_Creditos
Dim CvePrePoliza = 0 Dim CvePrePoliza = 0
'GENERA PREPOLIZA 'GENERA PREPOLIZA
If ObjContabilidad.GetPlantillaConceptos(UsuarioActual.CveEmpresa, 69) AndAlso ObjContabilidad.DtResultados.Rows.Count > 0 Then
Dim DtPlantilla = ObjContabilidad.DtResultados
Dim importeMovimiento = 0.0D Dim importeMovimiento = 0.0D
Dim ConceptoContable = 0 Dim ConceptoContable = 0
Dim TipoMovimiento = False Dim TipoMovimiento = False
Dim IdCtaContable = 0 Dim IdCtaContable = 0
Dim Concepto = "" Dim Concepto = ""
Dim Referencia = $"Crédito: {TxtReferencia.Text}" Dim Referencia = $"Crédito: {TxtReferencia.Text}"
Dim FechaMovimiento = Now.ToDate Dim FechaMovimiento = Now.ToDate
Dim MsgError As String = ""
CvePrePoliza = ObjContabilidad.AddPrePolizas("Creditos/RegistrodeRegistro", 69, TxtCSTotalCredito.Text.ToDouble, TxtCSTotalCredito.Text.ToDouble, DdlCSTipoMoneda.SelectedValue.ToEntero, FechaMovimiento, $"Crédito: {TxtReferencia.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CvePrePoliza = ObjContabilidad.AddPrePolizas("Creditos/RegistrodeRegistro", 69, TxtCSTotalCredito.Text.ToDouble, TxtCSTotalCredito.Text.ToDouble, DdlCSTipoMoneda.SelectedValue.ToEntero, FechaMovimiento, $"Crédito: {TxtReferencia.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
Dim ImporteDocXPagar = TxtTotalCredito.Text.ToDecimal Dim ImporteDocXPagar = TxtTotalCredito.Text.ToDecimal
Dim CveActivoFijo = -1
Dim CveProveedor = -1 Dim CveProveedor = -1
Dim CveCreditoPrePoliza = -1 Dim CveCreditoPrePoliza = -1
If CvePrePoliza > 0 Then
importeMovimiento = TxtVehiculoValor.Text.ToDecimal - TxtVehiculoAnticipo.Text.todecimal 'importe financiado
Concepto = $"Crédito: {TxtReferencia.Text}"
Dim Pago As New CompraPago
Pago.Fecha = Now
Pago.CveIE = CveIE
If CvePrePoliza > 0 Then Dim ObjCompra As New ClsCompras
For Each Row As DataRow In DtPlantilla.Rows
ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
IdCtaContable = 0
importeMovimiento = 0
Concepto = $"Crédito: {TxtReferencia.Text}"
CveActivoFijo = -1
CveProveedor = -1
CveCreditoPrePoliza = -1
Select Case ConceptoContable If ObjCompra.GetCompras(DdlCompras.SelectedValue.ToEntero, "-1", "-1", -1, -1, UsuarioActual.CveEmpresa) Then
Case 50 Dim dr As DataRow = ObjCompra.DtResultados.FiltroPrimero("")
importeMovimiento = ImporteDocXPagar Dim CompraActual As New Compra
IdCtaContable = DdlCtaContable.SelectedValue.ToEntero CompraActual.CveCompra = dr("CveCompra").ToString.ToEntero
CveCreditoPrePoliza = CveCredito CompraActual.CveTipoConceptoProveedor = dr("CveTipoConcepto").ToString.ToEntero
CveProveedor = DdlProveedores.SelectedValue.ToEntero CompraActual.CveProveedor = dr("CveProveedor").ToString.ToEntero
Case 42 CompraActual.CveMoneda = dr("CveMoneda").ToString.ToEntero
importeMovimiento = ImporteDocXPagar CompraActual.Fecha = dr("Fecha").ToString.ToDate
If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, DdlAcreedorPrePoliza.SelectedValue.ToEntero, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) AndAlso ObjProveedor.DtResultados.Rows.Count > 0 Then CompraActual.SerieFolio = dr("SerieFolio").ToString
IdCtaContable = ObjProveedor.IdCtaContAcreedor CompraActual.ProveedorNombre = dr("RazonSocial").ToString
CveProveedor = ObjProveedor.CveProveedor CompraActual.TC = dr("TipoCambioOriginal").ToString.ToDecimal
End If CompraActual.Total = dr("Total").ToString.ToDecimal
End Select CompraActual.IVA = dr("IVA").ToString.ToDecimal
If importeMovimiento <> 0 Then CompraActual.IVADeducible = dr("IVADeducible").ToString.ToDecimal
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, ImporteMX:=importeMovimiento, CveProveedor:=CveProveedor, CveCredito:=CveCreditoPrePoliza) Then CompraActual.IVANoDeducible = dr("IVANoDeducible").ToString.ToDecimal
ErrorPrePoliza = True CompraActual.CompraNoDeducible = dr("NoDeducible").ToString.ToEntero
End If CompraActual.IEPS = dr("IEPS").ToString.ToDecimal
CompraActual.RetIVA = dr("RetIVA").ToString.ToDecimal
CompraActual.RetISR = dr("RetISR").ToString.ToDecimal
CompraActual.CveConceptoRetISR = dr("CveRetISRConcepto").ToString.ToEntero
CompraActual.CveConceptoRetIVA = dr("CveRetIVAConcepto").ToString.ToEntero
CompraActual.PorcentajeIVA = dr("PorcentajeIVA").ToString.ToDecimal
CompraActual.EsImportacion = dr("EsImportacion").ToString = "1"
CompraActual.UsuarioActual = UsuarioActual
CompraActual.CveSubProyecto = dr("CveSubProyecto").ToString.ToEntero
Pago.CveMonedaPago = CompraActual.CveMoneda
Pago.ImportePago = importeMovimiento
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjContabilidad) Then
MsgError = "No se pudo insertar la póliza"
ErrorPrePoliza = True
End If
If Not ErrorPrePoliza Then
If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Referencia, 50, Concepto, FechaMovimiento, IdCtaContable, -1, ImporteMX:=importeMovimiento, CveProveedor:=CveProveedor, CveCredito:=CveCreditoPrePoliza) Then
MsgError = "No se pudo insertar la póliza"
ErrorPrePoliza = True
End If End If
Next End If
Else
ErrorPrePoliza = True
End If End If
'For Each Row As DataRow In DtPlantilla.Rows
' ConceptoContable = Row("CveConcepto").ToString.ToEntero
' TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
' IdCtaContable = 0
' importeMovimiento = 0
' CveActivoFijo = -1
' CveProveedor = -1
' CveCreditoPrePoliza = -1
' Select Case ConceptoContable
' Case 50
' importeMovimiento = ImporteDocXPagar
' IdCtaContable = DdlCtaContable.SelectedValue.ToEntero
' CveCreditoPrePoliza = CveCredito
' CveProveedor = DdlProveedores.SelectedValue.ToEntero
' Case 42
' importeMovimiento = ImporteDocXPagar
' If ObjProveedor.GetProveedores(ClsCompProveedores.TipoConsulta.ParaUsoEnEmpresa, DdlAcreedorPrePoliza.SelectedValue.ToEntero, "-1", "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa) AndAlso ObjProveedor.DtResultados.Rows.Count > 0 Then
' IdCtaContable = ObjProveedor.IdCtaContAcreedor
' CveProveedor = ObjProveedor.CveProveedor
' End If
' End Select
' If importeMovimiento <> 0 Then
' If Not ObjContabilidad.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, ImporteMX:=importeMovimiento, CveProveedor:=CveProveedor, CveCredito:=CveCreditoPrePoliza) Then
' ErrorPrePoliza = True
' End If
' End If
'Next
Else Else
ErrorPrePoliza = True MsgError = "No se registró la prepóliza"
End If End If
If Not ErrorPrePoliza Then If Not ErrorPrePoliza Then
If Not ObjBancos.UpdateCreditosPrePoliza(CveCredito, CvePrePoliza) Then If Not ObjBancos.UpdateCreditosPrePoliza(CveCredito, CvePrePoliza) Then
MsgError = "."
ErrorPrePoliza = True ErrorPrePoliza = True
End If End If
End If End If
@@ -1644,6 +1692,22 @@ Partial Class Bancos_Creditos
End If End If
End Sub End Sub
Private Sub DdlAcreedorPrePoliza_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlAcreedorPrePoliza.SelectedIndexChanged
If DdlAcreedorPrePoliza.SelectedValue.ToEntero > 0 Then
Dim ObjCompras As New ClsCompras
DdlCompras.ClearSelection()
If ObjCompras.GetCompras(-1, "-1", "-1", DdlAcreedorPrePoliza.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa) Then
DdlCompras.DataSource = ObjCompras.DtResultados.FiltraParametros("Saldo > 0")
Else
DdlCompras.DataSource = Nothing
End If
ObjCompras.Dispose()
DdlCompras.DataBind()
DdlCompras.Items.Insert(0, New ListItem(" - ", "-1"))
End If
End Sub
#End Region #End Region

View File

@@ -638,7 +638,7 @@ Partial Class Bancos_FluctuacionCambiaria
Next Next
If Not ErrorRegistrar AndAlso Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then If Not ErrorRegistrar AndAlso Not Banco.UpdateFluctuacionesBitacoraPrePoliza(CvePrePoliza, 3, HdnCveFluctuacionBitacora.Value.ToEntero, UsuarioActual.CveEmpresa) Then
ErrorRegistrar = True ErrorRegistrar = True
End If End If
If Not ErrorRegistrar AndAlso Not Conta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then If Not ErrorRegistrar AndAlso Not Conta.ValidacionesPrePoliza(CvePrePoliza, UsuarioActual) Then

View File

@@ -1072,7 +1072,7 @@ Partial Class Bancos_IE
End If End If
End If End If
If UsuarioActual.TienePermisoProceso(85) Then LnkCancelar.Visible = True If UsuarioActual.TienePermisoProceso(85) AndAlso Not ObjIE.FueConciliado Then LnkCancelar.Visible = True
''COMENTAR - solo para pruebas ''COMENTAR - solo para pruebas
'If UsuarioActual.TienePermisoProceso(85) Then LnkCancelar.Visible = True 'If UsuarioActual.TienePermisoProceso(85) Then LnkCancelar.Visible = True

View File

@@ -76,6 +76,7 @@
<asp:CheckBox Text="Pagar con pesos" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarPesos" OnCheckedChanged="ChkPagarPesos_CheckedChanged" runat="server" ClientIDMode="Static" /> <asp:CheckBox Text="Pagar con pesos" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarPesos" OnCheckedChanged="ChkPagarPesos_CheckedChanged" runat="server" ClientIDMode="Static" />
<asp:CheckBox Text="Pagar con dolares" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarDolares" OnCheckedChanged="ChkPagarDolares_CheckedChanged" runat="server" ClientIDMode="Static" /> <asp:CheckBox Text="Pagar con dolares" TextAlign="Right" Visible="false" AutoPostBack="true" ID="ChkPagarDolares" OnCheckedChanged="ChkPagarDolares_CheckedChanged" runat="server" ClientIDMode="Static" />
</div> </div>
</div> </div>
<asp:Panel ID="PanelBancos" runat="server" Visible="true"> <asp:Panel ID="PanelBancos" runat="server" Visible="true">
@@ -138,16 +139,7 @@
<asp:TextBox ID="TxtPagueseA" runat="server" MaxLength="70" Width="100%"></asp:TextBox>&nbsp;<asp:Image ID="ImgBuscaProv" runat="server" Visible="false" ImageUrl="/Imagenes/buscar.gif" onclick="_loadJavaScript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact',800,600,'popBuscarProv');" Width="16px" Style="cursor: pointer;" alt="Buscar" /> <asp:TextBox ID="TxtPagueseA" runat="server" MaxLength="70" Width="100%"></asp:TextBox>&nbsp;<asp:Image ID="ImgBuscaProv" runat="server" Visible="false" ImageUrl="/Imagenes/buscar.gif" onclick="_loadJavaScript:AbrirVentana('/Ventas/PopUpBuscarClientes.aspx?Opt=Fact',800,600,'popBuscarProv');" Width="16px" Style="cursor: pointer;" alt="Buscar" />
</div> </div>
</div> </div>
<div class="row" runat="server" id="rowComisiones" visible="false">
<label class="col-xs-4" runat="server" id="lblpagocomisiones">Comisiones:</label>
<div class="col-xs-8">
<asp:DropDownList ID="DdlOtrosPagos" CssClass="form-control input-sm select2me" runat="server" AutoPostBack="true" Width="100%">
<asp:ListItem Value="-1">-</asp:ListItem>
<asp:ListItem Value="2">Otros Ingresos</asp:ListItem>
</asp:DropDownList>
</div>
</div>
<asp:UpdatePanel ID="UpCuentaDeposito" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpCuentaDeposito" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
@@ -510,8 +502,11 @@
<div class="caption font-green"> <div class="caption font-green">
<i class="icon-pin font-green"></i> <i class="icon-pin font-green"></i>
<span class="caption-subject bold uppercase">Importes</span> <span class="caption-subject bold uppercase">Importes</span>
</div> </div>
<div class="col-xs-6" runat="server" id="rowComisiones" visible="false">
<asp:CheckBox ID="ChkComisiones" runat="server" Text="Comisiones" TextAlign="Right" AutoPostBack="true" />
</div>
<div class="actions"> <div class="actions">
<div class="btn-group"> <div class="btn-group">
</div> </div>

View File

@@ -430,7 +430,7 @@ Partial Class Bancos_PopIECompras
CargaCompra(CveCompra) CargaCompra(CveCompra)
End If End If
If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 72, 80) Then If UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 72, 80, 122, 140, 141, 145) Then
rowComisiones.Visible = True rowComisiones.Visible = True
End If End If
@@ -1032,14 +1032,21 @@ Partial Class Bancos_PopIECompras
End If End If
End Sub End Sub
Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged 'Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged
Dim EsOtrosEgresos As Boolean = (DdlOtrosPagos.SelectedValue.Equals("2")) ' Dim EsOtrosEgresos As Boolean = (DdlOtrosPagos.SelectedValue.Equals("2"))
' rowComision.Visible = EsOtrosEgresos
' rowTotal.Visible = EsOtrosEgresos
' TxtComision.Text = "0.00"
' TxtTotal.Text = TxtImporte.Text
'End Sub
Private Sub ChkComisiones_CheckedChanged(sender As Object, e As EventArgs) Handles ChkComisiones.CheckedChanged
Dim EsOtrosEgresos As Boolean = ChkComisiones.Checked
rowComision.Visible = EsOtrosEgresos rowComision.Visible = EsOtrosEgresos
rowTotal.Visible = EsOtrosEgresos rowTotal.Visible = EsOtrosEgresos
TxtComision.Text = "0.00" TxtComision.Text = "0.00"
TxtTotal.Text = TxtImporte.Text TxtTotal.Text = TxtImporte.Text
End Sub End Sub
Protected Sub DdlFuncionarioEmpleado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFuncionarioEmpleado.SelectedIndexChanged Protected Sub DdlFuncionarioEmpleado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFuncionarioEmpleado.SelectedIndexChanged
ArrIEFuncionariosEmpleados = New ArrayList() ArrIEFuncionariosEmpleados = New ArrayList()
ArrIE = New ArrayList() ArrIE = New ArrayList()
@@ -1399,7 +1406,12 @@ Partial Class Bancos_PopIECompras
Dim Pago As New CompraPago Dim Pago As New CompraPago
Pago.Fecha = TxtFechaDocumento.Text.ToDate Pago.Fecha = TxtFechaDocumento.Text.ToDate
Pago.CveMonedaPago = CveMoneda Pago.CveMonedaPago = CveMoneda
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL If ChkComisiones.Checked Then
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL - TxtComision.Text.ToDecimal
Else
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL
End If
'Tipos de cambio 'Tipos de cambio
If Pago.CveMonedaPago = 1 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos If Pago.CveMonedaPago = 1 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en Pesos
Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
@@ -1416,7 +1428,8 @@ Partial Class Bancos_PopIECompras
Select Case RBLContado.SelectedValue Select Case RBLContado.SelectedValue
Case "1" ' Bancos Case "1" ' Bancos
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImportePagado, CveMoneda, 15.55, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1")) Dim ImporteBancos As Decimal = TxtImporte.Text.ToDecimal
CveIE = ObjIE.AddBancos_IE(DdlCuenta.SelectedValue.ToEntero, DdlTipoTransaccion.SelectedValue.ToEntero, Fecha, TxtFolio.Text.Trim, TxtPagueseA.Text.Trim, ImporteBancos, CveMoneda, 11, TxtObservaciones.Text.Trim, "", True, True, -1, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCuentaTarjeta:=If(DivTarjeta.Visible, DdlTarjeta.SelectedValue.ToEntero, -1), CveCuentaDeposito:=CveCuentaDeposito, Referencia:=If(TxtReferenciaCIE.Visible, TxtReferenciaCIE.Text, "-1"), ConceptoCIE:=If(TxtConceptoCIE.Text.Trim.Length > 0, TxtConceptoCIE.Text, "-1"))
If Not CveIE > 0 Then If Not CveIE > 0 Then
MsgError = "Ocurrio un Error al registrarse el movimiento bancario." MsgError = "Ocurrio un Error al registrarse el movimiento bancario."
End If End If
@@ -1433,7 +1446,7 @@ Partial Class Bancos_PopIECompras
Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83) Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83)
Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}" Dim ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}"
Dim Referencia As String = TxtFolio.Text.Trim Dim Referencia As String = TxtFolio.Text.Trim
Dim tImporteMN As Decimal = ImportePagado Dim tImporteMN As Decimal = ImporteBancos
Pago.ImportePago = tImporteMN Pago.ImportePago = tImporteMN
If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then
@@ -1546,7 +1559,7 @@ Partial Class Bancos_PopIECompras
Alert("Debe especificar el Acreedor.", TipoMensaje.MsgAdvertencia) Alert("Debe especificar el Acreedor.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim Aplicopagocomision As Boolean = False
For Each rw As GridViewRow In GvAcreedores.Rows For Each rw As GridViewRow In GvAcreedores.Rows
If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then
Dim TCC As Decimal = 1 Dim TCC As Decimal = 1
@@ -1559,6 +1572,14 @@ Partial Class Bancos_PopIECompras
Pago.TCPago = If(Pago.CveMonedaPago <> 1, TxtTipoCambio.Text.ToDecimal, 1) Pago.TCPago = If(Pago.CveMonedaPago <> 1, TxtTipoCambio.Text.ToDecimal, 1)
Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero
Pago.TipoPago = "Egsc" Pago.TipoPago = "Egsc"
If TxtComision.Text.ToDecimal <> 0 AndAlso Aplicopagocomision = False Then
Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal
Aplicopagocomision = True 'solo debe de aplicarse una vez, de manera general
Else
Pago.OtroGastoIngreso = 0
End If
If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then If AplicaPrePolizaPagoCompra(CompraActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza" MsgError = "No se pudo insertar la póliza"
Else Else
@@ -1622,7 +1643,7 @@ Partial Class Bancos_PopIECompras
StrMsg.Append("El Documento se guardó correctamente.<br/>") StrMsg.Append("El Documento se guardó correctamente.<br/>")
If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa) If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa)
If UsuarioActual.Empresa.TipoContabilidad = 1 Then If UsuarioActual.Empresa.TipoContabilidad = 1 Then
StrMsg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza) StrMsg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
Else Else
If IdPoliza > 0 Then If IdPoliza > 0 Then
StrMsg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza) StrMsg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
@@ -1818,7 +1839,13 @@ Partial Class Bancos_PopIECompras
Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs) Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs)
Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace("MXN", "").Replace(",", "").ToDecimal Dim Saldo As Decimal = LtlSaldo.Text.Replace("USD", "").Replace("MXN", "").Replace(",", "").ToDecimal
Dim ImportePagado As Decimal = TxtImporte.Text.ToDecimal Dim ImportePagado As Decimal = 0
If ChkComisiones.Checked Then
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL - TxtComision.Text.ToDecimal
Else
ImportePagado = TxtImporte.Text.Trim.ToDecimal.RoundSQL
End If
If ChkPagarPesos.Checked Then If ChkPagarPesos.Checked Then

View File

@@ -3769,7 +3769,7 @@ Partial Class Sistemas_UsuarioDetalle
#Region " CLONAR USUARIO " #Region " CLONAR USUARIO "
Private Sub InicializaClonarUsuario() Private Sub InicializaClonarUsuario()
DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", DistinctColumns:={"CveUsuario", "Usuario"})
DdlUsuarioClonar.DataBind() DdlUsuarioClonar.DataBind()
DdlUsuarioClonar.Items.Insert(0, New ListItem("Seleccione", "-1")) DdlUsuarioClonar.Items.Insert(0, New ListItem("Seleccione", "-1"))

View File

@@ -209,7 +209,7 @@ public partial class Ventas_RepNCxAplicar : ClsPaginas
} }
string TextAdicionalJAM = Gv.DataKey("Fecha").ToDate().Year <= 2017 && UsuarioActual.CveEmpresa == 119 ? "Anticipo 2017" : ""; string TextAdicionalJAM = Gv.DataKey("Fecha").ToDate().Year <= 2017 && UsuarioActual.CveEmpresa == 119 ? "Anticipo 2017" : "";
string ConceptoPartida = string.Format("{0} {1} ", TxtConcepto.Text, Gv.DataKey("Folio").ToString()); string ConceptoPartida = string.Format("{0} {1} ", TxtConcepto.Text, Gv.DataKey("Folio").ToString());
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 11, Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("CveMoneda").ToEntero(), TxtFecha.Text.ToDate(), $"{TextAdicionalJAM} {TxtConcepto.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa); CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 11, Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("CveMoneda").ToEntero(), TxtFecha.Text.ToDate(), $"{TextAdicionalJAM} {TxtConcepto.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza: 3);
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, -Gv.DataKey("Saldo").ToDecimal(), Gv.DataKey("Folio").ToString(), 12, TxtConcepto.Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, -1, Gv.DataKey("CveVenta").ToEntero(), CveCliente: Gv.DataKey("CveCliente").ToEntero(), ImporteMX: -Gv.DataKey("Saldo").ToDecimal())) if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, -Gv.DataKey("Saldo").ToDecimal(), Gv.DataKey("Folio").ToString(), 12, TxtConcepto.Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, -1, Gv.DataKey("CveVenta").ToEntero(), CveCliente: Gv.DataKey("CveCliente").ToEntero(), ImporteMX: -Gv.DataKey("Saldo").ToDecimal()))
{ {