Still testing my simple tax plugin, I'm now facing a challenging issue.As I previously mentioned, I chose not to have any dedicated tables for my plugin, but just persist my tax codes into custom fields.I would like to stick to this choice, otherwise I would have to change the name into “complex-tax plugin” and I definitely don't want to do that.
But most of the time, I need to add custom fields on items of an invoice that is being created.So that I get a boom! I mean an ObjectDoesNotExist exception. (Btw, could you make this exception public please? Currently, I'm catching all IllegalStateException and filtering on the class name!)
So my question is : how could I defer the creation of custom fields so that it happens at the right time, after the invoice items are properly persisted?
A second alternative would be the invoice plugins being called a second time after new invoice are persisted. This would give a chance for invoice plugin to decorate the created invoices with custom fields.
--
You received this message because you are subscribed to the Google Groups "Kill Bill developers mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-d...@googlegroups.com.
To post to this group, send email to killbil...@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-dev/c764e879-5f4a-44c3-bad7-8a5f23c0b145%40googlegroups.com.
But the implemented onEvent(ExtBusEvent) method (of the NotificationPluginApi interface) didn't seem to be called, though the bus_ext_events_history table properly listed the INVOICE_CREATION events.
As a workaround, I implemented the listening of events as the killbill-email-notifications-plugin does. I mean as the EmailNotificationActivator does, registering an OSGIKillbillEventHandler.
Now the simple-tax activator doesn't call registrar.registerService() twice anymore. Instead, the OSGIKillbillEventHandler implementation delegates to the onEvent(ExtBusEvent) method.
And it seems to work.
Could you please confirm this the correct way for an invoice plugin to listen to ExtBusEvent events?
--
You received this message because you are subscribed to the Google Groups "Kill Bill developers mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-d...@googlegroups.com.
To post to this group, send email to killbil...@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-dev/5ea85b1e-a65a-4050-a975-82f780945bc1%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-dev/62478240-aa14-4c72-8d4b-f9abaf4db0e7%40googlegroups.com.