- |
+ |
+
+ orderproduct->product->attributes) && $c->orderproduct->product->attributes['hostnetwork_order']->value): ?>
+
+
+ n/a
+
+ |
=$c->order->owner->customer_number?> |
=$c->order->owner->getCompanyOrName()?> |
=($c->termination_id) ? $c->termination->building->zip." ".$c->termination->building->city : $c->order->owner->zip." ".$c->order->owner->city?> |
@@ -120,7 +131,7 @@
diff --git a/Layout/default/Cpeshipping/csv/dhl.csv.php b/Layout/default/Cpeshipping/csv/dhl.csv.php
new file mode 100644
index 000000000..a5ddd3e01
--- /dev/null
+++ b/Layout/default/Cpeshipping/csv/dhl.csv.php
@@ -0,0 +1,8 @@
+"Kontakt (Shipper)";"Firmenanme (Shipper)";"Adresszeile 1 (Shipper)";"City name (Shipper)";"PLZ (Shipper)";"Country Code (Shipper)";"Email (Shipper)";"Phone type (Shipper)";"Phone Country Code (Shipper)";"Phone Number (Shipper)";"Firmename (Receiver)";"Kontakt (Receiver)";"Adresszeile 1 (Receiver)";"City name (Receiver)";"Country Code (Receiver)";"PLZ (Receiver)";"Phone Type (Receiver)";"Phone Country Code (Receiver)";"Phone Number (Receiver)";"Shipment Date (YYYYMMDD)";"Account Number (Shipper)";"Accoun Number (Payer)";"Accoun Number (Duty&Tax)";"Total Shipment Pieces";"Weight";"Lenght";"Weith ";"Hight";"Product Code (three digits)";"Declared Value Currency";"Declared Value";"Summary of Contents";"Product Type";"Reference 1";"Email Address Receiver";"Email Address (shipment notification)";"Delivered Duty Paid";"Neutral Delivery";"Saturday Delivery";"Extended Liability";"Insured Value Currency";"Insured Value"
+order;
+$owner = $order->owner;
+?>
+"=$me->username?>";XINON GmbH;Fladnitz 150;Studenzen;8322;AT;office@xinon.at;O;43;311540800;"=$owner->company?>";"=$owner->getFullName()?>";"=($ship->termination_id) ? $ship->termination->building->street : $owner->street?>";"=$owner->city?>";AT;=($ship->termination_id) ? $ship->termination->building->zip : $owner->zip?>;0;=$owner->splitPhoneNumber()[0]?>;=$owner->splitPhoneNumber()[1]?>;;170863186;;;1;=$ship->ship_weight?>;=$ship->ship_length?>;=$ship->ship_width?>;=$ship->ship_height?>;DOM;EUR;;"Ware, not restricted";P;=$owner->customer_number?>;"=$owner->email?>";office@xinon.at;;;N;N;;
+
\ No newline at end of file
diff --git a/Layout/default/Order/Index.php b/Layout/default/Order/Index.php
index fdac973f7..5e899a163 100644
--- a/Layout/default/Order/Index.php
+++ b/Layout/default/Order/Index.php
@@ -192,7 +192,7 @@
-
|
diff --git a/application/Address/Address.php b/application/Address/Address.php
index 8e73b5347..905f4bdfe 100644
--- a/application/Address/Address.php
+++ b/application/Address/Address.php
@@ -7,6 +7,7 @@ class Address extends mfBaseModel {
private $attributes;
private $permissions;
+ private $phoneparts;
public function getFullName() {
// Assumes "Firma1 Firma2" or "firstname lastname" as readable form
@@ -22,6 +23,40 @@ class Address extends mfBaseModel {
return $name;
+ }
+
+ public function splitPhoneNumber() {
+ if(!$this->phone) {
+ return false;
+ }
+
+ if($this->phoneparts) {
+ return $this->phoneparts;
+ }
+
+ $phone = preg_replace('/[^0-9]\+/', '', $this->phone);
+
+ $cc = "";
+ $num = "";
+ if(substr($phone, 0, 1) === '+') {
+ $cc = substr($phone, 1, 2);
+ $num = substr($phone, 3);
+ } elseif(substr($phone, 0, 2) === '00') {
+ $cc = substr($phone, 2, 2);
+ $num = substr($phone, 4);
+ } elseif(substr($phone, 0, 1) === '0') {
+ $cc = 43;
+ $num = substr($phone, 1);
+ } else {
+ $cc = 43;
+ $num = $phone;
+ }
+
+ $this->phoneparts = [$cc,$num];
+ return $this->phoneparts;
+
+
+
}
public function getCompanyOrName($returnParent = false) {
diff --git a/application/Cpeprovisioning/Cpeprovisioning.php b/application/Cpeprovisioning/Cpeprovisioning.php
index ea1a98e36..682102bf9 100644
--- a/application/Cpeprovisioning/Cpeprovisioning.php
+++ b/application/Cpeprovisioning/Cpeprovisioning.php
@@ -11,28 +11,24 @@ class Cpeprovisioning extends mfBaseModel {
public function getProperty($name) {
if($this->$name == null) {
+
+ if(!$this->id) {
+ return null;
+ }
- if($name == "cpeprovisioning") {
- $this->cpeprovisioning = CpeprovisioningModel::getFirst(["orderproduct_id" => $this->id]);
- return $this->cpeprovisioning;
+ if($name == "orderproduct") {
+ $this->orderproduct = new OrderProduct($this->orderproduct_id);
+ return $this->orderproduct;
}
if($name == "creator") {
- if($this->id) {
- $this->creator = new User($this->create_by);
- return $this->creator;
- } else {
- return null;
- }
+ $this->creator = new User($this->create_by);
+ return $this->creator;
}
if($name == "editor") {
- if($this->id) {
- $this->editor = new User($this->edit_by);
- return $this->editor;
- } else {
- return null;
- }
+ $this->editor = new User($this->edit_by);
+ return $this->editor;
}
$classname = ucfirst($name);
diff --git a/application/Cpeshipping/CpeshippingController.php b/application/Cpeshipping/CpeshippingController.php
index 53e80ed95..e4b807dd3 100644
--- a/application/Cpeshipping/CpeshippingController.php
+++ b/application/Cpeshipping/CpeshippingController.php
@@ -31,19 +31,52 @@ class CpeshippingController extends mfBaseController {
$pagination['maxItems'] = CpeprovisioningModel::count($provisions_search);
$provisions = CpeprovisioningModel::search($provisions_search, $pagination);
-
+ //$o = $provisions[0]->orderproduct->product->attributes;
+ //var_dump($o);exit;
$this->layout()->set("cpeprovisionings", $provisions);
$this->layout()->set("pagination", $pagination);
}
protected function shipAction() {
- $this->redirect("Cpeshipping");
+ //$this->redirect("Cpeshipping");
$r = $this->request;
+ //var_dump($r);exit;
+
- /*if($r->ships) {
+ if(is_array($r->ships) && count($r->ships)) {
+ $ships = $r->ships;
+ }
+
+ $shippings = [];
+
+ foreach($ships as $prov_id) {
+ if(!is_numeric($prov_id) || $prov_id <= 0) {
+ continue;
+ }
- }*/
+ $prov = new Cpeprovisioning($prov_id);
+
+ if(!$prov->id) {
+ continue;
+ }
+ if(!$prov->shipping) {
+ // is not supposed to be selectable in UI
+ continue;
+ }
+ $shippings[] = $prov;
+ }
+
+ $tpl = new Layout();
+ $tpl->setTemplate("Cpeshipping/csv/dhl.csv");
+ $tpl->set("shippings", $shippings);
+ $tpl->set("me", $this->me);
+ $body = $tpl->render();
+
+ //$values = $tpl->getReturnedValue();
+
+ header("Content-type: text/csv");
+ echo $body;exit;
}
}
\ No newline at end of file
diff --git a/application/File/File.php b/application/File/File.php
index 0af70f94f..0404a32e7 100644
--- a/application/File/File.php
+++ b/application/File/File.php
@@ -4,6 +4,10 @@ class File extends mfBaseModel {
private $creator;
private $editor;
+ public function createFile($overwrite = false) {
+ // TODO
+ }
+
public function delete() {
if($this->id) {
$id = $this->id;
|