';
print '';
@@ -669,7 +688,10 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print_titre($langs->trans('Products'));
print '';
print ''.$langs->trans('Ref').' '.$langs->trans('Product').' ';
- print ''.$langs->trans('Price').' '.$langs->trans('Discount').' '.$langs->trans('Qty').' ';
+ print ''.$langs->trans('Price').' ';
+ print ''.$langs->trans('Qty').' ';
+ print ''.$langs->trans('Reductionshort').' ';
+ print '';
$var=false;
@@ -688,8 +710,8 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print '['.$objp->ref.'] ';
print ''.img_object($langs->trans('ShowProduct'),'product').' '.$objp->product.' ';
print ''.price($objp->price).' ';
- print ''.$objp->remise_percent.'% ';
print ''.$objp->qty.' ';
+ print ''.$objp->remise_percent.'% ';
$i++;
}
}
@@ -708,8 +730,8 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print ' ';
print ''.img_object($langs->trans('ShowProduct'),'product').' '.$objp->product.' ';
print ''.price($objp->price).' ';
- print ''.$objp->remise_percent.'% ';
print ''.$objp->qty.' ';
+ print ''.$objp->remise_percent.'% ';
$i++;
}
}
@@ -825,12 +847,24 @@ else
print '';
- // Sociét
+ // Société
print ''.$langs->trans('Company').' ';
- print '';
+ print ' ';
print ''.$soc->nom.' ';
print ' ';
+ // Ligne info remises tiers
+ print ''.$langs->trans('Info').' ';
+ 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 ' ';
+
+ // Date
print ''.$langs->trans('Date').' ';
print ''.dolibarr_print_date($commande->date,'%A %d %B %Y').' ';
print ''.$langs->trans('Source').' : ' . $commande->sources[$commande->source] ;
@@ -1014,7 +1048,7 @@ else
print ' '.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Discount').' ';
+ print ''.$langs->trans('ReductionShort').' ';
print ''.$langs->trans('AmountHT').' ';
print ' ';
print ' ';
@@ -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 ' ';
print '';
+*/
// Remise absolue
+/* Les remises absolues doivent s'appliquer par ajout de lignes spécialisées
$var=!$var;
print '';
+*/
/*
* Ajouter une ligne
@@ -1250,7 +1289,7 @@ else
print ''.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Discount').' ';
+ print ''.$langs->trans('ReductionShort').' ';
print ' ';
print ' ';
print ' ';
@@ -1273,7 +1312,7 @@ else
print '';
print ' ';
print ' ';
- print ' % ';
+ print ' % ';
print ' ';
print '';
@@ -1297,7 +1336,7 @@ else
print '';
print ' ';
print ' ';
- print ' % ';
+ print ' % ';
print ' ';
print '';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index fcc63ac861e..c16703ba3ac 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -739,6 +739,17 @@ if ($_GET['action'] == 'create')
print ''.$langs->trans('Company').' '.img_object($langs->trans("ShowCompany"),'company').' '.$soc->nom_url.' ';
print ' ';
+ // Ligne info remises tiers
+ print ''.$langs->trans('Info').' ';
+ 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 ' ';
+
// Date facture
print ''.$langs->trans('Date').' ';
$html->select_date('','','','','',"add");
@@ -754,7 +765,9 @@ if ($_GET['action'] == 'create')
$html->select_types_paiements($mode_reglement_id,'mode_reglement_id');
print ' ';
- // 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 ''.$langs->trans("CustomerRelativeDiscount").' ';
print '';
if (! $_GET['propalid'] && ! $_GET['commandeid'] && ! $_GET['contratid']) print ' ';
+*/
// Réductions absolues (Remises-Ristournes-Rabbais)
+/* Les remises absolues doivent s'appliquer par ajout de lignes spécialisées
print ''.$langs->trans("CustomerAbsoluteDiscount").' ';
print '';
if (! $_GET['propalid'] && ! $_GET['commandeid'] && ! $_GET['contratid']) print ' ';
+*/
// Projet
if ($conf->projet->enabled)
@@ -857,8 +873,8 @@ if ($_GET['action'] == 'create')
print ' '."\n";
print ' '."\n";
print ' '."\n";
- print ' '."\n";
- print ' '."\n";
+// print ' '."\n";
+// print ' '."\n";
print ' ';
print ''.$langs->trans('Proposal').' '.$propal->ref.' ';
@@ -871,8 +887,8 @@ if ($_GET['action'] == 'create')
print ' '."\n";
print ' '."\n";
print ' '."\n";
- print ' '."\n";
- print ' '."\n";
+// print ' '."\n";
+// print ' '."\n";
print ' ';
print ''.$langs->trans('Order').' '.$commande->ref.' ';
@@ -890,8 +906,8 @@ if ($_GET['action'] == 'create')
print ' '."\n";
print ' '."\n";
print ' '."\n";
- print ' '."\n";
- print ' '."\n";
+// print ' '."\n";
+// print ' '."\n";
print ' ';
print ''.$langs->trans('Contract').' '.$contrat->ref.' ';
@@ -905,7 +921,10 @@ if ($_GET['action'] == 'create')
// Zone de choix des produits prédéfinis à la création
print '';
- print ''.$langs->trans('ProductsAndServices').' '.$langs->trans('Qty').' '.$langs->trans('Reduction').' ';
+ print ''.$langs->trans('ProductsAndServices').' ';
+ print ''.$langs->trans('Qty').' ';
+ print ''.$langs->trans('ReductionShort').' ';
+ print ' ';
if ($conf->service->enabled)
{
print ''.$langs->trans('ServiceLimitedDuration').' ';
@@ -920,7 +939,7 @@ if ($_GET['action'] == 'create')
$html->select_produits('','idprod'.$i,'',$conf->produit->limit_size);
print '';
print ' ';
- print ' % ';
+ print ' % ';
print ' ';
// 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 ''.$langs->trans('RecurringBills').' : ';
- print ' ';
- while ($i < $num)
+ $num = $db->num_rows();
+ $i = 0;
+
+ if ($num > 0)
{
- $objp = $db->fetch_object();
- print ''.$objp->titre.' : '.$objp->amount.' ';
- $i++;
+ print ''.$langs->trans('CreateFromRepeatableInvoice').' : ';
+ print ' ';
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object();
+ print ''.$objp->titre.' : '.$objp->amount.' ';
+ $i++;
+ }
+ print ' ';
}
- print ' ';
+ $db->free();
+ }
+ else
+ {
+ dolibarr_print_error($db);
}
- $db->free();
- }
- else
- {
- dolibarr_print_error($db);
}
}
-
+
// Bouton "Create Draft"
print ' ';
print "
\n";
@@ -990,7 +1012,7 @@ if ($_GET['action'] == 'create')
print ''.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Reduction').' ';
+ print ''.$langs->trans('ReductionShort').' ';
// 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 ''.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Reduction').' ';
+ print ''.$langs->trans('ReductionShort').' ';
$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 ''.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Reduction').' ';
+ print ''.$langs->trans('ReductionShort').' ';
// 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 ''.$soc->nom.' ';
print '';
+ // Ligne info remises tiers
+ print ''.$langs->trans('Info').' ';
+ 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 ' ';
+
// Dates
print ''.$langs->trans('Date').' ';
print ''.dolibarr_print_date($fac->date,'%A %d %B %Y').' ';
@@ -1555,7 +1588,7 @@ else
print ''.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Reduction').' ';
+ print ''.$langs->trans('ReductionShort').' ';
print ''.$langs->trans('AmountHT').' ';
print ' ';
print ' ';
@@ -1817,7 +1850,7 @@ else
print ''.$langs->trans('VAT').' ';
print ''.$langs->trans('PriceUHT').' ';
print ''.$langs->trans('Qty').' ';
- print ''.$langs->trans('Reduction').' ';
+ print ''.$langs->trans('ReductionShort').' ';
print ' ';
print ' ';
print ' ';
@@ -1906,7 +1939,7 @@ else
print '';
// 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 '
'.$langs->trans("ChangeIntoRepeatableInvoice").' ';
}
diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php
index d591c1c8095..ebc89e4a964 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 '
'.$societe->nom.' ';
print '
';
+ // Ligne info remises tiers
+ print ''.$langs->trans('Info').' ';
+ 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 ' ';
+
// Dates
print ''.$langs->trans('Date').' ';
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 ' ';
print '';
+*/
// Remise absolue
+/* Les remises absolues doivent s'appliquer par ajout de lignes spécialisées
$var=!$var;
print '';
-
+*/
print '
';
}
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index cc33c1d6920..0d80b4fb48f 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 ' '.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").' ';
print '';
@@ -425,8 +439,9 @@ if ($_GET["action"] == 'create')
print '';
print ''.$langs->trans("Ref").' '.$langs->trans("Product").' ';
print ''.$langs->trans("Price").' ';
+ print ''.$langs->trans("Qty").' ';
print ''.$langs->trans("ReductionShort").' ';
- print ''.$langs->trans("Qty").' ';
+ print '';
$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 "[$objp->ref] \n";
print ''.$objp->product.' ';
- print "".price($objp->price)." ";
+ print "".price($objp->price).' ';
+ print ''.$objp->qty.' ';
print ''.$objp->remise_percent.'% ';
- print "".$objp->qty." \n";
+ print "\n";
$i++;
}
}
@@ -466,7 +482,8 @@ if ($_GET["action"] == 'create')
print ''.$objp->product.' ';
print ''.price($objp->price).' ';
print ''.$objp->remise_percent.'% ';
- print "".$objp->qty." \n";
+ print ''.$objp->qty.' ';
+ print "\n";
$i++;
}
}
@@ -574,6 +591,17 @@ else
print '';
print ''.$contrat->societe->nom.' ';
+ // Ligne info remises tiers
+ print ''.$langs->trans('Info').' ';
+ 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 ' ';
+
// Statut contrat
print ''.$langs->trans("Status").' ';
print $contrat->getLibStatut(2);
@@ -793,8 +821,8 @@ else
print ' ';
print $html->select_tva("eltva_tx",$objp->tva_tx,$mysoc,$contrat->societe);
print ' ';
- print ' ';
- print ' ';
+ print ' ';
+ print ' ';
print ' % ';
print ' ';
print ' ';
@@ -868,7 +896,7 @@ else
print ' ';
print ' ';
- print ' % ';
+ print ' % ';
print ' ';
print ' '."\n";
@@ -899,7 +927,7 @@ else
print '';
print ' ';
print ' ';
- print ' % ';
+ print ' % ';
print ' ';
print ''."\n";
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index 68eca56fc3f..ac4a75e37f6 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 06affbcc2e3..6341ab45e11 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 c171fef0082..60fbd7bcf0e 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