Completed
Push — master ( d19556...dcc177 )
by Al3x
08:24
created

Invoice::setRecurring()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace InvoiceNinjaModule\Model;
5
6
use InvoiceNinjaModule\Model\Interfaces\InvoiceInterface;
7
8
/**
9
 * Class Invoice
10
 * @codeCoverageIgnore
11
 */
12
final class Invoice extends Base implements InvoiceInterface
13
{
14
    /** @var float */
15
    private $amount = 0;
16
    /** @var float */
17
    private $balance = 0;
18
    /** @var int */
19
    private $clientId = 0;
20
    /** @var int */
21
    private $invoiceStatusId = InvoiceInterface::STATUS_DRAFT;
22
    /** @var string */
23
    private $invoiceNumber = '';
24
    /** @var float */
25
    private $discount = 0;
26
    /** @var string */
27
    private $poNumber = '';
28
    /** @var string */
29
    private $invoiceDate = '';
30
    /** @var string */
31
    private $dueDate = '';
32
    /** @var string */
33
    private $terms = '';
34
    /** @var string */
35
    private $publicNotes = '';
36
    /** @var int */
37
    private $invoiceTypeId = 0;
38
    /** @var bool */
39
    private $isRecurring = false;
40
    /** @var  int */
41
    private $frequencyId = 0;
42
    /** @var  string */
43
    private $startDate;
44
    /** @var  string */
45
    private $endDate;
46
    /** @var  string */
47
    private $lastSentDate;
48
    /** @var  int */
49
    private $recurringInvoiceId = 0;
50
    /** @var  string */
51
    private $taxName1 = '';
52
    /** @var  float */
53
    private $taxRate1 = 0;
54
    /** @var  string */
55
    private $taxName2 = '';
56
    /** @var  float */
57
    private $taxRate2 = 0;
58
    /** @var  bool */
59
    private $isAmountDiscount;
60
    /** @var  string */
61
    private $invoiceFooter = '';
62
    /** @var  float */
63
    private $partial = 0;
64
    /** @var  bool */
65
    private $hasTasks = false;
66
    /** @var  bool */
67
    private $autoBill = false;
68
    /** @var  int */
69
    private $customValue1;
70
    /** @var  int */
71
    private $customValue2;
72
    /** @var  bool */
73
    private $customTaxes1 = false;
74
    /** @var  bool */
75
    private $customTaxes2 = false;
76
    /** @var  bool */
77
    private $hasExpenses = false;
78
    /** @var  int */
79
    private $quoteInvoiceId = 0;
80
    /** @var  string */
81
    private $customTextValue1;
82
    /** @var  string */
83
    private $customTextValue2;
84
    /** @var  bool */
85
    private $isQuote = false;
86
    /** @var  bool */
87
    private $isPublic = false;
88
    /** @var  InvoiceItem[] */
89
    private $invoiceItems;
90
91
    /**
92
     * @return float
93
     */
94
    public function getAmount() : float
95
    {
96
        return $this->amount;
97
    }
98
99
    /**
100
     * @param float $amount
101
     */
102
    public function setAmount(float $amount) : void
103
    {
104
        $this->amount = $amount;
105
    }
106
107
    /**
108
     * @return float
109
     */
110
    public function getBalance() : float
111
    {
112
        return $this->balance;
113
    }
114
115
    /**
116
     * @param float $balance
117
     */
118
    public function setBalance(float $balance) : void
119
    {
120
        $this->balance = $balance;
121
    }
122
123
    /**
124
     * @return int
125
     */
126
    public function getClientId() : int
127
    {
128
        return $this->clientId;
129
    }
130
131
    /**
132
     * @param int $clientId
133
     */
134
    public function setClientId(int $clientId) : void
135
    {
136
        $this->clientId = $clientId;
137
    }
138
139
    /**
140
     * @return int
141
     */
142
    public function getInvoiceStatusId() : int
143
    {
144
        return $this->invoiceStatusId;
145
    }
146
147
    /**
148
     * @param int $invoiceStatusId
149
     */
150
    public function setInvoiceStatusId(int $invoiceStatusId) : void
151
    {
152
        $this->invoiceStatusId = $invoiceStatusId;
153
    }
154
155
    /**
156
     * @return string
157
     */
158
    public function getInvoiceNumber() : string
159
    {
160
        return $this->invoiceNumber;
161
    }
162
163
    /**
164
     * @param string $invoiceNumber
165
     */
166
    public function setInvoiceNumber(string $invoiceNumber) : void
167
    {
168
        $this->invoiceNumber = $invoiceNumber;
169
    }
170
171
    /**
172
     * @return float
173
     */
174
    public function getDiscount() : float
175
    {
176
        return $this->discount;
177
    }
178
179
    /**
180
     * @param float $discount
181
     */
182
    public function setDiscount(float $discount) : void
183
    {
184
        $this->discount = $discount;
185
    }
186
187
    /**
188
     * @return string
189
     */
190
    public function getPoNumber() : string
191
    {
192
        return $this->poNumber;
193
    }
194
195
    /**
196
     * @param string $poNumber
197
     */
198
    public function setPoNumber(string $poNumber) : void
199
    {
200
        $this->poNumber = $poNumber;
201
    }
202
203
    /**
204
     * @return \DateTime
205
     */
206
    public function getInvoiceDate() : \DateTime
207
    {
208
        return \DateTime::createFromFormat('Y-m-d', $this->invoiceDate);
209
    }
210
211
    /**
212
     * @param \DateTime $invoiceDate
213
     */
214
    public function setInvoiceDate(\DateTime $invoiceDate) : void
215
    {
216
        $this->invoiceDate = $invoiceDate->format('Y-m-d');
217
    }
218
219
    /**
220
     * @return string
221
     */
222
    public function getDueDate() : string
223
    {
224
        return $this->dueDate;
225
    }
226
227
    /**
228
     * @param string $dueDate
229
     */
230
    public function setDueDate(string $dueDate) : void
231
    {
232
        $this->dueDate = $dueDate;
233
    }
234
235
    /**
236
     * @return string
237
     */
238
    public function getTerms() : string
239
    {
240
        return $this->terms;
241
    }
242
243
    /**
244
     * @param string $terms
245
     */
246
    public function setTerms(string $terms) : void
247
    {
248
        $this->terms = $terms;
249
    }
250
251
    /**
252
     * @return string
253
     */
254
    public function getPublicNotes() : string
255
    {
256
        return $this->publicNotes;
257
    }
258
259
    /**
260
     * @param string $publicNotes
261
     */
262
    public function setPublicNotes(string $publicNotes) : void
263
    {
264
        $this->publicNotes = $publicNotes;
265
    }
266
267
    /**
268
     * @return int
269
     */
270
    public function getInvoiceTypeId() : int
271
    {
272
        return $this->invoiceTypeId;
273
    }
274
275
    /**
276
     * @param int $invoiceTypeId
277
     */
278
    public function setInvoiceTypeId(int $invoiceTypeId) : void
279
    {
280
        $this->invoiceTypeId = $invoiceTypeId;
281
    }
282
283
    /**
284
     * @return bool
285
     */
286
    public function isRecurring() : bool
287
    {
288
        return $this->isRecurring;
289
    }
290
291
    /**
292
     * @param bool $isRecurring
293
     */
294
    public function setRecurring(bool $isRecurring) : void
295
    {
296
        $this->isRecurring = $isRecurring;
297
    }
298
299
    /**
300
     * @return int
301
     */
302
    public function getFrequencyId() : int
303
    {
304
        return $this->frequencyId;
305
    }
306
307
    /**
308
     * @param int $frequencyId
309
     */
310
    public function setFrequencyId(int $frequencyId) : void
311
    {
312
        $this->frequencyId = $frequencyId;
313
    }
314
315
    /**
316
     * @return string
317
     */
318
    public function getStartDate() : string
319
    {
320
        return $this->startDate;
321
    }
322
323
    /**
324
     * @param string $startDate
325
     */
326
    public function setStartDate(string $startDate) : void
327
    {
328
        $this->startDate = $startDate;
329
    }
330
331
    /**
332
     * @return string
333
     */
334
    public function getEndDate() : string
335
    {
336
        return $this->endDate;
337
    }
338
339
    /**
340
     * @param string $endDate
341
     */
342
    public function setEndDate(string $endDate) : void
343
    {
344
        $this->endDate = $endDate;
345
    }
346
347
    /**
348
     * @return string
349
     */
350
    public function getLastSentDate() : string
351
    {
352
        return $this->lastSentDate;
353
    }
354
355
    /**
356
     * @param string $lastSentDate
357
     */
358
    public function setLastSentDate(string $lastSentDate) : void
359
    {
360
        $this->lastSentDate = $lastSentDate;
361
    }
362
363
    /**
364
     * @return int
365
     */
366
    public function getRecurringInvoiceId() : int
367
    {
368
        return $this->recurringInvoiceId;
369
    }
370
371
    /**
372
     * @param int $recurringInvoiceId
373
     */
374
    public function setRecurringInvoiceId(int $recurringInvoiceId) : void
375
    {
376
        $this->recurringInvoiceId = $recurringInvoiceId;
377
    }
378
379
    /**
380
     * @return string
381
     */
382
    public function getTaxName1() : string
383
    {
384
        return $this->taxName1;
385
    }
386
387
    /**
388
     * @param string $taxName1
389
     */
390
    public function setTaxName1(string $taxName1) : void
391
    {
392
        $this->taxName1 = $taxName1;
393
    }
394
395
    /**
396
     * @return float
397
     */
398
    public function getTaxRate1() : float
399
    {
400
        return $this->taxRate1;
401
    }
402
403
    /**
404
     * @param float $taxRate1
405
     */
406
    public function setTaxRate1(float $taxRate1) : void
407
    {
408
        $this->taxRate1 = $taxRate1;
409
    }
410
411
    /**
412
     * @return string
413
     */
414
    public function getTaxName2() : string
415
    {
416
        return $this->taxName2;
417
    }
418
419
    /**
420
     * @param string $taxName2
421
     */
422
    public function setTaxName2(string $taxName2) : void
423
    {
424
        $this->taxName2 = $taxName2;
425
    }
426
427
    /**
428
     * @return float
429
     */
430
    public function getTaxRate2() : float
431
    {
432
        return $this->taxRate2;
433
    }
434
435
    /**
436
     * @param float $taxRate2
437
     */
438
    public function setTaxRate2(float $taxRate2) : void
439
    {
440
        $this->taxRate2 = $taxRate2;
441
    }
442
443
    /**
444
     * @return bool
445
     */
446
    public function isAmountDiscount() : bool
447
    {
448
        return $this->isAmountDiscount;
449
    }
450
451
    /**
452
     * @param bool $isAmountDiscount
453
     */
454
    public function setAmountDiscount(bool $isAmountDiscount) : void
455
    {
456
        $this->isAmountDiscount = $isAmountDiscount;
457
    }
458
459
    /**
460
     * @return string
461
     */
462
    public function getInvoiceFooter() : string
463
    {
464
        return $this->invoiceFooter;
465
    }
466
467
    /**
468
     * @param string $invoiceFooter
469
     */
470
    public function setInvoiceFooter(string $invoiceFooter) : void
471
    {
472
        $this->invoiceFooter = $invoiceFooter;
473
    }
474
475
    /**
476
     * @return float
477
     */
478
    public function getPartial() : float
479
    {
480
        return $this->partial;
481
    }
482
483
    /**
484
     * @param float $partial
485
     */
486
    public function setPartial(float $partial) : void
487
    {
488
        $this->partial = $partial;
489
    }
490
491
    /**
492
     * @return bool
493
     */
494
    public function hasTasks() : bool
495
    {
496
        return $this->hasTasks;
497
    }
498
499
    /**
500
     * @param bool $hasTasks
501
     */
502
    public function setHasTasks(bool $hasTasks) : void
503
    {
504
        $this->hasTasks = $hasTasks;
505
    }
506
507
    /**
508
     * @return bool
509
     */
510
    public function isAutoBill() : bool
511
    {
512
        return $this->autoBill;
513
    }
514
515
    /**
516
     * @param bool $autoBill
517
     */
518
    public function setAutoBill(bool $autoBill) : void
519
    {
520
        $this->autoBill = $autoBill;
521
    }
522
523
    /**
524
     * @return int
525
     */
526
    public function getCustomValue1() : int
527
    {
528
        return $this->customValue1;
529
    }
530
531
    /**
532
     * @param int $customValue1
533
     */
534
    public function setCustomValue1(int $customValue1) : void
535
    {
536
        $this->customValue1 = $customValue1;
537
    }
538
539
    /**
540
     * @return int
541
     */
542
    public function getCustomValue2() : int
543
    {
544
        return $this->customValue2;
545
    }
546
547
    /**
548
     * @param int $customValue2
549
     */
550
    public function setCustomValue2(int $customValue2) : void
551
    {
552
        $this->customValue2 = $customValue2;
553
    }
554
555
    /**
556
     * @return bool
557
     */
558
    public function isCustomTaxes1() : bool
559
    {
560
        return $this->customTaxes1;
561
    }
562
563
    /**
564
     * @param bool $customTaxes1
565
     */
566
    public function setCustomTaxes1(bool $customTaxes1) : void
567
    {
568
        $this->customTaxes1 = $customTaxes1;
569
    }
570
571
    /**
572
     * @return bool
573
     */
574
    public function isCustomTaxes2() : bool
575
    {
576
        return $this->customTaxes2;
577
    }
578
579
    /**
580
     * @param bool $customTaxes2
581
     */
582
    public function setCustomTaxes2(bool $customTaxes2) : void
583
    {
584
        $this->customTaxes2 = $customTaxes2;
585
    }
586
587
    /**
588
     * @return bool
589
     */
590
    public function hasExpenses() : bool
591
    {
592
        return $this->hasExpenses;
593
    }
594
595
    /**
596
     * @param bool $hasExpenses
597
     */
598
    public function setHasExpenses(bool $hasExpenses) : void
599
    {
600
        $this->hasExpenses = $hasExpenses;
601
    }
602
603
    /**
604
     * @return int
605
     */
606
    public function getQuoteInvoiceId() : int
607
    {
608
        return $this->quoteInvoiceId;
609
    }
610
611
    /**
612
     * @param int $quoteInvoiceId
613
     */
614
    public function setQuoteInvoiceId(int $quoteInvoiceId) : void
615
    {
616
        $this->quoteInvoiceId = $quoteInvoiceId;
617
    }
618
619
    /**
620
     * @return string
621
     */
622
    public function getCustomTextValue1() : string
623
    {
624
        return $this->customTextValue1;
625
    }
626
627
    /**
628
     * @param string $customTextValue1
629
     */
630
    public function setCustomTextValue1(string $customTextValue1) : void
631
    {
632
        $this->customTextValue1 = $customTextValue1;
633
    }
634
635
    /**
636
     * @return string
637
     */
638
    public function getCustomTextValue2() : string
639
    {
640
        return $this->customTextValue2;
641
    }
642
643
    /**
644
     * @param string $customTextValue2
645
     */
646
    public function setCustomTextValue2(string $customTextValue2) : void
647
    {
648
        $this->customTextValue2 = $customTextValue2;
649
    }
650
651
    /**
652
     * @return bool
653
     */
654
    public function isQuote() : bool
655
    {
656
        return $this->isQuote;
657
    }
658
659
    /**
660
     * @param bool $isQuote
661
     */
662
    public function setQuote(bool $isQuote) : void
663
    {
664
        $this->isQuote = $isQuote;
665
    }
666
667
    /**
668
     * @return bool
669
     */
670
    public function isPublic() : bool
671
    {
672
        return $this->isPublic;
673
    }
674
675
    /**
676
     * @param bool $isPublic
677
     */
678
    public function setPublic(bool $isPublic) : void
679
    {
680
        $this->isPublic = $isPublic;
681
    }
682
683
    /**
684
     * @return InvoiceItem[]
685
     */
686
    public function getInvoiceItems() : array
687
    {
688
        return $this->invoiceItems;
689
    }
690
691
    /**
692
     * @param InvoiceItem[] $invoiceItems
693
     */
694
    public function setInvoiceItems(array $invoiceItems) : void
695
    {
696
        $this->invoiceItems = $invoiceItems;
697
    }
698
}
699