Merge branch 'develop' into 12.0_a8
This commit is contained in:
commit
91b4f7c663
@ -33,6 +33,7 @@ NEW: Add button "Save and Stay" in website editor of pages.
|
|||||||
NEW: Accountancy - Can add specific widget in this accountancy area.
|
NEW: Accountancy - Can add specific widget in this accountancy area.
|
||||||
NEW: Accountancy - Add export model LDCompta V9 & higher
|
NEW: Accountancy - Add export model LDCompta V9 & higher
|
||||||
NEW: Accountancy - Add permission on export, delete operations in ledger
|
NEW: Accountancy - Add permission on export, delete operations in ledger
|
||||||
|
NEW: Can defined alternative profiles (email and signatures) for users.
|
||||||
NEW: add ability to edit price without tax before adding a line of a predefined product.
|
NEW: add ability to edit price without tax before adding a line of a predefined product.
|
||||||
NEW: Add a tab to setup "Opening hours" of company (information only).
|
NEW: Add a tab to setup "Opening hours" of company (information only).
|
||||||
NEW: Add attendee to ical export + cleanup.
|
NEW: Add attendee to ical export + cleanup.
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -27,6 +27,7 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries"));
|
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries"));
|
||||||
@ -183,6 +184,7 @@ if (empty($reshook))
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
llxHeader('', $langs->trans("ListAccounts"));
|
llxHeader('', $langs->trans("ListAccounts"));
|
||||||
|
|
||||||
@ -201,10 +203,43 @@ if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_accou
|
|||||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity;
|
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity;
|
||||||
$sql .= " WHERE asy.rowid = ".$pcgver;
|
$sql .= " WHERE asy.rowid = ".$pcgver;
|
||||||
//print $sql;
|
//print $sql;
|
||||||
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
if (strlen(trim($search_account))) {
|
||||||
|
$lengthpaddingaccount = 0;
|
||||||
|
if ($conf->global->ACCOUNTING_LENGTH_GACCOUNT || $conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||||
|
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_GACCOUNT, $conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||||
|
}
|
||||||
|
$search_account_tmp = $search_account;
|
||||||
|
$weremovedsomezero = 0;
|
||||||
|
if (strlen($search_account_tmp) <= $lengthpaddingaccount) {
|
||||||
|
for($i = 0; $i < $lengthpaddingaccount; $i++) {
|
||||||
|
if (preg_match('/0$/', $search_account_tmp)) {
|
||||||
|
$weremovedsomezero++;
|
||||||
|
$search_account_tmp = preg_replace('/0$/', '', $search_account_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($search_account); exit;
|
||||||
|
if ($search_account_tmp) {
|
||||||
|
if ($weremovedsomezero) {
|
||||||
|
$search_account_tmp_clean = $search_account_tmp;
|
||||||
|
$search_account_clean = $search_account;
|
||||||
|
$startchar = '%';
|
||||||
|
if (strpos($search_account_tmp, '^') === 0)
|
||||||
|
{
|
||||||
|
$startchar = '';
|
||||||
|
$search_account_tmp_clean = preg_replace('/^\^/', '', $search_account_tmp);
|
||||||
|
$search_account_clean = preg_replace('/^\^/', '', $search_account);
|
||||||
|
}
|
||||||
|
$sql .= " AND (aa.account_number LIKE '".$startchar.$search_account_tmp_clean."'";
|
||||||
|
$sql .= " OR aa.account_number LIKE '".$startchar.$search_account_clean."%')";
|
||||||
|
}
|
||||||
|
else $sql .= natural_search("aa.account_number", $search_account_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
|
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
|
||||||
if (strlen(trim($search_labelshort))) $sql .= natural_search("aa.labelshort", $search_labelshort);
|
if (strlen(trim($search_labelshort))) $sql .= natural_search("aa.labelshort", $search_labelshort);
|
||||||
if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent);
|
if (strlen(trim($search_accountparent)) && $search_accountparent != '-1') $sql .= natural_search("aa.account_parent", $search_accountparent, 2);
|
||||||
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||||
if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
@ -237,7 +272,7 @@ if ($resql)
|
|||||||
if ($search_account) $param .= '&search_account='.urlencode($search_account);
|
if ($search_account) $param .= '&search_account='.urlencode($search_account);
|
||||||
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
||||||
if ($search_labelshort) $param.= '&search_labelshort='.urlencode($search_labelshort);
|
if ($search_labelshort) $param.= '&search_labelshort='.urlencode($search_labelshort);
|
||||||
if ($search_accountparent) $param .= '&search_accountparent='.urlencode($search_accountparent);
|
if ($search_accountparent > 0 || $search_accountparent == '0') $param .= '&search_accountparent='.urlencode($search_accountparent);
|
||||||
if ($search_pcgtype) $param .= '&search_pcgtype='.urlencode($search_pcgtype);
|
if ($search_pcgtype) $param .= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||||
if ($search_pcgsubtype) $param .= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
if ($search_pcgsubtype) $param .= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||||
if ($optioncss != '') $param .= '&optioncss='.$optioncss;
|
if ($optioncss != '') $param .= '&optioncss='.$optioncss;
|
||||||
@ -322,7 +357,11 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="'.$search_account.'"></td>';
|
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="'.$search_account.'"></td>';
|
||||||
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
||||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_labelshort" value="' . $search_labelshort . '"></td>';
|
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_labelshort" value="' . $search_labelshort . '"></td>';
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="'.$search_accountparent.'"></td>';
|
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||||
if (!empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="'.$search_pcgsubtype.'"></td>';
|
if (!empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="'.$search_pcgsubtype.'"></td>';
|
||||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||||
@ -346,6 +385,7 @@ if ($resql)
|
|||||||
$accountstatic = new AccountingAccount($db);
|
$accountstatic = new AccountingAccount($db);
|
||||||
$accountparent = new AccountingAccount($db);
|
$accountparent = new AccountingAccount($db);
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -32,6 +32,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage the different format accountancy export
|
* Manage the different format accountancy export
|
||||||
@ -742,10 +744,10 @@ class AccountancyExport
|
|||||||
print $line->label_operation.$separator;
|
print $line->label_operation.$separator;
|
||||||
|
|
||||||
// FEC:Debit
|
// FEC:Debit
|
||||||
print price2num($line->debit).$separator;
|
print price2fec($line->debit).$separator;
|
||||||
|
|
||||||
// FEC:Credit
|
// FEC:Credit
|
||||||
print price2num($line->credit).$separator;
|
print price2fec($line->credit).$separator;
|
||||||
|
|
||||||
// FEC:EcritureLet
|
// FEC:EcritureLet
|
||||||
print $line->lettering_code.$separator;
|
print $line->lettering_code.$separator;
|
||||||
|
|||||||
@ -342,11 +342,12 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Morphy
|
// Morphy
|
||||||
|
$morphys = array();
|
||||||
$morphys[""] = $langs->trans("MorPhy");
|
$morphys[""] = $langs->trans("MorPhy");
|
||||||
$morphys["phy"] = $langs->trans("Physical");
|
$morphys["phy"] = $langs->trans("Physical");
|
||||||
$morphys["mor"] = $langs->trans("Moral");
|
$morphys["mor"] = $langs->trans("Moral");
|
||||||
print '<tr><td><span>'.$langs->trans("MemberNature").'</span></td><td>';
|
print '<tr><td><span>'.$langs->trans("MemberNature").'</span></td><td>';
|
||||||
print $form->selectarray("morphy", $morphys, isset($_POST["morphy"]) ? $_POST["morphy"] : $object->morphy);
|
print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy');
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||||
@ -354,12 +355,12 @@ if ($action == 'create')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||||
print $form->selectyesno("vote", 0, 1);
|
print $form->selectyesno("vote", GETPOSTISSET("vote") ? GETPOST('vote', 'aZ09') : 1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
|
||||||
print '<input name="duration_value" size="5" value="'.$_POST["duration_value"].'"> ';
|
print '<input name="duration_value" size="5" value="'.GETPOST('duraction_unit', 'aZ09').'"> ';
|
||||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", $_POST["duration_unit"], 0, 1);
|
print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||||
|
|||||||
@ -235,7 +235,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/action/doc/");
|
$dir = dol_buildpath($reldir."core/modules/action/doc");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -257,7 +257,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "<td>\n";
|
print "<td>\n";
|
||||||
require_once $dir.$file;
|
require_once $dir.'/'.$file;
|
||||||
$module = new $classname($db, $specimenthirdparty);
|
$module = new $classname($db, $specimenthirdparty);
|
||||||
if (method_exists($module, 'info'))
|
if (method_exists($module, 'info'))
|
||||||
print $module->info($langs);
|
print $module->info($langs);
|
||||||
|
|||||||
@ -350,7 +350,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/bom".$valdir);
|
$realpath = $reldir."core/modules/bom".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -382,7 +383,6 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified)
|
||||||
{
|
{
|
||||||
$var = !$var;
|
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td width="100">';
|
||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
@ -425,6 +425,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
|
||||||
|
|||||||
@ -403,7 +403,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/commande".$valdir);
|
$realpath = $reldir."core/modules/commande".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -477,6 +478,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -339,7 +339,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/contract".$valdir);
|
$realpath = $reldir."core/modules/contract".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -413,6 +414,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -1298,7 +1298,6 @@ if ($id)
|
|||||||
// Determines the name of the field in relation to the possible names
|
// Determines the name of the field in relation to the possible names
|
||||||
// in data dictionaries
|
// in data dictionaries
|
||||||
$showfield = 1; // By defaut
|
$showfield = 1; // By defaut
|
||||||
$align = "left";
|
|
||||||
$cssprefix = '';
|
$cssprefix = '';
|
||||||
$sortable = 1;
|
$sortable = 1;
|
||||||
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
|
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
|
||||||
@ -1310,23 +1309,23 @@ if ($id)
|
|||||||
if ($fieldlist[$field] == 'taux') {
|
if ($fieldlist[$field] == 'taux') {
|
||||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow = $langs->trans("Rate");
|
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow = $langs->trans("Rate");
|
||||||
else $valuetoshow = $langs->trans("Amount");
|
else $valuetoshow = $langs->trans("Amount");
|
||||||
$align = 'center';
|
$cssprefix = 'center ';
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'localtax1_type') { $valuetoshow = $langs->trans("UseLocalTax")." 2"; $align = "center"; $sortable = 0; }
|
if ($fieldlist[$field] == 'localtax1_type') { $valuetoshow = $langs->trans("UseLocalTax")." 2"; $cssprefix = "center "; $sortable = 0; }
|
||||||
if ($fieldlist[$field] == 'localtax1') { $valuetoshow = $langs->trans("Rate")." 2"; $align = "center"; $sortable = 0; }
|
if ($fieldlist[$field] == 'localtax1') { $valuetoshow = $langs->trans("Rate")." 2"; $cssprefix = "center "; $sortable = 0; }
|
||||||
if ($fieldlist[$field] == 'localtax2_type') { $valuetoshow = $langs->trans("UseLocalTax")." 3"; $align = "center"; $sortable = 0; }
|
if ($fieldlist[$field] == 'localtax2_type') { $valuetoshow = $langs->trans("UseLocalTax")." 3"; $cssprefix = "center "; $sortable = 0; }
|
||||||
if ($fieldlist[$field] == 'localtax2') { $valuetoshow = $langs->trans("Rate")." 3"; $align = "center"; $sortable = 0; }
|
if ($fieldlist[$field] == 'localtax2') { $valuetoshow = $langs->trans("Rate")." 3"; $cssprefix = "center "; $sortable = 0; }
|
||||||
if ($fieldlist[$field] == 'organization') { $valuetoshow = $langs->trans("Organization"); }
|
if ($fieldlist[$field] == 'organization') { $valuetoshow = $langs->trans("Organization"); }
|
||||||
if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); }
|
if ($fieldlist[$field] == 'lang') { $valuetoshow = $langs->trans("Language"); }
|
||||||
if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); }
|
if ($fieldlist[$field] == 'type') { $valuetoshow = $langs->trans("Type"); }
|
||||||
if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); }
|
if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); }
|
||||||
if ($fieldlist[$field] == 'position') { $align = 'right'; }
|
if ($fieldlist[$field] == 'position') { $cssprefix = 'right '; }
|
||||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') { $valuetoshow = $langs->trans("Label"); }
|
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') { $valuetoshow = $langs->trans("Label"); }
|
||||||
if ($fieldlist[$field] == 'libelle_facture') { $valuetoshow = $langs->trans("LabelOnDocuments"); }
|
if ($fieldlist[$field] == 'libelle_facture') { $valuetoshow = $langs->trans("LabelOnDocuments"); }
|
||||||
if ($fieldlist[$field] == 'country') { $valuetoshow = $langs->trans("Country"); }
|
if ($fieldlist[$field] == 'country') { $valuetoshow = $langs->trans("Country"); }
|
||||||
if ($fieldlist[$field] == 'recuperableonly') { $valuetoshow = $langs->trans("NPR"); $align = "center"; }
|
if ($fieldlist[$field] == 'recuperableonly') { $valuetoshow = $langs->trans("NPR"); $cssprefix = "center "; }
|
||||||
if ($fieldlist[$field] == 'nbjour') { $valuetoshow = $langs->trans("NbOfDays"); }
|
if ($fieldlist[$field] == 'nbjour') { $valuetoshow = $langs->trans("NbOfDays"); }
|
||||||
if ($fieldlist[$field] == 'type_cdr') { $valuetoshow = $langs->trans("AtEndOfMonth"); $align = "center"; }
|
if ($fieldlist[$field] == 'type_cdr') { $valuetoshow = $langs->trans("AtEndOfMonth"); $cssprefix = "center "; }
|
||||||
if ($fieldlist[$field] == 'decalage') { $valuetoshow = $langs->trans("Offset"); }
|
if ($fieldlist[$field] == 'decalage') { $valuetoshow = $langs->trans("Offset"); }
|
||||||
if ($fieldlist[$field] == 'width' || $fieldlist[$field] == 'nx') { $valuetoshow = $langs->trans("Width"); }
|
if ($fieldlist[$field] == 'width' || $fieldlist[$field] == 'nx') { $valuetoshow = $langs->trans("Width"); }
|
||||||
if ($fieldlist[$field] == 'height' || $fieldlist[$field] == 'ny') { $valuetoshow = $langs->trans("Height"); }
|
if ($fieldlist[$field] == 'height' || $fieldlist[$field] == 'ny') { $valuetoshow = $langs->trans("Height"); }
|
||||||
@ -1368,7 +1367,7 @@ if ($id)
|
|||||||
// Show field title
|
// Show field title
|
||||||
if ($showfield)
|
if ($showfield)
|
||||||
{
|
{
|
||||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, "align=".$align, $sortfield, $sortorder, $cssprefix);
|
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $cssprefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Favorite - Only activated on country dictionary
|
// Favorite - Only activated on country dictionary
|
||||||
@ -1424,8 +1423,8 @@ if ($id)
|
|||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
//var_dump($fieldlist);
|
//var_dump($fieldlist);
|
||||||
|
$class = '';
|
||||||
$showfield = 1;
|
$showfield = 1;
|
||||||
$align = "left";
|
|
||||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||||
|
|
||||||
if ($fieldlist[$field] == 'entity') {
|
if ($fieldlist[$field] == 'entity') {
|
||||||
@ -1457,13 +1456,13 @@ if ($id)
|
|||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||||
$valuetoshow = yn($valuetoshow);
|
$valuetoshow = yn($valuetoshow);
|
||||||
$align = "center";
|
$class = "center";
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'type_cdr') {
|
elseif ($fieldlist[$field] == 'type_cdr') {
|
||||||
if (empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
if (empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
||||||
elseif ($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
elseif ($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
||||||
elseif ($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
elseif ($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
||||||
$align = "center";
|
$class = "center";
|
||||||
} elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
|
} elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
|
||||||
$valuetoshow = price($valuetoshow);
|
$valuetoshow = price($valuetoshow);
|
||||||
}
|
}
|
||||||
@ -1577,20 +1576,20 @@ if ($id)
|
|||||||
$valuetoshow = $localtax_typeList[$valuetoshow];
|
$valuetoshow = $localtax_typeList[$valuetoshow];
|
||||||
else
|
else
|
||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
$align = "center";
|
$class = "center";
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'localtax2_type') {
|
elseif ($fieldlist[$field] == 'localtax2_type') {
|
||||||
if ($obj->localtax2 != 0)
|
if ($obj->localtax2 != 0)
|
||||||
$valuetoshow = $localtax_typeList[$valuetoshow];
|
$valuetoshow = $localtax_typeList[$valuetoshow];
|
||||||
else
|
else
|
||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
$align = "center";
|
$class = "center";
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'taux') {
|
elseif ($fieldlist[$field] == 'taux') {
|
||||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||||
$align = "center";
|
$class = "center";
|
||||||
} elseif (in_array($fieldlist[$field], array('recuperableonly'))) {
|
} elseif (in_array($fieldlist[$field], array('recuperableonly'))) {
|
||||||
$align = "center";
|
$class = "center";
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') {
|
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy') {
|
||||||
$valuetoshow = length_accountg($valuetoshow);
|
$valuetoshow = length_accountg($valuetoshow);
|
||||||
@ -1622,14 +1621,14 @@ if ($id)
|
|||||||
$valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$fieldlist[$field]});
|
$valuetoshow = ($obj->label && $key != strtoupper($obj->label) ? $key : $obj->{$fieldlist[$field]});
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = 'tddict';
|
$class .= ($class ? ' ' : '').'tddict';
|
||||||
if ($fieldlist[$field] == 'note' && $id == 10) $class .= ' tdoverflowmax200';
|
if ($fieldlist[$field] == 'note' && $id == 10) $class .= ' tdoverflowmax200';
|
||||||
if ($fieldlist[$field] == 'tracking') $class .= ' tdoverflowauto';
|
if ($fieldlist[$field] == 'tracking') $class .= ' tdoverflowauto';
|
||||||
if ($fieldlist[$field] == 'position') $class .= ' right';
|
if ($fieldlist[$field] == 'position') $class .= ' right';
|
||||||
if ($fieldlist[$field] == 'localtax1_type') $class .= ' nowrap';
|
if ($fieldlist[$field] == 'localtax1_type') $class .= ' nowrap';
|
||||||
if ($fieldlist[$field] == 'localtax2_type') $class .= ' nowrap';
|
if ($fieldlist[$field] == 'localtax2_type') $class .= ' nowrap';
|
||||||
// Show value for field
|
// Show value for field
|
||||||
if ($showfield) print '<!-- '.$fieldlist[$field].' --><td align="'.$align.'" class="'.$class.'">'.$valuetoshow.'</td>';
|
if ($showfield) print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.$valuetoshow.'</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1908,9 +1907,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
|
elseif (in_array($fieldlist[$field], array('nbjour', 'decalage', 'taux', 'localtax1', 'localtax2'))) {
|
||||||
$align = "left";
|
$class = "left";
|
||||||
if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) $align = "center"; // Fields aligned on right
|
if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2'))) $class = "center"; // Fields aligned on right
|
||||||
print '<td class="'.$align.'">';
|
print '<td class="'.$class.'">';
|
||||||
print '<input type="text" class="flat" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'" size="3" name="'.$fieldlist[$field].'">';
|
print '<input type="text" class="flat" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'" size="3" name="'.$fieldlist[$field].'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -486,7 +486,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('','/doc') as $valdir)
|
foreach (array('','/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/facture".$valdir);
|
$realpath = $reldir."core/modules/facture".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -560,6 +561,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -409,7 +409,8 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/fichinter/doc/");
|
$realpath = $reldir."core/modules/fichinter/doc";
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -480,6 +481,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -355,7 +355,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/holiday".$valdir);
|
$realpath = $reldir."core/modules/holiday".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -429,6 +430,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -377,6 +377,7 @@ print '</table>'."\n";
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table summary="edit" class="noborder centpercent">';
|
print '<table summary="edit" class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LoginPage").'</td><td></td>';
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LoginPage").'</td><td></td>';
|
||||||
print '<td width="20"> </td>';
|
print '<td width="20"> </td>';
|
||||||
@ -427,7 +428,7 @@ print '</div>';
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
|
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
|
||||||
@ -467,24 +467,6 @@ if ($action == 'edit')
|
|||||||
$liste = array();
|
$liste = array();
|
||||||
$liste['user'] = $langs->trans('UserEmail');
|
$liste['user'] = $langs->trans('UserEmail');
|
||||||
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||||
/*
|
|
||||||
$sql='SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1';
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
|
||||||
$i=0;
|
|
||||||
while($i < $num)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
if ($obj)
|
|
||||||
{
|
|
||||||
$liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>';
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else dol_print_error($db);*/
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
||||||
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0);
|
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0);
|
||||||
@ -655,7 +637,8 @@ else
|
|||||||
$liste = array();
|
$liste = array();
|
||||||
$liste['user'] = $langs->trans('UserEmail');
|
$liste['user'] = $langs->trans('UserEmail');
|
||||||
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||||
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1';
|
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
|
||||||
|
$sql.= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,13 +69,14 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|||||||
if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
if (!$sortorder) $sortorder = "ASC";
|
||||||
|
|
||||||
// Protection if external user
|
// Security check
|
||||||
$socid = 0;
|
$socid = 0;
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0) // Protection if external user
|
||||||
{
|
{
|
||||||
//$socid = $user->socid;
|
//$socid = $user->socid;
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
//$result = restrictedArea($user, 'mymodule', $id, '');
|
||||||
|
|
||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
$search_all = trim(GETPOST("search_all", 'alpha'));
|
||||||
@ -97,7 +98,7 @@ $arrayfields = array();
|
|||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val)
|
||||||
{
|
{
|
||||||
// If $val['visible']==0, then we never show the field
|
// If $val['visible']==0, then we never show the field
|
||||||
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled']);
|
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
|
||||||
@ -161,8 +162,6 @@ if (empty($reshook))
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'EmailSenderProfile';
|
$objectclass = 'EmailSenderProfile';
|
||||||
$objectlabel = 'EmailSenderProfile';
|
$objectlabel = 'EmailSenderProfile';
|
||||||
$permissiontoread = $user->admin;
|
|
||||||
$permissiontodelete = $user->admin;
|
|
||||||
$uploaddir = $conf->admin->dir_output.'/senderprofiles';
|
$uploaddir = $conf->admin->dir_output.'/senderprofiles';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
@ -185,8 +184,6 @@ if (empty($reshook))
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$limit = (GETPOSTISSET('limit') ? $limit : 0);
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
@ -196,7 +193,7 @@ $help_url = '';
|
|||||||
$title = $langs->trans("EMailsSetup");
|
$title = $langs->trans("EMailsSetup");
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader('', $title);
|
||||||
|
|
||||||
$linkback = '';
|
$linkback = '';
|
||||||
$titlepicto = 'title_setup';
|
$titlepicto = 'title_setup';
|
||||||
@ -234,6 +231,10 @@ foreach ($search as $key => $val)
|
|||||||
{
|
{
|
||||||
if ($key == 'status' && $search[$key] == -1) continue;
|
if ($key == 'status' && $search[$key] == -1) continue;
|
||||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||||
|
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
|
||||||
|
if ($search[$key] == '-1') $search[$key] = '';
|
||||||
|
$mode_search = 2;
|
||||||
|
}
|
||||||
if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
if ($search[$key] != '') $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||||
}
|
}
|
||||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||||
@ -254,6 +255,7 @@ foreach($object->fields as $key => $val)
|
|||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||||
|
}
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -375,9 +377,12 @@ if ($action != 'create') {
|
|||||||
$doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
|
$doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||||
|
print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id));
|
||||||
|
print '</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.GETPOST('position', 'int').'"></td></tr>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td><input type="text" name="position" class="maxwidth50" value="'.GETPOST('position', 'int').'"></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print $form->selectyesno('active', GETPOST('active', 'int'), 1);
|
print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOST('active', 'int'), 0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -443,7 +448,10 @@ foreach ($object->fields as $key => $val)
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||||
if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75');
|
if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75');
|
||||||
else print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
elseif (strpos($val['type'], 'integer:') === 0) {
|
||||||
|
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||||
|
}
|
||||||
|
elseif (! preg_match('/^(date|timestamp)/', $val['type'])) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -509,11 +517,7 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
if (empty($obj)) break; // Should not happen
|
if (empty($obj)) break; // Should not happen
|
||||||
|
|
||||||
// Store properties in $object
|
// Store properties in $object
|
||||||
$object->id = $obj->rowid;
|
$object->setVarsFromFetchObj($obj);
|
||||||
foreach ($object->fields as $key => $val)
|
|
||||||
{
|
|
||||||
if (property_exists($obj, $key)) $object->$key = $obj->$key;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show here line of result
|
// Show here line of result
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -532,21 +536,20 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
{
|
{
|
||||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||||
if ($key == 'status') print $object->getLibStatut(5);
|
if ($key == 'status') print $object->getLibStatut(5);
|
||||||
elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');
|
else print $object->showOutputField($val, $key, $object->$key, '');
|
||||||
else print $object->showOutputField($val, $key, $obj->$key, '');
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
if (!empty($val['isameasure']))
|
if (!empty($val['isameasure']))
|
||||||
{
|
{
|
||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||||
$totalarray['val']['t.'.$key] += $obj->$key;
|
$totalarray['val']['t.'.$key] += $object->$key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
@ -562,8 +565,8 @@ while ($i < ($limit ? min($num, $limit) : $num))
|
|||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
{
|
{
|
||||||
$selected = 0;
|
$selected = 0;
|
||||||
if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
|
if (in_array($object->id, $arrayofselected)) $selected = 1;
|
||||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|||||||
@ -351,7 +351,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('','/doc') as $valdir)
|
foreach (array('','/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/mrp".$valdir);
|
$realpath = $reldir."core/modules/mrp".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -383,7 +384,6 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified)
|
||||||
{
|
{
|
||||||
$var = !$var;
|
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td width="100">';
|
||||||
print (empty($module->name)?$name:$module->name);
|
print (empty($module->name)?$name:$module->name);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
@ -426,6 +426,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftMOs").': '.yn($module->option_draft_watermark, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftMOs").': '.yn($module->option_draft_watermark, 1, 1);
|
||||||
|
|||||||
@ -271,7 +271,7 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/propale/");
|
$dir = dol_buildpath($reldir."core/modules/propale");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
require_once $dir.$file.'.php';
|
require_once $dir.'/'.$file.'.php';
|
||||||
|
|
||||||
$module = new $file;
|
$module = new $file;
|
||||||
|
|
||||||
@ -399,7 +399,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/propale".$valdir);
|
$realpath = $reldir."core/modules/propale".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -474,6 +475,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -221,7 +221,7 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/reception/");
|
$dir = dol_buildpath($reldir."core/modules/reception");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -353,7 +353,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/reception".$valdir);
|
$realpath = $reldir."core/modules/reception".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -427,6 +428,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -461,6 +461,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
/*
|
||||||
print '<br>';
|
print '<br>';
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||||
{
|
{
|
||||||
@ -471,7 +472,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
// Example with a yes / no select
|
// Example with a yes / no select
|
||||||
/*print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").'</td>';
|
print '<td>'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").'</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
@ -481,10 +482,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL);
|
print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
|
||||||
|
|
||||||
// Example with a yes / no select
|
// Example with a yes / no select
|
||||||
/*print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").'</td>';
|
print '<td>'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").'</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
@ -494,7 +495,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA);
|
print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
*/
|
|
||||||
|
|
||||||
// Example with a yes / no select
|
// Example with a yes / no select
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -507,8 +508,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT);
|
print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/* I keep the option/feature, but hidden to end users for the moment. If feature is used by module, no need to have users see it.
|
/* I keep the option/feature, but hidden to end users for the moment. If feature is used by module, no need to have users see it.
|
||||||
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
|
If not used by a module, I still need to understand in which case user may need this now we can set rule on product page.
|
||||||
|
|||||||
@ -90,7 +90,7 @@ if ($action == 'specimen') // For invoices
|
|||||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$file = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/pdf_".$modele.".modules.php", 0);
|
$file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$filefound = 1;
|
$filefound = 1;
|
||||||
@ -230,7 +230,7 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/supplier_invoice/");
|
$dir = dol_buildpath($reldir."core/modules/supplier_invoice");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -243,7 +243,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
require_once $dir.$file.'.php';
|
require_once $dir.'/'.$file.'.php';
|
||||||
|
|
||||||
$module = new $file;
|
$module = new $file;
|
||||||
|
|
||||||
@ -360,7 +360,8 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/supplier_invoice/pdf/");
|
$realpath = $reldir."core/modules/supplier_invoice/doc";
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -385,7 +386,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "<td>\n";
|
print "<td>\n";
|
||||||
require_once $dir.$file;
|
require_once $dir.'/'.$file;
|
||||||
$module = new $classname($db, $specimenthirdparty);
|
$module = new $classname($db, $specimenthirdparty);
|
||||||
if (method_exists($module, 'info')) print $module->info($langs);
|
if (method_exists($module, 'info')) print $module->info($langs);
|
||||||
else print $module->description;
|
else print $module->description;
|
||||||
@ -434,6 +435,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -86,7 +86,7 @@ elseif ($action == 'specimen') // For orders
|
|||||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$file = dol_buildpath($reldir."core/modules/supplier_order/pdf/pdf_".$modele.".modules.php", 0);
|
$file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
|
||||||
if (file_exists($file))
|
if (file_exists($file))
|
||||||
{
|
{
|
||||||
$filefound = 1;
|
$filefound = 1;
|
||||||
@ -388,7 +388,8 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/supplier_order/pdf/");
|
$realpath = $reldir."core/modules/supplier_order/doc";
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -411,7 +412,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "<td>\n";
|
print "<td>\n";
|
||||||
require_once $dir.$file;
|
require_once $dir.'/'.$file;
|
||||||
$module = new $classname($db, $specimenthirdparty);
|
$module = new $classname($db, $specimenthirdparty);
|
||||||
if (method_exists($module, 'info')) print $module->info($langs);
|
if (method_exists($module, 'info')) print $module->info($langs);
|
||||||
else print $module->description;
|
else print $module->description;
|
||||||
@ -456,6 +457,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -332,7 +332,8 @@ clearstatcache();
|
|||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/supplier_payment/doc/");
|
$realpath = $reldir."core/modules/supplier_payment/doc";
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -356,7 +357,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "<td>\n";
|
print "<td>\n";
|
||||||
require_once $dir.$file;
|
require_once $dir.'/'.$file;
|
||||||
$module = new $classname($db, $specimenthirdparty);
|
$module = new $classname($db, $specimenthirdparty);
|
||||||
if (method_exists($module, 'info')) print $module->info($langs);
|
if (method_exists($module, 'info')) print $module->info($langs);
|
||||||
else print $module->description;
|
else print $module->description;
|
||||||
@ -405,6 +406,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
|
|||||||
@ -239,7 +239,7 @@ print '</tr>'."\n";
|
|||||||
clearstatcache();
|
clearstatcache();
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/supplier_proposal/");
|
$dir = dol_buildpath($reldir."core/modules/supplier_proposal");
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
require_once $dir.$file.'.php';
|
require_once $dir.'/'.$file.'.php';
|
||||||
|
|
||||||
$module = new $file;
|
$module = new $file;
|
||||||
|
|
||||||
@ -366,7 +366,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
foreach (array('', '/doc') as $valdir)
|
foreach (array('', '/doc') as $valdir)
|
||||||
{
|
{
|
||||||
$dir = dol_buildpath($reldir."core/modules/supplier_proposal".$valdir);
|
$realpath = $reldir."core/modules/supplier_proposal".$valdir;
|
||||||
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir))
|
||||||
{
|
{
|
||||||
@ -440,6 +441,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
{
|
{
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
|
|
||||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||||
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
$htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
|
||||||
|
|||||||
@ -209,7 +209,7 @@ print "</tr>\n";
|
|||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
foreach ($dirmodels as $reldir) {
|
foreach ($dirmodels as $reldir) {
|
||||||
$dir = dol_buildpath($reldir."core/modules/ticket/");
|
$dir = dol_buildpath($reldir."core/modules/ticket");
|
||||||
|
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
@ -219,7 +219,7 @@ foreach ($dirmodels as $reldir) {
|
|||||||
$file = $reg[1];
|
$file = $reg[1];
|
||||||
$classname = substr($file, 4);
|
$classname = substr($file, 4);
|
||||||
|
|
||||||
include_once $dir.$file.'.php';
|
include_once $dir.'/'.$file.'.php';
|
||||||
|
|
||||||
$module = new $file;
|
$module = new $file;
|
||||||
|
|
||||||
|
|||||||
@ -413,11 +413,6 @@ print '<br>';
|
|||||||
// Define compressions array
|
// Define compressions array
|
||||||
$compression = array();
|
$compression = array();
|
||||||
if (in_array($type, array('mysql', 'mysqli'))) {
|
if (in_array($type, array('mysql', 'mysqli'))) {
|
||||||
$compression['none'] = array(
|
|
||||||
'function' => '',
|
|
||||||
'id' => 'radio_compression_none',
|
|
||||||
'label' => $langs->trans("None")
|
|
||||||
);
|
|
||||||
$compression['gz'] = array(
|
$compression['gz'] = array(
|
||||||
'function' => 'gzopen',
|
'function' => 'gzopen',
|
||||||
'id' => 'radio_compression_gzip',
|
'id' => 'radio_compression_gzip',
|
||||||
@ -434,13 +429,18 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
|||||||
'id' => 'radio_compression_bzip',
|
'id' => 'radio_compression_bzip',
|
||||||
'label' => $langs->trans("Bzip2")
|
'label' => $langs->trans("Bzip2")
|
||||||
);
|
);
|
||||||
|
$compression['none'] = array(
|
||||||
|
'function' => '',
|
||||||
|
'id' => 'radio_compression_none',
|
||||||
|
'label' => $langs->trans("None")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$compression['none'] = array(
|
$compression['none'] = array(
|
||||||
'function' => '',
|
'function' => '',
|
||||||
'id' => 'radio_compression_none',
|
'id' => 'radio_compression_none',
|
||||||
'label' => $langs->trans("Default")
|
'label' => $langs->trans("None")
|
||||||
);
|
);
|
||||||
$compression['gz'] = array(
|
$compression['gz'] = array(
|
||||||
'function' => 'gzopen',
|
'function' => 'gzopen',
|
||||||
@ -455,11 +455,14 @@ print "\n";
|
|||||||
|
|
||||||
print $langs->trans("Compression").': ';
|
print $langs->trans("Compression").': ';
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
foreach($compression as $key => $val)
|
foreach($compression as $key => $val)
|
||||||
{
|
{
|
||||||
if (! $val['function'] || function_exists($val['function'])) {
|
if (! $val['function'] || function_exists($val['function'])) {
|
||||||
// Enabled export format
|
// Enabled export format
|
||||||
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>';
|
$checked = '';
|
||||||
|
if ($key == 'gz') $checked = ' checked';
|
||||||
|
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'"'.$checked.'>';
|
||||||
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -467,9 +470,10 @@ foreach($compression as $key => $val)
|
|||||||
// Disabled export format
|
// Disabled export format
|
||||||
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
|
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
|
||||||
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
||||||
print ' ('.$langs->trans("NotAvailable").')';
|
print ' <span class="opacitymedium">('.$langs->trans("NotAvailable").')</span>';
|
||||||
}
|
}
|
||||||
print ' ';
|
print ' ';
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -542,6 +546,7 @@ print "<!-- Dump of a server -->\n";
|
|||||||
print '<form method="post" action="export_files.php" name="dump">';
|
print '<form method="post" action="export_files.php" name="dump">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||||
print '<input type="hidden" name="export_type" value="server" />';
|
print '<input type="hidden" name="export_type" value="server" />';
|
||||||
|
print '<input type="hidden" name="page_y" value="" />';
|
||||||
|
|
||||||
print '<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>';
|
print '<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>';
|
||||||
|
|
||||||
@ -555,34 +560,39 @@ print load_fiche_titre($title?$title:$langs->trans("BackupZipWizard"));
|
|||||||
print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>';
|
print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>';
|
||||||
$prefix='documents';
|
$prefix='documents';
|
||||||
$ext='zip';
|
$ext='zip';
|
||||||
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
|
$file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M");
|
||||||
print '<input type="text" name="zipfilename_template" style="width: 90%" id="zipfilename_template" value="'.$file.'" /> <br>';
|
print '<input type="text" name="zipfilename_template" style="width: 90%" id="zipfilename_template" value="'.$file.'" /> <br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Show compression choices
|
// Show compression choices
|
||||||
|
// Example: With gz choice, you can compress in 5mn, a file of 2GB directory (after compression) with 10 Mb memory.
|
||||||
print '<div class="formelementrow">';
|
print '<div class="formelementrow">';
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
print $langs->trans("Compression").': ';
|
print $langs->trans("Compression").': ';
|
||||||
$filecompression = $compression;
|
$filecompression = $compression;
|
||||||
array_shift($filecompression);
|
unset($filecompression['none']);
|
||||||
$filecompression['zip']= array('function' => 'dol_compress_dir', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip"));
|
$filecompression['zip']= array('function' => 'dol_compress_dir', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip"));
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
foreach($filecompression as $key => $val)
|
foreach($filecompression as $key => $val)
|
||||||
{
|
{
|
||||||
if (! $val['function'] || function_exists($val['function'])) // Enabled export format
|
if (! $val['function'] || function_exists($val['function'])) // Enabled export format
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" checked>';
|
$checked = '';
|
||||||
|
if ($key == 'gz') $checked = ' checked';
|
||||||
|
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'"'.$checked.'>';
|
||||||
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
||||||
}
|
}
|
||||||
else // Disabled export format
|
else // Disabled export format
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
|
print '<input type="radio" name="compression" value="'.$key.'" id="'.$val['id'].'" disabled>';
|
||||||
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
print ' <label for="'.$val['id'].'">'.$val['label'].'</label>';
|
||||||
print ' ('.$langs->trans("NotAvailable").')';
|
print ' <span class="opacitymedium">('.$langs->trans("NotAvailable").')</span>';
|
||||||
}
|
}
|
||||||
print ' ';
|
print ' ';
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -600,7 +610,7 @@ print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px;
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
|
|
||||||
$filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
|
$filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
|
||||||
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
|
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"));
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -18,8 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/admin/tools/export.php
|
* \file htdocs/admin/tools/export_files.php
|
||||||
* \brief Page to export a database into a dump file
|
* \brief Page to export documents into a compressed file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@ -33,10 +33,11 @@ $langs->load("admin");
|
|||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$what=GETPOST('what', 'alpha');
|
$what=GETPOST('what', 'alpha');
|
||||||
$export_type=GETPOST('export_type', 'alpha');
|
$export_type=GETPOST('export_type', 'alpha');
|
||||||
$file=GETPOST('zipfilename_template', 'alpha');
|
$file=trim(GETPOST('zipfilename_template', 'alpha'));
|
||||||
$compression = GETPOST('compression');
|
$compression = GETPOST('compression');
|
||||||
|
|
||||||
$file = dol_sanitizeFileName($file);
|
$file = dol_sanitizeFileName($file);
|
||||||
|
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);
|
||||||
|
|
||||||
$sortfield = GETPOST('sortfield', 'alpha');
|
$sortfield = GETPOST('sortfield', 'alpha');
|
||||||
$sortorder = GETPOST('sortorder', 'alpha');
|
$sortorder = GETPOST('sortorder', 'alpha');
|
||||||
@ -73,7 +74,7 @@ if ($action == 'delete')
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Increase limit of time. Works only if we are not in safe mode
|
// Increase limit of time. Works only if we are not in safe mode
|
||||||
$ExecTimeLimit=600;
|
$ExecTimeLimit=1800; // 30mn
|
||||||
if (!empty($ExecTimeLimit))
|
if (!empty($ExecTimeLimit))
|
||||||
{
|
{
|
||||||
$err=error_reporting();
|
$err=error_reporting();
|
||||||
@ -112,19 +113,26 @@ $utils = new Utils($db);
|
|||||||
|
|
||||||
if ($compression == 'zip')
|
if ($compression == 'zip')
|
||||||
{
|
{
|
||||||
|
$file .= '.zip';
|
||||||
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/');
|
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/');
|
||||||
if ($ret < 0)
|
if ($ret < 0)
|
||||||
{
|
{
|
||||||
|
if ($ret == -2) {
|
||||||
|
$langs->load("errors");
|
||||||
|
$errormsg = $langs->trans("ErrNoZipEngine");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$langs->load("errors");
|
||||||
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
|
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
elseif (in_array($compression, array('gz', 'bz')))
|
elseif (in_array($compression, array('gz', 'bz')))
|
||||||
{
|
{
|
||||||
$userlogin = ($user->login ? $user->login : 'unknown');
|
$userlogin = ($user->login ? $user->login : 'unknown');
|
||||||
|
|
||||||
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
|
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
|
||||||
|
|
||||||
$file = substr($file, 0, strrpos($file, '.'));
|
|
||||||
$file .= '.tar';
|
$file .= '.tar';
|
||||||
// We also exclude '/temp/' dir and 'documents/admin/documents'
|
// We also exclude '/temp/' dir and 'documents/admin/documents'
|
||||||
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
|
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
|
||||||
|
|||||||
@ -205,9 +205,9 @@ if ($result)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||||
if ($search_code) $param.='&search_code='.urlencode($search_code);
|
if ($search_code) $param.='&search_code='.urlencode($search_code);
|
||||||
if ($search_ip) $param.='&search_ip='.urlencode($search_ip);
|
if ($search_ip) $param.='&search_ip='.urlencode($search_ip);
|
||||||
if ($search_user) $param.='&search_user='.urlencode($search_user);
|
if ($search_user) $param.='&search_user='.urlencode($search_user);
|
||||||
@ -332,13 +332,14 @@ if ($result)
|
|||||||
// Description
|
// Description
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$text=$langs->trans($obj->description);
|
$text=$langs->trans($obj->description);
|
||||||
|
$reg = array();
|
||||||
if (preg_match('/\((.*)\)(.*)/i', $obj->description, $reg))
|
if (preg_match('/\((.*)\)(.*)/i', $obj->description, $reg))
|
||||||
{
|
{
|
||||||
$val=explode(',', $reg[1]);
|
$val=explode(',', $reg[1]);
|
||||||
$text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:'');
|
$text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:'');
|
||||||
if (! empty($reg[2])) $text.=$reg[2];
|
if (! empty($reg[2])) $text.=$reg[2];
|
||||||
}
|
}
|
||||||
print $text;
|
print dol_escape_htmltag($text);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if (! empty($arrayfields['e.user_agent']['checked']))
|
if (! empty($arrayfields['e.user_agent']['checked']))
|
||||||
@ -359,8 +360,8 @@ if ($result)
|
|||||||
|
|
||||||
// More informations
|
// More informations
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
$htmltext='<b>'.$langs->trans("UserAgent").'</b>: '.($obj->user_agent?$obj->user_agent:$langs->trans("Unknown"));
|
$htmltext='<b>'.$langs->trans("UserAgent").'</b>: '.($obj->user_agent ? dol_string_nohtmltag($obj->user_agent) : $langs->trans("Unknown"));
|
||||||
$htmltext.='<br><b>'.$langs->trans("PrefixSession").'</b>: '.($obj->prefix_session?$obj->prefix_session:$langs->trans("Unknown"));
|
$htmltext.='<br><b>'.$langs->trans("PrefixSession").'</b>: '.($obj->prefix_session ? dol_string_nohtmltag($obj->prefix_session) : $langs->trans("Unknown"));
|
||||||
print $form->textwithpicto('', $htmltext);
|
print $form->textwithpicto('', $htmltext);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
|||||||
@ -264,7 +264,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
llxHeader('', $langs->trans("BarCodePrintsheet"));
|
llxHeader('', $langs->trans("BarCodePrintsheet"));
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("BarCodePrintsheet"));
|
print load_fiche_titre($langs->trans("BarCodePrintsheet"), '', 'barcode');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print $langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).'<br>';
|
print $langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).'<br>';
|
||||||
|
|||||||
@ -746,6 +746,9 @@ class BOM extends CommonObject
|
|||||||
$label = '<u>'.$langs->trans("BillOfMaterials").'</u>';
|
$label = '<u>'.$langs->trans("BillOfMaterials").'</u>';
|
||||||
$label .= '<br>';
|
$label .= '<br>';
|
||||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
if (isset($this->status)) {
|
||||||
|
$label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
|
||||||
$url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id;
|
$url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id;
|
||||||
|
|
||||||
|
|||||||
@ -791,6 +791,9 @@ class ActionComm extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function fetchResources()
|
public function fetchResources()
|
||||||
{
|
{
|
||||||
|
$this->userassigned = array();
|
||||||
|
$this->socpeopleassigned = array();
|
||||||
|
|
||||||
$sql = 'SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency';
|
$sql = 'SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency';
|
||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm_resources';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm_resources';
|
||||||
$sql .= ' WHERE fk_actioncomm = '.$this->id;
|
$sql .= ' WHERE fk_actioncomm = '.$this->id;
|
||||||
@ -798,9 +801,6 @@ class ActionComm extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->userassigned = array();
|
|
||||||
$this->socpeopleassigned = array();
|
|
||||||
|
|
||||||
// If owner is known, we must but id first into list
|
// If owner is known, we must but id first into list
|
||||||
if ($this->userownerid > 0) $this->userassigned[$this->userownerid] = array('id'=>$this->userownerid); // Set first so will be first into list.
|
if ($this->userownerid > 0) $this->userassigned[$this->userownerid] = array('id'=>$this->userownerid); // Set first so will be first into list.
|
||||||
|
|
||||||
@ -1381,7 +1381,7 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $withpicto 0 = No picto, 1 = Include picto into link, 2 = Only picto
|
* @param int $withpicto 0 = No picto, 1 = Include picto into link, 2 = Only picto
|
||||||
* @param int $maxlength Max number of charaters into label. If negative, use the ref as label.
|
* @param int $maxlength Max number of charaters into label. If negative, use the ref as label.
|
||||||
* @param string $classname Force style class on a link
|
* @param string $classname Force style class on a link
|
||||||
* @param string $option ''=Link to action, 'birthday'=Link to contact
|
* @param string $option '' = Link to action, 'birthday'= Link to contact, 'holiday' = Link to leave
|
||||||
* @param int $overwritepicto 1 = Overwrite picto
|
* @param int $overwritepicto 1 = Overwrite picto
|
||||||
* @param int $notooltip 1 = Disable tooltip
|
* @param int $notooltip 1 = Disable tooltip
|
||||||
* @param int $save_lastsearch_value -1 = Auto, 0 = No save of lastsearch_values when clicking, 1 = Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1 = Auto, 0 = No save of lastsearch_values when clicking, 1 = Save lastsearch_values whenclicking
|
||||||
@ -1393,7 +1393,11 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
if ((!$user->rights->agenda->allactions->read && $this->authorid != $user->id) || (!$user->rights->agenda->myactions->read && $this->authorid == $user->id))
|
$canread = 0;
|
||||||
|
if ($user->rights->agenda->myactions->read && $this->authorid == $user->id) $canread = 1; // Can read my event
|
||||||
|
if ($user->rights->agenda->myactions->read && array_key_exists($user->id, $this->userassigned)) $canread = 1; // Can read my event i am assigned
|
||||||
|
if ($user->rights->agenda->allactions->read) $canread = 1; // Can read all event of other
|
||||||
|
if (! $canread)
|
||||||
{
|
{
|
||||||
$option = 'nolink';
|
$option = 'nolink';
|
||||||
}
|
}
|
||||||
@ -1451,6 +1455,8 @@ class ActionComm extends CommonObject
|
|||||||
$url = '';
|
$url = '';
|
||||||
if ($option == 'birthday')
|
if ($option == 'birthday')
|
||||||
$url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/contact/perso.php?id='.$this->id;
|
||||||
|
elseif ($option == 'holiday')
|
||||||
|
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
|
||||||
else
|
else
|
||||||
$url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
|
||||||
if ($option !== 'nolink')
|
if ($option !== 'nolink')
|
||||||
|
|||||||
@ -757,6 +757,95 @@ if ($showbirthday)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($conf->global->AGENDA_SHOW_HOLIDAYS)
|
||||||
|
{
|
||||||
|
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
||||||
|
$sql.= " WHERE u.rowid = x.fk_user";
|
||||||
|
$sql.= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
|
||||||
|
$sql.= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
|
||||||
|
|
||||||
|
if($action == 'show_day')
|
||||||
|
{
|
||||||
|
// Request only leaves for the current selected day
|
||||||
|
$sql.= " AND '".$year."-".$month."-".$day."' BETWEEN x.date_debut AND x.date_fin";
|
||||||
|
}
|
||||||
|
elseif($action == 'show_week')
|
||||||
|
{
|
||||||
|
// TODO: Add filter to reduce database request
|
||||||
|
}
|
||||||
|
elseif($action == 'show_month')
|
||||||
|
{
|
||||||
|
// TODO: Add filter to reduce database request
|
||||||
|
}
|
||||||
|
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
while ($i < $num)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$dateStartArray = dol_getdate(dol_stringtotime($obj->date_start, 1), true);
|
||||||
|
$dateEndArray = dol_getdate(dol_stringtotime($obj->date_end, 1), true);
|
||||||
|
|
||||||
|
$event = new ActionComm($db);
|
||||||
|
|
||||||
|
// Need the id of the leave object for link to it
|
||||||
|
$event->id = $obj->rowid;
|
||||||
|
|
||||||
|
$event->type_code = 'HOLIDAY';
|
||||||
|
$event->datep = dol_mktime(0, 0, 0, $dateStartArray['mon'], $dateStartArray['mday'], $dateStartArray['year'], true);
|
||||||
|
$event->datef = dol_mktime(0, 0, 0, $dateEndArray['mon'], $dateEndArray['mday'], $dateEndArray['year'], true);
|
||||||
|
$event->date_start_in_calendar = $event->datep;
|
||||||
|
$event->date_end_in_calendar = $event->datef;
|
||||||
|
|
||||||
|
if($obj->status == 3)
|
||||||
|
{
|
||||||
|
// Show no symbol for leave with state "leave approved"
|
||||||
|
$event->percentage = -1;
|
||||||
|
}
|
||||||
|
elseif($obj->status == 2)
|
||||||
|
{
|
||||||
|
// Show TO-DO symbol for leave with state "leave wait for approval"
|
||||||
|
$event->percentage = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($obj->halfday == 1)
|
||||||
|
{
|
||||||
|
$event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
|
||||||
|
}
|
||||||
|
elseif($obj->halfday == -1)
|
||||||
|
{
|
||||||
|
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$event->label = $obj->lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
$annee = date('Y', $event->date_start_in_calendar);
|
||||||
|
$mois = date('m', $event->date_start_in_calendar);
|
||||||
|
$jour = date('d', $event->date_start_in_calendar);
|
||||||
|
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
$eventarray[$daykey][] = $event;
|
||||||
|
|
||||||
|
$daykey += 60*60*24;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($daykey <= $event->date_end_in_calendar);
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Complete $eventarray with external import Ical
|
// Complete $eventarray with external import Ical
|
||||||
if (count($listofextcals))
|
if (count($listofextcals))
|
||||||
{
|
{
|
||||||
@ -1512,7 +1601,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
{
|
{
|
||||||
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
|
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
|
||||||
}
|
}
|
||||||
if ($event->type_code != 'BIRTHDAY')
|
elseif ($event->type_code == 'HOLIDAY')
|
||||||
|
{
|
||||||
|
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'holiday', 'user');
|
||||||
|
}
|
||||||
|
elseif ($event->type_code != 'BIRTHDAY' && $event->type_code != 'HOLIDAY')
|
||||||
{
|
{
|
||||||
// Picto
|
// Picto
|
||||||
if (empty($event->fulldayevent))
|
if (empty($event->fulldayevent))
|
||||||
@ -1568,13 +1661,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$titletoshow = $daterange;
|
$titletoshow = $daterange;
|
||||||
$titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle);
|
$titletoshow .= ($titletoshow ? ' ' : '').($event->label ? $event->label : $event->libelle);
|
||||||
|
|
||||||
if ($event->type_code == 'ICALEVENT') print $titletoshow;
|
if ($event->type_code != 'ICALEVENT') {
|
||||||
else
|
|
||||||
{
|
|
||||||
$savlabel = $event->label ? $event->label : $event->libelle;
|
$savlabel = $event->label ? $event->label : $event->libelle;
|
||||||
$event->label = $titletoshow;
|
$event->label = $titletoshow;
|
||||||
$event->libelle = $titletoshow;
|
$event->libelle = $titletoshow;
|
||||||
print $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0);
|
// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
|
||||||
|
$titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event', '', 0, 0);
|
||||||
$event->label = $savlabel;
|
$event->label = $savlabel;
|
||||||
$event->libelle = $savlabel;
|
$event->libelle = $savlabel;
|
||||||
}
|
}
|
||||||
@ -1595,6 +1687,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
|
|
||||||
$listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
|
$listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print $titletoshow;
|
||||||
print $listofusertoshow;
|
print $listofusertoshow;
|
||||||
|
|
||||||
if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname, $maxnbofchar).')';
|
if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname, $maxnbofchar).')';
|
||||||
@ -1740,6 +1834,17 @@ function dol_color_minus($color, $minus, $minusunit = 16)
|
|||||||
*/
|
*/
|
||||||
function sort_events_by_date($a, $b)
|
function sort_events_by_date($a, $b)
|
||||||
{
|
{
|
||||||
|
// Sort holidays at first
|
||||||
|
if($a->type_code === 'HOLIDAY')
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($b->type_code === 'HOLIDAY')
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
// datep => Event start time
|
// datep => Event start time
|
||||||
// datef => Event end time
|
// datef => Event end time
|
||||||
|
|
||||||
|
|||||||
@ -554,7 +554,10 @@ if ($resql)
|
|||||||
$actionstatic->type_picto = $obj->type_picto;
|
$actionstatic->type_picto = $obj->type_picto;
|
||||||
$actionstatic->label = $obj->label;
|
$actionstatic->label = $obj->label;
|
||||||
$actionstatic->location = $obj->location;
|
$actionstatic->location = $obj->location;
|
||||||
$actionstatic->note = dol_htmlentitiesbr($obj->note);
|
$actionstatic->note = dol_htmlentitiesbr($obj->note); // deprecated
|
||||||
|
$actionstatic->note_public = dol_htmlentitiesbr($obj->note);
|
||||||
|
|
||||||
|
$actionstatic->fetchResources();
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -656,7 +659,6 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['a.fk_contact']['checked'])) {
|
if (!empty($arrayfields['a.fk_contact']['checked'])) {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$actionstatic->fetchResources();
|
|
||||||
if (!empty($actionstatic->socpeopleassigned))
|
if (!empty($actionstatic->socpeopleassigned))
|
||||||
{
|
{
|
||||||
$contactList = array();
|
$contactList = array();
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/comm/multiprix.php
|
* \file htdocs/comm/multiprix.php
|
||||||
* \ingroup societe
|
* \ingroup societe
|
||||||
* \brief Onglet choix du niveau de prix
|
* \brief Tab to set the price level of a thirdparty
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
@ -64,20 +64,11 @@ $userstatic = new User($db);
|
|||||||
|
|
||||||
if ($_socid > 0)
|
if ($_socid > 0)
|
||||||
{
|
{
|
||||||
// On recupere les donnees societes par l'objet
|
// We load data of thirdparty
|
||||||
$objsoc = new Societe($db);
|
$objsoc = new Societe($db);
|
||||||
$objsoc->id = $_socid;
|
$objsoc->id = $_socid;
|
||||||
$objsoc->fetch($_socid, $to);
|
$objsoc->fetch($_socid, $to);
|
||||||
|
|
||||||
if ($errmesg)
|
|
||||||
{
|
|
||||||
print '<div class="error">'.$errmesg.'</div><br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Affichage onglets
|
|
||||||
*/
|
|
||||||
|
|
||||||
$head = societe_prepare_head($objsoc);
|
$head = societe_prepare_head($objsoc);
|
||||||
|
|
||||||
@ -91,7 +82,7 @@ if ($_socid > 0)
|
|||||||
|
|
||||||
dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company');
|
dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company');
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
print '<tr><td class="titlefieldcreate">';
|
print '<tr><td class="titlefieldcreate">';
|
||||||
print $langs->trans("PriceLevel").'</td><td>'.$objsoc->price_level."</td></tr>";
|
print $langs->trans("PriceLevel").'</td><td>'.$objsoc->price_level."</td></tr>";
|
||||||
|
|||||||
@ -3346,7 +3346,7 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
// Load array of products prodids
|
// Load array of products prodids
|
||||||
$num_prods = 0;
|
$num_prods = 0;
|
||||||
@ -3385,6 +3385,10 @@ class Propal extends CommonObject
|
|||||||
$this->demand_reason_code = 'SRC_00';
|
$this->demand_reason_code = 'SRC_00';
|
||||||
$this->note_public = 'This is a comment (public)';
|
$this->note_public = 'This is a comment (public)';
|
||||||
$this->note_private = 'This is a comment (private)';
|
$this->note_private = 'This is a comment (private)';
|
||||||
|
|
||||||
|
$this->multicurrency_tx = 1;
|
||||||
|
$this->multicurrency_code = $conf->currency;
|
||||||
|
|
||||||
// Lines
|
// Lines
|
||||||
$nbp = 5;
|
$nbp = 5;
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
|
|||||||
@ -2542,6 +2542,11 @@ if ($action == 'create' && $usercancreate)
|
|||||||
// Note that $action and $object may be modified by hook
|
// Note that $action and $object may be modified by hook
|
||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
|
// Reopen a closed order
|
||||||
|
if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) {
|
||||||
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
|
||||||
if ($usercansend) {
|
if ($usercansend) {
|
||||||
@ -2619,11 +2624,6 @@ if ($action == 'create' && $usercancreate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reopen a closed order
|
|
||||||
if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) {
|
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set to shipped
|
// Set to shipped
|
||||||
if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
|
if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=shipped">'.$langs->trans('ClassifyShipped').'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=shipped">'.$langs->trans('ClassifyShipped').'</a></div>';
|
||||||
|
|||||||
@ -959,6 +959,7 @@ class Commande extends CommonOrder
|
|||||||
if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER)
|
if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER)
|
||||||
{
|
{
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->error;
|
||||||
dol_print_error($this->db);
|
dol_print_error($this->db);
|
||||||
}
|
}
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
@ -1434,6 +1435,7 @@ class Commande extends CommonOrder
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
|
$this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
|
||||||
|
$this->errors[] = $this->error;
|
||||||
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
|
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
|
||||||
@ -3083,6 +3085,7 @@ class Commande extends CommonOrder
|
|||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
|
$this->error = $langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
|
||||||
|
$this->errors[] = $this->error;
|
||||||
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
|
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
|
||||||
@ -3715,7 +3718,7 @@ class Commande extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
public function initAsSpecimen()
|
public function initAsSpecimen()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::initAsSpecimen");
|
dol_syslog(get_class($this)."::initAsSpecimen");
|
||||||
|
|
||||||
@ -3749,8 +3752,13 @@ class Commande extends CommonOrder
|
|||||||
$this->mode_reglement_code = 'CHQ';
|
$this->mode_reglement_code = 'CHQ';
|
||||||
$this->availability_code = 'DSP';
|
$this->availability_code = 'DSP';
|
||||||
$this->demand_reason_code = 'SRC_00';
|
$this->demand_reason_code = 'SRC_00';
|
||||||
|
|
||||||
$this->note_public = 'This is a comment (public)';
|
$this->note_public = 'This is a comment (public)';
|
||||||
$this->note_private = 'This is a comment (private)';
|
$this->note_private = 'This is a comment (private)';
|
||||||
|
|
||||||
|
$this->multicurrency_tx = 1;
|
||||||
|
$this->multicurrency_code = $conf->currency;
|
||||||
|
|
||||||
// Lines
|
// Lines
|
||||||
$nbp = 5;
|
$nbp = 5;
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
|
|||||||
@ -75,6 +75,7 @@ $search_user = GETPOST('search_user', 'int');
|
|||||||
$search_sale = GETPOST('search_sale', 'int');
|
$search_sale = GETPOST('search_sale', 'int');
|
||||||
$search_total_ht = GETPOST('search_total_ht', 'alpha');
|
$search_total_ht = GETPOST('search_total_ht', 'alpha');
|
||||||
$search_total_ttc = GETPOST('search_total_ttc', 'alpha');
|
$search_total_ttc = GETPOST('search_total_ttc', 'alpha');
|
||||||
|
$search_login=GETPOST('search_login', 'alpha');
|
||||||
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
|
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$billed = GETPOST('billed', 'int');
|
$billed = GETPOST('billed', 'int');
|
||||||
@ -140,6 +141,7 @@ $arrayfields = array(
|
|||||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
||||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
||||||
|
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
|
||||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
|
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
|
||||||
@ -195,6 +197,7 @@ if (empty($reshook))
|
|||||||
$search_total_ht = '';
|
$search_total_ht = '';
|
||||||
$search_total_vat = '';
|
$search_total_vat = '';
|
||||||
$search_total_ttc = '';
|
$search_total_ttc = '';
|
||||||
|
$search_login='';
|
||||||
$search_dateorder_start = '';
|
$search_dateorder_start = '';
|
||||||
$search_dateorder_end = '';
|
$search_dateorder_end = '';
|
||||||
$search_datedelivery_start = '';
|
$search_datedelivery_start = '';
|
||||||
@ -246,10 +249,11 @@ if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
|||||||
$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
$sql .= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
|
||||||
$sql .= " typent.code as typent_code,";
|
$sql .= " typent.code as typent_code,";
|
||||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||||
$sql .= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
|
$sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client, c.fk_user_author,';
|
||||||
$sql .= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
$sql .= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
||||||
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
|
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
|
||||||
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
|
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
|
||||||
|
$sql.= " u.login";
|
||||||
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label']))
|
if (!empty($extrafields->attributes[$object->table_element]['label']))
|
||||||
@ -268,6 +272,8 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
|
|||||||
if ($sall || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande';
|
if ($sall || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande';
|
||||||
if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet";
|
||||||
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON c.fk_user_author = u.rowid';
|
||||||
|
|
||||||
// We'll need this table joined to the select in order to filter by sale
|
// We'll need this table joined to the select in order to filter by sale
|
||||||
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
if ($search_user > 0)
|
if ($search_user > 0)
|
||||||
@ -322,6 +328,7 @@ if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$s
|
|||||||
if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
|
||||||
if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1);
|
if ($search_total_ht != '') $sql .= natural_search('c.total_ht', $search_total_ht, 1);
|
||||||
if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
|
if ($search_total_ttc != '') $sql .= natural_search('c.total_ttc', $search_total_ttc, 1);
|
||||||
|
if ($search_login) $sql .= natural_search("u.login", $search_login);
|
||||||
if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_ref);
|
if ($search_project_ref != '') $sql .= natural_search("p.ref", $search_project_ref);
|
||||||
if ($search_project != '') $sql .= natural_search("p.title", $search_project);
|
if ($search_project != '') $sql .= natural_search("p.title", $search_project);
|
||||||
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
||||||
@ -417,6 +424,7 @@ if ($resql)
|
|||||||
if ($search_total_ht != '') $param .= '&search_total_ht='.urlencode($search_total_ht);
|
if ($search_total_ht != '') $param .= '&search_total_ht='.urlencode($search_total_ht);
|
||||||
if ($search_total_vat != '') $param .= '&search_total_vat='.urlencode($search_total_vat);
|
if ($search_total_vat != '') $param .= '&search_total_vat='.urlencode($search_total_vat);
|
||||||
if ($search_total_ttc != '') $param .= '&search_total_ttc='.urlencode($search_total_ttc);
|
if ($search_total_ttc != '') $param .= '&search_total_ttc='.urlencode($search_total_ttc);
|
||||||
|
if ($search_login) $param.='&search_login='.urlencode($search_login);
|
||||||
if ($search_project_ref >= 0) $param .= "&search_project_ref=".urlencode($search_project_ref);
|
if ($search_project_ref >= 0) $param .= "&search_project_ref=".urlencode($search_project_ref);
|
||||||
if ($search_town != '') $param .= '&search_town='.urlencode($search_town);
|
if ($search_town != '') $param .= '&search_town='.urlencode($search_town);
|
||||||
if ($search_zip != '') $param .= '&search_zip='.urlencode($search_zip);
|
if ($search_zip != '') $param .= '&search_zip='.urlencode($search_zip);
|
||||||
@ -689,6 +697,13 @@ if ($resql)
|
|||||||
print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">';
|
print '<input class="flat" type="text" size="5" name="search_total_ttc" value="'.$search_total_ttc.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
if (! empty($arrayfields['u.login']['checked']))
|
||||||
|
{
|
||||||
|
// Author
|
||||||
|
print '<td class="liste_titre" align="center">';
|
||||||
|
print '<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
@ -760,6 +775,8 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// Hook fields
|
||||||
@ -781,7 +798,7 @@ if ($resql)
|
|||||||
|
|
||||||
$generic_commande = new Commande($db);
|
$generic_commande = new Commande($db);
|
||||||
$generic_product = new Product($db);
|
$generic_product = new Product($db);
|
||||||
|
$userstatic = new User($db);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit))
|
||||||
@ -1080,6 +1097,19 @@ if ($resql)
|
|||||||
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
|
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$userstatic->id=$obj->fk_user_author;
|
||||||
|
$userstatic->login=$obj->login;
|
||||||
|
|
||||||
|
// Author
|
||||||
|
if (! empty($arrayfields['u.login']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">';
|
||||||
|
if ($userstatic->id) print $userstatic->getLoginUrl(1);
|
||||||
|
else print ' ';
|
||||||
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
|
|||||||
@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
// Onglets
|
// Onglets
|
||||||
$head = account_statement_prepare_head($object, $num);
|
$head = account_statement_prepare_head($object, $num);
|
||||||
dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), -1, 'account');
|
dol_fiche_head($head, 'document', $langs->trans("AccountStatement"), -1, 'account');
|
||||||
|
|
||||||
|
|
||||||
// Build file list
|
// Build file list
|
||||||
@ -118,7 +118,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
|
|
||||||
$title = $langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
$title = $langs->trans("AccountStatement").' '.$num.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
||||||
print load_fiche_titre($title, '', 'title_bank.png');
|
print load_fiche_titre($title, '', '');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|||||||
@ -573,11 +573,13 @@ if ($page >= $nbtotalofpages)
|
|||||||
if (empty($search_account)) $mode_balance_ok = false;
|
if (empty($search_account)) $mode_balance_ok = false;
|
||||||
// If a search is done $mode_balance_ok=false
|
// If a search is done $mode_balance_ok=false
|
||||||
if (!empty($search_ref)) $mode_balance_ok = false;
|
if (!empty($search_ref)) $mode_balance_ok = false;
|
||||||
if (!empty($req_nb)) $mode_balance_ok = false;
|
if (!empty($search_description)) $mode_balance_ok = false;
|
||||||
if (!empty($search_type)) $mode_balance_ok = false;
|
if (!empty($search_type)) $mode_balance_ok = false;
|
||||||
if (!empty($debit)) $mode_balance_ok = false;
|
if (!empty($search_debit)) $mode_balance_ok = false;
|
||||||
if (!empty($credit)) $mode_balance_ok = false;
|
if (!empty($search_credit)) $mode_balance_ok = false;
|
||||||
if (!empty($thirdparty)) $mode_balance_ok = false;
|
if (!empty($search_thirdparty)) $mode_balance_ok = false;
|
||||||
|
if ($search_conciliated != '') $mode_balance_ok = false;
|
||||||
|
if (!empty($search_num_releve)) $mode_balance_ok = false;
|
||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2017 Patrick Delcroix <pmpdelcroix@gmail.com>
|
* Copyright (C) 2017 Patrick Delcroix <pmpdelcroix@gmail.com>
|
||||||
@ -364,12 +364,12 @@ if (empty($numref))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Show list of bank statements
|
* Show list of record into a bank statement
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Onglets
|
// Onglets
|
||||||
$head = account_statement_prepare_head($object, $numref);
|
$head = account_statement_prepare_head($object, $numref);
|
||||||
dol_fiche_head($head, 'statement', $langs->trans("FinancialAccount"), 0, 'account');
|
dol_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account');
|
||||||
|
|
||||||
|
|
||||||
$mesprevnext = '';
|
$mesprevnext = '';
|
||||||
@ -382,7 +382,7 @@ else
|
|||||||
$mesprevnext .= '</ul></div>';
|
$mesprevnext .= '</ul></div>';
|
||||||
|
|
||||||
$title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
$title = $langs->trans("AccountStatement").' '.$numref.' - '.$langs->trans("BankAccount").' '.$object->getNomUrl(1, 'receipts');
|
||||||
print load_fiche_titre($title, $mesprevnext, 'title_bank.png');
|
print load_fiche_titre($title, $mesprevnext, '');
|
||||||
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'title_bank.png', 0, '', '', 0, 1);
|
//print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, 0, $nbtotalofrecords, 'title_bank.png', 0, '', '', 0, 1);
|
||||||
|
|
||||||
print "<form method=\"post\" action=\"releve.php\">";
|
print "<form method=\"post\" action=\"releve.php\">";
|
||||||
@ -444,12 +444,11 @@ else
|
|||||||
// Date de valeur
|
// Date de valeur
|
||||||
print '<td valign="center" class="center nowrap">';
|
print '<td valign="center" class="center nowrap">';
|
||||||
print dol_print_date($db->jdate($objp->dv), "day").' ';
|
print dol_print_date($db->jdate($objp->dv), "day").' ';
|
||||||
print '<a href="releve.php?action=dvprev&num='.$numref.'&account='.$object->id.'&dvid='.$objp->rowid.'">';
|
print '<a class="ajax reposition" href="'.$_SERVER['PHP_SELF'].'?action=dvprev&num='.$numref.'&account='.$object->id.'&dvid='.$objp->rowid.'">';
|
||||||
print img_edit_remove()."</a> ";
|
print img_edit_remove()."</a> ";
|
||||||
print '<a href="releve.php?action=dvnext&num='.$numref.'&account='.$object->id.'&dvid='.$objp->rowid.'">';
|
print '<a class="ajax reposition" href="'.$_SERVER['PHP_SELF'].'?action=dvnext&num='.$numref.'&account='.$object->id.'&dvid='.$objp->rowid.'">';
|
||||||
print img_edit_add()."</a>";
|
print img_edit_add()."</a>";
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<a class="ajax" href="'.$_SERVER['PHP_SELF'].'?action=dvnext&account='.$objp->bankid.'&rowid='.$objp->rowid.'">';
|
|
||||||
|
|
||||||
// Type and num
|
// Type and num
|
||||||
if ($objp->fk_type == 'SOLD') {
|
if ($objp->fk_type == 'SOLD') {
|
||||||
@ -466,7 +465,8 @@ else
|
|||||||
print '<td class="nowrap">'.$type_label.' '.($objp->num_chq ? $objp->num_chq : '').$link.'</td>';
|
print '<td class="nowrap">'.$type_label.' '.($objp->num_chq ? $objp->num_chq : '').$link.'</td>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td valign="center"><a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&account='.$object->id.'">';
|
print '<td valign="center">';
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$objp->rowid.'&account='.$object->id.'">';
|
||||||
$reg = array();
|
$reg = array();
|
||||||
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
|
preg_match('/\((.+)\)/i', $objp->label, $reg); // Si texte entoure de parenthese on tente recherche de traduction
|
||||||
if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) print $langs->trans($reg[1]);
|
if ($reg[1] && $langs->trans($reg[1]) != $reg[1]) print $langs->trans($reg[1]);
|
||||||
|
|||||||
@ -234,7 +234,7 @@ if ($result)
|
|||||||
// Subledger account
|
// Subledger account
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $formaccounting->select_auxaccount($search_accountancy_subledger, 'search_accountancy_subledger', 1, array (), 1, 1, 'maxwidth200');
|
print $formaccounting->select_auxaccount($search_accountancy_subledger, 'search_accountancy_subledger', 1, 'maxwidth200');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('bills', 'compta', 'admin', 'other', 'products'));
|
$langs->loadLangs(array('bills', 'compta', 'admin', 'other', 'products', 'banks'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
@ -1030,6 +1030,8 @@ if ($action == 'create')
|
|||||||
// Only on template invoices
|
// Only on template invoices
|
||||||
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')';
|
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')';
|
||||||
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')';
|
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')';
|
||||||
|
$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count");
|
||||||
|
$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber");
|
||||||
|
|
||||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||||
foreach ($substitutionarray as $key => $val)
|
foreach ($substitutionarray as $key => $val)
|
||||||
@ -1446,8 +1448,6 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Bank Account
|
// Bank Account
|
||||||
$langs->load('banks');
|
|
||||||
|
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('BankAccount');
|
print $langs->trans('BankAccount');
|
||||||
@ -1468,8 +1468,6 @@ else
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Model pdf
|
// Model pdf
|
||||||
$langs->load('banks');
|
|
||||||
|
|
||||||
print '<tr><td class="nowrap">';
|
print '<tr><td class="nowrap">';
|
||||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||||
print $langs->trans('Model');
|
print $langs->trans('Model');
|
||||||
|
|||||||
@ -103,8 +103,10 @@ $extrafields = new ExtraFields($db);
|
|||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
if ($action != 'add') {
|
||||||
$ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION);
|
$ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
$hookmanager->initHooks(array('invoicecard', 'globalcard'));
|
||||||
@ -134,6 +136,8 @@ if ($user->socid) $socid = $user->socid;
|
|||||||
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -286,6 +290,39 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
|
setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Also negative lines should not be allowed on 'non Credit notes' invoices. A test is done when adding or updating lines but we must
|
||||||
|
// do it again in validation to avoid cases where invoice is created from another object that allow negative lines.
|
||||||
|
// Note that we can accept the negative line if sum with other lines with same vat is positivie: Because all the lines will be merged together
|
||||||
|
// when converted into 'available credit' and we will get a positive available credit line.
|
||||||
|
// Note: Other solution if you want to add a negative line on invoice, is to create a discount for customer and consumme it (but this is possible on standard invoice only).
|
||||||
|
$array_of_pu_ht_per_vat_rate = array();
|
||||||
|
$array_of_pu_ht_devise_per_vat_rate = array();
|
||||||
|
foreach($object->lines as $line) {
|
||||||
|
if (empty($array_of_pu_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_pu_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
|
||||||
|
if (empty($array_of_pu_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code])) $array_of_pu_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] = 0;
|
||||||
|
$array_of_pu_ht_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->subprice;
|
||||||
|
$array_of_pu_ht_devise_per_vat_rate[$line->tva_tx.'_'.$line->vat_src_code] += $line->multicurrency_subprice;
|
||||||
|
}
|
||||||
|
//var_dump($array_of_pu_ht_per_vat_rate);exit;
|
||||||
|
foreach($array_of_pu_ht_per_vat_rate as $vatrate => $tmpvalue)
|
||||||
|
{
|
||||||
|
$pu_ht = $array_of_pu_ht_per_vat_rate[$vatrate];
|
||||||
|
$pu_ht_devise = $array_of_pu_ht_devise_per_vat_rate[$vatrate];
|
||||||
|
|
||||||
|
if (($pu_ht < 0 || $pu_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
if ($object->type == $object::TYPE_DEPOSIT) {
|
||||||
|
// Using negative lines on deposit lead to headach and blocking problems when you want to consume them.
|
||||||
|
setEventMessages($langs->trans("ErrorLinesCantBeNegativeOnDeposits"), null, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT"), $langs->transnoentitiesnoconv("CustomerAbsoluteDiscountShort")), null, 'errors');
|
||||||
|
}
|
||||||
|
$error++;
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -941,11 +978,13 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!($_POST['fac_replacement'] > 0)) {
|
if (!($_POST['fac_replacement'] > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||||
@ -992,6 +1031,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
@ -999,6 +1039,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||||
@ -1181,6 +1222,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||||
@ -1223,6 +1265,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||||
@ -1230,6 +1273,7 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||||
@ -1642,6 +1686,7 @@ if (empty($reshook))
|
|||||||
$error++;
|
$error++;
|
||||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("InvoiceSituation"));
|
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("InvoiceSituation"));
|
||||||
setEventMessages($mesg, null, 'errors');
|
setEventMessages($mesg, null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -1811,7 +1856,12 @@ if (empty($reshook))
|
|||||||
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
if ($object->type == $object::TYPE_DEPOSIT) {
|
||||||
|
// Using negative lines on deposit lead to headach and blocking problems when you want to consume them.
|
||||||
|
setEventMessages($langs->trans("ErrorLinesCantBeNegativeOnDeposits"), null, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT"), $langs->transnoentitiesnoconv("CustomerAbsoluteDiscountShort")), null, 'errors');
|
||||||
|
}
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2123,7 +2173,7 @@ if (empty($reshook))
|
|||||||
if (!GETPOST('qty')) $special_code = 3;
|
if (!GETPOST('qty')) $special_code = 3;
|
||||||
|
|
||||||
$line = new FactureLigne($db);
|
$line = new FactureLigne($db);
|
||||||
$line->fetch(GETPOST('lineid'));
|
$line->fetch(GETPOST('lineid', 'int'));
|
||||||
$percent = $line->get_prev_progress($object->id);
|
$percent = $line->get_prev_progress($object->id);
|
||||||
|
|
||||||
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0)
|
if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0)
|
||||||
@ -2192,7 +2242,12 @@ if (empty($reshook))
|
|||||||
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
if ($object->type == $object::TYPE_DEPOSIT) {
|
||||||
|
// Using negative lines on deposit lead to headach and blocking problems when you want to consume them.
|
||||||
|
setEventMessages($langs->trans("ErrorLinesCantBeNegativeOnDeposits"), null, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT"), $langs->transnoentitiesnoconv("CustomerAbsoluteDiscountShort")), null, 'errors');
|
||||||
|
}
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2283,17 +2338,17 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier'))
|
elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier')) // Update all lines of situation invoice
|
||||||
{
|
{
|
||||||
if (!$object->fetch($id) > 0) dol_print_error($db);
|
if (!$object->fetch($id) > 0) dol_print_error($db);
|
||||||
if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
|
if (GETPOST('all_progress') != "")
|
||||||
{
|
{
|
||||||
$all_progress = GETPOST('all_progress', 'int');
|
$all_progress = GETPOST('all_progress', 'int');
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
$percent = $line->get_prev_progress($object->id);
|
$percent = $line->get_prev_progress($object->id);
|
||||||
if (floatval($all_progress) < floatval($percent)) {
|
if (floatval($all_progress) < floatval($percent)) {
|
||||||
$mesg = $langs->trans("Line").' '.$i.' '.$line->ref.' : '.$langs->trans("CantBeLessThanMinPercent");
|
$mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent");
|
||||||
setEventMessages($mesg, null, 'warnings');
|
setEventMessages($mesg, null, 'warnings');
|
||||||
$result = -1;
|
$result = -1;
|
||||||
} else
|
} else
|
||||||
@ -2303,7 +2358,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) {
|
elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) {
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition
|
header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // To show again edited page
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2939,7 +2994,7 @@ if ($action == 'create')
|
|||||||
if (($origin == 'propal') || ($origin == 'commande'))
|
if (($origin == 'propal') || ($origin == 'commande'))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap" style="padding-left: 5px">';
|
print '<td class="nowrap" style="padding-left: 5px">';
|
||||||
$arraylist = array('amount' => $langs->transnoentitiesnoconv('FixAmount'), 'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit')));
|
$arraylist = array('amount' => $langs->transnoentitiesnoconv('FixAmount', $langs->transnoentitiesnoconv('Deposit')), 'variable' => $langs->transnoentitiesnoconv('VarAmountOneLine', $langs->transnoentitiesnoconv('Deposit')));
|
||||||
print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1);
|
print $form->selectarray('typedeposit', $arraylist, GETPOST('typedeposit'), 0, 0, 0, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap" style="padding-left: 5px">'.$langs->trans('Value').':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="'.GETPOST('valuedeposit', 'int').'"/>';
|
print '<td class="nowrap" style="padding-left: 5px">'.$langs->trans('Value').':<input type="text" id="valuedeposit" name="valuedeposit" size="3" value="'.GETPOST('valuedeposit', 'int').'"/>';
|
||||||
@ -2992,6 +3047,7 @@ if ($action == 'create')
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$options = "";
|
$options = "";
|
||||||
|
if (is_array($facids)) {
|
||||||
foreach ($facids as $facparam)
|
foreach ($facids as $facparam)
|
||||||
{
|
{
|
||||||
$options .= '<option value="'.$facparam ['id'].'"';
|
$options .= '<option value="'.$facparam ['id'].'"';
|
||||||
@ -3001,6 +3057,7 @@ if ($action == 'create')
|
|||||||
$options .= ' ('.$facturestatic->LibStatut(0, $facparam ['status']).')';
|
$options .= ' ('.$facturestatic->LibStatut(0, $facparam ['status']).')';
|
||||||
$options .= '</option>';
|
$options .= '</option>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<!-- replacement line -->';
|
print '<!-- replacement line -->';
|
||||||
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
|
||||||
@ -3955,7 +4012,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
print '. <span class="opacitymediumbycolor">'.$langs->trans(
|
print '. <span class="opacitymediumbycolor">'.$langs->trans(
|
||||||
"GeneratedFromTemplate",
|
"GeneratedFromTemplate",
|
||||||
'<a href="'.DOL_MAIN_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$tmptemplate->id.'">'.$tmptemplate->ref.'</a>'
|
'<a href="'.DOL_MAIN_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.$tmptemplate->ref.'</a>'
|
||||||
).'</span>';
|
).'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4240,7 +4297,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none');
|
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none');
|
||||||
if (!$displayWarranty) {
|
if (!$displayWarranty) {
|
||||||
print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" ');
|
print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" ');
|
||||||
}
|
}
|
||||||
@ -4557,7 +4614,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Payments already done (from payment on this invoice)
|
// Payments already done (from payment on this invoice)
|
||||||
$sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
|
$sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,';
|
||||||
$sql .= ' c.code as payment_code, c.libelle as payment_label,';
|
$sql .= ' c.code as payment_code, c.libelle as payment_label,';
|
||||||
$sql .= ' pf.amount,';
|
$sql .= ' pf.amount,';
|
||||||
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
|
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
|
||||||
@ -4583,7 +4640,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
$paymentstatic->id = $objp->rowid;
|
$paymentstatic->id = $objp->rowid;
|
||||||
$paymentstatic->datepaye = $db->jdate($objp->dp);
|
$paymentstatic->datepaye = $db->jdate($objp->dp);
|
||||||
$paymentstatic->ref = $objp->ref;
|
$paymentstatic->ref = $objp->ref;
|
||||||
$paymentstatic->num_paiement = $objp->num_paiement;
|
$paymentstatic->num_payment = $objp->num_payment;
|
||||||
$paymentstatic->payment_code = $objp->payment_code;
|
$paymentstatic->payment_code = $objp->payment_code;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
@ -4591,7 +4648,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.dol_print_date($db->jdate($objp->dp), 'dayhour').'</td>';
|
print '<td>'.dol_print_date($db->jdate($objp->dp), 'dayhour').'</td>';
|
||||||
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
|
$label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label;
|
||||||
print '<td>'.$label.' '.$objp->num_paiement.'</td>';
|
print '<td>'.$label.' '.$objp->num_payment.'</td>';
|
||||||
if (!empty($conf->banque->enabled))
|
if (!empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
$bankaccountstatic->id = $objp->baid;
|
$bankaccountstatic->id = $objp->baid;
|
||||||
@ -5082,21 +5139,6 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
|
||||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate)
|
|
||||||
{
|
|
||||||
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=clone&object=invoice">'.$langs->trans("ToClone").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clone as predefined / Create template
|
|
||||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $usercancreate)
|
|
||||||
{
|
|
||||||
if (!$objectidnext && count($object->lines) > 0)
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a credit note
|
// Create a credit note
|
||||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
|
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
|
||||||
{
|
{
|
||||||
@ -5108,6 +5150,7 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
|
|
||||||
// For situation invoice with excess received
|
// For situation invoice with excess received
|
||||||
if ($object->statut > Facture::STATUS_DRAFT
|
if ($object->statut > Facture::STATUS_DRAFT
|
||||||
|
&& $object->type == Facture::TYPE_SITUATION
|
||||||
&& ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0
|
&& ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) > 0
|
||||||
&& $usercancreate
|
&& $usercancreate
|
||||||
&& !$objectidnext
|
&& !$objectidnext
|
||||||
@ -5123,6 +5166,21 @@ elseif ($id > 0 || !empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clone
|
||||||
|
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate)
|
||||||
|
{
|
||||||
|
print '<a class="butAction'.($conf->use_javascript_ajax ? ' reposition' : '').'" href="'.$_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=clone&object=invoice">'.$langs->trans("ToClone").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clone as predefined / Create template
|
||||||
|
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $usercancreate)
|
||||||
|
{
|
||||||
|
if (!$objectidnext && count($object->lines) > 0)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Remove situation from cycle
|
// Remove situation from cycle
|
||||||
if ($object->statut > Facture::STATUS_DRAFT
|
if ($object->statut > Facture::STATUS_DRAFT
|
||||||
&& $object->type == Facture::TYPE_SITUATION
|
&& $object->type == Facture::TYPE_SITUATION
|
||||||
|
|||||||
@ -448,10 +448,12 @@ class Facture extends CommonInvoice
|
|||||||
$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y');
|
$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y');
|
||||||
$substitutionarray['__INVOICE_YEAR__'] = dol_print_date($this->date, '%Y');
|
$substitutionarray['__INVOICE_YEAR__'] = dol_print_date($this->date, '%Y');
|
||||||
$substitutionarray['__INVOICE_NEXT_YEAR__'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y');
|
$substitutionarray['__INVOICE_NEXT_YEAR__'] = dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y');
|
||||||
// Only for tempalte invoice
|
// Only for template invoice
|
||||||
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = dol_print_date($originaldatewhen, 'dayhour');
|
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = dol_print_date($originaldatewhen, 'dayhour');
|
||||||
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = dol_print_date($nextdatewhen, 'dayhour');
|
$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = dol_print_date($nextdatewhen, 'dayhour');
|
||||||
$substitutionarray['__INVOICE_PREVIOUS_DATE_NEXT_INVOICE_AFTER_GEN__'] = dol_print_date($previousdaynextdatewhen, 'dayhour');
|
$substitutionarray['__INVOICE_PREVIOUS_DATE_NEXT_INVOICE_AFTER_GEN__'] = dol_print_date($previousdaynextdatewhen, 'dayhour');
|
||||||
|
$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $_facrec->nb_gen_done;
|
||||||
|
$substitutionarray['__INVOICE_COUNTER_MAX__'] = $_facrec->nb_gen_max;
|
||||||
|
|
||||||
//var_dump($substitutionarray);exit;
|
//var_dump($substitutionarray);exit;
|
||||||
|
|
||||||
@ -4046,7 +4048,7 @@ class Facture extends CommonInvoice
|
|||||||
*/
|
*/
|
||||||
public function initAsSpecimen($option = '')
|
public function initAsSpecimen($option = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
$arraynow = dol_getdate($now);
|
$arraynow = dol_getdate($now);
|
||||||
@ -4088,9 +4090,14 @@ class Facture extends CommonInvoice
|
|||||||
$this->date_lim_reglement = $this->calculate_date_lim_reglement();
|
$this->date_lim_reglement = $this->calculate_date_lim_reglement();
|
||||||
$this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR
|
$this->mode_reglement_id = 0; // Not forced to show payment mode CHQ + VIR
|
||||||
$this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR
|
$this->mode_reglement_code = ''; // Not forced to show payment mode CHQ + VIR
|
||||||
|
|
||||||
$this->note_public = 'This is a comment (public)';
|
$this->note_public = 'This is a comment (public)';
|
||||||
$this->note_private = 'This is a comment (private)';
|
$this->note_private = 'This is a comment (private)';
|
||||||
$this->note = 'This is a comment (private)';
|
$this->note = 'This is a comment (private)';
|
||||||
|
|
||||||
|
$this->multicurrency_tx = 1;
|
||||||
|
$this->multicurrency_code = $conf->currency;
|
||||||
|
|
||||||
$this->fk_incoterms = 0;
|
$this->fk_incoterms = 0;
|
||||||
$this->location_incoterms = '';
|
$this->location_incoterms = '';
|
||||||
|
|
||||||
|
|||||||
@ -226,7 +226,7 @@ if ($object->id > 0)
|
|||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
|
print '<tr><td class="titlefield">'.$langs->trans('Type').'</td><td colspan="3">';
|
||||||
@ -282,7 +282,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Date invoice
|
// Date invoice
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('DateInvoice');
|
print $langs->trans('DateInvoice');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editinvoicedate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||||
@ -309,7 +309,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Payment condition
|
// Payment condition
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('PaymentConditionsShort');
|
print $langs->trans('PaymentConditionsShort');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||||
@ -334,7 +334,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Date payment term
|
// Date payment term
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('DateMaxPayment');
|
print $langs->trans('DateMaxPayment');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editpaymentterm&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||||
@ -362,7 +362,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
print $langs->trans('PaymentMode');
|
print $langs->trans('PaymentMode');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&id='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>';
|
||||||
@ -409,7 +409,7 @@ if ($object->id > 0)
|
|||||||
print '<div class="ficheaddleft">';
|
print '<div class="ficheaddleft">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
|
|
||||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -397,7 +397,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td width="110" class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowraponall">';
|
||||||
print $facturestatic->getNomUrl(1, '');
|
print $facturestatic->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td width="20" class="nobordernopadding nowrap">';
|
print '<td width="20" class="nobordernopadding nowrap">';
|
||||||
@ -509,7 +509,7 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->
|
|||||||
//$thirdpartystatic->code_compta = $obj->code_compta;
|
//$thirdpartystatic->code_compta = $obj->code_compta;
|
||||||
$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven nowraponall"><td>';
|
||||||
print $facstatic->getNomUrl(1, '');
|
print $facstatic->getNomUrl(1, '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -637,7 +637,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven'.(($invoice->id == $facid) ? ' highlight' : '').'">';
|
||||||
|
|
||||||
print '<td class="nowraponall">';
|
print '<td class="nowraponall">';
|
||||||
print $invoice->getNomUrl(1, '');
|
print $invoice->getNomUrl(1, '');
|
||||||
@ -715,7 +715,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Price
|
// Price
|
||||||
print '<td class="right" '.(($invoice->id == $facid) ? ' style="font-weight: bold" ' : '').'>'.price($sign * $objp->total_ttc).'</td>';
|
print '<td class="right">'.price($sign * $objp->total_ttc).'</td>';
|
||||||
|
|
||||||
// Received or paid back
|
// Received or paid back
|
||||||
print '<td class="right">'.price($sign * $paiement);
|
print '<td class="right">'.price($sign * $paiement);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
@ -141,7 +141,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
|||||||
|
|
||||||
if (!$dateech)
|
if (!$dateech)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
}
|
}
|
||||||
elseif (!$dateperiod)
|
elseif (!$dateperiod)
|
||||||
@ -193,7 +193,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
|||||||
|
|
||||||
if (! $dateech)
|
if (! $dateech)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("DateDue")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors');
|
||||||
$action = 'edit';
|
$action = 'edit';
|
||||||
}
|
}
|
||||||
elseif (! $dateperiod)
|
elseif (! $dateperiod)
|
||||||
@ -337,6 +337,16 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Date
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="fieldrequired">';
|
||||||
|
print $langs->trans("Date");
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Date end period
|
// Date end period
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
@ -347,16 +357,6 @@ if ($action == 'create')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date due
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="fieldrequired">';
|
|
||||||
print $langs->trans("DateDue");
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1);
|
|
||||||
print '</td>';
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
@ -434,11 +434,11 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1);
|
||||||
$formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1);
|
$formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1);
|
||||||
$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("DateDue"), 'value' => -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneTax', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -515,9 +515,20 @@ if ($id > 0)
|
|||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Type")."</td><td>".$object->type_label."</td>";
|
print '<tr><td class="titlefield">';
|
||||||
|
print $langs->trans("Type")."</td><td>".$object->type_label."</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
// Date
|
||||||
|
if ($action == 'edit')
|
||||||
|
{
|
||||||
|
print '<tr><td>'.$langs->trans("Date")."</td><td>";
|
||||||
|
print $form->selectDate($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
|
||||||
|
print "</td></tr>";
|
||||||
|
} else {
|
||||||
|
print "<tr><td>".$langs->trans("Date")."</td><td>".dol_print_date($object->date_ech, 'day')."</td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
// Period end date
|
// Period end date
|
||||||
print "<tr><td>".$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo"))."</td>";
|
print "<tr><td>".$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo"))."</td>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
@ -531,16 +542,6 @@ if ($id > 0)
|
|||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Due date
|
|
||||||
if ($action == 'edit')
|
|
||||||
{
|
|
||||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
|
|
||||||
print $form->selectDate($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
|
|
||||||
print "</td></tr>";
|
|
||||||
} else {
|
|
||||||
print "<tr><td>".$langs->trans("DateDue")."</td><td>".dol_print_date($object->date_ech, 'day')."</td></tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
if ($action == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
@ -604,7 +605,7 @@ if ($id > 0)
|
|||||||
*/
|
*/
|
||||||
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
$sql = "SELECT p.rowid, p.num_paiement, datep as dp, p.amount,";
|
||||||
$sql .= " c.code as type_code,c.libelle as paiement_type,";
|
$sql .= " c.code as type_code,c.libelle as paiement_type,";
|
||||||
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
|
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal';
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p";
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid';
|
||||||
$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';
|
||||||
@ -653,6 +654,7 @@ if ($id > 0)
|
|||||||
$bankaccountstatic->ref = $objp->baref;
|
$bankaccountstatic->ref = $objp->baref;
|
||||||
$bankaccountstatic->label = $objp->baref;
|
$bankaccountstatic->label = $objp->baref;
|
||||||
$bankaccountstatic->number = $objp->banumber;
|
$bankaccountstatic->number = $objp->banumber;
|
||||||
|
$bankaccountstatic->currency_code = $objp->bacurrency_code;
|
||||||
|
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
$bankaccountstatic->account_number = $objp->account_number;
|
$bankaccountstatic->account_number = $objp->account_number;
|
||||||
|
|||||||
@ -499,16 +499,20 @@ class ChargeSociales extends CommonObject
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("customers","bills"));
|
$langs->loadLangs(array("customers","bills"));
|
||||||
|
|
||||||
|
// We reinit status array to force to redefine them because label may change according to properties values.
|
||||||
|
$this->labelStatus = array();
|
||||||
|
$this->labelStatusShort = array();
|
||||||
|
|
||||||
if (empty($this->labelStatus) || empty($this->labelStatusShort))
|
if (empty($this->labelStatus) || empty($this->labelStatusShort))
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
//$langs->load("mymodule");
|
//$langs->load("mymodule");
|
||||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
|
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
|
||||||
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
|
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
|
||||||
if ($status == 0 && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
if ($status == self::STATUS_UNPAID && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
||||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Draft');
|
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Unpaid');
|
||||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Enabled');
|
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Paid');
|
||||||
if ($status == 0 && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
if ($status == self::STATUS_UNPAID && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
||||||
}
|
}
|
||||||
|
|
||||||
$statusType = 'status1';
|
$statusType = 'status1';
|
||||||
|
|||||||
@ -121,7 +121,7 @@ $sql .= " AND cs.entity = ".$conf->entity;
|
|||||||
// Search criteria
|
// Search criteria
|
||||||
if ($search_ref) $sql .= " AND cs.rowid=".$db->escape($search_ref);
|
if ($search_ref) $sql .= " AND cs.rowid=".$db->escape($search_ref);
|
||||||
if ($search_label) $sql .= natural_search("cs.libelle", $search_label);
|
if ($search_label) $sql .= natural_search("cs.libelle", $search_label);
|
||||||
if ($search_amount) $sql .= natural_search("cs.amount", price2num(trim($search_amount)), 1);
|
if ($search_amount) $sql .= natural_search("cs.amount", $search_amount, 1);
|
||||||
if ($search_status != '' && $search_status >= 0) $sql .= " AND cs.paye = ".$db->escape($search_status);
|
if ($search_status != '' && $search_status >= 0) $sql .= " AND cs.paye = ".$db->escape($search_status);
|
||||||
$sql .= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim);
|
$sql .= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim);
|
||||||
//$sql.= dolSqlDateFilter("cs.periode", 0, 0, $year);
|
//$sql.= dolSqlDateFilter("cs.periode", 0, 0, $year);
|
||||||
@ -217,6 +217,8 @@ if ($resql)
|
|||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
$formsocialcontrib->select_type_socialcontrib($search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth100onsmartphone');
|
$formsocialcontrib->select_type_socialcontrib($search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth100onsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
// Date
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
// Period end date
|
// Period end date
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_lim" value="'.dol_escape_htmltag($search_day_lim).'">';
|
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_lim" value="'.dol_escape_htmltag($search_day_lim).'">';
|
||||||
@ -227,7 +229,6 @@ if ($resql)
|
|||||||
print '<td class="liste_titre right">';
|
print '<td class="liste_titre right">';
|
||||||
print '<input class="flat maxwidth75" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
print '<input class="flat maxwidth75" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
|
||||||
// Status
|
// Status
|
||||||
print '<td class="liste_titre maxwidthonsmartphone right">';
|
print '<td class="liste_titre maxwidthonsmartphone right">';
|
||||||
$liststatus = array('0'=>$langs->trans("Unpaid"), '1'=>$langs->trans("Paid"));
|
$liststatus = array('0'=>$langs->trans("Unpaid"), '1'=>$langs->trans("Paid"));
|
||||||
@ -244,9 +245,9 @@ if ($resql)
|
|||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "id", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "id", "", $param, "", $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "cs.libelle", "", $param, 'class="left"', $sortfield, $sortorder);
|
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "cs.libelle", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder);
|
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder);
|
||||||
|
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "periode", "", $param, 'align="center"', $sortfield, $sortorder);
|
print_liste_field_titre("PeriodEndDate", $_SERVER["PHP_SELF"], "periode", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "cs.amount", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("DateDue", $_SERVER["PHP_SELF"], "cs.date_ech", "", $param, 'align="center"', $sortfield, $sortorder);
|
|
||||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "cs.paye", "", $param, 'class="right"', $sortfield, $sortorder);
|
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "cs.paye", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -276,6 +277,10 @@ if ($resql)
|
|||||||
print "<td>".$obj->type_label."</td>\n";
|
print "<td>".$obj->type_label."</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
|
// Date
|
||||||
|
print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
// Date end period
|
// Date end period
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($obj->periode)
|
if ($obj->periode)
|
||||||
@ -295,10 +300,6 @@ if ($resql)
|
|||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield';
|
||||||
$totalarray['val']['totalttcfield'] += $obj->amount;
|
$totalarray['val']['totalttcfield'] += $obj->amount;
|
||||||
|
|
||||||
// Due date
|
|
||||||
print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
|
|
||||||
if (!$i) $totalarray['nbfield']++;
|
|
||||||
|
|
||||||
print '<td class="nowrap right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>';
|
print '<td class="nowrap right">'.$chargesociale_static->LibStatut($obj->paye, 5, $obj->alreadypayed).'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
|
|||||||
@ -1114,6 +1114,7 @@ if ($action == 'create')
|
|||||||
if (GETPOST('origin') && GETPOST('originid'))
|
if (GETPOST('origin') && GETPOST('originid'))
|
||||||
{
|
{
|
||||||
// Parse element/subelement (ex: project_task)
|
// Parse element/subelement (ex: project_task)
|
||||||
|
$regs = array();
|
||||||
$element = $subelement = GETPOST('origin');
|
$element = $subelement = GETPOST('origin');
|
||||||
if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs))
|
if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs))
|
||||||
{
|
{
|
||||||
@ -1544,7 +1545,7 @@ else
|
|||||||
$sql .= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
$sql .= " cd.date_fin_validite as date_fin, cd.date_cloture as date_fin_reelle,";
|
||||||
$sql .= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,";
|
$sql .= " cd.commentaire as comment, cd.fk_product_fournisseur_price as fk_fournprice, cd.buy_price_ht as pa_ht,";
|
||||||
$sql .= " cd.fk_unit,";
|
$sql .= " cd.fk_unit,";
|
||||||
$sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
|
$sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity, p.tosell, p.tobuy, p.tobatch";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
$sql .= " FROM ".MAIN_DB_PREFIX."contratdet as cd";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
|
||||||
$sql .= " WHERE cd.rowid = ".$object->lines[$cursorline - 1]->id;
|
$sql .= " WHERE cd.rowid = ".$object->lines[$cursorline - 1]->id;
|
||||||
@ -1577,12 +1578,16 @@ else
|
|||||||
// Label
|
// Label
|
||||||
if ($objp->fk_product > 0)
|
if ($objp->fk_product > 0)
|
||||||
{
|
{
|
||||||
print '<td>';
|
|
||||||
$productstatic->id = $objp->fk_product;
|
$productstatic->id = $objp->fk_product;
|
||||||
$productstatic->type = $objp->ptype;
|
$productstatic->type = $objp->ptype;
|
||||||
$productstatic->ref = $objp->pref;
|
$productstatic->ref = $objp->pref;
|
||||||
$productstatic->entity = $objp->pentity;
|
$productstatic->entity = $objp->pentity;
|
||||||
$productstatic->label = $objp->plabel;
|
$productstatic->label = $objp->plabel;
|
||||||
|
$productstatic->status = $objp->tosell;
|
||||||
|
$productstatic->status_buy = $objp->tobuy;
|
||||||
|
$productstatic->status_batch = $objp->tobatch;
|
||||||
|
|
||||||
|
print '<td>';
|
||||||
$text = $productstatic->getNomUrl(1, '', 32);
|
$text = $productstatic->getNomUrl(1, '', 32);
|
||||||
if ($objp->plabel)
|
if ($objp->plabel)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -708,7 +708,7 @@ class Contrat extends CommonObject
|
|||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
// Retreive all extrafields
|
// Retrieve all extrafields
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$this->fetch_optionals();
|
$this->fetch_optionals();
|
||||||
|
|
||||||
@ -1381,10 +1381,10 @@ class Contrat extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Ajoute une ligne de contrat en base
|
* Ajoute une ligne de contrat en base
|
||||||
*
|
*
|
||||||
* @param string $desc Description de la ligne
|
* @param string $desc Description of line
|
||||||
* @param float $pu_ht Prix unitaire HT
|
* @param float $pu_ht Unit price net
|
||||||
* @param int $qty Quantite
|
* @param int $qty Quantity
|
||||||
* @param float $txtva Taux tva
|
* @param float $txtva Vat rate
|
||||||
* @param float $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate
|
||||||
* @param float $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate
|
||||||
* @param int $fk_product Id produit
|
* @param int $fk_product Id produit
|
||||||
@ -3004,6 +3004,7 @@ class ContratLigne extends CommonObjectLine
|
|||||||
|
|
||||||
$this->oldcopy = new ContratLigne($this->db);
|
$this->oldcopy = new ContratLigne($this->db);
|
||||||
$this->oldcopy->fetch($this->id);
|
$this->oldcopy->fetch($this->id);
|
||||||
|
$this->oldcopy->fetch_optionals();
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";
|
||||||
|
|||||||
@ -352,6 +352,7 @@ if (!$error && $massaction == 'confirm_presend')
|
|||||||
{
|
{
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
|
$reg = array();
|
||||||
$fromtype = GETPOST('fromtype');
|
$fromtype = GETPOST('fromtype');
|
||||||
if ($fromtype === 'user') {
|
if ($fromtype === 'user') {
|
||||||
$from = $user->getFullName($langs).' <'.$user->email.'>';
|
$from = $user->getFullName($langs).' <'.$user->email.'>';
|
||||||
|
|||||||
@ -273,6 +273,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
|||||||
|
|
||||||
$langs->load("commercial");
|
$langs->load("commercial");
|
||||||
|
|
||||||
|
$reg = array();
|
||||||
$fromtype = GETPOST('fromtype', 'alpha');
|
$fromtype = GETPOST('fromtype', 'alpha');
|
||||||
if ($fromtype === 'robot') {
|
if ($fromtype === 'robot') {
|
||||||
$from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
|
$from = dol_string_nospecial($conf->global->MAIN_MAIL_EMAIL_FROM, ' ', array(",")).' <'.$conf->global->MAIN_MAIL_EMAIL_FROM.'>';
|
||||||
@ -292,7 +293,8 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
|||||||
$from = trim($tmp[($reg[1] - 1)]);
|
$from = trim($tmp[($reg[1] - 1)]);
|
||||||
}
|
}
|
||||||
elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
|
elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
|
||||||
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE rowid = '.(int) $reg[1];
|
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
|
||||||
|
$sql .= ' WHERE rowid = '.(int) $reg[1];
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
|
|||||||
@ -33,7 +33,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
|
|||||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
|
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||||
|
|
||||||
$result_update=$object->update_note(dol_html_entity_decode(GETPOST('note_public', 'none'), ENT_QUOTES), '_public');
|
$result_update = $object->update_note(dol_html_entity_decode(GETPOST('note_public', 'none'), ENT_QUOTES, 'UTF-8', 1), '_public');
|
||||||
|
|
||||||
if ($result_update < 0) setEventMessages($object->error, $object->errors, 'errors');
|
if ($result_update < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
elseif (in_array($object->table_element, array('supplier_proposal', 'propal', 'commande_fournisseur', 'commande', 'facture_fourn', 'facture')))
|
elseif (in_array($object->table_element, array('supplier_proposal', 'propal', 'commande_fournisseur', 'commande', 'facture_fourn', 'facture')))
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class box_factures_imp extends ModeleBoxes
|
|||||||
$sql.= " AND fk_statut = 1";
|
$sql.= " AND fk_statut = 1";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
|
if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
|
||||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, s.logo, f.ref, f.date_lim_reglement,";
|
$sql.= " GROUP BY s.nom, s.rowid, s.email, s.code_client, s.logo, f.ref, f.date_lim_reglement,";
|
||||||
$sql.= " f.type, f.amount, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
$sql.= " f.type, f.amount, f.datef, f.total, f.tva, f.total_ttc, f.paye, f.fk_statut, f.rowid";
|
||||||
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
//$sql.= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||||
$sql.= " ORDER BY datelimite ASC, f.ref ASC ";
|
$sql.= " ORDER BY datelimite ASC, f.ref ASC ";
|
||||||
|
|||||||
@ -94,6 +94,7 @@ class box_services_expired extends ModeleBoxes
|
|||||||
if ($user->socid) $sql .= ' AND c.fk_soc = '.$user->socid;
|
if ($user->socid) $sql .= ' AND c.fk_soc = '.$user->socid;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
$sql .= " GROUP BY c.rowid, c.ref, c.statut, c.date_contrat, c.ref_customer, c.ref_supplier, s.nom, s.rowid";
|
$sql .= " GROUP BY c.rowid, c.ref, c.statut, c.date_contrat, c.ref_customer, c.ref_supplier, s.nom, s.rowid";
|
||||||
|
$sql.= ", s.email, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
|
||||||
$sql .= " ORDER BY date_line ASC";
|
$sql .= " ORDER BY date_line ASC";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -1123,7 +1123,7 @@ abstract class CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
public function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0)
|
public function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0)
|
||||||
{
|
{
|
||||||
global $hookmanager;
|
global $hookmanager, $conf;
|
||||||
|
|
||||||
foreach ($this->cols as $colKey => $colDef) {
|
foreach ($this->cols as $colKey => $colDef) {
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
@ -1153,6 +1153,14 @@ abstract class CommonDocGenerator
|
|||||||
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0]);
|
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0]);
|
||||||
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] - $colDef['title']['padding'][1];
|
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] - $colDef['title']['padding'][1];
|
||||||
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);
|
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);
|
||||||
|
|
||||||
|
global $outputlangsbis;
|
||||||
|
if (is_object($outputlangsbis)) {
|
||||||
|
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] + 4);
|
||||||
|
$textbis = $outputlangsbis->transnoentities($colDef['title']['textkey']);
|
||||||
|
$pdf->MultiCell($textWidth, 2, $textbis, '', $colDef['title']['align']);
|
||||||
|
}
|
||||||
|
|
||||||
$this->tabTitleHeight = max($pdf->GetY() - $tab_top + $colDef['title']['padding'][2], $this->tabTitleHeight);
|
$this->tabTitleHeight = max($pdf->GetY() - $tab_top + $colDef['title']['padding'][2], $this->tabTitleHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4199,6 +4199,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$product_static->ref = $line->ref; //can change ref in hook
|
$product_static->ref = $line->ref; //can change ref in hook
|
||||||
$product_static->label = $line->label; //can change label in hook
|
$product_static->label = $line->label; //can change label in hook
|
||||||
|
|
||||||
$text = $product_static->getNomUrl(1);
|
$text = $product_static->getNomUrl(1);
|
||||||
|
|
||||||
// Define output language and label
|
// Define output language and label
|
||||||
@ -6124,7 +6125,7 @@ abstract class CommonObject
|
|||||||
$param_list_array = explode(':', $param_list[0]);
|
$param_list_array = explode(':', $param_list[0]);
|
||||||
$showempty = (($required && $default != '') ? 0 : 1);
|
$showempty = (($required && $default != '') ? 0 : 1);
|
||||||
|
|
||||||
$out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, empty($val['disabled']) ? 0 : 1);
|
$out = $form->selectForForms($param_list[0], $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, $moreparam, 0, empty($val['disabled']) ? 0 : 1);
|
||||||
|
|
||||||
if (!empty($param_list_array[2])) // If we set to add a create button
|
if (!empty($param_list_array[2])) // If we set to add a create button
|
||||||
{
|
{
|
||||||
@ -7523,7 +7524,10 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If field is an implicit foreign key field
|
// If field is an implicit foreign key field
|
||||||
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && empty($values[$key])) $values[$key] = 'null';
|
if (preg_match('/^integer:/i', $this->fields[$key]['type']) && empty($values[$key])) {
|
||||||
|
if (isset($this->fields[$key]['default'])) $values[$key] = $this->fields[$key]['default'];
|
||||||
|
else $values[$key] = 'null';
|
||||||
|
}
|
||||||
if (!empty($this->fields[$key]['foreignkey']) && empty($values[$key])) $values[$key] = 'null';
|
if (!empty($this->fields[$key]['foreignkey']) && empty($values[$key])) $values[$key] = 'null';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -309,7 +309,7 @@ class Conf
|
|||||||
{
|
{
|
||||||
if (!empty($this->$module->enabled))
|
if (!empty($this->$module->enabled))
|
||||||
{
|
{
|
||||||
foreach ($dirs as $type => $name)
|
foreach ($dirs as $type => $name) // $type is 'output' or 'temp'
|
||||||
{
|
{
|
||||||
$subdir = ($type == 'temp' ? '/temp' : '');
|
$subdir = ($type == 'temp' ? '/temp' : '');
|
||||||
// For multicompany sharings
|
// For multicompany sharings
|
||||||
|
|||||||
@ -105,6 +105,7 @@ require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/autoload.php';
|
|||||||
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
|
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
|
||||||
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
|
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
|
||||||
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
|
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
|
||||||
|
use Mike42\Escpos\PrintConnectors\DummyPrintConnector;
|
||||||
use Mike42\Escpos\CapabilityProfile;
|
use Mike42\Escpos\CapabilityProfile;
|
||||||
use Mike42\Escpos\Printer;
|
use Mike42\Escpos\Printer;
|
||||||
use Mike42\Escpos\EscposImage;
|
use Mike42\Escpos\EscposImage;
|
||||||
@ -529,7 +530,13 @@ class dolReceiptPrinter extends Printer
|
|||||||
$this->printer->text("Most simple example\n");
|
$this->printer->text("Most simple example\n");
|
||||||
$this->printer->feed();
|
$this->printer->feed();
|
||||||
$this->printer->cut();
|
$this->printer->cut();
|
||||||
//print '<pre>'.print_r($this->connector, true).'</pre>';
|
|
||||||
|
// If is DummyPrintConnector send to log to debugging
|
||||||
|
if($this->printer->connector instanceof DummyPrintConnector)
|
||||||
|
{
|
||||||
|
$data = $this->printer->connector-> getData();
|
||||||
|
dol_syslog($data);
|
||||||
|
}
|
||||||
$this->printer->close();
|
$this->printer->close();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->errors[] = $e->getMessage();
|
$this->errors[] = $e->getMessage();
|
||||||
@ -713,9 +720,13 @@ class dolReceiptPrinter extends Printer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If is DummyPrintConnector send to log to debugging
|
||||||
|
if($this->printer->connector instanceof DummyPrintConnector)
|
||||||
|
{
|
||||||
|
$data = $this->printer->connector->getData();
|
||||||
|
dol_syslog($data);
|
||||||
|
}
|
||||||
// Close and print
|
// Close and print
|
||||||
// uncomment next line to see content sent to printer
|
|
||||||
//print '<pre>'.print_r($this->connector, true).'</pre>';
|
|
||||||
$this->printer->close();
|
$this->printer->close();
|
||||||
}
|
}
|
||||||
return $error;
|
return $error;
|
||||||
@ -783,7 +794,6 @@ class dolReceiptPrinter extends Printer
|
|||||||
try {
|
try {
|
||||||
switch ($obj['fk_type']) {
|
switch ($obj['fk_type']) {
|
||||||
case 1:
|
case 1:
|
||||||
require_once DOL_DOCUMENT_ROOT .'/includes/mike42/escpos-php/src/DummyPrintConnector.php';
|
|
||||||
$this->connector = new DummyPrintConnector();
|
$this->connector = new DummyPrintConnector();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
@ -20,8 +20,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file class/emailsenderprofile.class.php
|
* \file core/class/emailsenderprofile.class.php
|
||||||
* \ingroup monmodule
|
* \ingroup core
|
||||||
* \brief This file is a CRUD class file for EmailSenderProfile (Create/Read/Update/Delete)
|
* \brief This file is a CRUD class file for EmailSenderProfile (Create/Read/Update/Delete)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
|||||||
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||||
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for EmailSenderProfile
|
* Class for EmailSenderProfile
|
||||||
*/
|
*/
|
||||||
@ -60,24 +61,29 @@ class EmailSenderProfile extends CommonObject
|
|||||||
const STATUS_ENABLED = 1;
|
const STATUS_ENABLED = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'type' if the field format ('integer', 'integer:Class:pathtoclass', 'varchar(x)', 'double(24,8)', 'text', 'html', 'datetime', 'timestamp', 'float')
|
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||||
|
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||||
* 'label' the translation key.
|
* 'label' the translation key.
|
||||||
* 'enabled' is a condition when the field must be managed.
|
* 'enabled' is a condition when the field must be managed.
|
||||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
* 'position' is the sort order of field.
|
||||||
* 'noteditable' says if field is not editable (1 or 0)
|
|
||||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||||
* 'default' is a default value for creation (can still be replaced by the global setup of default values)
|
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||||
|
* 'noteditable' says if field is not editable (1 or 0)
|
||||||
|
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||||
* 'index' if we want an index in database.
|
* 'index' if we want an index in database.
|
||||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||||
* 'position' is the sort order of field.
|
|
||||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||||
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||||
* 'help' is a string visible as a tooltip on field
|
* 'help' is a string visible as a tooltip on field
|
||||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
|
||||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||||
|
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||||
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||||
|
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||||
|
*
|
||||||
|
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// BEGIN MODULEBUILDER PROPERTIES
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
@ -90,12 +96,12 @@ class EmailSenderProfile extends CommonObject
|
|||||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
|
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
|
||||||
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
|
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
|
||||||
//'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
//'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||||
//'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>-1,),
|
'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
|
||||||
'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>-1, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
|
'signature' => array('type'=>'text', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
|
||||||
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
|
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),
|
||||||
'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1),
|
'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'default'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1, 'arrayofkeyval'=>array(0=>'Disabled', 1=>'Enabled')),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -213,7 +213,7 @@ class Form
|
|||||||
$valuetoshow = price2num($editvalue ? $editvalue : $value);
|
$valuetoshow = price2num($editvalue ? $editvalue : $value);
|
||||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').'>';
|
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').'>';
|
||||||
}
|
}
|
||||||
elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata))
|
elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) // if wysiwyg is enabled $typeofdata = 'ckeditor'
|
||||||
{
|
{
|
||||||
$tmp = explode(':', $typeofdata);
|
$tmp = explode(':', $typeofdata);
|
||||||
$cols = $tmp[2];
|
$cols = $tmp[2];
|
||||||
@ -225,8 +225,10 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$valuetoshow = ($editvalue ? $editvalue : $value);
|
$valuetoshow = ($editvalue ? $editvalue : $value);
|
||||||
|
|
||||||
$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1] ? $tmp[1] : '20').'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'">';
|
$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1] ? $tmp[1] : '20').'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'">';
|
||||||
|
// textarea convert automatically entities chars into simple chars.
|
||||||
|
// So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off.
|
||||||
|
$valuetoshow = str_replace('&', '&', $valuetoshow);
|
||||||
$ret .= dol_string_neverthesehtmltags($valuetoshow, array('textarea'));
|
$ret .= dol_string_neverthesehtmltags($valuetoshow, array('textarea'));
|
||||||
$ret .= '</textarea>';
|
$ret .= '</textarea>';
|
||||||
}
|
}
|
||||||
@ -697,9 +699,10 @@ class Form
|
|||||||
* @param int $showempty Show empty choice
|
* @param int $showempty Show empty choice
|
||||||
* @param int $disablefavorites 1=Disable favorites,
|
* @param int $disablefavorites 1=Disable favorites,
|
||||||
* @param int $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...)
|
* @param int $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...)
|
||||||
|
* @param array $exclude_country_code Array of country code (iso2) to exclude
|
||||||
* @return string HTML string with select
|
* @return string HTML string with select
|
||||||
*/
|
*/
|
||||||
public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0)
|
public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0, $exclude_country_code = array())
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs, $mysoc;
|
global $conf, $langs, $mysoc;
|
||||||
@ -731,6 +734,7 @@ class Form
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$countryArray[$i]['rowid'] = $obj->rowid;
|
$countryArray[$i]['rowid'] = $obj->rowid;
|
||||||
$countryArray[$i]['code_iso'] = $obj->code_iso;
|
$countryArray[$i]['code_iso'] = $obj->code_iso;
|
||||||
$countryArray[$i]['code_iso3'] = $obj->code_iso3;
|
$countryArray[$i]['code_iso3'] = $obj->code_iso3;
|
||||||
@ -763,6 +767,7 @@ class Form
|
|||||||
{
|
{
|
||||||
//if (empty($showempty) && empty($row['rowid'])) continue;
|
//if (empty($showempty) && empty($row['rowid'])) continue;
|
||||||
if (empty($row['rowid'])) continue;
|
if (empty($row['rowid'])) continue;
|
||||||
|
if (is_array($exclude_country_code) && count($exclude_country_code) && in_array($row['code_iso'], $exclude_country_code)) continue; // exclude some countries
|
||||||
|
|
||||||
if (empty($disablefavorites) && $row['favorite'] && $row['code_iso']) $atleastonefavorite++;
|
if (empty($disablefavorites) && $row['favorite'] && $row['code_iso']) $atleastonefavorite++;
|
||||||
if (empty($row['favorite']) && $atleastonefavorite)
|
if (empty($row['favorite']) && $atleastonefavorite)
|
||||||
@ -2359,6 +2364,7 @@ class Form
|
|||||||
$objp->price_ttc = price2num($objp->price_ttc, 'MU');
|
$objp->price_ttc = price2num($objp->price_ttc, 'MU');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected, $hidepriceinlabel, $filterkey);
|
$this->constructProductListOption($objp, $opt, $optJson, $price_level, $selected, $hidepriceinlabel, $filterkey);
|
||||||
// Add new entry
|
// Add new entry
|
||||||
// "key" value of json key array is used by jQuery automatically as selected value
|
// "key" value of json key array is used by jQuery automatically as selected value
|
||||||
@ -2509,7 +2515,7 @@ class Form
|
|||||||
$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
|
$sql .= " ORDER BY date_price DESC, rowid DESC"; // Warning DESC must be both on date_price and rowid.
|
||||||
$sql .= " LIMIT 1";
|
$sql .= " LIMIT 1";
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.'', LOG_DEBUG);
|
dol_syslog(get_class($this).'::constructProductListOption search price for product '.$objp->rowid.' AND level '.$price_level.'', LOG_DEBUG);
|
||||||
$result2 = $this->db->query($sql);
|
$result2 = $this->db->query($sql);
|
||||||
if ($result2)
|
if ($result2)
|
||||||
{
|
{
|
||||||
@ -2637,7 +2643,7 @@ class Form
|
|||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
|
||||||
$tmpproduct = new Product($this->db);
|
$tmpproduct = new Product($this->db);
|
||||||
$tmpproduct->fetch($objp->rowid);
|
$tmpproduct->fetch($objp->rowid, '', '', '', 1, 1, 1); // Load product without lang and prices arrays (we just need to make ->virtual_stock() after)
|
||||||
$tmpproduct->load_virtual_stock();
|
$tmpproduct->load_virtual_stock();
|
||||||
$virtualstock = $tmpproduct->stock_theorique;
|
$virtualstock = $tmpproduct->stock_theorique;
|
||||||
|
|
||||||
@ -5167,11 +5173,11 @@ class Form
|
|||||||
{
|
{
|
||||||
if ($societe_vendeuse->id == $mysoc->id)
|
if ($societe_vendeuse->id == $mysoc->id)
|
||||||
{
|
{
|
||||||
$return .= '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</div>';
|
$return .= '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</font>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$return .= '<font class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</div>';
|
$return .= '<font class="error">'.$langs->trans("ErrorSupplierCountryIsNotDefined").'</font>';
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
@ -6233,7 +6239,12 @@ class Form
|
|||||||
|
|
||||||
$out .= '<option value="'.$key.'"';
|
$out .= '<option value="'.$key.'"';
|
||||||
$out .= $style.$disabled;
|
$out .= $style.$disabled;
|
||||||
|
if (is_array($id)) {
|
||||||
|
if (in_array($key, $id) && !$disabled) $out .= ' selected'; // To preselect a value
|
||||||
|
} else {
|
||||||
|
$id = (string) $id; // if $id = 0, then $id = '0'
|
||||||
if ($id != '' && $id == $key && !$disabled) $out .= ' selected'; // To preselect a value
|
if ($id != '' && $id == $key && !$disabled) $out .= ' selected'; // To preselect a value
|
||||||
|
}
|
||||||
if ($nohtmlescape) $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
|
if ($nohtmlescape) $out .= ' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
|
||||||
if (is_array($tmpvalue))
|
if (is_array($tmpvalue))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -309,7 +309,7 @@ class FormAccounting extends Form
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$selected = 0;
|
$selected = $selectid; // selectid can be -1, 0, 123
|
||||||
while ($obj = $this->db->fetch_object($resql))
|
while ($obj = $this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
if (empty($obj->labelshort))
|
if (empty($obj->labelshort))
|
||||||
|
|||||||
@ -569,7 +569,9 @@ class FormMail extends Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add also email aliases from the c_email_senderprofile table
|
// Add also email aliases from the c_email_senderprofile table
|
||||||
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile WHERE active = 1 ORDER BY position';
|
$sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile';
|
||||||
|
$sql .= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')';
|
||||||
|
$sql .= ' ORDER BY position';
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -508,7 +508,7 @@ class SMTPs
|
|||||||
// The error here just means the ID/password combo doesn't work.
|
// The error here just means the ID/password combo doesn't work.
|
||||||
$_retVal = $this->socket_send_str(base64_encode("\0" . $this->_smtpsID . "\0" . $this->_smtpsPW), '235');
|
$_retVal = $this->socket_send_str(base64_encode("\0" . $this->_smtpsID . "\0" . $this->_smtpsPW), '235');
|
||||||
break;
|
break;
|
||||||
case 'LOGIN':
|
case 'LOGIN': // most common case
|
||||||
default:
|
default:
|
||||||
$this->socket_send_str('AUTH LOGIN', '334');
|
$this->socket_send_str('AUTH LOGIN', '334');
|
||||||
// User name will not return any error, server will take anything we give it.
|
// User name will not return any error, server will take anything we give it.
|
||||||
@ -588,7 +588,11 @@ class SMTPs
|
|||||||
// From this point onward most server response codes should be 250
|
// From this point onward most server response codes should be 250
|
||||||
// Specify who the mail is from....
|
// Specify who the mail is from....
|
||||||
// This has to be the raw email address, strip the "name" off
|
// This has to be the raw email address, strip the "name" off
|
||||||
$this->socket_send_str('MAIL FROM: ' . $this->getFrom('addr'), '250');
|
$resultmailfrom = $this->socket_send_str('MAIL FROM: ' . $this->getFrom('addr'), '250');
|
||||||
|
if (! $resultmailfrom) {
|
||||||
|
fclose($this->socket);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 'RCPT TO:' must be given a single address, so this has to loop
|
// 'RCPT TO:' must be given a single address, so this has to loop
|
||||||
// through the list of addresses, regardless of TO, CC or BCC
|
// through the list of addresses, regardless of TO, CC or BCC
|
||||||
@ -1792,6 +1796,7 @@ class SMTPs
|
|||||||
$_retVal = false;
|
$_retVal = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$this->log .= $server_response;
|
||||||
$limit++;
|
$limit++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,7 +158,7 @@ print '
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field page_y with value "+page_y);
|
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y);
|
||||||
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
jQuery("input[type=hidden][name=page_y]").val(page_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1818,7 +1818,7 @@ function email_admin_prepare_head()
|
|||||||
$head[$h][2] = 'templates';
|
$head[$h][2] = 'templates';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && !empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates'))
|
if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates'))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php";
|
$head[$h][0] = DOL_URL_ROOT."/admin/mails_senderprofile_list.php";
|
||||||
$head[$h][1] = $langs->trans("EmailSenderProfiles");
|
$head[$h][1] = $langs->trans("EmailSenderProfiles");
|
||||||
|
|||||||
@ -172,7 +172,7 @@ function account_statement_prepare_head($object, $num)
|
|||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$object->id.'&num='.$num;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$object->id.'&num='.$num;
|
||||||
$head[$h][1] = $langs->trans("AccountStatements");
|
$head[$h][1] = $langs->trans("AccountStatement");
|
||||||
$head[$h][2] = 'statement';
|
$head[$h][2] = 'statement';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@ -2963,19 +2963,22 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$perm = GETPOST('perm');
|
/*$perm = GETPOST('perm', 'aZ09');
|
||||||
$subperm = GETPOST('subperm');
|
$subperm = GETPOST('subperm', 'aZ09');
|
||||||
if ($perm || $subperm)
|
if ($perm || $subperm)
|
||||||
{
|
{
|
||||||
if (($perm && !$subperm && $fuser->rights->$modulepart->$perm) || ($perm && $subperm && $fuser->rights->$modulepart->$perm->$subperm)) $accessallowed = 1;
|
if (($perm && !$subperm && $fuser->rights->$modulepart->$perm) || ($perm && $subperm && $fuser->rights->$modulepart->$perm->$subperm)) $accessallowed = 1;
|
||||||
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{*/
|
||||||
|
// Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read
|
||||||
|
$partsofdirinoriginalfile = explode('/', $original_file);
|
||||||
|
$partofdirinoriginalfile = $partsofdirinoriginalfile[0];
|
||||||
|
if ($partofdirinoriginalfile && ($fuser->rights->$modulepart->$partofdirinoriginalfile->{$lire} || $fuser->rights->$modulepart->$partofdirinoriginalfile->{$read})) $accessallowed = 1;
|
||||||
if ($fuser->rights->$modulepart->{$lire} || $fuser->rights->$modulepart->{$read}) $accessallowed = 1;
|
if ($fuser->rights->$modulepart->{$lire} || $fuser->rights->$modulepart->{$read}) $accessallowed = 1;
|
||||||
|
//}
|
||||||
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
|
$original_file = $conf->$modulepart->dir_output.'/'.$original_file;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// For modules who wants to manage different levels of permissions for documents
|
// For modules who wants to manage different levels of permissions for documents
|
||||||
$subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS';
|
$subPermCategoryConstName = strtoupper($modulepart).'_SUBPERMCATEGORY_FOR_DOCUMENTS';
|
||||||
|
|||||||
@ -3060,7 +3060,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
||||||
if (empty($srconly) && in_array($pictowithouttext, array(
|
if (empty($srconly) && in_array($pictowithouttext, array(
|
||||||
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
|
||||||
'address', 'bank', 'bookmark', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
|
'address', 'barcode', 'bank', 'bookmark', 'building', 'cash-register', 'close_title', 'cubes', 'delete', 'dolly', 'edit', 'ellipsis-h',
|
||||||
'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
'filter', 'file-code', 'grip', 'grip_title', 'list', 'listlight', 'note',
|
||||||
'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
'object_bookmark', 'object_list', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser',
|
||||||
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'stats',
|
||||||
@ -4515,7 +4515,8 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function that return a number with universal decimal format (decimal separator is '.') from an amount typed by a user.
|
* Function that return a number with universal decimal format (decimal separator is '.') from an amount typed by a user.
|
||||||
* Function to use on each input amount before any numeric test or database insert
|
* Function to use on each input amount before any numeric test or database insert. A better name for this function
|
||||||
|
* should be text2num().
|
||||||
*
|
*
|
||||||
* @param float $amount Amount to convert/clean
|
* @param float $amount Amount to convert/clean
|
||||||
* @param string $rounding ''=No rounding
|
* @param string $rounding ''=No rounding
|
||||||
@ -4604,7 +4605,6 @@ function price2num($amount, $rounding = '', $alreadysqlnb = 0)
|
|||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output a dimension with best unit
|
* Output a dimension with best unit
|
||||||
*
|
*
|
||||||
@ -5703,11 +5703,16 @@ function dol_htmlcleanlastbr($stringtodecode)
|
|||||||
* @param string $a Operand a
|
* @param string $a Operand a
|
||||||
* @param string $b Operand b (ENT_QUOTES=convert simple and double quotes)
|
* @param string $b Operand b (ENT_QUOTES=convert simple and double quotes)
|
||||||
* @param string $c Operand c
|
* @param string $c Operand c
|
||||||
|
* @param string $keepsomeentities Entities but &, <, >, " are not converted.
|
||||||
* @return string String decoded
|
* @return string String decoded
|
||||||
*/
|
*/
|
||||||
function dol_html_entity_decode($a, $b, $c = 'UTF-8')
|
function dol_html_entity_decode($a, $b, $c = 'UTF-8', $keepsomeentities = 0)
|
||||||
{
|
{
|
||||||
return html_entity_decode($a, $b, $c);
|
$newstring = $a;
|
||||||
|
if ($keepsomeentities) $newstring = strtr($newstring, array('&'=>'__andamp__', '<'=>'__andlt__', '>'=>'__andgt__', '"'=>'__dquot__'));
|
||||||
|
$newstring = html_entity_decode($newstring, $b, $c);
|
||||||
|
if ($keepsomeentities) $newstring = strtr($newstring, array('__andamp__'=>'&', '__andlt__'=>'<', '__andgt__'=>'>', '__dquot__'=>'"'));
|
||||||
|
return $newstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -6039,7 +6044,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
|
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
|
||||||
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
|
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
|
||||||
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
|
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
|
||||||
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : '');
|
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = $outputlangs->transnoentities("AvailabilityType".$object->availability_code)!=('AvailabilityType'.$object->availability_code)?$outputlangs->transnoentities("AvailabilityType".$object->availability_code):$outputlangs->convToOutputCharset(isset($object->availability)?$object->availability:'');
|
||||||
|
|
||||||
$birthday = dol_print_date($object->birth, 'day');
|
$birthday = dol_print_date($object->birth, 'day');
|
||||||
|
|
||||||
@ -6084,6 +6089,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object) ? $object->address : '');
|
$substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object) ? $object->address : '');
|
||||||
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object) ? $object->zip : '');
|
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object) ? $object->zip : '');
|
||||||
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object) ? $object->town : '');
|
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object) ? $object->town : '');
|
||||||
|
$substitutionarray['__THIRDPARTY_COUNTRY_ID__'] = (is_object($object) ? $object->country_id : '');
|
||||||
|
$substitutionarray['__THIRDPARTY_COUNTRY_CODE__'] = (is_object($object) ? $object->country_code : '');
|
||||||
$substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object) ? $object->idprof1 : '');
|
$substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object) ? $object->idprof1 : '');
|
||||||
$substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object) ? $object->idprof2 : '');
|
$substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object) ? $object->idprof2 : '');
|
||||||
$substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object) ? $object->idprof3 : '');
|
$substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object) ? $object->idprof3 : '');
|
||||||
@ -6107,6 +6114,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
|||||||
$substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object->thirdparty) ? $object->thirdparty->address : '');
|
$substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object->thirdparty) ? $object->thirdparty->address : '');
|
||||||
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty) ? $object->thirdparty->zip : '');
|
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty) ? $object->thirdparty->zip : '');
|
||||||
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty) ? $object->thirdparty->town : '');
|
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty) ? $object->thirdparty->town : '');
|
||||||
|
$substitutionarray['__THIRDPARTY_COUNTRY_ID__'] = (is_object($object->thirdparty) ? $object->thirdparty->country_id : '');
|
||||||
|
$substitutionarray['__THIRDPARTY_COUNTRY_CODE__'] = (is_object($object->thirdparty) ? $object->thirdparty->country_code : '');
|
||||||
$substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof1 : '');
|
$substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof1 : '');
|
||||||
$substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof2 : '');
|
$substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof2 : '');
|
||||||
$substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof3 : '');
|
$substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object->thirdparty) ? $object->thirdparty->idprof3 : '');
|
||||||
@ -8493,7 +8502,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
|
|||||||
*/
|
*/
|
||||||
function isAFileWithExecutableContent($filename)
|
function isAFileWithExecutableContent($filename)
|
||||||
{
|
{
|
||||||
if (preg_match('/\.(htm|html|js|php|phtml|pl|py|cgi|ksh|sh|bash|bat|cmd|wpk|exe|dmg)$/i', $filename))
|
if (preg_match('/\.(htm|html|js|php|php\d+|phtml|pl|py|cgi|ksh|sh|bash|bat|cmd|wpk|exe|dmg)$/i', $filename))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2613,3 +2613,32 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow)
|
|||||||
$notetoshow = preg_replace('/src="[a-zA-Z0-9_\/\-\.]*(viewimage\.php\?modulepart=medias[^"]*)"/', 'src="'.$urlwithroot.'/\1"', $notetoshow);
|
$notetoshow = preg_replace('/src="[a-zA-Z0-9_\/\-\.]*(viewimage\.php\?modulepart=medias[^"]*)"/', 'src="'.$urlwithroot.'/\1"', $notetoshow);
|
||||||
return $notetoshow;
|
return $notetoshow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals)
|
||||||
|
* Function used into accountancy FEC export
|
||||||
|
*
|
||||||
|
* @param float $amount Amount to format
|
||||||
|
* @return string Chain with formatted upright
|
||||||
|
* @see price2num() Format a numeric into a price for FEC files
|
||||||
|
*/
|
||||||
|
function price2fec($amount)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
// Clean parameters
|
||||||
|
if (empty($amount)) $amount=0; // To have a numeric value if amount not defined or = ''
|
||||||
|
$amount = (is_numeric($amount) ? $amount : 0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number)
|
||||||
|
|
||||||
|
// Output decimal number by default
|
||||||
|
$nbdecimal = (empty($conf->global->ACCOUNTING_FEC_DECIMAL_LENGTH) ? 2 : $conf->global->ACCOUNTING_FEC_DECIMAL_LENGTH);
|
||||||
|
|
||||||
|
// Output separators by default
|
||||||
|
$dec = (empty($conf->global->ACCOUNTING_FEC_DECIMAL_SEPARATOR) ? ',' : $conf->global->ACCOUNTING_FEC_DECIMAL_SEPARATOR);
|
||||||
|
$thousand = (empty($conf->global->ACCOUNTING_FEC_THOUSAND_SEPARATOR) ? '' : $conf->global->ACCOUNTING_FEC_THOUSAND_SEPARATOR);
|
||||||
|
|
||||||
|
// Format number
|
||||||
|
$output = number_format($amount, $nbdecimal, $dec, $thousand);
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||||
|
* Copyright (C) 2019 Lenin Rivas <lenin.rivas@servcom-it.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -2153,6 +2154,17 @@ function pdf_getLinkedObjects($object, $outputlangs)
|
|||||||
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat, 'day', '', $outputlangs);
|
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat, 'day', '', $outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ($objecttype == 'fichinter')
|
||||||
|
{
|
||||||
|
$outputlangs->load('interventions');
|
||||||
|
foreach($objects as $elementobject)
|
||||||
|
{
|
||||||
|
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("InterRef");
|
||||||
|
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref);
|
||||||
|
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("InterDate");
|
||||||
|
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->datec, 'day', '', $outputlangs);
|
||||||
|
}
|
||||||
|
}
|
||||||
elseif ($objecttype == 'shipping')
|
elseif ($objecttype == 'shipping')
|
||||||
{
|
{
|
||||||
$outputlangs->loadLangs(array("orders", "sendings"));
|
$outputlangs->loadLangs(array("orders", "sendings"));
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Societe object that emits
|
* @var Societe Object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -160,8 +160,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -678,13 +676,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
|||||||
@ -77,7 +77,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
* Dolibarr version of the loaded document
|
* Dolibarr version of the loaded document
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $version = 'development';
|
public $version = 'dolibarr';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int page_largeur
|
* @var int page_largeur
|
||||||
@ -116,7 +116,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Societe
|
* @var Societe Object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -160,8 +160,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -200,9 +198,16 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||||
|
|
||||||
// Translations
|
// Load translation files required by the page
|
||||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
||||||
|
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
global $outputlangsbis;
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
||||||
|
}
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = count($object->lines);
|
||||||
|
|
||||||
$hidetop=0;
|
$hidetop=0;
|
||||||
@ -391,7 +396,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche notes
|
// Displays notes
|
||||||
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
|
||||||
{
|
{
|
||||||
@ -866,17 +871,17 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param int $posy Y
|
* @param int $posy Y
|
||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @return void
|
* @return int Pos y
|
||||||
*/
|
*/
|
||||||
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
|
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -1073,11 +1078,19 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
$largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||||
$useborder = 0;
|
$useborder = 0;
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
|
$outputlangsbis = null;
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||||
|
}
|
||||||
|
|
||||||
// Total HT
|
// Total HT
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
|
||||||
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
|
$total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
|
||||||
|
|
||||||
@ -1116,7 +1129,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1147,7 +1161,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1173,7 +1188,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$tvakey = str_replace('*', '', $tvakey);
|
$tvakey = str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat .= vatrate($tvakey, 1).$tvacompl;
|
$totalvat .= vatrate($tvakey, 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1204,7 +1220,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
|
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
@ -1236,7 +1253,8 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
|
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
@ -1253,7 +1271,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224, 224, 224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
@ -1276,7 +1294,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$index++;
|
$index++;
|
||||||
|
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
|
||||||
|
|
||||||
@ -1284,7 +1302,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224, 224, 224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
@ -1333,7 +1351,9 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
||||||
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128, 128, 128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
@ -1360,14 +1380,14 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
* @param int $showaddress 0=no, 1=yes
|
* @param int $showaddress 0=no, 1=yes
|
||||||
* @param Translate $outputlangs Object lang for output
|
* @param Translate $outputlangs Object lang for output
|
||||||
* @param string $titlekey Translation key to show as title of document
|
* @param string $titlekey Translation key to show as title of document
|
||||||
* @return void
|
* @return int Return topshift value
|
||||||
*/
|
*/
|
||||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle")
|
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "PdfOrderTitle")
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf,$langs,$hookmanager;
|
global $conf,$langs,$hookmanager;
|
||||||
|
|
||||||
// Translations
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));
|
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
@ -1449,7 +1469,15 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
$posy += 4;
|
$posy += 4;
|
||||||
$pdf->SetXY($posx, $posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "%d %b %Y", false, $outputlangs, true), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
|
||||||
|
|
||||||
|
if (!empty($conf->global->DOC_SHOW_CUSTOMER_CODE) && ! empty($object->thirdparty->code_client))
|
||||||
|
{
|
||||||
|
$posy+=4;
|
||||||
|
$pdf->SetXY($posx, $posy);
|
||||||
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
// Get contact
|
// Get contact
|
||||||
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
|
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
* \brief File of Class to generate PDF orders with template Proforma
|
* \brief File of Class to generate PDF orders with template Proforma
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_einstein.modules.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/doc/pdf_eratosthene.modules.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/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
|||||||
/**
|
/**
|
||||||
* Class to generate PDF orders with template Proforma
|
* Class to generate PDF orders with template Proforma
|
||||||
*/
|
*/
|
||||||
class pdf_proforma extends pdf_einstein
|
class pdf_proforma extends pdf_eratosthene
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -168,6 +168,13 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
// Load traductions files required by page
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
||||||
|
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
global $outputlangsbis;
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
||||||
|
}
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = count($object->lines);
|
||||||
|
|
||||||
// Loop on each lines to detect if there is at least one image to show
|
// Loop on each lines to detect if there is at least one image to show
|
||||||
@ -781,7 +788,9 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
||||||
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128, 128, 128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
|
|||||||
@ -155,8 +155,6 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise = !$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Societe object that emits
|
* @var Societe Object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -171,8 +171,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise = !$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur = $mysoc;
|
$this->emetteur = $mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -965,14 +963,14 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -1040,13 +1038,28 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
|
$lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
||||||
|
|
||||||
|
// Show online payment link
|
||||||
|
$useonlinepayment = ((! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)) && !empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT));
|
||||||
|
if ($object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD' && $object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$langs->loadLangs(array('payment', 'paybox'));
|
||||||
|
$servicename=$langs->transnoentities('Online');
|
||||||
|
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||||
|
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||||
|
|
||||||
|
$pdf->writeHTMLCell(80, 10, '', '', dol_htmlentitiesbr($linktopay), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$posy = $pdf->GetY() + 2;
|
$posy = $pdf->GetY() + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show payment mode CHQ
|
// Show payment mode CHQ
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// If unregulated or forced payment mode to CHQ
|
// If payment mode unregulated or payment mode forced to CHQ
|
||||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER))
|
if (!empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||||
{
|
{
|
||||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
* Dolibarr version of the loaded document
|
* Dolibarr version of the loaded document
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $version = 'development';
|
public $version = 'dolibarr';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int page_largeur
|
* @var int page_largeur
|
||||||
@ -117,7 +117,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Societe
|
* @var Societe Object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -171,8 +171,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -211,13 +209,22 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
|
global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
|
||||||
|
|
||||||
|
dol_syslog("write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang : 'null'));
|
||||||
|
|
||||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||||
|
|
||||||
// Translations
|
// Load translation files required by the page
|
||||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
|
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
|
||||||
|
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
global $outputlangsbis;
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies"));
|
||||||
|
}
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = count($object->lines);
|
||||||
|
|
||||||
$hidetop=0;
|
$hidetop=0;
|
||||||
@ -944,7 +951,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetFont('', '', $default_font_size - 4);
|
$pdf->SetFont('', '', $default_font_size - 4);
|
||||||
|
|
||||||
|
|
||||||
// Loop on each deposits and credit notes included
|
// Loop on each discount available (deposits and credit notes and excess of payment included)
|
||||||
$sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,";
|
$sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,";
|
||||||
$sql .= " re.description, re.fk_facture_source,";
|
$sql .= " re.description, re.fk_facture_source,";
|
||||||
$sql .= " f.type, f.datef";
|
$sql .= " f.type, f.datef";
|
||||||
@ -961,9 +968,10 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$y += 3;
|
$y += 3;
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
if ($obj->type == 2) $text = $outputlangs->trans("CreditNote");
|
if ($obj->type == 2) $text = $outputlangs->transnoentities("CreditNote");
|
||||||
elseif ($obj->type == 3) $text = $outputlangs->trans("Deposit");
|
elseif ($obj->type == 3) $text = $outputlangs->transnoentities("Deposit");
|
||||||
else $text = $outputlangs->trans("UnknownType");
|
elseif ($obj->type == 0) $text = $outputlangs->transnoentities("ExcessReceived");
|
||||||
|
else $text = $outputlangs->transnoentities("UnknownType");
|
||||||
|
|
||||||
$invoice->fetch($obj->fk_facture_source);
|
$invoice->fetch($obj->fk_facture_source);
|
||||||
|
|
||||||
@ -1037,18 +1045,18 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param int $posy Y
|
* @param int $posy Y
|
||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @return void
|
* @return int Pos y
|
||||||
*/
|
*/
|
||||||
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
|
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -1116,13 +1124,27 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
||||||
|
|
||||||
|
// Show online payment link
|
||||||
|
$useonlinepayment = ((! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)) && !empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT));
|
||||||
|
if ($object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD' && $object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$langs->loadLangs(array('payment', 'paybox'));
|
||||||
|
$servicename=$langs->transnoentities('Online');
|
||||||
|
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||||
|
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||||
|
|
||||||
|
$pdf->writeHTMLCell(80, 10, '', '', dol_htmlentitiesbr($linktopay), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show payment mode CHQ
|
// Show payment mode CHQ
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// If payment mode not forced or forced to CHQ
|
// If payment mode unregulated or payment mode forced to CHQ
|
||||||
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||||
{
|
{
|
||||||
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
||||||
@ -1192,7 +1214,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
*
|
*
|
||||||
* @param PDF $pdf Object PDF
|
* @param PDF $pdf Object PDF
|
||||||
* @param Facture $object Object invoice
|
* @param Facture $object Object invoice
|
||||||
* @param int $deja_regle Montant deja regle
|
* @param int $deja_regle Amount already paid (in the currency of invoice)
|
||||||
* @param int $posy Position depart
|
* @param int $posy Position depart
|
||||||
* @param Translate $outputlangs Objet langs
|
* @param Translate $outputlangs Objet langs
|
||||||
* @return int Position pour suite
|
* @return int Position pour suite
|
||||||
@ -1221,7 +1243,12 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$useborder=0;
|
$useborder=0;
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
|
$outputlangsbis = null;
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||||
|
}
|
||||||
|
|
||||||
// overall percentage of advancement
|
// overall percentage of advancement
|
||||||
$percent = 0;
|
$percent = 0;
|
||||||
@ -1358,7 +1385,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
if (! empty($conf->global->MAIN_SHOW_AMOUNT_DISCOUNT)) {
|
if (! empty($conf->global->MAIN_SHOW_AMOUNT_DISCOUNT)) {
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1);
|
||||||
|
|
||||||
@ -1368,7 +1395,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
if (! empty($conf->global->MAIN_SHOW_AMOUNT_BEFORE_DISCOUNT)) {
|
if (! empty($conf->global->MAIN_SHOW_AMOUNT_BEFORE_DISCOUNT)) {
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1);
|
||||||
|
|
||||||
@ -1379,8 +1406,9 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
// Total HT
|
// Total HT
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
|
||||||
|
|
||||||
|
$total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1);
|
||||||
|
|
||||||
@ -1424,7 +1452,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1456,7 +1485,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1506,7 +1536,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tvakey = str_replace('*', '', $tvakey);
|
$tvakey = str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat .= vatrate($tvakey, 1).$tvacompl;
|
$totalvat .= vatrate($tvakey, 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1537,7 +1568,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
|
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
@ -1570,7 +1602,8 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
|
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
@ -1587,7 +1620,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RevenueStamp", $mysoc->country_code) : ''), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1);
|
||||||
@ -1598,7 +1631,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224, 224, 224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
@ -1670,27 +1703,29 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
|
|
||||||
$pdf->SetTextColor(0, 0, 0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
$creditnoteamount = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received
|
||||||
$depositsamount = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
$depositsamount = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||||
|
|
||||||
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
if ($object->paye) $resteapayer=0;
|
if (!empty($object->paye)) $resteapayer = 0;
|
||||||
|
|
||||||
if (($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
if (($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
||||||
{
|
{
|
||||||
// Already paid + Deposits
|
// Already paid + Deposits
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', 0);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0);
|
||||||
|
|
||||||
// Credit note
|
// Credit note
|
||||||
if ($creditnoteamount)
|
if ($creditnoteamount)
|
||||||
{
|
{
|
||||||
|
$labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes");
|
||||||
|
$labeltouse .= (is_object($outputlangsbis) ? ' / '.($outputlangsbis->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangsbis->transnoentities("CreditNotesOrExcessReceived") : $outputlangsbis->transnoentities("CreditNotes") : '');
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', 0);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0);
|
||||||
}
|
}
|
||||||
@ -1702,7 +1737,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
|
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("EscompteOfferedShort") : ''), $useborder, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
|
|
||||||
@ -1713,7 +1748,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224, 224, 224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', 1);
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
|
|
||||||
@ -1775,7 +1810,9 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
||||||
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128, 128, 128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
@ -1806,7 +1843,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
// Translations
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "bills", "propal", "companies"));
|
$outputlangs->loadLangs(array("main", "bills", "propal", "companies"));
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|||||||
@ -42,6 +42,10 @@ abstract class ModelePDFFactures extends CommonDocGenerator
|
|||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
public $atleastonediscount = 0;
|
||||||
|
public $atleastoneratenotnull = 0;
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
|
|||||||
@ -142,8 +142,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||||
$this->option_codeproduitservice = 1; // Display product-service code
|
$this->option_codeproduitservice = 1; // Display product-service code
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
|
|||||||
@ -633,7 +633,7 @@ class modFournisseur extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
$this->remove($options);
|
$this->remove($options);
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class modMrp extends DolibarrModules
|
|||||||
|
|
||||||
// Id for module (must be unique).
|
// Id for module (must be unique).
|
||||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||||
$this->numero = 660; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module
|
$this->numero = 660;
|
||||||
// Key text used to identify module (for permissions, menus, etc...)
|
// Key text used to identify module (for permissions, menus, etc...)
|
||||||
$this->rights_class = 'mrp';
|
$this->rights_class = 'mrp';
|
||||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||||
@ -240,17 +240,17 @@ class modMrp extends DolibarrModules
|
|||||||
// Add here entries to declare new permissions
|
// Add here entries to declare new permissions
|
||||||
/* BEGIN MODULEBUILDER PERMISSIONS */
|
/* BEGIN MODULEBUILDER PERMISSIONS */
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Read objects of Mrp'; // Permission label
|
$this->rights[$r][1] = 'Read Manufacturing Order'; // Permission label
|
||||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Create/Update objects of Mrp'; // Permission label
|
$this->rights[$r][1] = 'Create/Update Manufacturing Order'; // Permission label
|
||||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||||
$this->rights[$r][1] = 'Delete objects of Mrp'; // Permission label
|
$this->rights[$r][1] = 'Delete Manufacturing Order'; // Permission label
|
||||||
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
||||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->mrp->level1->level2)
|
||||||
$r++;
|
$r++;
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Societe object that emits
|
* @var Societe Object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -160,8 +160,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise = !$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur = $mysoc;
|
$this->emetteur = $mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -866,13 +864,13 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Save the name of generated file as the main doc when generating a doc with this template
|
* @var string Save the name of generated file as the main doc when generating a doc with this template
|
||||||
*/
|
*/
|
||||||
public $update_main_doc_field;
|
public $update_main_doc_field;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
* Dolibarr version of the loaded document
|
* Dolibarr version of the loaded document
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $version = 'development';
|
public $version = 'dolibarr';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int page_largeur
|
* @var int page_largeur
|
||||||
@ -115,7 +115,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Societe
|
* @var Societe Object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -159,8 +159,6 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -199,9 +197,16 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||||
|
|
||||||
// Translations
|
// Load traductions files required by page
|
||||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||||
|
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
global $outputlangsbis;
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||||
|
}
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = count($object->lines);
|
||||||
|
|
||||||
$hidetop=0;
|
$hidetop=0;
|
||||||
@ -238,7 +243,11 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
if (! $arephoto)
|
if (! $arephoto)
|
||||||
{
|
{
|
||||||
$dir = $conf->product->dir_output.'/'.$midir;
|
if ($conf->product->entity != $objphoto->entity) {
|
||||||
|
$dir = $conf->product->multidir_output[$objphoto->entity].'/'.$midir; //Check repertories of current entities
|
||||||
|
} else {
|
||||||
|
$dir = $conf->product->dir_output.'/'.$midir; //Check repertory of the current product
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
|
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
|
||||||
{
|
{
|
||||||
@ -413,11 +422,13 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
$tmpuser=new User($this->db);
|
$tmpuser=new User($this->db);
|
||||||
$tmpuser->fetch($object->user_author_id);
|
$tmpuser->fetch($object->user_author_id);
|
||||||
$notetoshow.='Affaire suivi par '.$tmpuser->getFullName($langs);
|
$notetoshow .= $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs);
|
||||||
if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email;
|
if ($tmpuser->email) $notetoshow.=', Mail: '.$tmpuser->email;
|
||||||
if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone;
|
if ($tmpuser->office_phone) $notetoshow.=', Tel: '.$tmpuser->office_phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tab_height = $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter;
|
||||||
|
|
||||||
$pagenb = $pdf->getPage();
|
$pagenb = $pdf->getPage();
|
||||||
if ($notetoshow)
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
@ -529,7 +540,6 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$posyafter = $tab_top_newpage;
|
$posyafter = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
$tab_top = $posyafter + 6;
|
$tab_top = $posyafter + 6;
|
||||||
}
|
}
|
||||||
@ -962,17 +972,17 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
* @param Object $object Object to show
|
* @param Object $object Object to show
|
||||||
* @param int $posy Y
|
* @param int $posy Y
|
||||||
* @param Translate $outputlangs Langs object
|
* @param Translate $outputlangs Langs object
|
||||||
* @return void
|
* @return int Pos y
|
||||||
*/
|
*/
|
||||||
public function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
|
public function drawInfoTable(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -1147,6 +1157,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
global $conf, $mysoc;
|
global $conf, $mysoc;
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$tab2_top = $posy;
|
$tab2_top = $posy;
|
||||||
@ -1164,12 +1175,19 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$useborder = 0;
|
$useborder = 0;
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
|
$outputlangsbis = null;
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "dict", "companies", "bills", "products", "propal"));
|
||||||
|
}
|
||||||
|
|
||||||
// Total HT
|
// Total HT
|
||||||
$pdf->SetFillColor(255, 255, 255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
|
||||||
|
|
||||||
$total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
|
$total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
|
||||||
$pdf->SetXY($col2x, $tab2_top + 0);
|
$pdf->SetXY($col2x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1);
|
||||||
|
|
||||||
@ -1210,7 +1228,8 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1244,7 +1263,8 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1270,7 +1290,8 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$tvakey = str_replace('*', '', $tvakey);
|
$tvakey = str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
$totalvat .= vatrate($tvakey, 1).$tvacompl;
|
$totalvat .= vatrate($tvakey, 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1301,7 +1322,8 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : '');
|
||||||
|
$totalvat.=' ';
|
||||||
|
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
@ -1334,7 +1356,8 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$tvakey=str_replace('*', '', $tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' ';
|
$totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : '');
|
||||||
|
$totalvat.= ' ';
|
||||||
|
|
||||||
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
@ -1351,7 +1374,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224, 224, 224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
@ -1360,6 +1383,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
|
|
||||||
$pdf->SetTextColor(0, 0, 0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
|
$resteapayer = 0;
|
||||||
/*
|
/*
|
||||||
$resteapayer = $object->total_ttc - $deja_regle;
|
$resteapayer = $object->total_ttc - $deja_regle;
|
||||||
if (! empty($object->paye)) $resteapayer=0;
|
if (! empty($object->paye)) $resteapayer=0;
|
||||||
@ -1370,7 +1394,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$index++;
|
$index++;
|
||||||
|
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0);
|
||||||
@ -1395,7 +1419,7 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224, 224, 224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1);
|
||||||
@ -1444,7 +1468,9 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
||||||
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128, 128, 128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
@ -1453,7 +1479,6 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
// Output Rect
|
// Output Rect
|
||||||
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter
|
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter
|
||||||
|
|
||||||
|
|
||||||
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
||||||
|
|
||||||
if (empty($hidetop)){
|
if (empty($hidetop)){
|
||||||
@ -1475,10 +1500,8 @@ class pdf_cyan extends ModelePDFPropales
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$outputlangs->load("main");
|
// Load traductions files required by page
|
||||||
$outputlangs->load("bills");
|
$outputlangs->loadLangs(array("main", "propal", "companies", "bills"));
|
||||||
$outputlangs->load("propal");
|
|
||||||
$outputlangs->load("companies");
|
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
|
* \file htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
|
||||||
* \ingroup fournisseur
|
* \ingroup fournisseur
|
||||||
* \brief Class file to generate the supplier invoices with the canelle model
|
* \brief Class file to generate the supplier invoices with the canelle model
|
||||||
*/
|
*/
|
||||||
@ -152,8 +152,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
|
|
||||||
$this->franchise = !$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Define column position
|
// Define column position
|
||||||
$this->posxdesc = $this->marge_gauche + 1;
|
$this->posxdesc = $this->marge_gauche + 1;
|
||||||
$this->posxtva = 112;
|
$this->posxtva = 112;
|
||||||
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/supplier_order/pdf/doc_generic_supplier_order_odt.modules.php
|
* \file htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
|
||||||
* \ingroup commande
|
* \ingroup commande
|
||||||
* \brief File of class to build ODT documents for supplier orders
|
* \brief File of class to build ODT documents for supplier orders
|
||||||
*/
|
*/
|
||||||
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/supplier_order/pdf/pdf_cornas.modules.php
|
* \file htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php
|
||||||
* \ingroup fournisseur
|
* \ingroup fournisseur
|
||||||
* \brief File of class to generate suppliers orders from cornas model
|
* \brief File of class to generate suppliers orders from cornas model
|
||||||
*/
|
*/
|
||||||
@ -71,7 +71,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
* Dolibarr version of the loaded document
|
* Dolibarr version of the loaded document
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $version = 'development';
|
public $version = 'dolibarr';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int page_largeur
|
* @var int page_largeur
|
||||||
@ -153,8 +153,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise = !$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur = $mysoc;
|
$this->emetteur = $mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -194,6 +192,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$outputlangs->loadLangs(array("main", "orders", "companies", "bills", "dict", "products"));
|
$outputlangs->loadLangs(array("main", "orders", "companies", "bills", "dict", "products"));
|
||||||
|
|
||||||
|
if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
|
||||||
|
global $outputlangsbis;
|
||||||
|
$outputlangsbis = new Translate('', $conf);
|
||||||
|
$outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
|
||||||
|
$outputlangsbis->loadLangs(array("main", "orders", "companies", "bills", "dict", "products"));
|
||||||
|
}
|
||||||
|
|
||||||
$nblines = count($object->lines);
|
$nblines = count($object->lines);
|
||||||
|
|
||||||
$hidetop=0;
|
$hidetop=0;
|
||||||
@ -328,8 +333,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (!empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (!empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
@ -830,11 +833,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -1134,7 +1137,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
||||||
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128, 128, 128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
@ -1364,9 +1369,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// If BILLING contact defined on order, we use it
|
// If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER'
|
||||||
$usecontact = false;
|
$usecontact = false;
|
||||||
$arrayidcontact = $object->getIdContact('external', 'BILLING');
|
$arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
|
||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$usecontact = true;
|
$usecontact = true;
|
||||||
@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
|
* \file htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php
|
||||||
* \ingroup fournisseur
|
* \ingroup fournisseur
|
||||||
* \brief File of class to generate suppliers orders from muscadet model
|
* \brief File of class to generate suppliers orders from muscadet model
|
||||||
*/
|
*/
|
||||||
@ -129,7 +129,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->name = "muscadet";
|
$this->name = "muscadet";
|
||||||
$this->description = $langs->trans('SuppliersCommandModel');
|
$this->description = $langs->trans('SuppliersCommandModelMuscadet');
|
||||||
|
|
||||||
// Page size for A4 format
|
// Page size for A4 format
|
||||||
$this->type = 'pdf';
|
$this->type = 'pdf';
|
||||||
@ -153,8 +153,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
@ -732,11 +730,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf, $mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// If France, show VAT mention if not applicable
|
// If France, show VAT mention if not applicable
|
||||||
if ($this->emetteur->country_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -142,8 +142,6 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
|||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Define column position
|
// Define column position
|
||||||
$this->posxdate=$this->marge_gauche+1;
|
$this->posxdate=$this->marge_gauche+1;
|
||||||
$this->posxreffacturefourn=30;
|
$this->posxreffacturefourn=30;
|
||||||
|
|||||||
@ -150,8 +150,6 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||||
|
|
||||||
$this->franchise=!$mysoc->tva_assuj;
|
|
||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
|
|||||||
@ -620,7 +620,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
/* When changing predefined product, we reload list of supplier prices required for margin combo */
|
/* When changing predefined product, we reload list of supplier prices required for margin combo */
|
||||||
$("#idprod, #idprodfournprice").change(function()
|
$("#idprod, #idprodfournprice").change(function()
|
||||||
{
|
{
|
||||||
console.log("#idprod, #idprodfournprice change triggered this.val = "+$(this).val());
|
console.log("Call method change() after change on #idprod or #idprodfournprice. this.val = "+$(this).val());
|
||||||
|
|
||||||
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
|
setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva
|
||||||
|
|
||||||
@ -631,6 +631,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
// Get the HT price for the product and display it
|
// Get the HT price for the product and display it
|
||||||
|
console.log("Load price without tax and set it into #price_ht");
|
||||||
$.post('<?php echo DOL_URL_ROOT; ?>/product/ajax/products.php?action=fetch',
|
$.post('<?php echo DOL_URL_ROOT; ?>/product/ajax/products.php?action=fetch',
|
||||||
{ 'id': $(this).val(), 'socid' : <?php print $object->socid; ?> },
|
{ 'id': $(this).val(), 'socid' : <?php print $object->socid; ?> },
|
||||||
function(data) { jQuery("#price_ht").val(data.price_ht); },
|
function(data) { jQuery("#price_ht").val(data.price_ht); },
|
||||||
|
|||||||
@ -66,11 +66,11 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
|
|||||||
|
|
||||||
$coldisplay = 0; ?>
|
$coldisplay = 0; ?>
|
||||||
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
|
<!-- BEGIN PHP TEMPLATE objectline_view.tpl.php -->
|
||||||
<tr id="row-<?php echo $line->id?>" class="drag drop oddeven" <?php echo $domData; ?> >
|
<tr id="row-<?php print $line->id?>" class="drag drop oddeven" <?php print $domData; ?> >
|
||||||
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||||
<td class="linecolnum center"><?php $coldisplay++; ?><?php echo ($i + 1); ?></td>
|
<td class="linecolnum center"><?php $coldisplay++; ?><?php print ($i + 1); ?></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php echo $line->id; ?>"></div>
|
<td class="linecoldescription minwidth300imp"><?php $coldisplay++; ?><div id="line_<?php print $line->id; ?>"></div>
|
||||||
<?php
|
<?php
|
||||||
if (($line->info_bits & 2) == 2) {
|
if (($line->info_bits & 2) == 2) {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid.'">';
|
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->socid.'">';
|
||||||
@ -88,32 +88,32 @@ if (($line->info_bits & 2) == 2) {
|
|||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromCreditNote", $discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0)
|
elseif ($line->description == '(DEPOSIT)' && $line->fk_remise_except > 0)
|
||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromDeposit", $discount->getNomUrl(0));
|
||||||
// Add date of deposit
|
// Add date of deposit
|
||||||
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE))
|
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE))
|
||||||
echo ' ('.dol_print_date($discount->datec).')';
|
print ' ('.dol_print_date($discount->datec).')';
|
||||||
}
|
}
|
||||||
elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
|
elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0)
|
||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessReceived", $discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0)
|
elseif ($line->description == '(EXCESS PAID)' && $objp->fk_remise_except > 0)
|
||||||
{
|
{
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
echo ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0));
|
print ($txt ? ' - ' : '').$langs->transnoentities("DiscountFromExcessPaid", $discount->getNomUrl(0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description);
|
print ($txt ? ' - ' : '').dol_htmlentitiesbr($line->description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ else
|
|||||||
|
|
||||||
if ($line->fk_product > 0)
|
if ($line->fk_product > 0)
|
||||||
{
|
{
|
||||||
echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -132,24 +132,30 @@ else
|
|||||||
|
|
||||||
if (!empty($line->label)) {
|
if (!empty($line->label)) {
|
||||||
$text .= ' <strong>'.$line->label.'</strong>';
|
$text .= ' <strong>'.$line->label.'</strong>';
|
||||||
echo $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
print $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
||||||
} else {
|
} else {
|
||||||
if (!empty($line->fk_parent_line)) echo img_picto('', 'rightarrow');
|
if (!empty($line->fk_parent_line)) print img_picto('', 'rightarrow');
|
||||||
echo $text.' '.dol_htmlentitiesbr($line->description);
|
if (preg_match('/^\(DEPOSIT\)/', $line->description)) {
|
||||||
|
$newdesc = preg_replace('/^\(DEPOSIT\)/', $langs->trans("Deposit"), $line->description);
|
||||||
|
print $text.' '.dol_htmlentitiesbr($newdesc);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print $text.' '.dol_htmlentitiesbr($line->description);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show date range
|
// Show date range
|
||||||
if ($line->element == 'facturedetrec') {
|
if ($line->element == 'facturedetrec') {
|
||||||
if ($line->date_start_fill || $line->date_end_fill) echo '<br><div class="clearboth nowraponall">';
|
if ($line->date_start_fill || $line->date_end_fill) print '<br><div class="clearboth nowraponall">';
|
||||||
if ($line->date_start_fill) echo $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
|
if ($line->date_start_fill) print $langs->trans('AutoFillDateFromShort').': '.yn($line->date_start_fill);
|
||||||
if ($line->date_start_fill && $line->date_end_fill) echo ' - ';
|
if ($line->date_start_fill && $line->date_end_fill) print ' - ';
|
||||||
if ($line->date_end_fill) echo $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
|
if ($line->date_end_fill) print $langs->trans('AutoFillDateToShort').': '.yn($line->date_end_fill);
|
||||||
if ($line->date_start_fill || $line->date_end_fill) echo '</div>';
|
if ($line->date_start_fill || $line->date_end_fill) print '</div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($line->date_start || $line->date_end) echo '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
|
if ($line->date_start || $line->date_end) print '<br><div class="clearboth nowraponall">'.get_date_range($line->date_start, $line->date_end, $format).'</div>';
|
||||||
//echo get_date_range($line->date_start, $line->date_end, $format);
|
//print get_date_range($line->date_start, $line->date_end, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add description in form
|
// Add description in form
|
||||||
@ -164,15 +170,16 @@ if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0)
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||||
$productfourn = new ProductFournisseur($this->db);
|
$productfourn = new ProductFournisseur($this->db);
|
||||||
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
|
$productfourn->fetch_product_fournisseur_price($line->fk_fournprice);
|
||||||
echo '<div class="clearboth"></div><span class="opacitymedium">'.$langs->trans('Supplier').' : </span>'.$productfourn->getSocNomUrl(1, 'supplier').' - <span class="opacitymedium">'.$langs->trans('Ref').' : </span>';
|
print '<div class="clearboth"></div>';
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans('Supplier').' : </span>'.$productfourn->getSocNomUrl(1, 'supplier').' - <span class="opacitymedium">'.$langs->trans('Ref').' : </span>';
|
||||||
// Supplier ref
|
// Supplier ref
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer) // change required right here
|
if ($user->rights->produit->creer || $user->rights->service->creer) // change required right here
|
||||||
{
|
{
|
||||||
echo $productfourn->getNomUrl();
|
print $productfourn->getNomUrl();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo $productfourn->ref_supplier;
|
print $productfourn->ref_supplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,14 +187,14 @@ if (!empty($conf->accounting->enabled) && $line->fk_accounting_account > 0)
|
|||||||
{
|
{
|
||||||
$accountingaccount = new AccountingAccount($this->db);
|
$accountingaccount = new AccountingAccount($this->db);
|
||||||
$accountingaccount->fetch($line->fk_accounting_account);
|
$accountingaccount->fetch($line->fk_accounting_account);
|
||||||
echo '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1);
|
print '<div class="clearboth"></div><br><span class="opacitymedium">'.$langs->trans('AccountingAffectation').' : </span>'.$accountingaccount->getNomUrl(0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
|
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
|
||||||
{
|
{
|
||||||
print '<td class="linecolrefsupplier">';
|
print '<td class="linecolrefsupplier">';
|
||||||
echo ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier);
|
print ($line->ref_fourn ? $line->ref_fourn : $line->ref_supplier);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// VAT Rate
|
// VAT Rate
|
||||||
@ -198,18 +205,18 @@ if (price2num($line->tva_tx)) $positiverates .= ($positiverates ? '/' :
|
|||||||
if (price2num($line->total_localtax1)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx);
|
if (price2num($line->total_localtax1)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax1_tx);
|
||||||
if (price2num($line->total_localtax2)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx);
|
if (price2num($line->total_localtax2)) $positiverates .= ($positiverates ? '/' : '').price2num($line->localtax2_tx);
|
||||||
if (empty($positiverates)) $positiverates = '0';
|
if (empty($positiverates)) $positiverates = '0';
|
||||||
echo vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits);
|
print vatrate($positiverates.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''), '%', $line->info_bits);
|
||||||
//echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits);
|
//print vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits);
|
||||||
?></td>
|
?></td>
|
||||||
|
|
||||||
<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>
|
<td class="linecoluht nowrap right"><?php $coldisplay++; ?><?php print price($line->subprice); ?></td>
|
||||||
|
|
||||||
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
|
<?php if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) { ?>
|
||||||
<td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php echo price($line->multicurrency_subprice); ?></td>
|
<td class="linecoluht_currency nowrap right"><?php $coldisplay++; ?><?php print price($line->multicurrency_subprice); ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
if ($inputalsopricewithtax) { ?>
|
if ($inputalsopricewithtax) { ?>
|
||||||
<td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php echo (isset($line->pu_ttc) ?price($line->pu_ttc) : price($line->subprice)); ?></td>
|
<td class="linecoluttc nowrap right"><?php $coldisplay++; ?><?php print (isset($line->pu_ttc) ?price($line->pu_ttc) : price($line->subprice)); ?></td>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
|
<td class="linecolqty nowrap right"><?php $coldisplay++; ?>
|
||||||
@ -219,8 +226,8 @@ if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
|
|||||||
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
|
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
|
||||||
// must also not be output for most entities (proposal, intervention, ...)
|
// must also not be output for most entities (proposal, intervention, ...)
|
||||||
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
|
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
|
||||||
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
print price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
|
||||||
} else echo ' ';
|
} else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($conf->global->PRODUCT_USE_UNITS)
|
if ($conf->global->PRODUCT_USE_UNITS)
|
||||||
@ -236,7 +243,7 @@ if (!empty($line->remise_percent) && $line->special_code != 3) {
|
|||||||
print '<td class="linecoldiscount right">';
|
print '<td class="linecoldiscount right">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
echo dol_print_reduction($line->remise_percent, $langs);
|
print dol_print_reduction($line->remise_percent, $langs);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td class="linecoldiscount"> </td>';
|
print '<td class="linecoldiscount"> </td>';
|
||||||
@ -258,17 +265,17 @@ if ($this->situation_cycle_ref)
|
|||||||
if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid))
|
if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid))
|
||||||
{
|
{
|
||||||
if (!empty($user->rights->margins->creer)) { ?>
|
if (!empty($user->rights->margins->creer)) { ?>
|
||||||
<td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
|
<td class="linecolmargin1 nowrap margininfos right"><?php $coldisplay++; ?><?php print price($line->pa_ht); ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
|
if (!empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
|
||||||
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0) ? 'n/a' : price(price2num($line->marge_tx, 'MT')).'%'); ?></td>
|
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php print (($line->pa_ht == 0) ? 'n/a' : price(price2num($line->marge_tx, 'MT')).'%'); ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
|
if (!empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
|
||||||
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php echo price(price2num($line->marque_tx, 'MT')).'%'; ?></td>
|
<td class="linecolmargin2 nowrap margininfos right"><?php $coldisplay++; ?><?php print price(price2num($line->marque_tx, 'MT')).'%'; ?></td>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
if ($line->special_code == 3) { ?>
|
if ($line->special_code == 3) { ?>
|
||||||
<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
|
<td class="linecoloption nowrap right"><?php $coldisplay++; ?><?php print $langs->trans('Option'); ?></td>
|
||||||
<?php } else {
|
<?php } else {
|
||||||
print '<td class="linecolht nowrap right">';
|
print '<td class="linecolht nowrap right">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
@ -303,8 +310,8 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
if (($line->info_bits & 2) == 2 || !empty($disableedit)) {
|
||||||
} else { ?>
|
} else { ?>
|
||||||
<a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>">
|
<a href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=editline&lineid='.$line->id.'#line_'.$line->id; ?>">
|
||||||
<?php echo img_edit().'</a>';
|
<?php print img_edit().'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -321,13 +328,13 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
print '<td class="linecolmove tdlineupdown center">';
|
print '<td class="linecolmove tdlineupdown center">';
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
if ($i > 0) { ?>
|
if ($i > 0) { ?>
|
||||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id; ?>">
|
||||||
<?php echo img_up('default', 0, 'imgupforline'); ?>
|
<?php print img_up('default', 0, 'imgupforline'); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php }
|
<?php }
|
||||||
if ($i < $num - 1) { ?>
|
if ($i < $num - 1) { ?>
|
||||||
<a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
<a class="lineupdown" href="<?php print $_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id; ?>">
|
||||||
<?php echo img_down('default', 0, 'imgdownforline'); ?>
|
<?php print img_down('default', 0, 'imgdownforline'); ?>
|
||||||
</a>
|
</a>
|
||||||
<?php }
|
<?php }
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -341,7 +348,7 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'selectlines') { ?>
|
if ($action == 'selectlines') { ?>
|
||||||
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i + 1; ?>]" value="<?php echo $line->id; ?>" ></td>
|
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php print $i + 1; ?>]" value="<?php print $line->id; ?>" ></td>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -389,6 +389,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$link = '<a href="' . $link . '">' . $link . '</a>';
|
||||||
$message = $langs->transnoentities("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut, $object->date_fin, '', $langs), $link);
|
$message = $langs->transnoentities("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut, $object->date_fin, '', $langs), $link);
|
||||||
|
|
||||||
// Rebuild pdf
|
// Rebuild pdf
|
||||||
@ -508,6 +509,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$link = '<a href="' . $link . '">' . $link . '</a>';
|
||||||
$dateRefusEx = explode(" ", $object->date_refuse);
|
$dateRefusEx = explode(" ", $object->date_refuse);
|
||||||
$message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link);
|
$message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link);
|
||||||
|
|
||||||
@ -633,6 +635,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$link = '<a href="' . $link . '">' . $link . '</a>';
|
||||||
$message = $langs->transnoentities("ExpenseReportApprovedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
|
$message = $langs->transnoentities("ExpenseReportApprovedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
|
||||||
|
|
||||||
// Rebuilt pdf
|
// Rebuilt pdf
|
||||||
@ -703,7 +706,8 @@ if (empty($reshook))
|
|||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
$result = $object->setDeny($user, GETPOST('detail_refuse', 'alpha'));
|
$detailRefuse = GETPOST('detail_refuse', 'alpha');
|
||||||
|
$result = $object->setDeny($user, $detailRefuse);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -751,7 +755,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
$message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $_POST['detail_refuse'], $link);
|
$link = '<a href="' . $link . '">' . $link . '</a>';
|
||||||
|
$message = $langs->transnoentities("ExpenseReportRefusedMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $detailRefuse, $link);
|
||||||
|
|
||||||
// Rebuilt pdf
|
// Rebuilt pdf
|
||||||
/*
|
/*
|
||||||
@ -831,7 +836,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($user->id == $object->fk_user_valid || $user->id == $object->fk_user_author)
|
if ($user->id == $object->fk_user_valid || $user->id == $object->fk_user_author)
|
||||||
{
|
{
|
||||||
$result = $object->set_cancel($user, GETPOST('detail_cancel', 'alpha'));
|
$detailCancel = GETPOST('detail_cancel', 'alpha');
|
||||||
|
$result = $object->set_cancel($user, $detailCancel);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
@ -879,7 +885,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
$message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), GETPOST('detail_cancel', 'alpha'), $link);
|
$link = '<a href="' . $link . '">' . $link . '</a>';
|
||||||
|
$message = $langs->transnoentities("ExpenseReportCanceledMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $detailCancel, $link);
|
||||||
|
|
||||||
// Rebuilt pdf
|
// Rebuilt pdf
|
||||||
/*
|
/*
|
||||||
@ -1104,6 +1111,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// CONTENT
|
// CONTENT
|
||||||
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
$link = $urlwithroot.'/expensereport/card.php?id='.$object->id;
|
||||||
|
$link = '<a href="' . $link . '">' . $link . '</a>';
|
||||||
$message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
|
$message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link);
|
||||||
|
|
||||||
// Generate pdf before attachment
|
// Generate pdf before attachment
|
||||||
@ -1735,7 +1743,7 @@ else
|
|||||||
if ($action == 'cancel')
|
if ($action == 'cancel')
|
||||||
{
|
{
|
||||||
$array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text", 'label'=>'<strong>'.$langs->trans("Comment").'</strong>', 'name'=>"detail_cancel", 'value'=>""));
|
$array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text", 'label'=>'<strong>'.$langs->trans("Comment").'</strong>', 'name'=>"detail_cancel", 'value'=>""));
|
||||||
$formconfirm = $form->formconfirm($_SEVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setdraft')
|
if ($action == 'setdraft')
|
||||||
|
|||||||
@ -377,7 +377,7 @@ if ($step == 2 && $action == 'select_model')
|
|||||||
$result = $objexport->fetch($exportmodelid);
|
$result = $objexport->fetch($exportmodelid);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$fieldsarray = explode(',', $objexport->hexa);
|
$fieldsarray = preg_split("/,(?! [^(]*\))/", $objexport->hexa);
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach($fieldsarray as $val)
|
foreach($fieldsarray as $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -705,7 +705,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
|
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
|
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
|
||||||
@ -2691,8 +2691,13 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$this->date_lim_reglement = $this->date + 3600 * 24 * 30;
|
$this->date_lim_reglement = $this->date + 3600 * 24 * 30;
|
||||||
$this->cond_reglement_code = 'RECEP';
|
$this->cond_reglement_code = 'RECEP';
|
||||||
$this->mode_reglement_code = 'CHQ';
|
$this->mode_reglement_code = 'CHQ';
|
||||||
|
|
||||||
$this->note_public = 'This is a comment (public)';
|
$this->note_public = 'This is a comment (public)';
|
||||||
$this->note_private = 'This is a comment (private)';
|
$this->note_private = 'This is a comment (private)';
|
||||||
|
|
||||||
|
$this->multicurrency_tx = 1;
|
||||||
|
$this->multicurrency_code = $conf->currency;
|
||||||
|
|
||||||
$this->statut = 0;
|
$this->statut = 0;
|
||||||
|
|
||||||
// Lines
|
// Lines
|
||||||
@ -2953,7 +2958,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$modelpath = "core/modules/supplier_order/pdf/";
|
$modelpath = "core/modules/supplier_order/doc/";
|
||||||
|
|
||||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user