Fix: Use correct translation of fields
This commit is contained in:
parent
82e0462dc8
commit
0152e226c1
@ -189,7 +189,7 @@ class modProduct extends DolibarrModules
|
|||||||
// End add extra fields
|
// End add extra fields
|
||||||
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
$this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||||
$this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
$this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]$','p.tobuy'=>'^[0|1]$','p.fk_product_type'=>'^[0|1]$','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||||
$this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31');
|
$this->import_examplevalues_array[$r]=array('p.ref'=>"PREF123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.tobuy'=>"0 or 1",'p.fk_product_type'=>"0 for product/1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31');
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->fournisseur->enabled))
|
if (! empty($conf->fournisseur->enabled))
|
||||||
@ -197,23 +197,27 @@ class modProduct extends DolibarrModules
|
|||||||
// Import product suppliers
|
// Import product suppliers
|
||||||
$r++;
|
$r++;
|
||||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||||
$this->import_label[$r]="SuppliersProducts"; // Translation key
|
$this->import_label[$r]="SuppliersPrices"; // Translation key
|
||||||
$this->import_icon[$r]='product';
|
$this->import_icon[$r]='product';
|
||||||
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
$this->import_tables_array[$r]=array('sp'=>MAIN_DB_PREFIX.'product_fournisseur_price');
|
||||||
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
|
$this->import_tables_creator_array[$r]=array('sp'=>'fk_user');
|
||||||
$this->import_fields_array[$r]=array('sp.fk_product'=>"Product*",
|
$this->import_fields_array[$r]=array('sp.fk_product'=>"Product*",
|
||||||
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'RefSupplier', 'sp.price'=>"Price*",
|
'sp.fk_soc'=>"Supplier*", 'sp.ref_fourn'=>'SupplierRef', 'sp.quantity'=>"QtyMin*", 'sp.tva_tx'=>'VATRate',
|
||||||
'sp.quantity'=>"Quantity*",'sp.unitprice'=>'UnitPrice*','sp.tva_tx'=>'VAT'
|
'sp.price'=>"PriceQtyMinHT*",
|
||||||
|
'sp.unitprice'=>'UnitPriceHT*', // TODO Make this file not required and calculate it from price and qty
|
||||||
|
'sp.remise_percent'=>'DiscountQtyMin'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->import_convertvalue_array[$r]=array(
|
$this->import_convertvalue_array[$r]=array(
|
||||||
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
'sp.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
|
||||||
'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
|
'sp.fk_product'=>array('rule'=>'fetchidfromref','classfile'=>'/product/class/product.class.php','class'=>'Product','method'=>'fetch','element'=>'Product')
|
||||||
);
|
);
|
||||||
$this->import_examplevalues_array[$r]=array('sp.fk_product'=>"PR123456",
|
$this->import_examplevalues_array[$r]=array('sp.fk_product'=>"PREF123456",
|
||||||
'sp.fk_soc'=>"My Supplier",'sp.ref_fourn'=>"SupplierRef",'sp.price'=>"50",
|
'sp.fk_soc'=>"My Supplier",'sp.ref_fourn'=>"SupplierRef", 'sp.quantity'=>"1", 'sp.tva_tx'=>'21',
|
||||||
'sp.quantity'=>"1",'sp.unitprice'=>'50','sp.tva_tx'=>'21'
|
'sp.price'=>"50",
|
||||||
|
'sp.unitprice'=>'50',
|
||||||
|
'sp.remise_percent'=>'0'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,8 @@ $contentlinevalues=array();
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($fieldstarget as $code=>$label)
|
foreach($fieldstarget as $code=>$label)
|
||||||
{
|
{
|
||||||
$headerlinefields[]=$fieldstarget[$code].' ('.$code.')';
|
$withoutstar=preg_replace('/\*/','',$fieldstarget[$code]);
|
||||||
|
$headerlinefields[]=$langs->transnoentities($withoutstar).($withoutstar != $fieldstarget[$code]?'*':'').' ('.$code.')';
|
||||||
$contentlinevalues[]=$valuestarget[$code];
|
$contentlinevalues[]=$valuestarget[$code];
|
||||||
}
|
}
|
||||||
//var_dump($headerlinefields);
|
//var_dump($headerlinefields);
|
||||||
|
|||||||
@ -733,7 +733,7 @@ if ($step == 4 && $datatoimport)
|
|||||||
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>';
|
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>';
|
||||||
print ' '.$langs->trans("Enclosure").' : ';
|
print ' '.$langs->trans("Enclosure").' : ';
|
||||||
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>';
|
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>';
|
||||||
print '<input type="submit" value="'.$langs->trans('Update').'" />';
|
print '<input type="submit" value="'.$langs->trans('Update').'" class="button" />';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -117,6 +117,6 @@ Excel2007FormatDesc=Format <b>Excel</b> (.xls).<br>Format standard Excel 2007 (S
|
|||||||
TsvFormatDesc=Format de fichier à <b>Valeurs Séparées par des Tabulations</b> (.tsv).<br>C'est un fichier texte dont les champs sont séparés par des tabulations [tab].
|
TsvFormatDesc=Format de fichier à <b>Valeurs Séparées par des Tabulations</b> (.tsv).<br>C'est un fichier texte dont les champs sont séparés par des tabulations [tab].
|
||||||
ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre).
|
ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement car il évitera que des lignes identiques soient considérées comme des doublons (avec ce champ, aucune ligne ne sera identique mais aura un id propre).
|
||||||
CsvOptions=Options du fichier Csv
|
CsvOptions=Options du fichier Csv
|
||||||
Separator=Séparateur
|
Separator=Séparateur de champs
|
||||||
Enclosure=Délimiteur de champs
|
Enclosure=Encadrement des chaines de textes
|
||||||
SuppliersProducts=Produits Fournisseurs
|
SuppliersProducts=Produits Fournisseurs
|
||||||
@ -470,7 +470,7 @@ if ($id || $ref)
|
|||||||
print vatrate($productfourn->fourn_tva_tx,true);
|
print vatrate($productfourn->fourn_tva_tx,true);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Price quantity
|
// Price for the quantity
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
print $productfourn->fourn_price?price($productfourn->fourn_price):"";
|
print $productfourn->fourn_price?price($productfourn->fourn_price):"";
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user