WeFact Hosting API versie 2.7



Offertes

Offertes zijn te beheren via de controller 'pricequote'.



pricequoteline add

Middels deze functie voegt u een offerteregel toe aan een bestaande offerte.
Voorbeeldbestand: /voorbeelden/pricequote/pricequoteline.add.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een offerte
PriceQuoteCode string Het offertenummer
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
- TaxPercentage float     BTW percentage: 0 - 100
- PeriodicType 'once' of 'period'     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 PriceQuoteCode en PriceQuoteLines (minimaal 1)

Voorbeeld invoer:
<?php

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

$api = new WeFactAPI();

$priceQuoteLineParams = array(
					'PriceQuoteCode' 	=> 'OF0001',
					
					'PriceQuoteLines' 	=> array(
						array(
							'Description'	=> 'Additional fee',
							'PriceExcl'		=> 50
						)
					)
);

$response = $api->sendRequest('pricequoteline', 'add', $priceQuoteLineParams);

print_r_pre($response);

?>

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

    [pricequote] => Array
        (
            [Identifier] => 1
            [PriceQuoteCode] => OF0001
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Status] => 0
            [Date] => 2016-07-14
            [Term] => 30
            [ExpirationDate] => 2016-08-13 00:00:00
            [AmountExcl] => 215.00
            [AmountTax] => 45.15
            [AmountIncl] => 260.15
            [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] => 1
                            [Date] => 2016-07-14
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => 
                            [Description] => Setupfee
                            [PriceExcl] => 150
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                            [NoDiscountAmountIncl] => 181.50
                            [NoDiscountAmountExcl] => 150.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                    [1] => Array
                        (
                            [Identifier] => 2
                            [Date] => 2016-07-14
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => P003
                            [Description] => Domain example.com
                            [PriceExcl] => 15
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [Periods] => 1
                            [Periodic] => j
                            [StartPeriod] => 2016-07-14
                            [EndPeriod] => 2017-07-14
                            [NoDiscountAmountIncl] => 18.15
                            [NoDiscountAmountExcl] => 15.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                    [2] => Array
                        (
                            [Identifier] => 3
                            [Date] => 2017-01-16
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => 
                            [Description] => Additional fee
                            [PriceExcl] => 50
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                            [NoDiscountAmountIncl] => 60.50
                            [NoDiscountAmountExcl] => 50.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                )

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

                )

            [Translations] => Array
                (
                    [Status] => Concept
                    [Country] => Nederland
                    [PriceQuoteMethod] => Per e-mail
                    [Template] => Offerte
                )

            [AmountDiscount] => 0.00
            [AmountDiscountIncl] => 0.00
            [UsedTaxrates] => Array
                (
                    [0.21] => Array
                        (
                            [AmountExcl] => 215.00
                            [AmountTax] => 45.15
                            [AmountIncl] => 260.15
                        )

                )

        )

)