foodsoft icon indicating copy to clipboard operation
foodsoft copied to clipboard

Feature/tw automatic group order invoice generation

Open Viehlieb opened this issue 3 years ago • 5 comments

Offers the possibility to generate Invoices for given Group Orders. Generation is possible after an order is closed. If order is 'settled' then there's additionally the possibility to let the software send e-mails automatically on button press. The corresponding invoices will be sent as attachment via mail to the order group members.

Notes: To use automatic sending of invoices, select option in "Admin/Finance" config You can enter a "payment method " in "Admin/Finance" To make things work, it is mandatory to enter a tax_number in "Admin/Foodcoop" config

As for now "payment method" determines the "body" of the invoice. An example of new options and the resulting invoice can be found here:

tax_number finance Screenshot from 2022-03-28 16-16-01

Additionally for older and already settled orders, group order invoices can be generated manually under "finance/balancing" generate download

Invoices will be generated given the momentarily given information about invoicee and invoicer (tax_number, contact details...). SO take care when delting an invoice.

Viehlieb avatar Dec 23 '21 08:12 Viehlieb

This seems like a great feature. Thanks for taking the time to draft this! What exactly is the use of removing an invoice?

wvengen avatar Dec 24 '21 07:12 wvengen

Hey. Excuse my late reply. When incorrect settings are set in the admin configs, there should be the possibility to delete the old and generate a new invoice with correct settings applied.

Viehlieb avatar Jan 19 '22 11:01 Viehlieb

Is there anything more needed to merge this feature into master branch?

Viehlieb avatar Apr 07 '22 14:04 Viehlieb

first: sorry for the late reply second: thanks for the contribution third: this is a huge change and therefore hard to review: could split it smaller self-containing parts? e.g.: change the model in a separate commit

there are a bunch of style violations and i have no idea why they are not marked by the CI system :disappointed: if i'm not wrong there are a bunch of changes which require cleanup before merge. it seams there a some dummy "hello world" files and debug outputs introduces. please feel free to correct my if i'm wrong. i just skimmed the PR

paroga avatar May 27 '22 15:05 paroga

Hey. Thanks for the hints. It made me look into the code again and I am working on fixing the points you mentioned.

  1. I noticed, there was no authentication clause to deal wirth group order invoices. With b6854bc41609fe42bcb5bae733f9ffc4524d3ea6 I added a neccessary update of the group_order_invoice_controller. :authenticate_finance, so only for finance authenticated users can see/download and generate group_order_invoices.
  2. Removed the "Hello World" Dummy files.
  3. Todo Style issues Let me know, if there is anything more you notice.

Viehlieb avatar Sep 07 '22 09:09 Viehlieb