diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 3d47b5175f8f1a08d28834290571ac5d5f34ec31..d866ec8afa7132ba0c1a12ceffaefe0bc01e72d6 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -126,6 +126,8 @@ if ($_GET["action"] == 'create') print '</td></tr>'; // R�ductions relatives (Remises-Ristournes-Rabbais) +/* Une r�duction doit s'appliquer obligatoirement sur des lignes de factures + et non globalement car une tva est obligatoire meme sur une reduc $relative_discount=$soc->remise_client; print '<tr><td>'.$langs->trans("CustomerRelativeDiscount").'</td>'; print '<td>'; @@ -140,8 +142,10 @@ if ($_GET["action"] == 'create') print $langs->trans("CompanyHasNoRelativeDiscount"); } print '</td></tr>'; +*/ // R�ductions absolues (Remises-Ristournes-Rabbais) +/* Les remises absolues doivent s'appliquer par ajout de lignes sp�cialis�es $absolute_discount=$soc->getCurrentDiscount(); print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscount").'</td>'; print '<td>'; @@ -156,7 +160,7 @@ if ($_GET["action"] == 'create') print $langs->trans("CompanyHasNoAbsoluteDiscount"); } print '</td></tr>'; - +*/ // Date de livraison if ($conf->global->PROPAL_ADD_SHIPPING_DATE) @@ -177,6 +181,7 @@ if ($_GET["action"] == 'create') } print '</td></tr>'; } +*/ // Adresse de livraison if ($conf->global->PROPAL_ADD_DELIVERY_ADDRESS) @@ -320,7 +325,8 @@ if ($_GET["action"] == 'create') $html->select_produits('',"idprod".$i,'',$conf->produit->limit_size); print '</td>'; print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>'; - print '<td><input type="text" size="2" name="remise'.$i.'" value="">%</td></tr>'; + print '<td><input type="text" size="2" name="remise'.$i.'" value="">%</td>'; + print '</tr>'; } print "</table>"; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 88ad6cbd7a61adf402dc317f09b8777d9ceb92ec..7578d3158109a9caac295e741a8752d1597145e5 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -589,9 +589,21 @@ if ($_GET['propalid'] > 0) { $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$societe->id; } - print '<a href="'.$url.'">'.$societe->nom.'</a></td>'; + print '<a href="'.$url.'">'.$societe->nom.'</a>'; + print '</td>'; print '</tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td colspan="5">'; + if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$societe->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + // Dates print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; print dolibarr_print_date($propal->date,'%a %d %B %Y'); @@ -832,7 +844,7 @@ if ($_GET['propalid'] > 0) print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; - print '<td align="right" width="50">'.$langs->trans('Discount').'</td>'; + print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>'; print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>'; print '<td width="16"> </td>'; print '<td width="16"> </td>'; @@ -954,7 +966,7 @@ if ($_GET['propalid'] > 0) print '</td>'; print '<td align="right"><input size="6" type="text" name="subprice" value="'.price($objp->subprice).'"></td>'; print '<td align="right"><input size="2" type="text" name="qty" value="'.$objp->qty.'"></td>'; - print '<td align="right" nowrap><input size="2" type="text" name="remise_percent" value="'.$objp->remise_percent.'">%</td>'; + print '<td align="right" nowrap><input size="1" type="text" name="remise_percent" value="'.$objp->remise_percent.'">%</td>'; print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">'; print '<br /><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>'; print '</tr>' . "\n"; @@ -989,7 +1001,8 @@ if ($_GET['propalid'] > 0) * Lignes de remise */ - // Remise relative + // R�ductions relatives (Remises-Ristournes-Rabbais) +/* Une r�duction doit s'appliquer obligatoirement sur des lignes de factures $var=!$var; print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="action" value="setremisepercent">'; @@ -1004,7 +1017,7 @@ if ($_GET['propalid'] > 0) print '<td align="right"><font style="font-weight: normal">'; if ($_GET['action'] == 'editrelativediscount') { - print '<input type="text" name="remise_percent" size="2" value="'.$propal->remise_percent.'">%'; + print '<input type="text" name="remise_percent" size="1" value="'.$propal->remise_percent.'">%'; } else { @@ -1043,8 +1056,10 @@ if ($_GET['propalid'] > 0) } print '</tr>'; print '</form>'; +*/ - // Remise absolue + // R�ductions absolues (Remises-Ristournes-Rabbais) +/* Les remises absolues doivent s'appliquer par ajout de lignes sp�cialis�es $var=!$var; print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="action" value="setremiseabsolue">'; @@ -1095,7 +1110,7 @@ if ($_GET['propalid'] > 0) } print '</tr>'; print '</form>'; - +*/ /* * Ajouter une ligne @@ -1107,7 +1122,7 @@ if ($_GET['propalid'] > 0) print '<td align="right">'.$langs->trans('VAT').'</td>'; print '<td align="right">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; - print '<td align="right">'.$langs->trans('Discount').'</td>'; + print '<td align="right">'.$langs->trans('ReductionShort').'</td>'; print '<td> </td>'; print '<td> </td>'; print '<td> </td>'; @@ -1135,7 +1150,7 @@ if ($_GET['propalid'] > 0) print "</td>\n"; print '<td align="right"><input type="text" size="5" name="np_price"></td>'; print '<td align="right"><input type="text" size="2" value="1" name="qty"></td>'; - print '<td align="right" nowrap><input type="text" size="2" value="'.$societe->remise_client.'" name="np_remise">%</td>'; + print '<td align="right" nowrap><input type="text" size="1" value="'.$societe->remise_client.'" name="np_remise">%</td>'; print '<td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addligne"></td>'; print '</tr>'; @@ -1166,7 +1181,8 @@ if ($_GET['propalid'] > 0) print '</td>'; print '<td> </td>'; print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>'; - print '<td align="right" nowrap><input type="text" size="2" name="remise" value="'.$societe->remise_client.'">%</td>'; + print '<td align="right" nowrap><input type="text" size="1" name="remise" value="'.$societe->remise_client.'">%</td>'; + print '<td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Add").'" name="addligne">'; print '</td></tr>'."\n"; @@ -1538,6 +1554,8 @@ else { $url = DOL_URL_ROOT.'/comm/prospect/fiche.php?socid='.$objp->idp; } + + // Soci�t� print '<td><a href="'.$url.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>'; // Date propale diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index f9cfdc3121364843d27ed773b8a6ef41e750427c..427870571a5d1548a2e5d075b63d7fa2bbc51633 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -36,8 +36,9 @@ $user->getrights('commande'); $user->getrights('projet'); -$langs->load("orders"); $langs->load("companies"); +$langs->load("orders"); +$langs->load("bills"); if ($_POST["action"] == 'setremise') diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 831786ae58cb65200718e1931dec97e82ebfbd6f..e9295c0749c5f6d84c9546dfb8d8a4e3a8124bac 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -495,14 +495,14 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '<form name="crea_commande" action="fiche.php" method="post">'; print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="soc_id" value="'.$soc->id.'">' ."\n"; - print '<input type="hidden" name="remise_percent" value="0">'; + print '<input type="hidden" name="remise_percent" value="'.$soc->remise_client.'">'; print '<input name="facnumber" type="hidden" value="provisoire">'; print '<table class="border" width="100%">'; // Reference - print '<tr><td>'.$langs->trans('Ref').'</td><td>Provisoire</td>'; - print '<td>'.$langs->trans('Comments').'</td></tr>'; + print '<tr><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans("Provisoire").'</td>'; + print '<td>'.$langs->trans('NotePublic').'</td></tr>'; // Reference client print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>'; @@ -514,6 +514,18 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '<tr><td>'.$langs->trans('Customer').'</td><td>'.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.'</td>'; print '</tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td>'; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$soc->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + + // Date print '<tr><td>'.$langs->trans('Date').'</td><td>'; $html->select_date('','re','','','',"crea_commande"); print '</td></tr>'; @@ -554,6 +566,8 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '</td></tr>'; // R�ductions relatives (Remises-Ristournes-Rabbais) +/* Une r�duction doit s'appliquer obligatoirement sur des lignes de factures + et non globalement $relative_discount=$soc->remise_client; print '<tr><td>'.$langs->trans("CustomerRelativeDiscount").'</td>'; print '<td>'; @@ -568,8 +582,10 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print $langs->trans("CompanyHasNoRelativeDiscount"); } print '</td></tr>'; +*/ // R�ductions (Remises-Ristournes-Rabbais) +/* Les remises absolues doivent s'appliquer par ajout de lignes sp�cialis�es $absolute_discount=$soc->getCurrentDiscount(); print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscount").'</td>'; print '<td>'; @@ -584,7 +600,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print $langs->trans("CompanyHasNoAbsoluteDiscount"); } print '</td></tr>'; - +*/ // Projet if ($conf->projet->enabled) @@ -601,7 +617,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '<tr><td>'.$langs->trans('Source').'</td><td>'; $html->selectSourcesCommande('','source_id',1); print '</td></tr>'; - print '<tr><td>Mod�le</td>'; + print '<tr><td>'.$langs->trans("Model").'</td>'; print '<td>'; // pdf include_once(DOL_DOCUMENT_ROOT.'/includes/modules/commande/modules_commande.php'); @@ -635,7 +651,10 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '<tr><td colspan="3">'; print '<table class="noborder">'; - print '<tr><td>'.$langs->trans('ProductsAndServices').'</td><td>'.$langs->trans('Qty').'</td><td>'.$langs->trans('Discount').'</td></tr>'; + print '<tr><td>'.$langs->trans('ProductsAndServices').'</td>'; + print '<td>'.$langs->trans('Qty').'</td>'; + print '<td>'.$langs->trans('ReductionShort').'</td>'; + print '</tr>'; for ($i = 1 ; $i <= $NBLINES ; $i++) { print '<tr><td>'; @@ -646,7 +665,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); print '</td>'; print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>'; - print '<td><input type="text" size="3" name="remise_percent'.$i.'" value="0">%</td></tr>'; + print '<td><input type="text" size="3" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td></tr>'; } print '</table>'; @@ -669,7 +688,10 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print_titre($langs->trans('Products')); print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Product').'</td>'; - print '<td align="right">'.$langs->trans('Price').'</td><td align="center">'.$langs->trans('Discount').'</td><td align="center">'.$langs->trans('Qty').'</td></tr>'; + print '<td align="right">'.$langs->trans('Price').'</td>'; + print '<td align="center">'.$langs->trans('Qty').'</td>'; + print '<td align="center">'.$langs->trans('Reductionshort').'</td>'; + print '</tr>'; $var=false; @@ -688,8 +710,8 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '<tr '.$bc[$var].'><td>['.$objp->ref.']</td>'; print '<td>'.img_object($langs->trans('ShowProduct'),'product').' '.$objp->product.'</td>'; print '<td align="right">'.price($objp->price).'</td>'; - print '<td align="center">'.$objp->remise_percent.'%</td>'; print '<td align="center">'.$objp->qty.'</td></tr>'; + print '<td align="center">'.$objp->remise_percent.'%</td>'; $i++; } } @@ -708,8 +730,8 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) print '<tr '.$bc[$var].'><td> </td>'; print '<td>'.img_object($langs->trans('ShowProduct'),'product').' '.$objp->product.'</td>'; print '<td align="right">'.price($objp->price).'</td>'; - print '<td align="center">'.$objp->remise_percent.'%</td>'; print '<td align="center">'.$objp->qty.'</td></tr>'; + print '<td align="center">'.$objp->remise_percent.'%</td>'; $i++; } } @@ -825,12 +847,24 @@ else print '</tr>'; - // Soci�t + // Soci�t� print '<tr><td>'.$langs->trans('Company').'</td>'; - print '<td colspan="2">'; + print '<td colspan="3">'; print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; print '</tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td colspan="3">'; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$soc->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + + // Date print '<tr><td>'.$langs->trans('Date').'</td>'; print '<td colspan="2">'.dolibarr_print_date($commande->date,'%A %d %B %Y').'</td>'; print '<td width="50%">'.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ; @@ -1014,7 +1048,7 @@ else print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; - print '<td align="right" width="50">'.$langs->trans('Discount').'</td>'; + print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>'; print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>'; print '<td> </td>'; print '<td> </td>'; @@ -1133,7 +1167,9 @@ else * Lignes de remise */ - // Remise relative + // R�ductions relatives (Remises-Ristournes-Rabbais) +/* Une r�duction doit s'appliquer obligatoirement sur des lignes de factures + et non globalement $var=!$var; print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="action" value="setremisepercent">'; @@ -1187,8 +1223,10 @@ else } print '</tr>'; print '</form>'; +*/ // Remise absolue +/* Les remises absolues doivent s'appliquer par ajout de lignes sp�cialis�es $var=!$var; print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="action" value="setremiseabsolue">'; @@ -1239,6 +1277,7 @@ else } print '</tr>'; print '</form>'; +*/ /* * Ajouter une ligne @@ -1250,7 +1289,7 @@ else print '<td align="right">'.$langs->trans('VAT').'</td>'; print '<td align="right">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; - print '<td align="right">'.$langs->trans('Discount').'</td>'; + print '<td align="right">'.$langs->trans('ReductionShort').'</td>'; print '<td> </td>'; print '<td> </td>'; print '<td> </td>'; @@ -1273,7 +1312,7 @@ else print '</td>'; print '<td align="right"><input type="text" name="pu" size="5"></td>'; print '<td align="right"><input type="text" name="qty" value="1" size="2"></td>'; - print '<td align="right" nowrap><input type="text" name="remise_percent" size="2" value="0">%</td>'; + print '<td align="right" nowrap><input type="text" name="remise_percent" size="1" value="'.$soc->remise_client.'">%</td>'; print '<td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'"></td>'; print '</tr>'; @@ -1297,7 +1336,7 @@ else print '</td>'; print '<td> </td>'; print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>'; - print '<td align="right" nowrap><input type="text" size="2" name="remise_percent" value="0">%</td>'; + print '<td align="right" nowrap><input type="text" size="1" name="remise_percent" value="'.$soc->remise_client.'">%</td>'; print '<td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'"></td>'; print '</tr>'; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index fcc63ac861e61b6028e071783b4a1733e71f37d1..c16703ba3ac839f9a9949b17f1cdbedb7b5c77e4 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -739,6 +739,17 @@ if ($_GET['action'] == 'create') print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">'.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.'</td>'; print '</tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td colspan="2">'; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$soc->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + // Date facture print '<tr><td>'.$langs->trans('Date').'</td><td colspan="2">'; $html->select_date('','','','','',"add"); @@ -754,7 +765,9 @@ if ($_GET['action'] == 'create') $html->select_types_paiements($mode_reglement_id,'mode_reglement_id'); print '</td></tr>'; - // R�ductions absolues (Remises-Ristournes-Rabbais) + // R�ductions relatives (Remises-Ristournes-Rabbais) +/* Une r�duction doit s'appliquer obligatoirement sur des lignes de factures + et non globalement print '<tr><td>'.$langs->trans("CustomerRelativeDiscount").'</td>'; print '<td>'; if (! $_GET['propalid'] && ! $_GET['commandeid'] && ! $_GET['contratid']) print '<input type="text" name="remise_percent" size="1" value="'; @@ -772,8 +785,10 @@ if ($_GET['action'] == 'create') print $langs->trans("CompanyHasNoRelativeDiscount"); } print '</td></tr>'; +*/ // R�ductions absolues (Remises-Ristournes-Rabbais) +/* Les remises absolues doivent s'appliquer par ajout de lignes sp�cialis�es print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscount").'</td>'; print '<td>'; if (! $_GET['propalid'] && ! $_GET['commandeid'] && ! $_GET['contratid']) print '<input type="text" name="remise_absolue" size="1" value="'; @@ -791,6 +806,7 @@ if ($_GET['action'] == 'create') print $langs->trans("CompanyHasNoAbsoluteDiscount"); } print '</td></tr>'; +*/ // Projet if ($conf->projet->enabled) @@ -857,8 +873,8 @@ if ($_GET['action'] == 'create') print '<input type="hidden" name="amount" value="'.$propal->price.'">'."\n"; print '<input type="hidden" name="total" value="'.$propal->total.'">'."\n"; print '<input type="hidden" name="tva" value="'.$propal->tva.'">'."\n"; - print '<input type="hidden" name="remise_absolue" value="'.$propal->remise_absolue.'">'."\n"; - print '<input type="hidden" name="remise_percent" value="'.$propal->remise_percent.'">'."\n"; +// print '<input type="hidden" name="remise_absolue" value="'.$propal->remise_absolue.'">'."\n"; +// print '<input type="hidden" name="remise_percent" value="'.$propal->remise_percent.'">'."\n"; print '<input type="hidden" name="propalid" value="'.$propal->id.'">'; print '<tr><td>'.$langs->trans('Proposal').'</td><td colspan="2">'.$propal->ref.'</td></tr>'; @@ -871,8 +887,8 @@ if ($_GET['action'] == 'create') print '<input type="hidden" name="amount" value="'.$commande->total_ht.'">'."\n"; print '<input type="hidden" name="total" value="'.$commande->total_ttc.'">'."\n"; print '<input type="hidden" name="tva" value="'.$commande->tva.'">'."\n"; - print '<input type="hidden" name="remise_absolue" value="'.$commande->remise_absolue.'">'."\n"; - print '<input type="hidden" name="remise_percent" value="'.$commande->remise_percent.'">'."\n"; +// print '<input type="hidden" name="remise_absolue" value="'.$commande->remise_absolue.'">'."\n"; +// print '<input type="hidden" name="remise_percent" value="'.$commande->remise_percent.'">'."\n"; print '<input type="hidden" name="commandeid" value="'.$commande->id.'">'; print '<tr><td>'.$langs->trans('Order').'</td><td colspan="2">'.$commande->ref.'</td></tr>'; @@ -890,8 +906,8 @@ if ($_GET['action'] == 'create') print '<input type="hidden" name="amount" value="'.$contrat->total_ht.'">'."\n"; print '<input type="hidden" name="total" value="'.$contrat->total_ttc.'">'."\n"; print '<input type="hidden" name="tva" value="'.$contrat->total_tva.'">'."\n"; - print '<input type="hidden" name="remise_absolue" value="'.$contrat->remise_absolue.'">'."\n"; - print '<input type="hidden" name="remise_percent" value="'.$contrat->remise_percent.'">'."\n"; +// print '<input type="hidden" name="remise_absolue" value="'.$contrat->remise_absolue.'">'."\n"; +// print '<input type="hidden" name="remise_percent" value="'.$contrat->remise_percent.'">'."\n"; print '<input type="hidden" name="contratid" value="'.$contrat->id.'">'; print '<tr><td>'.$langs->trans('Contract').'</td><td colspan="2">'.$contrat->ref.'</td></tr>'; @@ -905,7 +921,10 @@ if ($_GET['action'] == 'create') // Zone de choix des produits pr�d�finis � la cr�ation print '<table class="noborder">'; - print '<tr><td>'.$langs->trans('ProductsAndServices').'</td><td>'.$langs->trans('Qty').'</td><td>'.$langs->trans('Reduction').'</td><td> </td>'; + print '<tr><td>'.$langs->trans('ProductsAndServices').'</td>'; + print '<td>'.$langs->trans('Qty').'</td>'; + print '<td>'.$langs->trans('ReductionShort').'</td>'; + print '<td> </td>'; if ($conf->service->enabled) { print '<td>'.$langs->trans('ServiceLimitedDuration').'</td></tr>'; @@ -920,7 +939,7 @@ if ($_GET['action'] == 'create') $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); print '</td>'; print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>'; - print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="0">%</td>'; + print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>'; print '<td> </td>'; // Si le module service est actif, on propose des dates de d�but et fin � la ligne if ($conf->service->enabled) @@ -942,35 +961,38 @@ if ($_GET['action'] == 'create') /* * Factures r�currentes */ - if ($_GET['propalid'] == 0 && $_GET['commandeid'] == 0 && $_GET['contratid'] == 0) + if (! $conf->global->FACTURE_DISABLE_RECUR) { - $sql = 'SELECT r.rowid, r.titre, r.amount FROM '.MAIN_DB_PREFIX.'facture_rec as r'; - $sql .= ' WHERE r.fk_soc = '.$soc->id; - if ( $db->query($sql) ) + if ($_GET['propalid'] == 0 && $_GET['commandeid'] == 0 && $_GET['contratid'] == 0) { - $num = $db->num_rows(); - $i = 0; - - if ($num > 0) + $sql = 'SELECT r.rowid, r.titre, r.amount FROM '.MAIN_DB_PREFIX.'facture_rec as r'; + $sql .= ' WHERE r.fk_soc = '.$soc->id; + if ( $db->query($sql) ) { - print '<tr><td colspan="3">'.$langs->trans('RecurringBills').' : <select class="flat" name="fac_rec">'; - print '<option value="0" selected="true"></option>'; - while ($i < $num) + $num = $db->num_rows(); + $i = 0; + + if ($num > 0) { - $objp = $db->fetch_object(); - print '<option value="'.$objp->rowid.'">'.$objp->titre.' : '.$objp->amount.'</option>'; - $i++; + print '<tr><td colspan="3">'.$langs->trans('CreateFromRepeatableInvoice').' : <select class="flat" name="fac_rec">'; + print '<option value="0" selected="true"></option>'; + while ($i < $num) + { + $objp = $db->fetch_object(); + print '<option value="'.$objp->rowid.'">'.$objp->titre.' : '.$objp->amount.'</option>'; + $i++; + } + print '</select></td></tr>'; } - print '</select></td></tr>'; + $db->free(); + } + else + { + dolibarr_print_error($db); } - $db->free(); - } - else - { - dolibarr_print_error($db); } } - + // Bouton "Create Draft" print '<tr><td colspan="3" align="center"><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></td></tr>'; print "</table>\n"; @@ -990,7 +1012,7 @@ if ($_GET['action'] == 'create') print '<td align="right">'.$langs->trans('VAT').'</td>'; print '<td align="right">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; - print '<td align="right">'.$langs->trans('Reduction').'</td></tr>'; + print '<td align="right">'.$langs->trans('ReductionShort').'</td></tr>'; // Lignes de propal produits pr�d�finis $sql = 'SELECT pt.rowid, p.label as product, p.ref, pt.tva_tx, pt.price, pt.qty, p.rowid as prodid, pt.remise_percent, pt.description'; @@ -1070,7 +1092,7 @@ if ($_GET['action'] == 'create') print '<td align="right">'.$langs->trans('VAT').'</td>'; print '<td align="right">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; - print '<td align="right">'.$langs->trans('Reduction').'</td></tr>'; + print '<td align="right">'.$langs->trans('ReductionShort').'</td></tr>'; $sql = 'SELECT pt.rowid, pt.subprice, pt.tva_tx, pt.qty, pt.remise_percent, pt.description,'; $sql.= ' p.label as product, p.ref, p.rowid as prodid'; @@ -1153,7 +1175,7 @@ if ($_GET['action'] == 'create') print '<td align="right">'.$langs->trans('VAT').'</td>'; print '<td align="right">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; - print '<td align="right">'.$langs->trans('Reduction').'</td></tr>'; + print '<td align="right">'.$langs->trans('ReductionShort').'</td></tr>'; // Lignes de contrat produits pr�d�finis $sql = 'SELECT pt.rowid, pt.subprice, pt.tva_tx, pt.qty, pt.remise_percent, pt.description,'; @@ -1317,6 +1339,17 @@ else print '<a href="fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>'; print '</tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td colspan="5">'; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$soc->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + // Dates print '<tr><td>'.$langs->trans('Date').'</td>'; print '<td colspan="3">'.dolibarr_print_date($fac->date,'%A %d %B %Y').'</td>'; @@ -1555,7 +1588,7 @@ else print '<td align="right" width="50">'.$langs->trans('VAT').'</td>'; print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right" width="50">'.$langs->trans('Qty').'</td>'; - print '<td align="right" width="50">'.$langs->trans('Reduction').'</td>'; + print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>'; print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>'; print '<td width="16"> </td>'; print '<td width="16"> </td>'; @@ -1817,7 +1850,7 @@ else print '<td align="right">'.$langs->trans('VAT').'</td>'; print '<td align="right">'.$langs->trans('PriceUHT').'</td>'; print '<td align="right">'.$langs->trans('Qty').'</td>'; - print '<td align="right">'.$langs->trans('Reduction').'</td>'; + print '<td align="right">'.$langs->trans('ReductionShort').'</td>'; print '<td> </td>'; print '<td> </td>'; print '<td> </td>'; @@ -1906,7 +1939,7 @@ else print '<div class="tabsAction">'; // R�currente - if (! defined('FACTURE_DISABLE_RECUR') || FACTURE_DISABLE_RECUR == 0) // Possibilit� de d�sactiver les factures r�currentes + if (! $conf->global->FACTURE_DISABLE_RECUR) { print ' <a class="butAction" href="facture/fiche-rec.php?facid='.$fac->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>'; } diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index d591c1c8095c0bed3ad055bee91d6c1e94b6b347..ebc89e4a9646df1c75f447a5930334fd24109484 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -39,6 +39,7 @@ $user->getrights('propale'); if (!$user->rights->propale->lire) accessforbidden(); +$langs->load('companies'); $langs->load('compta'); @@ -193,6 +194,17 @@ if ($_GET["propalid"] > 0) print '<a href="'.$url.'">'.$societe->nom.'</a></td>'; print '</tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td colspan="5">'; + if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$societe->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + // Dates print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; print dolibarr_print_date($propal->date,'%a %d %B %Y'); @@ -448,7 +460,9 @@ if ($_GET["propalid"] > 0) * Lignes de remise */ - // Remise relative + // R�ductions relatives (Remises-Ristournes-Rabbais) +/* Une r�duction doit s'appliquer obligatoirement sur des lignes de factures + et non globalement $var=!$var; print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="action" value="setremisepercent">'; @@ -502,8 +516,10 @@ if ($_GET["propalid"] > 0) } print '</tr>'; print '</form>'; +*/ // Remise absolue +/* Les remises absolues doivent s'appliquer par ajout de lignes sp�cialis�es $var=!$var; print '<form name="updateligne" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<input type="hidden" name="action" value="setremiseabsolue">'; @@ -554,7 +570,7 @@ if ($_GET["propalid"] > 0) } print '</tr>'; print '</form>'; - +*/ print '</table>'; } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index cc33c1d69209bde40af95da86ced1463f745f923..0d80b4fb48f5a393331f0d9e23bd8a4774cadd0f 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -36,6 +36,7 @@ if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.cl $langs->load("contracts"); $langs->load("orders"); $langs->load("companies"); +$langs->load("bills"); $user->getrights('contrat'); $user->getrights('commercial'); @@ -248,6 +249,7 @@ if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer && $_POST if ($_POST["action"] == 'updateligne' && $user->rights->contrat->creer && $_POST["cancel"]) { Header("Location: fiche.php?id=".$_GET["id"]); + exit; } if ($_GET["action"] == 'deleteline' && $user->rights->contrat->creer) @@ -259,6 +261,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->contrat->creer) if ($result == 0) { Header("Location: fiche.php?id=".$contrat->id); + exit; } } @@ -339,6 +342,17 @@ if ($_GET["action"] == 'create') // Customer print '<tr><td>'.$langs->trans("Customer").'</td><td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$soc->id.'">'.$obj->nom.'</a></td></tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td>'; + if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$soc->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + // Commercial suivi print '<tr><td width="20%" nowrap>'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</td><td>'; print '<select name="commercial_suivi_id">'; @@ -425,8 +439,9 @@ if ($_GET["action"] == 'create') print '<table class="noborder" width="100%">'; print '<tr class="liste_titre"><td>'.$langs->trans("Ref").'</td><td>'.$langs->trans("Product").'</td>'; print '<td align="right">'.$langs->trans("Price").'</td>'; + print '<td align="center">'.$langs->trans("Qty").'</td>'; print '<td align="center">'.$langs->trans("ReductionShort").'</td>'; - print '<td align="center">'.$langs->trans("Qty").'</td></tr>'; + print '</tr>'; $sql = "SELECT pt.rowid, p.label as product, p.ref, pt.price, pt.qty, p.rowid as prodid, pt.remise_percent"; $sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pt, ".MAIN_DB_PREFIX."product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propalid"; @@ -443,9 +458,10 @@ if ($_GET["action"] == 'create') $var=!$var; print "<tr $bc[$var]><td>[$objp->ref]</td>\n"; print '<td>'.$objp->product.'</td>'; - print "<td align=\"right\">".price($objp->price)."</td>"; + print "<td align=\"right\">".price($objp->price).'</td>'; + print '<td align="center">'.$objp->qty.'</td>'; print '<td align="center">'.$objp->remise_percent.'%</td>'; - print "<td align=\"center\">".$objp->qty."</td></tr>\n"; + print "</tr>\n"; $i++; } } @@ -466,7 +482,8 @@ if ($_GET["action"] == 'create') print '<td>'.$objp->product.'</td>'; print '<td align="right">'.price($objp->price).'</td>'; print '<td align="center">'.$objp->remise_percent.'%</td>'; - print "<td align=\"center\">".$objp->qty."</td></tr>\n"; + print '<td align="center">'.$objp->qty.'</td>'; + print "</tr>\n"; $i++; } } @@ -574,6 +591,17 @@ else print '<td colspan="3">'; print '<b><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$contrat->societe->id.'">'.$contrat->societe->nom.'</a></b></td></tr>'; + // Ligne info remises tiers + print '<tr><td>'.$langs->trans('Info').'</td><td>'; + if ($contrat->societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$contrat->societe->remise_client); + else print $langs->trans("CompanyHasNoRelativeDiscount"); + $aboslute_discount=$contrat->societe->getCurrentDiscount(); + print '. '; + if ($aboslute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount); + else print $langs->trans("CompanyHasNoAbsoluteDiscount"); + print '.'; + print '</td></tr>'; + // Statut contrat print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; print $contrat->getLibStatut(2); @@ -793,8 +821,8 @@ else print '<td align="right">'; print $html->select_tva("eltva_tx",$objp->tva_tx,$mysoc,$contrat->societe); print '</td>'; - print '<td align="right"><input size="6" type="text" name="elprice" value="'.price($objp->subprice).'"></td>'; - print '<td align="center"><input size="3" type="text" name="elqty" value="'.$objp->qty.'"></td>'; + print '<td align="right"><input size="5" type="text" name="elprice" value="'.price($objp->subprice).'"></td>'; + print '<td align="center"><input size="2" type="text" name="elqty" value="'.$objp->qty.'"></td>'; print '<td align="right"><input size="1" type="text" name="elremise_percent" value="'.$objp->remise_percent.'">%</td>'; print '<td align="center" colspan="3" rowspan="2" valign="middle"><input type="submit" class="button" name="save" value="'.$langs->trans("Modify").'">'; print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; @@ -868,7 +896,7 @@ else print '</td>'; print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>'; - print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="0">%</td>'; + print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="'.$contrat->societe->remise_client.'">%</td>'; print '<td align="center" colspan="2" rowspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>'; print '</tr>'."\n"; @@ -899,7 +927,7 @@ else print '</td>'; print '<td align="right"><input type="text" class="flat" size="4" name="pu" value=""></td>'; print '<td align="center"><input type="text" class="flat" size="2" name="pqty" value="1"></td>'; - print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="0">%</td>'; + print '<td align="right" nowrap><input type="text" class="flat" size="1" name="premise" value="'.$contrat->societe->remise_client.'">%</td>'; print '<td align="center" rowspan="2" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>'; print '</tr>'."\n"; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 68eca56fc3fb1ee1ccb3f13b547d98ec708cf87a..ac4a75e37f6b6d6833322e79b0dc4bc4276c27c1 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -118,6 +118,7 @@ RepeatableInvoices=Repeatable invoices Repeatable=Repeatable ChangeIntoRepeatableInvoice=Change into repeatable CreateRepeatableInvoice=Create repeatable invoice +CreateFromRepeatableInvoice=Create from repeatable invoice ExportDataset_invoice_1=Customer invoices list and invoices' lines ProformaBill=Proforma Bill: Reduction=Reduction diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 06affbcc2e31ce289adb3289c2d8fa9aeb12025a..6341ab45e11bba1d36f59c6a9e702643515d2f88 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -118,6 +118,7 @@ RepeatableInvoices=Factures r Repeatable=R�currente ChangeIntoRepeatableInvoice=Modifier en r�currente CreateRepeatableInvoice=Cr�er facture r�currente +CreateFromRepeatableInvoice=Cr�er depuis facture r�currente ExportDataset_invoice_1=Factures clients et lignes de facture ProformaBill=Facture Proforma : Reduction=R�duction diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index c171fef0082bfc9e6f56d39a277474e48e773f65..60fbd7bcf0eba85f629859d1da6bd32f95cbf12f 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -73,15 +73,16 @@ CustomerCard=Fiche Client Customer=Client CustomerDiscount=Remise client CustomerRelativeDiscount=Remise globale relative -CustomerAbsoluteDiscount=Remise globale absolue +CustomerAbsoluteDiscount=Remise globale fixe CustomerRelativeDiscountShort=Remise relative -CustomerAbsoluteDiscountShort=Remise absolue +CustomerAbsoluteDiscountShort=Remise fixe CompanyHasRelativeDiscount=Ce client a une remise par d�faut de %s%% CompanyHasNoRelativeDiscount=Ce client n'a pas de remises par d�faut CompanyHasAbsoluteDiscount=Ce client a %s %s de remises disponibles -CompanyHasNoAbsoluteDiscount=Ce client n'a pas ou plus de remise disponibles +CompanyHasNoAbsoluteDiscount=Ce client n'a pas ou plus de remises fixes disponibles CustomerAbsoluteDiscountAllUsers=Remises en cours (accord�es par tout utilisateur) CustomerAbsoluteDiscountMy=Remises en cours (accord�es personnellement) +DefaultDiscount=Remise par d�faut DiscountNone=Aucune Supplier=Fournisseur CompanyList=Liste des soci�t�s