Passed
Push — master ( c2faf8...afa411 )
by Al3x
11:51
created

Invoice::setBalance()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
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
15
    private string $projectId = '';
16
    private float $amount = 0;
17
    private float $balance = 0;
18
    private string $clientId = '';
19
    private string $vendorId = '';
20
    private string $statusId = InvoiceInterface::STATUS_DRAFT;
21
    private string $designId = '';
22
    private string $recurringId = '';
23
    private string $number = '';
24
    private float $discount = 0;
25
    private string $poNumber = '';
26
    private string $date = '';
27
    private string $lastSentDate = '';
28
    private string $nextSendDate = '';
29
    private string $dueDate = '';
30
    private string $terms = '';
31
    private string $publicNotes = '';
32
    private string $privateNotes = '';
33
    private bool $usesInclusiveTaxes = false;
34
    private string $taxName1 = '';
35
    private float $taxRate1 = 0;
36
    private string $taxName2 = '';
37
    private float $taxRate2 = 0;
38
    private string $taxName3 = '';
39
    private float $taxRate3 = 0;
40
    private float $totalTaxes = 0;
41
    private bool $isAmountDiscount = false;
42
    private string $footer = '';
43
    private int $partial = 0;
44
    private string $partialDueDate = '';
45
    private string $customValue1;
46
    private string $customValue2;
47
    private string $customValue3;
48
    private string $customValue4;
49
    private bool $hasTasks = false;
50
    private bool $hasExpenses = false;
51
    private float $customSurcharge1 = 0;
52
    private float $customSurcharge2 = 0;
53
    private float $customSurcharge3 = 0;
54
    private float $customSurcharge4 = 0;
55
    private float $exchangeRate = 0;
56
    private bool $customSurchargeTax1 = false;
57
    private bool $customSurchargeTax2 = false;
58
    private bool $customSurchargeTax3 = false;
59
    private bool $customSurchargeTax4 = false;
60
    /** @var  InvoiceItem[] */
61
    private array $lineItems = [];
62
    private string $entityType = ''; //invoice?
63
    private string $reminder1Sent = '';
64
    private string $reminder2Sent = '';
65
    private string $reminder3Sent = '';
66
    private string $reminderLastSent = '';
67
    private float $paidToDate = 0;
68
    private string $subscriptionId = '';
69
    private bool $autoBillEnabled = false;
70
    private array $invitations = [];
71
    private array $documents = [];
72
73
    /**
74
     * @return string
75
     */
76
    public function getProjectId() : string
77
    {
78
        return $this->projectId;
79
    }
80
81
    /**
82
     * @param string $projectId
83
     */
84
    public function setProjectId(string $projectId) : void
85
    {
86
        $this->projectId = $projectId;
87
    }
88
89
    /**
90
     * @return float|int
91
     */
92
    public function getAmount() : float|int
93
    {
94
        return $this->amount;
95
    }
96
97
    /**
98
     * @param float|int $amount
99
     */
100
    public function setAmount(float|int $amount) : void
101
    {
102
        $this->amount = $amount;
103
    }
104
105
    /**
106
     * @return float|int
107
     */
108
    public function getBalance() : float|int
109
    {
110
        return $this->balance;
111
    }
112
113
    /**
114
     * @param float|int $balance
115
     */
116
    public function setBalance(float|int $balance) : void
117
    {
118
        $this->balance = $balance;
119
    }
120
121
    /**
122
     * @return string
123
     */
124
    public function getClientId() : string
125
    {
126
        return $this->clientId;
127
    }
128
129
    /**
130
     * @param string $clientId
131
     */
132
    public function setClientId(string $clientId) : void
133
    {
134
        $this->clientId = $clientId;
135
    }
136
137
    /**
138
     * @return string
139
     */
140
    public function getVendorId() : string
141
    {
142
        return $this->vendorId;
143
    }
144
145
    /**
146
     * @param string $vendorId
147
     */
148
    public function setVendorId(string $vendorId) : void
149
    {
150
        $this->vendorId = $vendorId;
151
    }
152
153
    /**
154
     * @return string
155
     */
156
    public function getStatusId() : string
157
    {
158
        return $this->statusId;
159
    }
160
161
    /**
162
     * @param string $statusId
163
     */
164
    public function setStatusId(string $statusId) : void
165
    {
166
        $this->statusId = $statusId;
167
    }
168
169
    /**
170
     * @return string
171
     */
172
    public function getDesignId() : string
173
    {
174
        return $this->designId;
175
    }
176
177
    /**
178
     * @param string $designId
179
     */
