WeFact Hosting API versie 2.6



Inkoopfacturen

Inkoopfacturen (van crediteuren) zijn te beheren via de controller 'creditinvoice'.



creditinvoiceline add

Met deze functie voegt u een factuurregel toe aan een bestaande inkoopfactuur.
Voorbeeldbestand: /voorbeelden/creditinvoice/creditinvoiceline.add.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een inkoopfactuur
CreditInvoiceCode string Eigen interne inkoopfactuurnummer
InvoiceLines array Inkoopfactuurregel:
- Number float     Aantal. Standaard: 1
- Description string     Omschrijving
- PriceExcl float     Prijs per stuk (excl. BTW)
- TaxPercentage float     BTW percentage: 0 - 100
Verplichte velden: Identifier of CreditInvoiceCode en InvoiceLines

Voorbeeld invoer:
<?php

require_once("../wefact_api.php");

$api = new WeFactAPI();


$creditInvoiceParams = array(
				'CreditInvoiceCode'		=> 'CF0001',
				
				'InvoiceLines' => array(
					array(
						'Description'	=> 'Additional service',
						'PriceExcl'		=> 50
					)
				)
);

$response = $api->sendRequest('creditinvoiceline', 'add', $creditInvoiceParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => creditinvoiceline
    [action] => add
    [status] => success
    [date] => 2016-09-01T12:00:00+02:00
    [success] => Array
        (
            [0] => Er zijn 1 factuurregels toegevoegd
        )

    [creditinvoice] => Array
        (
            [Identifier] => 1
            [CreditInvoiceCode] => CF0001
            [InvoiceCode] => 2013-6422
            [Creditor] => 1
            [CreditorCode] => CD0001
            [Status] => 1
            [Date] => 2013-12-04
            [Term] => 0
            [AmountExcl] => 212.50
            [AmountIncl] => 196.63
            [AmountPaid] => 0.00
            [Authorisation] => no
            [Private] => 0.00
            [PrivatePercentage] => 0
            [ReferenceNumber] => 
            [PayDate] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 1
                            [Number] => 1
                            [Description] => SLA contract #2
                            [PriceExcl] => 125
                            [TaxPercentage] => 21
                        )

                    [1] => Array
                        (
                            [Identifier] => 2
                            [Number] => 3
                            [Description] => Domains .com
                            [PriceExcl] => 12.5
                            [TaxPercentage] => 21
                        )

                    [2] => Array
                        (
                            [Identifier] => 3
                            [Number] => 1
                            [Description] => Additional service
                            [PriceExcl] => 50
                            [TaxPercentage] => 21
                        )

                )

            [Created] => 2016-09-01 12:00:00
            [Modified] => 2016-09-01 12:00:00
            [Attachments] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 3
                            [Filename] => sample.pdf
                        )

                )

            [Translations] => Array
                (
                    [Status] => Nog niet betaald
                )

        )

)