Browse Source

Merge branch 'dev'

Mathieu Moulin 2 years ago
parent
commit
5fa8002e42

+ 1 - 0
src/sync/customer/dp.inc.php

@@ -120,6 +120,7 @@ public function dp_map_update(&$o, &$d_data, &$p_data=[])
 			'ape' => $d_data['societe']['ape'],
 			'date_upd' => $tms,
 			'id_default_group' => $d_data['societe_extrafields']['p_group'],
+			'note' => $d_data['societe']['note_private'],
 		],
 	];
 

+ 1 - 1
src/sync/customer/pd.inc.php

@@ -84,7 +84,7 @@ public function pd_map_update(&$o, &$p_data, &$d_data=[])
 			//'tva_intra' => '',
 			//'capital' => NULL,
 			//'fk_stcomm' => 0,
-			//'note_private' => NULL,
+			'note_private' => $p_data['customer']['note'],
 			//'note_public' => NULL,
 			//'model_pdf' => NULL,
 			//'prefix_comm' => NULL,

+ 8 - 11
src/sync/order/dp.inc.php

@@ -6,17 +6,12 @@ class sync_order_dp extends sync_order
 public static function dp_check_sync(&$o, &$d_data)
 {
 	// @todo modifier avec P >= 1.7.8
-	// Si produit maître avec déclinaisons, on stoppe la synchro pour pas foutre le border
 	
 	// Uniquement resynchro ! On n'envoie pas les commandes créées sur DOli vers Presta
 	// @todo : Du moins tant qu'on a pas réglé le cas des produits libres
 	if (empty($o['p_oid']))
 		return false;
 	
-	// Si noté pas synchro
-	if (empty($d_data['product_extrafields']) || empty($d_data['product_extrafields']['sync']))
-		return false;
-	
 	return true;
 }
 
@@ -102,15 +97,17 @@ public function dp_map_update(&$o, &$d_data, &$p_data=[])
 		'orders' => [
 			//'reference' => substr($d_data['commande']['ref'], 0, 9),
 
-			'id_customer' => static::_dp_map_fk_customer($d_data),
-			'id_address_delivery' => static::_dp_map_fk_address_delivery($d_data),
-			'id_address_invoice' => static::_dp_map_fk_address_invoice($d_data),
+			//'id_customer' => static::_dp_map_fk_customer($d_data),
+			//'id_address_delivery' => static::_dp_map_fk_address_delivery($d_data),
+			//'id_address_invoice' => static::_dp_map_fk_address_invoice($d_data),
 			
-			'total_paid' => $d_data['commande']['total_ttc'],
-			'total_paid_tax_incl' => $d_data['commande']['total_ttc'],
-			'total_paid_tax_excl' => $d_data['commande']['total_ht'],
+			//'total_paid' => $d_data['commande']['total_ttc'],
+			//'total_paid_tax_incl' => $d_data['commande']['total_ttc'],
+			//'total_paid_tax_excl' => $d_data['commande']['total_ht'],
 			
 			'date_upd' => max($d_data['commande']['tms'], !empty($p_data['orders']['date_upd']) ?$p_data['orders']['date_upd'] :'0000-00-00 00:00:00'),
+
+			'note' => strip_tags($d_data['commande']['note_private']),
 		],
 	];
 

+ 1 - 0
src/sync/order/pd.inc.php

@@ -437,6 +437,7 @@ public function pd_map_update(&$o, &$p_data, &$d_data=[])
 
 				'fk_user_modif' => static::D_K_USER,
 				'tms' => max($p_data['orders']['date_upd'], isset($d_data['commande']) ?$d_data['commande']['tms']: 0),
+				'note_private' => $p_data['orders']['note'],
 			],
 			'commande_extrafields' => [
 				'p_state' => $p_data['orders']['current_state'],