180
    public function setDesignId(string $designId) : void
181
    {
182
        $this->designId = $designId;
183
    }
184
185
    /**
186
     * @return string
187
     */
188
    public function getRecurringId() : string
189
    {
190
        return $this->recurringId;
191
    }
192
193
    /**
194
     * @param string $recurringId
195
     */
196
    public function setRecurringId(string $recurringId) : void
197
    {
198
        $this->recurringId = $recurringId;
199
    }
200
201
    /**
202
     * @return string
203
     */
204
    public function getNumber() : string
205
    {
206
        return $this->number;
207
    }
208
209
    /**
210
     * @param string $number
211
     */
212
    public function setNumber(string $number) : void
213
    {
214
        $this->number = $number;
215
    }
216
217
    /**
218
     * @return float|int
219
     */
220
    public function getDiscount() : float|int
221
    {
222
        return $this->discount;
223
    }
224
225
    /**
226
     * @param float|int $discount
227
     */
228
    public function setDiscount(float|int $discount) : void
229
    {
230
        $this->discount = $discount;
231
    }
232
233
    /**
234
     * @return string
235
     */
236
    public function getPoNumber() : string
237
    {
238
        return $this->poNumber;
239
    }
240
241
    /**
242
     * @param string $poNumber
243
     */
244
    public function setPoNumber(string $poNumber) : void
245
    {
246
        $this->poNumber = $poNumber;
247
    }
248
249
    /**
250
     * @return string
251
     */
252
    public function getDate() : string
253
    {
254
        return $this->date;
255
    }
256
257
    /**
258
     * @param string $date
259
     */
260
    public function setDate(string $date) : void
261
    {
262
        $this->date = $date;
263
    }
264
265
    /**
266
     * @return string
267
     */
268
    public function getLastSentDate() : string
269
    {
270
        return $this->lastSentDate;
271
    }
272
273
    /**
274
     * @param string $lastSentDate
275
     */
276
    public function setLastSentDate(string $lastSentDate) : void
277
    {
278
        $this->lastSentDate = $lastSentDate;
279
    }
280
281
    /**
282
     * @return string
283
     */
284
    public function getNextSendDate() : string
285
    {
286
        return $this->nextSendDate;
287
    }
288
289
    /**
290
     * @param string $nextSendDate
291
     */
292
    public function setNextSendDate(string $nextSendDate) : void
293
    {
294
        $this->nextSendDate = $nextSendDate;
295
    }
296
297
    /**
298
     * @return string
299
     */
300
    public function getDueDate() : string
301
    {
302
        return $this->dueDate;
303
    }
304
305
    /**
306
     * @param string $dueDate
307
     */
308
    public function setDueDate(string $dueDate) : void
309
    {
310
        $this->dueDate = $dueDate;
311
    }
312
313
    /**
314
     * @return string
315
     */
316
    public function getTerms() : string
317
    {
318
        return $this->terms;
319
    }
320
321
    /**
322
     * @param string $terms
323
     */
324
    public function setTerms(string $terms) : void
325
    {
326
        $this->terms = $terms;
327
    }
328
329
    /**
330
     * @return string
331
     */
332
    public function getPublicNotes() : string
333
    {
334
        return $this->publicNotes;
335
    }
336
337
    /**
338
     * @param string $publicNotes
339
     */
340
    public function setPublicNotes(string $publicNotes) : void
341
    {
342
        $this->publicNotes = $publicNotes;
343
    }
344
345
    /**
346
     * @return string
347
     */
348
    public function getPrivateNotes() : string
349
    {
350
        return $this->privateNotes;
351
    }
352
353
    /**
354
     * @param string $privateNotes
355
     */
356
    public function setPrivateNotes(string $privateNotes) : void
357
    {
358
        $this->privateNotes = $privateNotes;
359
    }
360
361
    /**
362
     * @return bool
363
     */
364
    public function isUsesInclusiveTaxes() : bool
365
    {
366
        return $this->usesInclusiveTaxes;
367
    }
368
369
    /**
370
     * @param bool $usesInclusiveTaxes
371
     */
372
    public function setUsesInclusiveTaxes(bool $usesInclusiveTaxes) : void
373
    {
374
        $this->usesInclusiveTaxes = $usesInclusiveTaxes;
375
    }
376
377
    /**
378
     * @return string
379
     */
380
    public function getTaxName1() : string
381
    {
382
        return $this->taxName1;
383
    }
384
385
    /**
386
     * @param string $taxName1
387
     */
388
    public function setTaxName1(string $taxName1) : void
389
    {
390
        $this->taxName1 = $taxName1;
391
    }
