HostFact API versie 3.1
Offertes
Offertes zijn te beheren via de controller 'pricequote'.
add
Middels deze functie kunt u een offerte aanmaken in HostFact.
Voorbeeldbestand: /voorbeelden/pricequote/pricequote.add.php
Invoerparameters:
| Veldnaam | Waarde | Omschrijving |
|---|---|---|
| PriceQuoteCode | string | Het offertenummer Geef deze parameter niet mee wanneer het offertenummer automatisch bepaald mag worden. |
| Debtor | int | De unieke ID van een debiteur |
| DebtorCode | string | Het debiteurnummer |
| Date | date | De datum van de offerte |
| Term | int | Geldigheidstermijn in dagen |
| Discount | float | Korting (totale offerte): percentage 0 - 100 |
| IgnoreDiscount | '0' of '1' | Kortingsmodule negeren. (0 = nee en 1 = ja) Standaard: 0 |
| Coupon | string | Kortings actiecode/coupon |
| TaxableSetting | 'auto', 'yes' of 'no' | Afwijken van de standaard BTW-regels of er BTW op deze offerte moet woren berekend |
| VatCalcMethod | 'excl' of 'incl' | BTW rekenen op basis van exclusief of inclusief BTW? Standaard: gebruikt administratie instelling |
| ReferenceNumber | string | Referentie |
| CompanyName | string | Debiteur: bedrijfsnaam |
| Sex | 'm', 'f', 'd' of 'u' | Debiteur: geslacht. Standaard: 'm' |
| Initials | string | Debiteur: voornaam |
| SurName | string | Debiteur: achternaam |
| Address | string | Debiteur: adres |
| ZipCode | string | Debiteur: postcode |
| City | string | Debiteur: plaats |
| Country | string | Debiteur: land, zie variabelen-lijst |
| EmailAddress | string | Debiteur: e-mailadres |
| Template | int | Offerte template ID. Standaard: debiteur instelling |
| SentDate | date | Verzenddatum offerte |
| Sent | int | Aantal keer verstuurd. Standaard: 0 |
| Description | text | Offerte omschrijving |
| Comment | text | Interne notitie bij offerte |
| Status | int | Offerte status, zie variabelen-lijst. Standaard: 0 (concept) |
| CustomFields | array | array met eigen velden. De key van de array komt overeen met de veldcode, de value met de waarde |
| PriceQuoteLines | array | Offerteregel: |
| - Date | date | Datum. Standaard: vandaag |
| - Number | float | Aantal. Standaard: 1 |
| - NumberSuffix | string | Eenheid bijvoorbeeld: uur |
| - ProductCode | string | Productnummer |
| - Description | text | Omschrijving |
| - PriceExcl | float | Prijs per stuk (excl. BTW) |
| - DiscountPercentage | float | Korting offerteregel, percentage: 0 - 100 |
| - DiscountPercentageType | 'line' of 'subscription' | Type korting (enkel offerteregel of later ook voor abonnement) |
| - TaxPercentage | float | BTW percentage: 0 - 100 |
| - PeriodicType | 'once' of 'period' | Periodiek factureren? Standaard: 'once' (eenmalig) |
| - Periods | int | Factureer iedere: aantal periodes |
| - Periodic | string | Factureer iedere: eenheid, zie variabelen-lijst |
| - StartPeriod | date | Startdatum van de periode |
* Debiteurgegevens worden automatisch ingevuld door de variabele 'Debtor' of 'DebtorCode'.
** Offerteregel: Indien 'ProductCode' wordt meegegeven worden automatisch de 'Description', 'PriceExcl', 'TaxPercentage', 'PeriodicType', 'Periods', 'Periodic' en 'StartPeriod' ingevuld.
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$priceQuoteParams = array(
'DebtorCode' => 'DB0001', // Customer information will automatically be fetched
'PriceQuoteLines' => array(
array(
'Description' => 'Setupfee',
'PriceExcl' => 150
),
array(
'ProductCode' => 'P003',
'Description' => 'Domain example.com'
)
)
);
$response = $api->sendRequest('pricequote', 'add', $priceQuoteParams);
print_r_pre($response);
?>Voorbeeld uitvoer:
Array
(
[controller] => pricequote
[action] => add
[status] => success
[date] => 2022-11-24T12:00:00+02:00
[pricequote] => Array
(
[Identifier] => 2
[PriceQuoteCode] => OF0002
[Debtor] => 1
[DebtorCode] => DB0001
[Status] => 0
[Date] => 2022-11-24
[Term] => 30
[ExpirationDate] => 2022-12-24 00:00:00
[AmountExcl] => 165.00
[AmountTax] => 34.65
[AmountIncl] => 199.65
[TaxRate] => 0
[Compound] => no
[Discount] => 0
[VatCalcMethod] => excl
[IgnoreDiscount] => no
[Coupon] =>
[ReferenceNumber] =>
[CompanyName] => Company X
[Sex] => m
[Initials] => John
[SurName] => Jackson
[Address] => Keizersgracht 100
[ZipCode] => 1015 AA
[City] => Amsterdam
[Country] => NL
[EmailAddress] => info@company.com
[PriceQuoteMethod] => 0
[Template] => 2
[SentDate] =>
[Sent] => 0
[Description] =>
[Comment] =>
[PriceQuoteLines] => Array
(
[0] => Array
(
[Identifier] => 3
[Date] => 2022-11-24
[Number] => 1
[NumberSuffix] =>
[ProductCode] =>
[Description] => Setupfee
[PriceExcl] => 150
[DiscountPercentage] => 0
[DiscountPercentageType] => line
[TaxPercentage] => 21
[Periods] => 1
[Periodic] =>
[StartPeriod] =>
[EndPeriod] =>
[NoDiscountAmountIncl] => 181.5
[NoDiscountAmountExcl] => 150
[DiscountAmountIncl] => 0
[DiscountAmountExcl] => 0
)
[1] => Array
(
[Identifier] => 4
[Date] => 2022-11-24
[Number] => 1
[NumberSuffix] =>
[ProductCode] => P003
[Description] => Domain example.com
[PriceExcl] => 15
[DiscountPercentage] => 0
[DiscountPercentageType] => line
[TaxPercentage] => 21
[Periods] => 1
[Periodic] => j
[StartPeriod] => 2022-11-24
[EndPeriod] => 2023-11-24
[NoDiscountAmountIncl] => 18.15
[NoDiscountAmountExcl] => 15
[DiscountAmountIncl] => 0
[DiscountAmountExcl] => 0
)
)
[Created] => 2022-11-24 11:00:00
[Modified] => 2022-11-24 11:00:00
[AcceptURL] =>
[Translations] => Array
(
[Status] => Concept
[Country] => Nederland
[PriceQuoteMethod] => Per e-mail
[Template] => Offerte
)
[AmountDiscount] => 0
[AmountDiscountIncl] => 0
[UsedTaxrates] => Array
(
[0.21] => Array
(
[AmountExcl] => 165
[AmountTax] => 34.65
[AmountIncl] => 199.65
)
)
)
)