This commit is contained in:
2023-05-09 16:22:41 -07:00
33 changed files with 2031 additions and 2305 deletions

View File

@@ -20,17 +20,8 @@ public partial class Ventas_RepUsados : ClsPaginas
private void InicializaValores() private void InicializaValores()
{ {
CargaCliente(); CargaCliente();
txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString(); txtFechaI.Text = DateTime.Now.FirstDayOfMonth().ToShortDateString();
txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
UpFiltros.Update();
}
private void CargaCliente()
{
if (UsuarioActual.CveEmpresa == 119) {
DdlClientes.setEsWebService(true);
}else
txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString(); txtFechaF.Text = DateTime.Now.LastDayOfMonth().ToShortDateString();
UpFiltros.Update(); UpFiltros.Update();
} }

View File

@@ -4807,7 +4807,7 @@ Public Class ClsBancos
strBody.AppendFormat(" <td>Cuenta:</td>") strBody.AppendFormat(" <td>Cuenta:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", NumCuenta) strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", NumCuenta)
strBody.AppendFormat(" </tr>") strBody.AppendFormat(" </tr>")
If CuentaDepositado.ToString <> "" Then If CuentaDepositado IsNot Nothing AndAlso CuentaDepositado.ToString <> "" Then
strBody.AppendFormat(" <tr class='Texto'>") strBody.AppendFormat(" <tr class='Texto'>")
strBody.AppendFormat(" <td>Cuenta Destino:</td>") strBody.AppendFormat(" <td>Cuenta Destino:</td>")
strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", CuentaDepositado) strBody.AppendFormat(" <td style='text-align: left'>{0}</td>", CuentaDepositado)

View File

@@ -1032,6 +1032,9 @@ Public Class ClsContabilidad
If dr("AplicaProveedor").ToString = "True" Then If dr("AplicaProveedor").ToString = "True" Then
StrMsg = StrMsg + " - Proveedor: " + ClsPaginas.GlobalDTCompProveedores(tCveEmp, CveProveedor:=CveProveedor).FiltroPrimeroValor("NombreComercial", "") StrMsg = StrMsg + " - Proveedor: " + ClsPaginas.GlobalDTCompProveedores(tCveEmp, CveProveedor:=CveProveedor).FiltroPrimeroValor("NombreComercial", "")
End If End If
If dr("AplicaPersonal").ToString = "True" Then
StrMsg = StrMsg + " - Personal: " + ClsPaginas.GlobalDTRHPersonal(tCveEmp, CvePersonal:=CvePersonal).FiltroPrimeroValor("NombreCompleto", "")
End If
End If End If
End If End If
OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", StrMsg), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) OnError(String.Format("El concepto '{0}' no tiene especificada la cuenta. Favor de especificarla en la asignación de cuentas.", StrMsg), ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
@@ -5986,7 +5989,8 @@ Public Class ClsContabilidad
Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1, Public Function AddCuentasAsignaciones(Optional CveConceptoContable As Integer = -1, Optional CveEmpresa As Integer = -1, Optional CveCuenta As Integer = -1, Optional IdCtaContable As Integer = -1,
Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCliente As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1,
Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional CveAlmacen As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional RegeneraCuenta As Boolean = False, Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveCredito As Integer = -1,
Optional RegeneraCuenta As Boolean = False,
Optional OpActualizarClasificacion As Boolean = False) As Boolean Optional OpActualizarClasificacion As Boolean = False) As Boolean
Dim Retorno = False Dim Retorno = False
@@ -6008,6 +6012,7 @@ Public Class ClsContabilidad
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
.Add("@CveCredito", SqlDbType.Int).Value = CveCredito
.Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta .Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta
.Add("@OpActualizarClasificacion", SqlDbType.Bit).Value = OpActualizarClasificacion .Add("@OpActualizarClasificacion", SqlDbType.Bit).Value = OpActualizarClasificacion
End With End With
@@ -6027,7 +6032,7 @@ Public Class ClsContabilidad
Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveAlmacen As Integer = -1,
Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1, Optional PorcentajeIVA As Decimal = -1, Optional CveConceptoNomina As Decimal = -1, Optional CveBancoCuenta As Integer = -1,
Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveTipoGasto As Integer = -1,
Optional RegeneraCuenta As Boolean = False) As Boolean Optional CveCredito As Integer = -1, Optional RegeneraCuenta As Boolean = False) As Boolean
Dim Retorno = False Dim Retorno = False
DataAdapter("PA_Conta_CuentasAsignacionesUpdate") DataAdapter("PA_Conta_CuentasAsignacionesUpdate")
@@ -6048,6 +6053,7 @@ Public Class ClsContabilidad
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo .Add("@CveActivoFijo", SqlDbType.Int).Value = CveActivoFijo
.Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto .Add("@CveTipoGasto", SqlDbType.Int).Value = CveTipoGasto
.Add("@CveCredito", SqlDbType.Int).Value = CveCredito
.Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta .Add("@RegeneraCuenta", SqlDbType.Bit).Value = RegeneraCuenta
End With End With

View File

@@ -6,6 +6,7 @@ Imports System.IO
Imports System.Net.Http Imports System.Net.Http
Imports System.Xml Imports System.Xml
Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared Imports CrystalDecisions.Shared
Imports Extensiones Imports Extensiones
Imports iText.Kernel.Pdf Imports iText.Kernel.Pdf
@@ -7668,7 +7669,6 @@ Public Class ClsPaginas
#Region "P A G O D E C O M P R A S " #Region "P A G O D E C O M P R A S "
Public Function AplicaPrePolizaPagoCompra(CompraActual As Compra, Pago As CompraPago, CvePrePoliza As Integer, ByRef ObjConta As ClsContabilidad) As Boolean Public Function AplicaPrePolizaPagoCompra(CompraActual As Compra, Pago As CompraPago, CvePrePoliza As Integer, ByRef ObjConta As ClsContabilidad) As Boolean
Dim ErrorMovtos As Boolean = False Dim ErrorMovtos As Boolean = False
Dim PorcentajePago As Decimal = Pago.ImportePago / CompraActual.Total
Dim ImporteMovimiento As Decimal = 0 Dim ImporteMovimiento As Decimal = 0
Dim ImporteMN As Decimal = 0 Dim ImporteMN As Decimal = 0
Dim ImporteME As Decimal = 0 Dim ImporteME As Decimal = 0
@@ -7678,6 +7678,14 @@ Public Class ClsPaginas
Dim tFechaUltimaFluctuacion As Date Dim tFechaUltimaFluctuacion As Date
Dim tImportePago As Decimal Dim tImportePago As Decimal
Dim tImporteCompra As Decimal = Pago.ImportePago Dim tImporteCompra As Decimal = Pago.ImportePago
Dim PorcentajePago As Decimal = Pago.ImportePago / CompraActual.Total
'VALIDACIONES A CONSIDERAR
If CompraActual.CveMoneda = Pago.CveMonedaPago Then
Pago.TCCambioMoneda = 1 ' si la moneda es igual, el importe debe ser 1
ElseIf CompraActual.CveMoneda <> Pago.CveMonedaPago AndAlso Pago.TCCambioMoneda = 1 Then
ErrorMovtos = True
Return ErrorMovtos
End If
Dim ConPreP As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(1, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor) Dim ConPreP As ConceptosTipoSaldo = ObtenerCveConceptoPrePoliza(1, CompraActual.CveMoneda, True, CompraActual.CveTipoConceptoProveedor)
'cuando el Pago viene por NC, se utiliza un concepto 'cuando el Pago viene por NC, se utiliza un concepto
@@ -7699,28 +7707,40 @@ Public Class ClsPaginas
If Pago.Fecha < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion If Pago.Fecha < tFechaUltimaFluctuacion Then TCValuacionPago = TCValuacion
End If End If
End If End If
If CompraActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
tImportePago = ((Pago.ImportePago * TCValuacionCompra / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
tImporteCompra = (Pago.ImportePago * TCValuacionCompra).RoundSQL tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL
ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
tImporteCompra = (Pago.ImportePago * TCValuacionCompra).RoundSQL
tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL 'If CompraActual.CveMoneda = 1 And Pago.CveMonedaPago <> 1 Then 'factura pesos, pago en dolares
ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos ' tImportePago = ((Pago.ImportePago * TCValuacionCompra / Pago.TCPago).RoundSQL * Pago.TCPago).RoundSQL
tImporteCompra = (Pago.ImportePago * TCValuacionCompra).RoundSQL ' tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL ' PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
End If 'ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
Dim ImportePagoMN As Decimal = Pago.ImportePago ' tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
' tImportePago = (Pago.ImportePago).RoundSQL
' PorcentajePago = Pago.ImportePago * Pago.TCCambioMoneda / CompraActual.Total
'ElseIf CompraActual.CveMoneda <> 1 And Pago.CveMonedaPago <> 1 Then 'factura dolares, pago en dolares
' tImporteCompra = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
' tImportePago = (Pago.ImportePago * Pago.TCPago).RoundSQL
' PorcentajePago = Pago.ImportePago / CompraActual.Total
'ElseIf CompraActual.CveMoneda = 1 And Pago.CveMonedaPago = 1 Then 'factura dolares, pago en pesos
' tImporteCompra = Pago.ImportePagoCompra
' tImportePago = Pago.ImportePago
' PorcentajePago = Pago.ImportePago / CompraActual.Total
'End If
Dim ImportePagoMN As Decimal = Pago.ImportePagoCompra
Dim UsaComplementaria As Boolean = True Dim UsaComplementaria As Boolean = True
If CompraActual.CveMoneda > 1 Then ImporteME = Pago.ImportePago If CompraActual.CveMoneda > 1 Then ImporteME = Pago.ImportePagoCompra
If UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'caso excepcional de complementarias If UsuarioActual.CveEmpresa.Contiene(13, 83) Then 'caso excepcional de complementarias
UsaComplementaria = False UsaComplementaria = False
ImportePagoMN = (Pago.ImportePago * TCValuacionCompra).RoundSQL ImportePagoMN = (Pago.ImportePagoCompra * TCValuacionCompra).RoundSQL
End If End If
'movimiento de pago proveedor 'movimiento de pago proveedor
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, ImportePagoMN, ConPreP.CveConcepto, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto, CveVenta:=Pago.CveVentaRelacionada) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePagoCompra, ImportePagoMN, ConPreP.CveConcepto, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProv, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto, CveVenta:=Pago.CveVentaRelacionada) Then ErrorMovtos = True
'movimiento de pago proveedor Complementaria 'movimiento de pago proveedor Complementaria
If Not ErrorMovtos AndAlso CompraActual.CveMoneda > 1 AndAlso UsaComplementaria Then If Not ErrorMovtos AndAlso CompraActual.CveMoneda > 1 AndAlso UsaComplementaria Then
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePago, (ImporteME * TCValuacionCompra - ImporteME).RoundSQL, ConPreP.CveConceptoComplementario, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto, CveVenta:=Pago.CveVentaRelacionada) Then ErrorMovtos = True If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Pago.ImportePagoCompra, (ImporteME * TCValuacionCompra - ImporteME).RoundSQL, ConPreP.CveConceptoComplementario, CompraActual.SerieFolio, Concepto, CompraActual.IdCtaContableProvComplementaria, CveCompra:=CompraActual.CveCompra, CveProveedor:=CompraActual.CveProveedor, CveIE:=Pago.CveIE, CvePersonal:=Pago.CvePersonal, CveCompraAmortizacion:=Pago.CveCompraAmortizacion, TipoCambio:=TCValuacionCompra, TipoCambioPago:=Pago.TCPago, ImporteME:=ImporteME, CveSubProyecto:=CompraActual.CveSubProyecto, CveVenta:=Pago.CveVentaRelacionada) Then ErrorMovtos = True
End If End If
If Pago.AplicaAcreditable Then If Pago.AplicaAcreditable Then
'si tiene iva y su proporcion 'si tiene iva y su proporcion
@@ -7887,6 +7907,12 @@ Public Class ClsPaginas
Public Property CveIE As Integer = -1 Public Property CveIE As Integer = -1
Public Property CvePersonal As Integer = -1 Public Property CvePersonal As Integer = -1
Public Property ImportePago As Decimal = 0 Public Property ImportePago As Decimal = 0
Public ReadOnly Property ImportePagoCompra As Decimal
Get
Return (ImportePago * TCCambioMoneda).RoundSQL
End Get
End Property
Public Property TCCambioMoneda As Decimal = 1
Public Property CveMonedaPago As Integer = 1 Public Property CveMonedaPago As Integer = 1
Public Property TCPago As Decimal = 1 Public Property TCPago As Decimal = 1
Public Property CveCompraAmortizacion As Integer = 0 Public Property CveCompraAmortizacion As Integer = 0
@@ -8038,43 +8064,53 @@ Public Class ClsPaginas
End Get End Get
End Property End Property
End Class End Class
' 1. Proveedores, 11. anticipos proveedores, 15. Notas de crédito de proveedores ' 1. Proveedores, 11. anticipos proveedores, 15. Notas de crédito de proveedores, 6. Clientes
Public Shared ReadOnly Property ObtenerCveConceptoPrePoliza(CveTipoSaldo As Integer, CveMoneda As Integer, EsAplicacionPago As Boolean, CveTipoProveedor As Integer) As ConceptosTipoSaldo 'CveTipoProveedorTipoDocto: cuando es TipoSaldo=2: 1. Proveedor, 2. Acreedor, TipoSaldo=6: 1.Factura, 2.NC
Public Shared ReadOnly Property ObtenerCveConceptoPrePoliza(CveTipoSaldo As Integer, CveMoneda As Integer, EsAplicacionPago As Boolean, CveTipoProveedorTipoDocto As Integer) As ConceptosTipoSaldo
Get Get
Dim Retorno As New ConceptosTipoSaldo Dim Retorno As New ConceptosTipoSaldo
If EsAplicacionPago Then If EsAplicacionPago Then
Select Case CveTipoSaldo Select Case CveTipoSaldo
Case 1 ' proveedores/acreedores Case 1 ' proveedores/acreedores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 17, 308) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 17, 308)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 312, 309) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 312, 309)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 206, 310) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 206, 310)
End Select End Select
Case 11 ' anticipos Case 11 ' anticipos
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 21, 56) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 21, 56)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 339, 346) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 339, 346)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 340, 347) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 340, 347)
End Select End Select
Case 15 ' notas de crédito Case 15 ' notas de crédito
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 60, 324) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 60, 324)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 342, 344) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 342, 344)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 235, 235) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 235, 235)
End Select End Select
Case 17 ' deudores Case 17 ' deudores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 37, 37) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 37, 37)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 37, 37) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 37, 37)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 256, 256) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 256, 256)
End Select
Case 6 ' clientes
Select Case CveMoneda
Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 2, 91) '1.Venta.2.NC
Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 292, 294) '1.Venta.2.NC
Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 207, 203) '1.Venta.2.NC
End Select End Select
End Select End Select
Else 'cuando es la provisión Else 'cuando es la provisión
@@ -8082,35 +8118,44 @@ Public Class ClsPaginas
Case 1 ' proveedores/acreedores Case 1 ' proveedores/acreedores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 5, 305) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 5, 305)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 311, 306) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 311, 306)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 201, 307) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 201, 307)
End Select End Select
Case 11 ' anticipos Case 11 ' anticipos
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 10, 48) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 10, 48)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 338, 345) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 338, 345)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 340, 347) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 340, 347)
End Select End Select
Case 15 ' notas de crédito Case 15 ' notas de crédito
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 18, 323) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 18, 323)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 341, 343) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 341, 343)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 234, 234) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 234, 234)
End Select End Select
Case 17 ' deudores Case 17 ' deudores
Select Case CveMoneda Select Case CveMoneda
Case 1 'pesos Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedor = 1, 43, 43) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 43, 43)
Case 2 'dólares Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedor = 1, 43, 43) Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 43, 43)
Retorno.CveConceptoComplementario = If(CveTipoProveedor = 1, 256, 256) Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 256, 256)
End Select End Select
Case 6 ' clientes
Select Case CveMoneda
Case 1 'pesos
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 1, 12) '1.Venta.2.NC
Case 2 'dólares
Retorno.CveConcepto = If(CveTipoProveedorTipoDocto = 1, 291, 293) '1.Venta.2.NC
Retorno.CveConceptoComplementario = If(CveTipoProveedorTipoDocto = 1, 203, 203) '1.Venta.2.NC
End Select
End Select End Select
End If End If
@@ -8402,6 +8447,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918) PaginaDict.Add("/Nomina/ISRCalculoAnual.aspx".ToUpper(), 918)
PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919) PaginaDict.Add("/Nomina/MovimientosSUA.aspx".ToUpper(), 919)
PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916) PaginaDict.Add("/Nomina/Acumulados.aspx".ToUpper(), 916)
PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915) PaginaDict.Add("/RH/CalculoSBC.aspx".ToUpper(), 915)
PaginaDict.Add("/Inicio.aspx".ToUpper(), -1) PaginaDict.Add("/Inicio.aspx".ToUpper(), -1)
PaginaDict.Add("/reporteador.aspx".ToUpper(), -1) PaginaDict.Add("/reporteador.aspx".ToUpper(), -1)

