IE. que se permitan negativos en ot. ingresos. para permitir exceder el monto del ie.
- clsinventarios, parametro de Serie en kardex -Folios, Serie
This commit is contained in:
@@ -168,7 +168,7 @@ Public Class ClsGralFolios
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
'Alert("Ya existe una Aprobación de Folios con el mismo número: " & Aprobacion & ".", TipoMensaje.MsgAdvertencia)
|
||||
Me.OnError("Ocurrió un error al guardar el folio.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al guardar la nueva Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
@@ -201,9 +201,9 @@ Public Class ClsGralFolios
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
'Alert("Ya existe una Aprobación de Folios con el mismo número: " & Aprobacion & ".", TipoMensaje.MsgAdvertencia)
|
||||
Me.OnError("Ocurrió un error al actualizar los folios..", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al guardar los cambios en la Aprobación de Folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
Me.OnError("Ocurrió un error al actualizar los folios.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar los cambios en la Aprobación de Folios.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
|
||||
@@ -1485,7 +1485,7 @@ Public Class ClsInventarios
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional AgruparAlmacen As Boolean = False) As Boolean
|
||||
Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer, Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1") As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
DataAdapter("PA_Inv_KardexGet")
|
||||
@@ -1502,6 +1502,7 @@ Public Class ClsInventarios
|
||||
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@AgruparAlmacen", SqlDbType.Bit).Value = AgruparAlmacen
|
||||
.Add("@Serie", SqlDbType.VarChar).Value = Serie
|
||||
End With
|
||||
|
||||
Try
|
||||
|
||||
@@ -1547,7 +1547,10 @@
|
||||
|
||||
//VALIDA QUE LA CANTIDAD DE T (TXT) NO SEA MAYOR A C
|
||||
function ValidarCantidad(t, c) {
|
||||
t.value = (ToDouble(t.value) > ToDouble(c) ? c : t.value)
|
||||
var Ot = 0.00;
|
||||
// considera importe de OT ingresos, para que se peuda exceder
|
||||
if ($get('TxtOtrosIngresosEgresos')) { Ot = -ToDouble($get('TxtOtrosIngresosEgresos').value);}
|
||||
t.value = (ToDouble(t.value) > ToDouble(c) + Ot ? c : t.value)
|
||||
}
|
||||
|
||||
var TipoCambioActual = 0.0;
|
||||
|
||||
@@ -1180,6 +1180,7 @@ Partial Class Bancos_IE
|
||||
|
||||
DdlProveedores.SelectedText = ObjProveedor.NombreComercial
|
||||
DdlProveedores.SelectedValue = ObjProveedor.CveProveedor.ToString
|
||||
DivOtrosIngresosEgresos.Visible = True
|
||||
|
||||
End If
|
||||
|
||||
@@ -1262,6 +1263,7 @@ Partial Class Bancos_IE
|
||||
IDCtaBeneficiarioComplementaria = ObjCliente.IdCtaContCompClientes
|
||||
DdlCliente.SelectedText = ObjCliente.NombreComercial
|
||||
DdlCliente.SelectedValue = ObjCliente.CveCliente.ToString
|
||||
DivOtrosIngresosEgresos.Visible = True
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.UsaAC OrElse UsuarioActual.Empresa.Funcionalidad(200) = "1" Then
|
||||
@@ -2266,11 +2268,16 @@ Partial Class Bancos_IE
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Dim ObjIE As New ClsBancos()
|
||||
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||
Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
|
||||
Dim ObjOC As New ClsOC(ObjIE.IniciaTransacSQL)
|
||||
|
||||
' Dim ObjContabilidad As New ClsContabilidad(ObjIE.IniciaTransacSQL)
|
||||
|
||||
Dim MsgError As String = ""
|
||||
Dim CveConceptoContable As Integer = 30
|
||||
Dim CveConceptoCompra As Integer = 10
|
||||
@@ -2281,7 +2288,6 @@ Partial Class Bancos_IE
|
||||
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
|
||||
Dim Msg As New StringBuilder
|
||||
|
||||
Try
|
||||
If CveIE = -1 Then
|
||||
|
||||
Dim CveCuentaDeposito As Integer = 0
|
||||
@@ -2457,8 +2463,6 @@ Partial Class Bancos_IE
|
||||
If CveIE > 0 Then
|
||||
|
||||
If DdlTipoTransaccion.SelectedValue = "1" Then FolioFijo = ObjIE.Folio.ToEntero 'cheque
|
||||
If UsuarioActual.CveEmpresa = 119 Then FolioFijo = 0
|
||||
|
||||
CvePrePoliza = ObjMov.AddPrePolizas("Bancos/IE " + If(Request("Opcion") IsNot Nothing, Request("Opcion").ToString, "") + " " + RBL.SelectedValue, CvePlantillaPoliza, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, tCveMoneda, TxtFechaDocumento.Text.ToDate, PagueseA, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, FolioFijo:=FolioFijo, ReglaFolioPoliza:=ObjComp.ObtenerReglaFolio(DdlTipoTransaccion.SelectedValue, Nothing, UsuarioActual.CveEmpresa), CveTipoPoliza:=ObjMov.ObtenerTipoPoliza(DdlTipoTransaccion.SelectedValue, "-1", UsuarioActual.CveEmpresa))
|
||||
|
||||
'valida prepoliza
|
||||
@@ -2676,8 +2680,30 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
End If
|
||||
|
||||
'OTROS INGRESOS/EGRESOS
|
||||
Dim Impo As Decimal = TxtOtrosIngresosEgresos.Text.ToDecimal
|
||||
If TxtOtrosIngresosEgresos.Text.ToDecimal <> 0 Then
|
||||
Dim TipoMovtoIE As Boolean = False
|
||||
Dim CveConcIE As Integer = 78
|
||||
If Impo > 0 Then
|
||||
TipoMovtoIE = True
|
||||
Impo = Math.Abs(Impo)
|
||||
CveConcIE = 78
|
||||
Else
|
||||
TipoMovtoIE = False
|
||||
Impo = Math.Abs(Impo)
|
||||
CveConcIE = 211
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=Impo, ImporteME:=0) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
||||
Exit Select
|
||||
End If
|
||||
End If
|
||||
|
||||
'CANCELA NC
|
||||
IdCtaContableAplicar = IDCtaBeneficiario
|
||||
ImporteAplicar = ImporteAplicar + Impo
|
||||
ImporteAplicarMN = (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL()
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 12, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveVenta:=CveVentaDevDin, CveCliente:=CveCliente, ImporteMX:=-(ImporteAplicarMN), ImporteME:=ImporteAplicarME) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
||||
@@ -2780,11 +2806,33 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
End If
|
||||
|
||||
'OTROS INGRESOS/EGRESOS
|
||||
If TxtOtrosIngresosEgresos.Text.ToDecimal <> 0 Then
|
||||
Dim Impo As Decimal = TxtOtrosIngresosEgresos.Text.ToDecimal
|
||||
Dim TipoMovtoIE As Boolean = False
|
||||
Dim CveConcIE As Integer = 78
|
||||
If Impo > 0 Then
|
||||
TipoMovtoIE = True
|
||||
Impo = Math.Abs(Impo)
|
||||
CveConcIE = 78
|
||||
Else
|
||||
TipoMovtoIE = False
|
||||
Impo = Math.Abs(Impo)
|
||||
CveConcIE = 211
|
||||
End If
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovtoIE, Impo, ReferenciaAplicar, CveConcIE, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=Impo, ImporteME:=0, CveCuenta:=CveCuentaConta, TipoCambio:=TCDocumento) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
||||
Exit Select
|
||||
End If
|
||||
End If
|
||||
|
||||
'CANCELA NC
|
||||
IdCtaContableAplicar = IDCtaBeneficiario
|
||||
ImporteAplicar = ImporteAplicar - TxtOtrosIngresosEgresos.Text.ToDecimal
|
||||
ImporteAplicarMN = ImporteAplicar ' (ImporteAplicar * If(DdlMoneda.SelectedValue.ToEntero = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL()
|
||||
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, (ImporteAplicar), ReferenciaAplicar, 18, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=(ImporteAplicarMN), ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then
|
||||
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, -(ImporteAplicar), ReferenciaAplicar, 18, ConceptoAplicar, Now, IdCtaContableAplicar, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=(ImporteAplicarMN), ImporteME:=ImporteAplicarME, TipoCambio:=TCCompra) Then
|
||||
MsgError = "Ocurrió un error al registrar el asiento de pago de devolución"
|
||||
Exit Select
|
||||
End If
|
||||
@@ -2823,6 +2871,8 @@ Partial Class Bancos_IE
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
'IMPUESTOS
|
||||
@@ -2848,18 +2898,14 @@ Partial Class Bancos_IE
|
||||
Dim DTCuentas As DataTable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeCompraDevDinC)
|
||||
Dim CveCuentaIVAxAcreditarDevDinC = 0
|
||||
Dim CveCuentaIVAAcreditableDevDinC = 0
|
||||
Dim IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
|
||||
Dim IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
|
||||
|
||||
Dim IdCtaIVAXAcreditarDevDinC = 0
|
||||
Dim IdCtaIVAAcreditableDevDinC = 0
|
||||
|
||||
If DTCuentas IsNot Nothing AndAlso DTCuentas.Rows.Count > 0 Then
|
||||
IdCtaIVAXAcreditarDevDinC = DTCuentas.Rows(0)("IdCtaIVAXAcreditar").ToString.ToEntero
|
||||
IdCtaIVAAcreditableDevDinC = DTCuentas.Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
|
||||
End If
|
||||
|
||||
Dim IVADevMN As Decimal = 0
|
||||
Dim IEPSDevMN As Decimal = 0
|
||||
|
||||
|
||||
Dim PorcentajeDevolucion As Decimal = ((TxtImporte.Text.ToDecimal * 100D / TotalCompraDev) / 100).RoundSQL(2)
|
||||
|
||||
IVADev = Math.Round(IVADev * PorcentajeDevolucion, 2)
|
||||
@@ -2868,6 +2914,7 @@ Partial Class Bancos_IE
|
||||
Dim CveCuentaDevolucionIMPUESTOS As Integer = -1
|
||||
Dim IdCtaIVADevolucionIMPUESTOS As Integer = -1
|
||||
|
||||
|
||||
If DdlMoneda.SelectedValue.ToEntero > 1 AndAlso UsuarioActual.CveEmpresa.Contiene(1, 119) Then
|
||||
IVADevMN = IVADev
|
||||
IEPSDevMN = IEPSDev
|
||||
@@ -2876,6 +2923,7 @@ Partial Class Bancos_IE
|
||||
IEPSDevMN = (IEPSDev * If(CveMonedaDev = 1, 1, TxtTipoCambio.Text.ToDecimal)).RoundSQL(2)
|
||||
End If
|
||||
|
||||
|
||||
Dim ErrorDevolucionImpuestos As Boolean = False
|
||||
|
||||
If IVADev > 0 Then
|
||||
@@ -2947,6 +2995,8 @@ Partial Class Bancos_IE
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Case "EGSCREDITO"
|
||||
|
||||
Dim ConceptoContable As Integer
|
||||
@@ -2987,6 +3037,8 @@ Partial Class Bancos_IE
|
||||
importeMovimiento = TxtImporte.Text.ToDecimal
|
||||
importeMX = importeMovimiento
|
||||
|
||||
|
||||
|
||||
Case 46
|
||||
If TxtInteresMoratorio.Text.ToDecimal > 0 Then
|
||||
importeMovimiento = TxtInteresMoratorio.Text.ToDecimal
|
||||
@@ -3058,6 +3110,8 @@ Partial Class Bancos_IE
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If Opcion.Contiene("EGSSINFACT") AndAlso CveSolicitudViatico > 0 AndAlso MsgError = "" Then
|
||||
If Not ObjIE.UpdateSolicitudesViaticosIE(CveSolicitudViatico, CveIE) Then
|
||||
MsgError = "Ocurrió un error al vincular el egreso con la solicitud de viatico."
|
||||
@@ -3230,19 +3284,10 @@ Partial Class Bancos_IE
|
||||
RegistraScript($"window.location.href = '/Compras/PopUpVerFactura.aspx?P={Encripta(String.Format("OP=IE&CVEIE={0}", CveIE))}'", String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem))
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgError = "Ocurrió un error al guardar el IE"
|
||||
ex.ToString().GuardaLog()
|
||||
End Try
|
||||
|
||||
If MsgError = "" Then
|
||||
ObjIE.Commit()
|
||||
|
||||
Else
|
||||
ObjIE.RollBack()
|
||||
|
||||
Alert(MsgError, TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
If Msg.ToString <> "" Then
|
||||
@@ -3265,6 +3310,7 @@ Partial Class Bancos_IE
|
||||
AccionJS = String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery)
|
||||
End If
|
||||
|
||||
|
||||
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion").ToString.Contiene("EGSCREDITO") Then
|
||||
AccionJS = $"document.location.href=""/Bancos/Creditos.aspx?CveCredito={Request("CveCredito")}"";"
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, AccionJS)
|
||||
@@ -3272,15 +3318,18 @@ Partial Class Bancos_IE
|
||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, String.Format("document.location.href=""{0}"";", HttpContext.Current.Request.Url.PathAndQuery))
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
ObjIE.Dispose()
|
||||
ObjMov.Dispose()
|
||||
ObjOC.Dispose()
|
||||
If ObjComp IsNot Nothing Then ObjComp.Dispose()
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
RecargaGlobalCuentasBancarias()
|
||||
ObjIE.Dispose()
|
||||
ObjMov.Dispose()
|
||||
If ObjComp IsNot Nothing Then ObjComp.Dispose()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#Region " NOTIFICACION PAGO "
|
||||
|
||||
@@ -110,6 +110,7 @@ Partial Class CatFolios
|
||||
TxtFolioInicial.Text = ""
|
||||
TxtFolioFinal.Text = ""
|
||||
TxtFolioActual.Text = ""
|
||||
txtserie.text = ""
|
||||
DivFactual.Visible = False
|
||||
CargaSubProyectos()
|
||||
|
||||
@@ -193,7 +194,7 @@ Partial Class CatFolios
|
||||
|
||||
Session("FileUpload") = ""
|
||||
|
||||
Alert("La nueva Aprobación de Folios se guardó/editó correctamente.", TipoMensaje.MsgInformacion)
|
||||
Alert("El nuevo Folio se guardó/editó correctamente.", TipoMensaje.MsgInformacion)
|
||||
GlobalDTFolios = ObjFolios.DtResultados
|
||||
ViewState("DTFolios") = ObjFolios.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user