diff --git a/App_Code/ClsBancos.vb b/App_Code/ClsBancos.vb index b662d915d..93ebfc00b 100644 --- a/App_Code/ClsBancos.vb +++ b/App_Code/ClsBancos.vb @@ -4217,12 +4217,15 @@ Public Class ClsBancos #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 DataAdapter("PA_Banc_ConciliacionBancariaUpdate") With SqlAdapter.SelectCommand.Parameters .Add("@CveIE", SqlDbType.Int).Value = CveIE .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 End With Try diff --git a/Bancos/ConciliacionesBancarias.aspx.vb b/Bancos/ConciliacionesBancarias.aspx.vb index 2cdc55b14..20ba7ac10 100644 --- a/Bancos/ConciliacionesBancarias.aspx.vb +++ b/Bancos/ConciliacionesBancarias.aspx.vb @@ -178,8 +178,8 @@ Partial Class Bancos_ConciliacionesBancariasaspx If Not CBool(Dr("FueConciliado").ToString) And Dr("CveIE").ToString.ToEntero > 0 Then 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 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, - DrE("Referencia").ToString, DrE("Tipo").ToString, DrE("FechaDocumento").ToString.ToDate, DrE("CveCuenta").ToString.ToEntero) Then + 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 + 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 Else 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 For Each Gvr As GridViewRow In GvDatos.Rows 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 Else 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 If Gvr.FCCheckBox("ChkConciliado").Checked And Gvr.FCCheckBox("ChkConciliado").Enabled Then 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 Else If Not ObjOI.AddEventoBitacora("El pago ha sido conciliado", "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveIE:=Gvr.DataKey("CveIE").ToEntero) Then diff --git a/Bancos/Creditos.aspx b/Bancos/Creditos.aspx index 9811be61a..1b6d54886 100644 --- a/Bancos/Creditos.aspx +++ b/Bancos/Creditos.aspx @@ -1297,13 +1297,23 @@
Acreedor:
- +
+
+
Compra:
+
+ + + + + +
+
+ @@ -138,16 +139,7 @@   - -
- -
- - - - Otros Ingresos - -
-
+ @@ -510,8 +502,11 @@
Importes - +
+
+ +
diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 835763b90..9749730e3 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -430,7 +430,7 @@ Partial Class Bancos_PopIECompras CargaCompra(CveCompra) 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 End If @@ -1032,14 +1032,21 @@ Partial Class Bancos_PopIECompras End If End Sub - Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged - Dim EsOtrosEgresos As Boolean = (DdlOtrosPagos.SelectedValue.Equals("2")) + 'Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged + ' 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 rowTotal.Visible = EsOtrosEgresos TxtComision.Text = "0.00" - TxtTotal.Text = TxtImporte.Text + TxtTotal.Text = TxtImporte.Text End Sub - Protected Sub DdlFuncionarioEmpleado_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlFuncionarioEmpleado.SelectedIndexChanged ArrIEFuncionariosEmpleados = New ArrayList() ArrIE = New ArrayList() @@ -1399,7 +1406,12 @@ Partial Class Bancos_PopIECompras Dim Pago As New CompraPago Pago.Fecha = TxtFechaDocumento.Text.ToDate 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 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 @@ -1416,7 +1428,8 @@ Partial Class Bancos_PopIECompras Select Case RBLContado.SelectedValue 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 MsgError = "Ocurrio un Error al registrarse el movimiento bancario." 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 ConceptoMovimiento As String = $"{TxtPagueseA.Text.Trim} - {TxtObservaciones.Text} {If(Pago.TCPago > 1, $" TC:{Pago.TCPago}", "")}" Dim Referencia As String = TxtFolio.Text.Trim - Dim tImporteMN As Decimal = ImportePagado + Dim tImporteMN As Decimal = ImporteBancos Pago.ImportePago = tImporteMN If DivTarjeta.Visible AndAlso DdlTarjeta.SelectedValue.ToEntero > 0 Then @@ -1546,7 +1559,7 @@ Partial Class Bancos_PopIECompras Alert("Debe especificar el Acreedor.", TipoMensaje.MsgAdvertencia) Exit Sub End If - + Dim Aplicopagocomision As Boolean = False For Each rw As GridViewRow In GvAcreedores.Rows If rw.FCCheckBox("Chk").Checked AndAlso rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal <> 0 Then Dim TCC As Decimal = 1 @@ -1559,6 +1572,14 @@ Partial Class Bancos_PopIECompras Pago.TCPago = If(Pago.CveMonedaPago <> 1, TxtTipoCambio.Text.ToDecimal, 1) Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero 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 MsgError = "No se pudo insertar la póliza" Else @@ -1622,7 +1643,7 @@ Partial Class Bancos_PopIECompras StrMsg.Append("El Documento se guardó correctamente.
") If TipoTransaccion = "Egs" AndAlso CveIE > 0 Then GeneraChequePDF(CveIE, UsuarioActual.Empresa) If UsuarioActual.Empresa.TipoContabilidad = 1 Then - StrMsg.AppendFormat("

Ver Póliza", CvePrePoliza) + StrMsg.AppendFormat("
Ver Póliza", CvePrePoliza) Else If IdPoliza > 0 Then StrMsg.AppendFormat("

Ver Póliza", IdPoliza) @@ -1818,7 +1839,13 @@ Partial Class Bancos_PopIECompras Protected Sub CVTxtImporte_ServerValidate(source As Object, args As ServerValidateEventArgs) 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 diff --git a/Sistemas/UsuarioDetalle.aspx.vb b/Sistemas/UsuarioDetalle.aspx.vb index 663ea64a8..ce4094a74 100644 --- a/Sistemas/UsuarioDetalle.aspx.vb +++ b/Sistemas/UsuarioDetalle.aspx.vb @@ -3769,7 +3769,7 @@ Partial Class Sistemas_UsuarioDetalle #Region " CLONAR USUARIO " Private Sub InicializaClonarUsuario() - DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa) + DdlUsuarioClonar.DataSource = GlobalDTUsuarios(-1, UsuarioActual.CveEmpresa).FiltraParametros("", DistinctColumns:={"CveUsuario", "Usuario"}) DdlUsuarioClonar.DataBind() DdlUsuarioClonar.Items.Insert(0, New ListItem("Seleccione", "-1")) diff --git a/Ventas/RepNCxAplicar.aspx.cs b/Ventas/RepNCxAplicar.aspx.cs index 81c7c8dcd..a31e3accf 100644 --- a/Ventas/RepNCxAplicar.aspx.cs +++ b/Ventas/RepNCxAplicar.aspx.cs @@ -209,7 +209,7 @@ public partial class Ventas_RepNCxAplicar : ClsPaginas } 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()); - 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())) {