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);
93 $oImex =
oxNew(
"oximex");
94 if (($sLexware = $oImex->exportLexwareOrders($sOrderNr, $sToOrderNr))) {
96 $oUtils->setHeader(
"Pragma: public");
97 $oUtils->setHeader(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
98 $oUtils->setHeader(
"Expires: 0");
99 $oUtils->setHeader(
"Content-type: application/x-download");
100 $oUtils->setHeader(
"Content-Length: " . strlen($sLexware));
101 $oUtils->setHeader(
"Content-Disposition: attachment; filename=intern.xml");
102 $oUtils->showMessageAndExit($sLexware);
115 $sFilename = preg_replace(
'/[\s]+/',
'_', $sFilename);
116 $sFilename = preg_replace(
'/[^a-zA-Z0-9_\.-]/',
'', $sFilename);
118 return str_replace(
' ',
'_', $sFilename);
129 if ($soxId !=
"-1" && isset($soxId)) {
131 $oOrder =
oxNew(
"oxorder");
132 if ($oOrder->load($soxId)) {
134 $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue());
135 $sFilename = $oOrder->oxorder__oxordernr->value .
"_" . $sTrimmedBillName .
".pdf";
139 $sPDF = ob_get_contents();
141 $oUtils->setHeader(
"Pragma: public");
142 $oUtils->setHeader(
"Cache-Control: must-revalidate, post-check=0, pre-check=0");
143 $oUtils->setHeader(
"Expires: 0");
144 $oUtils->setHeader(
"Content-type: application/pdf");
145 $oUtils->setHeader(
"Content-Disposition: attachment; filename=" . $sFilename);
157 $oOrder =
oxNew(
"oxorder");
158 if ($oOrder->load($this->getEditObjectId())) {
159 $oOrder->oxorder__oxsenddate =
new oxField(date(
"Y-m-d H:i:s",
oxRegistry::get(
"oxUtilsDate")->getTime()));
163 $oOrderArticles = $oOrder->getOrderArticles();
164 foreach ($oOrderArticles as $sOxid => $oArticle) {
166 if ($oArticle->oxorderarticles__oxstorno->value == 1) {
167 $oOrderArticles->offsetUnset($sOxid);
173 $oEmail =
oxNew(
"oxemail");
174 $oEmail->sendSendedNowMail($oOrder);
184 $oOrder =
oxNew(
"oxorder");
185 if ($oOrder->load($this->getEditObjectId())) {
186 $oOrder->oxorder__oxsenddate =
new oxField(
"0000-00-00 00:00:00");
200 $oModule =
oxNew(
'oxmodule');
201 $oModule->load(
'invoicepdf');
202 if ($oModule->isActive()) {
205 $sTable = getViewName(
"oxorderarticles");
206 $sQ =
"select count(oxid) from {$sTable} where oxorderid = " . $oDb->quote($sOrderId) .
" and oxstorno = 0";
207 $blCan = (bool) $oDb->getOne($sQ,
false,
false);
220 $oOrder =
oxNew(
"oxorder");
222 if ($oOrder->load($this->getEditObjectId())) {
223 $blCan = $oOrder->oxorder__oxstorno->value ==
"0" &&
224 !($oOrder->oxorder__oxsenddate->value ==
"0000-00-00 00:00:00" || $oOrder->oxorder__oxsenddate->value ==
"-");