From f2f82ecea954d79e3686f0834ddc07db4cdc6834 Mon Sep 17 00:00:00 2001 From: GotPPay Date: Sun, 24 Jun 2018 18:57:30 +0200 Subject: [PATCH 1/2] add first name, last name and mail to the orders table --- api-wiaas/server/components/v2/cart/CartModel.php | 8 +++++++- docker/mysql/comarket_2018-06-08.sql | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api-wiaas/server/components/v2/cart/CartModel.php b/api-wiaas/server/components/v2/cart/CartModel.php index f9c097e..cd62269 100644 --- a/api-wiaas/server/components/v2/cart/CartModel.php +++ b/api-wiaas/server/components/v2/cart/CartModel.php @@ -1207,6 +1207,9 @@ $concatenatedDeliveryAddress = $deliveryInfo['detailedAddress'].", ".$deliveryInfo['city'].", $countryName, ".$deliveryInfo['zipCode']; $billingCountryDetails = $this->getCountryDetailsById($billingInfo['idCountrySelected'])[0]; $concatenatedBillingAddress = $billingInfo['detailedAddress'].", ".$billingInfo['city'].", ".$billingCountryDetails['countryName'].", ".$billingInfo['zipCode']; + $billingFirstName = $billingInfo['firstName']; + $billingLastName = $billingInfo['lastName']; + $billingMail = $billingInfo['invoiceMail']; $projectNumber = $countryCode . $orderNumber; $orderDate = $today->format('Y-m-d H:m:s'); @@ -1219,7 +1222,7 @@ $sql = " INSERT INTO ".TABLES['orders']." - (idCustomerInstance, orderNumber, orderDate, reference, tender, projectNumber, deliveryAddress, billingAddress, idTerms, idOrderType, idProject) + (idCustomerInstance, orderNumber, orderDate, reference, tender, projectNumber, deliveryAddress, billingAddress, billingFirstName, billingLastName, billingMail, idTerms, idOrderType, idProject) VALUES ( $idCustomerInstance, '".$orderNumber."', @@ -1229,6 +1232,9 @@ '".$projectNumber."', '".$concatenatedDeliveryAddress."', '".$concatenatedBillingAddress."', + '".$billingFirstName."', + '".$billingLastName."', + '".$billingMail."', '".$terms['idTemrs']."', '".$orderType."', ".$idProject." diff --git a/docker/mysql/comarket_2018-06-08.sql b/docker/mysql/comarket_2018-06-08.sql index 67e0f15..614441f 100644 --- a/docker/mysql/comarket_2018-06-08.sql +++ b/docker/mysql/comarket_2018-06-08.sql @@ -796,6 +796,9 @@ CREATE TABLE `orders` ( `projectNumber` varchar(12) DEFAULT NULL, `deliveryAddress` varchar(600) DEFAULT NULL, `billingAddress` varchar(600) DEFAULT NULL, + `billingFirstName` varchar(100) DEFAULT NULL, + `billingLastName` varchar(100) DEFAULT NULL, + `billingMail` varchar(300) DEFAULT NULL, `idTerms` int(11) DEFAULT '1', `customerAccepted` tinyint(1) DEFAULT '0', `acceptanceDueDate` date DEFAULT NULL, -- 2.47.3 From 6db387e5d15f673bd70a121a8f67c2a676895569 Mon Sep 17 00:00:00 2001 From: GotPPay Date: Sun, 24 Jun 2018 18:59:01 +0200 Subject: [PATCH 2/2] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dbc3a31..0eab6a3 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ JavasScript (React + Redux) ## DOCKER - install docker-ce and docker-compose +- Check env variables in php.dockerfile in root directory of project (for local testing, REACT_APP_DEV_URL should be set to http://localhost:8000/api-wiaas) - from root of the project, execute `docker-compose build` and then `docker-compose up` Application is now available on http://localhost:8000 \ No newline at end of file -- 2.47.3