diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 52971f767708e5237ea1c88b52c32274c087bb9f..57c8d55c9834ee523521e259318c64ed965d47a0 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1120,7 +1120,26 @@ class pdf_crabe extends ModelePDFFactures
 					}
 
                 //}
+                
 				// VAT
+				// Situations totals migth be wrong on huge amounts
+				if ($object->situation_cycle_ref && $object->situation_counter > 1) {
+					
+					$sum_pdf_tva = 0;
+					foreach($this->tva as $tvakey => $tvaval){
+						$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
+					}
+					
+					if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
+						$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
+						
+						foreach($this->tva as $tvakey => $tvaval) {
+							$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
+						}
+					}
+					
+				}
+				
 				foreach($this->tva as $tvakey => $tvaval)
 				{
 					if ($tvakey != 0)    // On affiche pas taux 0
diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
index f1c94f346cf40403ee1fc946903dc9a526a28d8c..e09d364a0e2348d4999e22ea7da6a0375ea3d927 100644
--- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
+++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
@@ -544,4 +544,6 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (178,
 -- VMYSQL4.1 ALTER TABLE llx_establishment CHANGE COLUMN fk_user_mod fk_user_mod integer NULL;
 -- VPGSQL8.2 ALTER TABLE llx_establishment ALTER COLUMN fk_user_mod DROP NOT NULL;
 
-ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
\ No newline at end of file
+ALTER TABLE llx_multicurrency_rate ADD COLUMN entity integer DEFAULT 1;
+
+ALTER TABLE llx_user MODIFY COLUMN login varchar(50);
\ No newline at end of file
diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql
index 6b3c5b83f6dbc7d7ad9463af23a47bed3e813b07..84d74fa52d938fa1f029c12ba1754efbd32fc62e 100644
--- a/htdocs/install/mysql/tables/llx_user.sql
+++ b/htdocs/install/mysql/tables/llx_user.sql
@@ -33,7 +33,7 @@ create table llx_user
   tms               timestamp,
   fk_user_creat     integer,
   fk_user_modif     integer,
-  login             varchar(24) NOT NULL,
+  login             varchar(50) NOT NULL,
   pass              varchar(128),
   pass_crypted      varchar(128),
   pass_temp         varchar(128),			    -- temporary password when asked for forget password
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 9ed3846118012cebd72e24f46a0e68c01b92742b..e2bfb5020286772292f980ea9713ce16a6ad66fe 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -526,7 +526,8 @@ if (empty($reshook))
 	    $error = 0;
 
 		// Set if we used free entry or predefined product
-		$predef='';
+	    $predef='';
+	    $ref_fourn = GETPOST('fourn_ref');
 		$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
 		$date_start=dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
 		$date_end=dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
@@ -614,7 +615,7 @@ if (empty($reshook))
 			        $price_base_type = $productsupplier->fourn_price_base_type;
 			        $type = $productsupplier->type;
 			        $label = $productsupplier->label;
-			        $desc = $productsupplier->description;
+			        $desc = $productsupplier->description;			        
 			        if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc);
 			
 			        $tva_tx	= get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice'));
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 8cbc3882fc451153b041d4272466b006a06e7622..6f973f4ce0888424e9714986f32ca5be935ebcaf 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -2738,6 +2738,7 @@ class SupplierProposalLine  extends CommonObject
         if (empty($this->special_code)) $this->special_code=0;
         if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
         if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
+        if (empty($this->subprice)) $this->subprice=0;
 
         if (empty($this->pa_ht)) $this->pa_ht=0;
 
@@ -2920,6 +2921,7 @@ class SupplierProposalLine  extends CommonObject
         if (empty($this->special_code)) $this->special_code=0;
         if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
         if (empty($this->fk_fournprice)) $this->fk_fournprice=0;
+        if (empty($this->subprice)) $this->subprice=0;
 
 		if (empty($this->pa_ht)) $this->pa_ht=0;
 
diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php
index f8624ebc0408aa94e2e9ca20625c3af3252acdeb..98a5c4d51bc25f7b55152cb46e37781a187fc95a 100755
--- a/scripts/product/migrate_picture_path.php
+++ b/scripts/product/migrate_picture_path.php
@@ -104,7 +104,7 @@ function migrate_product_photospath($product)
 	global $conf;
 
 	$dir = $conf->product->multidir_output[$product->entity];
-	$origin = $dir .'/'. get_exdir($product->id,2) . $product->id ."/photos";
+	$origin = $dir .'/'. get_exdir($product->id,2,0,0,$product,'product') . $product->id ."/photos";
 	$destin = $dir.'/'.dol_sanitizeFileName($product->ref);
 
 	$error = 0;