Code Duplication    Length = 76-77 lines in 2 locations

src/Picqer/Financials/Exact/PurchaseOrder.php 1 location

@@ 61-137 (lines=77) @@
58
 * @property Edm.String $WarehouseDescription Description of Warehouse
59
 * @property Edm.String $YourRef Shows the reference number associated with the purchase order. Enter a description and reference to make the purchase order easier to identify.
60
 */
61
class PurchaseOrder extends Model
62
{
63
    use Query\Findable;
64
    use Persistance\Storable;
65
66
    protected $primaryKey = 'PurchaseOrderID';
67
68
    protected $purchaseOrderLines = [];
69
70
    protected $fillable = [
71
        'PurchaseOrderID',
72
        'AmountDC',
73
        'AmountFC',
74
        'Created',
75
        'Creator',
76
        'CreatorFullName',
77
        'Currency',
78
        'DeliveryAccount',
79
        'DeliveryAccountCode',
80
        'DeliveryAccountName',
81
        'DeliveryAddress',
82
        'DeliveryContact',
83
        'DeliveryContactPersonFullName',
84
        'Description',
85
        'Division',
86
        'Document',
87
        'DocumentSubject',
88
        'DropShipment',
89
        'ExchangeRate',
90
        'InvoiceStatus',
91
        'Modified',
92
        'Modifier',
93
        'ModifierFullName',
94
        'OrderDate',
95
        'OrderNumber',
96
        'OrderStatus',
97
        'PaymentCondition',
98
        'PaymentConditionDescription',
99
        'PurchaseAgent',
100
        'PurchaseAgentFullName',
101
        'PurchaseOrderLines',
102
        'ReceiptDate',
103
        'ReceiptStatus',
104
        'Remarks',
105
        'SalesOrder',
106
        'SalesOrderNumber',
107
        'ShippingMethod',
108
        'ShippingMethodDescription',
109
        'Source',
110
        'Supplier',
111
        'SupplierCode',
112
        'SupplierContact',
113
        'SupplierContactPersonFullName',
114
        'SupplierName',
115
        'VATAmount',
116
        'Warehouse',
117
        'WarehouseCode',
118
        'WarehouseDescription',
119
        'YourRef',
120
    ];
121
122
    /**
123
     * @param array $array
124
     */
125
    public function addItem(array $array)
126
    {
127
        if (! isset($this->attributes['PurchaseOrderLines']) || $this->attributes['PurchaseOrderLines'] == null) {
128
            $this->attributes['PurchaseOrderLines'] = [];
129
        }
130
        if (! isset($array['LineNumber'])) {
131
            $array['LineNumber'] = count($this->attributes['PurchaseOrderLines']) + 1;
132
        }
133
        $this->attributes['PurchaseOrderLines'][] = $array;
134
    }
135
136
    protected $url = 'purchaseorder/PurchaseOrders';
137
}
138

src/Picqer/Financials/Exact/Quotation.php 1 location

@@ 61-136 (lines=76) @@
58
 * @property Int32 $VersionNumber Number indicating the different reviews which are made for the quotation
59
 * @property String $YourRef The number by which this quotation is identified by the order account
60
 */
61
class Quotation extends Model
62
{
63
64
    use Query\Findable;
65
    use Persistance\Storable;
66
67
    protected $primaryKey = 'QuotationID';
68
69
    protected $fillable = [
70
        'QuotationID',
71
        'AmountDC',
72
        'AmountFC',
73
        'CloseDate',
74
        'ClosingDate',
75
        'Created',
76
        'Creator',
77
        'CreatorFullName',
78
        'Currency',
79
        'DeliveryAccount',
80
        'DeliveryAccountCode',
81
        'DeliveryAccountContact',
82
        'DeliveryAccountContactFullName',
83
        'DeliveryAccountName',
84
        'DeliveryAddress',
85
        'Description',
86
        'Division',
87
        'Document',
88
        'DocumentSubject',
89
        'DueDate',
90
        'InvoiceAccount',
91
        'InvoiceAccountCode',
92
        'InvoiceAccountContact',
93
        'InvoiceAccountContactFullName',
94
        'InvoiceAccountName',
95
        'Modified',
96
        'Modifier',
97
        'ModifierFullName',
98
        'Opportunity',
99
        'OpportunityName',
100
        'OrderAccount',
101
        'OrderAccountCode',
102
        'OrderAccountContact',
103
        'OrderAccountContactFullName',
104
        'OrderAccountName',
105
        'Project',
106
        'ProjectCode',
107
        'ProjectDescription',
108
        'QuotationDate',
109
        'QuotationLines',
110
        'QuotationNumber',
111
        'Remarks',
112
        'SalesPerson',
113
        'SalesPersonFullName',
114
        'Status',
115
        'StatusDescription',
116
        'VATAmountFC',
117
        'VersionNumber',
118
        'YourRef',
119
    ];
120
121
    /**
122
     * @param array $array
123
     */
124
    public function addItem(array $array)
125
    {
126
        if (! isset($this->attributes['QuotationLines']) || $this->attributes['QuotationLines'] == null) {
127
            $this->attributes['QuotationLines'] = [];
128
        }
129
        if (! isset($array['LineNumber'])) {
130
            $array['LineNumber'] = count($this->attributes['QuotationLines']) + 1;
131
        }
132
        $this->attributes['QuotationLines'][] = $array;
133
    }
134
135
    protected $url = 'crm/Quotations';
136
}
137