diff --git a/Makefile b/Makefile
index f97f3d7ef65d3f2da848be57c26fe4435a8e9a2c..b78bc963557de6d32c7b1e05d39be4173dca8bd6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,11 @@
 BASE=ordernumber
 PLUGINTYPE=vmshopper
-VERSION=1.1
+VERSION=1.2
 
 PLUGINFILES=$(BASE).php $(BASE).xml index.html
-TRANSDIR=../../../administrator/language/
-TRANSLATIONS=$(call wildcard,$(TRANSDIR)/*/*.plg_$(PLUGINTYPE)_$(BASE).sys.ini)
+# TRANSDIR=../../../administrator/language/
+# TRANSLATIONS=$(call wildcard,$(TRANSDIR)/*/*.plg_$(PLUGINTYPE)_$(BASE).sys.ini)
+TRANSLATIONS=$(call wildcard,*.plg_$(PLUGINTYPE)_$(BASE).sys.ini)
 ZIPFILE=plg_$(PLUGINTYPE)_$(BASE)_v$(VERSION).zip
 
 zip: $(PLUGINFILES) $(TRANSLATIONS)
diff --git a/de-DE.plg_vmshopper_ordernumber.sys.ini b/de-DE.plg_vmshopper_ordernumber.sys.ini
index 3b50f765a10ee1af8376c79bb04a020c172ded06..ff13fdf62d81cdcda0bfaa3ce190669693315b81 100644
--- a/de-DE.plg_vmshopper_ordernumber.sys.ini
+++ b/de-DE.plg_vmshopper_ordernumber.sys.ini
@@ -49,7 +49,6 @@ PLG_ORDERNUMBER_ORDERNR_CUSTOMIZE = "Bestellungsnummern anpassen"
 PLG_ORDERNUMBER_ORDERNR_CUSTOMIZE_DESC = "Hier ankreuzen, wenn Sie Ihre Bestellungsnummern anpassen möchten und nicht die Standardeinstellung benutzen möchten."
 PLG_ORDERNUMBER_ORDERNR_FMT="Format der Bestellungsnummern"
 PLG_ORDERNUMBER_ORDERNR_FMT_DESC="Hier können Sie Ihr eigenes Format für Bestellungsnummern angeben."
-PLG_ORDERNUMBER_ORDERNR_FMT_DEFAULT = "Order-[year][month]-#"
 PLG_ORDERNUMBER_ORDERNR_COUNTER = "Zähler"
 PLG_ORDERNUMBER_ORDERNR_COUNTER_DESC = "Wählen Sie aus, ob der Zähler global oder pro Formatwert laufen soll. Z.B. beginnt bei einem Format '[year]-#' und einem Zähler pro Formatwert der Zähler jedes Jahr bei 1."
 
@@ -58,14 +57,11 @@ PLG_ORDERNUMBER_PASSWD_CUSTOMIZE = "Bestellungspasswort anpassen"
 PLG_ORDERNUMBER_PASSWD_CUSTOMIZE_DESC = "Hier ankreuzen, wenn Sie Ihre Bestellungspasswörter anpassen möchten und nicht die Standardeinstellung benutzen möchten."
 PLG_ORDERNUMBER_PASSWD_FMT = "Format of the order password"
 PLG_ORDERNUMBER_PASSWD_FMT_DESC = "Hier können Sie Ihr eigenes Format für Bestellungspasswörter angeben (# wird nicht ersetzt)."
-PLG_ORDERNUMBER_PASSWD_FMT_DEFAULT = "p_[randomHex5]"
 
 PLG_ORDERNUMBER_INVOICENR = "<b>Rechnungsnummern</b>"
 PLG_ORDERNUMBER_INVOICENR_CUSTOMIZE = "Rechnungsnummern anpassen"
 PLG_ORDERNUMBER_INVOICENR_CUSTOMIZE_DESC = "Hier ankreuzen, wenn Sie Ihre Rechnungsnummern anpassen möchten und nicht die Standardeinstellung benutzen möchten."
 PLG_ORDERNUMBER_INVOICENR_FMT = "Format der Rechnungsnummern"
 PLG_ORDERNUMBER_INVOICENR_FMT_DESC = "Hier können Sie Ihr eigenes Format für Rechnungsnummern angeben."
