Index: /mods/wpsg_mod_deliverynote.class.php
===================================================================
--- /mods/wpsg_mod_deliverynote.class.php	(revision 6366)
+++ /mods/wpsg_mod_deliverynote.class.php	(revision 6367)
@@ -837,25 +837,60 @@
 		{
 		
-			if ($this->shop->isMultiBlog())
-			{
-		
-				$path = WPSG_PATH_CONTENT.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/'.$order_id.'/';
-				$htaccess = WPSG_PATH_CONTENT.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/.htaccess';
-				$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/';
-				
-				if ($url) $strReturn = $url_content.$order_id.'/';
-				else $strReturn = $path;
-					
-			}
-			else
-			{
-		
-				$path = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_deliverynote/'.$order_id.'/';
-				$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_deliverynote/.htaccess';
-		
-				if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg/wpsg_deliverynote/'.$order_id.'/';
-				else $strReturn = $path.'/';
-					
-			}
+			if ($order_id == '')
+			{	// Briefpapier/Logo
+				if ($this->shop->isMultiBlog())
+				{
+					
+					$path = WPSG_PATH_CONTENT.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/'.$order_id.'/';
+					$htaccess = WPSG_PATH_CONTENT.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/.htaccess';
+					$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/';
+					
+					if ($url) $strReturn = $url_content.$order_id.'/';
+					else $strReturn = $path;
+					
+				}
+				else
+				{
+					
+					$path = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_deliverynote/'.$order_id.'/';
+					$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_deliverynote/.htaccess';
+					
+					if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg/wpsg_deliverynote/'.$order_id.'/';
+					else $strReturn = $path.'/';
+					
+				}
+				
+			}
+			else 
+			{	// Lieferschein aus Bestellung
+
+				$deliverynote = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_DELIVERYNOTE."` AS DN WHERE `order_id` = '".wpsg_q($order_id)."' ");
+				$datum = $deliverynote['cdate'];
+				$ym = date('Y/m/', strtotime($datum));
+				
+				if ($this->shop->isMultiBlog())
+				{
+					
+					$path = WPSG_PATH_CONTENT.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/'.$ym.$order_id.'/';
+					$htaccess = WPSG_PATH_CONTENT.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/.htaccess';
+					$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_deliverynote/'.$ym;
+					
+					if ($url) $strReturn = $url_content.$order_id.'/';
+					else $strReturn = $path;
+					
+				}
+				else
+				{
+					
+					$path = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_deliverynote/'.$ym.$order_id.'/';
+					$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_deliverynote/.htaccess';
+					
+					if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg/wpsg_deliverynote/'.$ym.$order_id.'/';
+					else $strReturn = $path.'/';
+					
+				}
+				
+			}	// if ($order_id == '')
+			
 				
 			if (!file_exists($path))
Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 6366)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 6367)
@@ -1558,27 +1558,60 @@
  		public function getFilePath($order_id, $url = false)
  		{ 
- 		  			
- 			if ($this->shop->isMultiBlog())
-			{
-
-				$path = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/';
-				$htaccess = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/.htaccess';
-				 
-				$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/';
-				
-				if ($url) $strReturn = $url_content.'/'.$order_id.'/';
-				else $strReturn = $path.'/'.$order_id.'/';
-								 
-			}
-			else
-			{
-				
-				$path = WPSG_PATH_CONTENT.'uploads/wpsg_rechnungen/';				
-				$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg_rechnungen/.htaccess';
-				
-				if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg_rechnungen/'.$order_id.'/';
-				else $strReturn = $path.$order_id.'/';
-				 
-			}
+ 		  	
+ 			if ($order_id == '')
+ 			{	// Briefpapier/Logo
+ 				if ($this->shop->isMultiBlog())
+ 				{
+ 					
+ 					$path = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/';
+ 					$htaccess = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/.htaccess';
+ 					
+ 					$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/';
+ 					
+ 					if ($url) $strReturn = $url_content.'/'.$order_id.'/';
+ 					else $strReturn = $path.'/'.$order_id.'/';
+ 					
+ 				}
+ 				else
+ 				{
+ 					
+ 					$path = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_rechnungen/';
+ 					$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_rechnungen/.htaccess';
+ 					
+ 					if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg/wpsg_rechnungen/'.$order_id.'/';
+ 					else $strReturn = $path.$order_id.'/';
+ 					
+ 				}
+ 			}
+ 			else 
+ 			{	// Rechnung aus Bestellung
+
+ 				$deliverynote = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_RECHNUNGEN."` AS DN WHERE `o_id` = '".wpsg_q($order_id)."' ");
+ 				$datum = $deliverynote['datum'];
+ 				$ym = date('Y/m/', strtotime($datum));
+ 				
+ 				if ($this->shop->isMultiBlog())
+ 				{
+ 					
+ 					$path = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/.$ym';
+ 					$htaccess = WP_CONTENT_DIR.'/'.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/.htaccess';
+ 					
+ 					$url_content = WPSG_URL_CONTENT.WPSG_MB_UPLOADS.'/wpsg/wpsg_rechnungen/.$ym';
+ 					
+ 					if ($url) $strReturn = $url_content.'/'.$order_id.'/';
+ 					else $strReturn = $path.'/'.$order_id.'/';
+ 					
+ 				}
+ 				else
+ 				{
+ 					
+ 					$path = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_rechnungen/'.$ym;
+ 					$htaccess = WPSG_PATH_CONTENT.'uploads/wpsg/wpsg_rechnungen/.htaccess';
+ 					
+ 					if ($url) $strReturn = WPSG_URL_CONTENT.'uploads/wpsg/wpsg_rechnungen/'.$ym.$order_id.'/';
+ 					else $strReturn = $path.$order_id.'/';
+ 					
+ 				}
+ 			}
 			
 			if (!file_exists($path)) 