View File

@@ -493,7 +493,7 @@
<ajax:ValidatorCalloutExtender ID="VCEProveedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVProveedor" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="VCEProveedor" runat="server" HighlightCssClass="vco" TargetControlID="RFVProveedor" Width="300px"></ajax:ValidatorCalloutExtender>
</td> </td>
</tr> </tr>
<tr> <tr runat="server" id="trClasifContable" visible="false">
<td colspan="2"> <td colspan="2">
<asp:RadioButtonList runat="server" ID="RBLClasificacionContable" AutoPostBack="true" RepeatDirection="Horizontal"> <asp:RadioButtonList runat="server" ID="RBLClasificacionContable" AutoPostBack="true" RepeatDirection="Horizontal">
<asp:ListItem Text="Doc x Pagar" Value="1" Selected="True"></asp:ListItem> <asp:ListItem Text="Doc x Pagar" Value="1" Selected="True"></asp:ListItem>
@@ -501,7 +501,7 @@
</asp:RadioButtonList> </asp:RadioButtonList>
</td> </td>
</tr> </tr>
<tr> <tr runat="server" id="trCtaContable" visible="false">
<td>Cuenta Contable:</td> <td>Cuenta Contable:</td>
<td> <td>
<asp:UpdatePanel runat="server" ID="UpCtaContable" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpCtaContable" UpdateMode="Conditional">

View File

@@ -549,7 +549,7 @@ Partial Class Bancos_Creditos
DdlCtaContable.Items.Clear() DdlCtaContable.Items.Clear()
Dim IdCuentaPadre As Integer = If(RBLClasificacionContable.SelectedValue.ToEntero = 1, UsuarioActual.Empresa.Funcionalidad(203).ToEntero, UsuarioActual.Empresa.Funcionalidad(202).ToEntero) Dim IdCuentaPadre As Integer = If(RBLClasificacionContable.SelectedValue.ToEntero = 1, UsuarioActual.Empresa.Funcionalidad(203).ToEntero, UsuarioActual.Empresa.Funcionalidad(202).ToEntero)
If IdCuentaPadre > 0 Then If UsuarioActual.Empresa.TipoContabilidad = 2 AndAlso IdCuentaPadre > 0 Then
Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa) Dim ObjContabilidad As New ClsContPAQi(UsuarioActual.Empresa)
If ObjContabilidad.GetCuentasRecursiva(IdCuentaPadre, 1) Then If ObjContabilidad.GetCuentasRecursiva(IdCuentaPadre, 1) Then
DdlCtaContable.DataSource = ObjContabilidad.DtResultados DdlCtaContable.DataSource = ObjContabilidad.DtResultados

View File

