Skip to content
Code-Schnipsel Gruppen Projekte
Commit aa2e25e0 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: pricefactors integracted (strated) button designs for order process

Übergeordneter f443a04d
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -25,12 +25,12 @@
*/
abstract class AbstractOrder extends QUI\QDOM
{
const PAYMENT_STATUS_OPEN = 0;
const PAYMENT_STATUS_PAID = 1;
const PAYMENT_STATUS_PART = 2;
const PAYMENT_STATUS_ERROR = 4;
const PAYMENT_STATUS_OPEN = 0;
const PAYMENT_STATUS_PAID = 1;
const PAYMENT_STATUS_PART = 2;
const PAYMENT_STATUS_ERROR = 4;
const PAYMENT_STATUS_CANCELED = 5;
const PAYMENT_STATUS_DEBIT = 11;
const PAYMENT_STATUS_DEBIT = 11;
/**
* Order is only created
......@@ -340,13 +340,21 @@ abstract public function isPosted();
*/
public function toArray()
{
$articles = '';
$paymentId = '';
$Payment = $this->getPayment();
$Payment = $this->getPayment();
if ($Payment) {
$paymentId = $Payment->getId();
}
try {
$articles = $this->getArticles()->toArray();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeDebugException($Exception);
}
return [
'id' => $this->id,
'invoiceId' => $this->invoiceId,
......@@ -358,7 +366,7 @@ public function toArray()
'customer' => $this->getCustomer()->getAttributes(),
'comments' => $this->getComments()->toArray(),
'articles' => $this->getArticles()->toArray(),
'articles' => $articles,
'addressDelivery' => $this->getDeliveryAddress()->getAttributes(),
'addressInvoice' => $this->getInvoiceAddress()->getAttributes(),
'paymentId' => $paymentId
......@@ -389,7 +397,9 @@ public function getIdPrefix()
/**
* @return QUI\ERP\Accounting\Calculations
*
* @throws QUI\ERP\Exception
* @throws QUI\Exception
*/
public function getPriceCalculation()
{
......@@ -438,6 +448,8 @@ public function getDeliveryAddress()
* Return the order articles list
*
* @return ArticleList
*
* @throws QUI\Exception
*/
public function getArticles()
{
......
......@@ -132,12 +132,3 @@
.quiqqer-order-ordering-buttons-next {
float: right;
}
.quiqqer-order-ordering-buttons-next[value="payableToOrder"] {
background-color: #75b947;
color: #fff;
}
.quiqqer-order-ordering-buttons-next[value="payableToOrder"]:hover {
background-color: #519f1d;
}
\ No newline at end of file
......@@ -56,24 +56,24 @@
</div>
<div class="quiqqer-order-ordering-buttons">
<a href="{url id=1}" class="button">
<a href="{url id=1}" class="btn btn-secondary btn-outline quiqqer-order-ordering-buttons-backToShop">
{locale group="quiqqer/order" var="ordering.btn.backToShop"}
</a>
{if $previous}
<a href="{$this->getStepUrl($previous)}"
class="button quiqqer-order-ordering-buttons-previous"
class="btn btn-light quiqqer-order-ordering-buttons-previous"
>
{locale group="quiqqer/order" var="ordering.btn.previous"}
</a>
{/if}
{if $payableToOrder}
<button name="step" value="payableToOrder" class="button quiqqer-order-ordering-buttons-next">
<button name="step" value="payableToOrder" class="btn-success quiqqer-order-ordering-buttons-next">
{locale group="quiqqer/order" var="ordering.btn.pay.to.order"}
</button>
{else if $next}
<button name="step" value="{$next}" class="button quiqqer-order-ordering-buttons-next">
<button name="step" value="{$next}" class="btn-success quiqqer-order-ordering-buttons-next">
{locale group="quiqqer/order" var="ordering.btn.next"}
</button>
{/if}
......
......@@ -112,7 +112,8 @@ public function __construct($attributes = [])
$Products = $this->Basket->getProducts();
$products = $Products->getProducts();
$Order = $this->getOrder();
$PriceFactors = $Products->getPriceFactors();
$Order = $this->getOrder();
if ($Order) {
$Order->clearArticles();
......@@ -126,6 +127,8 @@ public function __construct($attributes = [])
}
}
$Order->getArticles()->importPriceFactors($PriceFactors);
$this->Basket->setHash($Order->getHash());
$this->Basket->save();
}
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren