Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit f77f5abb erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen
Übergeordneter b8b79fc3
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
1 Merge Request!5Version 1.5.1 Release
......@@ -790,6 +790,18 @@ public function isApproved(): bool
}
}
/**
* @return string
*/
public function getInvoiceType(): string
{
try {
return $this->getInvoice()->getType();
} catch (QUI\Exception $Exception) {
return '';
}
}
/**
* Return invoice address
*
......
......@@ -25,7 +25,7 @@ class UserOrders extends Control implements ControlInterface
public function __construct(array $attributes = [])
{
$this->addCSSClass('quiqqer-order-profile-orders');
$this->addCSSFile(\dirname(__FILE__).'/UserOrders.css');
$this->addCSSFile(\dirname(__FILE__) . '/UserOrders.css');
$this->setAttributes([
'data-qui' => 'package/quiqqer/order/bin/frontend/controls/frontendusers/Orders',
......@@ -70,17 +70,17 @@ public function getBody()
$result = $Orders->getOrdersByUser($User, [
'order' => 'c_date DESC',
'limit' => $start.','.$limit
'limit' => $start . ',' . $limit
]);
foreach ($result as $Order) {
/* @var $Order QUI\ERP\Order\Order */
/* @var $View QUI\ERP\Order\OrderView */
$View = $Order->getView();
$View->setAttribute(
'downloadLink',
URL_OPT_DIR.'quiqqer/order/bin/frontend/order.pdf.php?order='.$View->getHash()
URL_OPT_DIR . 'quiqqer/order/bin/frontend/order.pdf.php?order=' . $View->getHash()
);
$orders[] = $View;
......@@ -100,7 +100,7 @@ public function getBody()
'sheetCount' => $count
]);
return $Engine->fetch(\dirname(__FILE__).'/UserOrders.html');
return $Engine->fetch(\dirname(__FILE__) . '/UserOrders.html');
}
/**
......@@ -200,7 +200,7 @@ public function renderOrder($Order)
)
]);
return $Engine->fetch(\dirname(__FILE__).'/UserOrders.Order.html');
return $Engine->fetch(\dirname(__FILE__) . '/UserOrders.Order.html');
}
/**
......@@ -240,7 +240,7 @@ public function renderArticle(QUI\ERP\Accounting\Article $Article)
'Project' => QUI::getProjectManager()->get()
]);
return $Engine->fetch(\dirname(__FILE__).'/UserOrders.Article.html');
return $Engine->fetch(\dirname(__FILE__) . '/UserOrders.Article.html');
}
/**
......
......@@ -11,6 +11,8 @@
use QUI\ERP\SalesOrders\Handler as SalesOrdersHandler;
use QUI\ERP\SalesOrders\SalesOrder;
use function json_decode;
/**
* Class OrderBooked
* - This order was ordered by the user
......@@ -53,7 +55,7 @@ public function refresh()
}
/**
* It return the invoice, if an invoice exist for the order
* It returns the invoice, if an invoice exist for the order
*
* @return QUI\ERP\Accounting\Invoice\Invoice|QUI\ERP\Accounting\Invoice\InvoiceTemporary
*
......@@ -84,8 +86,6 @@ public function getInvoice()
* Return the view object
*
* @return OrderView
*
* @throws QUI\Exception
*/
public function getView()
{
......@@ -271,7 +271,7 @@ public function createSalesOrder(): SalesOrder
}
$InvoiceAddress = $this->getInvoiceAddress();
$invoiceAddress = \json_decode($InvoiceAddress->toJSON(), true);
$invoiceAddress = json_decode($InvoiceAddress->toJSON(), true);
$invoiceAddressId = $InvoiceAddress->getId();
if (empty($invoiceAddressId)) {
......@@ -281,7 +281,7 @@ public function createSalesOrder(): SalesOrder
$DeliveryAddress = $this->getDeliveryAddress();
if ($InvoiceAddress->toJSON() !== $DeliveryAddress->toJSON()) {
$deliveryAddress = \json_decode($DeliveryAddress->toJSON(), true);
$deliveryAddress = json_decode($DeliveryAddress->toJSON(), true);
$deliveryAddressId = $DeliveryAddress->getId();
}
......
......@@ -28,6 +28,13 @@ interface OrderInterface
*/
public function getInvoice();
/**
* Returns the invoice type, if the order has an invoice
* - if no invoice is assigned, return is empty ('')
* @return string
*/
public function getInvoiceType(): string;
/**
* Exists an invoice for the order? is the order already posted?
*
......
......@@ -293,6 +293,14 @@ public function getInvoice()
return $this->Order->getInvoice();
}
/**
* @return string
*/
public function getInvoiceType(): string
{
return $this->Order->getInvoiceType();
}
/**
* @return bool
*/
......
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