This commit is contained in:
Rene Molina
2019-09-04 18:50:48 -07:00
53 changed files with 5112 additions and 549 deletions

View File

@@ -1126,9 +1126,9 @@ Partial Class Compras_Compras
CveCuentaBancaria = 0
End If
If UsuarioActual.TienePermisoProceso(259) Then
DivEsNoDeducible.Visible = True
End If
'If UsuarioActual.TienePermisoProceso(259) Then
DivEsNoDeducible.Visible = True
'End If
If UsuarioActual.Empresa.Funcionalidad(125) = "1" Then 'Seleccionar a quien se abona la Prepoliza
'ddlCargoPrePoliza.Visible = True
@@ -4641,6 +4641,18 @@ Partial Class Compras_Compras
If Not ErrorAC Then
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
AutoConta = False
End If
If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing Then
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaAC.IniciaTransacSQL()
End If
''EMPIEZA: INSERTA DETALLES DE LA COMPRA
Dim indiceTR = 0
Dim Cont As Integer = 0
@@ -4746,7 +4758,7 @@ Partial Class Compras_Compras
'verifica si fue vinculada con una OC, y si fue la opción de entrega por adelantado, que si hubo cambios de precios
If DdlOCVinculaInv.SelectedValue.ToEntero.Contiene(176, 205) Then
If Not AjustarPrePolizaVinculacionOC(ObjOC, ObjEventos, ObjInventario, ObjConta) Then
If Not AjustarPrePolizaVinculacionOC(ObjOC, ObjEventos, ObjInventario, ObjConta, ObjContaAC) Then
ErrorPrepoliza = True
End If
End If
@@ -5217,16 +5229,7 @@ Partial Class Compras_Compras
IdCtaIVAAcreditable = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=PorcentajeIVA).Rows(0)("IdCtaIVAAcreditable").ToString.ToEntero
End If
Dim AutoConta As Boolean = UsuarioActual.Empresa.Funcionalidad(200) = "1"
If UsuarioActual.CveEmpresa = 119 AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
AutoConta = False
End If
If (AutoConta Or UsuarioActual.Empresa.UsaAC) And ObjContaAC Is Nothing Then
ObjContaAC = New ClsContPAQi(UsuarioActual.Empresa)
ObjContaAC.IniciaTransacSQL()
End If
'********************** Variables '**********************
@@ -6206,23 +6209,24 @@ Partial Class Compras_Compras
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text}"
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If importeMovimiento > 0 Or TxtTotal.Text.ToDecimal = 0 Then
'Conta ContPAQ
If IdCtaContable = 0 Then
CuentasContablesInvalidas.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
idCuentaContabilizacion = 0
End If
'Conta SIG
If CveCuenta = 0 Then
CuentasContablesInvalidasSIG.Append("<br>" & GlobalDTContaConceptosContables(-1).FiltroPrimero(String.Format("CveConceptoContable = {0}", 68))("ConceptoContable").ToString)
CveCuentaContabilizacion = 0
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContabilizacionNC, Concepto, FechaMovimiento, IdCtaContable, -1, CveCompra:=CveCompra, CveProveedor:=CveProveedorConcepto, ImporteMX:=importeMN, ImporteME:=If(tipoCambioActual = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, TipoCambio:=tipoCambioActual, Contabilizable:=SeContabiliza) Then
ErrorPrepoliza = True
End If
Dim ContienePSNeteoBonif As Boolean = False
For Each Dr As DataRow In TmpDT.Rows
If Dr("CveClasificacion").ToString.ToEntero.Contiene(20319) Then 'clasificación de Bonificación, no se incluirá en el neteo
@@ -18465,7 +18469,7 @@ Partial Class Compras_Compras
#End Region
Private Function AjustarPrePolizaVinculacionOC(ByRef OC As ClsOC, ByRef OCBitacora As ClsOIEventos, ByRef ObjInventarios As ClsInventarios, ByRef ObjConta As ClsContabilidad) As Boolean
Private Function AjustarPrePolizaVinculacionOC(ByRef OC As ClsOC, ByRef OCBitacora As ClsOIEventos, ByRef ObjInventarios As ClsInventarios, ByRef ObjConta As ClsContabilidad, ByRef ObjAC As ClsContPAQi) As Boolean
'VARIABLES
Dim CveProveedorSucursal As Integer = -1
@@ -18685,6 +18689,12 @@ Partial Class Compras_Compras
Retorno = False
End If
End If
If UsuarioActual.Empresa.Funcionalidad(200) = "1" AndAlso ObjAC IsNot Nothing Then
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
Retorno = False
End If
End If
End If
End If
Next