-PLG_ORDERNUMBER_INVOICENR_FMT_DEFAULT = "[year]/#"
-
 PLG_ORDERNUMBER_INVOICENR_COUNTER = "Zähler"
 PLG_ORDERNUMBER_INVOICENR_COUNTER_DESC = "Wählen Sie aus, ob der Zähler global oder pro Formatwert laufen soll. Z.B. beginnt bei einem Format '[year]-#' und einem Zähler pro Formatwert der Zähler jedes Jahr bei 1."
diff --git a/en-GB.plg_vmshopper_ordernumber.sys.ini b/en-GB.plg_vmshopper_ordernumber.sys.ini
index 982e03c3f8e6b0f975857b17c126670b065f2729..0cb65d747c15ff3416e622490197850e2ffa8f2f 100644
--- a/en-GB.plg_vmshopper_ordernumber.sys.ini
+++ b/en-GB.plg_vmshopper_ordernumber.sys.ini
@@ -49,7 +49,6 @@ PLG_ORDERNUMBER_ORDERNR_CUSTOMIZE = "Customize order numbers"
 PLG_ORDERNUMBER_ORDERNR_CUSTOMIZE_DESC = "Check here if you want customized order number formats rather than the default."
 PLG_ORDERNUMBER_ORDERNR_FMT="Format of the order numbers"
 PLG_ORDERNUMBER_ORDERNR_FMT_DESC="Here you can customize the order number"
-PLG_ORDERNUMBER_ORDERNR_FMT_DEFAULT = "Order-[year][month]-#"
 PLG_ORDERNUMBER_ORDERNR_COUNTER = "Counter"
 PLG_ORDERNUMBER_ORDERNR_COUNTER_DESC = "Choose whether you want one global counter or per-format value counters. E.g. with a format of '[year]-#' and the latter option checked, the order count will be within the year only."
 
@@ -58,14 +57,11 @@ PLG_ORDERNUMBER_PASSWD_CUSTOMIZE = "Customize order password"
 PLG_ORDERNUMBER_PASSWD_CUSTOMIZE_DESC = "Check here if you want customized order password formats rather than the default."
 PLG_ORDERNUMBER_PASSWD_FMT = "Format of the order password"
 PLG_ORDERNUMBER_PASSWD_FMT_DESC = "Here you can customize the order password (# is NOT replaced)"
-PLG_ORDERNUMBER_PASSWD_FMT_DEFAULT = "p_[randomHex5]"
 
 PLG_ORDERNUMBER_INVOICENR = "<b>Invoice numbers</b>"
 PLG_ORDERNUMBER_INVOICENR_CUSTOMIZE = "Customize invoice numbers"
 PLG_ORDERNUMBER_INVOICENR_CUSTOMIZE_DESC = "Check here if you want customized invoice number formats rather than the default."
 PLG_ORDERNUMBER_INVOICENR_FMT = "Format of the invoice numbers"
 PLG_ORDERNUMBER_INVOICENR_FMT_DESC = "Here you can customize the invoice number"
-PLG_ORDERNUMBER_INVOICENR_FMT_DEFAULT = "[year]/#"
-
 PLG_ORDERNUMBER_INVOICENR_COUNTER = "Counter"
 PLG_ORDERNUMBER_INVOICENR_COUNTER_DESC = "Choose whether you want one global counter or per-format value counters. E.g. with a format of '[year]-#' and the latter option checked, the invoice count will be within the year only."
