Skip to content

Commit

Permalink
Merge pull request #118 from davidvandertuijn/master
Browse files Browse the repository at this point in the history
Added Class Address,Update Class SalesEntry and SalesEntryLine
  • Loading branch information
stephangroen authored Mar 31, 2017
2 parents 752fca4 + 57d4e4d commit d89811b
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 29 deletions.
127 changes: 127 additions & 0 deletions src/Picqer/Financials/Exact/Address.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?php namespace Picqer\Financials\Exact;

/**
* Class Address
*
* @package Picqer\Financials\Exact
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=CRMAddresses
*
* @property Guid $ID Primary key
* @property Guid $Account Account linked to the address
* @property Boolean $AccountIsSupplier Indicates if the account is a supplier
* @property String $AccountName Name of the account
* @property String $AddressLine1 First address line
* @property String $AddressLine2 Second address line
* @property String $AddressLine3 Third address line
* @property String $City City
* @property Guid $Contact Contact linked to Address
* @property String $ContactName Contact name
* @property String $Country Country code
* @property String $CountryName Country name
* @property DateTime $Created Creation date
* @property Guid $Creator User ID of creator
* @property String $CreatorFullName Name of creator
* @property Int32 $Division Division code
* @property String $Fax Fax number
* @property Boolean $FreeBoolField_01 Free boolean field 1
* @property Boolean $FreeBoolField_02 Free boolean field 2
* @property Boolean $FreeBoolField_03 Free boolean field 3
* @property Boolean $FreeBoolField_04 Free boolean field 4
* @property Boolean $FreeBoolField_05 Free boolean field 5
* @property DateTime $FreeDateField_01 Free date field 1
* @property DateTime $FreeDateField_02 Free date field 2
* @property DateTime $FreeDateField_03 Free date field 3
* @property DateTime $FreeDateField_04 Free date field 4
* @property DateTime $FreeDateField_05 Free date field 5
* @property Double $FreeNumberField_01 Free number field 1
* @property Double $FreeNumberField_02 Free number field 2
* @property Double $FreeNumberField_03 Free number field 3
* @property Double $FreeNumberField_04 Free number field 4
* @property Double $FreeNumberField_05 Free number field 5
* @property String $FreeTextField_01 Free text field 1
* @property String $FreeTextField_02 Free text field 2
* @property String $FreeTextField_03 Free text field 3
* @property String $FreeTextField_04 Free text field 4
* @property String $FreeTextField_05 Free text field 5
* @property String $Mailbox Mailbox
* @property Boolean $Main Indicates if the address is the main address for this type
* @property DateTime $Modified Last modified date
* @property Guid $Modifier User ID of modifier
* @property String $ModifierFullName Name of modifier
* @property String $NicNumber Last 5 digits of SIRET number which is an intern sequential number of 4 digits representing the identification of the localization of the office
* @property String $Notes Notes for an address
* @property String $Phone Phone number
* @property String $PhoneExtension Phone extension
* @property String $Postcode Postcode
* @property String $State State
* @property String $StateDescription Name of the State
* @property Int16 $Type The type of address. Visit=1, Postal=2, Invoice=3, Delivery=4
* @property Guid $Warehouse The warehouse linked to the address, if a warehouse is linked the account will be empty. Can only be filled for type=Delivery
* @property String $WarehouseCode Code of the warehoude
* @property String $WarehouseDescription Description of the warehouse
*/
class Address extends Model
{

use Query\Findable;
use Persistance\Storable;

protected $fillable = [
'ID',
'Account',
'AccountIsSupplier',
'AccountName',
'AddressLine1',
'AddressLine2',
'AddressLine3',
'City',
'Contact',
'ContactName',
'Country',
'CountryName',
'Created',
'Creator',
'CreatorFullName',
'Division',
'Fax',
'FreeBoolField_01',
'FreeBoolField_02',
'FreeBoolField_03',
'FreeBoolField_04',
'FreeBoolField_05',
'FreeDateField_01',
'FreeDateField_02',
'FreeDateField_03',
'FreeDateField_04',
'FreeDateField_05',
'FreeNumberField_01',
'FreeNumberField_02',
'FreeNumberField_03',
'FreeNumberField_04',
'FreeNumberField_05',
'FreeTextField_01',
'FreeTextField_02',
'FreeTextField_03',
'FreeTextField_04',
'FreeTextField_05',
'Mailbox',
'Main',
'Modified',
'Modifier',
'ModifierFullName',
'NicNumber',
'Notes',
'Phone',
'PhoneExtension',
'Postcode',
'State',
'StateDescription',
'Type',
'Warehouse',
'WarehouseCode',
'WarehouseDescription',
];

protected $url = 'crm/Addresses';

}
98 changes: 76 additions & 22 deletions src/Picqer/Financials/Exact/SalesEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,50 @@
* @package Picqer\Financials\Exact
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=salesentrySalesEntries
*
* @property Int32 $Division Division code
* @property Double $Currency Amount in the default currency of the company. For the header lines (LineNumber = 0) of an entry this is the SUM(AmountDC) of all lines
* @property DateTime $EntryDate The due date for payments. This date is calculated based on the EntryDate and the Paymentcondition
* @property Guid $EntryID The unique ID of the entry. Via this ID all transaction lines of a single entry can be retrieved
* @property Int32 $EntryNumber Entry number
* @property Double $AmountDC Amount in the default currency of the company. For the header lines (LineNumber = 0) of an entry this is the SUM(AmountDC) of all lines
* @property Double $AmountFC Amount in the currency of the transaction. For the header this is the sum of all lines, including VAT
* @property Int32 $BatchNumber The number of the batch of entries. Normally a batch consists of multiple entries. Batchnumbers are filled for invoices created by: - Fixed entries - Prolongation (only available with module hosting)
* @property DateTime $Created Creation date
* @property Guid $Creator User ID of creator
* @property String $CreatorFullName Name of creator
* @property String $Currency Currency for the invoice. By default this is the currency of the administration
* @property Guid $Customer Reference to customer (account)
* @property String $YourRef The invoice number of the customer
* @property SalesEntryLines $SalesEntryLines Collection of lines
* @property String $CustomerName Name of customer
* @property String $Description Description. Can be different for header and lines
* @property Int32 $Division Division code
* @property Guid $Document Document that is manually linked to the invoice
* @property Int32 $Journal Assigned at entry or at printing depending on setting. The number assigned is based on the freenumbers as defined for the Journal. When printing the field InvoiceNumber is copied to the fields EntryNumber and InvoiceNumber of the sales entry
* @property Int32 $DocumentNumber Number of the document
* @property String $DocumentSubject Subject of the document
* @property DateTime $DueDate The due date for payments. This date is calculated based on the EntryDate and the Paymentcondition
* @property String $ExternalLinkReference Reference of ExternalLink
* @property DateTime $EntryDate The date when the invoice is entered
* @property Int32 $EntryNumber Entry number
* @property String $ExternalLinkDescription Description of ExternalLink
* @property String $Description Description. Can be different for header and lines
* @property String $ExternalLinkReference Reference of ExternalLink
* @property Int32 $InvoiceNumber Assigned at entry or at printing depending on setting. The number assigned is based on the freenumbers as defined for the Journal. When printing the field InvoiceNumber is copied to the fields EntryNumber and InvoiceNumber of the sales entry
* @property Boolean $IsExtraDuty Indicates whether the invoice has extra duty
* @property String $Journal The journal code. Every invoice should be linked to a sales journal
* @property String $JournalDescription Description of Journal
* @property DateTime $Modified Last modified date
* @property Guid $Modifier User ID of modifier
* @property String $ModifierFullName Name of modifier
* @property Int32 $OrderNumber Number to indentify the invoice. Order numbers are not unique. Default the number is based on a setting for the first free number
* @property String $PaymentCondition The payment condition used for due date and discount calculation
* @property String $PaymentConditionDescription Description of PaymentCondition
* @property String $PaymentReference The payment reference used for bank imports, VAT return and Tax reference
* @property Int32 $ProcessNumber
* @property Double $Rate Foreign currency rate
* @property Int16 $ReportingPeriod The period of the transaction lines. The period should exist in the period date table
* @property Int16 $ReportingYear The financial year to which the entry belongs. The financial year should exist in the period date table
* @property Boolean $Reversal Indicates if amounts are reversed
* @property SalesEntryLines $SalesEntryLines Collection of lines
* @property Int16 $Status Status: 5 = Rejected, 20 = Open, 50 = Processed
* @property DateTime $PaymentCondition The due date for payments. This date is calculated based on the EntryDate and the Paymentcondition
* @property String $PaymentReference The reference in PSP system
* @property String $StatusDescription Description of Status
* @property Int32 $Type Type: 20 = Sales entry, 21 = Sales credit note
* @property String $TypeDescription Description of Type
* @property Double $VATAmountDC Vat amount in the default currency of the company
* @property Double $VATAmountFC Vat amount in the currency of the transaction
* @property String $YourRef The invoice number of the customer
*/
class SalesEntry extends Model
{
Expand All @@ -35,23 +62,50 @@ class SalesEntry extends Model
protected $saleEntryLines = [ ];

protected $fillable = [
'Division',
'Currency',
'EntryDate',
'EntryID',
'EntryNumber',
'AmountDC',
'AmountFC',
'BatchNumber',
'Created',
'Creator',
'CreatorFullName',
'Currency',
'Customer',
'YourRef',
'SalesEntryLines',
'CustomerName',
'Description',
'Division',
'Document',
'Journal',
'DocumentNumber',
'DocumentSubject',
'DueDate',
'ExternalLinkReference',
'EntryDate',
'EntryNumber',
'ExternalLinkDescription',
'Description',
'Status',
'ExternalLinkReference',
'InvoiceNumber',
'IsExtraDuty',
'Journal',
'JournalDescription',
'Modified',
'Modifier',
'ModifierFullName',
'OrderNumber',
'PaymentCondition',
'PaymentReference'
'PaymentConditionDescription',
'PaymentReference',
'ProcessNumber',
'Rate',
'ReportingPeriod',
'ReportingYear',
'Reversal',
'SalesEntryLines',
'Status',
'StatusDescription',
'Type',
'TypeDescription',
'VATAmountDC',
'VATAmountFC',
'YourRef',
];


Expand Down
60 changes: 53 additions & 7 deletions src/Picqer/Financials/Exact/SalesEntryLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,42 @@
* @package Picqer\Financials\Exact
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=salesentrySalesEntryLines
*
* @property Guid $ID Primary key
* @property Double $AmountDC Amount in the default currency of the company. For almost all lines this can be calculated like: AmountDC = AmountFC * RateFC.
* @property Double $AmountFC For normal lines it's the amount excluding VAT
* @property String $Description Description of Asset
* @property Guid $Asset Reference to Asset
* @property String $AssetDescription Description of Asset
* @property String $CostCenter Reference to Cost center
* @property String $CostCenterDescription Description of CostCenter
* @property String $CostUnit Reference to Cost unit
* @property String $CostUnitDescription Description of CostUnit
* @property String $Description Description. Can be different for header and lines
* @property Int32 $Division Division code
* @property Guid $ID Primary key
* @property Guid $EntryID The unique ID of the entry. Via this ID all transaction lines of a single entry can be retrieved
* @property Double $ExtraDutyAmountFC Extra duty amount in the currency of the transaction. Both extra duty amount and VAT amount need to be specified in order to differ this property from automatically calculated.
* @property Double $ExtraDutyPercentage Extra duty percentage for the item
* @property Guid $GLAccount The GL Account of the invoice line. This field is generated based on the revenue account of the item (or the related item group). G/L Account is also used to determine whether the costcenter / costunit is mandatory
* @property String $GLAccountCode Code of GLAccount
* @property $ItemDescription
* @property String $GLAccountDescription Description of GLAccount
* @property Int32 $LineNumber Indicates the sequence of the lines within one entry
* @property String $Notes Extra notes
* @property Guid $Project The project to which the sales transaction line is linked. The project can be different per line. Sometimes also the project in the header is filled although this is not really used
* @property String $ProjectDescription Description of Project
* @property Double $Quantity The number of items sold in default units. The quantity shown in the entry screen is Quantity * UnitFactor
* @property String $SerialNumber Serial number
* @property Guid $Subscription When generating invoices from subscriptions, this field records the link between invoice lines and subscription lines
* @property String $SubscriptionDescription Description of Subscription
* @property Guid $TaxSchedule Obsolete
* @property Guid $TrackingNumber Reference to TrackingNumber
* @property String $TrackingNumberDescription Description of TrackingNumber
* @property Int32 $Type Type: 20 = Sales entry, 21 = Sales credit note
* @property Double $VATAmountDC VAT amount in the default currency of the company
* @property Double $VATAmountFC VAT amount in the currency of the transaction. Use this property to specify a VAT amount that differs from the VAT amount that is automatically calculated. However if the transaction uses extra duty, extra duty amount also needs to be specified.
* @property Double $VATBaseAmountDC The VAT base amount in the default currency of the company. This is calculated based on the VATBaseAmountFC
* @property Double $VATBaseAmountFC The VAT base amount in invoice currency. This is calculated with the use of VAT codes. It's an internal value
* @property String $VATCode The VAT code used when the invoice was registered
* @property String $VATCodeDescription Description of VATCode
* @property Double $VATPercentage The VAT percentage of the VAT code. This is the percentage at the moment the invoice is created. It's also used by the default calculation of VAT amounts and VAT base amounts
* @property String $Notes Extra notes
*/
class SalesEntryLine extends Model
{
Expand All @@ -27,19 +50,42 @@ class SalesEntryLine extends Model
use Persistance\Storable;

protected $fillable = [
'ID',
'AmountDC',
'AmountFC',
'Asset',
'AssetDescription',
'CostCenter',
'CostCenterDescription',
'CostUnit',
'CostUnitDescription',
'Description',
'Division',
'ID',
'EntryID',
'ExtraDutyAmountFC',
'ExtraDutyPercentage',
'GLAccount',
'GLAccountCode',
'ItemDescription',
'GLAccountDescription',
'LineNumber',
'Notes',
'Project',
'ProjectDescription',
'Quantity',
'SerialNumber',
'Subscription',
'SubscriptionDescription',
'TaxSchedule',
'TrackingNumber',
'TrackingNumberDescription',
'Type',
'VATAmountDC',
'VATAmountFC',
'VATBaseAmountDC',
'VATBaseAmountFC',
'VATCode',
'VATCodeDescription',
'VATPercentage',
'Notes',
];

protected $url = 'salesentry/SalesEntryLines';
Expand Down

0 comments on commit d89811b

Please sign in to comment.