WeFact API versie 2.4.0



Facturen

Facturen zijn te beheren via de controller 'invoice'.



invoiceline add

Middels deze functie voegt u een factuurregel toe aan een bestaande factuur. Deze functie is beschikbaar voor een factuur in alle statussen.
Voorbeeldbestand: /voorbeelden/invoice/invoiceline.add.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een factuur
InvoiceCode string Het factuurnummer
InvoiceLines array Factuurregel:
- Date date     Datum. Standaard: vandaag
- Number float     Aantal. Standaard: 1
- ProductCode string     Productnummer
- Description string     Omschrijving
- PriceExcl float     Prijs per stuk (excl. BTW)
- DiscountPercentage float     Korting factuurregel, percentage: 0 - 100
- DiscountPercentageType 'line' of 'subscription'     Type korting
    (enkel factuurregel of ook voor abonnement)
- TaxCode string     BTW code
    Terug te vinden bij de BTW instellingen.
- StartDate date     Startdatum van de periode
- EndDate date     Einddatum van de periode
    Enkel in te geven als PeriodicType 'once' is.
- PeriodicType 'period' of 'once'     Periodiek factureren?
    Standaard: 'once' (Geen abonnement)
- Periods int     Factureer iedere: aantal periodes
- Periodic string     Factureer iedere: eenheid, zie variabelen-lijst
Verplichte velden: Identifier of InvoiceCode, en InvoiceLines Identifier (minimaal 1)

Voorbeeld invoer:
$parameters = [
    "InvoiceCode" => "[concept]0001",
    "InvoiceLines" => [
        [
            "ProductCode" => "P0001",
            "PriceExcl" => 100
        ]
    ]
];

$api->sendRequest('invoiceline', 'add', $parameters);

Voorbeeld uitvoer:
Array
(
    [controller] => invoiceline
    [action] => add
    [status] => success
    [date] => 2019-07-0109:29:53+02:00
    [success] => Array
        (
            [0] => Er zijn 1 factuurregels toegevoegd
        )

    [invoice] => Array
        (
            [Identifier] => 1
            [InvoiceCode] => [concept]0001
            [Debtor] => 1
            [DebtorCode] => DB10000
            [Status] => 0
            [SubStatus] => 
            [Date] => 2019-05-22
            [Term] => 14
            [PayBefore] => 2019-06-05
            [PaymentURL] => 
            [AmountExcl] => 329.64
            [AmountTax] => 69.22
            [AmountIncl] => 398.86
            [AmountPaid] => 0.00
            [Discount] => 0
            [VatCalcMethod] => excl
            [IgnoreDiscount] => no
            [Coupon] => 
            [ReferenceNumber] => 
            [CompanyName] => Jan Janssen B.V.
            [Initials] => Jan
            [SurName] => Janssen
            [Sex] => m
            [Address] => Keizersgracht 100
            [ZipCode] => 1015 AA
            [City] => Amsterdam
            [Country] => NL
            [EmailAddress] => info@example.com
            [InvoiceMethod] => 0
            [ScheduledAt] => 
            [SentDate] => 
            [Sent] => 0
            [Reminders] => 0
            [ReminderDate] => 
            [Summations] => 0
            [SummationDate] => 
            [Authorisation] => no
            [PaymentMethod] => 
            [PayDate] => 
            [TransactionID] => 
            [LanguageCode] => nl_nl
            [Currency] => EUR
            [Description] => 
            [Comment] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 1
                            [Date] => 2019-05-22
                            [Number] => 2
                            [NumberSuffix] =>  
                            [ProductCode] => P0001
                            [Description] => Werkzaamheden gebaseerd op uurtarief
                            [PriceExcl] => 100
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxCode] => V21
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartDate] => 
                            [EndDate] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                    [1] => Array
                        (
                            [Identifier] => 2
                            [Date] => 2019-05-22
                            [Number] => 155
                            [NumberSuffix] => km
                            [ProductCode] => P0002
                            [Description] => Reiskosten à € 0,19 per km
                            [PriceExcl] => 0.19
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxCode] => V21
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartDate] => 
                            [EndDate] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                    [2] => Array
                        (
                            [Identifier] => 3
                            [Date] => 2019-05-22
                            [Number] => 1
                            [NumberSuffix] =>  
                            [ProductCode] => P0002
                            [Description] => Reiskosten à € 0,19 per km
                            [PriceExcl] => 0.19
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxCode] => V21
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartDate] => 
                            [EndDate] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                    [3] => Array
                        (
                            [Identifier] => 4
                            [Date] => 2019-07-03
                            [Number] => 1
                            [NumberSuffix] =>  
                            [ProductCode] => P0001
                            [Description] => Werkzaamheden gebaseerd op uurtarief
                            [PriceExcl] => 100
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxCode] => V21
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartDate] => 
                            [EndDate] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                )

            [Created] => 2019-07-01 09:29:53
            [Modified] => 2019-07-01 09:29:53
            [VatShift] => no
            [Translations] => Array
                (
                    [Status] => Concept
                    [Country] => Nederland
                    [InvoiceMethod] => Per e-mail
                    [PaymentMethod] => 
                    [LanguageLabel] => Nederlands
                )

        )

)