Failed Conditions
Push — 4.0 ( f3e983...d5d6e1 )
by Ryo
22s queued 10s
created

Order::getTaxableTotal()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 10
ccs 0
cts 4
cp 0
crap 6
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.ec-cube.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Entity;
15
16
use Doctrine\Common\Collections\ArrayCollection;
17
use Doctrine\Common\Collections\Criteria;
18
use Doctrine\ORM\Mapping as ORM;
19
use Eccube\Entity\Master\TaxType;
20
use Eccube\Service\Calculator\OrderItemCollection;
21
use Eccube\Service\PurchaseFlow\ItemCollection;
22 1
23
if (!class_exists('\Eccube\Entity\Order')) {
24
    /**
25
     * Order
26
     *
27
     * @ORM\Table(name="dtb_order", indexes={
28
     *     @ORM\Index(name="dtb_order_email_idx", columns={"email"}),
29
     *     @ORM\Index(name="dtb_order_order_date_idx", columns={"order_date"}),
30
     *     @ORM\Index(name="dtb_order_payment_date_idx", columns={"payment_date"}),
31
     *     @ORM\Index(name="dtb_order_update_date_idx", columns={"update_date"}),
32
     *     @ORM\Index(name="dtb_order_order_no_idx", columns={"order_no"})
33
     *  },
34
     *  uniqueConstraints={
35
     *     @ORM\UniqueConstraint(name="dtb_order_pre_order_id_idx", columns={"pre_order_id"})
36
     *  })
37
     * @ORM\InheritanceType("SINGLE_TABLE")
38
     * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
39
     * @ORM\HasLifecycleCallbacks()
40
     * @ORM\Entity(repositoryClass="Eccube\Repository\OrderRepository")
41
     */
42
    class Order extends \Eccube\Entity\AbstractEntity implements PurchaseInterface, ItemHolderInterface
43
    {
44
        use NameTrait, PointTrait;
45
46
        /**
47
         * 課税対象の明細を返す.
48 65
         *
49
         * @return array
50 65
         */
51
        public function getTaxableItems()
52
        {
53 65
            $Items = [];
54 64
55 62
            foreach ($this->OrderItems as $Item) {
56 62
                if ($Item->getTaxType()->getId() == TaxType::TAXATION) {
57 62
                    $Items[] = $Item;
58
                }
59 64
            }
60
61
            return $Items;
62
        }
63 65
64
        /**
65
         * 課税対象の明細の合計金額を返す.
66
         * 商品合計 + 送料 + 手数料 + 値引き(課税).
67
         */
68
        public function getTaxableTotal()
69
        {
70
            $total = 0;
71
72
            foreach ($this->getTaxableItems() as $Item) {
73
                $total += $Item->getTotalPrice();
74
            }
75
76
            return $total;
77
        }
78
79
        /**
80
         * 課税対象の明細の合計金額を、税率ごとに集計する.
81
         *
82
         * @return array
83
         */
84
        public function getTaxableTotalByTaxRate()
85
        {
86
            $total = [];
87
88
            foreach ($this->getTaxableItems() as $Item) {
89 1
                    $totalPrice = $Item->getTotalPrice();
90
                    $taxRate = $Item->getTaxRate();
91 1
                    $total[$taxRate] = isset($total[$taxRate])
92 1
                        ? $total[$taxRate] + $totalPrice
93
                        : $totalPrice;
94 1
            }
95 1
96 1
            krsort($total);
97
98
            return $total;
99
        }
100 1
101
        /**
102
         * 課税対象の値引き明細を返す.
103
         *
104
         * @return array
105
         */
106
        public function getTaxableDiscountItems()
107
        {
108 1
            return array_filter($this->getTaxableItems(), function(OrderItem $Item) {
109
                return $Item->isDiscount();
110 1
            });
111 1
        }
112
113 1
        /**
114 1
         * 課税対象の値引き金額合計を返す.
115 1
         *
116
         * @return mixed
117
         */
118 1
        public function getTaxableDiscount()
119 1
        {
120 1
            return array_reduce($this->getTaxableDiscountItems(), function ($sum, OrderItem $Item) {
121
                return $sum += $Item->getTotalPrice();
122
            }, 0);
123 1
        }
124
125 1
        /**
126 1
         * 非課税・不課税の値引き明細を返す.
127 1
         *
128 1
         * @return array
129 1
         */
130 1
        public function getTaxFreeDiscountItems()
131 1
        {
132 1
            return array_filter($this->OrderItems->toArray(), function(OrderItem $Item) {
133
                return $Item->isPoint() || ($Item->isDiscount() && $Item->getTaxType()->getId() != TaxType::TAXATION);
134
            });
135
        }
136 1
137
        /**
138
         * 複数配送かどうかの判定を行う.
139
         *
140
         * @return boolean
141
         */
142
        public function isMultiple()
143
        {
144
            $Shippings = [];
145
            // クエリビルダ使用時に絞り込まれる場合があるため,
146 1
            // getShippingsではなくOrderItem経由でShippingを取得する.
147
            foreach ($this->getOrderItems() as $OrderItem) {
148 1
                if ($Shipping = $OrderItem->getShipping()) {
149
                    $id = $Shipping->getId();
150 1
                    if (isset($Shippings[$id])) {
151
                        continue;
152
                    }
153
                    $Shippings[$id] = $Shipping;
154
                }
155
            }
156
157
            return count($Shippings) > 1 ? true : false;
158
        }
159
160
        /**
161
         * 対象となるお届け先情報を取得
162
         *
163
         * @param integer $shippingId
164
         *
165
         * @return \Eccube\Entity\Shipping|null
166
         */
167
        public function findShipping($shippingId)
168
        {
169
            foreach ($this->getShippings() as $Shipping) {
170
                if ($Shipping->getId() == $shippingId) {
171
                    return $Shipping;
172
                }
173
            }
174
175
            return null;
176
        }
177
178
        /**
179
         * この注文の保持する販売種別を取得します.
180
         *
181
         * @return \Eccube\Entity\Master\SaleType[] 一意な販売種別の配列
182
         */
183
        public function getSaleTypes()
184
        {
185
            $saleTypes = [];
186
            foreach ($this->getOrderItems() as $OrderItem) {
187
                /* @var $ProductClass \Eccube\Entity\ProductClass */
188
                $ProductClass = $OrderItem->getProductClass();
189
                if ($ProductClass) {
190
                    $saleTypes[] = $ProductClass->getSaleType();
191
                }
192
            }
193
194
            return array_unique($saleTypes);
195
        }
196
197
        /**
198
         * 同じ規格の商品の個数をまとめた受注明細を取得
199
         *
200
         * @return OrderItem[]
201
         */
202
        public function getMergedProductOrderItems()
203
        {
204
            $ProductOrderItems = $this->getProductOrderItems();
205
            $orderItemArray = [];
206
            /** @var OrderItem $ProductOrderItem */
207
            foreach ($ProductOrderItems as $ProductOrderItem) {
208
                $productClassId = $ProductOrderItem->getProductClass()->getId();
209
                if (array_key_exists($productClassId, $orderItemArray)) {
210
                    // 同じ規格の商品がある場合は個数をまとめる
211
                    /** @var ItemInterface $OrderItem */
212
                    $OrderItem = $orderItemArray[$productClassId];
213
                    $quantity = $OrderItem->getQuantity() + $ProductOrderItem->getQuantity();
214
                    $OrderItem->setQuantity($quantity);
215
                } else {
216
                    // 新規規格の商品は新しく追加する
217
                    $OrderItem = new OrderItem();
218
                    $OrderItem->setOrder($ProductOrderItem->getOrder());
219
                    $OrderItem
220
                    ->setProduct($ProductOrderItem->getProduct())
221
                    ->setProductName($ProductOrderItem->getProductName())
222
                    ->setProductCode($ProductOrderItem->getProductCode())
223
                    ->setClassCategoryName1($ProductOrderItem->getClassCategoryName1())
224
                    ->setClassCategoryName2($ProductOrderItem->getClassCategoryName2())
225
                    ->setPrice($ProductOrderItem->getPrice())
226
                    ->setTax($ProductOrderItem->getTax())
227
                    ->setTaxRate($ProductOrderItem->getTaxRate())
228
                    ->setQuantity($ProductOrderItem->getQuantity());
229
                    $orderItemArray[$productClassId] = $OrderItem;
230
                }
231
            }
232
233
            return array_values($orderItemArray);
234
        }
235
236
        /**
237
         * 合計金額を計算
238
         *
239
         * @return string
240
         *
241
         * @deprecated
242
         */
243
        public function getTotalPrice()
244
        {
245
            @trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by TSURU
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
246
247
            return $this->getPaymentTotal();
248
        }
249
250
        /**
251
         * @var integer
252
         *
253
         * @ORM\Column(name="id", type="integer", options={"unsigned":true})
254
         * @ORM\Id
255
         * @ORM\GeneratedValue(strategy="IDENTITY")
256
         */
257
        private $id;
258
259
        /**
260
         * @var string|null
261
         *
262
         * @ORM\Column(name="pre_order_id", type="string", length=255, nullable=true)
263
         */
264
        private $pre_order_id;
265
266
        /**
267
         * @var string|null
268
         *
269
         * @ORM\Column(name="order_no", type="string", length=255, nullable=true)
270
         */
271
        private $order_no;
272
273
        /**
274
         * @var string|null
275
         *
276
         * @ORM\Column(name="message", type="string", length=4000, nullable=true)
277
         */
278
        private $message;
279
280
        /**
281
         * @var string|null
282
         *
283
         * @ORM\Column(name="name01", type="string", length=255)
284
         */
285
        private $name01;
286
287
        /**
288
         * @var string|null
289
         *
290
         * @ORM\Column(name="name02", type="string", length=255)
291
         */
292
        private $name02;
293
294
        /**
295
         * @var string|null
296
         *
297
         * @ORM\Column(name="kana01", type="string", length=255, nullable=true)
298
         */
299
        private $kana01;
300
301
        /**
302
         * @var string|null
303
         *
304
         * @ORM\Column(name="kana02", type="string", length=255, nullable=true)
305
         */
306
        private $kana02;
307
308
        /**
309
         * @var string|null
310
         *
311
         * @ORM\Column(name="company_name", type="string", length=255, nullable=true)
312
         */
313
        private $company_name;
314
315
        /**
316
         * @var string|null
317
         *
318
         * @ORM\Column(name="email", type="string", length=255, nullable=true)
319
         */
320
        private $email;
321
322
        /**
323
         * @var string|null
324
         *
325
         * @ORM\Column(name="phone_number", type="string", length=14, nullable=true)
326
         */
327
        private $phone_number;
328
329
        /**
330
         * @var string|null
331
         *
332
         * @ORM\Column(name="postal_code", type="string", length=8, nullable=true)
333
         */
334
        private $postal_code;
335
336
        /**
337
         * @var string|null
338
         *
339
         * @ORM\Column(name="addr01", type="string", length=255, nullable=true)
340
         */
341
        private $addr01;
342
343
        /**
344
         * @var string|null
345
         *
346
         * @ORM\Column(name="addr02", type="string", length=255, nullable=true)
347
         */
348
        private $addr02;
349
350
        /**
351
         * @var \DateTime|null
352
         *
353
         * @ORM\Column(name="birth", type="datetimetz", nullable=true)
354
         */
355
        private $birth;
356
357
        /**
358
         * @var string
359
         *
360
         * @ORM\Column(name="subtotal", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
361
         */
362
        private $subtotal = 0;
363
364
        /**
365
         * @var string
366
         *
367
         * @ORM\Column(name="discount", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
368
         */
369
        private $discount = 0;
370
371
        /**
372
         * @var string
373
         *
374
         * @ORM\Column(name="delivery_fee_total", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
375
         */
376
        private $delivery_fee_total = 0;
377
378
        /**
379
         * @var string
380
         *
381
         * @ORM\Column(name="charge", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
382
         */
383
        private $charge = 0;
384
385
        /**
386
         * @var string
387
         *
388
         * @ORM\Column(name="tax", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
389
         *
390
         * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨
391
         */
392
        private $tax = 0;
393
394
        /**
395
         * @var string
396
         *
397
         * @ORM\Column(name="total", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
398
         */
399
        private $total = 0;
400
401
        /**
402
         * @var string
403
         *
404
         * @ORM\Column(name="payment_total", type="decimal", precision=12, scale=2, options={"unsigned":true,"default":0})
405
         */
406
        private $payment_total = 0;
407
408
        /**
409
         * @var string|null
410
         *
411
         * @ORM\Column(name="payment_method", type="string", length=255, nullable=true)
412
         */
413
        private $payment_method;
414
415
        /**
416
         * @var string|null
417
         *
418
         * @ORM\Column(name="note", type="string", length=4000, nullable=true)
419
         */
420
        private $note;
421
422
        /**
423
         * @var \DateTime
424
         *
425
         * @ORM\Column(name="create_date", type="datetimetz")
426
         */
427
        private $create_date;
428
429
        /**
430
         * @var \DateTime
431
         *
432
         * @ORM\Column(name="update_date", type="datetimetz")
433
         */
434
        private $update_date;
435
436
        /**
437
         * @var \DateTime|null
438
         *
439
         * @ORM\Column(name="order_date", type="datetimetz", nullable=true)
440
         */
441
        private $order_date;
442
443
        /**
444
         * @var \DateTime|null
445
         *
446
         * @ORM\Column(name="payment_date", type="datetimetz", nullable=true)
447
         */
448
        private $payment_date;
449
450
        /**
451
         * @var string|null
452
         *
453
         * @ORM\Column(name="currency_code", type="string", nullable=true)
454
         */
455
        private $currency_code;
456
457
        /**
458
         * 注文完了画面に表示するメッセージ
459
         *
460
         * プラグインから注文完了時にメッセージを表示したい場合, このフィールドにセットすることで, 注文完了画面で表示されます。
461
         * 複数のプラグインから利用されるため, appendCompleteMesssage()で追加してください.
462
         * 表示する際にHTMLは利用可能です。
463
         *
464
         * @var string|null
465
         *
466
         * @ORM\Column(name="complete_message", type="text", nullable=true)
467
         */
468
        private $complete_message;
469
470
        /**
471
         * 注文完了メールに表示するメッセージ
472
         *
473
         * プラグインから注文完了メールにメッセージを表示したい場合, このフィールドにセットすることで, 注文完了メールで表示されます。
474
         * 複数のプラグインから利用されるため, appendCompleteMailMesssage()で追加してください.
475
         *
476
         * @var string|null
477
         *
478
         * @ORM\Column(name="complete_mail_message", type="text", nullable=true)
479
         */
480
        private $complete_mail_message;
481
482
        /**
483
         * @var \Doctrine\Common\Collections\Collection|OrderItem[]
484
         *
485
         * @ORM\OneToMany(targetEntity="Eccube\Entity\OrderItem", mappedBy="Order", cascade={"persist","remove"})
486
         */
487
        private $OrderItems;
488
489
        /**
490
         * @var \Doctrine\Common\Collections\Collection|Shipping[]
491
         *
492
         * @ORM\OneToMany(targetEntity="Eccube\Entity\Shipping", mappedBy="Order", cascade={"persist","remove"})
493
         */
494
        private $Shippings;
495
496
        /**
497
         * @var \Doctrine\Common\Collections\Collection
498
         *
499
         * @ORM\OneToMany(targetEntity="Eccube\Entity\MailHistory", mappedBy="Order", cascade={"remove"})
500
         * @ORM\OrderBy({
501 356
         *     "send_date"="DESC"
502
         * })
503 356
         */
504 356
        private $MailHistories;
505 356
506 356
        /**
507 356
         * @var \Eccube\Entity\Customer
508 356
         *
509 356
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Customer", inversedBy="Orders")
510 356
         * @ORM\JoinColumns({
511
         *   @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
512
         * })
513 356
         */
514 356
        private $Customer;
515 356
516
        /**
517
         * @var \Eccube\Entity\Master\Country
518
         *
519
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country")
520
         * @ORM\JoinColumns({
521 7
         *   @ORM\JoinColumn(name="country_id", referencedColumnName="id")
522
         * })
523 7
         */
524 7
        private $Country;
525 4
526
        /**
527 7
         * @var \Eccube\Entity\Master\Pref
528
         *
529
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref")
530
         * @ORM\JoinColumns({
531
         *   @ORM\JoinColumn(name="pref_id", referencedColumnName="id")
532
         * })
533
         */
534
        private $Pref;
535 124
536
        /**
537 124
         * @var \Eccube\Entity\Master\Sex
538
         *
539
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Sex")
540
         * @ORM\JoinColumns({
541
         *   @ORM\JoinColumn(name="sex_id", referencedColumnName="id")
542
         * })
543
         */
544
        private $Sex;
545
546
        /**
547 205
         * @var \Eccube\Entity\Master\Job
548
         *
549 205
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Job")
550
         * @ORM\JoinColumns({
551 205
         *   @ORM\JoinColumn(name="job_id", referencedColumnName="id")
552
         * })
553
         */
554
        private $Job;
555
556
        /**
557
         * @var \Eccube\Entity\Payment
558
         *
559 53
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Payment")
560
         * @ORM\JoinColumns({
561 53
         *   @ORM\JoinColumn(name="payment_id", referencedColumnName="id")
562
         * })
563
         */
564
        private $Payment;
565
566
        /**
567
         * @var \Eccube\Entity\Master\DeviceType
568
         *
569
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType")
570
         * @ORM\JoinColumns({
571 227
         *   @ORM\JoinColumn(name="device_type_id", referencedColumnName="id")
572
         * })
573 227
         */
574
        private $DeviceType;
575 227
576
        /**
577
         * OrderStatusより先にプロパティを定義しておかないとセットされなくなる
578
         *
579
         * @var \Eccube\Entity\Master\CustomerOrderStatus
580
         *
581
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\CustomerOrderStatus")
582
         * @ORM\JoinColumns({
583 97
         *   @ORM\JoinColumn(name="order_status_id", referencedColumnName="id")
584
         * })
585 97
         */
586
        private $CustomerOrderStatus;
587
588
        /**
589
         * OrderStatusより先にプロパティを定義しておかないとセットされなくなる
590
         *
591
         * @var \Eccube\Entity\Master\OrderStatusColor
592
         *
593
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\OrderStatusColor")
594
         * @ORM\JoinColumns({
595 181
         *   @ORM\JoinColumn(name="order_status_id", referencedColumnName="id")
596
         * })
597 181
         */
598
        private $OrderStatusColor;
599 181
600
        /**
601
         * @var \Eccube\Entity\Master\OrderStatus
602
         *
603
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\OrderStatus")
604
         * @ORM\JoinColumns({
605
         *   @ORM\JoinColumn(name="order_status_id", referencedColumnName="id")
606
         * })
607 81
         */
608
        private $OrderStatus;
609 81
610
        /**
611
         * Constructor
612
         */
613
        public function __construct(\Eccube\Entity\Master\OrderStatus $orderStatus = null)
614
        {
615
            $this->setDiscount(0)
0 ignored issues
show
Deprecated Code introduced by Kentaro Ohkouchi
The method Eccube\Entity\Order::setTax() has been deprecated with message: 明細ごとに集計した税額と差異が発生する場合があるため非推奨

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
616
            ->setSubtotal(0)
617
            ->setTotal(0)
618
            ->setPaymentTotal(0)
619 18
            ->setCharge(0)
620
            ->setTax(0)
621 18
            ->setDeliveryFeeTotal(0)
622
            ->setOrderStatus($orderStatus)
623 18
        ;
624
625
            $this->OrderItems = new \Doctrine\Common\Collections\ArrayCollection();
626
            $this->Shippings = new \Doctrine\Common\Collections\ArrayCollection();
627
            $this->MailHistories = new \Doctrine\Common\Collections\ArrayCollection();
628
        }
629
630
        /**
631 80
         * Clone
632
         */
633 80
        public function __clone()
634
        {
635
            $OriginOrderItems = $this->OrderItems;
0 ignored issues
show
Unused Code introduced by Chihiro Adachi
$OriginOrderItems is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
636
            $OrderItems = new ArrayCollection();
637
            foreach ($this->OrderItems as $OrderItem) {
638
                $OrderItems->add(clone $OrderItem);
639
            }
640
            $this->OrderItems = $OrderItems;
641
642
//            // ShippingとOrderItemが循環参照するため, 手動でヒモ付を変更する.
643 18
//            $Shippings = new ArrayCollection();
644
//            foreach ($this->Shippings as $Shipping) {
645 18
//                $CloneShipping = clone $Shipping;
646
//                foreach ($OriginOrderItems as $OrderItem) {
647 18
//                    //$CloneShipping->removeOrderItem($OrderItem);
648
//                }
649
//                foreach ($this->OrderItems as $OrderItem) {
650
//                    if ($OrderItem->getShipping() && $OrderItem->getShipping()->getId() == $Shipping->getId()) {
651
//                        $OrderItem->setShipping($CloneShipping);
652
//                    }
653
//                    $CloneShipping->addOrderItem($OrderItem);
654
//                }
655 80
//                $Shippings->add($CloneShipping);
656
//            }
657 80
//            $this->Shippings = $Shippings;
658
        }
659
660
        /**
661
         * Get id.
662
         *
663
         * @return int
664
         */
665
        public function getId()
666
        {
667 19
            return $this->id;
668
        }
669 19
670
        /**
671 19
         * Set preOrderId.
672
         *
673
         * @param string|null $preOrderId
674
         *
675
         * @return Order
676
         */
677
        public function setPreOrderId($preOrderId = null)
678
        {
679 70
            $this->pre_order_id = $preOrderId;
680
681 70
            return $this;
682
        }
683
684
        /**
685
         * Get preOrderId.
686
         *
687
         * @return string|null
688
         */
689
        public function getPreOrderId()
690
        {
691 19
            return $this->pre_order_id;
692
        }
693 19
694
        /**
695 19
         * Set orderNo
696
         *
697
         * @param string|null $orderNo
698
         *
699
         * @return Order
700
         */
701
        public function setOrderNo($orderNo = null)
702
        {
703 70
            $this->order_no = $orderNo;
704
705 70
            return $this;
706
        }
707
708
        /**
709
         * Get orderNo
710
         *
711
         * @return string|null
712
         */
713
        public function getOrderNo()
714
        {
715 16
            return $this->order_no;
716
        }
717 16
718
        /**
719 16
         * Set message.
720
         *
721
         * @param string|null $message
722
         *
723
         * @return Order
724
         */
725
        public function setMessage($message = null)
726
        {
727 71
            $this->message = $message;
728
729 71
            return $this;
730
        }
731
732
        /**
733
         * Get message.
734
         *
735
         * @return string|null
736
         */
737
        public function getMessage()
738
        {
739 16
            return $this->message;
740
        }
741 16
742
        /**
743 16
         * Set name01.
744
         *
745
         * @param string|null $name01
746
         *
747
         * @return Order
748
         */
749
        public function setName01($name01 = null)
750
        {
751 74
            $this->name01 = $name01;
752
753 74
            return $this;
754
        }
755
756
        /**
757
         * Get name01.
758
         *
759
         * @return string|null
760
         */
761
        public function getName01()
762
        {
763 17
            return $this->name01;
764
        }
765 17
766
        /**
767 17
         * Set name02.
768
         *
769
         * @param string|null $name02
770
         *
771
         * @return Order
772
         */
773
        public function setName02($name02 = null)
774
        {
775 70
            $this->name02 = $name02;
776
777 70
            return $this;
778
        }
779
780
        /**
781
         * Get name02.
782
         *
783
         * @return string|null
784
         */
785
        public function getName02()
786
        {
787 16
            return $this->name02;
788
        }
789 16
790
        /**
791 16
         * Set kana01.
792
         *
793
         * @param string|null $kana01
794
         *
795
         * @return Order
796
         */
797
        public function setKana01($kana01 = null)
798
        {
799 70
            $this->kana01 = $kana01;
800
801 70
            return $this;
802
        }
803
804
        /**
805
         * Get kana01.
806
         *
807
         * @return string|null
808
         */
809
        public function getKana01()
810
        {
811 16
            return $this->kana01;
812
        }
813 16
814
        /**
815 16
         * Set kana02.
816
         *
817
         * @param string|null $kana02
818
         *
819
         * @return Order
820
         */
821
        public function setKana02($kana02 = null)
822
        {
823 73
            $this->kana02 = $kana02;
824
825 73
            return $this;
826
        }
827
828
        /**
829
         * Get kana02.
830
         *
831
         * @return string|null
832
         */
833
        public function getKana02()
834
        {
835 16
            return $this->kana02;
836
        }
837 16
838
        /**
839 16
         * Set companyName.
840
         *
841
         * @param string|null $companyName
842
         *
843
         * @return Order
844
         */
845
        public function setCompanyName($companyName = null)
846
        {
847 73
            $this->company_name = $companyName;
848
849 73
            return $this;
850
        }
851
852
        /**
853
         * Get companyName.
854
         *
855
         * @return string|null
856
         */
857
        public function getCompanyName()
858
        {
859 5
            return $this->company_name;
860
        }
861 5
862
        /**
863 5
         * Set email.
864
         *
865
         * @param string|null $email
866
         *
867
         * @return Order
868
         */
869
        public function setEmail($email = null)
870
        {
871 3
            $this->email = $email;
872
873 3
            return $this;
874
        }
875
876
        /**
877
         * Get email.
878
         *
879
         * @return string|null
880
         */
881
        public function getEmail()
882
        {
883 356
            return $this->email;
884
        }
885 356
886
        /**
887 356
         * Set phone_number.
888
         *
889
         * @param string|null $phone_number
890
         *
891
         * @return Order
892
         */
893
        public function setPhoneNumber($phone_number = null)
894
        {
895 60
            $this->phone_number = $phone_number;
896
897 60
            return $this;
898
        }
899
900
        /**
901
         * Get phone_number.
902
         *
903
         * @return string|null
904
         */
905
        public function getPhoneNumber()
906
        {
907 356
            return $this->phone_number;
908
        }
909 356
910
        /**
911 356
         * Set postal_code.
912
         *
913
         * @param string|null $postal_code
914
         *
915
         * @return Order
916
         */
917
        public function setPostalCode($postal_code = null)
918
        {
919 212
            $this->postal_code = $postal_code;
920
921 212
            return $this;
922
        }
923
924
        /**
925
         * Get postal_code.
926
         *
927
         * @return string|null
928
         */
929
        public function getPostalCode()
930
        {
931 356
            return $this->postal_code;
932
        }
933 356
934
        /**
935 356
         * Set addr01.
936
         *
937
         * @param string|null $addr01
938
         *
939
         * @return Order
940
         */
941
        public function setAddr01($addr01 = null)
942
        {
943 75
            $this->addr01 = $addr01;
944
945 75
            return $this;
946
        }
947
948
        /**
949
         * Get addr01.
950
         *
951
         * @return string|null
952
         */
953
        public function getAddr01()
954
        {
955 356
            return $this->addr01;
956
        }
957 356
958
        /**
959 356
         * Set addr02.
960
         *
961
         * @param string|null $addr02
962
         *
963
         * @return Order
964
         */
965
        public function setAddr02($addr02 = null)
966
        {
967 212
            $this->addr02 = $addr02;
968
969 212
            return $this;
970
        }
971
972
        /**
973
         * Get addr02.
974
         *
975
         * @return string|null
976
         */
977
        public function getAddr02()
978
        {
979 356
            return $this->addr02;
980
        }
981 356
982
        /**
983 356
         * Set birth.
984
         *
985
         * @param \DateTime|null $birth
986
         *
987
         * @return Order
988
         */
989
        public function setBirth($birth = null)
990
        {
991 16
            $this->birth = $birth;
992
993 16
            return $this;
994
        }
995
996
        /**
997
         * Get birth.
998
         *
999
         * @return \DateTime|null
1000
         */
1001
        public function getBirth()
1002
        {
1003 356
            return $this->birth;
1004
        }
1005 356
1006
        /**
1007 356
         * Set subtotal.
1008
         *
1009
         * @param string $subtotal
1010
         *
1011
         * @return Order
1012
         */
1013
        public function setSubtotal($subtotal)
1014
        {
1015 237
            $this->subtotal = $subtotal;
1016
1017 237
            return $this;
1018
        }
1019
1020
        /**
1021
         * Get subtotal.
1022
         *
1023
         * @return string
1024
         */
1025
        public function getSubtotal()
1026
        {
1027 356
            return $this->subtotal;
1028
        }
1029 356
1030
        /**
1031 356
         * Set discount.
1032
         *
1033
         * @param string $discount
1034
         *
1035
         * @return Order
1036
         */
1037
        public function setDiscount($discount)
1038
        {
1039 28
            $this->discount = $discount;
1040
1041 28
            return $this;
1042
        }
1043
1044
        /**
1045
         * Get discount.
1046
         *
1047
         * @deprecated 4.0.3 から値引きは課税値引きと 非課税・不課税の値引きの2種に分かれる. 課税値引きについてはgetTaxableDiscountを利用してください.
1048
         * @return string
1049
         */
1050
        public function getDiscount()
1051 218
        {
1052
            return $this->discount;
1053 218
        }
1054
1055 218
        /**
1056
         * Set deliveryFeeTotal.
1057
         *
1058
         * @param string $deliveryFeeTotal
1059
         *
1060
         * @return Order
1061
         */
1062
        public function setDeliveryFeeTotal($deliveryFeeTotal)
1063 20
        {
1064
            $this->delivery_fee_total = $deliveryFeeTotal;
1065 20
1066
            return $this;
1067
        }
1068
1069
        /**
1070
         * Get deliveryFeeTotal.
1071
         *
1072
         * @return string
1073
         */
1074
        public function getDeliveryFeeTotal()
1075 156
        {
1076
            return $this->delivery_fee_total;
1077 156
        }
1078
1079 156
        /**
1080
         * Set charge.
1081
         *
1082
         * @param string $charge
1083
         *
1084
         * @return Order
1085
         */
1086
        public function setCharge($charge)
1087 20
        {
1088
            $this->charge = $charge;
1089 20
1090
            return $this;
1091
        }
1092
1093
        /**
1094
         * Get charge.
1095
         *
1096
         * @return string
1097
         */
1098
        public function getCharge()
1099 207
        {
1100
            return $this->charge;
1101 207
        }
1102
1103 207
        /**
1104
         * Set tax.
1105
         *
1106
         * @param string $tax
1107
         *
1108
         * @return Order
1109
         *
1110
         * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨
1111 3
         */
1112
        public function setTax($tax)
1113 3
        {
1114
            $this->tax = $tax;
0 ignored issues
show
Deprecated Code introduced by Kentaro Ohkouchi
The property Eccube\Entity\Order::$tax has been deprecated with message: 明細ごとに集計した税額と差異が発生する場合があるため非推奨

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
1115
1116
            return $this;
1117
        }
1118
1119
        /**
1120
         * Get tax.
1121
         *
1122
         * @return string
1123 207
         *
1124
         * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨
1125 207
         */
1126
        public function getTax()
1127 207
        {
1128
            return $this->tax;
0 ignored issues
show
Deprecated Code introduced by Kentaro Ohkouchi
The property Eccube\Entity\Order::$tax has been deprecated with message: 明細ごとに集計した税額と差異が発生する場合があるため非推奨

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
1129
        }
1130
1131
        /**
1132
         * Set total.
1133
         *
1134
         * @param string $total
1135 2
         *
1136
         * @return Order
1137 2
         */
1138
        public function setTotal($total)
1139
        {
1140
            $this->total = $total;
1141
1142
            return $this;
1143
        }
1144
1145
        /**
1146
         * Get total.
1147 47
         *
1148
         * @return string
1149 47
         */
1150
        public function getTotal()
1151 47
        {
1152
            return $this->total;
1153
        }
1154
1155
        /**
1156
         * Set paymentTotal.
1157
         *
1158
         * @param string $paymentTotal
1159