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

fix: #36

Übergeordneter 57f517df
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -44,7 +44,8 @@ define('package/quiqqer/order/bin/backend/controls/settings/Payments', [
* @return Promise
*/
refresh: function () {
var self = this;
var self = this,
current = QUILocale.getCurrent();
return new Promise(function (resolve) {
Payments.getPayments().then(function (payments) {
......@@ -56,7 +57,7 @@ define('package/quiqqer/order/bin/backend/controls/settings/Payments', [
list = result[1],
data = [];
var i, len, paymentData;
var i, len, title, paymentData;
var onChange = function () {
self.save();
......@@ -64,6 +65,11 @@ define('package/quiqqer/order/bin/backend/controls/settings/Payments', [
for (i = 0, len = payments.length; i < len; i++) {
paymentData = payments[i];
title = paymentData.title;
if (current in title) {
title = title[current];
}
data.push({
status: new QUISwitch({
......@@ -73,7 +79,7 @@ define('package/quiqqer/order/bin/backend/controls/settings/Payments', [
}
}),
id : paymentData.id,
title : paymentData.title,
title : title,
type : paymentData.paymentType.title
});
}
......
......@@ -533,6 +533,19 @@
<en><![CDATA[Send order confirmation automatically]]></en>
</locale>
<locale name="order.settings.autoInvoicePost">
<de><![CDATA[Rechnung automatisch buchen]]></de>
<en><![CDATA[Posting Invoices automatically]]></en>
</locale>
<locale name="order.settings.autoInvoicePost.description">
<de><![CDATA[
Die Rechnung wird automatisch gebucht wenn eine Rechnung angelegt wird
]]></de>
<en><![CDATA[
The invoice is posted automatically when the invoice is created
]]></en>
</locale>
<locale name="exception.order.process.not.found">
<de><![CDATA[Keinen Bestellprozess gefunden. Bitte legen Sie einen Bestellprozess an.]]></de>
<en><![CDATA[Checkout not found. Please create an order process.]]></en>
......
......@@ -16,6 +16,10 @@
<type><![CDATA[string]]></type>
<defaultvalue>onOrder</defaultvalue>
</conf>
<conf name="autoInvoicePost">
<type><![CDATA[bool]]></type>
<defaultvalue>1</defaultvalue>
</conf>
<conf name="sendOrderConfirmation">
<type><![CDATA[bool]]></type>
<defaultvalue><![CDATA[1]]></defaultvalue>
......@@ -75,6 +79,16 @@
</option>
</select>
<input type="checkbox" conf="order.autoInvoicePost">
<text>
<locale group="quiqqer/order" var="order.settings.autoInvoicePost"/>
</text>
<description>
<locale group="quiqqer/order"
var="order.settings.autoInvoicePost.description"/>
</description>
</input>
<input type="checkbox" conf="order.sendOrderConfirmation">
<text>
<locale group="quiqqer/order" var="order.settings.order.sendOrderConfirmation"/>
......
......@@ -76,7 +76,7 @@ public function getView()
/**
* Create an invoice for the order
*
* @return QUI\ERP\Accounting\Invoice\Invoice
* @return QUI\ERP\Accounting\Invoice\Invoice|QUI\ERP\Accounting\Invoice\InvoiceTemporary
*
* @throws QUI\Exception
*/
......@@ -165,10 +165,18 @@ public function createInvoice()
// create the real invoice
try {
$TemporaryInvoice = InvoiceHandler::getInstance()->getTemporaryInvoice($TemporaryInvoice->getId());
$TemporaryInvoice = InvoiceHandler::getInstance()->getTemporaryInvoice(
$TemporaryInvoice->getId()
);
$TemporaryInvoice->validate();
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
throw $Exception;
}
// @todo setting -> rechnung automatisch buchen
// auto invoice post
if (Settings::getInstance()->get('order', 'autoInvoicePost')) {
$Invoice = $TemporaryInvoice->post();
QUI::getDataBase()->update(
......@@ -176,14 +184,13 @@ public function createInvoice()
['invoice_id' => $Invoice->getCleanId()],
['id' => $this->getId()]
);
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
throw $Exception;
}
$this->invoiceId = $Invoice->getId();
$this->invoiceId = $Invoice->getId();
return InvoiceHandler::getInstance()->getInvoice($Invoice->getId());
}
return InvoiceHandler::getInstance()->getInvoice($Invoice->getId());
return $TemporaryInvoice;
}
/**
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren