You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 29, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+45-22
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,8 @@ After that you should be set to go!
41
41
###Usage
42
42
This package was made for working with the QuickBooks Accounting API in mind. You can look at all of the accounting resources here under 'Transaction' and 'Name list' resources. [QuickBooks Accounting API](https://developer.intuit.com/docs/api/accounting)
43
43
44
+
####Note On Working With QuickBooks
45
+
Just because in the QuickBooks documentation something says optional doesn't mean that you don't need it for your request. If your request doesn't go through make sure to dd() to see what error QuickBooks is giving back. It may be asking you to set something that is optional.
44
46
There are a few resources that aren't supported by the QuickBooks SDK and those are listed here:
45
47
* CompanyCurrency
46
48
* Budget
@@ -50,10 +52,11 @@ There are a few resources that aren't supported by the QuickBooks SDK and those
50
52
* Deposit
51
53
* Transfer
52
54
55
+
####Connecting To QuickBooks
53
56
To connect to quickbooks.
54
57
55
58
```php
56
-
// web.php
59
+
// routes/web.php
57
60
use Myleshyson\LaravelQuickBooks\Facades\Customer;
58
61
59
62
Route::get('/', function () {
@@ -63,19 +66,34 @@ Route::get('/', function () {
63
66
64
67
If you want to disconnect from quickbooks then you can do it like so.
65
68
```php
66
-
// web.php
69
+
// routes/web.php
67
70
use Myleshyson\LaravelQuickBooks\Facades\Customer;
68
71
69
72
Route::get('/', function () {
70
73
Connection::stop();
71
74
});
72
75
```
73
76
77
+
####Making Requests
78
+
79
+
Every resource that's available has four methods except for TaxRate and TaxCode. Those only have a get and find method.
80
+
81
+
```php
82
+
Customer::create(array $data);
83
+
84
+
Customer::update($id, array $data);
85
+
86
+
Customer::delete($id);
87
+
88
+
Customer::find($id);
89
+
90
+
Customer::get(); //gets all customers associated with your account.
91
+
```
74
92
75
93
I used the same naming conventions as the QuickBooks API to make things easier. In order to create a resource like Customer for example, you would use it like this...
76
94
77
95
```php
78
-
// web.php
96
+
// routes/web.php
79
97
80
98
use Myleshyson\LaravelQuickBooks\Facades\Customer;
81
99
@@ -97,7 +115,18 @@ Route::get('/', function () {
97
115
```
98
116
*Make sure to import the Facade class*
99
117
100
-
Most resources in the quickbooks api have lines that you can add to the object your building. For example an Invoice has line items and foreach line in the Invoice there could be sub line items and so forth. There are multiple lines types in quickbooks that are defined as the DetailType. For this package, set the DetailType as the key to the *Lines* multi-dimensional array and within it you can set both the Line data and the DetailType data. In order to create lines for the invoice it would look something like this.
118
+
To handle any type of line in QuickBooks handle it like so. The key in the Lines array is the DetailType of the line. Check the documentation for what attributes you can set for the specific line you want.
119
+
120
+
Here are the different line types in quickbooks
121
+
122
+
* SalesItemLineDetail
123
+
* ItemBasedExpenseLineDetail
124
+
* AccountBasedExpenseLineDetail
125
+
* GroupLineDetail
126
+
* DescriptionOnly
127
+
* DiscountLineDetail
128
+
* SubtotalLine
129
+
* TaxLineDetail
101
130
102
131
```php
103
132
Invoice::create([
@@ -113,23 +142,17 @@ Invoice::create([
113
142
'GroupLineDetail' => [
114
143
'...etc'
115
144
]
145
+
],
146
+
'TxnTaxDetail' => [
147
+
'TxnTaxCodeRef' => 8,
148
+
'Lines' => [
149
+
'TaxLineDetail' => [
150
+
'SomeStuff'
151
+
],
152
+
'TaxLineDetail' => [
153
+
'MoreStuff'
154
+
]
155
+
]
116
156
]
117
157
])
118
-
```
119
-
120
-
Every resource that's available has four methods except for TaxRate and TaxCode. Those only have a get and find method.
121
-
122
-
```php
123
-
Customer::create(array $data);
124
-
125
-
Customer::update($id, array $data);
126
-
127
-
Customer::delete($id);
128
-
129
-
Customer::find($id);
130
-
131
-
Customer::get(); //gets all customers associated with your account.
0 commit comments