Librería | Clase | Metodo |
AhoraConta | ContaProcesos | GeneraApunte |
Implementación:
Public Function GeneraApunte( aAsiento As Long, aFecha As Date, aCuenta As String, aValor As Double, aConcepto As String, Optional aIdCentrocoste As String = "") As Long
Descripción:
Inserta un apunte contable con los parámetros indicados. Si aAsiento es 0 entonces lo calcula automáticamente. Devuelve el índice del apunte creado, para el asiento.
Código VB6:
lSql = "Select sum(Alb.Total) Tot from vAlbaran_Cli_Lineas A " + _
"Inner join Pedidos_Cli_Cabecera P On A.IdPedido=P.IdPedido " + _
"Where (A.IdEstadoLinea=5) Group by P.IdCentroCoste"
Set lCursor = gCn.OpenResultset(lSql)
If Not lCursor.EOF Then
' Apuntes al Haber por C.C.
lInsertar = True
Do While Not lCursor.EOF
lTotalEuros = DRound(VGetNumber(lCursor!Tot.Value), 2)
gCn.AhoraProceso "GeneraApunte", False, lAsiento, lFecha, pCuentaCli_H, lTotalEuros, "Contab.Alb.Actualiz.: " & Format(lFecha, cFmt_Date))
lTotal = lTotal + lTotalEuros
lCursor.MoveNext
Loop
lCursor.Cerrar
End If
Set lCursor = Nothing
' Apuntes al Debe agrupado
If lInsertar Then
gCn.AhoraProceso "GeneraApunte", False, lAsiento, lFecha, pCuentaCli_D, (-1) * lTotal, "Contab.Alb.Actualiz.:" & Format(lFecha, cFmt_Date)
End If Código C#:
object[] lParam_AP_GeneraApunte = new Object[] {lAsiento, lFecha, pCuenta, (decimal)((-1) * lSumaDest), "Contab. Alb. de Traspaso: " + Format(lFecha, cFmt_Date), "", IdDiario.Text, NumDocDiario.Text, ContadorDiario.Text, pIdProceso};
lIdApunte = (int) gCn.AhoraProceso("GeneraApunte", out _, lParam_AP_GeneraApunte);
lAsiento = CInt(lParam_AP_GeneraApunte[0]);¿Le ha sido útil este artículo?
¡Qué bien!
Gracias por sus comentarios
¡Sentimos mucho no haber sido de ayuda!
Gracias por sus comentarios
Sus comentarios se han enviado
Agradecemos su esfuerzo e intentaremos corregir el artículo