HostFact API versie 3.1
Inkoopfacturen
Inkoopfacturen (van crediteuren) zijn te beheren via de controller 'creditinvoice'.
add
Middels deze functie is het mogelijk een inkoopfactuur toe te voegen..
Voorbeeldbestand: /voorbeelden/creditinvoice/creditinvoice.add.php
Invoerparameters:
| Veldnaam | Waarde | Omschrijving |
|---|---|---|
| CreditInvoiceCode | string | Eigen interne inkoopfactuurnummer Geef deze parameter niet mee wanneer het inkoopfactuurnummer automatisch bepaald mag worden. |
| InvoiceCode | string | Factuurnummer (door crediteur) |
| ReferenceNumber | string | Referentie |
| Creditor | int | De unieke ID van een crediteur |
| CreditorCode | string | Het crediteurnummer |
| Date | datetime | Datum van de inkoopfactuur. Standaard: vandaag |
| Term | int | Betaaltermijn in dagen |
| AmountPaid | float | Bedrag reeds betaald |
| Authorisation | 'yes' of 'no' | Automatische incasso, standaard: voorkeur crediteur |
| PayDate | date | Datum dat inkoopfactuur betaald is |
| Private | float | Privé: bedrag |
| PrivatePercentage | int | Privé: percentage 0 - 100 |
| Status | int | Factuur status, zie variabelen-lijst. Standaard: 1 (nog niet betaald) |
| InvoiceLines | array | Inkoopfactuurregel: |
| - Number | float | Aantal. Standaard: 1 |
| - Description | string | Omschrijving |
| - PriceExcl | float | Prijs per stuk (excl. BTW) |
| - TaxPercentage | float | BTW percentage: 0 - 100 |
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$creditInvoiceParams = array(
'CreditorCode' => 'CD0001',
'InvoiceCode' => '2013-6422',
'Date' => '2013-12-04',
'InvoiceLines' => array(
array(
'Description' => 'SLA contract #2',
'PriceExcl' => 125
),
array(
'Number' => 3,
'Description' => 'Domains .com',
'PriceExcl' => 12.50
),
)
);
$response = $api->sendRequest('creditinvoice', 'add', $creditInvoiceParams);
print_r_pre($response);
?>Voorbeeld uitvoer:
Array
(
[controller] => creditinvoice
[action] => add
[status] => success
[date] => 2022-11-24T12:00:00+02:00
[creditinvoice] => Array
(
[Identifier] => 2
[CreditInvoiceCode] => CF0002
[InvoiceCode] => 2013-6422
[Creditor] => 1
[CreditorCode] => CD0001
[Status] => 1
[Date] => 2013-12-04
[Term] => 0
[AmountExcl] => 162.50
[AmountIncl] => 196.63
[AmountPaid] => 0.00
[Authorisation] => no
[Private] => 0.00
[PrivatePercentage] => 0
[ReferenceNumber] =>
[PayDate] =>
[InvoiceLines] => Array
(
[0] => Array
(
[Identifier] => 3
[Number] => 1
[Description] => SLA contract #2
[PriceExcl] => 125
[TaxPercentage] => 21
)
[1] => Array
(
[Identifier] => 4
[Number] => 3
[Description] => Domains .com
[PriceExcl] => 12.5
[TaxPercentage] => 21
)
)
[Created] => 2022-11-24 11:00:00
[Modified] => 2022-11-24 11:00:00
[Translations] => Array
(
[Status] => Nog niet betaald
)
)
)