Skip to content

Commit

Permalink
Change TaxRate to Position
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Kwiedor committed Nov 23, 2020
1 parent f2c8fa7 commit a8606b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can currently only create invoices and items in the invoices. For this purpo
Here you will find an example how to create a new invoice in sevDesk.

```go
invoice, err := sevdesk.NewInvoice(sevdesk.Invoice{"", "clientID", "21.11.2020", "100", "RE", "contactID", "16" "token"})
invoice, err := sevdesk.NewInvoice(sevdesk.Invoice{"", "clientID", "21.11.2020", "100", "RE", "contactID", "token"})
if err != nil {
fmt.Println("Error: ", err)
}
Expand All @@ -31,7 +31,7 @@ For this I have worked it all out as follows. The funny thing is that the ID doe
**1 = Stk, 2 = m², 3 = m, 4 = kg, 5 = t, 6 = lfm, 7 = pauschal, 8 = m³, 9 = Std, 10 = km, 11 = %, 12 = Tag(e), 13 = l**

```go
Position, err := NewPosition(Position{"45", "1", "Backups", "9", "invoiceID", "token"})
Position, err := NewPosition(Position{"45", "1", "16", "Backups", "9", "invoiceID", "token"})
if err != nil {
fmt.Println("Error: ", err)
}
Expand Down
3 changes: 1 addition & 2 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Invoice struct {
Status string
InvoiceType string
ContactPerson string
TaxRate string
Token string
}

Expand Down Expand Up @@ -123,7 +122,7 @@ func NewInvoice(config Invoice) (InvoiceReturn, error) {
body.Set("contactPerson[id]", config.ContactPerson)
body.Set("contactPerson[objectName]", "SevUser")
body.Set("taxType", "default")
body.Set("taxRate", config.TaxRate)
body.Set("taxRate", "")
body.Set("taxText", "0")
body.Set("showNet", "false")

Expand Down
3 changes: 2 additions & 1 deletion position.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
type Position struct {
Price string
Quantity string
TaxRate string
Name string
UnityID string
InvoiceID string
Expand Down Expand Up @@ -137,7 +138,7 @@ func NewPosition(config Position) (PositionReturn, error) {
body := url.Values{}
body.Set("price", config.Price)
body.Set("quantity", config.Quantity)
body.Set("taxRate", "")
body.Set("taxRate", config.TaxRate)
body.Set("name", config.Name)
body.Set("unity[id]", config.UnityID)
body.Set("unity[objectName]", "Unity")
Expand Down

0 comments on commit a8606b0

Please sign in to comment.