WeFact Standard API versie 3.1



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)
- TaxPercentage float     BTW percentage: 0 - 100
- PeriodicType 'period' of 'once'     Periodiek factureren?
    Standaard: 'once' (eenmalig)
- Periods int     Aantal van de frequentie eenheid 'Periodic'
- Periodic string     Frequentie eenheid, zie variabelen-lijst
- StartPeriod date     Startdatum van de periode
Verplichte velden: Identifier of InvoiceCode, en InvoiceLines Identifier (minimaal 1)

Voorbeeld invoer:
$api->sendRequest('invoiceline', 'add', array(
	'InvoiceCode'		=> 'F0001',
	
	'InvoiceLines' 		=> array(
		array(
			'Description'	=> 'Traveling costs',
			'PriceExcl'	=> 35
		)
	)
));

Voorbeeld uitvoer:
Array
(
    [controller] => invoiceline
    [action] => add
    [status] => success
    [date] => 2014-05-16T15:06:33+00:00
    [success] => Array
        (
            [0] => Er zijn 1 factuurregels toegevoegd
        )

    [invoice] => Array
        (
            [Identifier] => 1
            [InvoiceCode] => F0001
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Status] => 2
            [SubStatus] =>
            [Date] => 2014-05-16
            [Term] => 14
            [PayBefore] => 2014-05-30
            [AmountExcl] => 485.00
            [AmountTax] => 101.85
            [AmountIncl] => 586.85
            [AmountPaid] => 0.00
            [Discount] => 0
            [VatCalcMethod] => excl
            [IgnoreDiscount] => no
            [Coupon] => 
            [ReferenceNumber] => 
            [CompanyName] => Company X
            [Initials] => John
            [SurName] => Jackson
            [Sex] => m
            [Address] => Keizersgracht 100
            [ZipCode] => 1015 AA
            [City] => Amsterdam
            [Country] => NL
            [EmailAddress] => info@company.com
            [InvoiceMethod] => 0
            [SentDate] => 2014-05-16
            [Sent] => 1
            [LanguageCode] => nl_nl
            [Reminders] => 0
            [ReminderDate] => 
            [Summations] => 0
            [SummationDate] => 
            [Authorisation] => no
            [PaymentMethod] => wire
            [PayDate] => 
            [TransactionID] => 
            [Comment] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 1
                            [Date] => 2014-05-16
                            [Number] => 3
                            [NumberSuffix] => 
                            [ProductCode] => P0001
                            [Description] => Consultancy
                            [PriceExcl] => 100
                            [DiscountPercentage] => 0
							[DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                    [1] => Array
                        (
                            [Identifier] => 2
                            [Date] => 2014-05-16
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => 
                            [Description] => Service contract
                            [PriceExcl] => 150
                            [DiscountPercentage] => 0
							[DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                    [2] => Array
                        (
                            [Identifier] => 3
                            [Date] => 2014-05-16
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => 
                            [Description] => Traveling costs
                            [PriceExcl] => 35
                            [DiscountPercentage] => 0
							[DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                        )

                )

            [PaymentURL] => https://www.mijnwefact.nl/betalen/?payment=F0001&key=xxxxxx
            [Translations] => Array
                (
                    [Status] => Verzonden
                    [Country] => Nederland
                    [InvoiceMethod] => Per e-mail
                    [PaymentMethod] => bankoverschrijving
                    [LanguageLabel] => Nederlands
                )

        )

)