Fix: Deposits was not included into lines but into into remain to pay
This commit is contained in:
parent
3d01d77427
commit
bf9c482f8a
@ -359,7 +359,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v
|
|||||||
if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
|
if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->facture->valider) || $user->rights->facture->invoice_advance->unvalidate))
|
||||||
{
|
{
|
||||||
$idwarehouse=GETPOST('idwarehouse');
|
$idwarehouse=GETPOST('idwarehouse');
|
||||||
|
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
@ -380,13 +380,13 @@ if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS
|
|||||||
$sql = 'SELECT pf.amount';
|
$sql = 'SELECT pf.amount';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf';
|
||||||
$sql.= ' WHERE pf.fk_facture = '.$object->id;
|
$sql.= ' WHERE pf.fk_facture = '.$object->id;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
@ -398,17 +398,17 @@ if ($action == 'confirm_modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS
|
|||||||
{
|
{
|
||||||
dol_print_error($db,'');
|
dol_print_error($db,'');
|
||||||
}
|
}
|
||||||
|
|
||||||
$resteapayer = $object->total_ttc - $totalpaye;
|
$resteapayer = $object->total_ttc - $totalpaye;
|
||||||
|
|
||||||
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees
|
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees
|
||||||
$ventilExportCompta = $object->getVentilExportCompta();
|
$ventilExportCompta = $object->getVentilExportCompta();
|
||||||
|
|
||||||
// On verifie si aucun paiement n'a ete effectue
|
// On verifie si aucun paiement n'a ete effectue
|
||||||
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
|
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
|
||||||
{
|
{
|
||||||
$object->set_draft($user, $idwarehouse);
|
$object->set_draft($user, $idwarehouse);
|
||||||
|
|
||||||
// Define output language
|
// Define output language
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang='';
|
$newlang='';
|
||||||
@ -1937,8 +1937,13 @@ else
|
|||||||
if ($object->paye) $resteapayer=0;
|
if ($object->paye) $resteapayer=0;
|
||||||
$resteapayeraffiche=$resteapayer;
|
$resteapayeraffiche=$resteapayer;
|
||||||
|
|
||||||
$absolute_discount=$soc->getAvailableDiscounts('','fk_facture_source IS NULL');
|
//$filterabsolutediscount="fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||||
$absolute_creditnote=$soc->getAvailableDiscounts('','fk_facture_source IS NOT NULL');
|
//$filtercreditnote="fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||||
|
$filterabsolutediscount="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')";
|
||||||
|
$filtercreditnote="fk_facture_source IS NOT NULL AND description <> '(DEPOSIT)'";
|
||||||
|
|
||||||
|
$absolute_discount=$soc->getAvailableDiscounts('',$filterabsolutediscount);
|
||||||
|
$absolute_creditnote=$soc->getAvailableDiscounts('',$filtercreditnote);
|
||||||
$absolute_discount=price2num($absolute_discount,'MT');
|
$absolute_discount=price2num($absolute_discount,'MT');
|
||||||
$absolute_creditnote=price2num($absolute_creditnote,'MT');
|
$absolute_creditnote=price2num($absolute_creditnote,'MT');
|
||||||
|
|
||||||
@ -2259,9 +2264,8 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Remise dispo de type remise fixe (not credit note)
|
// Remise dispo de type remise fixe (not credit note)
|
||||||
$filter='fk_facture_source IS NULL';
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, GETPOST('discountid'), 'remise_id', $soc->id, $absolute_discount, $filter, $resteapayer, ' ('.$addabsolutediscount.')');
|
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, GETPOST('discountid'), 'remise_id', $soc->id, $absolute_discount, $filterabsolutediscount, $resteapayer, ' ('.$addabsolutediscount.')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2291,9 +2295,8 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Remise dispo de type avoir
|
// Remise dispo de type avoir
|
||||||
$filter='fk_facture_source IS NOT NULL';
|
|
||||||
if (! $absolute_discount) print '<br>';
|
if (! $absolute_discount) print '<br>';
|
||||||
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filter, $resteapayer);
|
$form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! $absolute_discount && ! $absolute_creditnote)
|
if (! $absolute_discount && ! $absolute_creditnote)
|
||||||
|
|||||||
@ -89,13 +89,12 @@ else
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid AND s.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid)
|
if (!$user->rights->societe->client->voir && !$socid)
|
||||||
{
|
{
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
|
||||||
}
|
}
|
||||||
$sql.= " WHERE p.fk_paiement = c.id";
|
$sql.= " WHERE p.fk_paiement = c.id";
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
|
||||||
if (!$user->rights->societe->client->voir && !$socid)
|
if (!$user->rights->societe->client->voir && !$socid)
|
||||||
{
|
{
|
||||||
$sql.= " AND sc.fk_user = " .$user->id;
|
$sql.= " AND sc.fk_user = " .$user->id;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ accessforbidden();
|
|||||||
|
|
||||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
||||||
$modecompta = $conf->global->COMPTA_MODE;
|
$modecompta = $conf->global->COMPTA_MODE;
|
||||||
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta");
|
||||||
|
|
||||||
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||||
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||||
@ -121,7 +121,10 @@ else {
|
|||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
}
|
}
|
||||||
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
$moreparam=array();
|
||||||
|
if (! empty($modecompta)) $moreparam['modecompta']=$modecompta;
|
||||||
|
|
||||||
|
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam);
|
||||||
|
|
||||||
|
|
||||||
// Charge tableau
|
// Charge tableau
|
||||||
@ -136,7 +139,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
|||||||
$sql.= " f.type = 0"; // Standard
|
$sql.= " f.type = 0"; // Standard
|
||||||
$sql.= " OR f.type = 1"; // Replacement
|
$sql.= " OR f.type = 1"; // Replacement
|
||||||
$sql.= " OR f.type = 2"; // Credit note
|
$sql.= " OR f.type = 2"; // Credit note
|
||||||
//$sql.= " OR f.type = 3"; // We do not include deposit
|
$sql.= " OR f.type = 3"; // Deposit
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ $langs->load("companies");
|
|||||||
|
|
||||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
||||||
$modecompta = $conf->global->COMPTA_MODE;
|
$modecompta = $conf->global->COMPTA_MODE;
|
||||||
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta");
|
||||||
|
|
||||||
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
$sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"];
|
||||||
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
$sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"];
|
||||||
@ -124,7 +124,9 @@ else {
|
|||||||
$builddate=time();
|
$builddate=time();
|
||||||
//$exportlink=$langs->trans("NotYetAvailable");
|
//$exportlink=$langs->trans("NotYetAvailable");
|
||||||
}
|
}
|
||||||
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
|
$moreparam=array();
|
||||||
|
if (! empty($modecompta)) $moreparam['modecompta']=$modecompta;
|
||||||
|
report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,$moreparam);
|
||||||
|
|
||||||
|
|
||||||
// Charge tableau
|
// Charge tableau
|
||||||
@ -139,7 +141,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
|||||||
$sql.= " f.type = 0"; // Standard
|
$sql.= " f.type = 0"; // Standard
|
||||||
$sql.= " OR f.type = 1"; // Replacement
|
$sql.= " OR f.type = 1"; // Replacement
|
||||||
$sql.= " OR f.type = 2"; // Credit note
|
$sql.= " OR f.type = 2"; // Credit note
|
||||||
//$sql.= " OR f.type = 3"; // We do not include deposit
|
$sql.= " OR f.type = 3"; // Deposit
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " AND f.fk_soc = s.rowid";
|
$sql.= " AND f.fk_soc = s.rowid";
|
||||||
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||||
|
|||||||
@ -87,7 +87,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
|||||||
$sql.= " f.type = 0"; // Standard
|
$sql.= " f.type = 0"; // Standard
|
||||||
$sql.= " OR f.type = 1"; // Replacement
|
$sql.= " OR f.type = 1"; // Replacement
|
||||||
$sql.= " OR f.type = 2"; // Credit note
|
$sql.= " OR f.type = 2"; // Credit note
|
||||||
//$sql.= " OR f.type = 3"; // We do not include deposit
|
$sql.= " OR f.type = 3"; // Deposit
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@ -221,7 +221,7 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
|
|||||||
if ($cum[$case])
|
if ($cum[$case])
|
||||||
{
|
{
|
||||||
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
$now_show_delta=1; // On a trouve le premier mois de la premiere annee generant du chiffre.
|
||||||
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.'">'.price($cum[$case],1).'</a>';
|
print '<a href="casoc.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price($cum[$case],1).'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2023,6 +2023,7 @@ abstract class CommonObject
|
|||||||
* TODO Move this into an output class file (htmlline.class.php)
|
* TODO Move this into an output class file (htmlline.class.php)
|
||||||
* If lines are into a template, title must also be into a template
|
* If lines are into a template, title must also be into a template
|
||||||
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
|
||||||
|
*
|
||||||
* @param $action GET/POST action
|
* @param $action GET/POST action
|
||||||
* @param $line Selected object line to output
|
* @param $line Selected object line to output
|
||||||
* @param $var Is it a an odd line
|
* @param $var Is it a an odd line
|
||||||
|
|||||||
@ -352,7 +352,7 @@ class DiscountAbsolute
|
|||||||
$sql.= " WHERE (rc.fk_facture IS NULL AND rc.fk_facture_line IS NULL)"; // Available
|
$sql.= " WHERE (rc.fk_facture IS NULL AND rc.fk_facture_line IS NULL)"; // Available
|
||||||
if (is_object($company)) $sql.= " AND rc.fk_soc = ".$company->id;
|
if (is_object($company)) $sql.= " AND rc.fk_soc = ".$company->id;
|
||||||
if (is_object($user)) $sql.= " AND rc.fk_user = ".$user->id;
|
if (is_object($user)) $sql.= " AND rc.fk_user = ".$user->id;
|
||||||
if ($filter) $sql.=' AND '.$filter;
|
if ($filter) $sql.=' AND ('.$filter.')';
|
||||||
if ($maxvalue) $sql.=' AND rc.amount_ttc <= '.price2num($maxvalue);
|
if ($maxvalue) $sql.=' AND rc.amount_ttc <= '.price2num($maxvalue);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::getAvailableDiscounts sql=".$sql,LOG_DEBUG);
|
dol_syslog(get_class($this)."::getAvailableDiscounts sql=".$sql,LOG_DEBUG);
|
||||||
|
|||||||
@ -2710,7 +2710,7 @@ class Form
|
|||||||
* @param float $amount Total amount available
|
* @param float $amount Total amount available
|
||||||
* @param string $filter SQL filter on discounts
|
* @param string $filter SQL filter on discounts
|
||||||
* @param int $maxvalue Max value for lines that can be selected
|
* @param int $maxvalue Max value for lines that can be selected
|
||||||
* @param string $more More string to add
|
* @param string $more More string to add
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $amount, $filter='', $maxvalue=0, $more='')
|
function form_remise_dispo($page, $selected='', $htmlname='remise_id',$socid, $amount, $filter='', $maxvalue=0, $more='')
|
||||||
@ -2723,19 +2723,19 @@ class Form
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td nowrap="nowrap">';
|
print '<tr><td nowrap="nowrap">';
|
||||||
if (! $filter || $filter=='fk_facture_source IS NULL') print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
//if (! $filter || $filter=="fk_facture_source IS NULL") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': '; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||||
|
if (! $filter || $filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print $langs->trans("CompanyHasAbsoluteDiscount",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
||||||
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
else print $langs->trans("CompanyHasCreditNote",price($amount),$langs->transnoentities("Currency".$conf->monnaie)).': ';
|
||||||
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
$newfilter='fk_facture IS NULL AND fk_facture_line IS NULL'; // Remises disponibles
|
||||||
if ($filter) $newfilter.=' AND '.$filter;
|
if ($filter) $newfilter.=' AND ('.$filter.')';
|
||||||
$nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue);
|
$nbqualifiedlines=$this->select_remises($selected,$htmlname,$newfilter,$socid,$maxvalue);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($nbqualifiedlines > 0)
|
if ($nbqualifiedlines > 0)
|
||||||
{
|
{
|
||||||
print ' <input type="submit" class="button" value="';
|
print ' <input type="submit" class="button" value="'.$langs->trans("UseLine").'"';
|
||||||
if (! $filter || $filter=='fk_facture_source IS NULL') print $langs->trans("UseDiscount");
|
if ($filter && $filter != "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND description='(DEPOSIT)')") print '" title="'.$langs->trans("UseCreditNoteInInvoicePayment");
|
||||||
else print $langs->trans("UseCredit");
|
print '">';
|
||||||
print '" title="'.$langs->trans("UseCreditNoteInInvoicePayment").'">';
|
|
||||||
}
|
}
|
||||||
if ($more) print $more;
|
if ($more) print $more;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -748,6 +748,14 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
|||||||
$discount->fetch($object->lines[$i]->fk_remise_except);
|
$discount->fetch($object->lines[$i]->fk_remise_except);
|
||||||
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromCreditNote",$discount->ref_facture_source);
|
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromCreditNote",$discount->ref_facture_source);
|
||||||
}
|
}
|
||||||
|
elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except)
|
||||||
|
{
|
||||||
|
$discount=new DiscountAbsolute($db);
|
||||||
|
$discount->fetch($object->lines[$i]->fk_remise_except);
|
||||||
|
$libelleproduitservice=$outputlangs->transnoentities("DiscountFromDeposit",$discount->ref_facture_source);
|
||||||
|
// Add date of deposit
|
||||||
|
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec,'day','',$outputlangs).')';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($idprod)
|
if ($idprod)
|
||||||
|
|||||||
@ -24,15 +24,17 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Show header of a VAT report
|
* Show header of a VAT report
|
||||||
* @param nom Name of report
|
*
|
||||||
* @param variante Link for alternate report
|
* @param $nom Name of report
|
||||||
* @param period Period of report
|
* @param $variante Link for alternate report
|
||||||
* @param periodlink Link to switch period
|
* @param $period Period of report
|
||||||
* @param description Description
|
* @param $periodlink Link to switch period
|
||||||
* @param builddate Date generation
|
* @param $description Description
|
||||||
* @param exportlink Link for export or ''
|
* @param $builddate Date generation
|
||||||
|
* @param $exportlink Link for export or ''
|
||||||
|
* @param $moreparam Array with list of params to add into form
|
||||||
*/
|
*/
|
||||||
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='')
|
function report_header($nom,$variante='',$period,$periodlink,$description,$builddate,$exportlink='',$moreparam=array())
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -44,6 +46,10 @@ function report_header($nom,$variante='',$period,$periodlink,$description,$build
|
|||||||
dol_fiche_head($head, $hselected, $societe->nom);
|
dol_fiche_head($head, $hselected, $societe->nom);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
foreach($moreparam as $key => $value)
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
|
||||||
|
}
|
||||||
print '<table width="100%" class="border">';
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
// Ligne de titre
|
// Ligne de titre
|
||||||
|
|||||||
@ -23,29 +23,47 @@
|
|||||||
<td><a name="<?php echo $line->rowid; ?>"></a>
|
<td><a name="<?php echo $line->rowid; ?>"></a>
|
||||||
<?php if (($line->info_bits & 2) == 2) { ?>
|
<?php if (($line->info_bits & 2) == 2) { ?>
|
||||||
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
|
<a href="<?php echo DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid; ?>">
|
||||||
<?php echo img_object($langs->trans("ShowReduc"),'reduc').' '.$langs->trans("Discount"); ?>
|
<?php
|
||||||
|
$txt='';
|
||||||
|
print img_object($langs->trans("ShowReduc"),'reduc').' ';
|
||||||
|
if ($line->description == '(DEPOSIT)') $txt=$langs->trans("Deposit");
|
||||||
|
//else $txt=$langs->trans("Discount");
|
||||||
|
print $txt;
|
||||||
|
?>
|
||||||
</a>
|
</a>
|
||||||
<?php if ($line->description) {
|
<?php
|
||||||
if ($line->description == '(CREDIT_NOTE)') {
|
if ($line->description)
|
||||||
|
{
|
||||||
|
if ($line->description == '(CREDIT_NOTE)')
|
||||||
|
{
|
||||||
$discount=new DiscountAbsolute($this->db);
|
$discount=new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ' - '.$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromCreditNote",$discount->getNomUrl(0));
|
||||||
} elseif ($line->description == '(DEPOSIT)') {
|
}
|
||||||
|
elseif ($line->description == '(DEPOSIT)')
|
||||||
|
{
|
||||||
$discount=new DiscountAbsolute($this->db);
|
$discount=new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ' - '.$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
|
echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0));
|
||||||
} else {
|
// Add date of deposit
|
||||||
echo ' - '.dol_htmlentitiesbr($line->description,1,true);
|
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo ($txt?' - ':'').dol_htmlentitiesbr($line->description,1,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
|
if (! empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
|
||||||
if ($type==1) $text = img_object($langs->trans('Service'),'service');
|
if ($type==1) $text = img_object($langs->trans('Service'),'service');
|
||||||
else $text = img_object($langs->trans('Product'),'product');
|
else $text = img_object($langs->trans('Product'),'product');
|
||||||
echo $text.' '.dol_htmlentitiesbr($line->description,1,true);
|
echo $text.' '.dol_htmlentitiesbr($line->description,1,true);
|
||||||
// Show range
|
// Show range
|
||||||
print_date_range($line->date_start,$line->date_end);
|
print_date_range($line->date_start,$line->date_end);
|
||||||
} ?>
|
}
|
||||||
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
|
<td align="right" nowrap="nowrap"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></td>
|
||||||
|
|||||||
@ -100,7 +100,7 @@ BillStatus=Invoice status
|
|||||||
BillStatusDraft=Draft (needs to be validated)
|
BillStatusDraft=Draft (needs to be validated)
|
||||||
BillStatusPaid=Paid
|
BillStatusPaid=Paid
|
||||||
BillStatusPaidBackOrConverted=Paid or converted into discount
|
BillStatusPaidBackOrConverted=Paid or converted into discount
|
||||||
BillStatusConverted=Converted into discount
|
BillStatusConverted=Paid (ready for final invoice)
|
||||||
BillStatusCanceled=Abandoned
|
BillStatusCanceled=Abandoned
|
||||||
BillStatusValidated=Validated (needs to be paid)
|
BillStatusValidated=Validated (needs to be paid)
|
||||||
BillStatusStarted=Started
|
BillStatusStarted=Started
|
||||||
|
|||||||
@ -208,8 +208,8 @@ CustomerRelativeDiscountShort=Relative discount
|
|||||||
CustomerAbsoluteDiscountShort=Absolute discount
|
CustomerAbsoluteDiscountShort=Absolute discount
|
||||||
CompanyHasRelativeDiscount=This customer has a default discount of <b>%s%%</b>
|
CompanyHasRelativeDiscount=This customer has a default discount of <b>%s%%</b>
|
||||||
CompanyHasNoRelativeDiscount=This customer has no relative discount by default
|
CompanyHasNoRelativeDiscount=This customer has no relative discount by default
|
||||||
CompanyHasAbsoluteDiscount=This customer still has discount credits for <b>%s %s</b>
|
CompanyHasAbsoluteDiscount=This customer still has discount credits or deposits for <b>%s %s</b>
|
||||||
CompanyHasCreditNote=This customer still has credit notes or previous deposits for <b>%s %s</b>
|
CompanyHasCreditNote=This customer still has credit notes for <b>%s %s</b>
|
||||||
CompanyHasNoAbsoluteDiscount=This customer has no discount credit available
|
CompanyHasNoAbsoluteDiscount=This customer has no discount credit available
|
||||||
CustomerAbsoluteDiscountAllUsers=Absolute discounts (granted by all users)
|
CustomerAbsoluteDiscountAllUsers=Absolute discounts (granted by all users)
|
||||||
CustomerAbsoluteDiscountMy=Absolute discounts (granted by yourself)
|
CustomerAbsoluteDiscountMy=Absolute discounts (granted by yourself)
|
||||||
|
|||||||
@ -96,7 +96,7 @@ BillStatus=État de la facture
|
|||||||
BillStatusDraft=Brouillon (à valider)
|
BillStatusDraft=Brouillon (à valider)
|
||||||
BillStatusPaid=Payée
|
BillStatusPaid=Payée
|
||||||
BillStatusPaidBackOrConverted=Remboursé ou converti en réduction
|
BillStatusPaidBackOrConverted=Remboursé ou converti en réduction
|
||||||
BillStatusConverted=Converti en réduction
|
BillStatusConverted=Payée (prêt pour facture final)
|
||||||
BillStatusCanceled=Abandonnée
|
BillStatusCanceled=Abandonnée
|
||||||
BillStatusValidated=Validée (à payer)
|
BillStatusValidated=Validée (à payer)
|
||||||
BillStatusStarted=Règlement commencé
|
BillStatusStarted=Règlement commencé
|
||||||
@ -231,14 +231,15 @@ ReductionsShort=Réduc.
|
|||||||
Discount=Remise
|
Discount=Remise
|
||||||
Discounts=Remises
|
Discounts=Remises
|
||||||
ShowDiscount=Visualiser l'avoir
|
ShowDiscount=Visualiser l'avoir
|
||||||
|
ShowReduc=Visualiser la déduction
|
||||||
RelativeDiscount=Remise relative
|
RelativeDiscount=Remise relative
|
||||||
GlobalDiscount=Remise fixe
|
GlobalDiscount=Ligne de déduction
|
||||||
CreditNote=Avoir
|
CreditNote=Avoir
|
||||||
CreditNotes=Avoirs
|
CreditNotes=Avoirs
|
||||||
AddDiscount=Editer remises
|
AddDiscount=Editer remises
|
||||||
AddRelativeDiscount=Créer remise relative
|
AddRelativeDiscount=Créer remise relative
|
||||||
EditRelativeDiscount=Editer remise relative
|
EditRelativeDiscount=Editer remise relative
|
||||||
AddGlobalDiscount=Créer remise fixe
|
AddGlobalDiscount=Créer ligne de déduction
|
||||||
EditGlobalDiscounts=Editer remises fixes
|
EditGlobalDiscounts=Editer remises fixes
|
||||||
AddCreditNote=Créer facture avoir
|
AddCreditNote=Créer facture avoir
|
||||||
Deposit=Acompte
|
Deposit=Acompte
|
||||||
@ -247,7 +248,7 @@ DiscountFromCreditNote=Remise issue de l'avoir %s
|
|||||||
DiscountFromDeposit=Paiements issue de l'acompte %s
|
DiscountFromDeposit=Paiements issue de l'acompte %s
|
||||||
AbsoluteDiscountUse=Ce type de crédit ne peut s'utiliser que sur une facture non validée
|
AbsoluteDiscountUse=Ce type de crédit ne peut s'utiliser que sur une facture non validée
|
||||||
CreditNoteDepositUse=La facture doit être validée pour pouvoir utiliser ce type de crédit
|
CreditNoteDepositUse=La facture doit être validée pour pouvoir utiliser ce type de crédit
|
||||||
NewGlobalDiscount=Nouvelle remise fixe
|
NewGlobalDiscount=Nouvelle ligne de déduction
|
||||||
NewRelativeDiscount=Nouvelle remise relative
|
NewRelativeDiscount=Nouvelle remise relative
|
||||||
NoteReason=Note/Motif
|
NoteReason=Note/Motif
|
||||||
ReasonDiscount=Motif
|
ReasonDiscount=Motif
|
||||||
@ -344,6 +345,7 @@ LawApplicationPart2=les marchandises demeurent la propriété du
|
|||||||
LawApplicationPart3=vendeur jusqu'à complet encaissement de
|
LawApplicationPart3=vendeur jusqu'à complet encaissement de
|
||||||
LawApplicationPart4=leurs prix.
|
LawApplicationPart4=leurs prix.
|
||||||
LimitedLiabilityCompanyCapital=SARL au Capital de
|
LimitedLiabilityCompanyCapital=SARL au Capital de
|
||||||
|
UseLine=Appliquer
|
||||||
UseDiscount=Appliquer remise
|
UseDiscount=Appliquer remise
|
||||||
UseCredit=Utiliser crédit
|
UseCredit=Utiliser crédit
|
||||||
UseCreditNoteInInvoicePayment=Réduire le montant du reste à payer avec ce crédit
|
UseCreditNoteInInvoicePayment=Réduire le montant du reste à payer avec ce crédit
|
||||||
|
|||||||
@ -210,8 +210,8 @@ CustomerRelativeDiscountShort=Remise relative
|
|||||||
CustomerAbsoluteDiscountShort=Remise fixe
|
CustomerAbsoluteDiscountShort=Remise fixe
|
||||||
CompanyHasRelativeDiscount=Ce client a une remise par défaut de <b>%s%%</b>
|
CompanyHasRelativeDiscount=Ce client a une remise par défaut de <b>%s%%</b>
|
||||||
CompanyHasNoRelativeDiscount=Ce client n'a pas de remise relative par défaut
|
CompanyHasNoRelativeDiscount=Ce client n'a pas de remise relative par défaut
|
||||||
CompanyHasAbsoluteDiscount=Ce client a <b>%s %s</b> de remises fixes disponibles
|
CompanyHasAbsoluteDiscount=Ce client a <b>%s %s</b> de lignes de déduction disponibles (remises, acomptes...)
|
||||||
CompanyHasCreditNote=Ce client a <b>%s %s</b> d'avoirs/acomptes disponibles
|
CompanyHasCreditNote=Ce client a <b>%s %s</b> d'avoirs disponibles
|
||||||
CompanyHasNoAbsoluteDiscount=Ce client n'a pas ou plus de remise fixe disponible
|
CompanyHasNoAbsoluteDiscount=Ce client n'a pas ou plus de remise fixe disponible
|
||||||
CustomerAbsoluteDiscountAllUsers=Remises fixes en cours (accordées par tout utilisateur)
|
CustomerAbsoluteDiscountAllUsers=Remises fixes en cours (accordées par tout utilisateur)
|
||||||
CustomerAbsoluteDiscountMy=Remises fixes en cours (accordées personnellement)
|
CustomerAbsoluteDiscountMy=Remises fixes en cours (accordées personnellement)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user