From 843167515932e046511e505a69e91d7d30c37935 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Mar 2009 01:18:45 +0000 Subject: [PATCH] New: Some changes to support the type of line in entities. --- htdocs/comm/propal.php | 9 +++++---- htdocs/commande/fiche.php | 9 +++++---- htdocs/compta/facture.php | 10 ++++++---- htdocs/fourn/commande/fiche.php | 32 ++++++++++++++++++++++---------- htdocs/fourn/facture/fiche.php | 12 ++++++------ 5 files changed, 44 insertions(+), 28 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index ccb8272e9a8..68181895759 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1597,7 +1597,8 @@ if ($id > 0 || ! empty($ref)) print '\n"; print ''; - print $html->select_type_of_lines(-1,'type',1).'
'; + print $html->select_type_of_lines(-1,'type',1); + if ($conf->produit->enabled && $conf->service->enabled) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -1612,9 +1613,9 @@ if ($id > 0 || ! empty($ref)) } print ''; print ''; - //if ($societe->tva_assuj == "0") - //print '0'; - //else + if ($societe->tva_assuj == "0") + print '0'; + else $html->select_tva('np_tva_tx', $conf->defaulttx, $mysoc, $societe); print "\n"; print ''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 20c83cfbd05..8c080088f5f 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1689,7 +1689,8 @@ else print ''; print ''; - print $html->select_type_of_lines(-1,'type',1).'
'; + print $html->select_type_of_lines(-1,'type',1); + if ($conf->produit->enabled && $conf->service->enabled) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -1704,9 +1705,9 @@ else } print ''; print ''; - //if($soc->tva_assuj == "0") - //print '0'; - //else + if($soc->tva_assuj == "0") + print '0'; + else print $html->select_tva('tva_tx',$conf->defaulttx,$mysoc,$soc); print ''; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index cf630b69eb1..fe701663b6c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2902,6 +2902,7 @@ else else { print $html->select_type_of_lines($objp->product_type,'type',1); + if ($conf->produit->enabled && $conf->service->enabled) print '
'; } // Description - Editor wysiwyg @@ -2998,7 +2999,8 @@ else print ''; print ''; - print $html->select_type_of_lines(-1,'type',1).'
'; + print $html->select_type_of_lines(-1,'type',1); + if ($conf->produit->enabled && $conf->service->enabled) print '
'; // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) @@ -3013,9 +3015,9 @@ else } print ''; print ''; - //if($soc->tva_assuj == "0") - //print '0'; - //else + if($soc->tva_assuj == "0") + print '0'; + else $html->select_tva('tva_tx',$conf->defaulttx,$mysoc,$soc); print ''; print ''; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 07599c9919c..72d5b228e6b 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -693,6 +693,13 @@ if ($id > 0 || ! empty($ref)) $commandline = $commande->lignes[$i]; $var=!$var; + // Show product and description + $type=$commandline->product_type?$commandline->product_type:$commandline->fk_product_type; + // Try to enhance type detection using date_start and date_end for free lines where type + // was not saved. + if (! empty($commandline->date_start)) $type=1; + if (! empty($commandline->date_end)) $type=1; + // Ligne en mode visu if ($_GET['action'] != 'editline' || $_GET['rowid'] != $commandline->id) { @@ -775,7 +782,7 @@ if ($id > 0 || ! empty($ref)) print ' - '.nl2br($commandline->product); print '
'; } - // editeur wysiwyg + // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); @@ -802,14 +809,14 @@ if ($id > 0 || ! empty($ref)) } /* - * Ajouter une ligne + * Form to add new line */ if ($commande->statut == 0 && $user->rights->fournisseur->commande->creer && $_GET["action"] <> 'editline') { print ''; print ''; print ''; // ancre - print $langs->trans('Label').''; + print $langs->trans('AddNewLine').' - '.$langs->trans("FreeZone").''; print ''.$langs->trans('VAT').''; print ''.$langs->trans('PriceUHT').''; print ''.$langs->trans('Qty').''; @@ -817,7 +824,7 @@ if ($id > 0 || ! empty($ref)) print ' '; print ''; - // Ajout produit produits/services personnalises + // Add free products/services form print '
'; print ''; print ''; @@ -825,7 +832,11 @@ if ($id > 0 || ! empty($ref)) $var=true; print ''; print ''; - // editeur wysiwyg + + print $html->select_type_of_lines(-1,'type',1); + if ($conf->produit->enabled && $conf->service->enabled) print '
'; + + // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); @@ -838,10 +849,10 @@ if ($id > 0 || ! empty($ref)) } print ''; print ''; - if($soc->tva_assuj == "0") - print '0'; - else - print $html->select_tva('tva_tx',$conf->defaulttx,$mysoc,$soc); + //if($soc->tva_assuj == "0") + //print '0'; + //else + print $html->select_tva('tva_tx',$conf->defaulttx,$soc,$mysoc); print ''; print ''; print ''; @@ -856,6 +867,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; + print $langs->trans("AddNewLine").' - '; if ($conf->service->enabled) { print $langs->trans('RecordedProductsAndServices'); @@ -881,7 +893,7 @@ if ($id > 0 || ! empty($ref)) if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
'; - // editeur wysiwyg + // Editor wysiwyg if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) { require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 7e96496118f..2eed72aac7e 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -842,9 +842,9 @@ else print ''; // Unit price - print ''; + print ''; - print ''; + print ''; print ''; @@ -956,20 +956,20 @@ else } else { - print ''; + print ''; } print ''; - print ''; + print ''; //if($mysoc->tva_assuj == "0") //print '0'; //else print $html->select_tva('tauxtva',$conf->defaulttx,$societe,$mysoc); print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; print '';