Soporte en ReembolsosComprobaciones en otros ingresos.

Soportes en Compras en dif. en prepoliza en nc, en que se contabilice una factura y error porque se tenia que simplificar antes de contabilizar.
Cambios en Punto de Venta de bdh
This commit is contained in:
Desarrollo2019
2019-08-21 18:05:50 -07:00
parent f99828ea9c
commit a747e6d017
4 changed files with 178 additions and 67 deletions

View File

@@ -5192,7 +5192,6 @@ Partial Class Compras_Compras
Dim tipoCambioPago As Decimal
Dim alertaContabilizacion As String = "Se enviaron correctamente las siguientes pólizas:<br><br>"
Dim idCuentaContabilizacion As Long = 1
Dim BanderaContilizar = True
Dim CveCuentaContabilizacion As Long = 1
Dim FechaMovimiento As Date = TxtFecha.Text.ToDate
Dim DT As DataTable = Nothing
@@ -6072,7 +6071,6 @@ Partial Class Compras_Compras
If OCVinculada Or CveConceptoContableAlmacen.Contiene(237, 240) Then
ConceptoContabilizacion = CveConceptoContableAlmacen
End If
BanderaContilizar = If(ConceptoContabilizacion = 205, False, True)
Dim UsaComplementariaFleteImportaciones As Boolean = False
Select Case ConceptoContabilizacion
@@ -6990,6 +6988,12 @@ Partial Class Compras_Compras
End If
End If
'Simplificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
ErrorPrepolizaDescuadre = True
End If
End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 4) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
@@ -7000,19 +7004,17 @@ Partial Class Compras_Compras
'Conta ContPAQ
If ObjContaAC IsNot Nothing AndAlso Not ErrorPrepoliza AndAlso Not ErrorPrepolizaDescuadre AndAlso UsuarioActual.Empresa.UsaContabilidad Then
If BanderaContilizar Then
If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
IdPoliza = ObjConta.ContaIdPoliza
Else
ErrorPrepoliza = True
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If
If idCuentaContabilizacion > 0 Then
If ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjContaAC) Then
' Alert(alertaContabilizacion, ModExtensiones.TipoMensaje.MsgInformacion)
IdPoliza = ObjConta.ContaIdPoliza
Else
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True
Alert($"Ocurrio un error al contabilizar {ObjConta.AlertaMensaje}", TipoMensaje.MsgAdvertencia)
End If
Else
Alert(String.Format("No se puede contabilizar la Prepoliza debido a que las siguientes cuentas son inválidas: <br>{0}", CuentasContablesInvalidas), TipoMensaje.MsgAdvertencia)
ErrorPrepoliza = True
End If
End If
End If
@@ -7614,12 +7616,7 @@ Partial Class Compras_Compras
MsgAccionAceptar = "location.href =""Compras.aspx"""
End If
'Simplificacion de PrePolizas
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
If Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
End If
End If
'CUANDO ES REEMBOLSO COMPROBACION Y CAJA CHICA
If UsuarioActual.CveEmpresa.Contiene(1, 119) AndAlso TxtNumeroReembolso.Text.Trim <> "" AndAlso (DdlPersonalReembolso.SelectedValue.ToEntero > 0 Or DdlCuentaCajaChicaReembolso.SelectedValue.ToEntero > 0) Then
@@ -16756,6 +16753,8 @@ Partial Class Compras_Compras
Row("CveClasificacionOG") = DdlACGeneral5.SelectedValue.ToEntero
End If
TmpDT.Rows.Add(Row)
TmpDT.Rows.IndexOf(Row)
@@ -16857,6 +16856,10 @@ Partial Class Compras_Compras
DrPS("CveTipoGasto") = DdlTipoGasto.SelectedValue.ToEntero
DrPS("TipoGasto") = If(DdlTipoGasto.SelectedValue.ToEntero > 0, DdlTipoGasto.SelectedItem.Text, "")
If UsuarioActual.Empresa.Funcionalidad(562).ToEntero > 0 Then
DrPS("AplicaCostoIndirecto") = "0"
End If
'IMPUESTOS: SI ES COMPRA, FACUTRA O CON OC, NO MODIFICA IMPUESTOS!!
'Dim IVA = (TxtIVAModal.Text.ToDouble / 100)
Dim IVA = Math.Round(DdlIVA.SelectedValue.ToDouble - 1, 2)

View File

@@ -624,6 +624,11 @@ Partial Class Compras_ReembolsosComprobaciones
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, False, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
If CveCajaChica > 0 Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePolizaPago, True, gvr.FCTextBox("TxtComision").Text.ToDecimal, Referencia, 211, ConceptoMovimiento, gvr.FCLiteral("LtlFecha").Text.ToDate, IdCtaProveedor, -1, CveIE:=CveIERegistrado, CvePersonal:=CvePersonal, CveCompra:=gvr.FCHyperLink("HplF2").Text.ToEntero, CveProveedor:=gvr.FCHyperLink("HLProv").Text.ToEntero, ImporteME:=If(tipoCambio = 1, 0, gvr.FCTextBox("TxtComision").Text.ToDecimal), ImporteMX:=gvr.FCTextBox("TxtComision").Text.ToDecimal * tipoCambio, CveCuenta:=CveCuentaProveedor, Contabilizable:=False) Then
MsgError = "no se pudo insertar el detalle de la poliza de otros ingresos"
End If
End If
End If
If gvr.DataKey("Original").ToDecimal > 0 Then PorcentajePago = (ImporteMovto / gvr.DataKey("Original").ToDecimal).RoundSQL(6) Else PorcentajePago = 1