@@ -1034,34 +1034,28 @@ Partial Class Bancos_IE
IDPoliza = ObjIE.IDPoliza IDPoliza = ObjIE.IDPoliza
IDCtaContable = ObjIE.IdCtaContable IDCtaContable = ObjIE.IdCtaContable
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
If ObjIE.IDPoliza > 0 Then
If ObjIE.IDPoliza > 0 Then If UsuarioActual.TienePermisoProceso(107) Then
BtnDescontabilizar.Visible = True
If UsuarioActual.TienePermisoProceso(107) Then End If
BtnDescontabilizar.Visible = True BtnContabilizar.Visible = False
HplIrPoliza.Visible = True
HplIrPoliza.NavigateUrl = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", ObjIE.IDPoliza)
'ImgEliminarMovimiento.OnClientClick = "return confirm('Esta seguro de eliminar el documento y su póliza?');"
LnkEliminar.OnClientClick = "return confirm('¿Está seguro de eliminar el documento y su póliza?');"
EstaContabilizado = True
TxtFechaDocumento.Enabled = False
ImgCalendario.Visible = False
Else
BtnContabilizar.Visible = True
BtnDescontabilizar.Visible = False
HplIrPoliza.Visible = False
EstaContabilizado = False
End If End If
BtnContabilizar.Visible = False
HplIrPoliza.Visible = True
HplIrPoliza.NavigateUrl = String.Format("/Contabilidad/RegPoliza.aspx?IdPoliza={0}", ObjIE.IDPoliza)
'ImgEliminarMovimiento.OnClientClick = "return confirm('Esta seguro de eliminar el documento y su póliza?');"
LnkEliminar.OnClientClick = "return confirm('¿Está seguro de eliminar el documento y su póliza?');"
EstaContabilizado = True
TxtFechaDocumento.Enabled = False
ImgCalendario.Visible = False
Else
BtnContabilizar.Visible = True
BtnDescontabilizar.Visible = False
HplIrPoliza.Visible = False
EstaContabilizado = False
'TxtFechaDocumento.Enabled = True
'ImgCalendario.Visible = True
End If End If
UPPDesContabilizar.Update() UPPDesContabilizar.Update()
'ImgImprimir.Visible = True 'ImgImprimir.Visible = True
@@ -1416,9 +1410,9 @@ Partial Class Bancos_IE
IDCtaBeneficiario = ObjProveedor.IdCtaContAcreedor IDCtaBeneficiario = ObjProveedor.IdCtaContAcreedor
If Not IDCtaBeneficiario > 0 Then 'If Not IDCtaBeneficiario > 0 Then
Alert("No se pudo cargar IDCtaBeneficiario", TipoMensaje.MsgAdvertencia) ' Alert("No se pudo cargar IDCtaBeneficiario", TipoMensaje.MsgAdvertencia)
End If 'End If
End If End If
@@ -2651,6 +2645,7 @@ Partial Class Bancos_IE
Case "P" 'Proveedores Case "P" 'Proveedores
If CveProveedor > 0 Then If CveProveedor > 0 Then
CveConceptoCompra = 10 'Anticipo a proveedor CveConceptoCompra = 10 'Anticipo a proveedor
If CveMoneda = 2 Then CveConceptoCompra = 338
CveConceptoContable = 30 'Pago a Proveedor CveConceptoContable = 30 'Pago a Proveedor
CvePlantillaPoliza = 3 CvePlantillaPoliza = 3
End If End If
@@ -2665,6 +2660,7 @@ Partial Class Bancos_IE
Case "AC" ' Acreedores Diversos Case "AC" ' Acreedores Diversos
If CveProveedor > 0 Then If CveProveedor > 0 Then
CveConceptoCompra = 48 'anticipo a acreedor diverso CveConceptoCompra = 48 'anticipo a acreedor diverso
If CveMoneda = 2 Then CveConceptoCompra = 345
CveConceptoContable = 30 'Bancos CveConceptoContable = 30 'Bancos
'limpio el iva 'limpio el iva
HdnProvPorIVA.Value = "0" HdnProvPorIVA.Value = "0"
@@ -2720,7 +2716,11 @@ Partial Class Bancos_IE
Dim FolioFijo As Integer = 0 Dim FolioFijo As Integer = 0
Dim tCveMoneda As Integer = CveMoneda Dim tCveMoneda As Integer = CveMoneda
Dim tImporteMonedaExtranjera As Decimal = TxtImporte.Text.ToDecimal Dim tImporteMonedaExtranjera As Decimal = TxtImporte.Text.ToDecimal
If tCveMoneda <> 1 Then tImporteMonedaExtranjera = (TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal).RoundSQL Dim tImporteMonedaME As Decimal = 0
If tCveMoneda <> 1 Then
tImporteMonedaExtranjera = (TxtImporte.Text.ToDecimal * GlobalTipoCambio(TxtFechaDocumento.Text.Trim.ToDate).ToString.ToDecimal).RoundSQL
tImporteMonedaME = TxtImporte.Text.ToDecimal
End If
Dim PagueseA = "" Dim PagueseA = ""
If HdnCveCliente.Value.ToEntero > 0 Then If HdnCveCliente.Value.ToEntero > 0 Then
@@ -2884,7 +2884,7 @@ Partial Class Bancos_IE
Select Case ConceptoContable Select Case ConceptoContable
Case 10 Case 10, 338, 345
If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then If RBL.SelectedValue = "P" AndAlso CveProveedor > 0 Then
importeMovimiento = TxtImporte.Text.ToDecimal importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento importeMX = importeMovimiento
@@ -3596,71 +3596,46 @@ Partial Class Bancos_IE
Dim ConceptoContable As Integer Dim ConceptoContable As Integer
Dim TipoMovimiento As Boolean Dim TipoMovimiento As Boolean
Dim importeMovimiento As Decimal Dim importeMovimiento As Decimal = TxtImporte.Text.ToDecimal
Dim FechaMovimiento As Date = Now Dim FechaMovimiento As Date = Now
Dim Concepto As String = "" Dim Concepto As String = ""
Dim Referencia As String = PagueseA Dim Referencia As String = PagueseA
Dim CveCredito As Integer
Dim importeMX As Decimal CveCredito = IfNull(Request("CveCredito"), "-1").ToString.ToEntero
Dim Multiplicador As Integer CveCreditoDetalle = IfNull(Request("CveCreditoDetalle"), "-1").ToString.ToEntero
Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio)
If ObjMov.GetPlantillaConceptos(UsuarioActual.CveEmpresa, CvePlantillaPoliza) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, importeMovimiento, Concepto, 57, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCredito:=CveCredito) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
For Each Row As DataRow In ObjMov.DtResultados.Rows
ConceptoContable = Row("CveConcepto").ToString.ToEntero
TipoMovimiento = If(Row("TipoMovto").ToString = "True", True, False)
importeMovimiento = 0
Multiplicador = (Row("Multiplicador").ToString.ToEntero)
Concepto = ObjMov.ObtenerConceptoEmpresa(UsuarioActual.CveEmpresa, ConceptoContable, PagueseA, "", ObjIE.Folio)
Select Case ConceptoContable
Case 30
importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento
If tCveMoneda > 1 Then
'Agregamos complementaria
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
End If
Case 42
importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento
If tCveMoneda > 1 Then
importeMovimiento = TxtImporte.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal
importeMX = importeMovimiento
End If
Case 46
If TxtInteresMoratorio.Text.ToDecimal > 0 Then
importeMovimiento = TxtInteresMoratorio.Text.ToDecimal
importeMX = importeMovimiento
Else
importeMovimiento = 0
importeMX = 0
End If
Case 48
importeMovimiento = TxtImporte.Text.ToDecimal
importeMX = importeMovimiento
End Select
If importeMovimiento <> 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Concepto, ConceptoContable, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
End If
Next
End If End If
If MsgError = "" AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, importeMovimiento, Concepto, 30, Concepto, FechaMovimiento, If(ConceptoContable = 30, IDCtaContable, IDCtaBeneficiario), -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=importeMovimiento, ImporteME:=tImporteMonedaExtranjera, TipoCambio:=TxtTipoCambio.Text.ToDecimal, CveCredito:=CveCredito) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
If MsgError = "" AndAlso tCveMoneda > 1 Then
'Agregamos complementaria
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, 0, Concepto, 204, Concepto, FechaMovimiento, IDCtaContableComplementaria, -1, CveIE:=CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=(importeMovimiento * TC - importeMovimiento).RoundSQL, ImporteME:=importeMovimiento, TipoCambio:=TC, CveCredito:=CveCredito) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
End If
' Case 46
' If TxtInteresMoratorio.Text.ToDecimal > 0 Then
' importeMovimiento = TxtInteresMoratorio.Text.ToDecimal
' importeMX = importeMovimiento
' Else
' importeMovimiento = 0
' importeMX = 0
' End If
Case Else Case Else
Dim TipoMovimiento As Boolean = True Dim TipoMovimiento As Boolean = True
@@ -3681,7 +3656,7 @@ Partial Class Bancos_IE
'MOVIMIENTOS EGRESOS 'MOVIMIENTOS EGRESOS
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=Importe30, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, TxtImporte.Text.ToDecimal, Ref, CveConceptoContable, Conc, Now, IDCtaContable, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=Importe30, ImporteME:=tImporteMonedaME, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, TxtImporte.Text.ToDecimal - IVA - CIF, Ref, CveConceptoCompra, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=If(UsaComplementariaBancos, TxtImporte.Text.ToDecimal, tImporteMonedaExtranjera), ImporteME:=TxtImporte.Text.ToDecimal, CveIEDevolucion:=DdlIEAcreedor.SelectedValue.ToEntero) Then
If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, Ref, 19, Conc, Now, IDCtaBeneficiario, -1, CveIE, CveCompra:=CveCompra, CveProveedor:=CveProveedor, CveOC:=CveOrdenCompra, CvePersonal:=CvePersonal, CveCreditoDetalle:=CveCreditoDetalle, CveCliente:=CveCliente, ImporteMX:=TxtImporte.Text.ToDecimal, ImporteME:=tImporteMonedaExtranjera, CveIEDevolucion:=DDlCheques.SelectedValue.ToEntero) Then
@@ -3702,12 +3677,12 @@ Partial Class Bancos_IE
If tCveMoneda > 1 And UsaComplementariaBancos Then If tCveMoneda > 1 And UsaComplementariaBancos Then
Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal Dim ImporteAplicar As Decimal = TxtImporte.Text.ToDecimal
Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL() Dim ImporteAplicarMN = (ImporteAplicar * TxtTipoCambio.Text.ToDecimal - ImporteAplicar).RoundSQL()
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, ImporteAplicar, Ref, 204, Conc, Now, IDCtaContableComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=tImporteMonedaME, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
End If End If
If CveConceptoCompra = 10 Then If CveConceptoCompra.Contiene(10, 338, 48, 345) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, 266, Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovimiento, ImporteAplicar, Ref, If(CveConceptoCompra = 10, 266, 340), Conc, Now, IdCtaAnticipoComplementaria, -1, CveIE, CveCompra:=CveCompraDeCDin, CveProveedor:=CveProveedor, ImporteMX:=ImporteAplicarMN, ImporteME:=ImporteAplicar, TipoCambio:=TxtTipoCambio.Text.ToDecimal) Then
MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución" MsgError = "Ocurrió un error al registrar el asiento de bancos complementaria de devolución"
End If End If
End If End If
@@ -3873,8 +3848,12 @@ Partial Class Bancos_IE
End If End If
End If End If
If IDPoliza > 0 Then If UsuarioActual.Empresa.TipoContabilidad = 1 Then
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza) Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza)
Else
If IDPoliza > 0 Then
Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza)
End If
End If End If
'AUTO DESCARGAR PDF PARA COMPU 'AUTO DESCARGAR PDF PARA COMPU
@@ -3888,7 +3867,7 @@ Partial Class Bancos_IE
Else Else
ObjIE.RollBack() ObjIE.RollBack()
Alert(MsgError, TipoMensaje.MsgAdvertencia) Alert(MsgError, TipoMensaje.MsgAdvertencia)
If Opcion = "INGPC" Then If Opcion.Contiene("INGPC", "EGSCREDITO") Then
CveIE = -1 CveIE = -1
End If End If
End If End If

View File

@@ -24,7 +24,7 @@
<div class="row"> <div class="row">
<label class="col-md-2">Tipo Mov:</label> <label class="col-md-2">Tipo Mov:</label>
<div class="col-md-10"> <div class="col-md-10">
<asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" Width="156px" ValidationGroup="GrpGuardar"> <asp:DropDownList ID="DdlTipoTransaccion" CssClass="form-control input-sm select2me" runat="server" AppendDataBoundItems="true" AutoPostBack="true" DataTextField="TipoTransaccion" DataValueField="CveTipoTransaccion" Width="250px" ValidationGroup="GrpGuardar">
</asp:DropDownList> </asp:DropDownList>
<asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" /> <asp:HiddenField ID="HdnTipoTransaccion" runat="server" Value="" />
</div> </div>
@@ -213,7 +213,7 @@
</table>--%> </table>--%>
<br /> <br />
<div style="width: 100%; min-height: 200px; overflow-scrolling: auto;"> <div style="width: 100%; min-height: 200px; overflow-scrolling: auto;">
<asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" DataKeyNames="IdMov,IDCuenta,Cargo,Abono,TipoMovto,CveConcepto,CveProveedor,CveSubProyecto,CvePersonal" ShowHeaderWhenEmpty="true" Width="100%" CssClass="table table-striped table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None"> <asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" DataKeyNames="IdMov,IDCuenta,Cargo,Abono,TipoMovto,CveConcepto,CveProveedor,CveSubProyecto,CvePersonal,CveCuenta" ShowHeaderWhenEmpty="true" Width="100%" CssClass="table table-striped table-hover" Style="margin-top: -10px; text-align: center;" GridLines="None">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate>Código</HeaderTemplate> <HeaderTemplate>Código</HeaderTemplate>

View File

@@ -155,6 +155,7 @@ Partial Class Bancos_PolizaCheque
Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True Dim IDMov As DataColumn = DtMovimientos.Columns.Add("IdMov", Type.GetType("System.Int32")) : IDMov.AutoIncrement = True
With DtMovimientos.Columns With DtMovimientos.Columns
.Add("IdCuenta", Type.GetType("System.Int32")) .Add("IdCuenta", Type.GetType("System.Int32"))
.Add("CveCuenta", Type.GetType("System.Int32"))
.Add("CodigoCuenta", Type.GetType("System.String")) .Add("CodigoCuenta", Type.GetType("System.String"))
.Add("Cuenta", Type.GetType("System.String")) .Add("Cuenta", Type.GetType("System.String"))
.Add("Referencia", Type.GetType("System.String")) .Add("Referencia", Type.GetType("System.String"))
@@ -401,6 +402,7 @@ Partial Class Bancos_PolizaCheque
Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(UsuarioActual.CveEmpresa, CvePlantilla).FiltraParametros("", "Orden") Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(UsuarioActual.CveEmpresa, CvePlantilla).FiltraParametros("", "Orden")
Dim Cuenta As String = "" Dim Cuenta As String = ""
Dim IdCuenta As Integer = 0 Dim IdCuenta As Integer = 0
Dim CveCuenta As Integer = 0
Dim CodigoCuenta As String = "" Dim CodigoCuenta As String = ""
Dim NombreCuenta As String = "" Dim NombreCuenta As String = ""
Dim EsComodin As Integer = 0 Dim EsComodin As Integer = 0
@@ -412,6 +414,7 @@ Partial Class Bancos_PolizaCheque
Cuenta = drt("ConceptoContable").ToString Cuenta = drt("ConceptoContable").ToString
IdCuenta = 0 IdCuenta = 0
CveCuenta = 0
CodigoCuenta = "" CodigoCuenta = ""
NombreCuenta = "" NombreCuenta = ""
@@ -420,7 +423,7 @@ Partial Class Bancos_PolizaCheque
Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", drt("CveCuenta").ToString)) Dim drr As DataRow = DtCuentasContables.FiltroPrimero(String.Format("CveCuenta={0}", drt("CveCuenta").ToString))
If drr IsNot Nothing Then If drr IsNot Nothing Then
IdCuenta = drt("IdCtaContable").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() 'Cuenta = drr("Nombre").ToString()
@@ -469,7 +472,8 @@ Partial Class Bancos_PolizaCheque
Dim dr As DataRow = DtMovimientos.NewRow Dim dr As DataRow = DtMovimientos.NewRow
dr("IdCuenta") = IdCuenta dr("IdCuenta") = IdCuenta
dr("CveCuenta") = CveCuenta
dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta dr("CodigoCuenta") = CodigoCuenta & "<br>" & NombreCuenta
dr("Cuenta") = Cuenta 'TxtCuentaContable.Text dr("Cuenta") = Cuenta 'TxtCuentaContable.Text
dr("RazonSocial") = drt("RazonSocial") dr("RazonSocial") = drt("RazonSocial")
@@ -566,24 +570,8 @@ Partial Class Bancos_PolizaCheque
dr("CvePersonal") = drt("CvePersonal") dr("CvePersonal") = drt("CvePersonal")
DtMovimientos.Rows.Add(dr) DtMovimientos.Rows.Add(dr)
Next Next
'Dim drtt As DataRow = DtMovimientos.NewRow
'drtt("IdCuenta") = 0
'drtt("CodigoCuenta") = ""
'drtt("Cuenta") = Cuenta
'drtt("RazonSocial") = ""
'drtt("Concepto") = ""
'drtt("TipoMovto") = 0
'drtt("EsComodin") = EsComodin
'drtt("CveConcepto") = 44
'drtt("CveProveedor") = "-1"
'drtt("SubProyecto") = ""
'drtt("Proyecto") = ""
'drtt("Personal") = ""
'drtt("CveSubProyecto") = -1
'drtt("CvePersonal") = -1
'DtMovimientos.Rows.Add(drtt)
ObjNomina.Dispose() ObjNomina.Dispose()
ObjConta.Dispose() ObjConta.Dispose()
@@ -809,20 +797,8 @@ Partial Class Bancos_PolizaCheque
If UsuarioActual.CveEmpresa = 119 Then If UsuarioActual.CveEmpresa = 119 Then
e.Row.FCLiteral("LtlSP").Visible = False e.Row.FCLiteral("LtlSP").Visible = False
e.Row.FCDropDownList("DdlSubProyecto").Visible = True e.Row.FCDropDownList("DdlSubProyecto").Visible = True
End If End If
'cuando se modifica el importe de la cuenta bancaria que se actualice el importe del documento
'If e.Row.DBCampo("EsComodin") = "1" Then
' If e.Row.DBCampo("TipoMovto") = "1" Then
' e.Row.FCTextBox("TxtAbono").Attributes.Add("onkeyup", "FncImporte('TxtImporte',this.id,2)")
' e.Row.FCTextBox("TxtAbono").Text = TxtImporte.Text
' Else
' e.Row.FCTextBox("TxtCargo").Attributes.Add("onkeyup", "FncImporte('TxtImporte',this.id,2)")
' e.Row.FCTextBox("TxtCargo").Text = TxtImporte.Text
' End If
' TxtImporte.Attributes.Add("onkeyup", String.Format("FncImporte(this.id,'{0}',1)", e.Row.FCTextBox(If(e.Row.DBCampo("TipoMovto") = "1", "TxtAbono", "TxtCargo")).ClientID))
' UPPImporte.Update()
'End If
End If End If
End Sub End Sub
@@ -966,7 +942,7 @@ Partial Class Bancos_PolizaCheque
Importe = Importe * TC Importe = Importe * TC
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, TipoCambio:=TC) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, Referencia, gvr.DataKey("CveConcepto").ToEntero, TxtObservaciones.Text, Now, gvr.DataKey("IDCuenta").ToEntero, -1, CveIE, CveProveedor:=CveProveedor, CveSubProyecto:=gvr.FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero, CvePersonal:=gvr.DataKey("CvePersonal").ToEntero, ImporteMX:=Importe, TipoCambio:=TC, CveCuenta:=gvr.DataKey("CveCuenta").ToEntero) Then
MsgError = "no se pudo insertar el detalle de la póliza2" MsgError = "no se pudo insertar el detalle de la póliza2"
End If End If
@@ -1009,12 +985,6 @@ Partial Class Bancos_PolizaCheque
MsgError = "No se insertó el encabezado" MsgError = "No se insertó el encabezado"
End If End If
'If ChkContabilizar.Checked AndAlso UsuarioActual.Empresa.UsaContabilidad Then
' If Not ObjIE.UpdateIEPrePoliza(TxtFechaDocumento.Text.ToDate, NumPoliza.ToString, IDPoliza, CvePrePoliza, CveIE, 0) Then
' MsgError = "Error al actualizar la poliza"
' End If
'End If
Catch ex As Exception Catch ex As Exception
MsgError = "Error" MsgError = "Error"
End Try End Try
@@ -1030,20 +1000,17 @@ Partial Class Bancos_PolizaCheque
End If End If
End If End If
'El movimiento 2 es el de Pago 'El movimiento 2 es el de Pago
If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
If idCuentaContabilizacion > 0 Then
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
'Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) 'Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
IDPoliza = ObjMov.ContaIdPoliza IDPoliza = ObjMov.ContaIdPoliza
Else
MsgError = "Error al contabilizar"
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
End If
Else Else
Alert("No se puede contabilizar la Prepoliza debido a que una o mas cuentas son inválidas", TipoMensaje.MsgError) MsgError = "Error al contabilizar"
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico", TipoMensaje.MsgError)
End If End If
End If End If
@@ -1067,7 +1034,15 @@ Partial Class Bancos_PolizaCheque
TxtImporte.Text = "" TxtImporte.Text = ""
TxtPagueseA.Text = "" TxtPagueseA.Text = ""
TxtObservaciones.Text = "" TxtObservaciones.Text = ""
Alert($"El Movimiento se guardo correctamente <br><br> <a href=""/Bancos/IE.aspx?CveIE={CveIE}"" target=""_blank"">Movimiento</a><br/><a href=""/Contabilidad/RegPoliza.aspx?IdPoliza={ObjMov.ContaIdPoliza}"" target=""_blank"">{If(ObjMov.ContaIdPoliza > 0, "Ver Póliza", "")}</a>", TipoMensaje.MsgInformacion, "window.location.reload();") 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)
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
StrMsg.AppendFormat("<br/><a href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"" target=""_blank"" class='Texto'> Ver Póliza</a>", CvePrePoliza)
Else
StrMsg.AppendFormat("<br/><a href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"" target=""_blank"" class='Texto'> Ver Póliza</a>", ObjMov.ContaIdPoliza)
End If
Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "window.location.reload();")
Else Else
Alert(MsgError.ToString, TipoMensaje.MsgError) Alert(MsgError.ToString, TipoMensaje.MsgError)
ObjIE.RollBack() ObjIE.RollBack()
@@ -1090,8 +1065,6 @@ Partial Class Bancos_PolizaCheque
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 '' -------------------------------------- codigo para generar la poliza del cheque

