Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "wyz/practicalafas",
"name": "kjsoftware/practicalafas",
"type": "library",
"description": "A PHP library for communicating with AFAS Profit in a practical way.",
"license": "MIT",
Expand Down Expand Up @@ -28,3 +28,4 @@
"squizlabs/php_codesniffer": "^3.5"
}
}

101 changes: 101 additions & 0 deletions src/UpdateConnector/FiEntries.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?php

/**
* This file is part of the PracticalAfas package.
*
* (c) Roderik Muit <[email protected]>
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/

namespace PracticalAfas\UpdateConnector;

/**
* An UpdateObject containing definitions / logic for FiEntryPar objects.
*
* This has its own class because it's the only object type that needs to
* implement IsoCountryTrait and has no other custom functionality.
*/
class FiEntries extends UpdateObject
{

/**
* {@inheritdoc}
*/
protected function getDefaultPropertyDefinitions()
{
return [
'fields' => [
// Nummer
'EnNo' => [
'alias' => 'Nummer journaalpost',
'required' => true,
],
'VaAs' => [
'alias' => 'Kenmerk rekening',
'required' => true,
],
'AcNr' => [
'alias' => 'Rekeningnummer',
'required' => true,
],
'EnDa' => [
'alias' => 'Datum boeking',
'required' => true,
],
'BpDa' => [
'alias' => 'Boekstukdatum',
'required' => true,
'type' => 'date',
],
'BpNr' => [
'alias' => 'Boekstuknummer'
],
'InId' => [
'alias' => 'Factuurnummer'
],
'Ds' => [
'alias' => 'Omschrijving boeking'
],
'AmDe' => [
'alias' => 'Bedrag debit',
],
'AmCr' => [
'alias' => 'Bedrag credit',
],
'VaId' => [
'alias' => 'Btw-code',
],
'CuId' => [
'alias' => 'Valuta',
],
'AmDc' => [
'alias' => 'Valutabedrag debit',
],
'AmCc' => [
'alias' => 'Valutabedrag credit',
],
'OrNu' => [
'alias' => 'Verkoopordernummer',
],
'Fref' => [
'alias' => 'Factuurreferentie',
],
'Rate' => [
'alias' => 'Factuurreferentie',
]
],
];
}

/**
* {@inheritdoc}
*/
protected function validateFields(array $element, $element_index, $change_behavior = self::DEFAULT_CHANGE, $validation_behavior = self::DEFAULT_VALIDATION)
{
// $element = $this->convertIsoCountryCodeFields($element, $element_index, $change_behavior);

return parent::validateFields($element, $element_index, $change_behavior, $validation_behavior);
}
}
77 changes: 77 additions & 0 deletions src/UpdateConnector/FiEntryPar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

/**
* This file is part of the PracticalAfas package.
*
* (c) Roderik Muit <[email protected]>
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/

namespace PracticalAfas\UpdateConnector;

/**
* An UpdateObject containing definitions / logic for FiEntryPar objects.
*
* This has its own class because it's the only object type that needs to
* implement IsoCountryTrait and has no other custom functionality.
*/
class FiEntryPar extends UpdateObject
{

/**
* {@inheritdoc}
*/
protected function getDefaultPropertyDefinitions()
{
return [
'objects' => [
'FiEntries' => [
'alias' => 'line_items',
'multiple' => true,
],
],
'fields' => [
// Nummer
'Year' => [
'alias' => 'Boekjaar',
'required' => true,
],
'Peri' => [
'alias' => 'Periode',
'required' => true,
],
'UnId' => [
'alias' => 'Nummer administratie'
],
'JoCo' => [
'alias' => 'Dagboek',
'required' => true,
],
'AdDc' => [
'alias' => 'Maak verbijzonderingscode'
],
'AdDa' => [
'alias' => 'Maak verbijzonderingstoewijzing'
],
'PrTp' => [
'alias' => 'Type boeking'
],
'AuNu' => [
'alias' => 'Autonummering factuur',
]
],
];
}

/**
* {@inheritdoc}
*/
protected function validateFields(array $element, $element_index, $change_behavior = self::DEFAULT_CHANGE, $validation_behavior = self::DEFAULT_VALIDATION)
{
// $element = $this->convertIsoCountryCodeFields($element, $element_index, $change_behavior);

return parent::validateFields($element, $element_index, $change_behavior, $validation_behavior);
}
}
Loading