Así que por código, les muestro cómo calcular el saldo de las cuentas que estan asignadas a los grupos de artículos. Espero les sirva.
static void yc_jobs(Args _args)
{
LedgerTable ledgerTable;
ItemGroupId itemGroupId;
InventPosting inventPosting;
InventItemGroup inventItemGroup;
AmountMST balance;
TransDate fromDate,todate;
LedgerBalanceSum_CurrentMST ledgerBalanceSum_CurrentMST_SaldoMes;
;
fromdate = str2date("01/01/2011",123);
todate = str2date("08/02/2012",123);
ledgerBalanceSum_CurrentMST_SaldoMes = new LedgerBalanceSum_CurrentMST(fromdate,todate);
while select ItemRelation, LedgerAccountId, InventAccountType from inventPosting
join inventItemGroup
order by inventItemGroup.Name
where inventPosting.ItemRelation == inventItemGroup.ItemGroupId
{
balance = ledgerBalanceSum_CurrentMST_SaldoMes.balance(inventPosting.LedgerAccountId);
info(strfmt("%1, %2, %3, %4", inventItemGroup.Name, inventPosting.LedgerAccountId,
inventPosting.InventAccountType, balance));
}
}
No hay comentarios.:
Publicar un comentario