View File

@@ -1402,11 +1402,15 @@ Partial Class Bancos_PopIECompras
'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.TCPago = TxtTipoCambio.Text.ToDecimal Pago.TCPago = TxtTipoCambio.Text.ToDecimal
Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES ElseIf Pago.CveMonedaPago = 2 AndAlso CompraActual.CveMoneda = 2 Then 'Si la venta viene en Dolares y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal Pago.TCPago = TxtTipoCambio.Text.ToDecimal
ElseIf Pago.CveMonedaPago = 2 AndAlso CompraActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES ElseIf Pago.CveMonedaPago = 2 AndAlso CompraActual.CveMoneda = 1 Then 'Si la venta viene en pesos y se va a pagar en DOLARES
Pago.TCPago = TxtTipoCambio.Text.ToDecimal Pago.TCPago = TxtTipoCambio.Text.ToDecimal
Pago.TCCambioMoneda = TxtTipoCambio.Text.ToDecimal
End If End If
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = TxtTipoCambio.Text.ToDecimal
If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0 If TxtComision.Text.ToDecimal <> 0 Then Pago.OtroGastoIngreso = TxtComision.Text.ToDecimal Else Pago.OtroGastoIngreso = 0
@@ -1416,6 +1420,7 @@ Partial Class Bancos_PopIECompras
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
'Importe de pago 'Importe de pago
Pago.ImportePago = ImportePagado Pago.ImportePago = ImportePagado
Pago.CveIE = CveIE Pago.CveIE = CveIE
@@ -1473,8 +1478,6 @@ Partial Class Bancos_PopIECompras
Alert("No se encontro movimientos bancarios de personal", TipoMensaje.MsgAdvertencia) Alert("No se encontro movimientos bancarios de personal", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
End If End If
Dim saldo As Decimal = DtCheques.Rows(DDlCheques.SelectedIndex)("Saldo").ToString.ToDecimal Dim saldo As Decimal = DtCheques.Rows(DDlCheques.SelectedIndex)("Saldo").ToString.ToDecimal
If TxtImporte.Text.ToDecimal > saldo Then If TxtImporte.Text.ToDecimal > saldo Then
@@ -1503,6 +1506,8 @@ Partial Class Bancos_PopIECompras
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / rw.DataKey("TipoCambio").ToDecimal
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = rw.DataKey("TipoCambio").ToDecimal
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"
@@ -1542,14 +1547,18 @@ Partial Class Bancos_PopIECompras
Exit Sub Exit Sub
End If End If
For Each rw As GridViewRow In GvDeudores.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
Pago = New CompraPago
If ChkPagarPesos.Checked Then Pago.TCCambioMoneda = 1 / TxtTipoCambio.Text.ToDecimal
If ChkPagarDolares.Checked Then Pago.TCCambioMoneda = TxtTipoCambio.Text.ToDecimal
Pago.CveIE = rw.DataKey("CveIE").ToEntero Pago.CveIE = rw.DataKey("CveIE").ToEntero
Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero Pago.CveMonedaPago = rw.DataKey("CveMoneda").ToEntero
Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal Pago.ImportePago = rw.FCTextBox("TxtSaldoDeudor").Text.ToDecimal
Pago.TCPago = rw.DataKey("TipoCambio").ToDecimal Pago.TCPago = TxtTipoCambio.Text.ToDecimal
Pago.CveProveedor = DdlDeudor.SelectedValue.ToEntero Pago.CveProveedor = DdlAcreedor.SelectedValue.ToEntero
Pago.TipoPago = "DD" Pago.TipoPago = "Egsc"
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
@@ -1624,9 +1633,14 @@ Partial Class Bancos_PopIECompras
If ObjConta IsNot Nothing Then ObjConta.Commit() If ObjConta IsNot Nothing Then ObjConta.Commit()
Dim StrMsg As New StringBuilder Dim StrMsg As New StringBuilder
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 IdPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then StrMsg.AppendFormat("<br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza) 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)
Else
If IdPoliza > 0 Then
StrMsg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
End If
End If
If RBLContado.SelectedValue.ToEntero = 6 And ChkEmitirComplementoPago.Checked Then GeneraTimbre(CvePrePoliza) Else Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") If RBLContado.SelectedValue.ToEntero = 6 And ChkEmitirComplementoPago.Checked Then GeneraTimbre(CvePrePoliza) Else Alert(StrMsg.ToString, TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
EnviarCorreoNotificacion(CveIE, NotificarA, "", UsuarioActual, False) EnviarCorreoNotificacion(CveIE, NotificarA, "", UsuarioActual, False)

View File

@@ -3402,17 +3402,14 @@ Partial Class Bancos_PopIEVentas
'Conta ContPAQ 'Conta ContPAQ
If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then If UsuarioActual.Empresa.Funcionalidad(200) = "1" And MsgError = "" Then
If idCuentaContabilizacion > 0 Then
If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then If ObjMov.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa) Then
IdPoliza = ObjMov.ContaIdPoliza IdPoliza = ObjMov.ContaIdPoliza
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion) ' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
Else
Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
End If
Else Else
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son invalidas: {0}", CuentasContablesInvalidas)) Alert("Ocurrio un error al contabilizar, pongase en contacto con Soporte Técnico")
End If End If
End If End If
End If End If
@@ -3461,11 +3458,12 @@ Partial Class Bancos_PopIEVentas
If IdPoliza > 0 Then If IdPoliza > 0 Then
StrMsg.AppendFormat("<br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza) StrMsg.AppendFormat("<br/><a Class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IdPoliza)
End If End If
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
StrMsg.AppendFormat("</br> <br/>Póliza: <b> <a href='/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", CvePrePoliza, ObjMov.ContaFolio)
End If
Alert($"{StrMsg.ToString}<br/>", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();") Alert($"{StrMsg.ToString}<br/>", TipoMensaje.MsgInformacion, "self.parent.tb_remove();self.parent.location.reload();")
'Limpiar
'LimpiarTodo()
Else Else
ObjIE.RollBack() ObjIE.RollBack()
Alert(MsgError, TipoMensaje.MsgError) Alert(MsgError, TipoMensaje.MsgError)

View File

@@ -453,12 +453,21 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas
// Msg.AppendFormat(@"<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">{1}</a> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem)); // Msg.AppendFormat(@"<br/><br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">{1}</a> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)), String.Format("Imprimir {0}", DdlTipoTransaccion.SelectedItem));
// } // }
//} //}
ObjIE.Commit();
if (UsuarioActual.Empresa.TipoContabilidad == 1)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza);
}
else
{
if (IDPoliza > 0)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza);
}
}
if (IDPoliza > 0)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza);
}
ObjIE.Commit();
} }
else else
{ {
@@ -757,10 +766,17 @@ public partial class Bancos_PrestamoPersonal : ClsPaginas
archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuentaPrestamo.SelectedValue.ToEntero())); archivo = new System.IO.FileInfo(String.Format("{0}Formatos/ComprobanteEgreso.rdlc", UsuarioActual.Empresa.Ruta, DdlCuentaPrestamo.SelectedValue.ToEntero()));
} }
if (IDPoliza > 0) if (UsuarioActual.Empresa.TipoContabilidad == 1)
{ {
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza); Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={0}"">Ver Póliza</a>", CvePrePoliza);
} }
else
{
if (IDPoliza > 0)
{
Msg.AppendFormat(@"<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza</a>", IDPoliza);
}
}
} }
else else

View File

@@ -1101,7 +1101,7 @@ Partial Class Bancos_ProveedoresAbonar
Msg.AppendFormat("<li> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir movimiento</a></li> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE))) Msg.AppendFormat("<li> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir movimiento</a></li> ", Encripta(String.Format("OP=IECHEQUE&CVEIE={0}", CveIE)))
'End If 'End If
Msg.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Listado</a></li>", Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIE))) Msg.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Listado</a></li>", Encripta(String.Format("OP=ImprimeMov&CveIE={0}", CveIE)))
If IDPoliza > 0 Then Msg.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Póliza</a></li>", IDPoliza) If IDPoliza > 0 AndAlso UsuarioActual.Empresa.TipoContabilidad = 2 Then Msg.AppendFormat("<li><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Póliza</a></li>", IDPoliza)
Dim Mensaje As String = String.Format("<br />El Documento se generó correctamente.<br /><br /><br />Descargas:<ul>{0}</ul>", Msg.ToString) Dim Mensaje As String = String.Format("<br />El Documento se generó correctamente.<br /><br /><br />Descargas:<ul>{0}</ul>", Msg.ToString)

View File

@@ -5897,15 +5897,16 @@
txtvalue = ToDouble(txtvalue * TCAnticipo); txtvalue = ToDouble(txtvalue * TCAnticipo);
importevalue = ToDouble(importevalue * TCAnticipo); importevalue = ToDouble(importevalue * TCAnticipo);
} }
} }
else { TCC = 1; }
var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt()).toFixed(2); // le agrego lo del valor actual para validarlo var DifSaldo = (TotalSaldoCompra - FnSumaValoresAnt()).toFixed(2); // le agrego lo del valor actual para validarlo
if (t.checked) if (t.checked)
{ {
if (DifSaldo > importevalue) { if (DifSaldo > importevalue) {
txt.value = ToDouble(importevalue*TCC).toFixed(2); txt.value = toFixed(ToDouble(importevalue*TCC),2);
} else { } else {
txt.value = ToDouble(DifSaldo*TCC).toFixed(2); txt.value = toFixed(ToDouble(DifSaldo*TCC),2);
} }
} else { } else {
txt.value = ""; txt.value = "";
@@ -5914,7 +5915,7 @@
$("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2)); $("#LblTotalAnticipos").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2)); $("#LblAplicadoCompraAnt").text(FormatoNumero(FnSumaValoresAnt(), 2));
$("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2)); $("#LblAplicadoCompraAntComision").text(FormatoNumero(FnSumaValoresAntComisiones(), 2));
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2)); $("#LblSaldoFactura").text(FormatoNumero(TotalSaldoCompra - FnSumaValoresAnt(), 2));
} }
@@ -5948,7 +5949,7 @@
txtvalue = ToDouble(txtvalue * TCAnticipo); txtvalue = ToDouble(txtvalue * TCAnticipo);
} }
var SaldoCompra = (TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue)).toFixed(2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2)); var SaldoCompra = toFixed(TotalSaldo - FnSumaValoresAnt() + ToDouble(txtvalue),2); // le agrego lo del valor actual para validarlo //parseFloat(parseFloat($get('HdnCompraSaldo').value).toFixed(2));
if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue; if (SaldoCompra < 0) txt.value = SaldoCompra - txtvalue;
//minimo entre saldocompra y el saldoanticipo //minimo entre saldocompra y el saldoanticipo
@@ -5971,6 +5972,11 @@
$("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2)); $("#LblSaldoFactura").text(FormatoNumero(TotalSaldo - FnSumaValoresAnt(), 2));
} }
//funcion para truncar en lugar de redondear
function toFixed(num, fixed) {
var re = new RegExp('^-?\\d+(?:\.\\d{0,' + (fixed || -1) + '})?');
return num.toString().match(re)[0];
}
function FnSumaValoresAnt() { function FnSumaValoresAnt() {
var totalPoints = 0; var totalPoints = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -29,6 +29,9 @@ Partial Class Contabilidad_CatCuentas
If Not Page.IsPostBack Then If Not Page.IsPostBack Then
'inicio() 'inicio()
'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');") 'RegistraScript("$('#Tsubcuenta').mask('00000-0000-0000-00000');")
If UsuarioActual.Empresa.TipoContabilidad = 1 OrElse UsuarioActual.CveEmpresa = 119 Then
Server.Transfer("/Contabilidad2/CatCuentas.aspx")
End If
If UsuarioActual.Empresa.UsaContabilidad Then If UsuarioActual.Empresa.UsaContabilidad Then
CargaMonedas() CargaMonedas()

View File

@@ -192,7 +192,7 @@
<asp:LinkButton ID="LnkSimplificar" runat="server" OnClick="LnkSimplificarCompra_Click" ToolTip="Simplificar Póliza"><i class='fa fa-exchange'></i></asp:LinkButton> <asp:LinkButton ID="LnkSimplificar" runat="server" OnClick="LnkSimplificarCompra_Click" ToolTip="Simplificar Póliza"><i class='fa fa-exchange'></i></asp:LinkButton>
</td> </td>
<td style="width: 70px; text-align: left;"> <td style="width: 70px; text-align: left;">
<asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" Visible="false" CssClass="Texto" Text="Ver Poliza" NavigateUrl='<%# Eval("IdPoliza", "/Contabilidad/RegPoliza.aspx?IdPoliza={0}")%>'></asp:HyperLink> <asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" CssClass="Texto" Text="Ver Poliza" ></asp:HyperLink>
</td> </td>
</tr> </tr>
<tr style="color: black;"> <tr style="color: black;">
@@ -296,7 +296,7 @@
<asp:LinkButton ID="LnkSimplificar" runat="server" OnClick="LnkSimplificar_Click" ToolTip="Simplificar Póliza"><i class='fa fa-exchange'></i></asp:LinkButton> <asp:LinkButton ID="LnkSimplificar" runat="server" OnClick="LnkSimplificar_Click" ToolTip="Simplificar Póliza"><i class='fa fa-exchange'></i></asp:LinkButton>
</td> </td>
<td style="width: 70px; text-align: left;"> <td style="width: 70px; text-align: left;">
<asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" Visible="false" CssClass="Texto" Text="Ver Poliza" NavigateUrl='<%# Eval("IdPoliza", "/Contabilidad/RegPoliza.aspx?IdPoliza={0}")%>'></asp:HyperLink> <asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" CssClass="Texto" Text="Ver Poliza"></asp:HyperLink>
</td> </td>
</tr> </tr>
<tr style="color: black; display:none;"> <tr style="color: black; display:none;">
@@ -386,7 +386,7 @@
<asp:HyperLink ID="HplEdicion" runat="server" Target="_blank" CssClass="Texto" Visible="false" Text="Editar" NavigateUrl='<%# Eval("CvePrePoliza", "/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}")%>'></asp:HyperLink> <asp:HyperLink ID="HplEdicion" runat="server" Target="_blank" CssClass="Texto" Visible="false" Text="Editar" NavigateUrl='<%# Eval("CvePrePoliza", "/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}")%>'></asp:HyperLink>
</td> </td>
<td style="width: 70px; text-align: left;"> <td style="width: 70px; text-align: left;">
<asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" Visible="false" CssClass="Texto" Text="Ver Poliza" NavigateUrl='<%# Eval("IdPoliza", "/Contabilidad/RegPoliza.aspx?IdPoliza={0}")%>'></asp:HyperLink> <asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" CssClass="Texto" Text="Ver Poliza" ></asp:HyperLink>
</td> </td>
</tr> </tr>
<tr style="color: black;display:none;"> <tr style="color: black;display:none;">
@@ -476,7 +476,7 @@
<asp:HyperLink ID="HplEdicion" runat="server" Target="_blank" CssClass="Texto" Visible="false" Text="Editar" NavigateUrl='<%# Eval("CvePrePoliza", "/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}")%>'></asp:HyperLink> <asp:HyperLink ID="HplEdicion" runat="server" Target="_blank" CssClass="Texto" Visible="false" Text="Editar" NavigateUrl='<%# Eval("CvePrePoliza", "/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}")%>'></asp:HyperLink>
</td> </td>
<td style="width: 70px; text-align: left;"> <td style="width: 70px; text-align: left;">
<asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" Visible="false" CssClass="Texto" Text="Ver Poliza" NavigateUrl='<%# Eval("IdPoliza", "/Contabilidad/RegPoliza.aspx?IdPoliza={0}")%>'></asp:HyperLink> <asp:HyperLink ID="HLPoliza" runat="server" Target="_blank" CssClass="Texto" Text="Ver Poliza" ></asp:HyperLink>
</td> </td>
</tr> </tr>
<tr style="color: black;"> <tr style="color: black;">

View File

@@ -128,7 +128,6 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
e.Row.FCCheckBox("Chk").Enabled = false; e.Row.FCCheckBox("Chk").Enabled = false;
e.Row.FCCheckBox("Chk").ToolTip = "Póliza ya contabilizada"; e.Row.FCCheckBox("Chk").ToolTip = "Póliza ya contabilizada";
} }
GvD.DataSource = contP.DtResultados; GvD.DataSource = contP.DtResultados;
} }
else else
@@ -137,22 +136,31 @@ public partial class Contabilidad_ContabilizacionCompras : ClsPaginas
} }
} }
if (TienePermisoEditar) if (TienePermisoEditar)
{ {
e.Row.FCHyperLink("HplEdicion").Visible = true; e.Row.FCHyperLink("HplEdicion").Visible = true;
} }
e.Row.FCHyperLink("HLPoliza").Visible = TienePermisoVerPoliza & e.Row.DBCampo("IdPoliza").ToEntero() > 0; if (UsuarioActual.Empresa.TipoContabilidad == 1) // conta SIG
{
e.Row.FCHyperLink("HLPoliza").Visible = TienePermisoVerPoliza & e.Row.DBCampo("FolioPoliza").ToEntero() > 0;
e.Row.FCHyperLink("HLPoliza").NavigateUrl = $"/Contabilidad/RegPrePolizas.aspx?CvePrePoliza={e.Row.DBCampo("CvePrePoliza")}";
}
else
{
if (UsuarioActual.Empresa.TipoContabilidad == 2) // conta Contpaq
{
e.Row.FCHyperLink("HLPoliza").Visible = TienePermisoVerPoliza & e.Row.DBCampo("IdPoliza").ToEntero() > 0;
e.Row.FCHyperLink("HLPoliza").NavigateUrl = $"/Contabilidad/RegPoliza.aspx?IdPoliza={e.Row.DBCampo("IdPoliza")}";
}
}
contP.Dispose(); contP.Dispose();
GvD.DataBind(); GvD.DataBind();
if (e.Row.DBCampo("Moneda") == "USD" && e.Row.FCLinkButton("LBActualizarTC") != null) if (e.Row.DBCampo("Moneda") == "USD" && e.Row.FCLinkButton("LBActualizarTC") != null)
{ {
e.Row.FCLinkButton("LBActualizarTC").Visible = true; e.Row.FCLinkButton("LBActualizarTC").Visible = true;
} }
} }
} }

View File

@@ -109,7 +109,7 @@ Partial Class Contabilidad_DiarioPagos
DdlPolizaTipo.SelectedValue = "2" DdlPolizaTipo.SelectedValue = "2"
'busco si se ocupa el tipo de cambio 'busco si se ocupa el tipo de cambio
CargaDatos(-1) 'CargaDatos(-1)
Cc.Dispose() Cc.Dispose()
Else Else
@@ -1066,16 +1066,13 @@ Partial Class Contabilidad_DiarioPagos
End If End If
FluctuacionCambiaria += Math.Round((CompraPagadoRetISR * TipoCambioCompra) - (CompraPagadoRetISR * TipoCambioPago), 2) 'FLUCTUACION CAMBIARIA DE ISR FluctuacionCambiaria += Math.Round((CompraPagadoRetISR * TipoCambioCompra) - (CompraPagadoRetISR * TipoCambioPago), 2) 'FLUCTUACION CAMBIARIA DE ISR
Dim Dif As Double = (CompraPagadoTotal * TipoCambioPago) - Math.Round(CompraPagadoTotal * TipoCambioCompra, 2) + FluctuacionCambiaria Dim Dif As Decimal = (CompraPagadoTotal * TipoCambioPago) - Math.Round(CompraPagadoTotal * TipoCambioCompra, 2) + FluctuacionCambiaria
If Dif < 0 Then If Dif < 0 Then
tempMovto = True ' ganancia cambiaria CtaFluctuacion = If(UsuarioActual.CveEmpresa = 13, 579, 0) : tempMovto = True ' ganancia cambiaria
Else Else
tempMovto = False ' perdida cambiaria CtaFluctuacion = If(UsuarioActual.CveEmpresa = 13, 578, 0) : tempMovto = False ' perdida cambiaria
End If End If
ConceptoDetalle = String.Format("{0} TC:{1} ${2}", gvr.FCTextBox("TxtDescripcion").Text, TipoCambioPago, Math.Abs(Dif).FormatoNumero) ConceptoDetalle = String.Format("{0} TC:{1} ${2}", gvr.FCTextBox("TxtDescripcion").Text, TipoCambioPago, Math.Abs(Dif).FormatoNumero)

View File

@@ -81,15 +81,11 @@
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<br />
<div id="DivBusqueda" runat="server" align="Right"> <div id="DivBusqueda" runat="server" align="Right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", Gv.ClientID) %>" style="display: inline-block; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", Gv.ClientID) %>" style="display: inline-block; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", Gv.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", Gv.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<div class="portlet-body"> <div class="portlet-body">

View File

