Structured Creditor Reference - but how

Hi there,
I’m testing InvoiceNinja, and I like it so far. But there is one custom field I need, and I’m not yet sure how to do it.
When paying directly, my customers must provide a so-called Structured Creditor Reference number. It’s a 10 year old standard in European bank transfers. Details here, if you’re interested:
How to create:
So in my case it is a simple addition to the invoice number. Invoice# 1002 -> Reference# RF351002
What is the best way to implement?

In invoice template editing I only see options for layout, not for calculation. Is there a way to import data from an outside source via SOAP, something like:
field content set as, and this website returns <RF351002> (I would setup domain this myself of course)

Must I go self-hosted and hack it into the code myself?

Maybe I should setup a custom gateway for this, but I would like it to be visible on the PDF.

Or maybe I’m lucky and this is already built-in and I haven’t found it yet? Or maybe in the pipeline of the next big update? After all this is a common payment standard.

Could you use a custom client field and an invoice number pattern?

hi, i’m struggeling with the same question.

the RF is build by “Modulo 97” from a given String - that would be no problem, if i could ‘calcutale’ them in PHP. But where… ?

One Possability would be, to set the invoice-number based on them: so, something like:

therefor i would generate a new $variable wich i managed in ( app/Models/Traits/GeneratesNumbers.php) with the following lines:

   $modulo = 123456789 % 97;
    $search[] = '{$modulo}';
    $replace[] = $modulo;

BUT. I need to generate the Modulo out of the 3 Variables ({$year}{$clientIdNumber}{$clientCounter})
and at that place in PHP i was not able to access the variables. How could i?

an Example:
year: 2020
cliendIdNumber: 1111
clientCounter: 0001

Modulo 97 of 202011110001 is 87
so the invoice-number would be.

Here’s the relevant code:

hi hillel,

thanks - i allready found the code - but don’t get it work…

my addition in it (in the function applyNumberPattern)

 * Modulo for RF        according to ISO 11694

$moduloYear = date('Y');
$moduloClientId = $this->getClientInvoiceNumber('{$clientIdNumber}', $entity);
$moduloInvoiceId = $this->getClientInvoiceNumber('{$clientCounter}', $entity);
$moduloBase = $moduloYear . $moduloClientId . $moduloInvoiceId;
//      $modulo = $moduloBase % 97;
//      $search[] = '{$modulo}';
//      $replace[] = $modulo;
$search[] = '{$modulob}';
$replace[] = $moduloBase;

works fine on the site: [ninja-url]/settings/invoice_settings
with the schema: RF{$year}{$clientIdNumber}{$clientCounter}-{$modulob}
i get the example: RF202099010002-202099010002 which is perfect. (also the modulo would work)

but when i create a new invoice => [ninja-url]/invoices/create
he generats RF202099020012-2020{$clientIdNumber}{$clientCounter}

any idea?

Sorry, we aren’t able to provide developer support.

If you’d like to hire a developer to help we recommend this company.