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

refactor: feat: displayPrice option to the Article

Übergeordneter b421ca94
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -41,6 +41,12 @@ class Article implements ArticleInterface
*/
protected $customData = [];
/**
* Should the price displayed?
* default = yes
*/
protected $displayPrice = true;
/**
* @var bool
*/
......@@ -174,6 +180,10 @@ public function __construct($attributes = [])
if (isset($attributes['customData']) && is_array($attributes['customData'])) {
$this->customData = $attributes['customData'];
}
if (isset($attributes['displayPrice'])) {
$this->displayPrice = (bool)$attributes['displayPrice'];
}
}
/**
......@@ -393,6 +403,14 @@ public function getPrice()
);
}
/**
* @return bool
*/
public function displayPrice()
{
return $this->displayPrice;
}
//region Discounts
/**
......@@ -514,6 +532,7 @@ public function toArray()
'articleNo' => $this->getArticleNo(),
'description' => $this->getDescription(),
'unitPrice' => $this->getUnitPrice()->value(),
'displayPrice' => $this->displayPrice(),
'quantity' => $this->getQuantity(),
'sum' => $this->getSum()->value(),
'vat' => $vat,
......
......@@ -58,4 +58,10 @@ public function getQuantity();
* @return array
*/
public function toArray();
/**
* is the price displayed or not
* @return bool
*/
public function displayPrice();
}
......@@ -34,6 +34,10 @@
/** articles
========================================== */
table.articles-article {
padding-bottom: 10px;
}
.articles-article-pos,
.articles-article-quantity {
text-align: center;
......@@ -66,6 +70,14 @@
vertical-align: top;
}
.articles-article tr + tr td {
padding-top: 10px;
}
.quiqqer-order-basket-articles-article-fields {
margin-left: 20px;
}
/** sum
========================================== */
......
......@@ -36,7 +36,9 @@
<td class="articles-article-unitprice"
data-label="{locale group='quiqqer/erp' var='article.list.articles.header.unitprice'}"
>
{if $this->getAttribute('displayPrice')}
{$calculated_price}
{/if}
</td>
{/if}
......@@ -44,7 +46,9 @@
<td class="articles-article-price"
data-label="{locale group='quiqqer/erp' var='article.list.articles.header.price'}"
>
{if $this->getAttribute('displayPrice')}
{$calculated_sum}
{/if}
</td>
{/if}
</tr>
\ No newline at end of file
......@@ -71,6 +71,14 @@ public function getCurrency()
return QUI\ERP\Currency\Handler::getDefaultCurrency();
}
/**
* @return bool
*/
public function displayPrice()
{
return $this->Article->displayPrice();
}
/**
* Create the html
*
......
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