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

fix: a lot of fixes in the order view (css), generally controlled and improved

Übergeordneter d5895df8
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -200,6 +200,10 @@
<de><![CDATA[Lastschrift]]></de>
<en><![CDATA[Debit]]></en>
</locale>
<locale name="payment.status.paid.text">
<de><![CDATA[Bezahlt am [date]]]></de>
<en><![CDATA[Paid at [date]]]></en>
</locale>
</groups>
<groups name="quiqqer/order" datatype="php">
......
......@@ -48,7 +48,7 @@
.quiqqer-order-control-order-information-orderData-sum-title,
.quiqqer-order-control-order-information-orderData-sum {
color: darkred;
font-weight: bold;
}
.quiqqer-order-control-order-information-orderData-table {
......@@ -119,7 +119,6 @@
}
.quiqqer-order-profile-orders-order-articles-article-price {
color: darkred;
margin-top: 10px;
}
......
<article class="quiqqer-order-profile-orders-order-articles-article"
data-qui="package/quiqqer/order/bin/frontend/controls/frontendusers/Article"
data-qui="package/quiqqer/order/bin/frontend/controls/frontendusers/Article"
>
<div class="quiqqer-order-profile-orders-order-articles-image">
{if !empty($Image)}
......@@ -9,18 +9,24 @@
{/if}
</div>
{if !empty($Product)}
<a href="{$Product->getUrl()}"
class="quiqqer-order-profile-orders-order-articles-title"
target="_blank"
>
{$Article->getTitle()}
</a>
{else}
<div class="quiqqer-order-profile-orders-order-articles-title">
{$Article->getTitle()}
<div class="quiqqer-order-profile-orders-order-articles-information">
{if !empty($Product)}
<a href="{$Product->getUrl()}"
class="quiqqer-order-profile-orders-order-articles-title"
target="_blank"
>
{$Article->getTitle()}
</a>
{else}
<div class="quiqqer-order-profile-orders-order-articles-title">
{$Article->getTitle()}
</div>
{/if}
<div class="quiqqer-order-profile-orders-order-articles-description">
{$Article->getDescription()}
</div>
</div>
{/if}
<div class="quiqqer-order-profile-orders-order-articles-price">
{$Article->getPrice()->getDisplayPrice()}
......
......@@ -75,11 +75,23 @@
width: 100%;
}
.quiqqer-order-profile-orders-order-articles-information {
padding-top: 10px;
}
.quiqqer-order-profile-orders-order-articles-image {
float: left;
margin-right: 10px;
}
.quiqqer-order-profile-orders-order-articles-description {
margin: 5px 0;
}
.quiqqer-order-profile-orders-order-footer-paymentType {
margin-top: 10px;
}
.quiqqer-order-profile-orders-order footer {
background: #f6f6f6;
border-top: 1px #ddd solid;
......
{if $sheetsMax}
{if $sheetsMax && $sheetsMax != 1}
<div class="quiqqer-order-profile-orders-pagination">
{control
control="QUI\Controls\Navigating\Pagination"
......@@ -19,7 +19,7 @@
{/foreach}
</div>
{if $sheetsMax}
{if $sheetsMax && $sheetsMax != 1}
<div class="quiqqer-order-profile-orders-pagination">
{control
control="QUI\Controls\Navigating\Pagination"
......
......@@ -114,24 +114,35 @@ public function renderOrder($Order)
$Articles = $Order->getArticles();
$Invoice = null;
$paidStatus = $Order->getAttribute('paid_status');
$paidDate = $Order->getAttribute('paid_date');
$Articles->calc();
if ($Order->isPosted()) {
$Invoice = $Order->getInvoice();
if ($Order->hasInvoice()) {
$Invoice = $Order->getInvoice();
$paidStatus = $Invoice->getAttribute('paid_status');
$paidDate = $Invoice->getAttribute('paid_date');
}
switch ($Order->getAttribute('paid_status')) {
switch ((int)$paidStatus) {
case QUI\ERP\Order\AbstractOrder::PAYMENT_STATUS_OPEN:
$paymentStatus = QUI::getLocale()->get('quiqqer/order', 'payment.status.0');
break;
case QUI\ERP\Order\AbstractOrder::PAYMENT_STATUS_PAID:
$Formatter = QUI::getLocale()->getDateFormatter();
$date = $Formatter->format($paidDate);
$paymentStatus = QUI::getLocale()->get('quiqqer/order', 'payment.status.paid.text', [
'date' => $date
]);
break;
case QUI\ERP\Order\AbstractOrder::PAYMENT_STATUS_PART:
case QUI\ERP\Order\AbstractOrder::PAYMENT_STATUS_ERROR:
case QUI\ERP\Order\AbstractOrder::PAYMENT_STATUS_CANCELED:
case QUI\ERP\Order\AbstractOrder::PAYMENT_STATUS_DEBIT:
$status = $Order->getAttribute('paid_status');
$paymentStatus = QUI::getLocale()->get('quiqqer/order', 'payment.status.'.$status);
break;
default:
......
......@@ -155,7 +155,10 @@ public function createInvoice()
// save payment data
QUI::getDataBase()->update(
InvoiceHandler::getInstance()->temporaryInvoiceTable(),
['payment_data' => QUI\Security\Encryption::encrypt(json_encode($this->paymentData))],
[
'paid_status' => $this->getAttribute('paid_status'),
'payment_data' => QUI\Security\Encryption::encrypt(json_encode($this->paymentData))
],
['id' => $this->getId()]
);
......@@ -167,19 +170,18 @@ public function createInvoice()
// @todo setting -> rechnung automatisch buchen
$Invoice = $TemporaryInvoice->post();
QUI::getDataBase()->update(
Handler::getInstance()->table(),
['invoice_id' => $Invoice->getCleanId()],
['id' => $this->getId()]
);
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
throw $Exception;
}
QUI::getDataBase()->update(
Handler::getInstance()->table(),
[
'temporary_invoice_id' => null,
'invoice_id' => $Invoice->getCleanId()
],
['id' => $this->getId()]
);
$this->invoiceId = $Invoice->getId();
return InvoiceHandler::getInstance()->getInvoice($Invoice->getId());
}
......@@ -278,10 +280,17 @@ protected function getDataForSaving()
$idPrefix = QUI\ERP\Order\Utils\Utils::getOrderPrefix();
}
// invoice
$invoiceId = null;
if ($this->hasInvoice()) {
$invoiceId = $this->getInvoice()->getCleanId();
}
return [
'id_prefix' => $idPrefix,
'parent_order' => null,
'invoice_id' => null,
'invoice_id' => $invoiceId,
'status' => $this->status,
'successful' => $this->successful,
......
......@@ -41,6 +41,8 @@ public function __construct(Order $Order)
{
$this->Order = $Order;
$this->Articles = $this->Order->getArticles();
$this->setAttributes($this->Order->getAttributes());
}
/**
......@@ -218,7 +220,7 @@ public function getPaidStatusInformation()
*/
public function isPaid()
{
return $this->Order->isPosted();
return $this->Order->isPaid();
}
//endregion
......
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