josemmo / einvoicing

Library for reading and creating European-compliant electronic invoices (EN 16931)
https://josemmo.github.io/einvoicing/
MIT License
117 stars 30 forks source link

Add seller iban and bank name #46

Closed FDSTIL closed 11 months ago

FDSTIL commented 11 months ago

How to add seller iban and bank name

$transfer = new Transfer(); $transfer->setAccountId('IBAN') ->setAccountName('Numecont') ->setProvider('ING bank'); $inv->addPaymentTransferNode($transfer);

josemmo commented 11 months ago

Hello @FDSTIL,

You can add a credit transfer to an invoice like so:

use Einvoicing\Invoice;
use Einvoicing\Payments\Payment;
use Einvoicing\Payments\Transfer;

$invoice = new Invoice();
// [...]

$transfer = (new Transfer)
    ->setAccountId('IBAN32423940')
    ->setAccountName('Optional Account Name')
    ->setProvider('BIC324098');

$payment = (new Payment)
    ->setId('Optional Internal ID')
    ->setMeansCode('30') // See https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL4461/
    ->setMeansText('Credit transfer')
    ->addTransfer($transfer);

$invoice->setPayment($payment);