392
393
    /**
394
     * @return float|int
395
     */
396
    public function getTaxRate1() : float|int
397
    {
398
        return $this->taxRate1;
399
    }
400
401
    /**
402
     * @param float|int $taxRate1
403
     */
404
    public function setTaxRate1(float|int $taxRate1) : void
405
    {
406
        $this->taxRate1 = $taxRate1;
407
    }
408
409
    /**
410
     * @return string
411
     */
412
    public function getTaxName2() : string
413
    {
414
        return $this->taxName2;
415
    }
416
417
    /**
418
     * @param string $taxName2
419
     */
420
    public function setTaxName2(string $taxName2) : void
421
    {
422
        $this->taxName2 = $taxName2;
423
    }
424
425
    /**
426
     * @return float|int
427
     */
428
    public function getTaxRate2() : float|int
429
    {
430
        return $this->taxRate2;
431
    }
432
433
    /**
434
     * @param float|int $taxRate2
435
     */
436
    public function setTaxRate2(float|int $taxRate2) : void
437
    {
438
        $this->taxRate2 = $taxRate2;
439
    }
440
441
    /**
442
     * @return string
443
     */
444
    public function getTaxName3() : string
445
    {
446
        return $this->taxName3;
447
    }
448
449
    /**
450
     * @param string $taxName3
451
     */
452
    public function setTaxName3(string $taxName3) : void
453
    {
454
        $this->taxName3 = $taxName3;
455
    }
456
457
    /**
458
     * @return float|int
459
     */
460
    public function getTaxRate3() : float|int
461
    {
462
        return $this->taxRate3;
463
    }
464
465
    /**
466
     * @param float|int $taxRate3
467
     */
468
    public function setTaxRate3(float|int $taxRate3) : void
469
    {
470
        $this->taxRate3 = $taxRate3;
471
    }
472
473
    /**
474
     * @return float|int
475
     */
476
    public function getTotalTaxes() : float|int
477
    {
478
        return $this->totalTaxes;
479
    }
480
481
    /**
482
     * @param float|int $totalTaxes
483
     */
484
    public function setTotalTaxes(float|int $totalTaxes) : void
485
    {
486
        $this->totalTaxes = $totalTaxes;
487
    }
488
489
    /**
490
     * @return bool
491
     */
492
    public function isAmountDiscount() : bool
493
    {
494
        return $this->isAmountDiscount;
495
    }
496
497
    /**
498
     * @param bool $isAmountDiscount
499
     */
500
    public function setIsAmountDiscount(bool $isAmountDiscount) : void
501
    {
502
        $this->isAmountDiscount = $isAmountDiscount;
503
    }
504
505
    /**
506
     * @return string
507
     */
508
    public function getFooter() : string
509
    {
510
        return $this->footer;
511
    }
512
513
    /**
514
     * @param string $footer
515
     */
516
    public function setFooter(string $footer) : void
517
    {
518
        $this->footer = $footer;
519
    }
520
521
    /**
522
     * @return int
523
     */
524
    public function getPartial() : int
525
    {
526
        return $this->partial;
527
    }
528
529
    /**
530
     * @param int $partial
531
     */
532
    public function setPartial(int $partial) : void
533
    {
534
        $this->partial = $partial;
535
    }
536
537
    /**
538
     * @return string
539
     */
540
    public function getPartialDueDate() : string
541
    {
542
        return $this->partialDueDate;
543
    }
544
545
    /**
546
     * @param string $partialDueDate
547
     */
548
    public function setPartialDueDate(string $partialDueDate) : void
549
    {
550
        $this->partialDueDate = $partialDueDate;
551
    }
552
553
    /**
554
     * @return string
555
     */
556
    public function getCustomValue1() : string
557
    {
558
        return $this->customValue1;
559
    }
560
561
    /**
562
     * @param string $customValue1
563
     */
564
    public function setCustomValue1(string $customValue1) : void
565
    {
566
        $this->customValue1 = $customValue1;
567
    }
568
569
    /**
570
     * @return string
571
     */
572
    public function getCustomValue2() : string
573
    {
574
        return $this->customValue2;
575
    }
576
577
    /**
578
     * @param string $customValue2
579
     */
580
    public function setCustomValue2(string $customValue2) : void
581
    {
582
        $this->customValue2 = $customValue2;
583
    }
584
585
    /**
586
     * @return string
587
     */
588
    public function getCustomValue3() : string
589
    {
590
        return $this->customValue3;
591
    }
592
593
    /**
594
     * @param string $customValue3
595
     */
