Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
f0d458682d
@ -666,7 +666,7 @@ if ($object->id > 0)
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last proposals
|
* Latest proposals
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||||
{
|
{
|
||||||
@ -738,7 +738,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last orders
|
* Latest orders
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||||
{
|
{
|
||||||
@ -824,7 +824,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last shipments
|
* Latest shipments
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire)
|
if (!empty($conf->expedition->enabled) && $user->rights->expedition->lire)
|
||||||
{
|
{
|
||||||
@ -897,7 +897,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last linked contracts
|
* Latest linked contracts
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||||
{
|
{
|
||||||
@ -967,7 +967,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last interventions
|
* Latest interventions
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
|
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
|
||||||
{
|
{
|
||||||
@ -1028,7 +1028,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last invoices templates
|
* Latest invoices templates
|
||||||
*/
|
*/
|
||||||
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
@ -1063,7 +1063,7 @@ if ($object->id > 0)
|
|||||||
print '<table class="noborder centpercent lastrecordtable">';
|
print '<table class="noborder centpercent lastrecordtable">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LatestCustomerTemplateInvoices", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->id.'">'.$langs->trans("AllCustomerTemplateInvoices").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LatestCustomerTemplateInvoices", ($num <= $MAXLIST ? "" : $MAXLIST)).'</td><td class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/facture/invoicetemplate_list.php?socid='.$object->id.'">'.$langs->trans("AllCustomerTemplateInvoices").'<span class="badge marginleftonlyshort">'.$num.'</span></a></td>';
|
||||||
print '</tr></table></td>';
|
print '</tr></table></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,10 +33,7 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
if (!empty($conf->projet->enabled)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
//require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
|
|
||||||
}
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||||
@ -54,6 +51,8 @@ $cancel = GETPOST('cancel', 'alpha');
|
|||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search
|
||||||
|
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
|
$id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
@ -62,7 +61,6 @@ if ($user->socid) $socid = $user->socid;
|
|||||||
$objecttype = 'facture_rec';
|
$objecttype = 'facture_rec';
|
||||||
if ($action == "create" || $action == "add") $objecttype = '';
|
if ($action == "create" || $action == "add") $objecttype = '';
|
||||||
$result = restrictedArea($user, 'facture', $id, $objecttype);
|
$result = restrictedArea($user, 'facture', $id, $objecttype);
|
||||||
$projectid = GETPOST('projectid', 'int');
|
|
||||||
|
|
||||||
$search_ref = GETPOST('search_ref');
|
$search_ref = GETPOST('search_ref');
|
||||||
$search_societe = GETPOST('search_societe');
|
$search_societe = GETPOST('search_societe');
|
||||||
@ -146,6 +144,13 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
|
|||||||
$object->fields = dol_sort_array($object->fields, 'position');
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
|
if ($socid > 0) {
|
||||||
|
$tmpthirdparty = new Societe($db);
|
||||||
|
$res = $tmpthirdparty->fetch($socid);
|
||||||
|
if ($res > 0) $search_societe = $tmpthirdparty->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -218,6 +223,7 @@ $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['
|
|||||||
/*
|
/*
|
||||||
* List mode
|
* List mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,";
|
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total, f.tva as total_vat, f.total_ttc, f.frequency, f.unit_frequency,";
|
||||||
$sql .= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
|
$sql .= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
|
||||||
$sql .= " f.datec, f.tms,";
|
$sql .= " f.datec, f.tms,";
|
||||||
@ -243,6 +249,7 @@ if (!$user->rights->societe->client->voir && !$socid) {
|
|||||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
}
|
}
|
||||||
if ($search_ref) $sql .= natural_search('f.titre', $search_ref);
|
if ($search_ref) $sql .= natural_search('f.titre', $search_ref);
|
||||||
|
if ($socid) $sql .= ' AND s.rowid = '.(int) $socid;
|
||||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||||
if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1);
|
if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1);
|
||||||
if ($search_montant_vat != '') $sql .= natural_search('f.tva', $search_montant_vat, 1);
|
if ($search_montant_vat != '') $sql .= natural_search('f.tva', $search_montant_vat, 1);
|
||||||
@ -286,7 +293,7 @@ if ($resql)
|
|||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
if ($socid) $param .= '&socid='.urlencode($socid);
|
if ($socid > 0) $param .= '&socid='.urlencode($socid);
|
||||||
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
if ($search_day) $param .= '&search_day='.urlencode($search_day);
|
||||||
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
if ($search_month) $param .= '&search_month='.urlencode($search_month);
|
||||||
if ($search_year) $param .= '&search_year='.urlencode($search_year);
|
if ($search_year) $param .= '&search_year='.urlencode($search_year);
|
||||||
@ -299,12 +306,11 @@ if ($resql)
|
|||||||
if ($search_montant_vat != '') $param .= '&search_montant_vat='.urlencode($search_montant_vat);
|
if ($search_montant_vat != '') $param .= '&search_montant_vat='.urlencode($search_montant_vat);
|
||||||
if ($search_montant_ttc != '') $param .= '&search_montant_ttc='.urlencode($search_montant_ttc);
|
if ($search_montant_ttc != '') $param .= '&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||||
if ($search_payment_mode != '') $param .= '&search_payment_mode='.urlencode($search_payment_mode);
|
if ($search_payment_mode != '') $param .= '&search_payment_mode='.urlencode($search_payment_mode);
|
||||||
if ($search_payment_type != '') $param .= '&search_payment_type='.urlencode($search_payment_type);
|
if ($search_payment_term != '') $param .= '&search_payment_term='.urlencode($search_payment_term);
|
||||||
if ($search_recurring != '' && $search_recurrning != '-1') $param .= '&search_recurring='.urlencode($search_recurring);
|
if ($search_recurring != '' && $search_recurrning != '-1') $param .= '&search_recurring='.urlencode($search_recurring);
|
||||||
if ($search_frequency > 0) $param .= '&search_frequency='.urlencode($search_frequency);
|
if ($search_frequency > 0) $param .= '&search_frequency='.urlencode($search_frequency);
|
||||||
if ($search_unit_frequency != '') $param .= '&search_unit_frequency='.urlencode($search_unit_frequency);
|
if ($search_unit_frequency != '') $param .= '&search_unit_frequency='.urlencode($search_unit_frequency);
|
||||||
if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
|
if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
|
||||||
if ($option) $param .= "&option=".urlencode($option);
|
|
||||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
@ -326,12 +332,16 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("RepeatableInvoices"), $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
$title = $langs->trans("RepeatableInvoices");
|
||||||
|
|
||||||
|
print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'invoicing', 0, '', '', $limit);
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';
|
print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
$moreforfilter = '';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
@ -467,7 +477,6 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['f.titre']['checked'])) print_liste_field_titre($arrayfields['f.titre']['label'], $_SERVER['PHP_SELF'], "f.titre", "", $param, "", $sortfield, $sortorder);
|
if (!empty($arrayfields['f.titre']['checked'])) print_liste_field_titre($arrayfields['f.titre']['label'], $_SERVER['PHP_SELF'], "f.titre", "", $param, "", $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], "s.nom", "", $param, "", $sortfield, $sortorder);
|
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||||
|
|||||||
@ -794,6 +794,8 @@ abstract class CommonDocGenerator
|
|||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
if (is_array($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach($extrafields->attributes[$object->table_element]['label'] as $key=>$label)
|
foreach($extrafields->attributes[$object->table_element]['label'] as $key=>$label)
|
||||||
{
|
{
|
||||||
if($extrafields->attributes[$object->table_element]['type'][$key] == 'price')
|
if($extrafields->attributes[$object->table_element]['type'][$key] == 'price')
|
||||||
@ -870,6 +872,7 @@ abstract class CommonDocGenerator
|
|||||||
|
|
||||||
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
$array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $array_to_fill;
|
return $array_to_fill;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -604,14 +604,14 @@ class DiscountAbsolute
|
|||||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f';
|
||||||
$sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id;
|
$sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id;
|
||||||
$sql .= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ', ' . Facture::TYPE_SITUATION . ')'; // Find discount coming from credit note or excess received
|
$sql .= ' AND f.type IN (' . $invoice::TYPE_STANDARD . ', ' . $invoice::TYPE_CREDIT_NOTE . ', ' . $invoice::TYPE_SITUATION . ')'; // Find discount coming from credit note or excess received
|
||||||
}
|
}
|
||||||
elseif ($invoice->element == 'invoice_supplier')
|
elseif ($invoice->element == 'invoice_supplier')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||||
$sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id;
|
$sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id;
|
||||||
$sql .= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ')'; // Find discount coming from credit note or excess paid
|
$sql .= ' AND f.type IN (' . $invoice::TYPE_STANDARD . ', ' . $invoice::TYPE_CREDIT_NOTE . ')'; // Find discount coming from credit note or excess paid
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -189,7 +189,7 @@ if ($action == 'presend')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$formmail->withto = $liste;
|
$formmail->withto = $liste;
|
||||||
$formmail->withtofree = (GETPOSTISSET('sendto') ? (GETPOST('sendto') ? GETPOST('sendto') : '1') : '');
|
$formmail->withtofree = (GETPOSTISSET('sendto') ? (GETPOST('sendto') ? GETPOST('sendto') : '1') : '1');
|
||||||
$formmail->withtocc = $liste;
|
$formmail->withtocc = $liste;
|
||||||
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||||
$formmail->withtopic = $topicmail;
|
$formmail->withtopic = $topicmail;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user