Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit a907322

Browse files
committed
Updated Read
1 parent 1945936 commit a907322

File tree

1 file changed

+45
-22
lines changed

1 file changed

+45
-22
lines changed

README.md

+45-22
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ After that you should be set to go!
4141
###Usage
4242
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)
4343

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.
4446
There are a few resources that aren't supported by the QuickBooks SDK and those are listed here:
4547
* CompanyCurrency
4648
* Budget
@@ -50,10 +52,11 @@ There are a few resources that aren't supported by the QuickBooks SDK and those
5052
* Deposit
5153
* Transfer
5254

55+
####Connecting To QuickBooks
5356
To connect to quickbooks.
5457

5558
```php
56-
// web.php
59+
// routes/web.php
5760
use Myleshyson\LaravelQuickBooks\Facades\Customer;
5861

5962
Route::get('/', function () {
@@ -63,19 +66,34 @@ Route::get('/', function () {
6366

6467
If you want to disconnect from quickbooks then you can do it like so.
6568
```php
66-
// web.php
69+
// routes/web.php
6770
use Myleshyson\LaravelQuickBooks\Facades\Customer;
6871

6972
Route::get('/', function () {
7073
Connection::stop();
7174
});
7275
```
7376

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+
```
7492

7593
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...
7694

7795
```php
78-
// web.php
96+
// routes/web.php
7997

8098
use Myleshyson\LaravelQuickBooks\Facades\Customer;
8199

@@ -97,7 +115,18 @@ Route::get('/', function () {
97115
```
98116
*Make sure to import the Facade class*
99117

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
101130

102131
```php
103132
Invoice::create([
@@ -113,23 +142,17 @@ Invoice::create([
113142
'GroupLineDetail' => [
114143
'...etc'
115144
]
145+
],
146+
'TxnTaxDetail' => [
147+
'TxnTaxCodeRef' => 8,
148+
'Lines' => [
149+
'TaxLineDetail' => [
150+
'SomeStuff'
151+
],
152+
'TaxLineDetail' => [
153+
'MoreStuff'
154+
]
155+
]
116156
]
117157
])
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.
132-
```
133-
134-
135-
158+
```

0 commit comments

Comments
 (0)