pmassing / auler.gmbh.zugferdxinvoice

GNU General Public License v2.0
0 stars 4 forks source link

Remove POReference mandatory #14

Closed d-ruiz closed 2 weeks ago

d-ruiz commented 2 weeks ago

In the process code the process validates this:

if(m_invoice.getPOReference() == null)
            throw new AdempiereException(Msg.getMsg(Env.getLanguage(getCtx()), "Insert POReference !"));

Then it is used to set the leitweg-id, however, this is only needed for B2G invoices and the process makes it mandatory.

There are also cases where users set a custom value in POReference for internal purposes, which then make it wrong to set it as the leitweg-id.

The proposal is to move that from POReference to a field in BP or BP Location, as this value seems to belong to the BP and not to the order.

@pmassing is there any reason you did it like this and I am misinterpreting the documentation somehow? Do you agree with the change?

pmassing commented 2 weeks ago

In our business cases it is usually mandatory to specify a Leitweg-ID. For greater flexibility, I could imagine an additional parameter that is pre-filled with the business partner's reference. I did this for a UBL-Invoice plugin and it works very well.

There are also cases where users set a custom value in POReference for internal purposes ...

Okay, I understand.

d-ruiz commented 2 weeks ago

Pull request created with the solution proposed by you.

A new parameter has been added to the process. In the process and the toolbar button action, the parameter is filled with the BPartner Reference no by default and can be overridden.

The reference No is still mandatory when running the process but can be ignored when generating the file programatically.