596
    public function setCustomValue3(string $customValue3) : void
597
    {
598
        $this->customValue3 = $customValue3;
599
    }
600
601
    /**
602
     * @return string
603
     */
604
    public function getCustomValue4() : string
605
    {
606
        return $this->customValue4;
607
    }
608
609
    /**
610
     * @param string $customValue4
611
     */
612
    public function setCustomValue4(string $customValue4) : void
613
    {
614
        $this->customValue4 = $customValue4;
615
    }
616
617
    /**
618
     * @return bool
619
     */
620
    public function isHasTasks() : bool
621
    {
622
        return $this->hasTasks;
623
    }
624
625
    /**
626
     * @param bool $hasTasks
627
     */
628
    public function setHasTasks(bool $hasTasks) : void
629
    {
630
        $this->hasTasks = $hasTasks;
631
    }
632
633
    /**
634
     * @return bool
635
     */
636
    public function isHasExpenses() : bool
637
    {
638
        return $this->hasExpenses;
639
    }
640
641
    /**
642
     * @param bool $hasExpenses
643
     */
644
    public function setHasExpenses(bool $hasExpenses) : void
645
    {
646
        $this->hasExpenses = $hasExpenses;
647
    }
648
649
    /**
650
     * @return float|int
651
     */
652
    public function getCustomSurcharge1() : float|int
653
    {
654
        return $this->customSurcharge1;
655
    }
656
657
    /**
658
     * @param float|int $customSurcharge1
659
     */
660
    public function setCustomSurcharge1(float|int $customSurcharge1) : void
661
    {
662
        $this->customSurcharge1 = $customSurcharge1;
663
    }
664
665
    /**
666
     * @return float|int
667
     */
668
    public function getCustomSurcharge2() : float|int
669
    {
670
        return $this->customSurcharge2;
671
    }
672
673
    /**
674
     * @param float|int $customSurcharge2
675
     */
676
    public function setCustomSurcharge2(float|int $customSurcharge2) : void
677
    {
678
        $this->customSurcharge2 = $customSurcharge2;
679
    }
680
681
    /**
682
     * @return float|int
683
     */
684
    public function getCustomSurcharge3() : float|int
685
    {
686
        return $this->customSurcharge3;
687
    }
688
689
    /**
690
     * @param float|int $customSurcharge3
691
     */
692
    public function setCustomSurcharge3(float|int $customSurcharge3) : void
693
    {
694
        $this->customSurcharge3 = $customSurcharge3;
695
    }
696
697
    /**
698
     * @return float|int
699
     */
700
    public function getCustomSurcharge4() : float|int
701
    {
702
        return $this->customSurcharge4;
703
    }
704
705
    /**
706
     * @param float|int $customSurcharge4
707
     */
708
    public function setCustomSurcharge4(float|int $customSurcharge4) : void
709
    {
710
        $this->customSurcharge4 = $customSurcharge4;
711
    }
712
713
    /**
714
     * @return float|int
715
     */
716
    public function getExchangeRate() : float|int
717
    {
718
        return $this->exchangeRate;
719
    }
720
721
    /**
722
     * @param float|int $exchangeRate
723
     */
724
    public function setExchangeRate(float|int $exchangeRate) : void
725
    {
726
        $this->exchangeRate = $exchangeRate;
727
    }
728
729
    /**
730
     * @return bool
731
     */
732
    public function isCustomSurchargeTax1() : bool
733
    {
734
        return $this->customSurchargeTax1;
735
    }
736
737
    /**
738
     * @param bool $customSurchargeTax1
739
     */
740
    public function setCustomSurchargeTax1(bool $customSurchargeTax1) : void
741
    {
742
        $this->customSurchargeTax1 = $customSurchargeTax1;
743
    }
744
745
    /**
746
     * @return bool
747
     */
748
    public function isCustomSurchargeTax2() : bool
749
    {
750
        return $this->customSurchargeTax2;
751
    }
752
753
    /**
754
     * @param bool $customSurchargeTax2
755
     */
756
    public function setCustomSurchargeTax2(bool $customSurchargeTax2) : void
757
    {
758
        $this->customSurchargeTax2 = $customSurchargeTax2;
759
    }
760
761
    /**
762
     * @return bool
763
     */
764
    public function isCustomSurchargeTax3() : bool
765
    {
766
        return $this->customSurchargeTax3;
767
    }
768
769
    /**
770
     * @param bool $customSurchargeTax3
771
     */
772
    public function setCustomSurchargeTax3(bool $customSurchargeTax3) : void
