17 'oxorder__oxtrackcode',
32 if ($soxId !=
"-1" && isset($soxId)) {
34 $oOrder =
oxNew(
"oxorder");
35 $oOrder->load($soxId);
39 $sOxPaidField =
'oxorder__oxpaid';
40 $sDelTypeField =
'oxorder__oxdeltype';
42 if ($oOrder->$sOxPaidField->value !=
"0000-00-00 00:00:00") {
43 $oOrder->blIsPaid =
true;
46 $oOrder->$sOxPaidField =
new oxField($oUtilsDate->formatDBDate($oOrder->$sOxPaidField->value));
50 $this->_aViewData[
"edit"] = $oOrder;
51 $this->_aViewData[
"paymentType"] = $oOrder->getPaymentType();
52 $this->_aViewData[
"oShipSet"] = $oOrder->getShippingSetList();
55 if ($oOrder->$sDelTypeField->value) {
58 $oUser =
oxNew(
'oxuser');
59 $oUser->load($oOrder->oxorder__oxuserid->value);
62 $dPrice = $oOrder->oxorder__oxtotalbrutsum->value / $oOrder->oxorder__oxcurrate->value;
66 $this->_aViewData[
"oPayments"] =
67 $oPaymentList->getPaymentList($oOrder->$sDelTypeField->value, $dPrice, $oUser);
71 $this->_aViewData[
"aVouchers"] = $oOrder->getVoucherNrList();
74 $this->_aViewData[
"sNowValue"] = date(
"Y-m-d H:i:s",
oxRegistry::get(
"oxUtilsDate")->getTime());
76 return "order_main.tpl";
91 $aParams[
'oxorder__oxshopid'] = $sShopID;
93 $oOrder =
oxNew(
"oxorder");
95 $oOrder->load($soxId);
97 $aParams[
'oxorder__oxid'] = null;
100 $needOrderRecalculate =
false;
101 if (is_array($aParams)) {
102 foreach ($aParams as $parameter => $value) {
104 $orderField = $oOrder->$parameter;
105 if ( ($value != $orderField->value) && !in_array($parameter, $this->fieldsTriggerNoOrderRecalculation) ) {
106 $needOrderRecalculate =
true;
114 if (!empty($sPayId) && ($sPayId != $oOrder->oxorder__oxpaymenttype->value)) {
115 $aParams[
'oxorder__oxpaymenttype'] = $sPayId;
116 $needOrderRecalculate =
true;
119 $oOrder->assign($aParams);
122 if (isset($aDynvalues)) {
123 $oPayment =
oxNew(
"oxuserpayment");
124 $oPayment->load($oOrder->oxorder__oxpaymentid->value);
125 $oPayment->oxuserpayments__oxvalue->setValue(
oxRegistry::getUtils()->assignValuesToText($aDynvalues));
127 $needOrderRecalculate =
true;
131 if (!empty($sDelSetId) && ($sDelSetId != $oOrder->oxorder__oxdeltype->value)) {
132 $oOrder->oxorder__oxpaymenttype->setValue(
"oxempty");
133 $oOrder->setDelivery($sDelSetId);
134 $needOrderRecalculate =
true;
137 $oOrder->reloadDelivery(
false);
140 if ($needOrderRecalculate) {
142 $oOrder->reloadDiscount(
false);
143 $oOrder->recalculateOrder();
159 $oOrder =
oxNew(
"oxorder");
160 if ($oOrder->load($soxId)) {
163 $oOrder->oxorder__oxsenddate =
new oxField(date(
"Y-m-d H:i:s",
oxRegistry::get(
"oxUtilsDate")->getTime()));
167 $oOrderArticles = $oOrder->getOrderArticles(
true);
170 $oEmail =
oxNew(
"oxemail");
171 $oEmail->sendSendedNowMail($oOrder);
183 $oOrder =
oxNew(
"oxorder");
184 if ($oOrder->load($soxId)) {
185 $oEmail =
oxNew(
"oxemail");
186 $oEmail->sendDownloadLinksMail($oOrder);
195 $oOrder =
oxNew(
"oxorder");
196 if ($oOrder->load($this->getEditObjectId())) {
198 $oOrder->oxorder__oxsenddate =
new oxField(
"0000-00-00 00:00:00");