Skip to content

Additional salesinvoice fields #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4da508d
Can define optional sales invoice fields
PKJedi Jan 17, 2017
60cd3f0
Additional fields now serialized, tested
PKJedi Jan 17, 2017
233449a
Updated sales invoice dtd
PKJedi Jan 17, 2017
2dd57b0
Sales invoice field order
PKJedi Jan 17, 2017
3429a89
Back to normal props, added attachments
PKJedi Jan 18, 2017
f9a0577
Customer group name
PKJedi Jan 18, 2017
ae201cf
Added new features to readme
PKJedi Jan 18, 2017
e82c0c5
SalesInvoiceProductLine additional fields, dimensions tested
PKJedi Jan 18, 2017
8f84d27
Customer details
PKJedi Jan 24, 2017
c1834c0
Do not remove CDATA wraps as the escaping rules are different
PKJedi Jan 24, 2017
c28be54
Can define optional sales invoice fields
PKJedi Jan 17, 2017
27d95f2
Additional fields now serialized, tested
PKJedi Jan 17, 2017
d87698d
Updated sales invoice dtd
PKJedi Jan 17, 2017
36842fe
Sales invoice field order
PKJedi Jan 17, 2017
6de9bef
Back to normal props, added attachments
PKJedi Jan 18, 2017
19f6dfa
Customer group name
PKJedi Jan 18, 2017
3950d32
Added new features to readme
PKJedi Jan 18, 2017
d5e84d3
SalesInvoiceProductLine additional fields, dimensions tested
PKJedi Jan 18, 2017
d52e9a6
Customer details
PKJedi Jan 24, 2017
9ad6976
Do not remove CDATA wraps as the escaping rules are different
PKJedi Jan 24, 2017
2a71344
processXml test fix
PKJedi Jan 23, 2018
b515961
Merge branch '24-salesinvoice-additionals' of github.com:xi-project/x…
Jan 23, 2018
d1f7abe
Added option to set invoicing language
Jan 23, 2018
336ac4f
Added invoicing email address
Jan 25, 2018
bca54c2
Added editCustomer method with required request params
Jun 6, 2018
fb2d0bd
Merge pull request #30 from xi-project/edit-customer
PKJedi Oct 25, 2019
8e7bd75
Can define internal identifier in customer base information
PKJedi Oct 25, 2019
afb3c13
Updated dependencies, PHP 7.1+
PKJedi Oct 25, 2019
42d7c28
Internal identifier first
PKJedi Oct 25, 2019
8f21657
Fixed bug from microtime not always returning with a period char
PKJedi Nov 1, 2019
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
53 changes: 41 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Xi Netvisor

Netvisor API interface for PHP 5.3+.
Netvisor API interface for PHP 7.1+.

[![Build Status](https://secure.travis-ci.org/xi-project/xi-netvisor.png)](https://travis-ci.org/xi-project/xi-netvisor)

## Interfaces

- None yet

## Before you start hacking away

You must do the following things to get everything up and running:
Expand Down Expand Up @@ -44,15 +40,48 @@ $config = new Xi\Netvisor\Config(...); // Use the parameters described a
$netvisor = new Xi\Netvisor\Netvisor($config);
```

### Constructing XML
### Actions

You can instantiate a certain type of a _Resource_ (e.g. `Xi\Netvisor\Resource\Xml\SalesInvoice`).
All _Resources_ should extend `Xi\Netvisor\Resource\Xml\Root` and implement `getDtdPath()` to return a file path
which points to a correct DTD file (used for validation).
#### Search customers
```php
$customers = $netvisor->getCustomers(
'1234567-1' // Optional keyword
);
```

#### Get customers changed since datetime
```php
$customers = $netvisor->getCustomersChangedSince(
new DateTime(...) // Required
);
```

#### Get product
```php
$product = $netvisor->getProduct(
123 // Required Netvisor identifier
);
```

#### Send customer
```php
$customer = new Xi\Netvisor\Resource\Xml\Customer(
new Xi\Netvisor\Resource\Xml\CustomerBaseInformation(
'1234567-1',
'Test Oy',
'Test street 1',
'Helsinki',
'00240',
'FI'
)
);

$response = new \SimpleXMLElement($this->netvisor->sendCustomer($customer));
$netvisorIdentifier = (string)$response->Replies->InsertedDataIdentifier;
```

Resource's mandatory parameters are given in the constructor. Optional values can be set via setters.

#### SalesInvoice
#### Send invoice

```php
$invoice = new Xi\Netvisor\Resource\Xml\SalesInvoice(...);
Expand All @@ -61,5 +90,5 @@ $invoiceProductLine = new Xi\Netvisor\Resource\Xml\SalesInvoiceProductLine(...);

$invoice->addSalesInvoiceProductLine($invoiceProductLine);

$netvisor->addSalesInvoice($invoice);
$netvisor->sendInvoice($invoice);
```
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
],

"require": {
"php": "^5.6 || ^7.0",
"jms/serializer": "^1.4",
"guzzlehttp/guzzle": "^6.2"
"php": "^7.1",
"jms/serializer": "^1.14",
"guzzlehttp/guzzle": "^6.4"
},

"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^7.5"
},

"autoload": {
Expand Down
Loading