Discussion:
[Erp5-dev] Holding of creation of Accounting Transaction Line for hand-made Accounting Transactions
Łukasz Nowak
2007-04-10 14:54:59 UTC
Permalink
Hello,

Creating Sale Invoice Transaction (SIT) or Purchase Invoice Transaction
(PIT) can be done by hadn (go into accounting_module, create objects) or
by builder.

While using builder Accounting Transaction Lines (ATL) aren't created -
there are done by suitable builder using
default_invoice_transaction_rule - and it works great.

Well - while creating SIT or PIT by hand ATLs are created, user is able
to choose proper accounts - so far so good. But when user confirm
transaction more ATLs are created by
portal_workflow/accounting_workflow/scripts/Delivery_Build script.

How shall I prevent building such lines? Using same trick as in
{Purchase|Sale}InvoiceTransaction_init:

if kw.get('created_by_builder', 0):
return

(well - condtition would be opposite)

Is it achived somewhere - where? I wasn't able to find it out.

Thanks for any tips&suggestions,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
Jérôme Perrin
2007-04-11 17:33:46 UTC
Permalink
Post by Łukasz Nowak
Hello,
Creating Sale Invoice Transaction (SIT) or Purchase Invoice Transaction
(PIT) can be done by hadn (go into accounting_module, create objects) or
by builder.
While using builder Accounting Transaction Lines (ATL) aren't created -
there are done by suitable builder using
default_invoice_transaction_rule - and it works great.
Well - while creating SIT or PIT by hand ATLs are created, user is able
to choose proper accounts - so far so good. But when user confirm
transaction more ATLs are created by
portal_workflow/accounting_workflow/scripts/Delivery_Build script.
How shall I prevent building such lines?
It's more a problem of preventing creation of simulation movement than a
problem of preventing building lines. We could change
portal_workflow/delivery_edit_workflow/scripts/Delivery_UpdateSimulation
so that it does not call updateAppliedRule in the case of manually
created invoices (ie. without causality) already containing accounting lines,
but I'm curious about the need for this.
If I understand correctly, it's only when the user create invoice lines,
set the resource on those lines, there is an invoice transaction rule
configured for this resource, but the user doesn't want the system to
generate accounting lines automatically. Why ? isn't it a
misunderstanding from the user ? user could simply wait for accounting
line to be created instead of creating lines manually.

J?rome
Łukasz Nowak
2007-04-12 06:55:26 UTC
Permalink
Hello,
Post by Jérôme Perrin
Post by Łukasz Nowak
Hello,
Creating Sale Invoice Transaction (SIT) or Purchase Invoice Transaction
(PIT) can be done by hadn (go into accounting_module, create objects) or
by builder.
While using builder Accounting Transaction Lines (ATL) aren't created -
there are done by suitable builder using
default_invoice_transaction_rule - and it works great.
Well - while creating SIT or PIT by hand ATLs are created, user is able
to choose proper accounts - so far so good. But when user confirm
transaction more ATLs are created by
portal_workflow/accounting_workflow/scripts/Delivery_Build script.
How shall I prevent building such lines?
It's more a problem of preventing creation of simulation movement than a
problem of preventing building lines. We could change
portal_workflow/delivery_edit_workflow/scripts/Delivery_UpdateSimulation
so that it does not call updateAppliedRule in the case of manually
created invoices (ie. without causality) already containing accounting lines,
but I'm curious about the need for this.
If I understand correctly, it's only when the user create invoice lines,
set the resource on those lines, there is an invoice transaction rule
configured for this resource, but the user doesn't want the system to
generate accounting lines automatically. Why ? isn't it a
misunderstanding from the user ? user could simply wait for accounting
line to be created instead of creating lines manually.
Huh. I mean, that init scripts[0][1] for Purchase/Sale Invoice
Transaction are creating accounting lines - w/o any user interaction.
Default configruation hides accounting lines object from action box.

In correctly configured system accounting lines will be always (I
think^Wbelive) automatically created by builder using
default_invoice_transaction_rule. So maybe init scripts are just
obsolete? Is this that place, where I may stop system from building
lines manually?

Luke

[0]
http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/SaleInvoiceTransaction_init.xml?view=markup
[1]
http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/PurchaseInvoiceTransaction_init.xml?view=markup
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
Jérôme Perrin
2007-04-24 07:30:30 UTC
Permalink
Post by Łukasz Nowak
Huh. I mean, that init scripts[0][1] for Purchase/Sale Invoice
Transaction are creating accounting lines - w/o any user interaction.
Default configruation hides accounting lines object from action box.
are you using the latest xhtml_style with support for object_add action
category ?
Post by Łukasz Nowak
In correctly configured system accounting lines will be always (I
think^Wbelive) automatically created by builder using
default_invoice_transaction_rule.
Not always, you have two different situations: some invoices will be created
automatically from orders and deliveries, accounting will be automatic for
those. But for other invoices, like small amounts or exceptional expenses
(also if you use accounting without trade integration), you just add
accounting lines directly, and that's where init scripts are still usefull.

J?rome

Loading...