@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $origin = $order->getQuote()->getCityOrigin(); |
484 | 484 | } |
485 | 485 | |
486 | - $adresO = $this->getAddress($origin); |
|
486 | + $adresO = $this->getAddress($origin); |
|
487 | 487 | if ($adresO) { |
488 | 488 | $resOrigin = $this->getAddressVars('origin', $adresO); |
489 | 489 | $data["origin_address"] = $resOrigin["origin_address"]; |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | $destination = $order->getQuote()->getCityDestination(); |
501 | 501 | } |
502 | 502 | |
503 | - $adresD = $this->getAddress($destination); |
|
503 | + $adresD = $this->getAddress($destination); |
|
504 | 504 | if ($adresD) { |
505 | 505 | $resDestination = $this->getAddressVars('destination', $adresD); |
506 | 506 | $data["destination_address"] = $resDestination["destination_address"]; |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | ]; |
562 | 562 | |
563 | 563 | $peopleContract = $myContract->getContractPeople() |
564 | - ->filter(function ($contractPeople) { |
|
564 | + ->filter(function($contractPeople) { |
|
565 | 565 | return $contractPeople->getPeopleType() == 'Payer'; |
566 | 566 | }); |
567 | 567 | if (!$peopleContract->isEmpty()) { |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | } |
587 | 587 | |
588 | 588 | if (isset($contact['documents']['R.G'])) { |
589 | - $data['student_rg'] = $contact['documents']['R.G']; |
|
589 | + $data['student_rg'] = $contact['documents']['R.G']; |
|
590 | 590 | } |
591 | 591 | } |
592 | 592 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | //// total per month |
639 | 639 | $products = array_filter( |
640 | 640 | $contractProducts, |
641 | - function ($contractProduct) { |
|
641 | + function($contractProduct) { |
|
642 | 642 | return $contractProduct['product_subtype'] == 'Package' |
643 | 643 | && $contractProduct['billing_unit'] == 'Monthly'; |
644 | 644 | } |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | //// contract tax |
657 | 657 | $products = array_filter( |
658 | 658 | $contractProducts, |
659 | - function ($contractProduct) { |
|
659 | + function($contractProduct) { |
|
660 | 660 | return $contractProduct['product_type'] == 'Registration' |
661 | 661 | && $contractProduct['billing_unit'] == 'Single'; |
662 | 662 | } |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | // monthly products |
803 | 803 | |
804 | 804 | $contractProduct = $myContract->getContractProduct() |
805 | - ->filter(function ($contractProduct) { |
|
805 | + ->filter(function($contractProduct) { |
|
806 | 806 | return $contractProduct->getProduct()->getProductSubtype() == 'Package' |
807 | 807 | && $contractProduct->getProduct()->getBillingUnit() == 'Monthly' |
808 | 808 | && $contractProduct->getPrice() > 0; |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | // contract tax |
816 | 816 | |
817 | 817 | $contractProduct = $myContract->getContractProduct() |
818 | - ->filter(function ($contractProduct) { |
|
818 | + ->filter(function($contractProduct) { |
|
819 | 819 | return $contractProduct->getProduct()->getProductType() == 'Registration' |
820 | 820 | && $contractProduct->getProduct()->getBillingUnit() == 'Single' |
821 | 821 | && $contractProduct->getPrice() > 0; |
@@ -883,15 +883,15 @@ discard block |
||
883 | 883 | |
884 | 884 | |
885 | 885 | return [ |
886 | - 'id' => $isAddress ? $address->getId() : '', |
|
887 | - 'country' => !empty($state) ? $this->fixCountryName($state->getCountry()->getCountryName()) : '', |
|
888 | - 'state' => !empty($state) ? $state->getUF() : '', |
|
889 | - 'city' => !empty($city) ? $city->getCity() : '', |
|
886 | + 'id' => $isAddress ? $address->getId() : '', |
|
887 | + 'country' => !empty($state) ? $this->fixCountryName($state->getCountry()->getCountryName()) : '', |
|
888 | + 'state' => !empty($state) ? $state->getUF() : '', |
|
889 | + 'city' => !empty($city) ? $city->getCity() : '', |
|
890 | 890 | 'district' => !empty($district) ? $district->getDistrict() : '', |
891 | - 'postalCode' => !empty($street) ? $this->fixPostalCode($street->getCep()->getCep()) : '', |
|
892 | - 'street' => !empty($street) ? $street->getStreet() : '', |
|
893 | - 'number' => $isAddress ? $address->getNumber() : '', |
|
894 | - 'complement' => $isAddress ? $address->getComplement() : '', |
|
891 | + 'postalCode' => !empty($street) ? $this->fixPostalCode($street->getCep()->getCep()) : '', |
|
892 | + 'street' => !empty($street) ? $street->getStreet() : '', |
|
893 | + 'number' => $isAddress ? $address->getNumber() : '', |
|
894 | + 'complement' => $isAddress ? $address->getComplement() : '', |
|
895 | 895 | ]; |
896 | 896 | } |
897 | 897 | |
@@ -902,14 +902,14 @@ discard block |
||
902 | 902 | |
903 | 903 | protected function fixPostalCode(int $postalCode): string |
904 | 904 | { |
905 | - $code = (string)$postalCode; |
|
905 | + $code = (string) $postalCode; |
|
906 | 906 | return strlen($code) == 7 ? '0' . $code : $code; |
907 | 907 | } |
908 | 908 | |
909 | 909 | protected function getContractPeoplePayers(MyContract $contract): array |
910 | 910 | { |
911 | 911 | $contractPeople = $contract->getContractPeople() |
912 | - ->filter(function ($contractPeople) { |
|
912 | + ->filter(function($contractPeople) { |
|
913 | 913 | return $contractPeople->getPeopleType() == 'Payer' && $contractPeople->getContractPercentage() > 0; |
914 | 914 | }); |
915 | 915 |
@@ -846,8 +846,9 @@ |
||
846 | 846 | |
847 | 847 | protected function getPeopleAddress(People $people): ?array |
848 | 848 | { |
849 | - if (($address = $people->getAddress()->first()) === false) |
|
850 | - return null; |
|
849 | + if (($address = $people->getAddress()->first()) === false) { |
|
850 | + return null; |
|
851 | + } |
|
851 | 852 | |
852 | 853 | return $this->getAddress($address); |
853 | 854 | } |