diff --git a/ordernumber.php b/ordernumber.php
index c581d12876cc7c8cefa5805db817c1bcdf0d45a1..2993b4202acc346cf22e89927082c8f86bccd9c2 100644
--- a/ordernumber.php
+++ b/ordernumber.php
@@ -25,17 +25,17 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
 
     function getTableSQLFields () {
         $SQLfields = array(
-            'id'                                     => 'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',
-            'number_type'                            => 'int(1) UNSIGNED',
-            'number_format'                          => 'varchar(255)',
-            'count'                                  => 'int(1)',
+            'id'             => 'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',
+            'number_type'    => 'int(1) UNSIGNED',
+            'number_format'  => 'varchar(255)',
+            'count'          => 'int(1)',
         );
         return $SQLfields;
     }
 
     // We don't need this function, but the parent class declares it abstract, so we need to overload
     function plgVmOnUpdateOrderBEShopper($_orderID) {}
-    
+
     /* Return a random "string" of the given length taken from the given alphabet */
     static function randomString($alphabet, $len) {
         $alen = strlen($alphabet);
@@ -116,7 +116,7 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
         $db->setQuery($q);
         $existing = $db->loadResult();
         $count = $existing?($existing+1):1;
-          
+
         // Insert new counter value into the db
         if ($existing) {
             $q = 'UPDATE `'.$this->_tablename.'` SET `count`= "'.$count.'" WHERE `number_type`='.(int)$nrtype.' AND `number_format`="'.($global?"":$nr_escaped).'"';
@@ -137,7 +137,7 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
           $nrtype=0; /*order-nr*/
           $fmt = $this->params->get ('order_number_format', "#");
           $global = $this->params->get ('order_number_global', 1);
-          $ordernr = $this->format_number ($fmt, $orderDetails, $nrtype, $global); 
+          $ordernr = $this->format_number ($fmt, $orderDetails, $nrtype, $global);
           $orderDetails->order_number = $ordernr;
         }
         // Is order password customization enabled?
@@ -147,15 +147,25 @@ class plgVmShopperOrdernumber extends vmShopperPlugin {
           $orderDetails->order_pass = $passwd;
         }
     }
-    
+
     function plgVmOnUserInvoice($orderDetails,&$data) {
+        // print("<pre>plgVmOnUserInvoice, orderDetails=");print_r($orderDetails);print("</pre>");
+        // print("<pre>plgVmOnUserInvoice, data=");print_r($data);print("</pre>");
         // Is order number customization enabled?
         if ($this->params->get('customize_invoice_number')) {
-            $nrtype=1; /*invoice-nr*/
-            $fmt = $this->params->get ('invoice_number_format', "#");
-            $global = $this->params->get ('invoice_number_global', 1);
-            $invoicenr = $this->format_number ($fmt, (object)$orderDetails, $nrtype, $global); 
-            $data['invoice_number'] = $invoicenr;
+            // check the default configuration
+            $orderstatusForInvoice = VmConfig::get('inv_os',array());
+            if(!is_array($orderstatusForInvoice)) $orderstatusForInvoice = array($orderstatusForInvoice); //for backward compatibility 2.0.8e
+            $pdfInvoice = (int)VmConfig::get('pdf_invoice', 0); // backwards compatible
+            $force_create_invoice=JRequest::getInt('create_invoice', 0);
+            if ( in_array($orderDetails['order_status'],$orderstatusForInvoice)  or $pdfInvoice==1  or $force_create_invoice==1 ){
+                $nrtype=1; /*invoice-nr*/
+                $fmt = $this->params->get ('invoice_number_format', "#");
+                $global = $this->params->get ('invoice_number_global', 1);
+                $invoicenr = $this->format_number ($fmt, (object)$orderDetails, $nrtype, $global);
+                // print("<pre>    invoice nr format: $fmt, resulting in $invoicenr</pre>");
+                $data['invoice_number'] = $invoicenr;
+            }
         }
     }
 }
