diff --git a/ChangeLog b/ChangeLog
index 7bc3e729ec2..ae6da3e2653 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,8 +3,10 @@ English Dolibarr ChangeLog
***** ChangeLog for 2.9 compared to 2.8 *****
For users:
+- New: Can set accountancy code for product (buy and sell).
- New: Can filter third parties lists on categories.
- New: Can filter products and services lists on categories.
+- New: Can use categories for members.
- New: Can build documents for third parties (Use ODT templates, need PHP 5.2+).
- New: Support products property length and area.
- New: Add "payment due before" field in invoice exports
diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index 6f06a590fa9..717b1ecf1d2 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -151,31 +151,12 @@ if ($socid > 0)
print '';
print '
';
- // TODO Use a html->editfield function
- print '| ';
- print $langs->trans("CustomerAccountancyCode");
- print ' | ';
- if ($_GET['action'] != 'editcustomeraccountancycode' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Edit'),1).' | ';
- print ' ';
+ print ' | ';
+ print $form->editfieldkey("CustomerAccountancyCode",'customeraccountancycode',$societe->code_compta,'socid',$societe->id,$user->rights->societe->creer);
print ' | ';
- if ($_GET['action'] == 'editcustomeraccountancycode')
- {
- print "\n".''."\n";
- }
- else print $societe->code_compta;
+ print $form->editfieldval("CustomerAccountancyCode",'customeraccountancycode',$societe->code_compta,'socid',$societe->id,$user->rights->societe->creer);
print ' | ';
- // End editfield
print '
';
-
}
if ($societe->fournisseur)
@@ -188,29 +169,11 @@ if ($socid > 0)
print '';
print '';
- // TODO Use a html->editfield function
- print '| ';
- print $langs->trans("SupplierAccountancyCode");
- print ' | ';
- if ($_GET['action'] != 'editsupplieraccountancycode' && $user->rights->societe->creer) print 'id.'">'.img_edit($langs->trans('Edit'),1).' | ';
- print ' ';
+ print ' | ';
+ print $form->editfieldkey("SupplierAccountancyCode",'supplieraccountancycode',$societe->code_compta_fournisseur,'socid',$societe->id,$user->rights->societe->creer);
print ' | ';
- if ($_GET['action'] == 'editsupplieraccountancycode')
- {
- print "\n".''."\n";
- }
- else print $societe->code_compta_fournisseur;
+ print $form->editfieldval("SupplierAccountancyCode",'supplieraccountancycode',$societe->code_compta_fournisseur,'socid',$societe->id,$user->rights->societe->creer);
print ' | ';
- // End editfield
print '
';
}
@@ -407,35 +370,35 @@ if ($socid > 0)
if ($num > 0)
{
require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
-
+
$projectstatic = new Project($db);
-
+
print '';
// Ref
- print '| '.$langs->trans("Ref").' | ';
+ print ' | '.$langs->trans("Ref").' | ';
print $html->showrefnav($product,'ref','',1,'ref');
print ' | ';
- $nblignes=3;
- if (! empty($conf->global->PRODUIT_MULTIPRICES_LIMIT) && empty($socid)) $nblignes+=$conf->global->PRODUIT_MULTIPRICES_LIMIT;
- else $nblignes+=3;
+ print '
';
+ // Label
+ print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
+
+ $nblignes=4;
if ($product->is_photo_available($conf->produit->dir_output))
{
// Photo
print '';
- $nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0);
+ $nbphoto=$product->show_photos($conf->produit->dir_output,1,1,0,0,0,80);
print ' | ';
}
+
print '
';
- // Label
- print '| '.$langs->trans("Label").' | '.$product->libelle.' |
';
+ // Accountancy buy code
+ print '| '.$html->editfieldkey("ProductAccountancyBuyCode",'productaccountancycodesell',$product->accountancy_code_sell,'id',$product->id,$user->rights->produit->creer).' | ';
+ print $html->editfieldval("ProductAccountancyBuyCode",'productaccountancycodesell',$product->accountancy_code_sell,'id',$product->id,$user->rights->produit->creer);
+ print ' |
';
- // MultiPrix
- if($conf->global->PRODUIT_MULTIPRICES)
- {
- if ($socid)
- {
- $soc = new Societe($db);
- $soc->id = $socid;
- $soc->fetch($socid);
-
- print '| '.$langs->trans("SellingPrice").' | ';
-
- if ($product->multiprices_base_type["$soc->price_level"] == 'TTC')
- {
- print ''.price($product->multiprices_ttc["$soc->price_level"]);
- }
- else
- {
- print ' | '.price($product->multiprices["$soc->price_level"]);
- }
-
- if ($product->multiprices_base_type["$soc->price_level"])
- {
- print ' '.$langs->trans($product->multiprices_base_type["$soc->price_level"]);
- }
- else
- {
- print ' '.$langs->trans($product->price_base_type);
- }
- print ' |
';
-
- // Prix mini
- print '| '.$langs->trans("MinPrice").' | ';
- if ($product->multiprices_base_type["$soc->price_level"] == 'TTC')
- {
- print price($product->multiprices_min_ttc["$soc->price_level"]).' '.$langs->trans($product->multiprices_base_type["$soc->price_level"]);
- }
- else
- {
- print price($product->multiprices_min["$soc->price_level"]).' '.$langs->trans($product->multiprices_base_type["$soc->price_level"]);
- }
- print ' |
';
-
- // TVA
- print '| '.$langs->trans("VATRate").' | '.vatrate($product->multiprices_tva_tx["$soc->price_level"],true).' |
';
- }
- else
- {
- for ($i=1; $i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
- {
- print '| '.$langs->trans("SellingPrice").' '.$i.' | ';
-
- if ($product->multiprices_base_type["$i"] == 'TTC')
- {
- print ''.price($product->multiprices_ttc["$i"]);
- }
- else
- {
- print ' | '.price($product->multiprices["$i"]);
- }
-
- if ($product->multiprices_base_type["$i"])
- {
- print ' '.$langs->trans($product->multiprices_base_type["$i"]);
- }
- else
- {
- print ' '.$langs->trans($product->price_base_type);
- }
- print ' |
';
-
- // Prix mini
- print '| '.$langs->trans("MinPrice").' '.$i.' | ';
- if ($product->multiprices_base_type["$i"] == 'TTC')
- {
- print price($product->multiprices_min_ttc["$i"]).' '.$langs->trans($product->multiprices_base_type["$i"]);
- }
- else
- {
- print price($product->multiprices_min["$i"]).' '.$langs->trans($product->multiprices_base_type["$i"]);
- }
- print ' |
';
-
- // TVA
- print '| '.$langs->trans("VATRate").' '.$i.' | '.vatrate($product->multiprices_tva_tx["$i"],true).' |
';
- }
- }
- }
- else
- {
- // Prix
- print '| '.$langs->trans("SellingPrice").' | ';
- if ($product->price_base_type == 'TTC')
- {
- print price($product->price_ttc).' '.$langs->trans($product->price_base_type);
- }
- else
- {
- print price($product->price).' '.$langs->trans($product->price_base_type);
- }
- print ' |
';
-
- // Prix mini
- print '| '.$langs->trans("MinPrice").' | ';
- if ($product->price_base_type == 'TTC')
- {
- print price($product->price_min_ttc).' '.$langs->trans($product->price_base_type);
- }
- else
- {
- print price($product->price_min).' '.$langs->trans($product->price_base_type);
- }
- print ' |
';
-
- // TVA
- print '| '.$langs->trans("VATRate").' | '.vatrate($product->tva_tx,true).' |
';
- }
+ // Accountancy sell code
+ print '| '.$html->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$product->accountancy_code_buy,'id',$product->id,$user->rights->produit->creer).' | ';
+ print $html->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$product->accountancy_code_buy,'id',$product->id,$user->rights->produit->creer);
+ print ' |
';
// Statut
print '| '.$langs->trans("Status").' | ';
|