23 $oOrder =
oxNew(
"oxOrder");
24 $oCur =
$myConfig->getActShopCurrencyObject();
28 if ($soxId !=
"-1" && isset($soxId)) {
30 $oOrder->load($soxId);
32 $this->_aViewData[
"edit"] = $oOrder;
33 $this->_aViewData[
"aProductVats"] = $oOrder->getProductVats();
34 $this->_aViewData[
"orderArticles"] = $oOrder->getOrderArticles();
35 $this->_aViewData[
"giftCard"] = $oOrder->getGiftCard();
37 $this->_aViewData[
"deliveryType"] = $oOrder->getDelSet();
38 $sTsProtectsField =
'oxorder__oxtsprotectcosts';
39 if ($oOrder->$sTsProtectsField->value) {
40 $this->_aViewData[
"tsprotectcosts"] = $oLang->formatCurrency($oOrder->$sTsProtectsField->value, $oCur);
45 $dSum = $oOrder->getOrderSum(
true);
46 $this->_aViewData[
"ordersum"] = $oLang->formatCurrency($dSum, $oCur);
47 $this->_aViewData[
"ordercnt"] = $oOrder->getOrderCnt(
true);
50 $dSum = $oOrder->getOrderSum();
51 $this->_aViewData[
"ordertotalsum"] = $oLang->formatCurrency($dSum, $oCur);
52 $this->_aViewData[
"ordertotalcnt"] = $oOrder->getOrderCnt();
53 $this->_aViewData[
"afolder"] =
$myConfig->getConfigParam(
'aOrderfolder');
54 $this->_aViewData[
"alangs"] = $oLang->getLanguageNames();
56 $this->_aViewData[
"currency"] = $oCur;
58 return "order_overview.tpl";
72 if (!($oUserPayment = $oOrder->getPaymentType()) && $oOrder->oxorder__oxpaymenttype->value) {
73 $oPayment =
oxNew(
"oxPayment");
74 if ($oPayment->load($oOrder->oxorder__oxpaymenttype->value)) {
76 $oUserPayment =
oxNew(
"oxUserPayment");
77 $oUserPayment->oxpayments__oxdesc =
new oxField($oPayment->oxpayments__oxdesc->value);
91 $oImex =
oxNew(
"oximex");
92 if (($sLexware = $oImex->exportLexwareOrders($sOrderNr, $sToOrderNr))) {
94 $oUtils->setHeader(
"Pragma: public");
95 $oUtils->setHeader(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
96 $oUtils->setHeader(
"Expires: 0");
97 $oUtils->setHeader(
"Content-type: application/x-download");
98 $oUtils->setHeader(
"Content-Length: " . strlen($sLexware));
99 $oUtils->setHeader(
"Content-Disposition: attachment; filename=intern.xml");
100 $oUtils->showMessageAndExit($sLexware);
113 $sFilename = preg_replace(
'/[\s]+/',
'_', $sFilename);
114 $sFilename = preg_replace(
'/[^a-zA-Z0-9_\.-]/',
'', $sFilename);
116 return str_replace(
' ',
'_', $sFilename);
127 if ($soxId !=
"-1" && isset($soxId)) {
129 $oOrder =
oxNew(
"oxorder");
130 if ($oOrder->load($soxId)) {
132 $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue());
133 $sFilename = $oOrder->oxorder__oxordernr->value .
"_" . $sTrimmedBillName .
".pdf";
137 $sPDF = ob_get_contents();
139 $oUtils->setHeader(
"Pragma: public");
140 $oUtils->setHeader(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
141 $oUtils->setHeader(
"Expires: 0");
142 $oUtils->setHeader(
"Content-type: application/pdf");
143 $oUtils->setHeader(
"Content-Disposition: attachment; filename=" . $sFilename);
155 $oOrder =
oxNew(
"oxorder");
156 if ($oOrder->load($this->getEditObjectId())) {
157 $oOrder->oxorder__oxsenddate =
new oxField(date(
"Y-m-d H:i:s",
oxRegistry::get(
"oxUtilsDate")->getTime()));
161 $oOrderArticles = $oOrder->getOrderArticles();
162 foreach ($oOrderArticles as $sOxid => $oArticle) {
164 if ($oArticle->oxorderarticles__oxstorno->value == 1) {
165 $oOrderArticles->offsetUnset($sOxid);
171 $oEmail =
oxNew(
"oxemail");
172 $oEmail->sendSendedNowMail($oOrder);
182 $oOrder =
oxNew(
"oxorder");
183 if ($oOrder->load($this->getEditObjectId())) {
184 $oOrder->oxorder__oxsenddate =
new oxField(
"0000-00-00 00:00:00");
198 $oModule =
oxNew(
'oxmodule');
199 $oModule->load(
'invoicepdf');
200 if ($oModule->isActive()) {
203 $sTable = getViewName(
"oxorderarticles");
204 $sQ =
"select count(oxid) from {$sTable} where oxorderid = " . $oDb->quote($sOrderId) .
" and oxstorno = 0";
205 $blCan = (bool) $oDb->getOne($sQ,
false,
false);
218 $oOrder =
oxNew(
"oxorder");
220 if ($oOrder->load($this->getEditObjectId())) {
221 $blCan = $oOrder->oxorder__oxstorno->value ==
"0" &&
222 !($oOrder->oxorder__oxsenddate->value ==
"0000-00-00 00:00:00" || $oOrder->oxorder__oxsenddate->value ==
"-");