@@ -284,32 +284,41 @@ Partial Class ContabilidadC_RegPrePolizaS
If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then If Request("CvePrePoliza") IsNot Nothing AndAlso IsNumeric(Request("CvePrePoliza")) AndAlso Request("CvePrePoliza").ToEntero > 0 Then
ViewState("CvePrePoliza") = Request("CvePrePoliza").ToEntero
CreaDT() CreaDT()
CreaDTEliminar() CreaDTEliminar()
CargaPrePoliza() If CargaPrePoliza(Request("CvePrePoliza").ToEntero) Then
If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then If IfNull(Request("Tipo"), "").ToString <> "NOMPROV" Then
GvPrePoliza.Columns(5).Visible = False GvPrePoliza.Columns(5).Visible = False
DivTG.Visible = False DivTG.Visible = False
GvMov.Columns(5).Visible = False GvMov.Columns(5).Visible = False
End If End If
ValidaCrearAPartirDe() ValidaCrearAPartirDe()
DvPlantilla.Visible = False DvPlantilla.Visible = False
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If Folio.ToEntero > 0 Then
BtnDescontabilizar.Visible = True
LnkFolioManual.Visible = False
Else
BtnDescontabilizar.Visible = False
LnkFolioManual.Visible = True
End If
If UsuarioActual.Empresa.TipoContabilidad = 1 Then
If Folio.ToEntero > 0 Then
BtnDescontabilizar.Visible = True
LnkFolioManual.Visible = False
Else
BtnDescontabilizar.Visible = False
LnkFolioManual.Visible = True
End If End If
Exit Sub
Else
BtnEliminar.Visible = False
LnkExcel.Visible = True
LnkImprimirPDF.Visible = False
DvPlantilla.Visible = True
TxtFechaDocumento.Text = Now.ToString("dd/MM/yyyy")
TxtFechaelaboracion.Text = Now.ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True
TxtUsuarioElaboro.Text = UsuarioActual.Usuario
End If End If
Exit Sub
ElseIf Request("CvePrePolizaOrigen") IsNot Nothing AndAlso IsNumeric(Request("CvePrePolizaOrigen")) AndAlso Request("CvePrePolizaOrigen").ToEntero > 0 Then ElseIf Request("CvePrePolizaOrigen") IsNot Nothing AndAlso IsNumeric(Request("CvePrePolizaOrigen")) AndAlso Request("CvePrePolizaOrigen").ToEntero > 0 Then
@@ -334,10 +343,6 @@ Partial Class ContabilidadC_RegPrePolizaS
TxtFechaelaboracion.Text = Now.ToString("dd/MM/yyyy") TxtFechaelaboracion.Text = Now.ToString("dd/MM/yyyy")
TxtConcepto.Enabled = True TxtConcepto.Enabled = True
TxtUsuarioElaboro.Text = UsuarioActual.Usuario TxtUsuarioElaboro.Text = UsuarioActual.Usuario
DvPlantilla.Visible = True
'LnkAddConcepto.Visible = False
'UpPrePoliza.Visible = False
End If End If
@@ -366,8 +371,6 @@ Partial Class ContabilidadC_RegPrePolizaS
GvMov.Columns(5).Visible = False GvMov.Columns(5).Visible = False
End If End If
End If End If
End Sub End Sub
@@ -437,14 +440,18 @@ Partial Class ContabilidadC_RegPrePolizaS
End With End With
DtMovimientosEliminar.AcceptChanges() DtMovimientosEliminar.AcceptChanges()
End Sub End Sub
Private Sub CargaPrePoliza() Private Function CargaPrePoliza(tCvePrePoliza As Integer) As Boolean
BtnEliminar.Visible = True Dim retorno As Boolean = False
LblEncabezado.Text = "Edición de Póliza"
Dim ObjContabilidad As New ClsContabilidad Dim ObjContabilidad As New ClsContabilidad
If ObjContabilidad.GetPrePoliza(CvePrePoliza, UsuarioActual.CveEmpresa) Then If ObjContabilidad.GetPrePoliza(tCvePrePoliza, UsuarioActual.CveEmpresa) Then
Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("") Dim dr As DataRow = ObjContabilidad.DtResultados.FiltroPrimero("")
If dr IsNot Nothing Then If dr IsNot Nothing Then
retorno = True
BtnEliminar.Visible = True
LblEncabezado.Text = "Edición de Póliza"
ViewState("CvePrePoliza") = tCvePrePoliza
DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza") DdlTipoPoliza.SelectedValue = dr("CveTipoPoliza")
TxtFechaDocumento.Text = dr("Fecha") TxtFechaDocumento.Text = dr("Fecha")
TxtConcepto.Text = dr("Concepto") TxtConcepto.Text = dr("Concepto")
@@ -544,7 +551,8 @@ Partial Class ContabilidadC_RegPrePolizaS
ObjContabilidad.Dispose() ObjContabilidad.Dispose()
UpPoliza.Update() UpPoliza.Update()
End Sub Return retorno
End Function
Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound Private Sub GvPrePoliza_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPrePoliza.RowDataBound
@@ -562,8 +570,8 @@ Partial Class ContabilidadC_RegPrePolizaS
Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero Dim CveConceptoContable As Integer = e.Row.DataKey("CveConceptoContable").ToEntero
If CveConceptoContable.Contiene(1, 2, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta")) If CveConceptoContable.Contiene(1, 2, 12, 91, 13, 38, 207, 203, 39, 61, 62, 63, 4, 278, 291, 292, 293, 294, 272, 150, 251, 301) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Ventas/Ventas.aspx?CveVenta={0}", e.Row.DataKey("CveVenta"))
If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 341, 342, 304, 272, 259) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra")) If CveConceptoContable.Contiene(5, 6, 17, 18, 14, 19, 25, 26, 60, 205, 225, 234, 235, 240, 305, 306, 307, 308, 309, 310, 311, 312, 201, 206, 341, 342, 343, 344, 304, 272, 259) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DataKey("CveCompra"))
If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen")) If CveConceptoContable.Contiene(68) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}", e.Row.DBCampo("CveMovimientoAlmacen"))
If CveConceptoContable.Contiene(30, 204, 66, 92) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE")) If CveConceptoContable.Contiene(30, 204, 66, 92) Then e.Row.FCHyperLink("HlReferencia").NavigateUrl = String.Format("/Bancos/IE.aspx?CveIE={0}", e.Row.DBCampo("CveIE"))
@@ -1044,7 +1052,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TipoMovto = True TipoMovto = True
If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.DataKey("ImporteME").ToDecimal If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.DataKey("ImporteME").ToDecimal
If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.DataKey("TC").ToDecimal If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.DataKey("TxtTC").ToDecimal
End If End If
Else Else
@@ -1061,7 +1069,7 @@ Partial Class ContabilidadC_RegPrePolizaS
TipoMovto = False TipoMovto = False
If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.DataKey("ImporteME").ToDecimal If gvr.DataKey("EsComplementaria") = "True" Then ImporteME = gvr.DataKey("ImporteME").ToDecimal
If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.DataKey("TC").ToDecimal If gvr.DataKey("EsMonedaExtranjera") = "True" Then TipoCambio = gvr.DataKey("TxtTC").ToDecimal
End If End If
End If End If
@@ -1274,7 +1282,7 @@ Partial Class ContabilidadC_RegPrePolizaS
End If End If
ObjContabilidad.Dispose() ObjContabilidad.Dispose()
CargaPrePoliza() CargaPrePoliza(CvePrePoliza)
If Not OcurrioError Then If Not OcurrioError Then
If IdPoliza > 0 AndAlso contador Then If IdPoliza > 0 AndAlso contador Then
@@ -2310,7 +2318,7 @@ Partial Class ContabilidadC_RegPrePolizaS
{ {
.ConceptoAdministrativo = row.Item("ConceptoContable"), .ConceptoAdministrativo = row.Item("ConceptoContable"),
.Cuenta = row.Item("Codigo"), .Cuenta = row.Item("Codigo"),
.NombreCuenta = row.Item("NombreCuenta"), .NombreCuenta = row.Item("CodigoNombreCuenta"),
.Cargo = "", .Cargo = "",
.Abono = "", .Abono = "",
.Referencia = "", .Referencia = "",

View File

@@ -74,7 +74,7 @@
<asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional"> <asp:UpdatePanel runat="server" ID="UpDatos" UpdateMode="Conditional">
<ContentTemplate> <ContentTemplate>
<asp:GridView runat="server" ID="GvDatos" EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover ScrollAD" <asp:GridView runat="server" ID="GvDatos" EmptyDataText="" ToolTip="" CssClass="table table-striped table-advance table-hover ScrollAD"
DataKeyNames="CveCuentaAsignacion,CveConceptoContable,CveCuenta,IdCuenta,CveProveedor,CveCliente,CvePersonal,CveClasificacion,CveAlmacen,PorcentajeIVA,CveConceptoNomina,CveBancoCuenta,CveActivoFijo,CveSubProyecto,CveTipoGasto" AutoGenerateColumns="False" DataKeyNames="CveCuentaAsignacion,CveConceptoContable,CveCuenta,IdCuenta,CveProveedor,CveCliente,CvePersonal,CveClasificacion,CveAlmacen,PorcentajeIVA,CveConceptoNomina,CveBancoCuenta,CveActivoFijo,CveSubProyecto,CveTipoGasto,CveCredito" AutoGenerateColumns="False"
Style=" width:100%" GridLines="None"> Style=" width:100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField DataField="ConceptoContable" ItemStyle-Width="150px" HeaderText="Concepto Contable" ItemStyle-HorizontalAlign="Left"/> <asp:BoundField DataField="ConceptoContable" ItemStyle-Width="150px" HeaderText="Concepto Contable" ItemStyle-HorizontalAlign="Left"/>
@@ -186,6 +186,10 @@
<asp:DropDownList ID="DdlActivoFijo" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" DataTextField="Descripcion" DataValueField="CveActivoFijo" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList> <asp:DropDownList ID="DdlActivoFijo" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" DataTextField="Descripcion" DataValueField="CveActivoFijo" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlActivoFijo.ClientID.ToString()%>">Activo Fijo: </label> <label for="<%= DdlActivoFijo.ClientID.ToString()%>">Activo Fijo: </label>
</div> </div>
<div class="form-group form-md-line-input input-iconright" id="divCredito" runat="server" visible="false">
<asp:DropDownList ID="DdlCreditos" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" DataTextField="Referencia" DataValueField="CveCredito" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlCreditos.ClientID.ToString()%>">Crédito: </label>
</div>
<div class="form-group form-md-line-input input-iconright" id="divSubProyectos" runat="server" visible="false"> <div class="form-group form-md-line-input input-iconright" id="divSubProyectos" runat="server" visible="false">
<asp:DropDownList ID="DdlSubProyectos" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList> <asp:DropDownList ID="DdlSubProyectos" CssClass="form-control input-sm select2me js-cuenta-programmatic select2me" runat="server" AppendDataBoundItems="true" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="240px" ValidationGroup="GrpModulo" Enabled="false"></asp:DropDownList>
<label for="<%= DdlSubProyectos.ClientID.ToString()%>">Sub Proyectos: </label> <label for="<%= DdlSubProyectos.ClientID.ToString()%>">Sub Proyectos: </label>

View File

@@ -180,6 +180,18 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlPersonal.SelectedText = drp DdlPersonal.SelectedText = drp
End If End If
If GvRow.DataKey("CveCredito").ToEntero > 0 Then
DdlCreditos.Items.Clear()
DdlCreditos.ClearSelection()
Dim ObjCreditos As New ClsBancos
If ObjCreditos.GetCreditos(-1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
DdlCreditos.DataSource = ObjCreditos.DtResultados.FiltraParametros("", DistinctColumns:={"CveCredito", "Referencia"})
End If
ObjCreditos.Dispose()
DdlCreditos.DataBind()
DdlCreditos.SelectedValue = GvRow.DataKey("CveCredito")
End If
LbAgregar.Text = "Actualizar" LbAgregar.Text = "Actualizar"
UpModalModulos.Update() UpModalModulos.Update()
RegistraScript("$('#ModalCat').modal();") RegistraScript("$('#ModalCat').modal();")
@@ -203,6 +215,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
divAlmacen.Visible = Boolean.Parse(Dr("AplicaAlmacen").ToString) divAlmacen.Visible = Boolean.Parse(Dr("AplicaAlmacen").ToString)
divSubProyectos.Visible = Boolean.Parse(Dr("AplicaSubProyecto").ToString) divSubProyectos.Visible = Boolean.Parse(Dr("AplicaSubProyecto").ToString)
divActivoFijo.Visible = Boolean.Parse(Dr("AplicaActivoFijo").ToString) divActivoFijo.Visible = Boolean.Parse(Dr("AplicaActivoFijo").ToString)
divCredito.Visible = Boolean.Parse(Dr("AplicaCredito").ToString)
DdlActivoFijo.Enabled = False DdlActivoFijo.Enabled = False
@@ -215,10 +228,8 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
Else Else
DdlActivoFijo.Enabled = False DdlActivoFijo.Enabled = False
End If End If
End If End If
divConceptoNomina.Visible = Dr("AplicaNomina").ToString = "True" divConceptoNomina.Visible = Dr("AplicaNomina").ToString = "True"
If CveConceptoContable = 51 Then If CveConceptoContable = 51 Then
@@ -231,6 +242,21 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
If Dr("CveTipoSaldo").ToString = "1" Then If Dr("CveTipoSaldo").ToString = "1" Then
divRegeneraCuenta.Visible = True divRegeneraCuenta.Visible = True
End If End If
If Dr("AplicaCredito").ToString = "True" Then
Dim ObjCreditos As New ClsBancos
If ObjCreditos.GetCreditos(-1, -1, -1, -1, -1, UsuarioActual.CveEmpresa) Then
DdlCreditos.DataSource = ObjCreditos.DtResultados.FiltraParametros("", DistinctColumns:={"CveCredito", "Referencia"})
End If
ObjCreditos.Dispose()
DdlCreditos.DataBind()
If OpAgregar Then
DdlCreditos.Enabled = True
Else
DdlCreditos.Enabled = False
End If
End If
End If End If
End Sub End Sub
@@ -322,7 +348,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero,
CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, RegeneraCuenta:=chkRegeneraCuenta.Checked) Then CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, CveCredito:=DdlCreditos.SelectedValue.ToEntero, RegeneraCuenta:=chkRegeneraCuenta.Checked) Then
ErrorString = "Error al agregar" ErrorString = "Error al agregar"
End If End If
ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then ElseIf HdnCveCuentaAsignacion.Value.ToEntero > 0 Then
@@ -330,7 +356,7 @@ Partial Class Contabilidad2_CatCuentasAsignaciones
DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero, DdlProveedor.SelectedValue.ToEntero, DdlClientes.SelectedValue.ToEntero, DdlPersonal.SelectedValue.ToEntero,
DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(), DdlClasificacion.SelectedValue.ToEntero, DdlAlmacen.SelectedValue.ToEntero, TxtPorcentajeIVA.Text.ToDecimal, CveBancoCuenta:=DdlCuentaBancaria.SelectedValue.ToEntero(),
CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero, CveConceptoNomina:=DdlConceptoNomina.SelectedValue.ToEntero(), CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, CveActivoFijo:=DdlActivoFijo.SelectedValue.ToEntero,
CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, RegeneraCuenta:=chkRegeneraCuenta.Checked) Then CveTipoGasto:=DdlTipoGasto.SelectedValue.ToEntero, CveCredito:=DdlCreditos.SelectedValue.ToEntero, RegeneraCuenta:=chkRegeneraCuenta.Checked) Then
ErrorString = "Error al actualizar" ErrorString = "Error al actualizar"
End If End If
End If End If

View File

@@ -137,26 +137,18 @@
<div class="col-md-2"> <div class="col-md-2">
<asp:DropDownList ID="DdlSubproyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True"> <asp:DropDownList ID="DdlSubproyecto" CssClass="form-control input-sm select2me" runat="server" DataTextField="SubProyecto" DataValueField="CveSubProyecto" Width="95%" AutoPostBack="True">
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<div class="row" style="margin-right: 10px; margin-top: 8px;" align="right">
<br />
<div class="row" style="margin-right: 10px; margin-top: 18px;" align="right">
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" /> <input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a> <a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GvDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
</div> </div>
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" <asp:GridView ID="GvDatos" runat="server"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover Widthall ScrollAD mysmallbtn" AutoGenerateColumns="False"
EmptyDataText="No se encontrarios movimientos." EmptyDataText="No se encontrarios movimientos."

View File

@@ -697,7 +697,7 @@
<label class="col-md-3">Cliente:</label> <label class="col-md-3">Cliente:</label>
<div class="col-md-9"> <div class="col-md-9">
<%-- <ads:DropDownLost ID="s" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteCarta_SelectedIndexChanged" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" DataTextField="NombreComercial" DataValueField="CveCliente"></ads:DropDownLost>--%> <%-- <ads:DropDownLost ID="s" AutoPostBack="true" OnSelectedIndexChanged="DdlClienteCarta_SelectedIndexChanged" AppendDataBoundItems="true" runat="server" CssClass="form-control input-sm select2me" DataTextField="NombreComercial" DataValueField="CveCliente"></ads:DropDownLost>--%>
<ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteCarta" Width="100%" data-metodo="getcliente" Onselectedindexchange="DdlClienteCarta_SelectedIndexChanged" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost> <ADS:Dropdownlost CssClassDdl="select2me" ID="DdlClienteCarta" Width="100%" data-metodo="getcliente" Onselectedindexchange="DdlClienteCarta_SelectedIndexChanged" runat="server" DataTextField="NombreComercial" DataValueField="CveCliente" CssStyle="width: 100%;"></ADS:Dropdownlost>
</div> </div>
</div> </div>
<div class="row rowpadding" > <div class="row rowpadding" >

View File

@@ -686,8 +686,7 @@ Partial Class Inventarios_EntradasSalidas
TxtFechaLlegada.Text = Now.ToShortDateString TxtFechaLlegada.Text = Now.ToShortDateString
CargarCamiones() CargarCamiones()
DdlClienteCarta.setEsWebService(True)
CargaClientesCarta()
End Sub End Sub
Private Sub CargaPS() Private Sub CargaPS()
@@ -1371,6 +1370,12 @@ Partial Class Inventarios_EntradasSalidas
TieneError = True TieneError = True
End If End If
If Not TieneError Then
If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
TieneError = True
End If
End If
If Inv.MovimientoRemove(CveMovimiento, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then If Inv.MovimientoRemove(CveMovimiento, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
If HdnIdPoliza.Value.ToEntero > 0 Then If HdnIdPoliza.Value.ToEntero > 0 Then
If Not ObjConta.RemovePoliza(HdnIdPoliza.Value.ToEntero) Then If Not ObjConta.RemovePoliza(HdnIdPoliza.Value.ToEntero) Then
@@ -1381,12 +1386,6 @@ Partial Class Inventarios_EntradasSalidas
TieneError = True TieneError = True
End If End If
If Not TieneError Then
If Not Conta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
TieneError = True
End If
End If
If Not TieneError Then If Not TieneError Then
If ObjConta IsNot Nothing Then ObjConta.Commit() If ObjConta IsNot Nothing Then ObjConta.Commit()
Inv.Commit() Inv.Commit()
@@ -5906,18 +5905,11 @@ Partial Class Inventarios_EntradasSalidas
DdlConfigAuto.Items.Clear() DdlConfigAuto.Items.Clear()
DdlUnidadCamion.Items.Clear() DdlUnidadCamion.Items.Clear()
'DdlUnidadCamion.DataSource = GlobalDTInvCamiones(UsuarioActual.CveEmpresa)
'DdlUnidadCamion.DataBind()
Using ObjInv As New ClsInventarios Using ObjInv As New ClsInventarios
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 1, Estatus:=1) Then
DdlUnidadCamion.DataSource = ObjInv.DtResultados DdlUnidadCamion.DataSource = ObjInv.DtResultados
End If End If
If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then If ObjInv.GetCamiones(-1, UsuarioActual.CveEmpresa, 2, Estatus:=1) Then
DdlRemolque1.DataSource = ObjInv.DtResultados DdlRemolque1.DataSource = ObjInv.DtResultados
End If End If
@@ -5926,13 +5918,9 @@ Partial Class Inventarios_EntradasSalidas
DdlUnidadCamion.DataBind() DdlUnidadCamion.DataBind()
DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlUnidadCamion.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
DdlRemolque1.DataBind() DdlRemolque1.DataBind()
DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1")) DdlRemolque1.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
Using ObjGrales As New ClsGenerales Using ObjGrales As New ClsGenerales
If ObjGrales.GetCartaPorteConfigAutoTransportes() Then If ObjGrales.GetCartaPorteConfigAutoTransportes() Then
@@ -5940,27 +5928,9 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End Using End Using
DdlConfigAuto.DataBind() DdlConfigAuto.DataBind()
DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1")) DdlConfigAuto.Items.Insert(0, New ListItem("Seleccione una", "-1"))
'Using ObjGral As New ClsGenerales
' If ObjGral.GetCartaPorteConfigAutoTransportes() Then
' DdlConfigAuto.DataSource = ObjGral.DtResultados
' End If
'End Using
'DdlConfigAuto.DataBind()
End Sub
Private Sub CargaClientesCarta()
'DdlClienteCarta.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa)
'DdlClienteCarta.DataBind()
'DdlClienteCarta.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClienteCarta.SelectedValue = "-1"
End Sub End Sub
Private Sub EmitirTimbrado(CveTimbre As Integer, CveMovimientoTimbrado As Integer, ByRef MensajeAlert As StringBuilder) Private Sub EmitirTimbrado(CveTimbre As Integer, CveMovimientoTimbrado As Integer, ByRef MensajeAlert As StringBuilder)

View File

@@ -135,20 +135,7 @@
</div> </div>
</div> </div>
<div class="portlet-body rowpadding"> <div class="portlet-body rowpadding">
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
<asp:Label runat="server" Text="Tipo" AssociatedControlID="DdlTipo"></asp:Label>
<asp:DropDownList ID="DdlTipo" runat="server" AppendDataBoundItems="True" DataTextField="TipoGasto" DataValueField="TipoGasto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipo" runat="server" ControlToValidate="DdlTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipo" Width="300px" BehaviorID="VCETipo"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
@@ -168,6 +155,20 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
<asp:Label runat="server" Text="Tipo" AssociatedControlID="DdlTipo"></asp:Label>
<asp:DropDownList ID="DdlTipo" runat="server" AppendDataBoundItems="True" DataTextField="TipoGasto" DataValueField="TipoGasto" Class="form-control input-sm select2me" Width="100%" ValidationGroup="GrpGuardar"></asp:DropDownList>
<asp:RequiredFieldValidator ID="RFVTipo" runat="server" ControlToValidate="DdlTipo" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Tipo''</b> es necesario, por favor ingréselo." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCETipo" runat="server" HighlightCssClass="vco" TargetControlID="RFVTipo" Width="300px" BehaviorID="VCETipo"></ajax:ValidatorCalloutExtender>
</div>
</div>
<div class="col-md-6">
<div class="form-group form-md-line-input form-md-floating-label input-iconright">
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">

View File

@@ -225,7 +225,7 @@ public partial class Nomina_CatConcepto : ClsPaginas
} }
protected void CargaConceptoContable() protected void CargaConceptoContable()
{ {
DdlConceptoContable.DataSource = get_GlobalDTContaConceptosContables(-1); DdlConceptoContable.DataSource = get_GlobalDTContaConceptosContables(-1).FiltraParametros("Tipo = 'Nom'");
DdlConceptoContable.DataBind(); DdlConceptoContable.DataBind();
DdlConceptoContable.Items.Insert(0, new ListItem("Seleccione", "-1")); DdlConceptoContable.Items.Insert(0, new ListItem("Seleccione", "-1"));
DdlConceptoContable.SelectedValueExist("-1"); DdlConceptoContable.SelectedValueExist("-1");

View File

@@ -644,7 +644,7 @@
&nbsp; &nbsp;
<asp:DropDownList ID="DdlTipoDeduccion" runat="server" Width="300px"> <asp:DropDownList ID="DdlTipoDeduccion" runat="server" Width="300px">
<asp:ListItem Text="Gasto No Deducible" Value="255" Selected="True"></asp:ListItem> <asp:ListItem Text="Gasto No Deducible" Value="255" Selected="True"></asp:ListItem>
<asp:ListItem Text="Incobrable No Deducible" Value="211"></asp:ListItem> <asp:ListItem Text="Incobrable No Deducible" Value="179"></asp:ListItem>
<asp:ListItem Text="Incobrable Deducible" Value="263"></asp:ListItem> <asp:ListItem Text="Incobrable Deducible" Value="263"></asp:ListItem>
<asp:ListItem Text="Reservas" Value="252"></asp:ListItem> <asp:ListItem Text="Reservas" Value="252"></asp:ListItem>
<asp:ListItem Text="Otros Ingresos" Value="78"></asp:ListItem> <asp:ListItem Text="Otros Ingresos" Value="78"></asp:ListItem>

View File

@@ -2443,7 +2443,7 @@ Partial Class Ventas_ClientesAbonar
Dim ConceptoPartida As String = TxtObsSaldarIncobrable.Text.Trim & " " & gr.DataKey("SerieFolio").ToString Dim ConceptoPartida As String = TxtObsSaldarIncobrable.Text.Trim & " " & gr.DataKey("SerieFolio").ToString
If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero If CveConceptoDeduccion = 255 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(266).ToEntero
If CveConceptoDeduccion = 211 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero If CveConceptoDeduccion = 179 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(559).ToEntero
If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero If CveConceptoDeduccion = 263 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(537).ToEntero
If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero If CveConceptoDeduccion = 252 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.Funcionalidad(581).ToEntero
If CveConceptoDeduccion = 78 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.IdCuentaOtrosIngresos If CveConceptoDeduccion = 78 Then IdCuentaContableNoDeducible = UsuarioActual.Empresa.IdCuentaOtrosIngresos
@@ -2476,22 +2476,18 @@ Partial Class Ventas_ClientesAbonar
Else Else
IdCtaContable = IdCuentaCliente IdCtaContable = IdCuentaCliente
End If End If
Dim ConPreP As ConceptosTipoSaldo = ClsPaginas.ObtenerCveConceptoPrePoliza(6, tCveMoneda, True, 1)
'normal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, ConPreP.CveConcepto, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
If UsaComplementaria AndAlso tCveMoneda = 2 Then If UsaComplementaria AndAlso tCveMoneda = 2 Then
'normal
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
'complementaria 'complementaria
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, 207, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, 0, gr.DataKey("SerieFolio").ToString, ConPreP.CveConceptoComplementario, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContComplementaria, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, (Saldo * TCVenta) - Saldo).RoundSQL, ImporteME:=Saldo, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
Else
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, Saldo, gr.DataKey("SerieFolio").ToString, CveConceptoCliente, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable:=IdCtaContable, CveIE:=-1, IdSegmentoNegocio:=-1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, Saldo, Saldo * TCVenta), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento"
End If
End If End If
'fluctuación. 'fluctuación.
@@ -2519,27 +2515,15 @@ Partial Class Ventas_ClientesAbonar
End If End If
' iva If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=gr.DataKey("PorcetajeIVA").ToDecimal, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
Dim PorcentajeImpuesto As Decimal = gr.DataKey("PorcentajeIVA").ToDecimal
Dim IdCtaIVAXTrasladar As Integer = 0
Dim CveCuentaIVAxTrasladar As Integer = 0
'If GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows.Count > 0 Then
' IdCtaIVAXTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("IdCtaIVAXTrasladar").ToString.ToEntero
' CveCuentaIVAxTrasladar = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeImpuesto).Rows(0)("CveCuentaIVAxTrasladar").ToString.ToEntero
'End If
If (IVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And IVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IVA, gr.DataKey("SerieFolio").ToString, 13, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IVA, IVA * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContRetIVA, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If (RETIVA > 0 Or UsuarioActual.CveEmpresa.Contiene(4, 7, 11, 12, 122) And RETIVA < 0) AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ClienteMovto, RETIVA, gr.DataKey("SerieFolio").ToString, 8, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContRetIVA, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, RETIVA, RETIVA * TCVenta), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If
If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), PorcentajeImpuesto:=PorcentajeImpuesto, TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then If IEPS > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, ImpuestosMovto, IEPS, gr.DataKey("SerieFolio").ToString, 38, ConceptoPartida, TxtFechaIncobrable.Text.ToDate, IdCtaContable, -1, CveCliente:=gr.DataKey("CveCliente").ToEntero, CveVenta:=gr.DataKey("CveVenta").ToEntero, ImporteMX:=If(CveMonedaFiltro = 1, IEPS, IEPS * TCVenta), TipoCambio:=TCVenta, TipoCambioPago:=TCPago) Then
MsgError = "Ocurrio un error al saldar el movimiento" MsgError = "Ocurrio un error al saldar el movimiento"
End If End If

View File

@@ -152,7 +152,7 @@
<asp:GridView ID="GvDatos" runat="server" OnRowDataBound="GvDatos_RowDataBound" GridLines="None" <asp:GridView ID="GvDatos" runat="server" OnRowDataBound="GvDatos_RowDataBound" GridLines="None"
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False" CssClass="table table-striped table-advance table-hover Widthall ScrollAD" AutoGenerateColumns="False"
EmptyDataText="No se encontraron registros" data-sort="true" Width="99%" EmptyDataText="No se encontraron registros" data-sort="true" Width="99%"
DataKeyNames="CveCliente,CveMoneda,Saldo,Folio,CveVenta,NombreComercial,CveVentaAmortizacion,SerieFolioAmortizacion,SerieFolio,Total, DataKeyNames="CveCliente,CveMoneda,Saldo,CveVenta,NombreComercial,CveVentaAmortizacion,SerieFolioAmortizacion,SerieFolio,Total,TipoCambio,
Fecha,FechaAmortizacion,SubTotal,SubTotalAmortizacion,ImporteAmortizacion,CveIE,Tipo,SaldoAcumulativo,CveSubProyecto"> Fecha,FechaAmortizacion,SubTotal,SubTotalAmortizacion,ImporteAmortizacion,CveIE,Tipo,SaldoAcumulativo,CveSubProyecto">
<Columns> <Columns>
<asp:TemplateField> <asp:TemplateField>

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Activities.Expressions;
using System.Collections.Generic; using System.Collections.Generic;
using System.Data; using System.Data;
using System.Linq; using System.Linq;
@@ -324,80 +325,103 @@ public partial class Ventas_RepAnticipo_NC_IXCDetalle : ClsPaginas
{ {
ClsContabilidad ObjConta = new ClsContabilidad(); ClsContabilidad ObjConta = new ClsContabilidad();
ObjConta.IniciaTransacSQL(); ObjConta.IniciaTransacSQL();
int CvePrePoliza = 0, ConceptoContable1 = 0, ConceptoContable2 = 0, CveVenta = -1, CveIE = -1; int CvePrePoliza = 0, CveVenta = -1, CveIE = -1;
decimal Saldo = 0; decimal Saldo = 0;
string MsgError = ""; decimal ImporteTotalGasto = 0;
if (Tipo == 2) string MsgError = "";
{
ConceptoContable1 = 91; CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 6, 0, 0, 1, TxtFecha.Text.ToDate(), TxtConcepto.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
ConceptoContable2 = 12;
}
else if (Tipo == 1)
{
ConceptoContable1 = 11;
ConceptoContable2 = 3;
}
else if (Tipo == 3)
{
ConceptoContable1 = 92;
ConceptoContable2 = 92;
}
foreach (GridViewRow Gv in GvDatos.Rows) if (CvePrePoliza > 0)
{ {
if (Gv.FCCheckBox("Chk").Checked) foreach (GridViewRow Gv in GvDatos.Rows)
{ {
if (Tipo == 1 || Tipo == 2) ConceptosTipoSaldo ConPreP = new ConceptosTipoSaldo();
{ if (Gv.FCCheckBox("Chk").Checked)
CveVenta = Gv.DataKey("CveVenta").ToEntero(); {
Saldo = -Gv.DataKey("Saldo").ToDecimal(); if (Tipo == 2)
} {
else if (Tipo == 3) ConPreP = ClsPaginas.get_ObtenerCveConceptoPrePoliza(6, Gv.DataKey("CveMoneda").ToEntero(), false, 2);
{ }
CveIE = Gv.DataKey("CveIE").ToEntero(); else if (Tipo == 1)
Saldo = Gv.DataKey("Saldo").ToDecimal(); {
} ConPreP.CveConcepto = 3;
}
int IdCtaContable = 0;
if (ObjConta.GetRetCuenta(ConceptoContable1, Gv.DataKey("CveCliente").ToEntero())) if (Tipo == 1 || Tipo == 2)
{
if (ObjConta.DtResultados.Rows.Count > 0)
{ {
if (Tipo == 1 || Tipo == 2) CveVenta = Gv.DataKey("CveVenta").ToEntero();
{ Saldo = -Gv.DataKey("Saldo").ToDecimal();
IdCtaContable = ObjConta.DtResultados.Rows[0]["IdCtaContable"].ToString().ToEntero(); }
} else if (Tipo == 3)
else if (Tipo == 3) {
{ ConPreP.CveConcepto = 92;
IdCtaContable = ObjConta.DtResultados.Rows[0]["IdCtaContClientes"].ToString().ToEntero(); CveIE = Gv.DataKey("CveIE").ToEntero();
Saldo = Gv.DataKey("Saldo").ToDecimal();
}
int IdCtaContable = 0;
if (UsuarioActual.Empresa.TipoContabilidad == 2)
{
if (UsuarioActual.Empresa.TipoContabilidad == 2 && ObjConta.GetRetCuenta(ConPreP.CveConcepto, Gv.DataKey("CveCliente").ToEntero()))
{
if (ObjConta.DtResultados.Rows.Count > 0)
{
if (Tipo == 1 || Tipo == 2)
{
IdCtaContable = ObjConta.DtResultados.Rows[0]["IdCtaContable"].ToString().ToEntero();
}
else if (Tipo == 3)
{
IdCtaContable = ObjConta.DtResultados.Rows[0]["IdCtaContClientes"].ToString().ToEntero();
}
}
}
else
{
break;
}
}
ImporteTotalGasto += Saldo;
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Saldo, Gv.DataKey("SerieFolio").ToString(), ConPreP.CveConcepto, TxtConcepto.Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero(), ImporteMX: Saldo))
{
MsgError = "Ocurrio un error al saldar el movimiento";
break;
}
if (Gv.DataKey("CveMoneda").ToEntero() > 1 )
{
decimal ImporteMN = (Saldo * Gv.DataKey("TipoCambio").ToDecimal() - Saldo).RoundSQL();
ImporteTotalGasto += ImporteMN;
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Saldo, Gv.DataKey("SerieFolio").ToString(), ConPreP.CveConceptoComplementario, TxtConcepto.Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero(), ImporteME: Saldo, ImporteMX: ImporteMN, TipoCambio: Gv.DataKey("TipoCambio").ToDecimal()))
{
MsgError = "Ocurrio un error al saldar el movimiento";
break;
} }
} }
} }
else }
if (ImporteTotalGasto != 0)
{
ImporteTotalGasto = ImporteTotalGasto * -1; // se invierte el valor, para cuadre de prepoliza
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, ImporteTotalGasto, "", 78, TxtConcepto.Text, TxtFecha.Text.ToDate(), UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE, CveVenta, ImporteMX: ImporteTotalGasto, CveSubProyecto: DdlSubProyectoSaldar.SelectedValue.ToEntero()))
{ {
break;
}
CvePrePoliza = ObjConta.AddPrePolizas("Bancos/RepNCXAplicar", 6, Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("Saldo").ToDouble(), Gv.DataKey("CveMoneda").ToEntero(), TxtFecha.Text.ToDate(), "Saldo de NC por Sistema", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa);
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Saldo, Gv.DataKey("Folio").ToString(), ConceptoContable2, TxtConcepto.Text, TxtFecha.Text.ToDate(), IdCtaContable, -1, CveIE, CveVenta, CveCliente: Gv.DataKey("CveCliente").ToEntero(), ImporteMX: Saldo))
{
MsgError = "Ocurrio un error al saldar el movimiento";
break;
}
if (!ObjConta.AddPrePolizasDetalle(CvePrePoliza, true, Gv.DataKey("Saldo").ToDecimal(), Gv.DataKey("Folio").ToString(), 78, TxtConcepto.Text, TxtFecha.Text.ToDate(), UsuarioActual.Empresa.IdCuentaOtrosIngresos, -1, CveIE, CveVenta, ImporteMX: Gv.DataKey("Saldo").ToDecimal(), CveSubProyecto: DdlSubProyectoSaldar.SelectedValue.ToEntero()))
{
MsgError = "Ocurrio un error al saldar el movimiento"; MsgError = "Ocurrio un error al saldar el movimiento";
break;
} }
}
else
{
MsgError = "Poliza no insertada";
} }
} }
if (MsgError == "") if (MsgError == "")
{ {
ObjConta.Commit(); ObjConta.Commit();
Alert("Los movimientos se saldaron correctamente."); string Msg = "Los movimientos se saldaron correctamente.";
Msg = Msg + $"<br/><br/><a Class='Texto' target='_blank' href='/Contabilidad/RegPrePolizaS.aspx?CvePrePoliza={CvePrePoliza}'>Ver Póliza</a>&nbsp;&nbsp; ";
Alert(Msg);
} }
else else
{ {

View File

@@ -2450,7 +2450,7 @@ Partial Class Ventas
UpFacturar.Update() UpFacturar.Update()
'CargaTiposDocumentos() 'CargaTiposDocumentos()
TrEmitir.Visible = False TrEmitir.Visible = False
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa.Contiene(13, 83, 172, 173) Then If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then
DivCartaPorte.Visible = True DivCartaPorte.Visible = True
End If End If
ViewState("EstablecioFolio") = False ViewState("EstablecioFolio") = False
@@ -8204,7 +8204,7 @@ Partial Class Ventas
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) If Costo <= 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose() ObjInventarios.Dispose()
Dim PrecioMinimo As Decimal = 0 Dim PrecioMinimo As Decimal = 0
@@ -18422,7 +18422,7 @@ Partial Class Ventas
Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) Dim Costo As Decimal = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1)
'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal
If Costo = 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) If Costo <= 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDouble, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1)
ObjInventarios.Dispose() ObjInventarios.Dispose()
Dim PrecioMinimo As Decimal = 0 Dim PrecioMinimo As Decimal = 0