773
    {
774
        $this->customSurchargeTax3 = $customSurchargeTax3;
775
    }
776
777
    /**
778
     * @return bool
779
     */
780
    public function isCustomSurchargeTax4() : bool
781
    {
782
        return $this->customSurchargeTax4;
783
    }
784
785
    /**
786
     * @param bool $customSurchargeTax4
787
     */
788
    public function setCustomSurchargeTax4(bool $customSurchargeTax4) : void
789
    {
790
        $this->customSurchargeTax4 = $customSurchargeTax4;
791
    }
792
793
    /**
794
     * @return InvoiceItem[]
795
     */
796
    public function getLineItems() : array
797
    {
798
        return $this->lineItems;
799
    }
800
801
    /**
802
     * @param InvoiceItem[] $lineItems
803
     */
804
    public function setLineItems(array $lineItems) : void
805
    {
806
        $this->lineItems = $lineItems;
807
    }
808
809
    /**
810
     * @return string
811
     */
812
    public function getEntityType() : string
813
    {
814
        return $this->entityType;
815
    }
816
817
    /**
818
     * @param string $entityType
819
     */
820
    public function setEntityType(string $entityType) : void
821
    {
822
        $this->entityType = $entityType;
823
    }
824
825
    /**
826
     * @return string
827
     */
828
    public function getReminder1Sent() : string
829
    {
830
        return $this->reminder1Sent;
831
    }
832
833
    /**
834
     * @param string $reminder1Sent
835
     */
836
    public function setReminder1Sent(string $reminder1Sent) : void
837
    {
838
        $this->reminder1Sent = $reminder1Sent;
839
    }
840
841
    /**
842
     * @return string
843
     */
844
    public function getReminder2Sent() : string
845
    {
846
        return $this->reminder2Sent;
847
    }
848
849
    /**
850
     * @param string $reminder2Sent
851
     */
852
    public function setReminder2Sent(string $reminder2Sent) : void
853
    {
854
        $this->reminder2Sent = $reminder2Sent;
855
    }
856
857
    /**
858
     * @return string
859
     */
860
    public function getReminder3Sent() : string
861
    {
862
        return $this->reminder3Sent;
863
    }
864
865
    /**
866
     * @param string $reminder3Sent
867
     */
868
    public function setReminder3Sent(string $reminder3Sent) : void
869
    {
870
        $this->reminder3Sent = $reminder3Sent;
871
    }
872
873
    /**
874
     * @return string
875
     */
876
    public function getReminderLastSent() : string
877
    {
878
        return $this->reminderLastSent;
879
    }
880
881
    /**
882
     * @param string $reminderLastSent
883
     */
884
    public function setReminderLastSent(string $reminderLastSent) : void
885
    {
886
        $this->reminderLastSent = $reminderLastSent;
887
    }
888
889
    /**
890
     * @return float|int
891
     */
892
    public function getPaidToDate() : float|int
893
    {
894
        return $this->paidToDate;
895
    }
896
897
    /**
898
     * @param float|int $paidToDate
899
     */
900
    public function setPaidToDate(float|int $paidToDate) : void
901
    {
902
        $this->paidToDate = $paidToDate;
903
    }
904
905
    /**
906
     * @return string
907
     */
908
    public function getSubscriptionId() : string
909
    {
910
        return $this->subscriptionId;
911
    }
912
913
    /**
914
     * @param string $subscriptionId
915
     */
916
    public function setSubscriptionId(string $subscriptionId) : void
917
    {
918
        $this->subscriptionId = $subscriptionId;
919
    }
920
921
    /**
922
     * @return bool
923
     */
924
    public function isAutoBillEnabled() : bool
925
    {
926
        return $this->autoBillEnabled;
927
    }
928
929
    /**
930
     * @param bool $autoBillEnabled
931
     */
932
    public function setAutoBillEnabled(bool $autoBillEnabled) : void
933
    {
934
        $this->autoBillEnabled = $autoBillEnabled;
935
    }
936
937
    /**
938
     * @return array
939
     */
940
    public function getInvitations() : array
941
    {
942
        return $this->invitations;
943
    }
944
945
    /**
946
     * @param array $invitations
947
     */
948
    public function setInvitations(array $invitations) : void
949
    {
950
        $this->invitations = $invitations;
951
    }
952
953
    /**
954
     * @return array
955
     */
956
    public function getDocuments() : array
957
    {
958
        return $this->documents;
959
    }
960
961
    /**
962
     * @param array $documents
963
     */
964
    public function setDocuments(array $documents) : void
965
    {
966
        $this->documents = $documents;
967
    }
968
}
969