Index: /views/mods/mod_rechnungen/order_view.phtml
===================================================================
--- /views/mods/mod_rechnungen/order_view.phtml	(revision 6366)
+++ /views/mods/mod_rechnungen/order_view.phtml	(revision 6367)
@@ -111,5 +111,5 @@
                     ?>
 
-                    <a target="_blank" onclick="if (!confirm('<?php echo __('Sind Sie sicher, dass Sie eine Kopie dieser Rechnung/Rechnungskorrektur erneut an den Kunden senden mÃ¶chten?', 'wpsg'); ?>')) return false;" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id=<?php echo $this->view['data']['id']; ?>&r_id=<?php echo $r['id']; ?>&do=copy"><?php echo __("Kopie senden", "wpsg"); ?></a>&nbsp;
+                    <a target="_blank" onclick="if (!confirm('<?php echo __('Sind Sie sicher, dass Sie eine Kopie dieser Rechnung/Rechnungskorrektur erneut an den Kunden senden mÃ¶chten?', 'wpsg'); ?>')) return false;" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id=<?php echo $this->view['data']['id']; ?>&r_id=<?php echo $r['id']; ?>&do=copy"><?php echo ' &nbsp;'.__("Kopie senden", "wpsg"); ?></a>&nbsp;
                     <a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&noheader=1&mod=wpsg_mod_rechnungen&do=getRechnung&edit_id=<?php echo $this->view['data']['id']; ?>&r_id=<?php echo $r['id']; ?>"><?php echo __("Ansehen", "wpsg"); ?></a>
 
@@ -122,6 +122,6 @@
 
     <?php if (sizeof($this->view['mod_rechnungen']['arRechnungen']) > 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_gesamt']) != sizeof($this->view['mod_rechnungen']['arRechnungen_storno'])) { ?>
-        <fieldset style="border:1px solid #999999; width:100%;">
-            <legend style="margin-left:7px; margin-right:10px;"><?php echo __("Bestellstorno: Rechnungskorrektur erstellen", "wpsg"); ?></legend>
+        <fieldset style="border:0px solid #999999; width:100%;">
+            <legend ><?php echo __("Bestellstorno: Rechnungskorrektur erstellen", "wpsg"); ?></legend>
             <div style="padding:10px;">
                 <form id="storno_form" target="_blank" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&noheader=1&action=ajax&mod=wpsg_mod_rechnungen&edit_id=<?php echo $this->view['data']['id']; ?>&do=storno">