diff --git a/ordernumber.xml b/ordernumber.xml
index aec6cd15023b6ee1dececcf04865fbabb3b2bccb..683d48de9fbefec563997904306518ca312d69ed 100644
--- a/ordernumber.xml
+++ b/ordernumber.xml
@@ -11,11 +11,12 @@
     <releaseDate>2012-11-13</releaseDate>
     <releaseType>Major update</releaseType>
     <downloadUrl>http://www.kainhofer.com/virtuemart-2-extensions/</downloadUrl>
-    
+
     <description>VMSHOPPER_ORDERNUMBER_DESC</description>
-    
+
     <languages>
         <language tag="en-GB">en-GB.plg_vmshopper_ordernumber.sys.ini</language>
+        <language tag="de-DE">de-DE.plg_vmshopper_ordernumber.sys.ini</language>
     </languages>
     <files>
         <filename plugin="ordernumber">ordernumber.php</filename>
@@ -28,7 +29,7 @@
                     <option value="1">PLG_ORDERNUMBER_YES</option>
                     <option value="0">PLG_ORDERNUMBER_NO</option>
                 </field>
-                <field name="order_number_format" type="text" default="PLG_ORDERNUMBER_ORDERNR_FMT_DEFAULT" label="PLG_ORDERNUMBER_ORDERNR_FMT" description="PLG_ORDERNUMBER_ORDERNR_FMT_DESC"/>
+                <field name="order_number_format" type="text" default="Order-[year][month]-#" label="PLG_ORDERNUMBER_ORDERNR_FMT" description="PLG_ORDERNUMBER_ORDERNR_FMT_DESC"/>
                 <field name="order_number_global" type="radio" default="0" label="PLG_ORDERNUMBER_ORDERNR_COUNTER" description="PLG_ORDERNUMBER_ORDERNR_COUNTER_DESC">
                     <option value="1">PLG_ORDERNUMBER_COUNTER_GLOBAL</option>
                     <option value="0">PLG_ORDERNUMBER_COUNTER_PERFORMAT</option>
@@ -39,19 +40,19 @@
                     <option value="1">Yes</option>
                     <option value="0">No</option>
                 </field>
-                <field name="order_password_format" type="text" default="PLG_ORDERNUMBER_PASSWD_FMT_DEFAULT" label="PLG_ORDERNUMBER_PASSWD_FMT" description="PLG_ORDERNUMBER_PASSWD_FMT_DESC"/>
+                <field name="order_password_format" type="text" default="p_[randomHex5]" label="PLG_ORDERNUMBER_PASSWD_FMT" description="PLG_ORDERNUMBER_PASSWD_FMT_DESC"/>
 
                 <field name="invoice_options" type="spacer" label="PLG_ORDERNUMBER_INVOICENR" />
                 <field name="customize_invoice_number" type="radio" default="0" label="PLG_ORDERNUMBER_INVOICENR_CUSTOMIZE" description="PLG_ORDERNUMBER_INVOICENR_CUSTOMIZE_DESC">
                     <option value="1">PLG_ORDERNUMBER_YES</option>
                     <option value="0">PLG_ORDERNUMBER_NO</option>
                 </field>
-		<field name="invoice_number_format" type="text" default="PLG_ORDERNUMBER_INVOICENR_FMT_DEFAULT" label="PLG_ORDERNUMBER_INVOICENR_FMT" description="PLG_ORDERNUMBER_INVOICENR_FMT_DESC"/>
+		<field name="invoice_number_format" type="text" default="[year]/#" label="PLG_ORDERNUMBER_INVOICENR_FMT" description="PLG_ORDERNUMBER_INVOICENR_FMT_DESC"/>
                 <field name="invoice_number_global" type="radio" default="0" label="PLG_ORDERNUMBER_INVOICENR_COUNTER" description="PLG_ORDERNUMBER_INVOICENR_COUNTER_DESC">
                     <option value="1">PLG_ORDERNUMBER_COUNTER_GLOBAL</option>
                     <option value="0">PLG_ORDERNUMBER_COUNTER_PERFORMAT</option>
                 </field>
             </fieldset>
-        </fields>      
+        </fields>
     </config>
 </install>