-- cambios en pago a tdc
This commit is contained in:
@@ -53,10 +53,10 @@
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr id="TrCuentaDestino" runat="server">
|
||||
<td>Cuenta Destino:</td>
|
||||
<td>
|
||||
<asp:DropDownList ID="DdlCuentaDestino" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" AutoPostBack="True" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="400px" ValidationGroup="GrpGuardar">
|
||||
<asp:DropDownList ID="DdlCuentaDestino" runat="server" CssClass="form-control input-sm select2me" AppendDataBoundItems="true" DataTextField="NumCuentaMoneda" DataValueField="CveCuenta" Width="400px" ValidationGroup="GrpGuardar">
|
||||
</asp:DropDownList>
|
||||
<asp:RequiredFieldValidator ID="RFVCuentaDestino" runat="server" ControlToValidate="DdlCuentaDestino" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Cuenta Destino''</b> es necesario, por favor seleccione uno." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOCuentaDestino" runat="server" HighlightCssClass="vco" TargetControlID="RFVCuentaDestino" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||
@@ -182,7 +182,7 @@
|
||||
<asp:UpdatePanel ID="UpGvTC" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvTC" runat="server" DataKeyNames="CveCuenta" AutoGenerateColumns="False" EmptyDataText="No hay tarjetas vinculadas" ToolTip="Tarjetas de Credito" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<asp:GridView ID="GvTC" runat="server" Visible="false" DataKeyNames="CveCuenta" AutoGenerateColumns="False" EmptyDataText="No hay tarjetas vinculadas" ToolTip="Tarjetas de Credito" CssClass="table table-striped table-advance table-hover Widthall" GridLines="None">
|
||||
<Columns>
|
||||
<%-- <asp:BoundField DataField="CLABE" HeaderText="CLABE" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
|
||||
@@ -60,12 +60,13 @@ Partial Class Bancos_Transferencias
|
||||
If Opcion = 1 Then
|
||||
LtlTitulo.Text = "Domicializaci<EFBFBD>n de tarjeta"
|
||||
RBLOpcion.Visible = True
|
||||
TrCuentaOrigen.Visible = False
|
||||
TrCuentaDestino.Visible = False
|
||||
chkMovimientoTarjeta.Checked = True
|
||||
chkMovimientoTarjeta.Enabled = False
|
||||
CargaCuenta(-1, DdlCuentaOrigen)
|
||||
chkMovimientoTarjeta_CheckedChanged(Nothing, Nothing)
|
||||
CargaCuenta(-1, DdlCuentaDestino)
|
||||
CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
|
||||
'CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
Else
|
||||
CargaCuenta(-1, DdlCuentaOrigen)
|
||||
CargaCuenta(DdlCuentaOrigen.SelectedValue.ToEntero, DdlCuentaDestino)
|
||||
@@ -89,7 +90,7 @@ Partial Class Bancos_Transferencias
|
||||
End If
|
||||
Ddl.DataBind()
|
||||
|
||||
DdlCuentaDestino_SelectedIndexChanged(Nothing, Nothing)
|
||||
'DdlCuentaDestino_SelectedIndexChanged(Nothing, Nothing)
|
||||
|
||||
If CveCuenta > 0 Then VerificaMonedas()
|
||||
|
||||
@@ -155,43 +156,41 @@ Partial Class Bancos_Transferencias
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlCuentaDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDestino.SelectedIndexChanged
|
||||
'Protected Sub DdlCuentaDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDestino.SelectedIndexChanged
|
||||
|
||||
VerificaMonedas()
|
||||
' VerificaMonedas()
|
||||
|
||||
If Opcion = 1 Then
|
||||
CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
End If
|
||||
' If Opcion = 1 Then
|
||||
' CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
' End If
|
||||
|
||||
If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then
|
||||
CargaGridTarjetas()
|
||||
Else
|
||||
GvTC.Visible = False
|
||||
End If
|
||||
' If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then
|
||||
' CargaGridTarjetas()
|
||||
' Else
|
||||
' GvTC.Visible = False
|
||||
' End If
|
||||
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
Private Sub CargaGridTarjetas()
|
||||
Dim ObjCreditos As New ClsBancos
|
||||
If ObjCreditos.GetTarjetasCreditos(DdlCuentaOrigen.SelectedValue.ToEntero) Then
|
||||
If ObjCreditos.DtResultados.Rows.Count > 0 Then
|
||||
GvTC.DataSource = ObjCreditos.DtResultados
|
||||
GvTC.Visible = True
|
||||
End If
|
||||
|
||||
GvTC.DataBind()
|
||||
UpGvTC.Update()
|
||||
|
||||
GvTC.Visible = True
|
||||
End If
|
||||
ObjCreditos.Dispose()
|
||||
GvTC.DataBind()
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
|
||||
|
||||
'VALIDACIONES
|
||||
Dim SumaImportesTarjeta As Decimal = 0D
|
||||
If GvTC.Visible Then
|
||||
If GvTC.Visible AndAlso GvTC.Rows.Count > 0 Then
|
||||
For Each row As GridViewRow In GvTC.Rows
|
||||
SumaImportesTarjeta += row.FCTextBox("TxtAbono").Text.ToDecimal
|
||||
Next
|
||||
@@ -202,8 +201,8 @@ Partial Class Bancos_Transferencias
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlCuentaDestino.SelectedValue = "" Then
|
||||
Alert("Seleccione cuenta destino", TipoMensaje.MsgAdvertencia)
|
||||
If DdlCuentaOrigen.SelectedValue = "" Then
|
||||
Alert("Seleccione cuenta origen", TipoMensaje.MsgAdvertencia)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -225,8 +224,7 @@ Partial Class Bancos_Transferencias
|
||||
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||
'Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
|
||||
Dim TipoCambio As Double = If(TxtTipoCambio.Visible, TxtTipoCambio.Text.ToDecimal, 0)
|
||||
Dim TipoCambio As Double = If(TxtTipoCambio.Visible, TxtTipoCambio.Text.ToDecimal, 1)
|
||||
Dim CveMonedaOrigen, CveMonedaDestino As Integer
|
||||
Dim FolioOrigen As String = TxtFolio.Text.Trim
|
||||
Dim FolioDestino As String = GetFolio(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3))
|
||||
@@ -246,15 +244,14 @@ Partial Class Bancos_Transferencias
|
||||
filemove = fileItem.filename
|
||||
Next
|
||||
|
||||
|
||||
dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue))
|
||||
If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero
|
||||
dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue))
|
||||
If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero
|
||||
|
||||
If Opcion = -1 Then
|
||||
dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue))
|
||||
If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero
|
||||
dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue))
|
||||
If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero
|
||||
Else
|
||||
CveMonedaOrigen = CveMonedaDestino
|
||||
CveMonedaDestino = CveMonedaOrigen
|
||||
End If
|
||||
|
||||
If CveMonedaOrigen = 1 AndAlso CveMonedaDestino <> 1 Then
|
||||
@@ -275,21 +272,18 @@ Partial Class Bancos_Transferencias
|
||||
If CveMonedaOrigen = 2 AndAlso CveMonedaDestino = 2 Then
|
||||
TipoCambio = TxtTipoCambio.Text.ToDouble 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate)
|
||||
End If
|
||||
|
||||
|
||||
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/Transferencias", 13, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TxtFechaDocumento.Text.ToDate, $"Transferencia entre cuentas {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
|
||||
If UsuarioActual.CveEmpresa = 48 Then
|
||||
CuentaDestino = "Alumbrado publico de Hermosillo S.A de C.V"
|
||||
Observaciones = String.Format("{0} {1}", DdlCuentaDestino.SelectedItem.Text, TxtObservaciones.Text.Trim)
|
||||
Else
|
||||
CuentaDestino = String.Format("Transferencia Cta: {0}", DdlCuentaDestino.SelectedItem.Text)
|
||||
CuentaDestino = String.Format("Transferencia Cta: {0}", If(DdlCuentaDestino.SelectedItem IsNot Nothing, DdlCuentaDestino.SelectedItem.Text, ""))
|
||||
Observaciones = TxtObservaciones.Text.Trim
|
||||
End If
|
||||
|
||||
|
||||
If Opcion = 1 Then 'ESTO ES TRANSFERENCIA ENTRE
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||
CveIEDestino = CveIE
|
||||
Else
|
||||
|
||||
@@ -325,11 +319,6 @@ Partial Class Bancos_Transferencias
|
||||
If MsgError = "" Then
|
||||
|
||||
If CvePrePoliza > 0 Then
|
||||
|
||||
Dim alertaContabilizacion As String = "Se envi<76> correctamente la siguiente p<>liza:<br><br>"
|
||||
Dim CuentasContablesInvalidas As New StringBuilder
|
||||
Dim RowCuentaOrigen As DataRow = Nothing
|
||||
|
||||
Dim TipoMovtoDetalle As Boolean = True
|
||||
If RBLOpcion.SelectedValue = "2" Then TipoMovtoDetalle = False ' cuando sea un reembolso/devoluci<63>n, es ingreso a bancos
|
||||
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
|
||||
@@ -360,7 +349,7 @@ Partial Class Bancos_Transferencias
|
||||
For Each row As GridViewRow In GvTC.Rows
|
||||
|
||||
If row.FCTextBox("TxtAbono").Text.ToDecimal > 0 Then
|
||||
FolioDestino = GetFolio(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TransaccioSQL:=ObjIE.IniciaTransacSQL())
|
||||
FolioDestino = GetFolio(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TransaccionSQL:=ObjIE.IniciaTransacSQL())
|
||||
|
||||
If FolioDestino.Trim.Length = 0 Then
|
||||
MsgError = "Ocurrio un error al obtener el folio destino."
|
||||
@@ -414,18 +403,14 @@ Partial Class Bancos_Transferencias
|
||||
End If
|
||||
|
||||
If MsgError = "" Then
|
||||
|
||||
If CveIE > 0 Then
|
||||
AlertaGlobal.AppendFormat("<br/><br/>Movimiento: <a class=""Texto"" target='_blank' href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", CveIE, FolioOrigen)
|
||||
End If
|
||||
If CveIEDestino > 0 AndAlso CveIE <> CveIEDestino Then
|
||||
|
||||
If Not chkMovimientoTarjeta.Checked Then
|
||||
AlertaGlobal.AppendFormat("<br/><br/>Recepci<63>n: <a class=""Texto"" target='_blank' href=""/Bancos/IE.aspx?CveIE={0}"">{1}</a>", CveIEDestino, FolioDestino)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
MsgError = "no se pudo insertar el detalle de la p<>liza2"
|
||||
End If
|
||||
Else
|
||||
MsgError = "no se pudo insertar el detalle de la p<>liza"
|
||||
@@ -455,10 +440,7 @@ Partial Class Bancos_Transferencias
|
||||
CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
TxtImporte.Text = ""
|
||||
TxtObservaciones.Text = ""
|
||||
|
||||
GeneraChequePDF(CveIEDestino, UsuarioActual.Empresa)
|
||||
|
||||
|
||||
'GeneraChequePDF(CveIEDestino, UsuarioActual.Empresa)
|
||||
Else
|
||||
ObjIE.RollBack()
|
||||
Alert(MsgError)
|
||||
@@ -466,7 +448,7 @@ Partial Class Bancos_Transferencias
|
||||
|
||||
ObjIE.Dispose()
|
||||
ObjMov.Dispose()
|
||||
'If ObjComp IsNot Nothing Then ObjComp.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub EnviaCorreo(Comprobante As String)
|
||||
@@ -592,24 +574,21 @@ Partial Class Bancos_Transferencias
|
||||
TxtFolio.Text = GetFolio(CveCuenta, CveTipoTransaccion)
|
||||
End Sub
|
||||
|
||||
Private Function GetFolio(CveCuenta As Integer, CveTipoTransaccion As Integer, Optional ByRef TransaccioSQL As SqlTransaction = Nothing) As String
|
||||
Private Function GetFolio(CveCuenta As Integer, CveTipoTransaccion As Integer, Optional ByRef TransaccionSQL As SqlTransaction = Nothing) As String
|
||||
|
||||
Dim Folio As String
|
||||
Dim Banco As ClsBancos
|
||||
|
||||
If TransaccioSQL Is Nothing Then
|
||||
If TransaccionSQL Is Nothing Then
|
||||
Banco = New ClsBancos
|
||||
Else
|
||||
Banco = New ClsBancos(TransaccioSQL)
|
||||
Banco = New ClsBancos(TransaccionSQL)
|
||||
End If
|
||||
|
||||
Folio = Banco.GetNextFolio(CveCuenta, CveTipoTransaccion).ToString
|
||||
|
||||
If TransaccioSQL Is Nothing Then
|
||||
If TransaccionSQL Is Nothing Then
|
||||
Banco.Dispose()
|
||||
End If
|
||||
|
||||
|
||||
Return Folio
|
||||
|
||||
End Function
|
||||
@@ -629,18 +608,13 @@ Partial Class Bancos_Transferencias
|
||||
Private Sub DdlTipoMovto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoMovto.SelectedIndexChanged
|
||||
|
||||
RFVTxtPaguese.Visible = False
|
||||
CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
|
||||
If Opcion = 1 Then
|
||||
CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
Else
|
||||
CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
|
||||
|
||||
If Not Opcion = 1 Then
|
||||
If DdlTipoMovto.SelectedValue.ToEntero = 1 And Opcion <> 1 Then 'CHEQUE ACTIVA EL REQUIRED DE TxtPaguese
|
||||
RFVTxtPaguese.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
UPPDatos.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user