@@ -67,10 +67,10 @@ |
||
67 | 67 | |
68 | 68 | public function addItem(array $array) |
69 | 69 | { |
70 | - if (! isset($this->attributes['PurchaseEntryLines']) || $this->attributes['PurchaseEntryLines'] == null) { |
|
70 | + if ( ! isset($this->attributes['PurchaseEntryLines']) || $this->attributes['PurchaseEntryLines'] == null) { |
|
71 | 71 | $this->attributes['PurchaseEntryLines'] = []; |
72 | 72 | } |
73 | - if (! isset($array['LineNumber'])) { |
|
73 | + if ( ! isset($array['LineNumber'])) { |
|
74 | 74 | $array['LineNumber'] = count($this->attributes['PurchaseEntryLines']) + 1; |
75 | 75 | } |
76 | 76 | $this->attributes['PurchaseEntryLines'][] = $array; |
@@ -32,22 +32,22 @@ |
||
32 | 32 | protected $primaryKey = 'HID'; |
33 | 33 | |
34 | 34 | protected $fillable = [ |
35 | - 'AccountCode', |
|
36 | - 'AccountId', |
|
37 | - 'AccountName', |
|
38 | - 'Amount', |
|
39 | - 'AmountInTransit', |
|
40 | - 'CurrencyCode', |
|
41 | - 'Description', |
|
42 | - 'DueDate', |
|
43 | - 'EntryNumber', |
|
44 | - 'HID', |
|
45 | - 'Id', |
|
46 | - 'InvoiceDate', |
|
47 | - 'InvoiceNumber', |
|
48 | - 'JournalCode', |
|
49 | - 'JournalDescription', |
|
50 | - 'YourRef', |
|
35 | + 'AccountCode', |
|
36 | + 'AccountId', |
|
37 | + 'AccountName', |
|
38 | + 'Amount', |
|
39 | + 'AmountInTransit', |
|
40 | + 'CurrencyCode', |
|
41 | + 'Description', |
|
42 | + 'DueDate', |
|
43 | + 'EntryNumber', |
|
44 | + 'HID', |
|
45 | + 'Id', |
|
46 | + 'InvoiceDate', |
|
47 | + 'InvoiceNumber', |
|
48 | + 'JournalCode', |
|
49 | + 'JournalDescription', |
|
50 | + 'YourRef', |
|
51 | 51 | ]; |
52 | 52 | |
53 | 53 | protected $url = 'read/financial/ReceivablesList'; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | public function addItem(array $array) |
61 | 61 | { |
62 | - if (! isset($this->attributes['BankEntryLines']) || $this->attributes['BankEntryLines'] == null) { |
|
62 | + if ( ! isset($this->attributes['BankEntryLines']) || $this->attributes['BankEntryLines'] == null) { |
|
63 | 63 | $this->attributes['BankEntryLines'] = []; |
64 | 64 | } |
65 | 65 | $this->attributes['BankEntryLines'][] = $array; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | ]; |
28 | 28 | |
29 | 29 | $res = $client->get($uri, [ |
30 | - 'headers' => $headers |
|
30 | + 'headers' => $headers |
|
31 | 31 | ]); |
32 | 32 | |
33 | 33 | return $res->getBody(); |
@@ -123,10 +123,10 @@ |
||
123 | 123 | */ |
124 | 124 | public function addItem(array $array) |
125 | 125 | { |
126 | - if (! isset($this->attributes['QuotationLines']) || $this->attributes['QuotationLines'] == null) { |
|
126 | + if ( ! isset($this->attributes['QuotationLines']) || $this->attributes['QuotationLines'] == null) { |
|
127 | 127 | $this->attributes['QuotationLines'] = []; |
128 | 128 | } |
129 | - if (! isset($array['LineNumber'])) { |
|
129 | + if ( ! isset($array['LineNumber'])) { |
|
130 | 130 | $array['LineNumber'] = count($this->attributes['QuotationLines']) + 1; |
131 | 131 | } |
132 | 132 | $this->attributes['QuotationLines'][] = $array; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | // If we have one result which is not an assoc array, make it the first element of an array for the |
36 | 36 | // collectionFromResult function so we always return a collection from filter |
37 | 37 | if ((bool) count(array_filter(array_keys($result), 'is_string'))) { |
38 | - $result = [ $result ]; |
|
38 | + $result = [$result]; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | $class = $this->class; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * @return mixed |
78 | 78 | */ |
79 | 79 | public function getSalesInvoiceLines() { |
80 | - if(array_key_exists('__deferred', $this->attributes['PurchaseInvoiceLines'])) { |
|
80 | + if (array_key_exists('__deferred', $this->attributes['PurchaseInvoiceLines'])) { |
|
81 | 81 | $this->attributes['PurchaseInvoiceLines'] = (new PurchaseInvoiceLine($this->connection()))->filter("InvoiceID eq guid'{$this->ID}'"); |
82 | 82 | } |
83 | 83 | return $this->attributes['PurchaseInvoiceLines']; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * |
59 | 59 | * @return string (guid) |
60 | 60 | */ |
61 | - public function findId($code, $key='Code') |
|
61 | + public function findId($code, $key = 'Code') |
|
62 | 62 | { |
63 | 63 | if ($this->isFillable($key)) { |
64 | 64 | $format = ($this->url() == 'crm/Accounts' && $key === 'Code') ? '%18s' : '%s'; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $result = $this->connection()->get($this->url(), $request, $headers); |
110 | 110 | |
111 | - if (!empty($divisionId)) { |
|
111 | + if ( ! empty($divisionId)) { |
|
112 | 112 | $this->connection()->setDivision($originalDivision); // Restore division |
113 | 113 | } |
114 | 114 |
@@ -64,8 +64,7 @@ |
||
64 | 64 | $format = ($this->url() == 'crm/Accounts' && $key === 'Code') ? '%18s' : '%s'; |
65 | 65 | if (preg_match('/^[\w]{8}-([\w]{4}-){3}[\w]{12}$/', $code)) { |
66 | 66 | $format = "guid'$format'"; |
67 | - } |
|
68 | - elseif (is_string($code)) { |
|
67 | + } elseif (is_string($code)) { |
|
69 | 68 | $format = "'$format'"; |
70 | 69 | } |
71 | 70 |
@@ -47,34 +47,34 @@ |
||
47 | 47 | |
48 | 48 | protected $fillable = [ |
49 | 49 | 'ID', |
50 | - 'AverageCost', |
|
51 | - 'Backflush', |
|
52 | - 'CalculatorType', |
|
53 | - 'CostBatch', |
|
54 | - 'CostCenter', |
|
55 | - 'CostCenterDescription', |
|
56 | - 'CostUnit', |
|
57 | - 'CostUnitDescription', |
|
58 | - 'CreatorFullName', |
|
59 | - 'Description', |
|
60 | - 'DetailDrawing', |
|
61 | - 'Division', |
|
62 | - 'ItemVersion', |
|
63 | - 'LineNumber', |
|
64 | - 'NetWeight', |
|
65 | - 'NetWeightUnit', |
|
66 | - 'Notes', |
|
67 | - 'PartItem', |
|
68 | - 'PartItemCode', |
|
69 | - 'PartItemCostPriceStandard', |
|
70 | - 'PartItemDescription', |
|
71 | - 'Quantity', |
|
72 | - 'QuantityBatch', |
|
73 | - 'syscreated', |
|
74 | - 'syscreator', |
|
75 | - 'sysmodified', |
|
76 | - 'sysmodifier', |
|
77 | - 'Type' |
|
50 | + 'AverageCost', |
|
51 | + 'Backflush', |
|
52 | + 'CalculatorType', |
|
53 | + 'CostBatch', |
|
54 | + 'CostCenter', |
|
55 | + 'CostCenterDescription', |
|
56 | + 'CostUnit', |
|
57 | + 'CostUnitDescription', |
|
58 | + 'CreatorFullName', |
|
59 | + 'Description', |
|
60 | + 'DetailDrawing', |
|
61 | + 'Division', |
|
62 | + 'ItemVersion', |
|
63 | + 'LineNumber', |
|
64 | + 'NetWeight', |
|
65 | + 'NetWeightUnit', |
|
66 | + 'Notes', |
|
67 | + 'PartItem', |
|
68 | + 'PartItemCode', |
|
69 | + 'PartItemCostPriceStandard', |
|
70 | + 'PartItemDescription', |
|
71 | + 'Quantity', |
|
72 | + 'QuantityBatch', |
|
73 | + 'syscreated', |
|
74 | + 'syscreator', |
|
75 | + 'sysmodified', |
|
76 | + 'sysmodifier', |
|
77 | + 'Type' |
|
78 | 78 | ]; |
79 | 79 | |
80 | 80 | protected $url = 'manufacturing/BillOfMaterialMaterials'; |