Merge branch 'develop' into patch-2
This commit is contained in:
commit
eedbcbdc40
18
ChangeLog
18
ChangeLog
@ -2,8 +2,20 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* Hook 'maildao' was renamed into 'mail' into the method sendfile that send emails, and method was renamed from
|
||||||
|
'doaction' into 'sendMail'.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 7.0.0 compared to 6.0.5 *****
|
***** ChangeLog for 7.0.0 compared to 6.0.5 *****
|
||||||
For users:
|
For users:
|
||||||
|
NEW: When payment is registered, PDF of invoices are also regenerated so payments
|
||||||
|
appears with no need to click on regenerate.
|
||||||
NEW: #5711 Add shipment line deleting and editing for draft shipments.
|
NEW: #5711 Add shipment line deleting and editing for draft shipments.
|
||||||
NEW: Accept substitution key __[ABC]__ replaced with value of const ABC
|
NEW: Accept substitution key __[ABC]__ replaced with value of const ABC
|
||||||
NEW: Accountancy Add variant on sell account for intracommunity sales & export sales
|
NEW: Accountancy Add variant on sell account for intracommunity sales & export sales
|
||||||
@ -276,6 +288,12 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
and add 'td.' to the beginning of the dragHandle match string.
|
and add 'td.' to the beginning of the dragHandle match string.
|
||||||
* IE8 and earlier and Firefox 12 and earlier (< 2012) are no more supported.
|
* IE8 and earlier and Firefox 12 and earlier (< 2012) are no more supported.
|
||||||
|
|
||||||
|
* If you use the external module "multicompany", you must also upgrade the module. Multicompany module for
|
||||||
|
Dolibarr v7 is required because with Dolibarr v7, payment modes and payment conditions are management as data
|
||||||
|
that are dedicated to each company. If you keep your old version of multicompany module, mode and
|
||||||
|
condition of payments will appears empty in all companies that are not the first one. By upgrading the
|
||||||
|
multicompany module to a version that support Dolibarr v7, everything should work as expected.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
|
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
|
||||||
FIX: security vulnerability reported by ADLab of Venustech
|
FIX: security vulnerability reported by ADLab of Venustech
|
||||||
|
|||||||
@ -87,7 +87,7 @@ $offset = $limit * $page;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if ($sortorder == "") $sortorder = "ASC";
|
if ($sortorder == "") $sortorder = "ASC";
|
||||||
if ($sortfield == "") $sortfield = "t.rowid";
|
if ($sortfield == "") $sortfield = "t.piece_num,t.rowid";
|
||||||
|
|
||||||
|
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
@ -98,25 +98,30 @@ $form = new Form($db);
|
|||||||
|
|
||||||
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int'))
|
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int'))
|
||||||
{
|
{
|
||||||
$query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
if (empty($search_date_start) && empty($search_date_end))
|
||||||
$query.= " where date_start < '".$this->idate(dol_now())."' and date_end > '".$this->idate(dol_now())."' limit 1";
|
{
|
||||||
$res = $db->query($query);
|
$query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||||
if ($res->num_rows > 0) {
|
$query.= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1";
|
||||||
$fiscalYear = $db->fetch_object($res);
|
$res = $db->query($query);
|
||||||
$search_date_start = strtotime($fiscalYear->date_start);
|
|
||||||
$search_date_end = strtotime($fiscalYear->date_end);
|
if ($res->num_rows > 0) {
|
||||||
} else {
|
$fiscalYear = $db->fetch_object($res);
|
||||||
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
|
$search_date_start = strtotime($fiscalYear->date_start);
|
||||||
$year_start = dol_print_date(dol_now(), '%Y');
|
$search_date_end = strtotime($fiscalYear->date_end);
|
||||||
$year_end = $year_start + 1;
|
} else {
|
||||||
$month_end = $month_start - 1;
|
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
|
||||||
if ($month_end < 1)
|
$year_start = dol_print_date(dol_now(), '%Y');
|
||||||
{
|
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
|
||||||
$month_end = 12;
|
$year_end = $year_start + 1;
|
||||||
$year_end--;
|
$month_end = $month_start - 1;
|
||||||
|
if ($month_end < 1)
|
||||||
|
{
|
||||||
|
$month_end = 12;
|
||||||
|
$year_end--;
|
||||||
|
}
|
||||||
|
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
|
||||||
|
$search_date_end = dol_get_last_day($year_end, $month_end);
|
||||||
}
|
}
|
||||||
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
|
|
||||||
$search_date_end = dol_get_last_day($year_end, $month_end);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +129,7 @@ if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !
|
|||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1),
|
't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1),
|
||||||
't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1),
|
't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1),
|
||||||
't.doc_ref'=>array('label'=>$langs->trans("Docref"), 'checked'=>1),
|
't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1),
|
||||||
't.numero_compte'=>array('label'=>$langs->trans("AccountAccountingShort"), 'checked'=>1),
|
't.numero_compte'=>array('label'=>$langs->trans("AccountAccountingShort"), 'checked'=>1),
|
||||||
't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
|
't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
|
||||||
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
@ -430,7 +435,7 @@ else $button.= $langs->trans("ExportList");
|
|||||||
$button.= '</a>';
|
$button.= '</a>';
|
||||||
|
|
||||||
|
|
||||||
$groupby = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php"">' . $langs->trans("GroupByAccountAccounting") . '</a>';
|
$groupby = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param.'">' . $langs->trans("GroupByAccountAccounting") . '</a>';
|
||||||
$addbutton = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a>';
|
$addbutton = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a>';
|
||||||
|
|
||||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$addbutton, '', $limit);
|
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby.$addbutton, '', $limit);
|
||||||
@ -576,17 +581,17 @@ print '</td>';
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
if (! empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre("Docref", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
if (! empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
if (! empty($arrayfields['t.numero_compte']['checked'])) print_liste_field_titre($arrayfields['t.numero_compte']['label'], $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre("SubledgerAccount", $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder);
|
if (! empty($arrayfields['t.subledger_account']['checked'])) print_liste_field_titre($arrayfields['t.subledger_account']['label'], $_SERVER['PHP_SELF'], "t.subledger_account", "", $param, "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
if (! empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre("DateCreation", $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.date_creation']['checked'])) print_liste_field_titre($arrayfields['t.date_creation']['label'], $_SERVER['PHP_SELF'], "t.date_creation", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre("DateModification", $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder);
|
if (! empty($arrayfields['t.tms']['checked'])) print_liste_field_titre($arrayfields['t.tms']['label'], $_SERVER['PHP_SELF'], "t.tms", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -677,14 +682,14 @@ if ($num > 0)
|
|||||||
// Creation operation date
|
// Creation operation date
|
||||||
if (! empty($arrayfields['t.date_creation']['checked']))
|
if (! empty($arrayfields['t.date_creation']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">' . dol_print_date($line->date_creation, 'day') . '</td>';
|
print '<td align="center">' . dol_print_date($line->date_creation, 'dayhour') . '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modification operation date
|
// Modification operation date
|
||||||
if (! empty($arrayfields['t.tms']['checked']))
|
if (! empty($arrayfields['t.tms']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">' . dol_print_date($line->date_modification, 'day') . '</td>';
|
print '<td align="center">' . dol_print_date($line->date_modification, 'dayhour') . '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,6 +709,7 @@ if ($num > 0)
|
|||||||
if (isset($totalarray['totaldebitfield']) || isset($totalarray['totalcreditfield']))
|
if (isset($totalarray['totaldebitfield']) || isset($totalarray['totalcreditfield']))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
|
print '<tr class="liste_total">';
|
||||||
while ($i < $totalarray['nbfield'])
|
while ($i < $totalarray['nbfield'])
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ $pagenext = $page + 1;
|
|||||||
if ($sortorder == "") $sortorder = "ASC";
|
if ($sortorder == "") $sortorder = "ASC";
|
||||||
if ($sortfield == "") $sortfield = "t.rowid";
|
if ($sortfield == "") $sortfield = "t.rowid";
|
||||||
|
|
||||||
if (empty($search_date_start)) {
|
if (empty($search_date_start) && empty($search_date_end)) {
|
||||||
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||||
$sql.= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
$sql.= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
||||||
$sql.= $db->plimit(1);
|
$sql.= $db->plimit(1);
|
||||||
@ -81,6 +81,7 @@ if (empty($search_date_start)) {
|
|||||||
} else {
|
} else {
|
||||||
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
|
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
|
||||||
$year_start = dol_print_date(dol_now(), '%Y');
|
$year_start = dol_print_date(dol_now(), '%Y');
|
||||||
|
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
|
||||||
$year_end = $year_start + 1;
|
$year_end = $year_start + 1;
|
||||||
$month_end = $month_start - 1;
|
$month_end = $month_start - 1;
|
||||||
if ($month_end < 1)
|
if ($month_end < 1)
|
||||||
@ -225,14 +226,13 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$param=$options;
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||||
|
|
||||||
$viewflat = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">' . $langs->trans("ViewFlatList") . '</a>';
|
$viewflat = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param.'">' . $langs->trans("ViewFlatList") . '</a>';
|
||||||
$addbutton = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a>';
|
$addbutton = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("NewAccountingMvt") . '</a>';
|
||||||
|
|
||||||
$param=$options;
|
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
|
|
||||||
|
|||||||
@ -781,7 +781,8 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= " t.code_journal,";
|
$sql .= " t.code_journal,";
|
||||||
$sql .= " t.journal_label,";
|
$sql .= " t.journal_label,";
|
||||||
$sql .= " t.piece_num,";
|
$sql .= " t.piece_num,";
|
||||||
$sql .= " t.date_creation";
|
$sql .= " t.date_creation,";
|
||||||
|
$sql .= " t.tms as date_modification";
|
||||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
|
||||||
// Manage filter
|
// Manage filter
|
||||||
$sqlwhere = array ();
|
$sqlwhere = array ();
|
||||||
@ -849,7 +850,8 @@ class BookKeeping extends CommonObject
|
|||||||
$line->code_journal = $obj->code_journal;
|
$line->code_journal = $obj->code_journal;
|
||||||
$line->journal_label = $obj->journal_label;
|
$line->journal_label = $obj->journal_label;
|
||||||
$line->piece_num = $obj->piece_num;
|
$line->piece_num = $obj->piece_num;
|
||||||
$line->date_creation = $obj->date_creation;
|
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||||
|
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||||
|
|
||||||
$this->lines[] = $line;
|
$this->lines[] = $line;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -303,6 +303,7 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
$chargestatic->ref = $chargestatic->lib;
|
$chargestatic->ref = $chargestatic->lib;
|
||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||||
|
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
||||||
|
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
||||||
@ -401,7 +402,9 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ( $tabpay as $key => $val ) { // $key is rowid into llx_bank
|
foreach ( $tabpay as $key => $val ) // $key is rowid into llx_bank
|
||||||
|
{
|
||||||
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
|
|
||||||
@ -423,7 +426,14 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
// Line into bank account
|
// Line into bank account
|
||||||
foreach ( $tabbq[$key] as $k => $mt )
|
foreach ( $tabbq[$key] as $k => $mt )
|
||||||
{
|
{
|
||||||
if ($mt) {
|
if ($mt)
|
||||||
|
{
|
||||||
|
$reflabel = $langs->trans("Bank");
|
||||||
|
$reflabel.= ' '.$val['bank_account_ref'];
|
||||||
|
if (! empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - " . dol_string_nohtmltag($val['soclib']);
|
||||||
|
}
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
$bookkeeping->doc_ref = $ref;
|
$bookkeeping->doc_ref = $ref;
|
||||||
@ -442,31 +452,8 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
$bookkeeping->date_create = $now;
|
$bookkeeping->date_create = $now;
|
||||||
|
|
||||||
// No subledger_account value for the bank line but add a specific label_operation
|
// No subledger_account value for the bank line but add a specific label_operation
|
||||||
if ($tabtype[$key] == 'payment') {
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->label_operation = $reflabel;
|
||||||
$bookkeeping->label_operation = $tabcompany[$key]['name'] . ' - ' . $ref;
|
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->label_operation = $tabcompany[$key]['name'] . ' - ' . $ref;
|
|
||||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->label_operation = $tabuser[$key]['name'] . ' - ' . $ref;
|
|
||||||
} else if ($tabtype[$key] == 'payment_salary') {
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->label_operation = $tabuser[$key]['name'] . ' - ' . $ref;
|
|
||||||
} else if ($tabtype[$key] == 'payment_vat') {
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->label_operation = $ref;
|
|
||||||
} else if ($tabtype[$key] == 'payment_donation') {
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->label_operation = $ref;
|
|
||||||
} else if ($tabtype[$key] == 'payment_various') {
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->label_operation = $ref;
|
|
||||||
} else if ($tabtype[$key] == 'unknown') {
|
|
||||||
// ???
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$totaldebit += $bookkeeping->debit;
|
$totaldebit += $bookkeeping->debit;
|
||||||
$totalcredit += $bookkeeping->credit;
|
$totalcredit += $bookkeeping->credit;
|
||||||
@ -491,108 +478,151 @@ if (! $error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (! $errorforline && is_array($tabtp[$key]))
|
if (! $errorforline)
|
||||||
{
|
{
|
||||||
// Line into thirdparty account
|
if (is_array($tabtp[$key]))
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
{
|
||||||
if ($mt) {
|
// Line into thirdparty account
|
||||||
$bookkeeping = new BookKeeping($db);
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
$bookkeeping->doc_date = $val["date"];
|
if ($mt)
|
||||||
$bookkeeping->doc_ref = $ref;
|
{
|
||||||
$bookkeeping->doc_type = 'bank';
|
$reflabel = dol_string_nohtmltag($val['soclib']);
|
||||||
$bookkeeping->fk_doc = $key;
|
|
||||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
|
||||||
$bookkeeping->montant = $mt;
|
|
||||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
|
||||||
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
|
||||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
|
||||||
$bookkeeping->code_journal = $journal;
|
|
||||||
$bookkeeping->journal_label = $journal_label;
|
|
||||||
$bookkeeping->fk_user_author = $user->id;
|
|
||||||
$bookkeeping->date_create = $now;
|
|
||||||
|
|
||||||
if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->label_operation = $tabcompany[$key]['name'] . ' - ' . $ref;
|
$bookkeeping->doc_date = $val["date"];
|
||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
$bookkeeping->doc_ref = $ref;
|
||||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
$bookkeeping->doc_type = 'bank';
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
$bookkeeping->fk_doc = $key;
|
||||||
$bookkeeping->label_compte = '';
|
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||||
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
$bookkeeping->montant = $mt;
|
||||||
$bookkeeping->label_operation = $tabcompany[$key]['name'] . ' - ' . $ref;
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$bookkeeping->code_journal = $journal;
|
||||||
$bookkeeping->label_compte = '';
|
$bookkeeping->journal_label = $journal_label;
|
||||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
$bookkeeping->fk_user_author = $user->id;
|
||||||
$bookkeeping->label_operation = $tabuser[$key]['name'] . ' - ' . $ref;
|
$bookkeeping->date_create = $now;
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||||
$bookkeeping->label_compte = '';
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
} else if ($tabtype[$key] == 'payment_salary') {
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
$bookkeeping->label_operation = $tabuser[$key]['name'] . ' - ' . $ref;
|
$bookkeeping->label_compte = '';
|
||||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||||
$bookkeeping->label_compte = '';
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
$bookkeeping->label_compte = '';
|
||||||
$bookkeeping->label_operation = $ref;
|
} else if ($tabtype[$key] == 'payment_expensereport') {
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
$bookkeeping->label_compte = $objmid->labelc;
|
$bookkeeping->label_compte = '';
|
||||||
} else if ($tabtype[$key] == 'payment_vat') {
|
} else if ($tabtype[$key] == 'payment_salary') {
|
||||||
$bookkeeping->label_operation = $ref;
|
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
$bookkeeping->numero_compte = $k;
|
$bookkeeping->label_compte = '';
|
||||||
$bookkeeping->label_compte = '';
|
} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||||
} else if ($tabtype[$key] == 'payment_donation') {
|
|
||||||
$bookkeeping->label_operation = $ref;
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->subledger_label = '';
|
|
||||||
$bookkeeping->numero_compte = $k;
|
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
} else if ($tabtype[$key] == 'payment_various') {
|
|
||||||
$bookkeeping->label_operation = $ref;
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->subledger_label = '';
|
|
||||||
$bookkeeping->numero_compte = $k;
|
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
} else if ($tabtype[$key] == 'banktransfert') {
|
|
||||||
$bookkeeping->label_operation = $ref;
|
|
||||||
$bookkeeping->subledger_account = '';
|
|
||||||
$bookkeeping->subledger_label = '';
|
|
||||||
$bookkeeping->numero_compte = $k;
|
|
||||||
$bookkeeping->label_compte = '';
|
|
||||||
} else {
|
|
||||||
if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
|
|
||||||
{
|
|
||||||
// Temporary account
|
|
||||||
$bookkeeping->label_operation = '';
|
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = $objmid->labelc;
|
||||||
|
} else if ($tabtype[$key] == 'payment_vat') {
|
||||||
|
$bookkeeping->subledger_account = '';
|
||||||
|
$bookkeeping->subledger_label = '';
|
||||||
|
$bookkeeping->numero_compte = $k;
|
||||||
$bookkeeping->label_compte = '';
|
$bookkeeping->label_compte = '';
|
||||||
|
} else if ($tabtype[$key] == 'payment_donation') {
|
||||||
|
$bookkeeping->subledger_account = '';
|
||||||
|
$bookkeeping->subledger_label = '';
|
||||||
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = '';
|
||||||
|
} else if ($tabtype[$key] == 'payment_various') {
|
||||||
|
$bookkeeping->subledger_account = '';
|
||||||
|
$bookkeeping->subledger_label = '';
|
||||||
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = '';
|
||||||
|
} else if ($tabtype[$key] == 'banktransfert') {
|
||||||
|
$bookkeeping->subledger_account = '';
|
||||||
|
$bookkeeping->subledger_label = '';
|
||||||
|
$bookkeeping->numero_compte = $k;
|
||||||
|
$bookkeeping->label_compte = '';
|
||||||
|
} else {
|
||||||
|
if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
|
||||||
|
{
|
||||||
|
// Temporary account
|
||||||
|
$bookkeeping->subledger_account = '';
|
||||||
|
$bookkeeping->subledger_label = '';
|
||||||
|
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE;
|
||||||
|
$bookkeeping->label_compte = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$bookkeeping->label_operation = $reflabel;
|
||||||
|
|
||||||
|
$totaldebit += $bookkeeping->debit;
|
||||||
|
$totalcredit += $bookkeeping->credit;
|
||||||
|
|
||||||
|
$result = $bookkeeping->create($user);
|
||||||
|
if ($result < 0) {
|
||||||
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$errorforline++;
|
||||||
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$errorforline++;
|
||||||
|
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // If thirdparty unkown, output the waiting account
|
||||||
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
|
if ($mt)
|
||||||
|
{
|
||||||
|
$reflabel = 'WaitingAccount';
|
||||||
|
|
||||||
$totaldebit += $bookkeeping->debit;
|
$bookkeeping = new BookKeeping($db);
|
||||||
$totalcredit += $bookkeeping->credit;
|
$bookkeeping->doc_date = $val["date"];
|
||||||
|
$bookkeeping->doc_ref = $ref;
|
||||||
|
$bookkeeping->doc_type = 'bank';
|
||||||
|
$bookkeeping->fk_doc = $key;
|
||||||
|
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||||
|
$bookkeeping->montant = $mt;
|
||||||
|
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||||
|
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||||
|
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||||
|
$bookkeeping->code_journal = $journal;
|
||||||
|
$bookkeeping->journal_label = $journal_label;
|
||||||
|
$bookkeeping->fk_user_author = $user->id;
|
||||||
|
$bookkeeping->date_create = $now;
|
||||||
|
$bookkeeping->label_compte = '';
|
||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$bookkeeping->label_operation = $reflabel;
|
||||||
if ($result < 0) {
|
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
$totaldebit += $bookkeeping->debit;
|
||||||
{
|
$totalcredit += $bookkeeping->credit;
|
||||||
$error++;
|
|
||||||
$errorforline++;
|
$result = $bookkeeping->create($user);
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
if ($result < 0) {
|
||||||
}
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||||
else
|
{
|
||||||
{
|
$error++;
|
||||||
$error++;
|
$errorforline++;
|
||||||
$errorforline++;
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$errorforline++;
|
||||||
|
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -662,101 +692,102 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
|
|
||||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||||
|
|
||||||
$companystatic = new Client($db);
|
// CSV header line
|
||||||
$userstatic = new User($db);
|
print '"' . $langs->trans("BankId").'"' . $sep;
|
||||||
|
print '"' . $langs->trans("Date") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("PaymentMode") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("AccountAccounting") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("LedgerAccount") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("SubledgerAccount") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("Label"). '"' . $sep;
|
||||||
|
print '"' . $langs->trans("Amount") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("Amount") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("Journal") . '"' . $sep;
|
||||||
|
print '"' . $langs->trans("Note") . '"' . $sep;
|
||||||
|
print "\n";
|
||||||
|
|
||||||
foreach ( $tabpay as $key => $val ) {
|
|
||||||
|
foreach ( $tabpay as $key => $val )
|
||||||
|
{
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
|
|
||||||
//
|
|
||||||
if (! empty($tabcompany[$key]['id']))
|
|
||||||
{
|
|
||||||
$companystatic->id = $tabcompany[$key]['id'];
|
|
||||||
$companystatic->name = $tabcompany[$key]['name'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$companystatic->id = 0;
|
|
||||||
$companystatic->name = '';
|
|
||||||
}
|
|
||||||
if (! empty($tabuser[$key]['id']))
|
|
||||||
{
|
|
||||||
$userstatic->id = $tabuser[$key]['id'];
|
|
||||||
$userstatic->lastname = $tabuser[$key]['lastname'];
|
|
||||||
$userstatic->firstname = $tabuser[$key]['firstname'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$userstatic->id = 0;
|
|
||||||
$userstatic->lastname = '';
|
|
||||||
$userstatic->firstname = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
print '"' . $key . '"' . $sep;
|
if ($mt)
|
||||||
print '"' . $date . '"' . $sep;
|
{
|
||||||
print '"' . $val["type_payment"] . '"' . $sep;
|
$reflabel = $langs->trans("Bank");
|
||||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
$reflabel.= ' '.$val['bank_account_ref'];
|
||||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
if (! empty($val['soclib'])) {
|
||||||
print " " . $sep;
|
$reflabel .= " - " . dol_string_nohtmltag($val['soclib']);
|
||||||
if ($companystatic->name == '') {
|
}
|
||||||
print '"' . $val['bank_account_ref'] . " - " . utf8_decode($reflabel) . '"' . $sep;
|
|
||||||
} else {
|
print '"' . $key . '"' . $sep;
|
||||||
print '"' . $val['bank_account_ref'] . ' - ' . utf8_decode($companystatic->name) . '"' . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
|
print '"' . $val["type_payment"] . '"' . $sep;
|
||||||
|
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||||
|
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||||
|
print " " . $sep;
|
||||||
|
print '"' . $reflabel . '"' . $sep;
|
||||||
|
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||||
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||||
|
print '"' . $journal . '"' . $sep;
|
||||||
|
print '"' . dol_string_nohtmltag($ref) . '"' . $sep;
|
||||||
|
print "\n";
|
||||||
}
|
}
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
|
||||||
print '"' . $journal . '"' . $sep;
|
|
||||||
print "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
if ($mt) {
|
if ($mt)
|
||||||
|
{
|
||||||
|
$reflabel = dol_string_nohtmltag($val['soclib']);
|
||||||
|
|
||||||
print '"' . $key . '"' . $sep;
|
print '"' . $key . '"' . $sep;
|
||||||
print '"' . $date . '"' . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
print '"' . $val["type_payment"] . '"' . $sep;
|
print '"' . $val["type_payment"] . '"' . $sep;
|
||||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||||
if ($tabtype[$key] == 'payment_supplier') {
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
|
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
|
||||||
} else if($tabtype[$key] == 'payment') {
|
} else if($tabtype[$key] == 'payment') {
|
||||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
|
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
|
||||||
|
} else if($tabtype[$key] == 'payment_expensereport') {
|
||||||
|
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
||||||
|
} else if($tabtype[$key] == 'payment_salary') {
|
||||||
|
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
||||||
} else {
|
} else {
|
||||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||||
}
|
}
|
||||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||||
if ($companystatic->name == '') {
|
print '"' . $reflabel . '"' . $sep;
|
||||||
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($reflabel) . '"' . $sep;
|
|
||||||
} else {
|
|
||||||
print '"' . $langs->trans('ThirdParty') . " - " . utf8_decode($companystatic->name) . '"' . $sep;
|
|
||||||
}
|
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||||
print '"' . $journal . '"' . $sep;
|
print '"' . $journal . '"' . $sep;
|
||||||
|
print '"' . dol_string_nohtmltag($ref) . '"' . $sep;
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else { // If thirdparty unkown, output the waiting account
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
print '"' . $key . '"' . $sep;
|
if ($mt)
|
||||||
print '"' . $date . '"' . $sep;
|
{
|
||||||
print '"' . $val["type_payment"] . '"' . $sep;
|
$reflabel = 'WaitingAccount';
|
||||||
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
|
|
||||||
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
|
print '"' . $key . '"' . $sep;
|
||||||
print " " . $sep;
|
print '"' . $date . '"' . $sep;
|
||||||
if ($companystatic->name == '') {
|
print '"' . $val["type_payment"] . '"' . $sep;
|
||||||
print '"' . $val['bank_account_ref'] . ' - ' . utf8_decode($reflabel) . '"' . $sep;
|
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
|
||||||
} else {
|
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
|
||||||
print '"' . $val['bank_account_ref'] . ' - ' . utf8_decode($companystatic->name) . '"' . $sep;
|
print "" . $sep;
|
||||||
|
print '"' . $reflabel . '"' . $sep;
|
||||||
|
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||||
|
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||||
|
print '"' . $journal . '"' . $sep;
|
||||||
|
print '"' . dol_string_nohtmltag($ref) . '"' . $sep;
|
||||||
|
print "\n";
|
||||||
}
|
}
|
||||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
|
||||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
|
||||||
print '"' . $journal . '"' . $sep;
|
|
||||||
print "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -862,7 +893,8 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
$r = '';
|
$r = '';
|
||||||
|
|
||||||
foreach ( $tabpay as $key => $val ) { // $key is rowid in llx_bank
|
foreach ( $tabpay as $key => $val ) // $key is rowid in llx_bank
|
||||||
|
{
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
@ -870,48 +902,55 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Bank
|
// Bank
|
||||||
foreach ( $tabbq[$key] as $k => $mt )
|
foreach ( $tabbq[$key] as $k => $mt )
|
||||||
{
|
{
|
||||||
//var_dump($tabpay[$key]);
|
if ($mt)
|
||||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print "<td></td>";
|
|
||||||
print "<td>" . $date . "</td>";
|
|
||||||
print "<td>" . $ref . "</td>";
|
|
||||||
// Ledger account
|
|
||||||
print "<td>";
|
|
||||||
$accounttoshow = length_accountg($k);
|
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
$reflabel = $langs->trans("Bank");
|
||||||
|
$reflabel.= ' '.$val['bank_account_ref'];
|
||||||
|
if (! empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - " . $val['soclib'];
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($tabpay[$key]);
|
||||||
|
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td></td>";
|
||||||
|
print "<td>" . $date . "</td>";
|
||||||
|
print "<td>" . $ref . "</td>";
|
||||||
|
// Ledger account
|
||||||
|
print "<td>";
|
||||||
|
$accounttoshow = length_accountg($k);
|
||||||
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||||
|
{
|
||||||
|
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||||
|
}
|
||||||
|
else print $accounttoshow;
|
||||||
|
print "</td>";
|
||||||
|
// Subledger account
|
||||||
|
print "<td>";
|
||||||
|
/*$accounttoshow = length_accountg($k);
|
||||||
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||||
|
{
|
||||||
|
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||||
|
}
|
||||||
|
else print $accounttoshow;*/
|
||||||
|
print "</td>";
|
||||||
|
print "<td>";
|
||||||
|
print $reflabel;
|
||||||
|
print "</td>";
|
||||||
|
print "<td>" . $val["type_payment"] . "</td>";
|
||||||
|
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||||
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
|
print "</tr>";
|
||||||
}
|
}
|
||||||
else print $accounttoshow;
|
|
||||||
print "</td>";
|
|
||||||
// Subledger account
|
|
||||||
print "<td>";
|
|
||||||
/*$accounttoshow = length_accountg($k);
|
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
|
||||||
{
|
|
||||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
|
||||||
}
|
|
||||||
else print $accounttoshow;*/
|
|
||||||
print "</td>";
|
|
||||||
print "<td>";
|
|
||||||
//var_dump($tabpay[$key]);
|
|
||||||
print $langs->trans("Bank");
|
|
||||||
print ' '.$val['bank_account_ref'];
|
|
||||||
if (! empty($val['soclib'])) {
|
|
||||||
print " - " . $val['soclib'];
|
|
||||||
}
|
|
||||||
print "</td>";
|
|
||||||
print "<td>" . $val["type_payment"] . "</td>";
|
|
||||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
|
||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||||
if ($k != 'type') {
|
if ($mt)
|
||||||
|
{
|
||||||
|
$reflabel = $val['soclib'];
|
||||||
|
|
||||||
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print "<td></td>";
|
print "<td></td>";
|
||||||
@ -974,42 +1013,47 @@ if (empty($action) || $action == 'view') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "<td>" . $reflabel . ' ' . $val['soclib'] . "</td>";
|
print "<td>" . $reflabel . "</td>";
|
||||||
print "<td>" . $val["type_payment"] . "</td>";
|
print "<td>" . $val["type_payment"] . "</td>";
|
||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else { // Waiting account
|
||||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||||
print '<!-- Wait bank.rowid='.$key.' -->';
|
if ($mt)
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print "<td></td>";
|
|
||||||
print "<td>" . $date . "</td>";
|
|
||||||
print "<td>" . $ref . "</td>";
|
|
||||||
// Ledger account
|
|
||||||
print "<td>";
|
|
||||||
/*if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
|
||||||
{
|
{
|
||||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
$reflabel = 'WaitingAccount';
|
||||||
|
|
||||||
|
print '<!-- Wait bank.rowid='.$key.' -->';
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
print "<td></td>";
|
||||||
|
print "<td>" . $date . "</td>";
|
||||||
|
print "<td>" . $ref . "</td>";
|
||||||
|
// Ledger account
|
||||||
|
print "<td>";
|
||||||
|
/*if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||||
|
{
|
||||||
|
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||||
|
}
|
||||||
|
else */ print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||||
|
print "</td>";
|
||||||
|
// Subledger account
|
||||||
|
print "<td>";
|
||||||
|
/*if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
||||||
|
{
|
||||||
|
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||||
|
}
|
||||||
|
else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||||
|
*/
|
||||||
|
print "</td>";
|
||||||
|
print "<td>" . $reflabel . "</td>";
|
||||||
|
print "<td>" . $val["type_payment"] . "</td>";
|
||||||
|
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||||
|
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||||
|
print "</tr>";
|
||||||
}
|
}
|
||||||
else */ print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
|
||||||
print "</td>";
|
|
||||||
// Subledger account
|
|
||||||
print "<td>";
|
|
||||||
/*if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
|
||||||
{
|
|
||||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
|
||||||
}
|
|
||||||
else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
|
||||||
*/
|
|
||||||
print "</td>";
|
|
||||||
print "<td>" . $reflabel . "</td>";
|
|
||||||
print "<td>" . $val["type_payment"] . "</td>";
|
|
||||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
|
||||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
|
||||||
print "</tr>";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1089,6 +1133,13 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
$sqlmid .= " WHERE s.rowid=" . $val["paymentsalid"];
|
$sqlmid .= " WHERE s.rowid=" . $val["paymentsalid"];
|
||||||
$ref = $langs->trans("SalaryPayment");
|
$ref = $langs->trans("SalaryPayment");
|
||||||
}
|
}
|
||||||
|
elseif ($typerecord == 'sc')
|
||||||
|
{
|
||||||
|
$sqlmid = 'SELECT sc.rowid as ref';
|
||||||
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementcharge as sc";
|
||||||
|
$sqlmid .= " WHERE sc.rowid=" . $val["paymentscid"];
|
||||||
|
$ref = $langs->trans("SocialContribution");
|
||||||
|
}
|
||||||
elseif ($typerecord == 'payment_vat')
|
elseif ($typerecord == 'payment_vat')
|
||||||
{
|
{
|
||||||
$sqlmid = 'SELECT v.rowid as ref';
|
$sqlmid = 'SELECT v.rowid as ref';
|
||||||
|
|||||||
@ -148,10 +148,10 @@ if ($object->id > 0)
|
|||||||
//print '</div>';
|
//print '</div>';
|
||||||
|
|
||||||
|
|
||||||
$morehtmlcenter = '';
|
$createbutton = '';
|
||||||
if (! empty($conf->agenda->enabled))
|
if (! empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
$morehtmlcenter.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction").'</a>';
|
$createbutton.='<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage=1&origin=member&originid='.$id.'">'.$langs->trans("AddAction").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||||
@ -162,7 +162,7 @@ if ($object->id > 0)
|
|||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
|
|
||||||
print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $morehtmlcenter, 0, -1, '', '', '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("ActionsOnMember"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', '', $createbutton, '', 0, 1, 1);
|
||||||
|
|
||||||
// List of all actions
|
// List of all actions
|
||||||
$filters=array();
|
$filters=array();
|
||||||
|
|||||||
103
htdocs/admin/export.php
Normal file
103
htdocs/admin/export.php
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/admin/expedition.php
|
||||||
|
* \ingroup expedition
|
||||||
|
* \brief Page d'administration/configuration du module Expedition
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
$langs->load("admin");
|
||||||
|
$langs->load("exports");
|
||||||
|
|
||||||
|
$langs->load('other');
|
||||||
|
|
||||||
|
if (! $user->admin)
|
||||||
|
accessforbidden();
|
||||||
|
|
||||||
|
$action=GETPOST('action','alpha');
|
||||||
|
$value=GETPOST('value','alpha');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$page_name = "ExportSetup";
|
||||||
|
llxHeader('', $langs->trans($page_name));
|
||||||
|
|
||||||
|
// Subheader
|
||||||
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">'
|
||||||
|
. $langs->trans("BackToModuleList") . '</a>';
|
||||||
|
print_fiche_titre($langs->trans($page_name), $linkback);
|
||||||
|
|
||||||
|
// Configuration header
|
||||||
|
|
||||||
|
dol_fiche_head(
|
||||||
|
$head,
|
||||||
|
'settings',
|
||||||
|
$langs->trans("ExportsArea"),
|
||||||
|
0,
|
||||||
|
"exports"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Setup page goes here
|
||||||
|
$form=new Form($db);
|
||||||
|
$var=false;
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td>'.$langs->trans("ExportModel").'</td>'."\n";
|
||||||
|
print '<td align="center" width="20"> </td>';
|
||||||
|
print '<td align="center" width="100"></td>'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Example with a yes / no select
|
||||||
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'>';
|
||||||
|
print '<td>'.$langs->trans("set_EXPORTS_SHARE_MODELS").'</td>';
|
||||||
|
print '<td align="center" width="20"> </td>';
|
||||||
|
print '<td align="center" width="100">';
|
||||||
|
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="action" value="set_EXPORTS_SHARE_MODELS">';
|
||||||
|
echo ajax_constantonoff('EXPORTS_SHARE_MODELS');
|
||||||
|
print '</form>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -70,6 +70,7 @@ complete_substitutions_array($substitutionarrayfortest, $langs);
|
|||||||
if ($action == 'update' && empty($_POST["cancel"]))
|
if ($action == 'update' && empty($_POST["cancel"]))
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity);
|
||||||
|
dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"),'chaine',0,'',$conf->entity);
|
||||||
// Send mode parameters
|
// Send mode parameters
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity);
|
||||||
@ -239,6 +240,11 @@ if ($action == 'edit')
|
|||||||
print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1);
|
print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Force e-mail recipient
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>';
|
||||||
|
print '<input class="flat" name="MAIN_MAIL_FORCE_SENDTO" size="32" value="' . (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO)?$conf->global->MAIN_MAIL_FORCE_SENDTO:'') . '" />';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
|
|
||||||
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
||||||
@ -478,6 +484,11 @@ else
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'</td></tr>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'</td></tr>';
|
||||||
|
|
||||||
|
// Force e-mail recipient
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").'</td><td>'.$conf->global->MAIN_MAIL_FORCE_SENDTO;
|
||||||
|
if (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO) && ! isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Separator
|
// Separator
|
||||||
|
|
||||||
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
print '<tr class="oddeven"><td colspan="2"> </td></tr>';
|
||||||
@ -644,25 +655,7 @@ else
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
// Actions button
|
||||||
{
|
|
||||||
print '<br>';
|
|
||||||
/*
|
|
||||||
// Warning 1
|
|
||||||
if ($linuxlike)
|
|
||||||
{
|
|
||||||
$sendmailoption=ini_get('mail.force_extra_parameters');
|
|
||||||
if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
|
|
||||||
{
|
|
||||||
print info_admin($langs->trans("SendmailOptionNotComplete"));
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
// Warning 2
|
|
||||||
print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Boutons actions
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||||
@ -689,6 +682,22 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
// Warning 1
|
||||||
|
if ($linuxlike)
|
||||||
|
{
|
||||||
|
$sendmailoption=ini_get('mail.force_extra_parameters');
|
||||||
|
if (empty($sendmailoption) || ! preg_match('/ba/',$sendmailoption))
|
||||||
|
{
|
||||||
|
print info_admin($langs->trans("SendmailOptionNotComplete"));
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
// Warning 2
|
||||||
|
print info_admin($langs->trans("SendmailOptionMayHurtBuggedMTA"));
|
||||||
|
}
|
||||||
|
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && ! in_array($action, array('testconnect', 'test', 'testhtml')))
|
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && ! in_array($action, array('testconnect', 'test', 'testhtml')))
|
||||||
{
|
{
|
||||||
$text = $langs->trans("WarningPHPMail");
|
$text = $langs->trans("WarningPHPMail");
|
||||||
|
|||||||
@ -39,8 +39,7 @@ $action = GETPOST('action', 'alpha');
|
|||||||
|
|
||||||
// Other parameters SALARIES_*
|
// Other parameters SALARIES_*
|
||||||
$list = array (
|
$list = array (
|
||||||
'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',
|
'SALARIES_XXX',
|
||||||
'SALARIES_ACCOUNTING_ACCOUNT_CHARGE'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -87,7 +87,13 @@ foreach ($modulesdir as $dir)
|
|||||||
$part = 'compta/facture';
|
$part = 'compta/facture';
|
||||||
$obj = 'facture';
|
$obj = 'facture';
|
||||||
}
|
}
|
||||||
if (empty($conf->$module->enabled)) $enabled=false;
|
if ($module == 'ficheinter') {
|
||||||
|
$obj = 'fichinter';
|
||||||
|
$part = 'fichinter';
|
||||||
|
$module='fichinter';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($conf->$module->enabled)) $enabled=false;
|
||||||
|
|
||||||
if ($enabled)
|
if ($enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -145,6 +145,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' ||
|
|||||||
$modulenameforenabled = $module;
|
$modulenameforenabled = $module;
|
||||||
if ($module == 'propale') { $modulenameforenabled='propal'; }
|
if ($module == 'propale') { $modulenameforenabled='propal'; }
|
||||||
if ($module == 'supplierproposal') { $modulenameforenabled='supplier_proposal'; }
|
if ($module == 'supplierproposal') { $modulenameforenabled='supplier_proposal'; }
|
||||||
|
if ($module == 'ficheinter') { $modulenameforenabled='ficheinter'; }
|
||||||
|
|
||||||
dol_syslog("Found module file ".$file." - module=".$module." - modulenameforenabled=".$modulenameforenabled." - moduledirforclass=".$moduledirforclass);
|
dol_syslog("Found module file ".$file." - module=".$module." - modulenameforenabled=".$modulenameforenabled." - moduledirforclass=".$moduledirforclass);
|
||||||
|
|
||||||
@ -217,7 +218,7 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
|
|||||||
$moduledirforclass = getModuleDirForApiClass($module);
|
$moduledirforclass = getModuleDirForApiClass($module);
|
||||||
|
|
||||||
// Load a dedicated API file
|
// Load a dedicated API file
|
||||||
dol_syslog("Load a dedicated API file moduledirforclass=".$moduledirforclass);
|
dol_syslog("Load a dedicated API file module=".$module." moduledirforclass=".$moduledirforclass);
|
||||||
|
|
||||||
$tmpmodule = $module;
|
$tmpmodule = $module;
|
||||||
if ($tmpmodule != 'api')
|
if ($tmpmodule != 'api')
|
||||||
@ -229,6 +230,11 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
|
|||||||
$classfile = 'supplier_orders';
|
$classfile = 'supplier_orders';
|
||||||
if ($module == 'supplierinvoices')
|
if ($module == 'supplierinvoices')
|
||||||
$classfile = 'supplier_invoices';
|
$classfile = 'supplier_invoices';
|
||||||
|
if ($module == 'ficheinter')
|
||||||
|
$classfile = 'interventions';
|
||||||
|
if ($module == 'interventions')
|
||||||
|
$classfile = 'interventions';
|
||||||
|
|
||||||
$dir_part_file = dol_buildpath('/' . $moduledirforclass . '/class/api_' . $classfile . '.class.php', 0, 2);
|
$dir_part_file = dol_buildpath('/' . $moduledirforclass . '/class/api_' . $classfile . '.class.php', 0, 2);
|
||||||
|
|
||||||
$classname = ucwords($module);
|
$classname = ucwords($module);
|
||||||
|
|||||||
@ -453,24 +453,36 @@ if (is_array($blocks))
|
|||||||
if (empty($search_showonlyerrors) || ! $checkresult[$block->id])
|
if (empty($search_showonlyerrors) || ! $checkresult[$block->id])
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
print '<td>'.$block->id.'</td>';
|
print '<td>'.$block->id.'</td>';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
print '<td>'.dol_print_date($block->date_creation,'dayhour').'</td>';
|
print '<td>'.dol_print_date($block->date_creation,'dayhour').'</td>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
//print $block->getUser()
|
//print $block->getUser()
|
||||||
print $block->user_fullname;
|
print $block->user_fullname;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
print '<td>'.$langs->trans('log'.$block->action).'</td>';
|
print '<td>'.$langs->trans('log'.$block->action).'</td>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td class="nowrap">'.$block->ref_object.'</td>';
|
print '<td class="nowrap">'.$block->ref_object.'</td>';
|
||||||
|
|
||||||
// Link to source object
|
// Link to source object
|
||||||
print '<td>'.$object_link.'</td>';
|
print '<td>'.$object_link.'</td>';
|
||||||
|
|
||||||
|
// Amount
|
||||||
print '<td align="right">'.price($block->amounts).'</td>';
|
print '<td align="right">'.price($block->amounts).'</td>';
|
||||||
|
|
||||||
|
// Details link
|
||||||
print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';
|
print '<td align="center"><a href="#" data-blockid="'.$block->id.'" rel="show-info">'.img_info($langs->trans('ShowDetails')).'</a></td>';
|
||||||
|
|
||||||
|
// Fingerprint
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->textwithpicto(dol_trunc($block->signature, '12'), $block->signature, 1, 'help', '', 0, 2, 'fingerprint');
|
print $form->textwithpicto(dol_trunc($block->signature, '12'), $block->signature, 1, 'help', '', 0, 2, 'fingerprint');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -149,11 +149,10 @@ class BlockedLog
|
|||||||
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY']='logMEMBER_SUBSCRIPTION_MODIFY';
|
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY']='logMEMBER_SUBSCRIPTION_MODIFY';
|
||||||
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE']='logMEMBER_SUBSCRIPTION_DELETE';
|
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE']='logMEMBER_SUBSCRIPTION_DELETE';
|
||||||
|
|
||||||
/*
|
|
||||||
$trackedevents['PAYMENT_VARIOUS_CREATE']='BlockedLogVariousPaymentCreate';
|
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_CREATE']='logPAYMENT_VARIOUS_CREATE';
|
||||||
$trackedevents['PAYMENT_VARIOUS_MODIFY']='BlockedLogVariousPaymentModify';
|
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_MODIFY']='logPAYMENT_VARIOUS_MODIFY';
|
||||||
$trackedevents['PAYMENT_VARIOUS_DELETE']='BlockedLogVariousPaymentDelete';
|
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_DELETE']='logPAYMENT_VARIOUS_DELETE';
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -218,6 +217,17 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if($this->element === 'payment_various') {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||||
|
|
||||||
|
$object = new PaymentVarious($this->db);
|
||||||
|
if ($object->fetch($this->fk_object)>0) {
|
||||||
|
return $object->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if($this->element === 'don' || $this->element === 'donation') {
|
else if($this->element === 'don' || $this->element === 'donation') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||||
|
|
||||||
@ -299,7 +309,7 @@ class BlockedLog
|
|||||||
{
|
{
|
||||||
$this->date_object = $object->datev;
|
$this->date_object = $object->datev;
|
||||||
}
|
}
|
||||||
elseif ($object->element == 'payment_donation')
|
elseif ($object->element == 'payment_donation' || $object->element == 'payment_various')
|
||||||
{
|
{
|
||||||
$this->date_object = $object->datepaid?$object->datepaid:$object->datep;
|
$this->date_object = $object->datepaid?$object->datepaid:$object->datep;
|
||||||
}
|
}
|
||||||
@ -401,21 +411,26 @@ class BlockedLog
|
|||||||
|
|
||||||
if (! empty($object->newref)) $this->object_data->ref = $object->newref;
|
if (! empty($object->newref)) $this->object_data->ref = $object->newref;
|
||||||
}
|
}
|
||||||
elseif ($this->element == 'payment' || $this->element == 'payment_supplier' || $this->element == 'payment_donation')
|
elseif ($this->element == 'payment' || $this->element == 'payment_supplier' || $this->element == 'payment_donation' || $this->element == 'payment_various')
|
||||||
{
|
{
|
||||||
$datepayment = $object->datepaye?$object->datepaye:($object->datepaid?$object->datepaid:$object->datep);
|
$datepayment = $object->datepaye?$object->datepaye:($object->datepaid?$object->datepaid:$object->datep);
|
||||||
$paymenttypeid = $object->paiementid?$object->paiementid:$object->paymenttype;
|
$paymenttypeid = $object->paiementid?$object->paiementid:($object->paymenttype?$object->paymenttype:$object->type_payment);
|
||||||
|
|
||||||
$this->object_data->ref = $object->ref;
|
$this->object_data->ref = $object->ref;
|
||||||
$this->object_data->date = $datepayment;
|
$this->object_data->date = $datepayment;
|
||||||
$this->object_data->type_code = dol_getIdFromCode($this->db, $paymenttypeid, 'c_paiement', 'id', 'code');
|
$this->object_data->type_code = dol_getIdFromCode($this->db, $paymenttypeid, 'c_paiement', 'id', 'code');
|
||||||
$this->object_data->payment_num = $object->num_paiement;
|
$this->object_data->payment_num = ($object->num_paiement?$object->num_paiement:$object->num_payment);
|
||||||
//$this->object_data->fk_account = $object->fk_account;
|
//$this->object_data->fk_account = $object->fk_account;
|
||||||
$this->object_data->note = $object->note;
|
$this->object_data->note = $object->note;
|
||||||
//var_dump($this->object_data);exit;
|
//var_dump($this->object_data);exit;
|
||||||
|
|
||||||
$totalamount=0;
|
$totalamount=0;
|
||||||
|
|
||||||
|
if (! is_array($object->amounts) && $object->amount)
|
||||||
|
{
|
||||||
|
$object->amounts=array($object->id => $object->amount);
|
||||||
|
}
|
||||||
|
|
||||||
$paymentpartnumber=0;
|
$paymentpartnumber=0;
|
||||||
foreach($object->amounts as $objid => $amount)
|
foreach($object->amounts as $objid => $amount)
|
||||||
{
|
{
|
||||||
@ -439,26 +454,41 @@ class BlockedLog
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||||
$tmpobject = new Don($this->db);
|
$tmpobject = new Don($this->db);
|
||||||
}
|
}
|
||||||
|
elseif ($this->element == 'payment_various')
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||||
|
$tmpobject = new PaymentVarious($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
if (! is_object($tmpobject))
|
if (! is_object($tmpobject))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $tmpobject->fetch($objid);
|
$result = $tmpobject->fetch($objid);
|
||||||
|
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$this->error = $tmpobject->error;
|
$this->error = $tmpobject->error;
|
||||||
$this->errors = $tmpobject->errors;
|
$this->errors = $tmpobject->errors;
|
||||||
|
dol_syslog("Failed to fetch object with id ".$objid, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentpart = new stdClass();
|
$paymentpart = new stdClass();
|
||||||
$paymentpart->amount = $amount;
|
$paymentpart->amount = $amount;
|
||||||
|
|
||||||
if ($this->element != 'payment_donation')
|
if (! in_array($this->element, array('payment_donation', 'payment_various')))
|
||||||
{
|
{
|
||||||
$result = $tmpobject->fetch_thirdparty();
|
$result = $tmpobject->fetch_thirdparty();
|
||||||
if ($result <= 0)
|
if ($result == 0)
|
||||||
|
{
|
||||||
|
$this->error='Failed to fetch thirdparty for object with id '.$tmpobject->id;
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
dol_syslog("Failed to fetch thirdparty for object with id ".$tmpobject->id, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
elseif ($result < 0)
|
||||||
{
|
{
|
||||||
$this->error = $tmpobject->error;
|
$this->error = $tmpobject->error;
|
||||||
$this->errors = $tmpobject->errors;
|
$this->errors = $tmpobject->errors;
|
||||||
@ -481,21 +511,25 @@ class BlockedLog
|
|||||||
if ($this->element == 'payment_donation') $paymentpart->donation = new stdClass();
|
if ($this->element == 'payment_donation') $paymentpart->donation = new stdClass();
|
||||||
else $paymentpart->invoice = new stdClass();
|
else $paymentpart->invoice = new stdClass();
|
||||||
|
|
||||||
foreach($tmpobject as $key=>$value)
|
if ($this->element != 'payment_various')
|
||||||
{
|
{
|
||||||
if (in_array($key, array('fields'))) continue; // Discard some properties
|
foreach($tmpobject as $key=>$value)
|
||||||
if (! in_array($key, array(
|
|
||||||
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
|
||||||
))) continue; // Discard if not into a dedicated list
|
|
||||||
if (!is_object($value))
|
|
||||||
{
|
{
|
||||||
if ($this->element == 'payment_donation') $paymentpart->donation->{$key} = $value;
|
if (in_array($key, array('fields'))) continue; // Discard some properties
|
||||||
else $paymentpart->invoice->{$key} = $value;
|
if (! in_array($key, array(
|
||||||
|
'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||||
|
))) continue; // Discard if not into a dedicated list
|
||||||
|
if (!is_object($value))
|
||||||
|
{
|
||||||
|
if ($this->element == 'payment_donation') $paymentpart->donation->{$key} = $value;
|
||||||
|
elseif ($this->element == 'payment_various') $paymentpart->various->{$key} = $value;
|
||||||
|
else $paymentpart->invoice->{$key} = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$paymentpartnumber++;
|
$paymentpartnumber++; // first payment will be 1
|
||||||
$this->object_data->payment_part[$paymentpartnumber] = $paymentpart;
|
$this->object_data->payment_part[$paymentpartnumber] = $paymentpart;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->object_data->amount = $totalamount;
|
$this->object_data->amount = $totalamount;
|
||||||
|
|||||||
@ -825,7 +825,7 @@ class Categorie extends CommonObject
|
|||||||
$sql = "SELECT c.fk_" . $this->MAP_CAT_FK[$type];
|
$sql = "SELECT c.fk_" . $this->MAP_CAT_FK[$type];
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as c";
|
||||||
$sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o";
|
$sql .= ", " . MAIN_DB_PREFIX . $this->MAP_OBJ_TABLE[$type] . " as o";
|
||||||
$sql .= " WHERE o.entity IN (" . getEntity( $obj->element, 1).")";
|
$sql .= " WHERE o.entity IN (" . getEntity( $obj->element).")";
|
||||||
$sql.= " AND c.fk_categorie = ".$this->id;
|
$sql.= " AND c.fk_categorie = ".$this->id;
|
||||||
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
|
$sql .= " AND c.fk_" . $this->MAP_CAT_FK[$type] . " = o.rowid";
|
||||||
|
|
||||||
@ -1066,7 +1066,7 @@ class Categorie extends CommonObject
|
|||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
|
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
|
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
|
||||||
$sql .= " WHERE c.entity IN (" . getEntity( 'category', 1 ) . ")";
|
$sql .= " WHERE c.entity IN (" . getEntity( 'category') . ")";
|
||||||
$sql .= " AND c.type = " . $type;
|
$sql .= " AND c.type = " . $type;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
|
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
|
||||||
@ -1481,7 +1481,7 @@ class Categorie extends CommonObject
|
|||||||
$sql = "SELECT ct.fk_categorie, c.label, c.rowid";
|
$sql = "SELECT ct.fk_categorie, c.label, c.rowid";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type] . " as ct, " . MAIN_DB_PREFIX . "categorie as c";
|
||||||
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
|
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_" . $this->MAP_CAT_FK[$type] . " = " . (int) $id . " AND c.type = " . $this->MAP_ID[$type];
|
||||||
$sql .= " AND c.entity IN (" . getEntity( 'category', 1 ) . ")";
|
$sql .= " AND c.entity IN (" . getEntity( 'category') . ")";
|
||||||
|
|
||||||
$res = $this->db->query($sql);
|
$res = $this->db->query($sql);
|
||||||
if ($res)
|
if ($res)
|
||||||
@ -1542,7 +1542,7 @@ class Categorie extends CommonObject
|
|||||||
// Generation requete recherche
|
// Generation requete recherche
|
||||||
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie";
|
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie";
|
||||||
$sql .= " WHERE type = " . $this->MAP_ID[$type];
|
$sql .= " WHERE type = " . $this->MAP_ID[$type];
|
||||||
$sql .= " AND entity IN (" . getEntity( 'category', 1 ) . ")";
|
$sql .= " AND entity IN (" . getEntity( 'category') . ")";
|
||||||
if ($nom)
|
if ($nom)
|
||||||
{
|
{
|
||||||
if (! $exact)
|
if (! $exact)
|
||||||
|
|||||||
@ -1633,6 +1633,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
if (empty($conf->global->AGENDA_REMINDER_EMAIL))
|
if (empty($conf->global->AGENDA_REMINDER_EMAIL))
|
||||||
{
|
{
|
||||||
|
$langs->load("agenda");
|
||||||
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Agenda"));
|
$this->output = $langs->trans('EventRemindersByEmailNotEnabled', $langs->transnoentitiesnoconv("Agenda"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -773,7 +773,7 @@ if ($object->id > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Last sendings
|
* Last shipments
|
||||||
*/
|
*/
|
||||||
if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
|
if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) {
|
||||||
$sendingstatic = new Expedition($db);
|
$sendingstatic = new Expedition($db);
|
||||||
@ -1245,7 +1245,7 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
if (! empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_CUSTOMER_CARD))
|
||||||
{
|
{
|
||||||
// List of contacts
|
// List of contacts
|
||||||
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
show_contacts($conf,$langs,$db,$object,$_SERVER["PHP_SELF"].'?socid='.$object->id);
|
||||||
|
|||||||
@ -470,7 +470,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
$sql.= " WHERE s.client IN (1, 2, 3)";
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
|
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND s.rowid = $socid";
|
if ($socid) $sql.= " AND s.rowid = $socid";
|
||||||
$sql .= " ORDER BY s.tms DESC";
|
$sql .= " ORDER BY s.tms DESC";
|
||||||
@ -534,7 +534,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.fournisseur = 1";
|
$sql.= " WHERE s.fournisseur = 1";
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
|
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
||||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||||
$sql.= " ORDER BY s.datec DESC";
|
$sql.= " ORDER BY s.datec DESC";
|
||||||
|
|||||||
@ -156,6 +156,7 @@ if (empty($reshook))
|
|||||||
$sql = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
|
$sql = "SELECT mc.rowid, mc.fk_mailing, mc.lastname, mc.firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type, mc.tag";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||||
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
|
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;
|
||||||
|
$sql .= " ORDER BY mc.statut DESC"; // first status 0, then status -1
|
||||||
|
|
||||||
dol_syslog("card.php: select targets", LOG_DEBUG);
|
dol_syslog("card.php: select targets", LOG_DEBUG);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
@ -840,7 +841,7 @@ else
|
|||||||
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
|
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
|
||||||
$_GET["action"]='';
|
$_GET["action"]='';
|
||||||
}
|
}
|
||||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
|
else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
|
||||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
|
||||||
@ -875,7 +876,16 @@ else
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
$morehtmlright='';
|
$morehtmlright='';
|
||||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
$nbtry = $nbok = 0;
|
||||||
|
if ($object->statut == 2 || $object->statut == 3)
|
||||||
|
{
|
||||||
|
$nbtry = $object->countNbOfTargets('alreadysent');
|
||||||
|
$nbko = $object->countNbOfTargets('alreadysentko');
|
||||||
|
|
||||||
|
$morehtmlright.=' ('.$nbtry.'/'.$object->nbemail;
|
||||||
|
if ($nbko) $morehtmlright.=' - '.$nbko.' '.$langs->trans("Error");
|
||||||
|
$morehtmlright.=') ';
|
||||||
|
}
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||||
|
|
||||||
@ -903,11 +913,11 @@ else
|
|||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
|
$nbemail = ($object->nbemail?$object->nbemail:0);
|
||||||
if ($object->statut != 3 && is_numeric($nbemail))
|
if (is_numeric($nbemail))
|
||||||
{
|
{
|
||||||
$text='';
|
$text='';
|
||||||
if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
if ((! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail)))
|
||||||
{
|
{
|
||||||
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
||||||
{
|
{
|
||||||
@ -915,9 +925,10 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text.=$langs->trans('NotEnoughPermissions');
|
$text.=$langs->trans('SendingFromWebInterfaceIsNotAllowed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (empty($nbemail)) $nbemail.=' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
|
||||||
if ($text)
|
if ($text)
|
||||||
{
|
{
|
||||||
print $form->textwithpicto($nbemail,$text,1,'warning');
|
print $form->textwithpicto($nbemail,$text,1,'warning');
|
||||||
@ -1008,7 +1019,11 @@ else
|
|||||||
|
|
||||||
if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->rights->mailing->valider)
|
if (($object->statut == 1 || $object->statut == 2) && $object->nbemail > 0 && $user->rights->mailing->valider)
|
||||||
{
|
{
|
||||||
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0 || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send))
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("SendingFromWebInterfaceIsNotAllowed")).'">'.$langs->trans("SendMailing").'</a>';
|
||||||
|
}
|
||||||
|
else if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
|
||||||
{
|
{
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("SendMailing").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("SendMailing").'</a>';
|
||||||
}
|
}
|
||||||
@ -1183,15 +1198,30 @@ else
|
|||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
$nbemail = ($object->nbemail?$object->nbemail:img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>');
|
$nbemail = ($object->nbemail?$object->nbemail:0);
|
||||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && is_numeric($nbemail) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail)
|
if (is_numeric($nbemail))
|
||||||
{
|
{
|
||||||
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
$text='';
|
||||||
print $form->textwithpicto($nbemail,$text,1,'warning');
|
if ((! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || $object->statut == 2))
|
||||||
}
|
{
|
||||||
else
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
||||||
{
|
{
|
||||||
print $nbemail;
|
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text.=$langs->trans('SendingFromWebInterfaceIsNotAllowed');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($nbemail)) $nbemail.=' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
|
||||||
|
if ($text)
|
||||||
|
{
|
||||||
|
print $form->textwithpicto($nbemail,$text,1,'warning');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $nbemail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -171,6 +171,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing');
|
llxHeader('',$langs->trans("Mailing"),'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing');
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
@ -185,7 +186,16 @@ if ($object->fetch($id) >= 0)
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
$morehtmlright='';
|
$morehtmlright='';
|
||||||
if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
|
$nbtry = $nbok = 0;
|
||||||
|
if ($object->statut == 2 || $object->statut == 3)
|
||||||
|
{
|
||||||
|
$nbtry = $object->countNbOfTargets('alreadysent');
|
||||||
|
$nbko = $object->countNbOfTargets('alreadysentko');
|
||||||
|
|
||||||
|
$morehtmlright.=' ('.$nbtry.'/'.$object->nbemail;
|
||||||
|
if ($nbko) $morehtmlright.=' - '.$nbko.' '.$langs->trans("Error");
|
||||||
|
$morehtmlright.=') ';
|
||||||
|
}
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
|
||||||
|
|
||||||
@ -206,15 +216,30 @@ if ($object->fetch($id) >= 0)
|
|||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("TotalNbOfDistinctRecipients");
|
print $langs->trans("TotalNbOfDistinctRecipients");
|
||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
$nbemail = ($object->nbemail?$object->nbemail:'0');
|
$nbemail = ($object->nbemail?$object->nbemail:0);
|
||||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && ($conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || $object->statut == 2))
|
if (is_numeric($nbemail))
|
||||||
{
|
{
|
||||||
$text=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
$text='';
|
||||||
print $form->textwithpicto($nbemail,$text,1,'warning');
|
if ((! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) && ($object->statut == 1 || ($object->statut == 2 && $nbtry < $nbemail)))
|
||||||
}
|
{
|
||||||
else
|
if ($conf->global->MAILING_LIMIT_SENDBYWEB > 0)
|
||||||
{
|
{
|
||||||
print $nbemail;
|
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text.=$langs->trans('SendingFromWebInterfaceIsNotAllowed');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (empty($nbemail)) $nbemail.=' '.img_warning('').' <font class="warning">'.$langs->trans("NoTargetYet").'</font>';
|
||||||
|
if ($text)
|
||||||
|
{
|
||||||
|
print $form->textwithpicto($nbemail,$text,1,'warning');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $nbemail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -411,6 +436,8 @@ if ($object->fetch($id) >= 0)
|
|||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$param = "&id=".$object->id;
|
$param = "&id=".$object->id;
|
||||||
|
//if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||||
if ($search_lastname) $param.= "&search_lastname=".urlencode($search_lastname);
|
if ($search_lastname) $param.= "&search_lastname=".urlencode($search_lastname);
|
||||||
if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname);
|
if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname);
|
||||||
if ($search_email) $param.= "&search_email=".urlencode($search_email);
|
if ($search_email) $param.= "&search_email=".urlencode($search_email);
|
||||||
@ -552,7 +579,7 @@ if ($object->fetch($id) >= 0)
|
|||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Statut pour l'email destinataire (Attentioon != statut du mailing)
|
// Status of recipient sending email (Warning != status of emailing)
|
||||||
if ($obj->statut == 0)
|
if ($obj->statut == 0)
|
||||||
{
|
{
|
||||||
print '<td align="center"> </td>';
|
print '<td align="center"> </td>';
|
||||||
@ -563,18 +590,22 @@ if ($object->fetch($id) >= 0)
|
|||||||
{
|
{
|
||||||
print '<td align="center">'.$obj->date_envoi.'</td>';
|
print '<td align="center">'.$obj->date_envoi.'</td>';
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="right" class="nowrap">';
|
||||||
print $object::libStatutDest($obj->statut,2,$obj->error_text);
|
print $object::libStatutDest($obj->statut, 2, $obj->error_text);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search Icon
|
// Search Icon
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($obj->statut == 0)
|
if ($obj->statut == 0) // Not sent yet
|
||||||
{
|
{
|
||||||
if ($user->rights->mailing->creer && $allowaddtarget) {
|
if ($user->rights->mailing->creer && $allowaddtarget) {
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient"));
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&rowid='.$obj->rowid.$param.'">'.img_delete($langs->trans("RemoveRecipient")).'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*if ($obj->statut == -1) // Sent with error
|
||||||
|
{
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=retry&rowid='.$obj->rowid.$param.'">'.$langs->trans("Retry").'</a>';
|
||||||
|
}*/
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -485,7 +485,7 @@ class Mailing extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Count number of target with status
|
* Count number of target with status
|
||||||
*
|
*
|
||||||
* @param string $mode Mode ('alreadysent' = Sent success or error)
|
* @param string $mode Mode ('alreadysent' = Sent success or error, 'alreadysentok' = Sent success, 'alreadysentko' = Sent error)
|
||||||
* @return int Nb of target with status
|
* @return int Nb of target with status
|
||||||
*/
|
*/
|
||||||
function countNbOfTargets($mode)
|
function countNbOfTargets($mode)
|
||||||
@ -493,6 +493,8 @@ class Mailing extends CommonObject
|
|||||||
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
|
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
|
||||||
$sql.= " WHERE fk_mailing = ".$this->id;
|
$sql.= " WHERE fk_mailing = ".$this->id;
|
||||||
if ($mode == 'alreadysent') $sql.= " AND statut <> 0";
|
if ($mode == 'alreadysent') $sql.= " AND statut <> 0";
|
||||||
|
elseif ($mode == 'alreadysentok') $sql.= " AND statut > 0";
|
||||||
|
elseif ($mode == 'alreadysentko') $sql.= " AND statut = -1";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error='BadValueForParameterMode';
|
$this->error='BadValueForParameterMode';
|
||||||
@ -515,7 +517,7 @@ class Mailing extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne le libelle du statut d'un mailing (brouillon, validee, ...
|
* Return label of status of emailing (draft, validated, ...)
|
||||||
*
|
*
|
||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||||
* @return string Label
|
* @return string Label
|
||||||
|
|||||||
@ -2130,6 +2130,22 @@ if ($action == 'create')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tmparray=$object->getTotalWeightVolume();
|
||||||
|
$totalWeight=$tmparray['weight'];
|
||||||
|
$totalVolume=$tmparray['volume'];
|
||||||
|
if ($totalWeight) {
|
||||||
|
print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
if ($totalVolume) {
|
||||||
|
print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
|
||||||
|
print '<td>';
|
||||||
|
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
// Incoterms
|
// Incoterms
|
||||||
if (!empty($conf->incoterm->enabled))
|
if (!empty($conf->incoterm->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -76,7 +76,7 @@ $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st ";
|
|||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.fk_stcomm = st.id";
|
$sql.= " WHERE s.fk_stcomm = st.id";
|
||||||
$sql.= " AND s.client IN (2, 3)";
|
$sql.= " AND s.client IN (2, 3)";
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
|
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " GROUP BY st.id";
|
$sql.= " GROUP BY st.id";
|
||||||
$sql.= " ORDER BY st.id";
|
$sql.= " ORDER BY st.id";
|
||||||
@ -243,7 +243,7 @@ $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas";
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.fk_stcomm = 1";
|
$sql.= " WHERE s.fk_stcomm = 1";
|
||||||
$sql.= " AND s.entity IN (".getEntity($companystatic->element, 1).")";
|
$sql.= " AND s.entity IN (".getEntity($companystatic->element).")";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " ORDER BY s.tms ASC";
|
$sql.= " ORDER BY s.tms ASC";
|
||||||
$sql.= $db->plimit(15, 0);
|
$sql.= $db->plimit(15, 0);
|
||||||
|
|||||||
@ -2300,12 +2300,15 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$tmparray=$object->getTotalWeightVolume();
|
$tmparray=$object->getTotalWeightVolume();
|
||||||
$totalWeight=$tmparray['weight'];
|
$totalWeight=$tmparray['weight'];
|
||||||
$totalVolume=$tmparray['volume'];
|
$totalVolume=$tmparray['volume'];
|
||||||
if ($totalWeight || $totalVolume)
|
if ($totalWeight)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
|
print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
if ($totalVolume)
|
||||||
|
{
|
||||||
print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
|
print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no');
|
||||||
|
|||||||
@ -153,6 +153,7 @@ class Orders extends DolibarrApi
|
|||||||
{
|
{
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||||
|
$i=0;
|
||||||
while ($i < $min)
|
while ($i < $min)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
@ -276,7 +277,7 @@ class Orders extends DolibarrApi
|
|||||||
$request_data->product_type,
|
$request_data->product_type,
|
||||||
$request_data->rang,
|
$request_data->rang,
|
||||||
$request_data->special_code,
|
$request_data->special_code,
|
||||||
$fk_parent_line,
|
$request_data->fk_parent_line,
|
||||||
$request_data->fk_fournprice,
|
$request_data->fk_fournprice,
|
||||||
$request_data->pa_ht,
|
$request_data->pa_ht,
|
||||||
$request_data->label,
|
$request_data->label,
|
||||||
@ -424,14 +425,6 @@ class Orders extends DolibarrApi
|
|||||||
if ($this->commande->availability($this->commande->availability_id) < 0)
|
if ($this->commande->availability($this->commande->availability_id) < 0)
|
||||||
throw new RestException(400, 'Error while updating availability');
|
throw new RestException(400, 'Error while updating availability');
|
||||||
}
|
}
|
||||||
// update bank account
|
|
||||||
if(!empty($this->commande->fk_account))
|
|
||||||
{
|
|
||||||
if($this->commande->setBankAccount($this->commande->fk_account) == 0)
|
|
||||||
{
|
|
||||||
throw new RestException(400,$this->commande->error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->commande->update(DolibarrApiAccess::$user) > 0)
|
if ($this->commande->update(DolibarrApiAccess::$user) > 0)
|
||||||
{
|
{
|
||||||
@ -479,7 +472,7 @@ class Orders extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Validate an order
|
* Validate an order
|
||||||
*
|
*
|
||||||
* If you get a bad value for param notrigger check that ou provide this in body
|
* If you get a bad value for param notrigger check, provide this in body
|
||||||
* {
|
* {
|
||||||
* "idwarehouse": 0,
|
* "idwarehouse": 0,
|
||||||
* "notrigger": 0
|
* "notrigger": 0
|
||||||
|
|||||||
@ -3036,6 +3036,8 @@ class Commande extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
function update(User $user, $notrigger=0)
|
function update(User $user, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -3069,6 +3071,7 @@ class Commande extends CommonOrder
|
|||||||
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
|
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
|
||||||
$sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").",";
|
$sql.= " fk_cond_reglement=".(isset($this->cond_reglement_id)?$this->cond_reglement_id:"null").",";
|
||||||
$sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").",";
|
$sql.= " fk_mode_reglement=".(isset($this->mode_reglement_id)?$this->mode_reglement_id:"null").",";
|
||||||
|
$sql.= " fk_account=".($this->fk_account>0?$this->fk_account:"null").",";
|
||||||
$sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").",";
|
$sql.= " note_private=".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null").",";
|
||||||
$sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").",";
|
$sql.= " note_public=".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null").",";
|
||||||
$sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").",";
|
$sql.= " model_pdf=".(isset($this->modelpdf)?"'".$this->db->escape($this->modelpdf)."'":"null").",";
|
||||||
|
|||||||
@ -387,7 +387,7 @@ if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
|||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
|
||||||
|
$options = array();
|
||||||
|
|
||||||
if ($id > 0 || ! empty($ref))
|
if ($id > 0 || ! empty($ref))
|
||||||
{
|
{
|
||||||
@ -398,7 +398,6 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Load bank groups
|
// Load bank groups
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php';
|
||||||
$bankcateg = new BankCateg($db);
|
$bankcateg = new BankCateg($db);
|
||||||
$options = array();
|
|
||||||
|
|
||||||
foreach ($bankcateg->fetchAll() as $bankcategory) {
|
foreach ($bankcateg->fetchAll() as $bankcategory) {
|
||||||
$options[$bankcategory->id] = $bankcategory->label;
|
$options[$bankcategory->id] = $bankcategory->label;
|
||||||
@ -531,7 +530,6 @@ dol_syslog('compta/bank/bankentries_list.php', LOG_DEBUG);
|
|||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$var=True;
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||||
@ -569,14 +567,12 @@ if ($resql)
|
|||||||
// Form to reconcile
|
// Form to reconcile
|
||||||
if ($user->rights->banque->consolidate && $action == 'reconcile')
|
if ($user->rights->banque->consolidate && $action == 'reconcile')
|
||||||
{
|
{
|
||||||
// print '<table class="noborder" width="100%">';
|
|
||||||
// print '<tr '.$bcnd[false].'>';
|
|
||||||
// print '<td>';
|
|
||||||
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
print '<div class="valignmiddle inline-block" style="padding-right: 20px;">';
|
||||||
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
|
print '<strong>'.$langs->trans("InputReceiptNumber").'</strong>: ';
|
||||||
print '<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
|
print '<input class="flat" id="num_releve" name="num_releve" type="text" value="'.(GETPOST('num_releve')?GETPOST('num_releve'):'').'" size="10">'; // The only default value is value we just entered
|
||||||
print '</div>';
|
print '</div>';
|
||||||
if ($options) {
|
if (is_array($options) && count($options))
|
||||||
|
{
|
||||||
print $langs->trans("EventualyAddCategory").': ';
|
print $langs->trans("EventualyAddCategory").': ';
|
||||||
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
|
print Form::selectarray('cat', $options, GETPOST('cat'), 1);
|
||||||
}
|
}
|
||||||
@ -629,7 +625,6 @@ if ($resql)
|
|||||||
';
|
';
|
||||||
}
|
}
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
// print '</td></tr></table>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form to add a transaction with no invoice
|
// Form to add a transaction with no invoice
|
||||||
@ -663,7 +658,8 @@ if ($resql)
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input name="label" class="flat minwidth200" type="text" value="'.GETPOST("label","alpha").'">';
|
print '<input name="label" class="flat minwidth200" type="text" value="'.GETPOST("label","alpha").'">';
|
||||||
if (is_array($options) && count($options)) {
|
if (is_array($options) && count($options))
|
||||||
|
{
|
||||||
print '<br>'.$langs->trans("Rubrique").': ';
|
print '<br>'.$langs->trans("Rubrique").': ';
|
||||||
print Form::selectarray('cat1', $options, GETPOST('cat1'), 1);
|
print Form::selectarray('cat1', $options, GETPOST('cat1'), 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,8 @@ class PaymentVarious extends CommonObject
|
|||||||
public $table_element='payment_various'; //!< Name of table without prefix where object is stored
|
public $table_element='payment_various'; //!< Name of table without prefix where object is stored
|
||||||
public $picto = 'bill';
|
public $picto = 'bill';
|
||||||
|
|
||||||
|
var $id;
|
||||||
|
var $ref;
|
||||||
var $tms;
|
var $tms;
|
||||||
var $datep;
|
var $datep;
|
||||||
var $datev;
|
var $datev;
|
||||||
@ -87,8 +89,7 @@ class PaymentVarious extends CommonObject
|
|||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_various SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_various SET";
|
||||||
|
if ($this->tms) $sql.= " tms='".$this->db->idate($this->tms)."',";
|
||||||
$sql.= " tms='".$this->db->idate($this->tms)."',";
|
|
||||||
$sql.= " datep='".$this->db->idate($this->datep)."',";
|
$sql.= " datep='".$this->db->idate($this->datep)."',";
|
||||||
$sql.= " datev='".$this->db->idate($this->datev)."',";
|
$sql.= " datev='".$this->db->idate($this->datev)."',";
|
||||||
$sql.= " sens=".$this->sens.",";
|
$sql.= " sens=".$this->sens.",";
|
||||||
@ -102,7 +103,6 @@ class PaymentVarious extends CommonObject
|
|||||||
$sql.= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank:"null").",";
|
$sql.= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank:"null").",";
|
||||||
$sql.= " fk_user_author=".$this->fk_user_author.",";
|
$sql.= " fk_user_author=".$this->fk_user_author.",";
|
||||||
$sql.= " fk_user_modif=".$this->fk_user_modif;
|
$sql.= " fk_user_modif=".$this->fk_user_modif;
|
||||||
|
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
@ -146,7 +146,6 @@ class PaymentVarious extends CommonObject
|
|||||||
global $langs;
|
global $langs;
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
$sql.= " v.rowid,";
|
$sql.= " v.rowid,";
|
||||||
|
|
||||||
$sql.= " v.tms,";
|
$sql.= " v.tms,";
|
||||||
$sql.= " v.datep,";
|
$sql.= " v.datep,";
|
||||||
$sql.= " v.datev,";
|
$sql.= " v.datev,";
|
||||||
@ -164,7 +163,6 @@ class PaymentVarious extends CommonObject
|
|||||||
$sql.= " b.fk_account,";
|
$sql.= " b.fk_account,";
|
||||||
$sql.= " b.fk_type,";
|
$sql.= " b.fk_type,";
|
||||||
$sql.= " b.rappro";
|
$sql.= " b.rappro";
|
||||||
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
|
||||||
$sql.= " WHERE v.rowid = ".$id;
|
$sql.= " WHERE v.rowid = ".$id;
|
||||||
@ -184,7 +182,7 @@ class PaymentVarious extends CommonObject
|
|||||||
$this->datev = $this->db->jdate($obj->datev);
|
$this->datev = $this->db->jdate($obj->datev);
|
||||||
$this->sens = $obj->sens;
|
$this->sens = $obj->sens;
|
||||||
$this->amount = $obj->amount;
|
$this->amount = $obj->amount;
|
||||||
$this->type_payement = $obj->fk_typepayment;
|
$this->type_payment = $obj->fk_typepayment;
|
||||||
$this->num_payment = $obj->num_payment;
|
$this->num_payment = $obj->num_payment;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->note = $obj->note;
|
$this->note = $obj->note;
|
||||||
@ -350,6 +348,7 @@ class PaymentVarious extends CommonObject
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
|
||||||
|
$this->ref = $this->id;
|
||||||
|
|
||||||
if ($this->id > 0)
|
if ($this->id > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,7 +49,7 @@ $sens=GETPOST("sens","int");
|
|||||||
$amount=GETPOST("amount");
|
$amount=GETPOST("amount");
|
||||||
$paymenttype=GETPOST("paymenttype");
|
$paymenttype=GETPOST("paymenttype");
|
||||||
$accountancy_code=GETPOST("accountancy_code","int");
|
$accountancy_code=GETPOST("accountancy_code","int");
|
||||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : GETPOST('fk_project','int'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("socid","int");
|
$socid = GETPOST("socid","int");
|
||||||
@ -96,22 +96,23 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
$datep=dol_mktime(12,0,0, GETPOST("datepmonth"), GETPOST("datepday"), GETPOST("datepyear"));
|
$datep=dol_mktime(12,0,0, GETPOST("datepmonth",'int'), GETPOST("datepday",'int'), GETPOST("datepyear",'int'));
|
||||||
$datev=dol_mktime(12,0,0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
|
$datev=dol_mktime(12,0,0, GETPOST("datevmonth",'int'), GETPOST("datevday",'int'), GETPOST("datevyear",'int'));
|
||||||
if (empty($datev)) $datev=$datep;
|
if (empty($datev)) $datev=$datep;
|
||||||
|
|
||||||
$object->accountid=GETPOST("accountid") > 0 ? GETPOST("accountid","int") : 0;
|
$object->ref=''; // TODO
|
||||||
|
$object->accountid=GETPOST("accountid",'int') > 0 ? GETPOST("accountid","int") : 0;
|
||||||
$object->datev=$datev;
|
$object->datev=$datev;
|
||||||
$object->datep=$datep;
|
$object->datep=$datep;
|
||||||
$object->amount=price2num(GETPOST("amount"));
|
$object->amount=price2num(GETPOST("amount",'alpha'));
|
||||||
$object->label=GETPOST("label");
|
$object->label=GETPOST("label",'none');
|
||||||
$object->note=GETPOST("note");
|
$object->note=GETPOST("note",'none');
|
||||||
$object->type_payment=GETPOST("paymenttype") > 0 ? GETPOST("paymenttype", "int") : 0;
|
$object->type_payment=GETPOST("paymenttype",'int') > 0 ? GETPOST("paymenttype", "int") : 0;
|
||||||
$object->num_payment=GETPOST("num_payment");
|
$object->num_payment=GETPOST("num_payment",'alpha');
|
||||||
$object->fk_user_author=$user->id;
|
$object->fk_user_author=$user->id;
|
||||||
$object->accountancy_code=GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code","int") : "";
|
$object->accountancy_code=GETPOST("accountancy_code") > 0 ? GETPOST("accountancy_code","int") : "";
|
||||||
$object->sens=GETPOST('sens');
|
$object->sens=GETPOST('sens');
|
||||||
$object->fk_project= GETPOST('fk_project');
|
$object->fk_project= GETPOST('fk_project','int');
|
||||||
|
|
||||||
if (empty($datep) || empty($datev))
|
if (empty($datep) || empty($datev))
|
||||||
{
|
{
|
||||||
@ -411,7 +412,7 @@ if ($id)
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||||
|
|
||||||
// Payment date
|
// Payment date
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
|
|||||||
@ -108,21 +108,19 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.row
|
|||||||
$sql.= " WHERE v.entity IN (".getEntity('payment_various').")";
|
$sql.= " WHERE v.entity IN (".getEntity('payment_various').")";
|
||||||
|
|
||||||
// Search criteria
|
// Search criteria
|
||||||
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
||||||
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
||||||
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
|
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
|
||||||
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
|
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
|
||||||
if ($search_account > 0) $sql.=" AND b.fk_account=".$search_account;
|
if ($search_account > 0) $sql.=" AND b.fk_account=".$search_account;
|
||||||
if ($search_date) $sql.=" AND v.datep=".$search_date;
|
if ($search_date) $sql.=" AND v.datep=".$search_date;
|
||||||
if ($search_accountancy_code) $sql.=" AND v.accountancy_code=".$search_accountancy_code;
|
if ($search_accountancy_code > 0) $sql.=" AND v.accountancy_code=".$search_accountancy_code;
|
||||||
|
if ($typeid > 0) $sql .= " AND v.fk_typepayment=".$typeid;
|
||||||
if ($filtre) {
|
if ($filtre) {
|
||||||
$filtre=str_replace(":","=",$filtre);
|
$filtre=str_replace(":","=",$filtre);
|
||||||
$sql .= " AND ".$filtre;
|
$sql .= " AND ".$filtre;
|
||||||
}
|
}
|
||||||
if ($typeid) {
|
|
||||||
$sql .= " AND v.fk_typepayment=".$typeid;
|
|
||||||
}
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
|
|
||||||
$totalnboflines=0;
|
$totalnboflines=0;
|
||||||
@ -142,10 +140,18 @@ if ($result)
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
$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 ($typeid) $param.='&typeid='.$typeid;
|
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($search_label) $param.='&search_label='.urlencode($search_label);
|
||||||
|
if ($typeid > 0) $param.='&typeid='.urlencode($typeid);
|
||||||
|
if ($search_amount_deb) $param.='&search_amount_deb='.urlencode($search_amount_deb);
|
||||||
|
if ($search_amount_cred) $param.='&search_amount_cred='.urlencode($search_amount_cred);
|
||||||
|
if ($search_account > 0) $param.='&search_amount='.urlencode($search_account);
|
||||||
|
//if ($search_date) $param.='&search_date='.$search_date;
|
||||||
|
if ($search_accountancy_code > 0) $param.='&search_accountancy_code='.urlencode($search_accountancy_code);
|
||||||
|
|
||||||
|
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|
||||||
@ -162,18 +168,6 @@ if ($result)
|
|||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"v.rowid","",$param,"",$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"v.label","",$param,'align="left"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"v.datep","",$param,'align="center"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
|
||||||
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
|
||||||
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
|
||||||
print "</tr>\n";
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -227,6 +221,20 @@ if ($result)
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"v.rowid","",$param,"",$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre("Label",$_SERVER["PHP_SELF"],"v.label","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"v.datep","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre("PaymentMode",$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->banque->enabled)) print_liste_field_titre("BankAccount",$_SERVER["PHP_SELF"],"ba.label","",$param,"",$sortfield,$sortorder);
|
||||||
|
if (! empty($conf->accounting->enabled)) print_liste_field_titre("AccountAccounting",$_SERVER["PHP_SELF"],"v.accountancy_code","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre("Debit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre("Credit",$_SERVER["PHP_SELF"],"v.amount","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
|
print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
$totalarray=array();
|
$totalarray=array();
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -683,7 +683,7 @@ if (empty($reshook))
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
if ($line->total_ht!=0)
|
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9
|
||||||
{ // no need to create discount if amount is null
|
{ // no need to create discount if amount is null
|
||||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||||
@ -1570,7 +1570,7 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
|
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||||
$error ++;
|
$error ++;
|
||||||
@ -3047,10 +3047,10 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirmation de la validation
|
// Confirmation of validation
|
||||||
if ($action == 'valid')
|
if ($action == 'valid')
|
||||||
{
|
{
|
||||||
// on verifie si l'objet est en numerotation provisoire
|
// we check object has a draft number
|
||||||
$objectref = substr($object->ref, 1, 4);
|
$objectref = substr($object->ref, 1, 4);
|
||||||
if ($objectref == 'PROV') {
|
if ($objectref == 'PROV') {
|
||||||
$savdate = $object->date;
|
$savdate = $object->date;
|
||||||
|
|||||||
@ -60,30 +60,30 @@ class Invoices extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
function get($id)
|
function get($id)
|
||||||
{
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->invoice->fetch($id);
|
$result = $this->invoice->fetch($id);
|
||||||
if( ! $result ) {
|
if (! $result) {
|
||||||
throw new RestException(404, 'Invoice not found');
|
throw new RestException(404, 'Invoice not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get payment details
|
// Get payment details
|
||||||
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
|
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
|
||||||
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
|
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
|
||||||
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
|
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
|
||||||
$this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
|
$this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
if (! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->invoice->fetchObjectLinked();
|
$this->invoice->fetchObjectLinked();
|
||||||
return $this->_cleanObjectDatas($this->invoice);
|
return $this->_cleanObjectDatas($this->invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List invoices
|
* List invoices
|
||||||
|
|||||||
@ -1163,9 +1163,9 @@ class Facture extends CommonInvoice
|
|||||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
if (! empty($this->total_tva))
|
if (! empty($this->total_tva))
|
||||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
if (! empty($this->total_tva))
|
if (! empty($this->total_localtax1))
|
||||||
$label.= '<br><b>' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
if (! empty($this->total_tva))
|
if (! empty($this->total_localtax2))
|
||||||
$label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
if (! empty($this->total_ttc))
|
if (! empty($this->total_ttc))
|
||||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
|
|||||||
@ -1056,7 +1056,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">';
|
print '<td class="tdtop">';
|
||||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
|
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td colspan="2">';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
@ -1067,7 +1067,7 @@ if ($action == 'create')
|
|||||||
print '<td class="tdtop">';
|
print '<td class="tdtop">';
|
||||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
|
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td>';
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
||||||
@ -1396,7 +1396,7 @@ else
|
|||||||
// Note public
|
// Note public
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $user->rights->facture->creer);
|
print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $user->rights->facture->creer);
|
||||||
print '</td><td>';
|
print '</td><td class="wordbreak">';
|
||||||
print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
|
print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
@ -1404,7 +1404,7 @@ else
|
|||||||
// Note private
|
// Note private
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
|
print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
|
||||||
print '</td><td>';
|
print '</td><td class="wordbreak">';
|
||||||
print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
|
print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -140,8 +140,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$sql.= ", f.rowid, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.ref_client";
|
$sql.= ", f.rowid, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.ref_client";
|
||||||
$sql.= ", f.type";
|
$sql.= ", f.type";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid, s.email";
|
||||||
$sql.= ",s.code_client";
|
$sql.= ", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -177,22 +177,28 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
|
||||||
$facturestatic->ref=$obj->facnumber;
|
$facturestatic->ref=$obj->facnumber;
|
||||||
$facturestatic->id=$obj->rowid;
|
$facturestatic->id=$obj->rowid;
|
||||||
$facturestatic->total_ht=$obj->total_ht;
|
$facturestatic->total_ht=$obj->total_ht;
|
||||||
$facturestatic->total_tva=$obj->total_tva;
|
$facturestatic->total_tva=$obj->total_tva;
|
||||||
$facturestatic->total_ttc=$obj->total_ttc;
|
$facturestatic->total_ttc=$obj->total_ttc;
|
||||||
$facturestatic->ref_client=$obj->ref_client;
|
$facturestatic->ref_client=$obj->ref_client;
|
||||||
$facturestatic->type=$obj->type;
|
$facturestatic->type=$obj->type;
|
||||||
|
|
||||||
|
$companystatic->id=$obj->socid;
|
||||||
|
$companystatic->name=$obj->name;
|
||||||
|
$companystatic->email=$obj->email;
|
||||||
|
$companystatic->client = 1;
|
||||||
|
$companystatic->code_client = $obj->code_client;
|
||||||
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$companystatic->code_compta = $obj->code_compta;
|
||||||
|
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td class="nowrap">';
|
||||||
print $facturestatic->getNomUrl(1,'');
|
print $facturestatic->getNomUrl(1,'');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->client = 1;
|
|
||||||
$companystatic->code_client = $obj->code_client;
|
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
print $companystatic->getNomUrl(1,'',16);
|
print $companystatic->getNomUrl(1,'',16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td>';
|
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td>';
|
||||||
@ -226,8 +232,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
{
|
{
|
||||||
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier";
|
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid, s.email";
|
||||||
$sql.= ", s.code_fournisseur";
|
$sql.= ", s.code_fournisseur, s.code_compta_fournisseur";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
$sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
|
$sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
|
||||||
@ -256,22 +262,28 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td class="nowrap">';
|
|
||||||
$facturesupplierstatic->ref=$obj->ref;
|
$facturesupplierstatic->ref=$obj->ref;
|
||||||
$facturesupplierstatic->id=$obj->rowid;
|
$facturesupplierstatic->id=$obj->rowid;
|
||||||
$facturesupplierstatic->total_ht=$obj->total_ht;
|
$facturesupplierstatic->total_ht=$obj->total_ht;
|
||||||
$facturesupplierstatic->total_tva=$obj->total_tva;
|
$facturesupplierstatic->total_tva=$obj->total_tva;
|
||||||
$facturesupplierstatic->total_ttc=$obj->total_ttc;
|
$facturesupplierstatic->total_ttc=$obj->total_ttc;
|
||||||
$facturesupplierstatic->ref_supplier=$obj->ref_supplier;
|
$facturesupplierstatic->ref_supplier=$obj->ref_supplier;
|
||||||
$facturesupplierstatic->type=$obj->type;
|
$facturesupplierstatic->type=$obj->type;
|
||||||
|
|
||||||
|
$companystatic->id=$obj->socid;
|
||||||
|
$companystatic->name=$obj->name;
|
||||||
|
$companystatic->email=$obj->email;
|
||||||
|
$companystatic->fournisseur = 1;
|
||||||
|
$companystatic->code_client = $obj->code_client;
|
||||||
|
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$companystatic->code_compta = $obj->code_compta;
|
||||||
|
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td class="nowrap">';
|
||||||
print $facturesupplierstatic->getNomUrl(1,'',16);
|
print $facturesupplierstatic->getNomUrl(1,'',16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$companystatic->id=$obj->socid;
|
|
||||||
$companystatic->name=$obj->name;
|
|
||||||
$companystatic->fournisseur = 1;
|
|
||||||
$companystatic->code_client = $obj->code_client;
|
|
||||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
print $companystatic->getNomUrl(1,'supplier',16);
|
print $companystatic->getNomUrl(1,'supplier',16);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||||
@ -311,7 +323,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$sql.= ", f.date_lim_reglement as datelimite";
|
$sql.= ", f.date_lim_reglement as datelimite";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid";
|
||||||
$sql.= ", s.code_client";
|
$sql.= ", s.code_client, s.code_compta";
|
||||||
$sql.= ", sum(pf.amount) as am";
|
$sql.= ", sum(pf.amount) as am";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
|
||||||
@ -325,7 +337,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||||
|
$sql.= " s.nom, s.rowid, s.code_client, s.code_compta";
|
||||||
$sql.= " ORDER BY f.tms DESC ";
|
$sql.= " ORDER BY f.tms DESC ";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
@ -350,19 +363,28 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$facturestatic->ref=$obj->facnumber;
|
||||||
|
$facturestatic->id=$obj->rowid;
|
||||||
|
$facturestatic->total_ht=$obj->total_ht;
|
||||||
|
$facturestatic->total_tva=$obj->total_tva;
|
||||||
|
$facturestatic->total_ttc=$obj->total_ttc;
|
||||||
|
$facturestatic->statut = $obj->fk_statut;
|
||||||
|
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
||||||
|
$facturestatic->type=$obj->type;
|
||||||
|
|
||||||
|
$thirdpartystatic->id=$obj->socid;
|
||||||
|
$thirdpartystatic->name=$obj->name;
|
||||||
|
$thirdpartystatic->client=1;
|
||||||
|
$thirdpartystatic->code_client = $obj->code_client;
|
||||||
|
//$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$thirdpartystatic->code_compta = $obj->code_compta;
|
||||||
|
//$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
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 width="110" class="nobordernopadding nowrap">';
|
||||||
$facturestatic->ref=$obj->facnumber;
|
|
||||||
$facturestatic->id=$obj->rowid;
|
|
||||||
$facturestatic->total_ht=$obj->total_ht;
|
|
||||||
$facturestatic->total_tva=$obj->total_tva;
|
|
||||||
$facturestatic->total_ttc=$obj->total_ttc;
|
|
||||||
$facturestatic->statut = $obj->fk_statut;
|
|
||||||
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
|
||||||
$facturestatic->type=$obj->type;
|
|
||||||
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">';
|
||||||
@ -379,12 +401,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
$thirdpartystatic->id=$obj->socid;
|
print $thirdpartystatic->getNomUrl(1,'customer',44);
|
||||||
$thirdpartystatic->name=$obj->name;
|
|
||||||
$thirdpartystatic->client=1;
|
|
||||||
$thirdpartystatic->code_client = $obj->code_client;
|
|
||||||
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
print $thirdpartystatic->getNomUrl(1,'customer',44);
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
||||||
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
print '<td align="right">'.price($obj->total_ttc).'</td>';
|
||||||
@ -425,7 +442,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye";
|
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid";
|
||||||
$sql.= ", s.code_fournisseur";
|
$sql.= ", s.code_fournisseur, s.code_compta_fournisseur";
|
||||||
$sql.= ", SUM(pf.amount) as am";
|
$sql.= ", SUM(pf.amount) as am";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
|
||||||
@ -439,7 +456,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierLastModified',$parameters);
|
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierLastModified',$parameters);
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid, s.code_fournisseur";
|
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye,";
|
||||||
|
$sql.= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur";
|
||||||
$sql.= " ORDER BY ff.tms DESC ";
|
$sql.= " ORDER BY ff.tms DESC ";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
@ -463,20 +481,25 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
$facstatic->ref=$obj->ref;
|
$facstatic->ref=$obj->ref;
|
||||||
$facstatic->id = $obj->rowid;
|
$facstatic->id = $obj->rowid;
|
||||||
$facstatic->total_ht = $obj->total_ht;
|
$facstatic->total_ht = $obj->total_ht;
|
||||||
$facstatic->total_tva = $obj->total_tva;
|
$facstatic->total_tva = $obj->total_tva;
|
||||||
$facstatic->total_ttc = $obj->total_ttc;
|
$facstatic->total_ttc = $obj->total_ttc;
|
||||||
print $facstatic->getNomUrl(1,'');
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
$thirdpartystatic->id=$obj->socid;
|
$thirdpartystatic->id=$obj->socid;
|
||||||
$thirdpartystatic->name=$obj->name;
|
$thirdpartystatic->name=$obj->name;
|
||||||
$thirdpartystatic->fournisseur=1;
|
$thirdpartystatic->fournisseur=1;
|
||||||
$thirdpartystatic->code_client = $obj->code_client;
|
//$thirdpartystatic->code_client = $obj->code_client;
|
||||||
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
|
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
//$thirdpartystatic->code_compta = $obj->code_compta;
|
||||||
|
$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $facstatic->getNomUrl(1,'');
|
||||||
|
print '</td>';
|
||||||
|
print '<td>';
|
||||||
print $thirdpartystatic->getNomUrl(1,'supplier',44);
|
print $thirdpartystatic->getNomUrl(1,'supplier',44);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
||||||
@ -673,9 +696,9 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc";
|
$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name, s.email";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid";
|
||||||
$sql.= ", s.code_client";
|
$sql.= ", s.code_client, s.code_compta";
|
||||||
$sql.= ", c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva as total_tva, c.total_ttc";
|
$sql.= ", c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva as total_tva, c.total_ttc";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -693,7 +716,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
|
$sql.= " GROUP BY s.nom, s.rowid, s.email, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
@ -712,18 +735,28 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|||||||
print '<th align="right">'.$langs->trans("ToBill").'</th>';
|
print '<th align="right">'.$langs->trans("ToBill").'</th>';
|
||||||
print '<th align="center" width="16"> </th>';
|
print '<th align="center" width="16"> </th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$tot_ht=$tot_ttc=$tot_tobill=0;
|
$tot_ht=$tot_ttc=$tot_tobill=0;
|
||||||
$societestatic = new Societe($db);
|
$societestatic = new Societe($db);
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
$societestatic->id=$obj->socid;
|
||||||
print '<td class="nowrap">';
|
$societestatic->name=$obj->name;
|
||||||
|
$societestatic->email=$obj->email;
|
||||||
|
$societestatic->client=1;
|
||||||
|
$societestatic->code_client = $obj->code_client;
|
||||||
|
//$societestatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$societestatic->code_compta = $obj->code_compta;
|
||||||
|
//$societestatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
|
||||||
$commandestatic->id=$obj->rowid;
|
$commandestatic->id=$obj->rowid;
|
||||||
$commandestatic->ref=$obj->ref;
|
$commandestatic->ref=$obj->ref;
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
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 width="110" class="nobordernopadding nowrap">';
|
||||||
print $commandestatic->getNomUrl(1);
|
print $commandestatic->getNomUrl(1);
|
||||||
@ -741,11 +774,6 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
$societestatic->id=$obj->socid;
|
|
||||||
$societestatic->name=$obj->name;
|
|
||||||
$societestatic->client=1;
|
|
||||||
$societestatic->code_client = $obj->code_client;
|
|
||||||
$societestatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
print $societestatic->getNomUrl(1,'customer',44);
|
print $societestatic->getNomUrl(1,'customer',44);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
||||||
@ -787,8 +815,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
|
$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms";
|
||||||
$sql.= ", f.date_lim_reglement as datelimite";
|
$sql.= ", f.date_lim_reglement as datelimite";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid, s.email";
|
||||||
$sql.= ", s.code_client";
|
$sql.= ", s.code_client, s.code_compta";
|
||||||
$sql.= ", sum(pf.amount) as am";
|
$sql.= ", sum(pf.amount) as am";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
|
||||||
@ -802,7 +830,8 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,";
|
||||||
|
$sql.= " s.nom, s.rowid, s.email, s.code_client, s.code_compta";
|
||||||
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
|
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -829,19 +858,29 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
$facturestatic->ref=$obj->facnumber;
|
||||||
|
$facturestatic->id=$obj->rowid;
|
||||||
|
$facturestatic->total_ht=$obj->total_ht;
|
||||||
|
$facturestatic->total_tva=$obj->total_tva;
|
||||||
|
$facturestatic->total_ttc=$obj->total_ttc;
|
||||||
|
$facturestatic->type=$obj->type;
|
||||||
|
$facturestatic->statut = $obj->fk_statut;
|
||||||
|
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
||||||
|
|
||||||
|
$societestatic->id=$obj->socid;
|
||||||
|
$societestatic->name=$obj->name;
|
||||||
|
$societestatic->email=$obj->email;
|
||||||
|
$societestatic->client=1;
|
||||||
|
$societestatic->code_client = $obj->code_client;
|
||||||
|
$societestatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$societestatic->code_compta = $obj->code_compta;
|
||||||
|
$societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
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 width="110" class="nobordernopadding nowrap">';
|
||||||
$facturestatic->ref=$obj->facnumber;
|
|
||||||
$facturestatic->id=$obj->rowid;
|
|
||||||
$facturestatic->total_ht=$obj->total_ht;
|
|
||||||
$facturestatic->total_tva=$obj->total_tva;
|
|
||||||
$facturestatic->total_ttc=$obj->total_ttc;
|
|
||||||
$facturestatic->type=$obj->type;
|
|
||||||
$facturestatic->statut = $obj->fk_statut;
|
|
||||||
$facturestatic->date_lim_reglement = $db->jdate($obj->datelimite);
|
|
||||||
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">';
|
||||||
@ -858,11 +897,6 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left">' ;
|
print '<td align="left">' ;
|
||||||
$societestatic->id=$obj->socid;
|
|
||||||
$societestatic->name=$obj->name;
|
|
||||||
$societestatic->client=1;
|
|
||||||
$societestatic->code_client = $obj->code_client;
|
|
||||||
$societestatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
print $societestatic->getNomUrl(1,'customer',44);
|
print $societestatic->getNomUrl(1,'customer',44);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datelimite),'day').'</td>';
|
print '<td align="right">'.dol_print_date($db->jdate($obj->datelimite),'day').'</td>';
|
||||||
@ -912,9 +946,9 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
|
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye";
|
||||||
$sql.= ", ff.date_lim_reglement";
|
$sql.= ", ff.date_lim_reglement";
|
||||||
$sql.= ", s.nom as name";
|
$sql.= ", s.nom as name";
|
||||||
$sql.= ", s.rowid as socid";
|
$sql.= ", s.rowid as socid, s.email";
|
||||||
$sql.= ", s.code_client";
|
$sql.= ", s.code_client, s.code_compta";
|
||||||
$sql.= ", s.code_fournisseur";
|
$sql.= ", s.code_fournisseur, s.code_compta_fournisseur";
|
||||||
$sql.= ", sum(pf.amount) as am";
|
$sql.= ", sum(pf.amount) as am";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
|
||||||
@ -930,8 +964,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierUnpaid',$parameters);
|
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierUnpaid',$parameters);
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
|
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye, ff.date_lim_reglement,";
|
||||||
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
|
$sql.= " s.nom, s.rowid, s.email, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
|
||||||
$sql.= " ORDER BY ff.date_lim_reglement ASC";
|
$sql.= " ORDER BY ff.date_lim_reglement ASC";
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
@ -958,19 +992,25 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
$facstatic->ref=$obj->ref;
|
$facstatic->ref=$obj->ref;
|
||||||
$facstatic->id = $obj->rowid;
|
$facstatic->id = $obj->rowid;
|
||||||
$facstatic->total_ht = $obj->total_ht;
|
$facstatic->total_ht = $obj->total_ht;
|
||||||
$facstatic->total_tva = $obj->total_tva;
|
$facstatic->total_tva = $obj->total_tva;
|
||||||
$facstatic->total_ttc = $obj->total_ttc;
|
$facstatic->total_ttc = $obj->total_ttc;
|
||||||
|
|
||||||
|
$societestatic->id=$obj->socid;
|
||||||
|
$societestatic->name=$obj->name;
|
||||||
|
$societestatic->email=$obj->email;
|
||||||
|
$societestatic->client=0;
|
||||||
|
$societestatic->fournisseur=1;
|
||||||
|
$societestatic->code_client = $obj->code_client;
|
||||||
|
$societestatic->code_fournisseur = $obj->code_fournisseur;
|
||||||
|
$societestatic->code_compta = $obj->code_compta;
|
||||||
|
$societestatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
print $facstatic->getNomUrl(1,'');
|
print $facstatic->getNomUrl(1,'');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
$societestatic->id=$obj->socid;
|
|
||||||
$societestatic->name=$obj->name;
|
|
||||||
$societestatic->client=0;
|
|
||||||
$societestatic->code_client = $obj->code_client;
|
|
||||||
$societestatic->code_fournisseur = $obj->code_fournisseur;
|
|
||||||
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
|
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
|
||||||
print '<td align="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),'day').'</td>';
|
print '<td align="right">'.dol_print_date($db->jdate($obj->date_lim_reglement),'day').'</td>';
|
||||||
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
|
||||||
|
|||||||
@ -257,7 +257,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0)); // This include closing invoices
|
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0)); // This include closing invoices and regenerating documents
|
||||||
if ($paiement_id < 0)
|
if ($paiement_id < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||||
|
|||||||
@ -141,7 +141,7 @@ class Paiement extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Create payment of invoices into database.
|
* Create payment of invoices into database.
|
||||||
* Use this->amounts to have list of invoices for the payment.
|
* Use this->amounts to have list of invoices for the payment.
|
||||||
* For payment of a customer invoice, amounts are postive, for payment of credit note, amounts are negative
|
* For payment of a customer invoice, amounts are positive, for payment of credit note, amounts are negative
|
||||||
*
|
*
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more
|
* @param int $closepaidinvoices 1=Also close payed invoices to paid, 0=Do nothing more
|
||||||
@ -233,11 +233,12 @@ class Paiement extends CommonObject
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
$invoice=new Facture($this->db);
|
||||||
|
$invoice->fetch($facid);
|
||||||
|
|
||||||
// If we want to closed payed invoices
|
// If we want to closed payed invoices
|
||||||
if ($closepaidinvoices)
|
if ($closepaidinvoices)
|
||||||
{
|
{
|
||||||
$invoice=new Facture($this->db);
|
|
||||||
$invoice->fetch($facid);
|
|
||||||
$paiement = $invoice->getSommePaiement();
|
$paiement = $invoice->getSommePaiement();
|
||||||
$creditnotes=$invoice->getSumCreditNotesUsed();
|
$creditnotes=$invoice->getSumCreditNotesUsed();
|
||||||
$deposits=$invoice->getSumDepositsUsed();
|
$deposits=$invoice->getSumDepositsUsed();
|
||||||
@ -338,26 +339,25 @@ class Paiement extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
|
||||||
{
|
|
||||||
$outputlangs = $langs;
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang;
|
|
||||||
if (! empty($newlang)) {
|
|
||||||
$outputlangs = new Translate("", $conf);
|
|
||||||
$outputlangs->setDefaultLang($newlang);
|
|
||||||
}
|
|
||||||
$ret = $invoice->fetch($id); // Reload to get new records
|
|
||||||
|
|
||||||
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
|
|
||||||
if ($result < 0) {
|
|
||||||
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regenerate documents of invoices
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
|
{
|
||||||
|
$outputlangs = $langs;
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang;
|
||||||
|
if (! empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
|
$ret = $invoice->fetch($facid); // Reload to get new records
|
||||||
|
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.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
|
||||||
@ -651,26 +652,77 @@ class Tva 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 string $option link option
|
* @param string $option link option
|
||||||
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string Chaine with URL
|
* @return string Chaine with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0,$option='')
|
function getNomUrl($withpicto=0, $option='', $notooltip=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
|
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
|
||||||
|
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$url = DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id;
|
||||||
$linkend='</a>';
|
|
||||||
|
$linkclose='';
|
||||||
|
if (empty($notooltip))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$label=$langs->trans("ShowMyObject");
|
||||||
|
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||||
|
}
|
||||||
|
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
|
||||||
|
|
||||||
|
$linkstart = '<a href="'.$url.'"';
|
||||||
|
$linkstart.=$linkclose.'>';
|
||||||
|
$linkend ='</a>';
|
||||||
|
|
||||||
$picto='payment';
|
$picto='payment';
|
||||||
|
|
||||||
if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
|
$result .= $linkstart;
|
||||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
|
||||||
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
|
if ($withpicto != 2) $result.= $this->ref;
|
||||||
|
$result .= $linkend;
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return amount of payments already done
|
||||||
|
*
|
||||||
|
* @return int Amount of payment already done, <0 if KO
|
||||||
|
*/
|
||||||
|
function getSommePaiement()
|
||||||
|
{
|
||||||
|
$table='paiementcharge';
|
||||||
|
$field='fk_charge';
|
||||||
|
|
||||||
|
$sql = 'SELECT sum(amount) as amount';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.$table;
|
||||||
|
$sql.= ' WHERE '.$field.' = '.$this->id;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG);
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$amount=0;
|
||||||
|
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
if ($obj) $amount=$obj->amount?$obj->amount:0;
|
||||||
|
|
||||||
|
$this->db->free($resql);
|
||||||
|
return $amount;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Informations of vat payment object
|
* Informations of vat payment object
|
||||||
*
|
*
|
||||||
|
|||||||
177
htdocs/compta/tva/document.php
Normal file
177
htdocs/compta/tva/document.php
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||||
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/compta/tva/document.php
|
||||||
|
* \ingroup tax
|
||||||
|
* \brief Page with attached files on social contributions
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
$langs->load("other");
|
||||||
|
$langs->load("companies");
|
||||||
|
$langs->load("compta");
|
||||||
|
$langs->load("bills");
|
||||||
|
|
||||||
|
$id = GETPOST('id','int');
|
||||||
|
$action = GETPOST('action','aZ09');
|
||||||
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
$result = restrictedArea($user, 'tax', $id, 'vat','charges');
|
||||||
|
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
|
$page = GETPOST("page",'int');
|
||||||
|
if ($page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
}
|
||||||
|
$offset = $conf->liste_limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
if (! $sortfield) $sortfield="name";
|
||||||
|
|
||||||
|
|
||||||
|
$object = new Tva($db);
|
||||||
|
if ($id > 0) $object->fetch($id);
|
||||||
|
|
||||||
|
$upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
$modulepart='tax';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||||
|
|
||||||
|
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
||||||
|
{
|
||||||
|
$object->fetch($id);
|
||||||
|
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
||||||
|
if ($result < 0)
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
if (! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); }
|
||||||
|
|
||||||
|
$title = $langs->trans("VATPayment") . ' - ' . $langs->trans("Documents");
|
||||||
|
$help_url='EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)';
|
||||||
|
llxHeader("",$title,$help_url);
|
||||||
|
|
||||||
|
if ($object->id)
|
||||||
|
{
|
||||||
|
$alreadypayed=$object->getSommePaiement();
|
||||||
|
|
||||||
|
$head=vat_prepare_head($object);
|
||||||
|
|
||||||
|
dol_fiche_head($head, 'documents', $langs->trans("VATPayment"), -1, 'bill');
|
||||||
|
|
||||||
|
$morehtmlref='<div class="refidno">';
|
||||||
|
// Label of social contribution
|
||||||
|
$morehtmlref.=$form->editfieldkey("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
||||||
|
$morehtmlref.=$form->editfieldval("Label", 'lib', $object->lib, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
||||||
|
// Project
|
||||||
|
if (! empty($conf->projet->enabled))
|
||||||
|
{
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
|
||||||
|
if (! empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
|
$morehtmlref.=$proj->ref;
|
||||||
|
$morehtmlref.='</a>';
|
||||||
|
} else {
|
||||||
|
$morehtmlref.='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/tva/index.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
|
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
// Construit liste des fichiers
|
||||||
|
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||||
|
$totalsize=0;
|
||||||
|
foreach($filearray as $key => $file)
|
||||||
|
{
|
||||||
|
$totalsize+=$file['size'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||||
|
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="clearboth"></div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
$modulepart = 'tax';
|
||||||
|
$permission = $user->rights->tax->charges->creer;
|
||||||
|
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||||
|
$param = '&id=' . $object->id;
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("ErrorUnknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
@ -217,8 +217,11 @@ if ($result)
|
|||||||
|
|
||||||
$tva_static->id=$obj->rowid;
|
$tva_static->id=$obj->rowid;
|
||||||
$tva_static->ref=$obj->rowid;
|
$tva_static->ref=$obj->rowid;
|
||||||
|
|
||||||
|
// Ref
|
||||||
print "<td>".$tva_static->getNomUrl(1)."</td>\n";
|
print "<td>".$tva_static->getNomUrl(1)."</td>\n";
|
||||||
print "<td>".dol_trunc($obj->label,40)."</td>\n";
|
// Label
|
||||||
|
print "<td>".dol_trunc($obj->label,40)."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dv),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dv),'day')."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
|
||||||
// Type
|
// Type
|
||||||
|
|||||||
@ -607,7 +607,15 @@ else
|
|||||||
// State
|
// State
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('Region-State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="'.$colspan.'" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
|
||||||
if ($object->country_id)
|
if ($object->country_id)
|
||||||
{
|
{
|
||||||
print $formcompany->select_state(GETPOST("state_id",'alpha')?GETPOST("state_id",'alpha'):$object->state_id,$object->country_code,'state_id');
|
print $formcompany->select_state(GETPOST("state_id",'alpha')?GETPOST("state_id",'alpha'):$object->state_id,$object->country_code,'state_id');
|
||||||
@ -852,7 +860,15 @@ else
|
|||||||
// State
|
// State
|
||||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||||
{
|
{
|
||||||
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2))
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('Region-State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||||
|
}
|
||||||
|
|
||||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'state_id');
|
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'state_id');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,27 @@ class Contact extends CommonObject
|
|||||||
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
public $picto = 'contact';
|
public $picto = 'contact';
|
||||||
|
|
||||||
|
|
||||||
|
// BEGIN MODULEBUILDER PROPERTIES
|
||||||
|
/**
|
||||||
|
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||||
|
*/
|
||||||
|
public $fields=array(
|
||||||
|
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||||
|
'lastname' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||||
|
'firstname' =>array('type'=>'varchar(128)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>11, 'searchall'=>1),
|
||||||
|
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||||
|
'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>60),
|
||||||
|
'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||||
|
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
|
||||||
|
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
|
||||||
|
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||||
|
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
|
||||||
|
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||||
|
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||||
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>1, 'position'=>1000),
|
||||||
|
);
|
||||||
|
|
||||||
public $civility_id; // In fact we store civility_code
|
public $civility_id; // In fact we store civility_code
|
||||||
public $civility_code;
|
public $civility_code;
|
||||||
public $address;
|
public $address;
|
||||||
@ -96,9 +117,15 @@ class Contact extends CommonObject
|
|||||||
public $user_id;
|
public $user_id;
|
||||||
public $user_login;
|
public $user_login;
|
||||||
|
|
||||||
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
|
|
||||||
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -131,7 +158,7 @@ class Contact extends CommonObject
|
|||||||
$sql.= " WHERE sp.fk_soc = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
$sql.= " WHERE sp.fk_soc = s.rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$clause = "AND";
|
$clause = "AND";
|
||||||
}
|
}
|
||||||
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
|
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element).')';
|
||||||
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
|
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
|
||||||
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
|
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||||
@ -657,43 +657,53 @@ if (empty($reshook))
|
|||||||
|
|
||||||
else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha'))
|
else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha'))
|
||||||
{
|
{
|
||||||
if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update)
|
$error = 0;
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors');
|
|
||||||
$action = 'editline';
|
|
||||||
$_GET['rowid'] = GETPOST('elrowid');
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!empty($date_start_update) && !empty($date_end_update) && $date_start_update > $date_end_update)
|
||||||
$objectline = new ContratLigne($db);
|
{
|
||||||
if ($objectline->fetch(GETPOST('elrowid')))
|
setEventMessages($langs->trans("Error").': '.$langs->trans("DateStartPlanned").' > '.$langs->trans("DateEndPlanned"), null, 'errors');
|
||||||
{
|
$action = 'editline';
|
||||||
$db->begin();
|
$_GET['rowid'] = GETPOST('elrowid');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture;
|
if (! $error)
|
||||||
if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture;
|
{
|
||||||
|
$objectline = new ContratLigne($db);
|
||||||
|
if ($objectline->fetch(GETPOST('elrowid')) < 0)
|
||||||
|
{
|
||||||
|
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$vat_rate = GETPOST('eltva_tx');
|
$db->begin();
|
||||||
// Define info_bits
|
|
||||||
$info_bits = 0;
|
if (! $error)
|
||||||
if (preg_match('/\*/', $vat_rate))
|
{
|
||||||
|
if ($date_start_real_update == '') $date_start_real_update=$objectline->date_ouverture;
|
||||||
|
if ($date_end_real_update == '') $date_end_real_update=$objectline->date_cloture;
|
||||||
|
|
||||||
|
$vat_rate = GETPOST('eltva_tx');
|
||||||
|
// Define info_bits
|
||||||
|
$info_bits = 0;
|
||||||
|
if (preg_match('/\*/', $vat_rate))
|
||||||
$info_bits |= 0x01;
|
$info_bits |= 0x01;
|
||||||
|
|
||||||
// Define vat_rate
|
// Define vat_rate
|
||||||
$vat_rate = str_replace('*', '', $vat_rate);
|
$vat_rate = str_replace('*', '', $vat_rate);
|
||||||
$localtax1_tx=get_localtax($vat_rate, 1, $object->thirdparty, $mysoc);
|
$localtax1_tx=get_localtax($vat_rate, 1, $object->thirdparty, $mysoc);
|
||||||
$localtax2_tx=get_localtax($vat_rate, 2, $object->thirdparty, $mysoc);
|
$localtax2_tx=get_localtax($vat_rate, 2, $object->thirdparty, $mysoc);
|
||||||
|
|
||||||
$txtva = $vat_rate;
|
$txtva = $vat_rate;
|
||||||
|
|
||||||
// Clean vat code
|
// Clean vat code
|
||||||
$vat_src_code='';
|
$vat_src_code='';
|
||||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||||
{
|
{
|
||||||
$vat_src_code = $reg[1];
|
$vat_src_code = $reg[1];
|
||||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||||
}
|
}
|
||||||
|
|
||||||
// ajout prix d'achat
|
// ajout prix d'achat
|
||||||
$fk_fournprice = $_POST['fournprice'];
|
$fk_fournprice = $_POST['fournprice'];
|
||||||
@ -704,22 +714,22 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$fk_unit = GETPOST('unit', 'alpha');
|
$fk_unit = GETPOST('unit', 'alpha');
|
||||||
|
|
||||||
$objectline->description=GETPOST('product_desc','none');
|
$objectline->description=GETPOST('product_desc','none');
|
||||||
$objectline->price_ht=GETPOST('elprice');
|
$objectline->price_ht=GETPOST('elprice');
|
||||||
$objectline->subprice=GETPOST('elprice');
|
$objectline->subprice=GETPOST('elprice');
|
||||||
$objectline->qty=GETPOST('elqty');
|
$objectline->qty=GETPOST('elqty');
|
||||||
$objectline->remise_percent=GETPOST('elremise_percent');
|
$objectline->remise_percent=GETPOST('elremise_percent');
|
||||||
$objectline->tva_tx=($txtva?$txtva:0); // Field may be disabled, so we use vat rate 0
|
$objectline->tva_tx=($txtva?$txtva:0); // Field may be disabled, so we use vat rate 0
|
||||||
$objectline->vat_src_code=$vat_src_code;
|
$objectline->vat_src_code=$vat_src_code;
|
||||||
$objectline->localtax1_tx=is_numeric($localtax1_tx)?$localtax1_tx:0;
|
$objectline->localtax1_tx=is_numeric($localtax1_tx)?$localtax1_tx:0;
|
||||||
$objectline->localtax2_tx=is_numeric($localtax2_tx)?$localtax2_tx:0;
|
$objectline->localtax2_tx=is_numeric($localtax2_tx)?$localtax2_tx:0;
|
||||||
$objectline->date_ouverture_prevue=$date_start_update;
|
$objectline->date_ouverture_prevue=$date_start_update;
|
||||||
$objectline->date_ouverture=$date_start_real_update;
|
$objectline->date_ouverture=$date_start_real_update;
|
||||||
$objectline->date_fin_validite=$date_end_update;
|
$objectline->date_fin_validite=$date_end_update;
|
||||||
$objectline->date_cloture=$date_end_real_update;
|
$objectline->date_cloture=$date_end_real_update;
|
||||||
$objectline->fk_user_cloture=$user->id;
|
$objectline->fk_user_cloture=$user->id;
|
||||||
$objectline->fk_fournprice=$fk_fournprice;
|
$objectline->fk_fournprice=$fk_fournprice;
|
||||||
$objectline->pa_ht=$pa_ht;
|
$objectline->pa_ht=$pa_ht;
|
||||||
|
|
||||||
if ($fk_unit > 0) {
|
if ($fk_unit > 0) {
|
||||||
$objectline->fk_unit = GETPOST('unit');
|
$objectline->fk_unit = GETPOST('unit');
|
||||||
@ -727,30 +737,30 @@ if (empty($reshook))
|
|||||||
$objectline->fk_unit = null;
|
$objectline->fk_unit = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
$extrafieldsline = new ExtraFields($db);
|
$extrafieldsline = new ExtraFields($db);
|
||||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
|
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
|
||||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||||
$objectline->array_options=$array_options;
|
$objectline->array_options=$array_options;
|
||||||
|
|
||||||
// TODO verifier price_min si fk_product et multiprix
|
// TODO verifier price_min si fk_product et multiprix
|
||||||
|
|
||||||
$result=$objectline->update($user);
|
$result=$objectline->update($user);
|
||||||
if ($result > 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$error++;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
||||||
$db->rollback();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessages($objectline->error, $objectline->errors, 'errors');
|
$db->commit();
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
|
else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||||
@ -771,6 +781,30 @@ if (empty($reshook))
|
|||||||
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
|
else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
$result = $object->validate($user);
|
$result = $object->validate($user);
|
||||||
|
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
// Define output language
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
|
{
|
||||||
|
$outputlangs = $langs;
|
||||||
|
$newlang = '';
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09');
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
||||||
|
if (! empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
|
$model=$object->modelpdf;
|
||||||
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
|
|
||||||
|
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'reopen' && $user->rights->contrat->creer)
|
else if ($action == 'reopen' && $user->rights->contrat->creer)
|
||||||
|
|||||||
@ -1268,26 +1268,14 @@ class Contrat extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// Call triggers
|
||||||
// want this action calls a trigger.
|
$result=$this->call_trigger('CONTRACT_MODIFY',$user);
|
||||||
|
if ($result < 0) { $error++; }
|
||||||
//// Call triggers
|
// End call triggers
|
||||||
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
|
||||||
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
|
||||||
//// End call triggers
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
|
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
|
||||||
{
|
|
||||||
$result=$this->insertExtraFields();
|
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
|
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -2872,6 +2860,9 @@ class ContratLigne extends CommonObjectLine
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
$this->oldcopy = new ContratLigne($this->db);
|
||||||
|
$this->oldcopy->fetch($this->id);
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET";
|
||||||
$sql.= " fk_contrat=".$this->fk_contrat.",";
|
$sql.= " fk_contrat=".$this->fk_contrat.",";
|
||||||
@ -2911,22 +2902,14 @@ class ContratLigne extends CommonObjectLine
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if (! $resql)
|
||||||
{
|
|
||||||
$contrat=new Contrat($this->db);
|
|
||||||
$contrat->fetch($this->fk_contrat);
|
|
||||||
$result=$contrat->update_statut($user);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$this->error="Error ".$this->db->lasterror();
|
$this->error="Error ".$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
//return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) // For avoid conflicts if trigger used
|
||||||
{
|
{
|
||||||
|
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -2934,19 +2917,52 @@ class ContratLigne extends CommonObjectLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
// If we change a planned date (start or end), sync dates for all services
|
||||||
if (! $notrigger)
|
if (! $error && ! empty($conf->global->CONTRACT_SYNC_PLANNED_DATE_OF_SERVICES))
|
||||||
{
|
{
|
||||||
// Call trigger
|
if ($this->date_ouverture_prevue != $this->oldcopy->date_ouverture_prevue)
|
||||||
$result=$this->call_trigger('LINECONTRACT_UPDATE',$user);
|
{
|
||||||
if ($result < 0) { $error++; $this->db->rollback(); return -1; }
|
$sql ='UPDATE '.MAIN_DB_PREFIX.'contratdet SET';
|
||||||
// End call triggers
|
$sql.= " date_ouverture_prevue = ".($this->date_ouverture_prevue!=''?"'".$this->db->idate($this->date_ouverture_prevue)."'":"null");
|
||||||
}
|
$sql.= " WHERE fk_contrat = ".$this->fk_contrat;
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$this->error="Error ".$this->db->lasterror();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($this->date_fin_validite != $this->oldcopy->date_fin_validite)
|
||||||
|
{
|
||||||
|
$sql ='UPDATE '.MAIN_DB_PREFIX.'contratdet SET';
|
||||||
|
$sql.= " date_fin_validite = ".($this->date_fin_validite!=''?"'".$this->db->idate($this->date_fin_validite)."'":"null");
|
||||||
|
$sql.= " WHERE fk_contrat = ".$this->fk_contrat;
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$this->error="Error ".$this->db->lasterror();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error)) {
|
if (! $error)
|
||||||
$this->db->commit();
|
{
|
||||||
return 1;
|
if (! $notrigger)
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('LINECONTRACT_UPDATE', $user);
|
||||||
|
if ($result < 0) { $error++; $this->db->rollback(); }
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
$this->errors[]=$this->error;
|
$this->errors[]=$this->error;
|
||||||
|
|||||||
@ -106,7 +106,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
|
|
||||||
$subject='';$actionmsg='';$actionmsg2='';
|
$subject='';$actionmsg='';$actionmsg2='';
|
||||||
|
|
||||||
if (! empty($conf->dolimail->enabled)) $langs->load("dolimail@dolimail");
|
|
||||||
$langs->load('mails');
|
$langs->load('mails');
|
||||||
|
|
||||||
if (is_object($object))
|
if (is_object($object))
|
||||||
@ -321,6 +320,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
|
|
||||||
|
|
||||||
// Feature to push mail sent into Sent folder
|
// Feature to push mail sent into Sent folder
|
||||||
|
/* This code must be now included into the hook mail, method sendMailAfter
|
||||||
if (! empty($conf->dolimail->enabled))
|
if (! empty($conf->dolimail->enabled))
|
||||||
{
|
{
|
||||||
$mailfromid = explode("#", $_POST['frommail'],3); // $_POST['frommail'] = 'aaa#Sent# <aaa@aaa.com>' // TODO Use a better way to define Sent dir.
|
$mailfromid = explode("#", $_POST['frommail'],3); // $_POST['frommail'] = 'aaa#Sent# <aaa@aaa.com>' // TODO Use a better way to define Sent dir.
|
||||||
@ -329,7 +329,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
{
|
{
|
||||||
$mbid = $mailfromid[1];
|
$mbid = $mailfromid[1];
|
||||||
|
|
||||||
/*IMAP Postbox*/
|
// IMAP Postbox
|
||||||
$mailboxconfig = new IMAP($db);
|
$mailboxconfig = new IMAP($db);
|
||||||
$mailboxconfig->fetch($mbid);
|
$mailboxconfig->fetch($mbid);
|
||||||
if ($mailboxconfig->mailbox_imap_host) $ref=$mailboxconfig->get_ref();
|
if ($mailboxconfig->mailbox_imap_host) $ref=$mailboxconfig->get_ref();
|
||||||
@ -361,6 +361,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Make substitution in email content
|
// Make substitution in email content
|
||||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $object);
|
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $object);
|
||||||
@ -393,7 +394,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$result=$mailfile->sendfile();
|
$result=$mailfile->sendfile();
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// FIXME This must be moved into the trigger for action $trigger_name
|
// Two hooks are available into method $mailfile->sendfile, so dedicated code is no more required
|
||||||
|
/*
|
||||||
if (! empty($conf->dolimail->enabled))
|
if (! empty($conf->dolimail->enabled))
|
||||||
{
|
{
|
||||||
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
|
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
|
||||||
@ -411,7 +413,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
|
if ($movemail) setEventMessages($langs->trans("MailMovedToImapFolder",$folder), null, 'mesgs');
|
||||||
else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
|
else setEventMessages($langs->trans("MailMovedToImapFolder_Warning",$folder), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Initialisation of datas
|
// Initialisation of datas
|
||||||
if (is_object($object))
|
if (is_object($object))
|
||||||
@ -446,12 +448,10 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
// This avoid sending mail twice if going out and then back to page
|
// This avoid sending mail twice if going out and then back to page
|
||||||
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
|
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
|
||||||
setEventMessages($mesg, null, 'mesgs');
|
setEventMessages($mesg, null, 'mesgs');
|
||||||
if ($conf->dolimail->enabled)
|
|
||||||
{
|
$moreparam='';
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:'').'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
|
if (isset($paramname2) || isset($paramval2)) $moreparam.= '&'.($paramname2?$paramname2:'mid').'='.$paramval2;
|
||||||
exit;
|
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:'').$moreparam);
|
||||||
}
|
|
||||||
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:''));
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class box_produits extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity";
|
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||||
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
|
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
|
||||||
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
|
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
|
||||||
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
|
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
|
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as s on p.rowid = s.fk_product";
|
||||||
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element, 1).')';
|
$sql.= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
|
||||||
$sql.= " AND p.tosell = 1 AND p.seuil_stock_alerte > 0";
|
$sql.= " AND p.tosell = 1 AND p.seuil_stock_alerte > 0";
|
||||||
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
|
if (empty($user->rights->produit->lire)) $sql.=' AND p.fk_product_type != 0';
|
||||||
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
|
if (empty($user->rights->service->lire)) $sql.=' AND p.fk_product_type != 1';
|
||||||
|
|||||||
@ -482,7 +482,7 @@ class CMailFile
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send mail that was prepared by constructor
|
* Send mail that was prepared by constructor.
|
||||||
*
|
*
|
||||||
* @return boolean True if mail sent, false otherwise
|
* @return boolean True if mail sent, false otherwise
|
||||||
*/
|
*/
|
||||||
@ -495,19 +495,25 @@ class CMailFile
|
|||||||
|
|
||||||
$res=false;
|
$res=false;
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS))
|
if (empty($conf->global->MAIN_DISABLE_ALL_MAILS) || !empty($conf->global->MAIN_MAIL_FORCE_SENDTO))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
|
||||||
$hookmanager = new HookManager($db);
|
$hookmanager = new HookManager($db);
|
||||||
$hookmanager->initHooks(array('maildao'));
|
$hookmanager->initHooks(array('mail'));
|
||||||
$reshook = $hookmanager->executeHooks('doactions', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if (! empty($reshook))
|
$parameters=array(); $action='';
|
||||||
|
$reshook = $hookmanager->executeHooks('sendMail', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0)
|
||||||
{
|
{
|
||||||
$this->error = "Error in hook maildao doactions " . $reshook;
|
$this->error = "Error in hook maildao sendMail " . $reshook;
|
||||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
||||||
|
|
||||||
return $reshook;
|
return $reshook;
|
||||||
}
|
}
|
||||||
|
if ($reshook == 1) // Hook replace standard code
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
||||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
|
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
|
||||||
@ -558,6 +564,12 @@ class CMailFile
|
|||||||
$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
|
$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) {
|
||||||
|
$this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO;
|
||||||
|
$this->addr_cc = '';
|
||||||
|
$this->addr_bcc = '';
|
||||||
|
}
|
||||||
|
|
||||||
// Action according to choosed sending method
|
// Action according to choosed sending method
|
||||||
if ($this->sendmode == 'mail')
|
if ($this->sendmode == 'mail')
|
||||||
{
|
{
|
||||||
@ -760,13 +772,21 @@ class CMailFile
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
// Send mail method not correctly defined
|
// Send mail method not correctly defined
|
||||||
// --------------------------------------
|
// --------------------------------------
|
||||||
|
|
||||||
return 'Bad value for sendmode';
|
return 'Bad value for sendmode';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parameters=array(); $action='';
|
||||||
|
$reshook = $hookmanager->executeHooks('sendMailAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0)
|
||||||
|
{
|
||||||
|
$this->error = "Error in hook maildao sendMailAfter " . $reshook;
|
||||||
|
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_ERR);
|
||||||
|
|
||||||
|
return $reshook;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -79,7 +79,7 @@ abstract class CommonObject
|
|||||||
*/
|
*/
|
||||||
public $array_options=array();
|
public $array_options=array();
|
||||||
/**
|
/**
|
||||||
* @var int[] Array of linked objects ids. Loaded by ->fetchObjectLinked
|
* @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked
|
||||||
*/
|
*/
|
||||||
public $linkedObjectsIds;
|
public $linkedObjectsIds;
|
||||||
/**
|
/**
|
||||||
@ -1274,14 +1274,15 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load object from specific field
|
* Load object from specific field
|
||||||
*
|
*
|
||||||
* @param string $table Table element or element line
|
* @param string $table Table element or element line
|
||||||
* @param string $field Field selected
|
* @param string $field Field selected
|
||||||
* @param string $key Import key
|
* @param string $key Import key
|
||||||
* @return int <0 if KO, >0 if OK
|
* @param string $element Element name
|
||||||
*/
|
* @return int <0 if KO, >0 if OK
|
||||||
function fetchObjectFrom($table,$field,$key)
|
*/
|
||||||
|
function fetchObjectFrom($table, $field, $key, $element = null)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -1289,7 +1290,11 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$table;
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$table;
|
||||||
$sql.= " WHERE ".$field." = '".$key."'";
|
$sql.= " WHERE ".$field." = '".$key."'";
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
if (! empty($element)) {
|
||||||
|
$sql.= " AND entity IN (".getEntity($element).")";
|
||||||
|
} else {
|
||||||
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::fetchObjectFrom', LOG_DEBUG);
|
dol_syslog(get_class($this).'::fetchObjectFrom', LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1341,6 +1346,7 @@ abstract class CommonObject
|
|||||||
* @param User|string $fuser Update the user of last update field with this user. If not provided, current user is used except if value is 'none'
|
* @param User|string $fuser Update the user of last update field with this user. If not provided, current user is used except if value is 'none'
|
||||||
* @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY')
|
* @param string $trigkey Trigger key to run (in most cases something like 'XXX_MODIFY')
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
|
* @see updateExtraField
|
||||||
*/
|
*/
|
||||||
function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='')
|
function setValueFrom($field, $value, $table='', $id=null, $format='', $id_field='', $fuser=null, $trigkey='')
|
||||||
{
|
{
|
||||||
@ -4452,7 +4458,7 @@ abstract class CommonObject
|
|||||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
|
||||||
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
|
||||||
*/
|
*/
|
||||||
function fetch_optionals($rowid=null,$optionsArray=null)
|
function fetch_optionals($rowid=null, $optionsArray=null)
|
||||||
{
|
{
|
||||||
if (empty($rowid)) $rowid=$this->id;
|
if (empty($rowid)) $rowid=$this->id;
|
||||||
|
|
||||||
@ -4567,6 +4573,7 @@ abstract class CommonObject
|
|||||||
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
||||||
* @param User $userused Object user
|
* @param User $userused Object user
|
||||||
* @return int -1=error, O=did nothing, 1=OK
|
* @return int -1=error, O=did nothing, 1=OK
|
||||||
|
* @see updateExtraField, setValueFrom
|
||||||
*/
|
*/
|
||||||
function insertExtraFields($trigger='', $userused=null)
|
function insertExtraFields($trigger='', $userused=null)
|
||||||
{
|
{
|
||||||
@ -4597,16 +4604,30 @@ abstract class CommonObject
|
|||||||
|
|
||||||
foreach($new_array_options as $key => $value)
|
foreach($new_array_options as $key => $value)
|
||||||
{
|
{
|
||||||
$attributeKey = substr($key,8); // Remove 'options_' prefix
|
$attributeKey = substr($key,8); // Remove 'options_' prefix
|
||||||
$attributeType = $extrafields->attribute_type[$attributeKey];
|
$attributeType = $extrafields->attribute_type[$attributeKey];
|
||||||
$attributeLabel = $extrafields->attribute_label[$attributeKey];
|
$attributeLabel = $extrafields->attribute_label[$attributeKey];
|
||||||
$attributeParam = $extrafields->attribute_param[$attributeKey];
|
$attributeParam = $extrafields->attribute_param[$attributeKey];
|
||||||
|
$attributeRequired = $extrafields->attribute_required[$attributeKey];
|
||||||
|
|
||||||
|
if ($attributeRequired)
|
||||||
|
{
|
||||||
|
$mandatorypb=false;
|
||||||
|
if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb=true;
|
||||||
|
if ($this->array_options[$key] === '') $mandatorypb=true;
|
||||||
|
if ($mandatorypb)
|
||||||
|
{
|
||||||
|
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch ($attributeType)
|
switch ($attributeType)
|
||||||
{
|
{
|
||||||
case 'int':
|
case 'int':
|
||||||
if (!is_numeric($value) && $value!='')
|
if (!is_numeric($value) && $value!='')
|
||||||
{
|
{
|
||||||
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue",$attributeLabel);
|
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
elseif ($value=='')
|
elseif ($value=='')
|
||||||
@ -4630,23 +4651,27 @@ abstract class CommonObject
|
|||||||
$new_array_options[$key] = $this->db->idate($this->array_options[$key]);
|
$new_array_options[$key] = $this->db->idate($this->array_options[$key]);
|
||||||
break;
|
break;
|
||||||
case 'link':
|
case 'link':
|
||||||
$param_list=array_keys($attributeParam ['options']);
|
$param_list=array_keys($attributeParam['options']);
|
||||||
// 0 : ObjectName
|
// 0 : ObjectName
|
||||||
// 1 : classPath
|
// 1 : classPath
|
||||||
$InfoFieldList = explode(":", $param_list[0]);
|
$InfoFieldList = explode(":", $param_list[0]);
|
||||||
dol_include_once($InfoFieldList[1]);
|
dol_include_once($InfoFieldList[1]);
|
||||||
if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
|
if ($InfoFieldList[0] && class_exists($InfoFieldList[0]))
|
||||||
{
|
{
|
||||||
$object = new $InfoFieldList[0]($this->db);
|
if ($value == '-1') // -1 is key for no defined in combo list of objects
|
||||||
if ($value)
|
|
||||||
{
|
{
|
||||||
|
$new_array_options[$key]='';
|
||||||
|
}
|
||||||
|
elseif ($value)
|
||||||
|
{
|
||||||
|
$object = new $InfoFieldList[0]($this->db);
|
||||||
if (is_numeric($value)) $res=$object->fetch($value);
|
if (is_numeric($value)) $res=$object->fetch($value);
|
||||||
else $res=$object->fetch('',$value);
|
else $res=$object->fetch('',$value);
|
||||||
|
|
||||||
if ($res > 0) $new_array_options[$key]=$object->id;
|
if ($res > 0) $new_array_options[$key]=$object->id;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error="Ref '".$value."' for object '".$object->element."' not found";
|
$this->error="Id/Ref '".$value."' for object '".$object->element."' not found";
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4659,6 +4684,7 @@ abstract class CommonObject
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$table_element = $this->table_element;
|
$table_element = $this->table_element;
|
||||||
@ -4704,7 +4730,7 @@ abstract class CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !$trigger)
|
if (! $error && $trigger)
|
||||||
{
|
{
|
||||||
// Call trigger
|
// Call trigger
|
||||||
$this->context=array('extrafieldaddupdate'=>1);
|
$this->context=array('extrafieldaddupdate'=>1);
|
||||||
@ -4729,15 +4755,19 @@ abstract class CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an exta field value for the current object.
|
* Update an exta field value for the current object.
|
||||||
* Data to describe values to insert/update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
|
* Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...)
|
||||||
* This function delte record with all extrafields and insert them again from the array $this->array_options.
|
|
||||||
*
|
*
|
||||||
* @param string $key Key of the extrafield
|
* @param string $key Key of the extrafield
|
||||||
* @return int -1=error, O=did nothing, 1=OK
|
* @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY)
|
||||||
|
* @param User $userused Object user
|
||||||
|
* @return int -1=error, O=did nothing, 1=OK
|
||||||
|
* @see setValueFrom
|
||||||
*/
|
*/
|
||||||
function updateExtraField($key)
|
function updateExtraField($key, $trigger, $userused)
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs,$user;
|
||||||
|
|
||||||
|
if (empty($userused)) $userused=$user;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
@ -4789,9 +4819,9 @@ abstract class CommonObject
|
|||||||
// 1 : classPath
|
// 1 : classPath
|
||||||
$InfoFieldList = explode(":", $param_list[0]);
|
$InfoFieldList = explode(":", $param_list[0]);
|
||||||
dol_include_once($InfoFieldList[1]);
|
dol_include_once($InfoFieldList[1]);
|
||||||
$object = new $InfoFieldList[0]($this->db);
|
|
||||||
if ($value)
|
if ($value)
|
||||||
{
|
{
|
||||||
|
$object = new $InfoFieldList[0]($this->db);
|
||||||
$object->fetch(0,$value);
|
$object->fetch(0,$value);
|
||||||
$this->array_options["options_".$key]=$object->id;
|
$this->array_options["options_".$key]=$object->id;
|
||||||
}
|
}
|
||||||
@ -4804,7 +4834,21 @@ abstract class CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
|
$error++;
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error && $trigger)
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$this->context=array('extrafieldupdate'=>1);
|
||||||
|
$result=$this->call_trigger($trigger, $userused);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call trigger
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -5908,7 +5952,7 @@ abstract class CommonObject
|
|||||||
* @param int $dest_id New thirdparty id (the thirdparty that will received element of the other)
|
* @param int $dest_id New thirdparty id (the thirdparty that will received element of the other)
|
||||||
* @param string[] $tables Tables that need to be changed
|
* @param string[] $tables Tables that need to be changed
|
||||||
* @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one)
|
* @param int $ignoreerrors Ignore errors. Return true even if errors. We need this when replacement can fails like for categories (categorie of old thirdparty may already exists on new one)
|
||||||
* @return bool
|
* @return bool True if success, False if error
|
||||||
*/
|
*/
|
||||||
public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
|
public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
|
||||||
{
|
{
|
||||||
@ -6313,12 +6357,14 @@ abstract class CommonObject
|
|||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create extrafields
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result=$this->insertExtraFields();
|
$result=$this->insertExtraFields();
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Triggers
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call triggers
|
// Call triggers
|
||||||
@ -6380,13 +6426,13 @@ abstract class CommonObject
|
|||||||
/**
|
/**
|
||||||
* Update object into database
|
* Update object into database
|
||||||
*
|
*
|
||||||
* @param User $user User that modifies
|
* @param User $user User that modifies
|
||||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public function updateCommon(User $user, $notrigger = false)
|
public function updateCommon(User $user, $notrigger = false)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -6434,7 +6480,22 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && ! $notrigger) {
|
// Update extrafield
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
|
{
|
||||||
|
$result=$this->insertExtraFields();
|
||||||
|
if ($result < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Triggers
|
||||||
|
if (! $error && ! $notrigger)
|
||||||
|
{
|
||||||
// Call triggers
|
// Call triggers
|
||||||
$result=$this->call_trigger(strtoupper(get_class($this)).'_MODIFY',$user);
|
$result=$this->call_trigger(strtoupper(get_class($this)).'_MODIFY',$user);
|
||||||
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
|
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
|
||||||
@ -6473,6 +6534,19 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element."_extrafields";
|
||||||
|
$sql.= " WHERE fk_object=" . $this->id;
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
$this->errors[] = $this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
|
||||||
|
|||||||
@ -259,9 +259,6 @@ class Conf
|
|||||||
// Load translation object with current language
|
// Load translation object with current language
|
||||||
if (empty($this->global->MAIN_LANG_DEFAULT)) $this->global->MAIN_LANG_DEFAULT="en_US";
|
if (empty($this->global->MAIN_LANG_DEFAULT)) $this->global->MAIN_LANG_DEFAULT="en_US";
|
||||||
|
|
||||||
//if (! isset($this->global->MAIN_REPEATCONTACTONEACHTAB)) $this->global->MAIN_REPEATCONTACTONEACHTAB=1;
|
|
||||||
//if (! isset($this->global->MAIN_REPEATADDRESSONEACHTAB)) $this->global->MAIN_REPEATADDRESSONEACHTAB=1;
|
|
||||||
|
|
||||||
$rootfordata = DOL_DATA_ROOT;
|
$rootfordata = DOL_DATA_ROOT;
|
||||||
$rootforuser = DOL_DATA_ROOT;
|
$rootforuser = DOL_DATA_ROOT;
|
||||||
// If multicompany module is enabled, we redefine the root of data
|
// If multicompany module is enabled, we redefine the root of data
|
||||||
|
|||||||
@ -594,7 +594,7 @@ class DolGraph
|
|||||||
* @param string $fileurl Url path to show image if saved onto disk
|
* @param string $fileurl Url path to show image if saved onto disk
|
||||||
* @return integer|null
|
* @return integer|null
|
||||||
*/
|
*/
|
||||||
function draw($file,$fileurl='')
|
function draw($file, $fileurl='')
|
||||||
{
|
{
|
||||||
if (empty($file))
|
if (empty($file))
|
||||||
{
|
{
|
||||||
@ -602,12 +602,17 @@ class DolGraph
|
|||||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
if (! is_array($this->data) || count($this->data) < 1)
|
if (! is_array($this->data))
|
||||||
{
|
{
|
||||||
$this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
|
$this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
|
||||||
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
dol_syslog(get_class($this)."::draw ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (count($this->data) < 1)
|
||||||
|
{
|
||||||
|
$this->error="Call to draw method was made but SetData was is an empty dataset";
|
||||||
|
dol_syslog(get_class($this)."::draw ".$this->error, LOG_WARNING);
|
||||||
|
}
|
||||||
$call = "draw_".$this->_library;
|
$call = "draw_".$this->_library;
|
||||||
call_user_func_array(array($this,$call), array($file,$fileurl));
|
call_user_func_array(array($this,$call), array($file,$fileurl));
|
||||||
}
|
}
|
||||||
@ -822,7 +827,7 @@ class DolGraph
|
|||||||
|
|
||||||
$legends=array();
|
$legends=array();
|
||||||
$nblot=count($this->data[0])-1; // -1 to remove legend
|
$nblot=count($this->data[0])-1; // -1 to remove legend
|
||||||
if ($nblot < 0) dol_print_error('', 'Bad value for property ->data. Must be set by mydolgraph->SetData before calling mydolgrapgh->draw');
|
if ($nblot < 0) dol_syslog('Bad value for property ->data. Must be set by mydolgraph->SetData before calling mydolgrapgh->draw', LOG_WARNING);
|
||||||
$firstlot=0;
|
$firstlot=0;
|
||||||
// Works with line but not with bars
|
// Works with line but not with bars
|
||||||
//if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x
|
//if ($nblot > 2) $firstlot = ($nblot - 2); // We limit nblot to 2 because jflot can't manage more than 2 bars on same x
|
||||||
|
|||||||
@ -168,7 +168,7 @@ class ExtraFields
|
|||||||
if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate')
|
if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate')
|
||||||
{
|
{
|
||||||
// Add declaration of field into table
|
// Add declaration of field into table
|
||||||
$result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $notused, $default, $computed, $entity, $langfile, $enabled);
|
$result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $notused, $default_value, $computed, $entity, $langfile, $enabled);
|
||||||
$err2=$this->errno;
|
$err2=$this->errno;
|
||||||
if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS'))
|
if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS'))
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ class ExtraFields
|
|||||||
|
|
||||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
|
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
|
||||||
{
|
{
|
||||||
if(is_array($param) && count($param) > 0)
|
if (is_array($param) && count($param) > 0)
|
||||||
{
|
{
|
||||||
$params = serialize($param);
|
$params = serialize($param);
|
||||||
}
|
}
|
||||||
@ -627,10 +627,17 @@ class ExtraFields
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (is_array($param))
|
if (is_array($param) && count($param) > 0)
|
||||||
{
|
{
|
||||||
if (count($param) > 0) $param = $this->db->escape(serialize($param));
|
$params = serialize($param);
|
||||||
else $param='';
|
}
|
||||||
|
elseif (strlen($param) > 0)
|
||||||
|
{
|
||||||
|
$params = trim($param);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$params='';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
|
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX."extrafields";
|
||||||
@ -674,7 +681,7 @@ class ExtraFields
|
|||||||
$sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").",";
|
$sql.= " ".($langfile?"'".$this->db->escape($langfile)."'":"null").",";
|
||||||
$sql.= " ".$pos.",";
|
$sql.= " ".$pos.",";
|
||||||
$sql.= " '".$this->db->escape($alwayseditable)."',";
|
$sql.= " '".$this->db->escape($alwayseditable)."',";
|
||||||
$sql.= " '".$this->db->escape($param)."',";
|
$sql.= " '".$this->db->escape($params)."',";
|
||||||
$sql.= " ".$list.", ";
|
$sql.= " ".$list.", ";
|
||||||
$sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").",";
|
$sql.= " ".(($default!='')?"'".$this->db->escape($default)."'":"null").",";
|
||||||
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
|
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
|
||||||
@ -1344,28 +1351,48 @@ class ExtraFields
|
|||||||
/**
|
/**
|
||||||
* Return HTML string to put an output field into a page
|
* Return HTML string to put an output field into a page
|
||||||
*
|
*
|
||||||
* @param string $key Key of attribute
|
* @param string $key Key of attribute
|
||||||
* @param string $value Value to show
|
* @param string $value Value to show
|
||||||
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
|
* @param string $moreparam To add more parameters on html input tag (only checkbox use html input for output rendering)
|
||||||
* @return string Formated value
|
* @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data
|
||||||
|
* @return string Formated value
|
||||||
*/
|
*/
|
||||||
function showOutputField($key,$value,$moreparam='')
|
function showOutputField($key, $value, $moreparam='', $extrafieldsobjectkey='')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$elementtype=$this->attribute_elementtype[$key]; // seems not used
|
if (! empty($extrafieldsobjectkey))
|
||||||
$label=$this->attribute_label[$key];
|
{
|
||||||
$type=$this->attribute_type[$key];
|
$elementtype=$this->attributes[$extrafieldsobjectkey]['elementtype'][$key]; // seems not used
|
||||||
$size=$this->attribute_size[$key];
|
$label=$this->attributes[$extrafieldsobjectkey]['label'][$key];
|
||||||
$default=$this->attribute_default[$key];
|
$type=$this->attributes[$extrafieldsobjectkey]['type'][$key];
|
||||||
$computed=$this->attribute_computed[$key];
|
$size=$this->attributes[$extrafieldsobjectkey]['size'][$key];
|
||||||
$unique=$this->attribute_unique[$key];
|
$default=$this->attributes[$extrafieldsobjectkey]['default'][$key];
|
||||||
$required=$this->attribute_required[$key];
|
$computed=$this->attributes[$extrafieldsobjectkey]['computed'][$key];
|
||||||
$param=$this->attribute_param[$key];
|
$unique=$this->attributes[$extrafieldsobjectkey]['unique'][$key];
|
||||||
$perms=$this->attribute_perms[$key];
|
$required=$this->attributes[$extrafieldsobjectkey]['required'][$key];
|
||||||
$langfile=$this->attribute_langfile[$key];
|
$param=$this->attributes[$extrafieldsobjectkey]['param'][$key];
|
||||||
$list=$this->attribute_list[$key];
|
$perms=$this->attributes[$extrafieldsobjectkey]['perms'][$key];
|
||||||
$hidden=(($list == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
$langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key];
|
||||||
|
$list=$this->attributes[$extrafieldsobjectkey]['list'][$key];
|
||||||
|
$hidden=(($list == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$elementtype=$this->attribute_elementtype[$key]; // seems not used
|
||||||
|
$label=$this->attribute_label[$key];
|
||||||
|
$type=$this->attribute_type[$key];
|
||||||
|
$size=$this->attribute_size[$key];
|
||||||
|
$default=$this->attribute_default[$key];
|
||||||
|
$computed=$this->attribute_computed[$key];
|
||||||
|
$unique=$this->attribute_unique[$key];
|
||||||
|
$required=$this->attribute_required[$key];
|
||||||
|
$param=$this->attribute_param[$key];
|
||||||
|
$perms=$this->attribute_perms[$key];
|
||||||
|
$langfile=$this->attribute_langfile[$key];
|
||||||
|
$list=$this->attribute_list[$key];
|
||||||
|
$hidden=(($list == 0) ? 1 : 0); // If zero, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
||||||
|
}
|
||||||
|
|
||||||
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
||||||
|
|
||||||
@ -1593,8 +1620,9 @@ class ExtraFields
|
|||||||
elseif ($type == 'link')
|
elseif ($type == 'link')
|
||||||
{
|
{
|
||||||
$out='';
|
$out='';
|
||||||
// only if something to display (perf)
|
|
||||||
if ($value)
|
// Only if something to display (perf)
|
||||||
|
if ($value) // If we have -1 here, pb is into sert, not into ouptu
|
||||||
{
|
{
|
||||||
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
|
$param_list=array_keys($param['options']); // $param_list='ObjectName:classPath'
|
||||||
|
|
||||||
@ -1641,14 +1669,16 @@ class ExtraFields
|
|||||||
/**
|
/**
|
||||||
* Return tag to describe alignement to use for this extrafield
|
* Return tag to describe alignement to use for this extrafield
|
||||||
*
|
*
|
||||||
* @param string $key Key of attribute
|
* @param string $key Key of attribute
|
||||||
* @return string Formated value
|
* @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data
|
||||||
|
* @return string Formated value
|
||||||
*/
|
*/
|
||||||
function getAlignFlag($key)
|
function getAlignFlag($key, $extrafieldsobjectkey='')
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$type=$this->attribute_type[$key];
|
if (! empty($extrafieldsobjectkey)) $type=$this->attributes[$extrafieldsobjectkey]['type'][$key];
|
||||||
|
else $type=$this->attribute_type[$key];
|
||||||
|
|
||||||
$align='';
|
$align='';
|
||||||
|
|
||||||
|
|||||||
@ -139,6 +139,9 @@ class HookManager
|
|||||||
'addMoreMassActions',
|
'addMoreMassActions',
|
||||||
'addSearchEntry',
|
'addSearchEntry',
|
||||||
'addStatisticLine',
|
'addStatisticLine',
|
||||||
|
'createDictionaryFieldList',
|
||||||
|
'editDictionaryFieldlist',
|
||||||
|
'getFormMail',
|
||||||
'deleteFile',
|
'deleteFile',
|
||||||
'doActions',
|
'doActions',
|
||||||
'doMassActions',
|
'doMassActions',
|
||||||
@ -175,10 +178,9 @@ class HookManager
|
|||||||
'formatEvent',
|
'formatEvent',
|
||||||
'printObjectLine',
|
'printObjectLine',
|
||||||
'printObjectSubLine',
|
'printObjectSubLine',
|
||||||
'createDictionaryFieldList',
|
'showLinkToObjectBlock',
|
||||||
'editDictionaryFieldlist',
|
'sendMail',
|
||||||
'getFormMail',
|
'sendMailAfter'
|
||||||
'showLinkToObjectBlock'
|
|
||||||
)
|
)
|
||||||
)) $hooktype='addreplace';
|
)) $hooktype='addreplace';
|
||||||
|
|
||||||
|
|||||||
@ -1726,7 +1726,7 @@ class Form
|
|||||||
* @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
* @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
||||||
* @param int $limit Limit on number of returned lines
|
* @param int $limit Limit on number of returned lines
|
||||||
* @param int $price_level Level of price to show
|
* @param int $price_level Level of price to show
|
||||||
* @param int $status -1=Return all products, 0=Products not on sell, 1=Products on sell
|
* @param int $status Sell status -1=Return all products, 0=Products not on sell, 1=Products on sell
|
||||||
* @param int $finished 2=all, 1=finished, 0=raw material
|
* @param int $finished 2=all, 1=finished, 0=raw material
|
||||||
* @param string $selected_input_value Value of preselected input text (for use with ajax)
|
* @param string $selected_input_value Value of preselected input text (for use with ajax)
|
||||||
* @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
|
* @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
|
||||||
@ -1740,7 +1740,7 @@ class Form
|
|||||||
* 'warehouseopen' = select products from open warehouses,
|
* 'warehouseopen' = select products from open warehouses,
|
||||||
* 'warehouseclosed' = select products from closed warehouses,
|
* 'warehouseclosed' = select products from closed warehouses,
|
||||||
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
|
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
|
||||||
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array())
|
function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array())
|
||||||
@ -2390,7 +2390,7 @@ class Form
|
|||||||
* Return list of suppliers products
|
* Return list of suppliers products
|
||||||
*
|
*
|
||||||
* @param int $socid Id societe fournisseur (0 pour aucun filtre)
|
* @param int $socid Id societe fournisseur (0 pour aucun filtre)
|
||||||
* @param int $selected Produit pre-selectionne
|
* @param int $selected Product price pre-selected (must be 'id' in product_fournisseur_price or 'idprod_IDPROD')
|
||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Nom de la zone select
|
||||||
* @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
* @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service)
|
||||||
* @param string $filtre Pour filtre sql
|
* @param string $filtre Pour filtre sql
|
||||||
@ -5275,7 +5275,7 @@ class Form
|
|||||||
$confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
|
$confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
|
||||||
|
|
||||||
$fieldstoshow='t.ref';
|
$fieldstoshow='t.ref';
|
||||||
if (! empty($objecttmp->fields))
|
if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...)
|
||||||
{
|
{
|
||||||
$tmpfieldstoshow='';
|
$tmpfieldstoshow='';
|
||||||
foreach($objecttmp->fields as $key => $val)
|
foreach($objecttmp->fields as $key => $val)
|
||||||
|
|||||||
@ -266,10 +266,10 @@ class FormCompany
|
|||||||
$out.= '<option value="'.$obj->rowid.'">';
|
$out.= '<option value="'.$obj->rowid.'">';
|
||||||
}
|
}
|
||||||
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
|
||||||
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE) && $conf->global->MAIN_SHOW_REGION_IN_STATE == 2) {
|
if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2) {
|
||||||
$out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
$out.= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
||||||
}
|
}
|
||||||
else if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE) && $conf->global->MAIN_SHOW_REGION_IN_STATE == 1) {
|
else if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1) {
|
||||||
$out.= $obj->region_name . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
$out.= $obj->region_name . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -993,7 +993,7 @@ class FormMail extends Form
|
|||||||
$sql = "SELECT label, topic, joinfiles, content, content_lines, lang";
|
$sql = "SELECT label, topic, joinfiles, content, content_lines, lang";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||||
$sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
|
$sql.= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
|
||||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
|
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
|
||||||
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
|
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
|
||||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||||
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
||||||
@ -1065,7 +1065,7 @@ class FormMail extends Form
|
|||||||
$sql = "SELECT label, topic, content, lang";
|
$sql = "SELECT label, topic, content, lang";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||||
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
|
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
|
||||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
|
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
|
||||||
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
|
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
|
||||||
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
||||||
$sql.= $this->db->order("lang,label","ASC");
|
$sql.= $this->db->order("lang,label","ASC");
|
||||||
@ -1102,7 +1102,7 @@ class FormMail extends Form
|
|||||||
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
|
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||||
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
|
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
|
||||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 1).")";
|
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
|
||||||
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
|
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
|
||||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||||
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages
|
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages
|
||||||
|
|||||||
@ -61,13 +61,15 @@ class FormOther
|
|||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Nom de la zone select
|
||||||
* @param string $type Type des modeles recherches
|
* @param string $type Type des modeles recherches
|
||||||
* @param int $useempty Affiche valeur vide dans liste
|
* @param int $useempty Affiche valeur vide dans liste
|
||||||
|
* @param int $fk_user Utilisateur créant le modèle
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0)
|
function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0, $fk_user=null)
|
||||||
{
|
{
|
||||||
$sql = "SELECT rowid, label";
|
$sql = "SELECT rowid, label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||||
$sql.= " WHERE type = '".$type."'";
|
$sql.= " WHERE type = '".$type."'";
|
||||||
|
if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user;
|
||||||
$sql.= " ORDER BY rowid";
|
$sql.= " ORDER BY rowid";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class FormProjets
|
|||||||
* Output a combo list with projects qualified for a third party / user
|
* Output a combo list with projects qualified for a third party / user
|
||||||
*
|
*
|
||||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* @param int $selected Id project preselected
|
* @param string $selected Id project preselected ('' or id of project)
|
||||||
* @param string $htmlname Name of HTML field
|
* @param string $htmlname Name of HTML field
|
||||||
* @param int $maxlength Maximum length of label
|
* @param int $maxlength Maximum length of label
|
||||||
* @param int $option_only Return only html options lines without the select tag
|
* @param int $option_only Return only html options lines without the select tag
|
||||||
|
|||||||
@ -404,13 +404,13 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'FICHINTER_ADD_CONTACT':
|
case 'FICHINTER_ADD_CONTACT':
|
||||||
$link='/fichinter/card.php?id='.$object->id;
|
$link='/fichinter/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->facture->dir_output;
|
$dir_output = $conf->ficheinter->dir_output;
|
||||||
$object_type = 'ficheinter';
|
$object_type = 'ficheinter';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$object->ref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact",$object->ref);
|
||||||
break;
|
break;
|
||||||
case 'FICHINTER_VALIDATE':
|
case 'FICHINTER_VALIDATE':
|
||||||
$link='/fichinter/card.php?id='.$object->id;
|
$link='/fichinter/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->facture->dir_output;
|
$dir_output = $conf->ficheinter->dir_output;
|
||||||
$object_type = 'ficheinter';
|
$object_type = 'ficheinter';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||||
break;
|
break;
|
||||||
@ -664,8 +664,9 @@ class Notify
|
|||||||
}
|
}
|
||||||
dol_syslog("Replace the __SUPERVISOREMAIL__ key into recipient email string with ".$newval);
|
dol_syslog("Replace the __SUPERVISOREMAIL__ key into recipient email string with ".$newval);
|
||||||
$sendto = preg_replace('/__SUPERVISOREMAIL__/', $newval, $sendto);
|
$sendto = preg_replace('/__SUPERVISOREMAIL__/', $newval, $sendto);
|
||||||
$sendto = preg_replace('/^[\s,]+/','',$sendto); // Clean start of string
|
$sendto = preg_replace('/,\s*,/', ',', $sendto); // in some case you can have $sendto like "email, __SUPERVISOREMAIL__ , otheremail" then you have "email, , othermail" and it's not valid
|
||||||
$sendto = preg_replace('/[\s,]+$/','',$sendto); // Clean end of string
|
$sendto = preg_replace('/^[\s,]+/', '', $sendto); // Clean start of string
|
||||||
|
$sendto = preg_replace('/[\s,]+$/', '', $sendto); // Clean end of string
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sendto)
|
if ($sendto)
|
||||||
|
|||||||
@ -640,7 +640,6 @@ function isInEEC($object)
|
|||||||
function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='')
|
function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelink=0, $morehtmlright='')
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
global $bc;
|
|
||||||
|
|
||||||
$i = -1 ;
|
$i = -1 ;
|
||||||
|
|
||||||
@ -768,10 +767,10 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
|
|||||||
*/
|
*/
|
||||||
function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||||
{
|
{
|
||||||
global $user,$conf;
|
global $user,$conf,$extrafields,$hookmanager;
|
||||||
global $bc;
|
global $contextpage;
|
||||||
|
|
||||||
$form= new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -782,24 +781,67 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
$search_addressphone = GETPOST("search_addressphone",'alpha');
|
$search_addressphone = GETPOST("search_addressphone",'alpha');
|
||||||
|
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="p.lastname";
|
if (! $sortfield) $sortfield="t.lastname";
|
||||||
|
|
||||||
|
if (! empty($conf->clicktodial->enabled))
|
||||||
|
{
|
||||||
|
$user->fetch_clicktodial(); // lecture des infos de clicktodial du user
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$contactstatic = new Contact($db);
|
||||||
|
|
||||||
|
$extralabels=$extrafields->fetch_name_optionals_label($contactstatic->table_element);
|
||||||
|
|
||||||
|
$contactstatic->fields=array(
|
||||||
|
'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1),
|
||||||
|
'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOfFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20),
|
||||||
|
'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30),
|
||||||
|
'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>40, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0,1), 1=>$contactstatic->LibStatut(1,1))),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Definition of fields for list
|
||||||
|
$arrayfields=array(
|
||||||
|
't.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID?1:0), 'position'=>1),
|
||||||
|
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
|
||||||
|
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
|
||||||
|
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
|
||||||
|
't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>40, 'align'=>'center'),
|
||||||
|
);
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label']))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$contactstatic->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key])!=3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialize array of search criterias
|
||||||
|
$search=array();
|
||||||
|
foreach($contactstatic->fields as $key => $val)
|
||||||
|
{
|
||||||
|
if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||||
{
|
{
|
||||||
$search_status = '';
|
$search_status = '';
|
||||||
$search_name = '';
|
$search_name = '';
|
||||||
$search_addressphone = '';
|
$search_addressphone = '';
|
||||||
$search_array_options=array();
|
$search_array_options=array();
|
||||||
|
|
||||||
|
foreach($contactstatic->fields as $key => $val)
|
||||||
|
{
|
||||||
|
$search[$key]='';
|
||||||
|
}
|
||||||
|
$toselect='';
|
||||||
}
|
}
|
||||||
|
|
||||||
$i=-1;
|
$contactstatic->fields = dol_sort_array($contactstatic->fields, 'position');
|
||||||
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
$contactstatic = new Contact($db);
|
|
||||||
|
|
||||||
if (! empty($conf->clicktodial->enabled))
|
|
||||||
{
|
|
||||||
$user->fetch_clicktodial(); // lecture des infos de clicktodial
|
|
||||||
}
|
|
||||||
|
|
||||||
$buttoncreate='';
|
$buttoncreate='';
|
||||||
if ($user->rights->societe->contact->creer)
|
if ($user->rights->societe->contact->creer)
|
||||||
@ -815,26 +857,32 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
print load_fiche_titre($title, $buttoncreate,'');
|
print load_fiche_titre($title, $buttoncreate,'');
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="socid" value="'.$object->id.'">';
|
print '<input type="hidden" name="socid" value="'.$object->id.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
|
||||||
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
//if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print "\n".'<table class="noborder" width="100%">'."\n";
|
print "\n".'<table class="tagtable liste">'."\n";
|
||||||
|
|
||||||
$param="socid=".$object->id;
|
$param="socid=".$object->id;
|
||||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||||
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
|
if ($search_name != '') $param.='&search_name='.urlencode($search_name);
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.civility, p.poste, p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut, p.photo,";
|
$sql = "SELECT t.rowid, t.lastname, t.firstname, t.fk_pays as country_id, t.civility, t.poste, t.phone as phone_pro, t.phone_mobile, t.phone_perso, t.fax, t.email, t.skype, t.statut, t.photo,";
|
||||||
$sql .= " p.civility as civility_id, p.address, p.zip, p.town";
|
$sql .= " t.civility as civility_id, t.address, t.zip, t.town";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as t";
|
||||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||||
if ($search_status!='' && $search_status != '-1') $sql .= " AND p.statut = ".$db->escape($search_status);
|
$sql .= " WHERE t.fk_soc = ".$object->id;
|
||||||
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')";
|
if ($search_status!='' && $search_status != '-1') $sql .= " AND t.statut = ".$db->escape($search_status);
|
||||||
$sql.= " ORDER BY $sortfield $sortorder";
|
if ($search_name) $sql .= " AND (t.lastname LIKE '%".$db->escape($search_name)."%' OR t.firstname LIKE '%".$db->escape($search_name)."%')";
|
||||||
|
if ($sortfield == "t.name") $sql.=" ORDER BY t.lastname $sortorder, t.firstname $sortorder";
|
||||||
|
else $sql.= " ORDER BY $sortfield $sortorder";
|
||||||
|
|
||||||
dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
|
dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -842,59 +890,63 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$colspan=9;
|
// Fields title search
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
|
|
||||||
// Photo - Name
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print '<input type="text" class="flat minwidth75" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Position
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Address - Phone - Email
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
|
|
||||||
// Status
|
|
||||||
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
|
|
||||||
print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Add to agenda
|
|
||||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
|
||||||
{
|
|
||||||
$colspan++;
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action
|
|
||||||
print '<td class="liste_titre" align="right">';
|
|
||||||
$searchpicto=$form->showFilterButtons();
|
|
||||||
print $searchpicto;
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print "</tr>";
|
|
||||||
|
|
||||||
$titlefieldaddress=$langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email");
|
|
||||||
if (! empty($conf->dol_optimize_smallscreen)) $titlefieldaddress=$langs->trans("Address");
|
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Name",$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder);
|
foreach($contactstatic->fields as $key => $val)
|
||||||
print_liste_field_titre("Poste",$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder);
|
{
|
||||||
print_liste_field_titre($titlefieldaddress,$_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder);
|
$align='';
|
||||||
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"p.statut","",$param,'align="center"',$sortfield,$sortorder);
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||||
// Add to agenda
|
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||||
if (! empty($conf->agenda->enabled) && ! empty($user->rights->agenda->myactions->create)) print_liste_field_titre('');
|
if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center';
|
||||||
// Edit
|
if (! empty($arrayfields['t.'.$key]['checked']))
|
||||||
print_liste_field_titre('');
|
{
|
||||||
print "</tr>\n";
|
print '<td class="liste_titre'.($align?' '.$align:'').'">';
|
||||||
|
if (in_array($key, array('lastname','name'))) print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||||
|
elseif (in_array($key, array('statut'))) print $form->selectarray('search_status', array('-1'=>'','0'=>$contactstatic->LibStatut(0,1),'1'=>$contactstatic->LibStatut(1,1)),$search_status);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||||
|
|
||||||
|
// Fields from hook
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListOption', $parameters, $contactstatic); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
// Action column
|
||||||
|
print '<td class="liste_titre" align="right">';
|
||||||
|
$searchpicto=$form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
// Fields title label
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
foreach($contactstatic->fields as $key => $val)
|
||||||
|
{
|
||||||
|
$align='';
|
||||||
|
if (in_array($val['type'], array('date','datetime','timestamp'))) $align.=($align?' ':'').'center';
|
||||||
|
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
|
||||||
|
if ($key == 'status' || $key == 'statut') $align.=($align?' ':'').'center';
|
||||||
|
if (! empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align?'class="'.$align.'"':''), $sortfield, $sortorder, $align.' ')."\n";
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
|
// Hook fields
|
||||||
|
$parameters=array('arrayfields'=>$arrayfields);
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$i = -1;
|
||||||
|
|
||||||
if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x')))
|
if ($num || (GETPOST('button_search') || GETPOST('button_search.x') || GETPOST('button_search_x')))
|
||||||
{
|
{
|
||||||
$i=0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -923,46 +975,81 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
$contactstatic->country_code = $country_code;
|
$contactstatic->country_code = $country_code;
|
||||||
|
|
||||||
$contactstatic->setGenderFromCivility();
|
$contactstatic->setGenderFromCivility();
|
||||||
|
$contactstatic->fetch_optionals();
|
||||||
|
|
||||||
|
if (is_array($contactstatic->array_options))
|
||||||
|
{
|
||||||
|
foreach($contactstatic->array_options as $key => $val)
|
||||||
|
{
|
||||||
|
$obj->$key = $val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// ID
|
||||||
|
if (! empty($arrayfields['t.rowid']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
print $contactstatic->id;
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Photo - Name
|
// Photo - Name
|
||||||
print '<td>';
|
if (! empty($arrayfields['t.name']['checked']))
|
||||||
print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1);
|
{
|
||||||
print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage));
|
print '<td>';
|
||||||
print '</td>';
|
print $form->showphoto('contact',$contactstatic,0,0,0,'photorefnoborder valignmiddle marginrightonly','small',1,0,1);
|
||||||
|
print $contactstatic->getNomUrl(0,'',0,'&backtopage='.urlencode($backtopage));
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Job position
|
// Job position
|
||||||
print '<td>';
|
if (! empty($arrayfields['t.poste']['checked']))
|
||||||
if ($obj->poste) print $obj->poste;
|
{
|
||||||
print '</td>';
|
print '<td>';
|
||||||
|
if ($obj->poste) print $obj->poste;
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Address - Phone - Email
|
// Address - Phone - Email
|
||||||
print '<td>';
|
if (! empty($arrayfields['t.address']['checked']))
|
||||||
print $contactstatic->getBannerAddress('contact', $object);
|
{
|
||||||
print '</td>';
|
print '<td>';
|
||||||
|
print $contactstatic->getBannerAddress('contact', $object);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
print '<td align="center">'.$contactstatic->getLibStatut(5).'</td>';
|
if (! empty($arrayfields['t.statut']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="center">'.$contactstatic->getLibStatut(5).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Add to agenda
|
// Extra fields
|
||||||
|
$extrafieldsobjectkey='socpeople';
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
print '<td align="right">';
|
||||||
|
|
||||||
|
// Add to agenda
|
||||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&actioncode=&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||||
print img_object($langs->trans("Event"),"action");
|
print img_object($langs->trans("Event"),"action");
|
||||||
print '</a></td>';
|
print '</a> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if ($user->rights->societe->contact->creer)
|
if ($user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($backtopage).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
else print '<td> </td>';
|
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
@ -970,9 +1057,9 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven">';
|
$colspan=1;
|
||||||
print '<td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td>';
|
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||||
print "</tr>\n";
|
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||||
}
|
}
|
||||||
print "\n</table>\n";
|
print "\n</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -995,7 +1082,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
function show_addresses($conf,$langs,$db,$object,$backtopage='')
|
function show_addresses($conf,$langs,$db,$object,$backtopage='')
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
global $bc;
|
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/address.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/address.class.php';
|
||||||
|
|
||||||
@ -1087,7 +1173,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='')
|
|||||||
*/
|
*/
|
||||||
function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$actioncode='')
|
function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$actioncode='')
|
||||||
{
|
{
|
||||||
global $bc,$user,$conf;
|
global $user,$conf;
|
||||||
|
|
||||||
$out = show_actions_done($conf,$langs,$db,$filterobj,$objcon,1,$actioncode, 'todo');
|
$out = show_actions_done($conf,$langs,$db,$filterobj,$objcon,1,$actioncode, 'todo');
|
||||||
|
|
||||||
@ -1114,7 +1200,7 @@ function show_actions_todo($conf,$langs,$db,$filterobj,$objcon='',$noprint=0,$ac
|
|||||||
*/
|
*/
|
||||||
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep,a.id', $sortorder='DESC')
|
function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=0, $actioncode='', $donetodo='done', $filters=array(), $sortfield='a.datep,a.id', $sortorder='DESC')
|
||||||
{
|
{
|
||||||
global $bc,$user,$conf;
|
global $user,$conf;
|
||||||
global $form;
|
global $form;
|
||||||
|
|
||||||
global $param;
|
global $param;
|
||||||
@ -1142,14 +1228,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", m.lastname, m.firstname";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
|
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", o.ref";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
|
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", o.ref";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a";
|
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||||
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON a.fk_action = c.id";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
if (is_object($filterobj) && get_class($filterobj) == 'Societe') $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
if (is_object($filterobj) && get_class($filterobj) == 'Adherent') $sql.= ", ".MAIN_DB_PREFIX."adherent as m";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
|
if (is_object($filterobj) && get_class($filterobj) == 'CommandeFournisseur') $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as o";
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
|
if (is_object($filterobj) && get_class($filterobj) == 'Product') $sql.= ", ".MAIN_DB_PREFIX."product as o";
|
||||||
$sql.= " WHERE u.rowid = a.fk_user_action";
|
$sql.= " WHERE a.entity IN (".getEntity('agenda').")";
|
||||||
$sql.= " AND a.entity IN (".getEntity('agenda').")";
|
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
|
if (is_object($filterobj) && get_class($filterobj) == 'Societe' && $filterobj->id) $sql.= " AND a.fk_soc = ".$filterobj->id;
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
|
if (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) $sql.= " AND a.fk_project = ".$filterobj->id;
|
||||||
if (is_object($filterobj) && get_class($filterobj) == 'Adherent')
|
if (is_object($filterobj) && get_class($filterobj) == 'Adherent')
|
||||||
@ -1192,7 +1278,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||||
if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']);
|
if (is_array($filters) && $filters['search_agenda_label']) $sql.= natural_search('a.label', $filters['search_agenda_label']);
|
||||||
$sql.= $db->order($sortfield, $sortorder);
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -1298,7 +1383,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email)))
|
if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email)))
|
||||||
{
|
{
|
||||||
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
|
||||||
@ -1385,7 +1469,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
|
|
||||||
foreach ($histo as $key=>$value)
|
foreach ($histo as $key=>$value)
|
||||||
{
|
{
|
||||||
|
|
||||||
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
|
$actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo
|
||||||
|
|
||||||
$out.='<tr class="oddeven">';
|
$out.='<tr class="oddeven">';
|
||||||
@ -1407,8 +1490,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
//$userstatic->id=$histo[$key]['userid'];
|
//$userstatic->id=$histo[$key]['userid'];
|
||||||
//$userstatic->login=$histo[$key]['login'];
|
//$userstatic->login=$histo[$key]['login'];
|
||||||
//$out.=$userstatic->getLoginUrl(1);
|
//$out.=$userstatic->getLoginUrl(1);
|
||||||
$userstatic->fetch($histo[$key]['userid']);
|
if ($histo[$key]['userid'] > 0)
|
||||||
$out.=$userstatic->getNomUrl(-1);
|
{
|
||||||
|
$userstatic->fetch($histo[$key]['userid']);
|
||||||
|
$out.=$userstatic->getNomUrl(-1);
|
||||||
|
}
|
||||||
$out.='</td>';
|
$out.='</td>';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
@ -1560,7 +1646,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
|||||||
function show_subsidiaries($conf,$langs,$db,$object)
|
function show_subsidiaries($conf,$langs,$db,$object)
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
global $bc;
|
|
||||||
|
|
||||||
$i=-1;
|
$i=-1;
|
||||||
|
|
||||||
|
|||||||
@ -1706,7 +1706,15 @@ function dol_convert_file($fileinput, $ext='png', $fileoutput='')
|
|||||||
if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext;
|
if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext;
|
||||||
|
|
||||||
$count = $image->getNumberImages();
|
$count = $image->getNumberImages();
|
||||||
$ret = $image->writeImages($fileoutput, true);
|
|
||||||
|
if (! dol_is_file($fileoutput) || is_writeable($fileoutput))
|
||||||
|
{
|
||||||
|
$ret = $image->writeImages($fileoutput, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_syslog("Warning: Failed to write cache preview file '.$fileoutput.'. Check permission on file/dir", LOG_ERR);
|
||||||
|
}
|
||||||
if ($ret) return $count;
|
if ($ret) return $count;
|
||||||
else return -3;
|
else return -3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
|
|||||||
* 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey',
|
* 'commande', 'commande_fournisseur', 'expedition', 'intervention', 'survey',
|
||||||
* 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project',
|
* 'contract', 'tax', 'expensereport', 'holiday', 'multicurrency', 'project',
|
||||||
* 'email_template', 'event', 'donation'
|
* 'email_template', 'event', 'donation'
|
||||||
* 'c_paiement', ...
|
* 'c_paiement', 'c_payment_term', ...
|
||||||
* @param int $shared 0=Return id of current entity only,
|
* @param int $shared 0=Return id of current entity only,
|
||||||
* 1=Return id of current entity + shared entities (default)
|
* 1=Return id of current entity + shared entities (default)
|
||||||
* @param int $forceentity Entity id
|
* @param int $forceentity Entity id
|
||||||
@ -550,7 +550,7 @@ function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NU
|
|||||||
if (! is_array($out) || empty($out)) $out=array();
|
if (! is_array($out) || empty($out)) $out=array();
|
||||||
break;
|
break;
|
||||||
case 'nohtml':
|
case 'nohtml':
|
||||||
$out=dol_string_nohtmltag($out);
|
$out=dol_string_nohtmltag($out, 0);
|
||||||
break;
|
break;
|
||||||
case 'alphanohtml': // Recommended for search params
|
case 'alphanohtml': // Recommended for search params
|
||||||
if (! is_array($out))
|
if (! is_array($out))
|
||||||
@ -3520,15 +3520,16 @@ function dol_print_error($db='',$error='',$errors=null)
|
|||||||
* @param string $prefixcode Prefix of public error code
|
* @param string $prefixcode Prefix of public error code
|
||||||
* @param string $errormessage Complete error message
|
* @param string $errormessage Complete error message
|
||||||
* @param array $errormessages Array of error messages
|
* @param array $errormessages Array of error messages
|
||||||
|
* @param string $morecss More css
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function dol_print_error_email($prefixcode, $errormessage='', $errormessages=array())
|
function dol_print_error_email($prefixcode, $errormessage='', $errormessages=array(), $morecss='error')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
print '<br><div class="center login_main_message"><div class="error">';
|
print '<br><div class="center login_main_message"><div class="'.$morecss.'">';
|
||||||
print $langs->trans("ErrorContactEMail", $conf->global->MAIN_INFO_SOCIETE_MAIL, $prefixcode.dol_print_date($now,'%Y%m%d'));
|
print $langs->trans("ErrorContactEMail", $conf->global->MAIN_INFO_SOCIETE_MAIL, $prefixcode.dol_print_date($now,'%Y%m%d'));
|
||||||
if ($errormessage) print '<br><br>'.$errormessage;
|
if ($errormessage) print '<br><br>'.$errormessage;
|
||||||
if (is_array($errormessages) && count($errormessages))
|
if (is_array($errormessages) && count($errormessages))
|
||||||
@ -6309,7 +6310,7 @@ function dol_validElement($element)
|
|||||||
* Return img flag of country for a language code or country code
|
* Return img flag of country for a language code or country code
|
||||||
*
|
*
|
||||||
* @param string $codelang Language code (en_IN, fr_CA...) or Country code (IN, FR)
|
* @param string $codelang Language code (en_IN, fr_CA...) or Country code (IN, FR)
|
||||||
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
|
* @param string $moreatt Add more attribute on img tag (For example 'style="float: right"')
|
||||||
* @return string HTML img string with flag.
|
* @return string HTML img string with flag.
|
||||||
*/
|
*/
|
||||||
function picto_from_langcode($codelang, $moreatt = '')
|
function picto_from_langcode($codelang, $moreatt = '')
|
||||||
@ -6322,7 +6323,7 @@ function picto_from_langcode($codelang, $moreatt = '')
|
|||||||
|
|
||||||
if ($codelang == 'auto')
|
if ($codelang == 'auto')
|
||||||
{
|
{
|
||||||
return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png', $moreatt);
|
return '<span class="fa fa-globe"></span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$langtocountryflag = array(
|
$langtocountryflag = array(
|
||||||
|
|||||||
@ -995,7 +995,12 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
else dol_print_error($db);
|
else dol_print_error($db);
|
||||||
|
|
||||||
// Check if we must force counter to maskoffset
|
// Check if we must force counter to maskoffset
|
||||||
if (empty($counter) || preg_match('/[^0-9]/i',$counter)) $counter=$maskoffset;
|
if (empty($counter)) $counter=$maskoffset;
|
||||||
|
else if (preg_match('/[^0-9]/i',$counter))
|
||||||
|
{
|
||||||
|
$counter=0;
|
||||||
|
dol_syslog("Error, the last counter found is '".$counter."' so is not a numeric value. We will restart to 1.", LOG_ERR);
|
||||||
|
}
|
||||||
else if ($counter < $maskoffset && empty($conf->global->MAIN_NUMBERING_OFFSET_ONLY_FOR_FIRST)) $counter=$maskoffset;
|
else if ($counter < $maskoffset && empty($conf->global->MAIN_NUMBERING_OFFSET_ONLY_FOR_FIRST)) $counter=$maskoffset;
|
||||||
|
|
||||||
if ($mode == 'last') // We found value for counter = last counter value. Now need to get corresponding ref of invoice.
|
if ($mode == 'last') // We found value for counter = last counter value. Now need to get corresponding ref of invoice.
|
||||||
@ -1503,7 +1508,7 @@ function dol_print_reduction($reduction,$langs)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$string = price($reduction).'%';
|
$string = vatrate($reduction,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
@ -2253,6 +2258,9 @@ function getModuleDirForApiClass($module)
|
|||||||
elseif ($module == 'users') {
|
elseif ($module == 'users') {
|
||||||
$moduledirforclass = 'user';
|
$moduledirforclass = 'user';
|
||||||
}
|
}
|
||||||
|
elseif ($module == 'ficheinter' || $module == 'interventions') {
|
||||||
|
$moduledirforclass = 'fichinter';
|
||||||
|
}
|
||||||
|
|
||||||
return $moduledirforclass;
|
return $moduledirforclass;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
/* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.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
|
||||||
@ -46,6 +47,17 @@ function vat_prepare_head($object)
|
|||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat');
|
complete_head_from_modules($conf, $langs, $object, $head, $tab,'vat');
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||||
|
$upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
|
$nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$'));
|
||||||
|
$nbLinks=Link::count($db, $object->element, $object->id);
|
||||||
|
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id;
|
||||||
|
$head[$tab][1] = $langs->trans("Documents");
|
||||||
|
if (($nbFiles+$nbLinks) > 0) $head[$tab][1].= ' <span class="badge">'.($nbFiles+$nbLinks).'</span>';
|
||||||
|
$head[$tab][2] = 'documents';
|
||||||
|
$tab++;
|
||||||
|
|
||||||
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id;
|
$head[$tab][0] = DOL_URL_ROOT.'/compta/tva/info.php?id='.$object->id;
|
||||||
$head[$tab][1] = $langs->trans("Info");
|
$head[$tab][1] = $langs->trans("Info");
|
||||||
$head[$tab][2] = 'info';
|
$head[$tab][2] = 'info';
|
||||||
|
|||||||
@ -168,23 +168,25 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
|||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1600__+MAX_llx_menu__, 'billing', 'supplier_bills', 6__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'BillsSuppliers', 0, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 3, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1601__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/card.php?action=create&leftmenu=suppliers_bills', 'NewBill', 1, 'bills', '$user->rights->fournisseur->facture->creer', '', 2, 0, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1602__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/list.php?leftmenu=suppliers_bills', 'List', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__);
|
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', '', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1603__+MAX_llx_menu__, 'billing', 'suppliers_bills_payment', 1600__+MAX_llx_menu__, '/fourn/facture/paiement.php?leftmenu=suppliers_bills_payment', 'Payments', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 2, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', '', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1605__+MAX_llx_menu__, 'billing', 'suppliers_bills_reports', 1603__+MAX_llx_menu__, '/fourn/facture/rapport.php?leftmenu=suppliers_bills_reports', 'Reporting', 2, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 1, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_invoice->enabled', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
|
||||||
-- Billing - Customer invoice
|
-- Billing - Customer invoice
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?action=create&leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
|
||||||
|
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
|
||||||
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
|
||||||
|
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
|
||||||
|
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__);
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?leftmenu=customers_bills&search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
|
|
||||||
|
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?leftmenu=customers_bills', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);
|
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', '', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?leftmenu=customers_bills', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
|
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->facture->enabled', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?leftmenu=customers_bills', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__);
|
|
||||||
-- Billing - Orders to bill
|
-- Billing - Orders to bill
|
||||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__);
|
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->commande->enabled', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?leftmenu=orders&viewstatut=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__);
|
||||||
-- Donations
|
-- Donations
|
||||||
|
|||||||
@ -802,24 +802,24 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$newmenu->add("/compta/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
$newmenu->add("/compta/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
||||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire, '', $mainmenu, 'customers_bills_list');
|
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire, '', $mainmenu, 'customers_bills_list');
|
||||||
|
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu))
|
if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills(|draft|notpaid|paid|canceled)$/', $leftmenu))
|
||||||
{
|
{
|
||||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire);
|
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire);
|
||||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire);
|
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire);
|
||||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire);
|
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire);
|
||||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire);
|
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire);
|
||||||
}
|
}
|
||||||
$newmenu->add("/compta/facture/invoicetemplate_list.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->creer); // No need to see recurring invoices, if user has no permission to create invoice.
|
$newmenu->add("/compta/facture/invoicetemplate_list.php?leftmenu=customers_bills_templates",$langs->trans("ListOfTemplates"),1,$user->rights->facture->creer,'',$mainmenu,'customers_bills_templates'); // No need to see recurring invoices, if user has no permission to create invoice.
|
||||||
|
|
||||||
$newmenu->add("/compta/paiement/list.php",$langs->trans("Payments"),1,$user->rights->facture->lire);
|
$newmenu->add("/compta/paiement/list.php?leftmenu=customers_bills_payment",$langs->trans("Payments"),1,$user->rights->facture->lire,'',$mainmenu,'customers_bills_payment');
|
||||||
|
|
||||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||||
{
|
{
|
||||||
$newmenu->add("/compta/paiement/avalider.php",$langs->trans("MenuToValid"),2,$user->rights->facture->lire);
|
$newmenu->add("/compta/paiement/avalider.php?leftmenu=customers_bills_tovalid",$langs->trans("MenuToValid"),2,$user->rights->facture->lire,'',$mainmenu,'customer_bills_tovalid');
|
||||||
}
|
}
|
||||||
$newmenu->add("/compta/paiement/rapport.php",$langs->trans("Reportings"),2,$user->rights->facture->lire);
|
$newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_reports",$langs->trans("Reportings"),2,$user->rights->facture->lire,'',$mainmenu,'customers_bills_reports');
|
||||||
|
|
||||||
$newmenu->add("/compta/facture/stats/index.php", $langs->trans("Statistics"),1,$user->rights->facture->lire);
|
$newmenu->add("/compta/facture/stats/index.php?leftmenu=customers_bills_stats", $langs->trans("Statistics"),1,$user->rights->facture->lire,'',$mainmenu,'customers_bills_stats');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Suppliers invoices
|
// Suppliers invoices
|
||||||
@ -827,7 +827,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||||
$newmenu->add("/fourn/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create');
|
$newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer, '', $mainmenu, 'suppliers_bills_create');
|
||||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list');
|
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_list');
|
||||||
|
|
||||||
if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
|
if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
|
||||||
@ -836,11 +836,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
|||||||
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid');
|
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid');
|
||||||
}
|
}
|
||||||
|
|
||||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
|
$newmenu->add("/fourn/facture/paiement.php?leftmenu=suppliers_bills_payment", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_payment');
|
||||||
|
|
||||||
$newmenu->add("/fourn/facture/rapport.php",$langs->trans("Reportings"),2,$user->rights->fournisseur->facture->lire);
|
$newmenu->add("/fourn/facture/rapport.php?leftmenu=suppliers_bills_report",$langs->trans("Reportings"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_report');
|
||||||
|
|
||||||
$newmenu->add("/compta/facture/stats/index.php?mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
|
$newmenu->add("/compta/facture/stats/index.php?mode=supplier&leftmenu=suppliers_bills_stats", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_stats');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Orders
|
// Orders
|
||||||
|
|||||||
@ -139,10 +139,10 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
$this->posxtva=99;
|
$this->posxtva=101;
|
||||||
$this->posxup=114;
|
$this->posxup=118;
|
||||||
$this->posxqty=130;
|
$this->posxqty=135;
|
||||||
$this->posxunit=147;
|
$this->posxunit=151;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -423,9 +423,11 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
{
|
{
|
||||||
$pdf->commitTransaction();
|
$pdf->commitTransaction();
|
||||||
}
|
}
|
||||||
|
$posYAfterDescription=$pdf->GetY();
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
|
|
||||||
$pdf->setPage($pageposbefore);
|
$pdf->setPage($pageposbefore);
|
||||||
$pdf->setTopMargin($this->marge_haute);
|
$pdf->setTopMargin($this->marge_haute);
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -614,13 +616,13 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
|
$this->error=$langs->transnoentities("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,11 +122,10 @@ abstract class ModeleNumRefExpenseReport
|
|||||||
/**
|
/**
|
||||||
* Renvoie prochaine valeur attribuee
|
* Renvoie prochaine valeur attribuee
|
||||||
*
|
*
|
||||||
* @param Societe $objsoc Object thirdparty
|
|
||||||
* @param Object $object Object we need next value for
|
* @param Object $object Object we need next value for
|
||||||
* @return string Valeur
|
* @return string Valeur
|
||||||
*/
|
*/
|
||||||
function getNextValue($objsoc,$object)
|
function getNextValue($object)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
return $langs->trans("NotAvailable");
|
return $langs->trans("NotAvailable");
|
||||||
|
|||||||
@ -121,10 +121,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
$this->posxtva=99;
|
$this->posxtva=101;
|
||||||
$this->posxup=114;
|
$this->posxup=118;
|
||||||
$this->posxqty=130;
|
$this->posxqty=135;
|
||||||
$this->posxunit=147;
|
$this->posxunit=151;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -686,7 +686,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Affiche zone versements
|
// Affiche zone versements
|
||||||
if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included)
|
if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
||||||
{
|
{
|
||||||
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
|
||||||
}
|
}
|
||||||
@ -1294,7 +1294,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
|
||||||
if ($object->paye) $resteapayer=0;
|
if ($object->paye) $resteapayer=0;
|
||||||
|
|
||||||
if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0)
|
if (($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
|
||||||
{
|
{
|
||||||
// Already paid + Deposits
|
// Already paid + Deposits
|
||||||
$index++;
|
$index++;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class modExport extends DolibarrModules
|
|||||||
$this->dirs = array("/export/temp");
|
$this->dirs = array("/export/temp");
|
||||||
|
|
||||||
// Config pages
|
// Config pages
|
||||||
$this->config_page_url = array();
|
$this->config_page_url = array("export.php");
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
|
|||||||
@ -107,6 +107,21 @@ class modPaypal extends DolibarrModules
|
|||||||
// Main menu entries
|
// Main menu entries
|
||||||
$this->menus = array(); // List of menus to add
|
$this->menus = array(); // List of menus to add
|
||||||
$r=0;
|
$r=0;
|
||||||
|
$this->menu[$r]=array(
|
||||||
|
'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||||
|
'mainmenu'=>'billing',
|
||||||
|
'leftmenu'=>'customers_bills_payment_paypal',
|
||||||
|
'type'=>'left', // This is a Left menu entry
|
||||||
|
'titre'=>'PaypalImportPayment',
|
||||||
|
'url'=>'/paypal/importpayments.php',
|
||||||
|
'langs'=>'paypal', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||||
|
'position'=>501,
|
||||||
|
'enabled'=>'$conf->paypal->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||||
|
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||||
|
'target'=>'',
|
||||||
|
'user'=>2
|
||||||
|
); // 0=Menu for internal users, 1=external users, 2=both
|
||||||
|
$r++;
|
||||||
|
|
||||||
// Add here entries to declare new menus
|
// Add here entries to declare new menus
|
||||||
// Example to declare the Top Menu entry:
|
// Example to declare the Top Menu entry:
|
||||||
|
|||||||
@ -67,7 +67,8 @@ class modSalaries extends DolibarrModules
|
|||||||
$this->dirs = array("/salaries/temp");
|
$this->dirs = array("/salaries/temp");
|
||||||
|
|
||||||
// Config pages
|
// Config pages
|
||||||
$this->config_page_url = array('salaries.php');
|
//$this->config_page_url = array('salaries.php');
|
||||||
|
$this->config_page_url = array();
|
||||||
|
|
||||||
// Dependencies
|
// Dependencies
|
||||||
$this->depends = array();
|
$this->depends = array();
|
||||||
|
|||||||
@ -92,8 +92,22 @@ class modStripe extends DolibarrModules
|
|||||||
$r=0;
|
$r=0;
|
||||||
|
|
||||||
// Main menu entries
|
// Main menu entries
|
||||||
$this->menus = array(); // List of menus to add
|
|
||||||
$r=0;
|
$r=0;
|
||||||
|
$this->menu[$r]=array(
|
||||||
|
'fk_menu'=>'fk_mainmenu=billing,fk_leftmenu=customers_bills_payment', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||||
|
'mainmenu'=>'billing',
|
||||||
|
'leftmenu'=>'customers_bills_payment_stripe',
|
||||||
|
'type'=>'left', // This is a Left menu entry
|
||||||
|
'titre'=>'StripeImportPayment',
|
||||||
|
'url'=>'/stripe/importpayments.php',
|
||||||
|
'langs'=>'stripe', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||||
|
'position'=>500,
|
||||||
|
'enabled'=>'$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||||
|
'perms'=>'$user->rights->banque->consolidate', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||||
|
'target'=>'',
|
||||||
|
'user'=>2
|
||||||
|
); // 0=Menu for internal users, 1=external users, 2=both
|
||||||
|
$r++;
|
||||||
|
|
||||||
// Exports
|
// Exports
|
||||||
$r=1;
|
$r=1;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
* 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
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -19,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/core/modules/project/doc/pdf_baleine.modules.php
|
* \file htdocs/core/modules/project/doc/pdf_baleine.modules.php
|
||||||
* \ingroup project
|
* \ingroup project
|
||||||
* \brief Fichier de la classe permettant de generer les projets au modele Baleine
|
* \brief File of class to generate project document Baleine
|
||||||
* \author Regis Houssin
|
* \author Regis Houssin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe permettant de generer les projets au modele Baleine
|
* Class to manage generation of project document Baleine
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class pdf_baleine extends ModelePDFProjects
|
class pdf_baleine extends ModelePDFProjects
|
||||||
@ -78,10 +79,19 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
// Defini position des colonnes
|
// Defini position des colonnes
|
||||||
$this->posxref=$this->marge_gauche+1;
|
$this->posxref=$this->marge_gauche+1;
|
||||||
$this->posxlabel=$this->marge_gauche+25;
|
$this->posxlabel=$this->marge_gauche+25;
|
||||||
$this->posxworkload=$this->marge_gauche+100;
|
$this->posxworkload=$this->marge_gauche+120;
|
||||||
$this->posxprogress=$this->marge_gauche+130;
|
$this->posxprogress=$this->marge_gauche+140;
|
||||||
$this->posxdatestart=$this->marge_gauche+150;
|
$this->posxdatestart=$this->marge_gauche+152;
|
||||||
$this->posxdateend=$this->marge_gauche+170;
|
$this->posxdateend=$this->marge_gauche+170;
|
||||||
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
|
{
|
||||||
|
$this->posxref-=20;
|
||||||
|
$this->posxlabel-=20;
|
||||||
|
$this->posxworkload-=20;
|
||||||
|
$this->posxprogress-=20;
|
||||||
|
$this->posxdatestart-=20;
|
||||||
|
$this->posxdateend-=20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,12 +146,14 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
// Create pdf instance
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
|
$heightforinfotot = 40; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
@ -149,15 +161,21 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
}
|
}
|
||||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||||
|
// Set path to the background PDF File
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||||
|
{
|
||||||
|
$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||||
|
$tplidx = $pdf->importPage(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Complete object by loading several other informations
|
// Complete object by loading several other informations
|
||||||
$task = new Task($this->db);
|
$task = new Task($this->db);
|
||||||
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
||||||
|
|
||||||
if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines
|
if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines
|
||||||
{
|
{
|
||||||
$tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray)));
|
$tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->lines=$tasksarray;
|
$object->lines=$tasksarray;
|
||||||
$nblignes=count($object->lines);
|
$nblignes=count($object->lines);
|
||||||
@ -177,6 +195,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
|
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
@ -184,21 +203,28 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 50;
|
$tab_top = 50;
|
||||||
$tab_height = 200;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_top_newpage = 40;
|
$tab_height = 170;
|
||||||
$tab_height_newpage = 210;
|
$tab_height_newpage = 190;
|
||||||
|
|
||||||
// Affiche notes
|
// Show public note
|
||||||
if (! empty($object->note_public))
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
|
$substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-($tab_top-2);
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-2, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+2);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
@ -208,44 +234,126 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$height_note=0;
|
$height_note=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$heightoftitleline = 10;
|
||||||
$curY = $tab_top + 7;
|
$iniY = $tab_top + $heightoftitleline + 1;
|
||||||
$nexY = $tab_top + 7;
|
$curY = $tab_top + $heightoftitleline + 1;
|
||||||
|
$nexY = $tab_top + $heightoftitleline + 1;
|
||||||
|
|
||||||
// Boucle sur les lignes
|
// Loop on each lines
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
// Description of ligne
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
|
// Description of line
|
||||||
$ref=$object->lines[$i]->ref;
|
$ref=$object->lines[$i]->ref;
|
||||||
$libelleline=$object->lines[$i]->label;
|
$libelleline=$object->lines[$i]->label;
|
||||||
$progress=$object->lines[$i]->progress.'%';
|
$progress=($object->lines[$i]->progress?$object->lines[$i]->progress.'%':'');
|
||||||
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
|
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
|
||||||
$dateend=dol_print_date($object->lines[$i]->date_end,'day');
|
$dateend=dol_print_date($object->lines[$i]->date_end,'day');
|
||||||
$planned_workload=convertSecondToTime((int) $object->lines[$i]->planned_workload,'allhourmin');
|
$planned_workload=convertSecondToTime((int) $object->lines[$i]->planned_workload,'allhourmin');
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
$pdf->startTransaction();
|
||||||
$pdf->MultiCell($this->posxlabel-$this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
|
// Label
|
||||||
$pdf->SetXY($this->posxlabel, $curY);
|
$pdf->SetXY($this->posxlabel, $curY);
|
||||||
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$pageposafter=$pageposbefore;
|
||||||
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxlabel, $curY);
|
||||||
|
$posybefore=$pdf->GetY();
|
||||||
|
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||||
|
{
|
||||||
|
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||||
|
{
|
||||||
|
$pdf->AddPage('','',true);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$pdf->setPage($pageposafter+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We found a page break
|
||||||
|
$showpricebeforepagebreak=0;
|
||||||
|
$forcedesconsamepage=1;
|
||||||
|
if ($forcedesconsamepage)
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$pageposafter=$pageposbefore;
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
|
$pdf->AddPage('','',true);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$pdf->setPage($pageposafter+1);
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||||
|
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxlabel, $curY);
|
||||||
|
$posybefore=$pdf->GetY();
|
||||||
|
$pdf->MultiCell($this->posxworkload-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak);
|
||||||
|
}
|
||||||
|
else // No pagebreak
|
||||||
|
{
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
}
|
||||||
|
$posYAfterDescription=$pdf->GetY();
|
||||||
|
|
||||||
|
$nexY = $pdf->GetY();
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$pdf->setPage($pageposbefore);
|
||||||
|
$pdf->setTopMargin($this->marge_haute);
|
||||||
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||||
|
//var_dump($pageposbefore.'-'.$pageposafter.'-'.$showpricebeforepagebreak);
|
||||||
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
|
// Ref of task
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$pdf->MultiCell($this->posxlabel-$this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
|
||||||
|
// Workload
|
||||||
$pdf->SetXY($this->posxworkload, $curY);
|
$pdf->SetXY($this->posxworkload, $curY);
|
||||||
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload, 0, 'R');
|
$pdf->MultiCell($this->posxprogress-$this->posxworkload, 3, $planned_workload?$planned_workload:'', 0, 'R');
|
||||||
|
// Progress
|
||||||
$pdf->SetXY($this->posxprogress, $curY);
|
$pdf->SetXY($this->posxprogress, $curY);
|
||||||
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
|
$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
|
||||||
|
// Date
|
||||||
$pdf->SetXY($this->posxdatestart, $curY);
|
$pdf->SetXY($this->posxdatestart, $curY);
|
||||||
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
|
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
|
||||||
$pdf->SetXY($this->posxdateend, $curY);
|
$pdf->SetXY($this->posxdateend, $curY);
|
||||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
|
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
|
||||||
|
|
||||||
$pageposafter=$pdf->getPage();
|
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
|
||||||
$nexY = $pdf->GetY();
|
|
||||||
|
|
||||||
// Add line
|
// Add line
|
||||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||||
{
|
{
|
||||||
@ -274,6 +382,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pagenb++;
|
$pagenb++;
|
||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
}
|
}
|
||||||
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||||
{
|
{
|
||||||
@ -290,44 +399,33 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show square
|
// Show square
|
||||||
if ($pagenb == 1)
|
if ($pagenb == 1)
|
||||||
{
|
|
||||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
// Pied de page
|
||||||
* Pied de page
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
*/
|
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
$pdf->Output($file,'F');
|
$pdf->Output($file, 'F');
|
||||||
|
|
||||||
// Add pdfgeneration hook
|
// Add pdfgeneration hook
|
||||||
if (! is_object($hookmanager))
|
|
||||||
{
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager=new HookManager($this->db);
|
|
||||||
}
|
|
||||||
$hookmanager->initHooks(array('pdfgeneration'));
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
@ -339,9 +437,11 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
|
{
|
||||||
return 0;
|
$this->error=$langs->transnoentities("ErrorConstantNotDefined","PROJECT_OUTPUTDIR");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -361,14 +461,17 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$heightoftitleline = 10;
|
||||||
|
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128,128,128);
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||||
|
|
||||||
// line prend une position y en 3eme param
|
// line prend une position y en 3eme param
|
||||||
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
|
$pdf->line($this->marge_gauche, $tab_top+$heightoftitleline, $this->page_largeur-$this->marge_droite, $tab_top+$heightoftitleline);
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('','', $default_font_size);
|
$pdf->SetFont('','', $default_font_size);
|
||||||
@ -390,7 +493,6 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
|
|
||||||
$pdf->SetXY($this->posxdateend, $tab_top+1);
|
$pdf->SetXY($this->posxdateend, $tab_top+1);
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -447,10 +549,18 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
$posy+=6;
|
$posy+=6;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
|
if (is_object($object->thirdparty))
|
||||||
|
{
|
||||||
|
$posy+=6;
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty->getFullName($outputlangs), '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
|
||||||
// Add list of linked objects
|
// Add list of linked objects
|
||||||
@ -476,7 +586,6 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -496,4 +605,3 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
* 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
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -48,7 +49,7 @@ if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/com
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Classe permettant de generer les projets au modele Baleine
|
* Class to manage generation of project document Baleine
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class pdf_beluga extends ModelePDFProjects
|
class pdf_beluga extends ModelePDFProjects
|
||||||
@ -98,6 +99,15 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$this->posxamountht=$this->marge_gauche+110;
|
$this->posxamountht=$this->marge_gauche+110;
|
||||||
$this->posxamountttc=$this->marge_gauche+135;
|
$this->posxamountttc=$this->marge_gauche+135;
|
||||||
$this->posxstatut=$this->marge_gauche+165;
|
$this->posxstatut=$this->marge_gauche+165;
|
||||||
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
|
{
|
||||||
|
$this->posxref-=20;
|
||||||
|
$this->posxdate-=20;
|
||||||
|
$this->posxsociete-=20;
|
||||||
|
$this->posxamountht-=20;
|
||||||
|
$this->posxamountttc-=20;
|
||||||
|
$this->posstatut-=20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -110,7 +120,7 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
*/
|
*/
|
||||||
function write_file($object,$outputlangs)
|
function write_file($object,$outputlangs)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $conf, $hookmanager, $langs, $user;
|
||||||
|
|
||||||
$formproject=new FormProjets($this->db);
|
$formproject=new FormProjets($this->db);
|
||||||
|
|
||||||
@ -154,12 +164,14 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
// Create pdf instance
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
|
$heightforinfotot = 40; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
@ -167,11 +179,22 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
}
|
}
|
||||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||||
|
// Set path to the background PDF File
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||||
|
{
|
||||||
|
$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||||
|
$tplidx = $pdf->importPage(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Complete object by loading several other informations
|
// Complete object by loading several other informations
|
||||||
$task = new Task($this->db);
|
$task = new Task($this->db);
|
||||||
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
||||||
|
|
||||||
|
if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines
|
||||||
|
{
|
||||||
|
$tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray)));
|
||||||
|
}
|
||||||
|
|
||||||
$object->lines=$tasksarray;
|
$object->lines=$tasksarray;
|
||||||
$nblignes=count($object->lines);
|
$nblignes=count($object->lines);
|
||||||
|
|
||||||
@ -190,6 +213,7 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
|
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
@ -197,21 +221,28 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 50;
|
$tab_top = 50;
|
||||||
$tab_height = 200;
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_top_newpage = 40;
|
$tab_height = 170;
|
||||||
$tab_height_newpage = 210;
|
$tab_height_newpage = 190;
|
||||||
|
|
||||||
// Affiche notes
|
// Show public note
|
||||||
if (! empty($object->note_public))
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
|
$substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-($tab_top-2);
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-2, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+2);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
@ -221,9 +252,10 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$height_note=0;
|
$height_note=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$heightoftitleline = 10;
|
||||||
$curY = $tab_top + 7;
|
$iniY = $tab_top + $heightoftitleline + 1;
|
||||||
$nexY = $tab_top + 7;
|
$curY = $tab_top + $heightoftitleline + 1;
|
||||||
|
$nexY = $tab_top + $heightoftitleline + 1;
|
||||||
|
|
||||||
$listofreferent=array(
|
$listofreferent=array(
|
||||||
'propal'=>array(
|
'propal'=>array(
|
||||||
@ -335,173 +367,283 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$langstoload=$value['lang'];
|
$langstoload=$value['lang'];
|
||||||
$langs->load($langstoload);
|
$langs->load($langstoload);
|
||||||
|
|
||||||
if ($qualified)
|
if (! $qualified) continue;
|
||||||
|
|
||||||
|
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
|
||||||
|
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
|
||||||
|
|
||||||
|
if ($key == 'agenda')
|
||||||
{
|
{
|
||||||
//var_dump("$key, $tablename, $datefieldname, $dates, $datee");
|
// var_dump($elementarray);
|
||||||
$elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee);
|
}
|
||||||
//var_dump($elementarray);
|
|
||||||
|
|
||||||
$num = count($elementarray);
|
$num = count($elementarray);
|
||||||
if ($num >= 0)
|
if ($num >= 0)
|
||||||
|
{
|
||||||
|
$nexY = $pdf->GetY() + 5;
|
||||||
|
|
||||||
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
|
||||||
|
|
||||||
|
$selectList = $formproject->select_element($tablename, $project->thirdparty->id);
|
||||||
|
$nexY = $pdf->GetY() + 1;
|
||||||
|
$curY = $nexY;
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L');
|
||||||
|
$pdf->SetXY($this->posxdate, $curY);
|
||||||
|
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C');
|
||||||
|
$pdf->SetXY($this->posxsociety, $curY);
|
||||||
|
$titlethirdparty=$outputlangs->transnoentities("ThirdParty");
|
||||||
|
if ($classname == 'ExpenseReport') $titlethirdparty=$langs->trans("User");
|
||||||
|
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $titlethirdparty, 1, 'L');
|
||||||
|
if (empty($value['disableamount'])) {
|
||||||
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
|
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHTShort"), 1, 'R');
|
||||||
|
$pdf->SetXY($this->posxamountttc, $curY);
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTCShort"), 1, 'R');
|
||||||
|
} else {
|
||||||
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
||||||
|
}
|
||||||
|
$pdf->SetXY($this->posxstatut, $curY);
|
||||||
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R');
|
||||||
|
|
||||||
|
if (is_array($elementarray) && count($elementarray) > 0)
|
||||||
{
|
{
|
||||||
$nexY = $pdf->GetY() + 5;
|
$nexY = $pdf->GetY();
|
||||||
$curY = $nexY;
|
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L');
|
|
||||||
|
|
||||||
$selectList = $formproject->select_element($tablename, $project->thirdparty->id);
|
$total_ht = 0;
|
||||||
$nexY = $pdf->GetY() + 1;
|
$total_ttc = 0;
|
||||||
$curY = $nexY;
|
$num = count($elementarray);
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
|
||||||
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L');
|
|
||||||
$pdf->SetXY($this->posxdate, $curY);
|
|
||||||
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C');
|
|
||||||
$pdf->SetXY($this->posxsociety, $curY);
|
|
||||||
$titlethirdparty=$outputlangs->transnoentities("ThirdParty");
|
|
||||||
if ($classname == 'ExpenseReport') $titlethirdparty=$langs->trans("User");
|
|
||||||
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $titlethirdparty, 1, 'L');
|
|
||||||
if (empty($value['disableamount'])) {
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
|
||||||
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHTShort"), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxamountttc, $curY);
|
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTCShort"), 1, 'R');
|
|
||||||
} else {
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
|
||||||
}
|
|
||||||
$pdf->SetXY($this->posxstatut, $curY);
|
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R');
|
|
||||||
|
|
||||||
if (is_array($elementarray) && count($elementarray) > 0)
|
// Loop on each lines
|
||||||
{
|
for ($i = 0; $i < $num; $i ++)
|
||||||
|
{
|
||||||
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
|
// Description of line
|
||||||
|
$idofelement=$elementarray[$i];
|
||||||
|
if ($classname == 'ExpenseReport')
|
||||||
|
{
|
||||||
|
// We get id of expense report
|
||||||
|
$expensereportline=new ExpenseReportLine($this->db);
|
||||||
|
$expensereportline->fetch($idofelement);
|
||||||
|
$idofelement = $expensereportline->fk_expensereport;
|
||||||
|
}
|
||||||
|
|
||||||
|
$element = new $classname($this->db);
|
||||||
|
$element->fetch($idofelement);
|
||||||
|
$element->fetch_thirdparty();
|
||||||
|
// print $classname;
|
||||||
|
|
||||||
|
$qualifiedfortotal = true;
|
||||||
|
if ($key == 'invoice') {
|
||||||
|
if ($element->close_code == 'replaced')
|
||||||
|
$qualifiedfortotal = false; // Replacement invoice
|
||||||
|
}
|
||||||
|
|
||||||
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
|
$pdf->startTransaction();
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$pageposafter=$pageposbefore;
|
||||||
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$posybefore=$pdf->GetY();
|
||||||
|
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||||
|
{
|
||||||
|
if ($i == ($num-1)) // No more lines, and no space left to show total, so we create a new page
|
||||||
|
{
|
||||||
|
$pdf->AddPage('','',true);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$pdf->setPage($pageposafter+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We found a page break
|
||||||
|
$showpricebeforepagebreak=0;
|
||||||
|
$forcedesconsamepage=1;
|
||||||
|
if ($forcedesconsamepage)
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$pageposafter=$pageposbefore;
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
|
$pdf->AddPage('','',true);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$pdf->setPage($pageposafter+1);
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||||
|
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$posybefore=$pdf->GetY();
|
||||||
|
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak);
|
||||||
|
}
|
||||||
|
else // No pagebreak
|
||||||
|
{
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
}
|
||||||
|
$posYAfterDescription=$pdf->GetY();
|
||||||
|
|
||||||
|
$nexY = $pdf->GetY();
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$pdf->setPage($pageposbefore);
|
||||||
|
$pdf->setTopMargin($this->marge_haute);
|
||||||
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||||
|
//var_dump($pageposbefore.'-'.$pageposafter.'-'.$showpricebeforepagebreak);
|
||||||
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
|
// Date
|
||||||
|
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
|
||||||
|
$date = $element->date_commande;
|
||||||
|
else {
|
||||||
|
$date = $element->date;
|
||||||
|
if (empty($date))
|
||||||
|
$date = $element->datep;
|
||||||
|
if (empty($date))
|
||||||
|
$date = $element->date_contrat;
|
||||||
|
if (empty($date))
|
||||||
|
$date = $element->datev; // Fiche inter
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxdate, $curY);
|
||||||
|
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C');
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxsociety, $curY);
|
||||||
|
if ($classname == 'ExpenseReport')
|
||||||
|
{
|
||||||
|
$fuser=new User($this->db);
|
||||||
|
$fuser->fetch($element->fk_user_author);
|
||||||
|
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, (is_object($element->thirdparty)?$element->thirdparty->name:''), 1, 'L');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Amount without tax
|
||||||
|
if (empty($value['disableamount'])) {
|
||||||
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
|
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R');
|
||||||
|
$pdf->SetXY($this->posxamountttc, $curY);
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ' '), 1, 'R');
|
||||||
|
} else {
|
||||||
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
|
if ($key == 'agenda')
|
||||||
|
{
|
||||||
|
$textforamount = dol_trunc($element->label, 26);
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, $textforamount, 1, 'L');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status
|
||||||
|
if ($element instanceof CommonInvoice) {
|
||||||
|
// This applies for Facture and FactureFournisseur
|
||||||
|
$outputstatut = $element->getLibStatut(1, $element->getSommePaiement());
|
||||||
|
} else {
|
||||||
|
$outputstatut = $element->getLibStatut(1);
|
||||||
|
}
|
||||||
|
$pdf->SetXY($this->posxstatut, $curY);
|
||||||
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true);
|
||||||
|
|
||||||
|
if ($qualifiedfortotal) {
|
||||||
|
$total_ht = $total_ht + $element->total_ht;
|
||||||
|
$total_ttc = $total_ttc + $element->total_ttc;
|
||||||
|
}
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
$total_ht = 0;
|
|
||||||
$total_ttc = 0;
|
|
||||||
$num = count($elementarray);
|
|
||||||
for ($i = 0; $i < $num; $i ++) {
|
|
||||||
$idofelement=$elementarray[$i];
|
|
||||||
if ($classname == 'ExpenseReport')
|
|
||||||
{
|
|
||||||
// We get id of expense report
|
|
||||||
$expensereportline=new ExpenseReportLine($this->db);
|
|
||||||
$expensereportline->fetch($idofelement);
|
|
||||||
$idofelement = $expensereportline->fk_expensereport;
|
|
||||||
}
|
|
||||||
|
|
||||||
$element = new $classname($this->db);
|
|
||||||
$element->fetch($idofelement);
|
|
||||||
$element->fetch_thirdparty();
|
|
||||||
// print $classname;
|
|
||||||
|
|
||||||
$qualifiedfortotal = true;
|
|
||||||
if ($key == 'invoice') {
|
|
||||||
if ($element->close_code == 'replaced')
|
|
||||||
$qualifiedfortotal = false; // Replacement invoice
|
|
||||||
}
|
|
||||||
|
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
|
||||||
$pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L');
|
|
||||||
|
|
||||||
// Date
|
|
||||||
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
|
|
||||||
$date = $element->date_commande;
|
|
||||||
else {
|
|
||||||
$date = $element->date;
|
|
||||||
if (empty($date))
|
|
||||||
$date = $element->datep;
|
|
||||||
if (empty($date))
|
|
||||||
$date = $element->date_contrat;
|
|
||||||
if (empty($date))
|
|
||||||
$date = $element->datev; // Fiche inter
|
|
||||||
}
|
|
||||||
|
|
||||||
$pdf->SetXY($this->posxdate, $curY);
|
|
||||||
$pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C');
|
|
||||||
|
|
||||||
$pdf->SetXY($this->posxsociety, $curY);
|
|
||||||
if (is_object($element->thirdparty))
|
|
||||||
{
|
|
||||||
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L');
|
|
||||||
}
|
|
||||||
elseif ($classname == 'ExpenseReport')
|
|
||||||
{
|
|
||||||
$fuser=new User($this->db);
|
|
||||||
$fuser->fetch($element->fk_user_author);
|
|
||||||
$pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $fuser->getFullName($outputlangs), 1, 'L');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Amount without tax
|
|
||||||
if (empty($value['disableamount'])) {
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
|
||||||
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($element->total_ht) : ' '), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxamountttc, $curY);
|
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($element->total_ttc) : ' '), 1, 'R');
|
|
||||||
} else {
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Status
|
|
||||||
if ($element instanceof CommonInvoice) {
|
|
||||||
// This applies for Facture and FactureFournisseur
|
|
||||||
$outputstatut = $element->getLibStatut(1, $element->getSommePaiement());
|
|
||||||
} else {
|
|
||||||
$outputstatut = $element->getLibStatut(1);
|
|
||||||
}
|
|
||||||
$pdf->SetXY($this->posxstatut, $curY);
|
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true);
|
|
||||||
|
|
||||||
if ($qualifiedfortotal) {
|
|
||||||
$total_ht = $total_ht + $element->total_ht;
|
|
||||||
$total_ttc = $total_ttc + $element->total_ttc;
|
|
||||||
}
|
|
||||||
$nexY = $pdf->GetY();
|
|
||||||
$curY = $nexY;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($value['disableamount'])) {
|
|
||||||
$curY = $nexY;
|
|
||||||
$pdf->SetXY($this->posxref, $curY);
|
|
||||||
$pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L');
|
|
||||||
$pdf->SetXY($this->posxamountht, $curY);
|
|
||||||
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ' '), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxamountttc, $curY);
|
|
||||||
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ' '), 1, 'R');
|
|
||||||
$pdf->SetXY($this->posxstatut, $curY);
|
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L');
|
|
||||||
}
|
|
||||||
$nexY = $pdf->GetY() + 5;
|
|
||||||
$curY = $nexY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($value['disableamount'])) {
|
||||||
|
$curY = $nexY;
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L');
|
||||||
|
$pdf->SetXY($this->posxamountht, $curY);
|
||||||
|
$pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, (isset($element->total_ht) ? price($total_ht) : ' '), 1, 'R');
|
||||||
|
$pdf->SetXY($this->posxamountttc, $curY);
|
||||||
|
$pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, (isset($element->total_ttc) ? price($total_ttc) : ' '), 1, 'R');
|
||||||
|
$pdf->SetXY($this->posxstatut, $curY);
|
||||||
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L');
|
||||||
|
}
|
||||||
|
$nexY = $pdf->GetY() + 5;
|
||||||
|
$curY = $nexY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
$nexY+=2; // Passe espace entre les lignes
|
||||||
* Pied de page
|
|
||||||
*/
|
// Detect if some page were added automatically and output _tableau for past pages
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
while ($pagenb < $pageposafter)
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
{
|
||||||
|
$pdf->setPage($pagenb);
|
||||||
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
|
$pagenb++;
|
||||||
|
$pdf->setPage($pagenb);
|
||||||
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pied de page
|
||||||
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
|
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
$pdf->Output($file,'F');
|
$pdf->Output($file, 'F');
|
||||||
|
|
||||||
// Add pdfgeneration hook
|
// Add pdfgeneration hook
|
||||||
if (! is_object($hookmanager))
|
|
||||||
{
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
|
||||||
$hookmanager=new HookManager($this->db);
|
|
||||||
}
|
|
||||||
$hookmanager->initHooks(array('pdfgeneration'));
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_UMASK))
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
$this->result = array('fullpath'=>$file);
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
@ -513,9 +655,11 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
$this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
|
{
|
||||||
return 0;
|
$this->error=$langs->transnoentities("ErrorConstantNotDefined","PROJECT_OUTPUTDIR");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -535,14 +679,17 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
global $conf,$mysoc;
|
global $conf,$mysoc;
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$heightoftitleline = 10;
|
||||||
|
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128,128,128);
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||||
|
|
||||||
// line prend une position y en 3eme param
|
// line prend une position y en 3eme param
|
||||||
$pdf->line($this->marge_gauche, $tab_top+6, $this->page_largeur-$this->marge_droite, $tab_top+6);
|
$pdf->line($this->marge_gauche, $tab_top+$heightoftitleline, $this->page_largeur-$this->marge_droite, $tab_top+$heightoftitleline);
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('','', $default_font_size);
|
$pdf->SetFont('','', $default_font_size);
|
||||||
@ -564,7 +711,6 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
|
|
||||||
$pdf->SetXY($this->posxdateend, $tab_top+1);
|
$pdf->SetXY($this->posxdateend, $tab_top+1);
|
||||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -621,12 +767,19 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
$posy+=6;
|
$posy+=6;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,60);
|
if (is_object($object->thirdparty))
|
||||||
|
{
|
||||||
|
$posy+=6;
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty->getFullName($outputlangs), '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -644,4 +797,5 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
|
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
608
htdocs/core/modules/project/doc/pdf_timespent.modules.php
Normal file
608
htdocs/core/modules/project/doc/pdf_timespent.modules.php
Normal file
@ -0,0 +1,608 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
* or see http://www.gnu.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/core/modules/project/doc/pdf_baleine.modules.php
|
||||||
|
* \ingroup project
|
||||||
|
* \brief File of class to generate project document Baleine
|
||||||
|
* \author Regis Houssin
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/modules_project.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class to manage generation of project document Baleine
|
||||||
|
*/
|
||||||
|
|
||||||
|
class pdf_timespent extends ModelePDFProjects
|
||||||
|
{
|
||||||
|
var $emetteur; // Objet societe qui emet
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
function __construct($db)
|
||||||
|
{
|
||||||
|
global $conf,$langs,$mysoc;
|
||||||
|
|
||||||
|
$langs->load("main");
|
||||||
|
$langs->load("projects");
|
||||||
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
$this->name = "timespent";
|
||||||
|
$this->description = $langs->trans("DocumentModelTimeSpent");
|
||||||
|
|
||||||
|
// Dimension page pour format A4
|
||||||
|
$this->type = 'pdf';
|
||||||
|
$formatarray=pdf_getFormat();
|
||||||
|
$this->page_largeur = $formatarray['width'];
|
||||||
|
$this->page_hauteur = $formatarray['height'];
|
||||||
|
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||||
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
|
$this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
|
||||||
|
|
||||||
|
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||||
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
|
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||||
|
|
||||||
|
// Recupere emmetteur
|
||||||
|
$this->emetteur=$mysoc;
|
||||||
|
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
|
||||||
|
|
||||||
|
// Defini position des colonnes
|
||||||
|
$this->posxref=$this->marge_gauche+1;
|
||||||
|
$this->posxlabel=$this->marge_gauche+25;
|
||||||
|
$this->posxtimespent=$this->marge_gauche+120;
|
||||||
|
//$this->posxprogress=$this->marge_gauche+140;
|
||||||
|
$this->posxdatestart=$this->marge_gauche+152;
|
||||||
|
$this->posxdateend=$this->marge_gauche+170;
|
||||||
|
if ($this->page_largeur < 210) // To work with US executive format
|
||||||
|
{
|
||||||
|
$this->posxref-=20;
|
||||||
|
$this->posxlabel-=20;
|
||||||
|
$this->posxtimespent-=20;
|
||||||
|
//$this->posxprogress-=20;
|
||||||
|
$this->posxdatestart-=20;
|
||||||
|
$this->posxdateend-=20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction generant le projet sur le disque
|
||||||
|
*
|
||||||
|
* @param Project $object Object project a generer
|
||||||
|
* @param Translate $outputlangs Lang output object
|
||||||
|
* @return int 1 if OK, <=0 if KO
|
||||||
|
*/
|
||||||
|
function write_file($object,$outputlangs)
|
||||||
|
{
|
||||||
|
global $conf, $hookmanager, $langs, $user;
|
||||||
|
|
||||||
|
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
|
||||||
|
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||||
|
|
||||||
|
$outputlangs->load("main");
|
||||||
|
$outputlangs->load("dict");
|
||||||
|
$outputlangs->load("companies");
|
||||||
|
$outputlangs->load("projects");
|
||||||
|
|
||||||
|
if ($conf->projet->dir_output)
|
||||||
|
{
|
||||||
|
//$nblignes = count($object->lines); // This is set later with array of tasks
|
||||||
|
|
||||||
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
|
$dir = $conf->projet->dir_output;
|
||||||
|
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
||||||
|
$file = $dir . "/" . $objectref . ".pdf";
|
||||||
|
|
||||||
|
if (! file_exists($dir))
|
||||||
|
{
|
||||||
|
if (dol_mkdir($dir) < 0)
|
||||||
|
{
|
||||||
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_exists($dir))
|
||||||
|
{
|
||||||
|
// Add pdfgeneration hook
|
||||||
|
if (! is_object($hookmanager))
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
|
$hookmanager=new HookManager($this->db);
|
||||||
|
}
|
||||||
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
|
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||||
|
global $action;
|
||||||
|
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
// Create pdf instance
|
||||||
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|
||||||
|
$heightforinfotot = 40; // Height reserved to output the info and total part
|
||||||
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|
||||||
|
if (class_exists('TCPDF'))
|
||||||
|
{
|
||||||
|
$pdf->setPrintHeader(false);
|
||||||
|
$pdf->setPrintFooter(false);
|
||||||
|
}
|
||||||
|
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||||
|
// Set path to the background PDF File
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||||
|
{
|
||||||
|
$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||||
|
$tplidx = $pdf->importPage(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Complete object by loading several other informations
|
||||||
|
$task = new Task($this->db);
|
||||||
|
$tasksarray = $task->getTasksArray(0,0,$object->id);
|
||||||
|
|
||||||
|
if (! $object->id > 0) // Special case when used with object = specimen, we may return all lines
|
||||||
|
{
|
||||||
|
$tasksarray=array_slice($tasksarray, 0, min(5, count($tasksarray)));
|
||||||
|
}
|
||||||
|
|
||||||
|
$object->lines=$tasksarray;
|
||||||
|
$nblignes=count($object->lines);
|
||||||
|
|
||||||
|
$pdf->Open();
|
||||||
|
$pagenb=0;
|
||||||
|
$pdf->SetDrawColor(128,128,128);
|
||||||
|
|
||||||
|
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||||
|
$pdf->SetSubject($outputlangs->transnoentities("Project"));
|
||||||
|
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||||
|
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||||
|
$pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project"));
|
||||||
|
if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
|
||||||
|
|
||||||
|
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||||
|
|
||||||
|
// New page
|
||||||
|
$pdf->AddPage();
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
$pagenb++;
|
||||||
|
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$tab_top = 50;
|
||||||
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
|
$tab_height = 170;
|
||||||
|
$tab_height_newpage = 190;
|
||||||
|
|
||||||
|
// Show public note
|
||||||
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
|
if ($notetoshow)
|
||||||
|
{
|
||||||
|
$substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object);
|
||||||
|
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||||
|
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||||
|
|
||||||
|
$tab_top -= 2;
|
||||||
|
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
|
$pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
|
$nexY = $pdf->GetY();
|
||||||
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
|
// Rect prend une longueur en 3eme param
|
||||||
|
$pdf->SetDrawColor(192,192,192);
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
|
$tab_height = $tab_height - $height_note;
|
||||||
|
$tab_top = $nexY+6;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$height_note=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$heightoftitleline = 10;
|
||||||
|
$iniY = $tab_top + $heightoftitleline + 1;
|
||||||
|
$curY = $tab_top + $heightoftitleline + 1;
|
||||||
|
$nexY = $tab_top + $heightoftitleline + 1;
|
||||||
|
|
||||||
|
// Loop on each lines
|
||||||
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
|
{
|
||||||
|
$curY = $nexY;
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$pdf->setTopMargin($tab_top_newpage);
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$pageposbefore=$pdf->getPage();
|
||||||
|
|
||||||
|
// Description of line
|
||||||
|
$ref=$object->lines[$i]->ref;
|
||||||
|
$libelleline=$object->lines[$i]->label;
|
||||||
|
//$progress=($object->lines[$i]->progress?$object->lines[$i]->progress.'%':'');
|
||||||
|
$datestart=dol_print_date($object->lines[$i]->date_start,'day');
|
||||||
|
$dateend=dol_print_date($object->lines[$i]->date_end,'day');
|
||||||
|
$planned_timespent=convertSecondToTime((int) $object->lines[$i]->planned_timespent,'allhourmin');
|
||||||
|
|
||||||
|
$showpricebeforepagebreak=1;
|
||||||
|
|
||||||
|
$pdf->startTransaction();
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxlabel, $curY);
|
||||||
|
$pdf->MultiCell($this->posxtimespent-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$pageposafter=$pageposbefore;
|
||||||
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxlabel, $curY);
|
||||||
|
$posybefore=$pdf->GetY();
|
||||||
|
$pdf->MultiCell($this->posxtimespent-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||||
|
{
|
||||||
|
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||||
|
{
|
||||||
|
$pdf->AddPage('','',true);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$pdf->setPage($pageposafter+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We found a page break
|
||||||
|
$showpricebeforepagebreak=0;
|
||||||
|
$forcedesconsamepage=1;
|
||||||
|
if ($forcedesconsamepage)
|
||||||
|
{
|
||||||
|
$pdf->rollbackTransaction(true);
|
||||||
|
$pageposafter=$pageposbefore;
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
|
$pdf->AddPage('','',true);
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
$pdf->setPage($pageposafter+1);
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
$curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||||
|
|
||||||
|
// Label
|
||||||
|
$pdf->SetXY($this->posxlabel, $curY);
|
||||||
|
$posybefore=$pdf->GetY();
|
||||||
|
$pdf->MultiCell($this->posxtimespent-$this->posxlabel, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$posyafter=$pdf->GetY();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//var_dump($i.' '.$posybefore.' '.$posyafter.' '.($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot)).' '.$showpricebeforepagebreak);
|
||||||
|
}
|
||||||
|
else // No pagebreak
|
||||||
|
{
|
||||||
|
$pdf->commitTransaction();
|
||||||
|
}
|
||||||
|
$posYAfterDescription=$pdf->GetY();
|
||||||
|
|
||||||
|
$nexY = $pdf->GetY();
|
||||||
|
$pageposafter=$pdf->getPage();
|
||||||
|
$pdf->setPage($pageposbefore);
|
||||||
|
$pdf->setTopMargin($this->marge_haute);
|
||||||
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
|
||||||
|
// We suppose that a too long description is moved completely on next page
|
||||||
|
if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
|
||||||
|
//var_dump($pageposbefore.'-'.$pageposafter.'-'.$showpricebeforepagebreak);
|
||||||
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
|
// Ref of task
|
||||||
|
$pdf->SetXY($this->posxref, $curY);
|
||||||
|
$pdf->MultiCell($this->posxlabel-$this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
|
||||||
|
// timespent
|
||||||
|
$pdf->SetXY($this->posxtimespent, $curY);
|
||||||
|
$pdf->MultiCell($this->posxdatestart-$this->posxtimespent, 3, $planned_timespent?$planned_timespent:'', 0, 'R');
|
||||||
|
// Progress
|
||||||
|
//$pdf->SetXY($this->posxprogress, $curY);
|
||||||
|
//$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, $progress, 0, 'R');
|
||||||
|
// Date
|
||||||
|
$pdf->SetXY($this->posxdatestart, $curY);
|
||||||
|
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $datestart, 0, 'C');
|
||||||
|
$pdf->SetXY($this->posxdateend, $curY);
|
||||||
|
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->posxdateend, 3, $dateend, 0, 'C');
|
||||||
|
|
||||||
|
// Add line
|
||||||
|
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||||
|
{
|
||||||
|
$pdf->setPage($pageposafter);
|
||||||
|
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
||||||
|
//$pdf->SetDrawColor(190,190,200);
|
||||||
|
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||||
|
$pdf->SetLineStyle(array('dash'=>0));
|
||||||
|
}
|
||||||
|
|
||||||
|
$nexY+=2; // Passe espace entre les lignes
|
||||||
|
|
||||||
|
// Detect if some page were added automatically and output _tableau for past pages
|
||||||
|
while ($pagenb < $pageposafter)
|
||||||
|
{
|
||||||
|
$pdf->setPage($pagenb);
|
||||||
|
if ($pagenb == 1)
|
||||||
|
{
|
||||||
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||||
|
}
|
||||||
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
|
$pagenb++;
|
||||||
|
$pdf->setPage($pagenb);
|
||||||
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
}
|
||||||
|
if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
|
||||||
|
{
|
||||||
|
if ($pagenb == 1)
|
||||||
|
{
|
||||||
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||||
|
}
|
||||||
|
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
||||||
|
// New page
|
||||||
|
$pdf->AddPage();
|
||||||
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
|
$pagenb++;
|
||||||
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show square
|
||||||
|
if ($pagenb == 1)
|
||||||
|
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
|
||||||
|
else
|
||||||
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
|
||||||
|
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||||
|
|
||||||
|
// Pied de page
|
||||||
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
|
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
|
$pdf->Close();
|
||||||
|
|
||||||
|
$pdf->Output($file, 'F');
|
||||||
|
|
||||||
|
// Add pdfgeneration hook
|
||||||
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
|
global $action;
|
||||||
|
$reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_UMASK))
|
||||||
|
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||||
|
|
||||||
|
$this->result = array('fullpath'=>$file);
|
||||||
|
|
||||||
|
return 1; // Pas d'erreur
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$langs->transnoentities("ErrorConstantNotDefined","PROJECT_OUTPUTDIR");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show table for lines
|
||||||
|
*
|
||||||
|
* @param PDF $pdf Object PDF
|
||||||
|
* @param string $tab_top Top position of table
|
||||||
|
* @param string $tab_height Height of table (rectangle)
|
||||||
|
* @param int $nexY Y
|
||||||
|
* @param Translate $outputlangs Langs object
|
||||||
|
* @param int $hidetop Hide top bar of array
|
||||||
|
* @param int $hidebottom Hide bottom bar of array
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
|
||||||
|
{
|
||||||
|
global $conf,$mysoc;
|
||||||
|
|
||||||
|
$heightoftitleline = 10;
|
||||||
|
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
|
$pdf->SetDrawColor(128,128,128);
|
||||||
|
|
||||||
|
// Draw rect of all tab (title + lines). Rect prend une longueur en 3eme param
|
||||||
|
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height);
|
||||||
|
|
||||||
|
// line prend une position y en 3eme param
|
||||||
|
$pdf->line($this->marge_gauche, $tab_top+$heightoftitleline, $this->page_largeur-$this->marge_droite, $tab_top+$heightoftitleline);
|
||||||
|
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
$pdf->SetFont('','', $default_font_size);
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxref, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->posxlabel-$this->posxref,3, $outputlangs->transnoentities("Tasks"),'','L');
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxlabel, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->posxtimespent-$this->posxlabel, 3, $outputlangs->transnoentities("Description"), 0, 'L');
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxtimespent, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->posxdatestart-$this->posxtimespent, 3, $outputlangs->transnoentities("TimeSpent"), 0, 'R');
|
||||||
|
|
||||||
|
//$pdf->SetXY($this->posxprogress, $tab_top+1);
|
||||||
|
//$pdf->MultiCell($this->posxdatestart-$this->posxprogress, 3, '%', 0, 'R');
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxdatestart, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->posxdateend-$this->posxdatestart, 3, $outputlangs->transnoentities("Date"), 0, 'C');
|
||||||
|
|
||||||
|
$pdf->SetXY($this->posxdateend, $tab_top+1);
|
||||||
|
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxdatestart, 3, '', 0, 'C');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show top header of page.
|
||||||
|
*
|
||||||
|
* @param PDF $pdf Object PDF
|
||||||
|
* @param Project $object Object to show
|
||||||
|
* @param int $showaddress 0=no, 1=yes
|
||||||
|
* @param Translate $outputlangs Object lang for output
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||||
|
{
|
||||||
|
global $langs,$conf,$mysoc;
|
||||||
|
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
|
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
||||||
|
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
$pdf->SetFont('','B', $default_font_size + 3);
|
||||||
|
|
||||||
|
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||||
|
$posy=$this->marge_haute;
|
||||||
|
|
||||||
|
$pdf->SetXY($this->marge_gauche,$posy);
|
||||||
|
|
||||||
|
// Logo
|
||||||
|
$logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
|
||||||
|
if ($mysoc->logo)
|
||||||
|
{
|
||||||
|
if (is_readable($logo))
|
||||||
|
{
|
||||||
|
$height=pdf_getHeightForLogo($logo);
|
||||||
|
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pdf->SetTextColor(200,0,0);
|
||||||
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
|
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
||||||
|
$pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else $pdf->MultiCell(100, 4, $outputlangs->transnoentities($this->emetteur->name), 0, 'L');
|
||||||
|
|
||||||
|
$pdf->SetFont('','B', $default_font_size + 3);
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Project")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
|
||||||
|
$pdf->SetFont('','', $default_font_size + 2);
|
||||||
|
|
||||||
|
$posy+=6;
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : " . dol_print_date($object->date_start,'day',false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
|
$posy+=6;
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
|
if (is_object($object->thirdparty))
|
||||||
|
{
|
||||||
|
$posy+=6;
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("ThirdParty")." : " . $object->thirdparty->getFullName($outputlangs), '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
|
||||||
|
// Add list of linked objects
|
||||||
|
/* Removed: A project can have more than thousands linked objects (orders, invoices, proposals, etc....
|
||||||
|
$object->fetchObjectLinked();
|
||||||
|
|
||||||
|
foreach($object->linkedObjects as $objecttype => $objects)
|
||||||
|
{
|
||||||
|
var_dump($objects);exit;
|
||||||
|
if ($objecttype == 'commande')
|
||||||
|
{
|
||||||
|
$outputlangs->load('orders');
|
||||||
|
$num=count($objects);
|
||||||
|
for ($i=0;$i<$num;$i++)
|
||||||
|
{
|
||||||
|
$posy+=4;
|
||||||
|
$pdf->SetXY($posx,$posy);
|
||||||
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
|
$text=$objects[$i]->ref;
|
||||||
|
if ($objects[$i]->ref_client) $text.=' ('.$objects[$i]->ref_client.')';
|
||||||
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefOrder")." : ".$outputlangs->transnoentities($text), '', 'R');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show footer of page. Need this->emetteur object
|
||||||
|
*
|
||||||
|
* @param PDF $pdf PDF
|
||||||
|
* @param Project $object Object to show
|
||||||
|
* @param Translate $outputlangs Object lang for output
|
||||||
|
* @param int $hidefreetext 1=Hide free text
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
||||||
|
return pdf_pagefoot($pdf,$outputlangs,'PROJECT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -109,10 +109,10 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->posxdesc=$this->marge_gauche+1;
|
$this->posxdesc=$this->marge_gauche+1;
|
||||||
if($conf->global->PRODUCT_USE_UNITS)
|
if($conf->global->PRODUCT_USE_UNITS)
|
||||||
{
|
{
|
||||||
$this->posxtva=99;
|
$this->posxtva=101;
|
||||||
$this->posxup=114;
|
$this->posxup=118;
|
||||||
$this->posxqty=130;
|
$this->posxqty=135;
|
||||||
$this->posxunit=147;
|
$this->posxunit=151;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,7 +42,7 @@ foreach($object->fields as $key => $val)
|
|||||||
if (abs($val['visible']) != 1) continue;
|
if (abs($val['visible']) != 1) continue;
|
||||||
|
|
||||||
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
|
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
|
||||||
if ($key == 'status') continue; // Status is already in dol_banner
|
if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner
|
||||||
|
|
||||||
$value=$object->$key;
|
$value=$object->$key;
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ foreach($object->fields as $key => $val)
|
|||||||
|
|
||||||
if (abs($val['visible']) != 1) continue; // Discard such field from form
|
if (abs($val['visible']) != 1) continue; // Discard such field from form
|
||||||
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
|
if (array_key_exists('enabled', $val) && isset($val['enabled']) && ! $val['enabled']) continue; // We don't want this field
|
||||||
if ($key == 'status') continue; // Status is alreadt in dol_banner
|
if (in_array($key, array('ref','status'))) continue; // Ref and status are already in dol_banner
|
||||||
|
|
||||||
$value=$object->$key;
|
$value=$object->$key;
|
||||||
|
|
||||||
|
|||||||
@ -8,32 +8,69 @@ if (empty($conf) || ! is_object($conf))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'societe', 'socpeople', ...
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
|
||||||
{
|
{
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
foreach($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
|
||||||
{
|
{
|
||||||
$align=$extrafields->getAlignFlag($key);
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
print '<td';
|
|
||||||
if ($align) print ' align="'.$align.'"';
|
|
||||||
print '>';
|
|
||||||
$tmpkey='options_'.$key;
|
|
||||||
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
|
|
||||||
{
|
{
|
||||||
$value = $db->jdate($obj->$tmpkey);
|
$align=$extrafields->getAlignFlag($key, $extrafieldsobjectkey);
|
||||||
}
|
print '<td';
|
||||||
else
|
if ($align) print ' align="'.$align.'"';
|
||||||
{
|
print '>';
|
||||||
$value = $obj->$tmpkey;
|
$tmpkey='options_'.$key;
|
||||||
}
|
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')))
|
||||||
print $extrafields->showOutputField($key, $value, '');
|
{
|
||||||
print '</td>';
|
$value = $db->jdate($obj->$tmpkey);
|
||||||
if (! $i) $totalarray['nbfield']++;
|
}
|
||||||
if (! empty($val['isameasure']))
|
else
|
||||||
{
|
{
|
||||||
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
|
$value = $obj->$tmpkey;
|
||||||
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
|
}
|
||||||
|
|
||||||
|
print $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey);
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
if (! empty($val['isameasure']))
|
||||||
|
{
|
||||||
|
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
|
||||||
|
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Old method
|
||||||
|
{
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
print '<td';
|
||||||
|
if ($align) print ' align="'.$align.'"';
|
||||||
|
print '>';
|
||||||
|
$tmpkey='options_'.$key;
|
||||||
|
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
|
||||||
|
{
|
||||||
|
$value = $db->jdate($obj->$tmpkey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$value = $obj->$tmpkey;
|
||||||
|
}
|
||||||
|
print $extrafields->showOutputField($key, $value, '');
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
if (! empty($val['isameasure']))
|
||||||
|
{
|
||||||
|
if (! $i) $totalarray['pos'][$totalarray['nbfield']]='ef.'.$tmpkey;
|
||||||
|
$totalarray['val']['ef.'.$tmpkey] += $obj->$tmpkey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,7 +131,7 @@ if (empty($reshook) && ! empty($extrafields->attributes[$object->table_element][
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $extrafields->showOutputField($key, $value);
|
print $extrafields->showOutputField($key, $value, '', (empty($extrafieldsobjectkey)?'':$extrafieldsobjectkey));
|
||||||
}
|
}
|
||||||
print '</td></tr>' . "\n";
|
print '</td></tr>' . "\n";
|
||||||
|
|
||||||
|
|||||||
@ -131,7 +131,7 @@ if ($nolinesbefore) {
|
|||||||
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||||
$coldisplay=2;
|
$coldisplay=2;
|
||||||
?>
|
?>
|
||||||
<td class="linecolnum" align="center" width="5">
|
<td class="nobottom linecolnum" align="center" width="5">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -143,48 +143,53 @@ else {
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service)
|
$freelines = false;
|
||||||
if ($object->element == 'contrat')
|
if (empty($conf->global->MAIN_DISABLE_FREE_LINES))
|
||||||
{
|
{
|
||||||
if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
|
$freelines = true;
|
||||||
else $forceall=0;
|
$forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service)
|
||||||
}
|
if ($object->element == 'contrat')
|
||||||
|
|
||||||
// Free line
|
|
||||||
echo '<span class="prod_entry_mode_free">';
|
|
||||||
// Show radio free line
|
|
||||||
if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
|
|
||||||
{
|
|
||||||
echo '<label for="prod_entry_mode_free">';
|
|
||||||
echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
|
|
||||||
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') );
|
|
||||||
echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : '');
|
|
||||||
echo '> ';
|
|
||||||
// Show type selector
|
|
||||||
echo $langs->trans("FreeLineOfType");
|
|
||||||
echo '</label>';
|
|
||||||
echo ' ';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
|
|
||||||
// Show type selector
|
|
||||||
if ($forceall >= 0)
|
|
||||||
{
|
{
|
||||||
if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type");
|
if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
|
||||||
else echo $langs->trans("FreeLineOfType");
|
else $forceall=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Free line
|
||||||
|
echo '<span class="prod_entry_mode_free">';
|
||||||
|
// Show radio free line
|
||||||
|
if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
|
||||||
|
{
|
||||||
|
echo '<label for="prod_entry_mode_free">';
|
||||||
|
echo '<input type="radio" class="prod_entry_mode_free" name="prod_entry_mode" id="prod_entry_mode_free" value="free"';
|
||||||
|
//echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : ((empty($forceall) && (empty($conf->product->enabled) || empty($conf->service->enabled)))?' checked':'') );
|
||||||
|
echo (GETPOST('prod_entry_mode')=='free' ? ' checked' : '');
|
||||||
|
echo '> ';
|
||||||
|
// Show type selector
|
||||||
|
echo $langs->trans("FreeLineOfType");
|
||||||
|
echo '</label>';
|
||||||
echo ' ';
|
echo ' ';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo '<input type="hidden" id="prod_entry_mode_free" name="prod_entry_mode" value="free">';
|
||||||
|
// Show type selector
|
||||||
|
if ($forceall >= 0)
|
||||||
|
{
|
||||||
|
if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type");
|
||||||
|
else echo $langs->trans("FreeLineOfType");
|
||||||
|
echo ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall);
|
||||||
|
|
||||||
|
echo '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall);
|
|
||||||
|
|
||||||
echo '</span>';
|
|
||||||
|
|
||||||
// Predefined product/service
|
// Predefined product/service
|
||||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
if ($forceall >= 0) echo '<br>';
|
if ($forceall >= 0 && $freelines) echo '<br>';
|
||||||
echo '<span class="prod_entry_mode_predef">';
|
echo '<span class="prod_entry_mode_predef">';
|
||||||
echo '<label for="prod_entry_mode_predef">';
|
echo '<label for="prod_entry_mode_predef">';
|
||||||
echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> ';
|
echo '<input type="radio" class="prod_entry_mode_predef" name="prod_entry_mode" id="prod_entry_mode_predef" value="predef"'.(GETPOST('prod_entry_mode')=='predef'?' checked':'').'> ';
|
||||||
@ -403,9 +408,6 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
|
|||||||
{
|
{
|
||||||
$colspan = 6;
|
$colspan = 6;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
|
||||||
$colspan++;
|
|
||||||
}
|
|
||||||
if ($this->situation_cycle_ref) {
|
if ($this->situation_cycle_ref) {
|
||||||
$colspan++;
|
$colspan++;
|
||||||
}
|
}
|
||||||
@ -447,6 +449,7 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<tr id="trlinefordates" <?php echo $bcnd[$var]; ?>>
|
<tr id="trlinefordates" <?php echo $bcnd[$var]; ?>>
|
||||||
|
<?php if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; } ?>
|
||||||
<td colspan="<?php echo $colspan; ?>">
|
<td colspan="<?php echo $colspan; ?>">
|
||||||
<?php
|
<?php
|
||||||
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
$date_start=dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
|
||||||
@ -593,6 +596,13 @@ jQuery(document).ready(function() {
|
|||||||
jQuery('#trlinefordates').show();
|
jQuery('#trlinefordates').show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if(!$freelines) { ?>
|
||||||
|
$("#prod_entry_mode_predef").click();
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
/* 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()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
// Test if event/record is qualified
|
// Test if event/record is qualified
|
||||||
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription');
|
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription','payment_various');
|
||||||
if (! in_array($object->element, $listofqualifiedelement)) return 1;
|
if (! in_array($object->element, $listofqualifiedelement)) return 1;
|
||||||
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
@ -120,9 +120,10 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
|
|
||||||
$res = $b->create($user);
|
$res = $b->create($user);
|
||||||
|
|
||||||
if ($res<0)
|
if ($res < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($b->error, $b->errors, 'errors');
|
$this->error = $b->error;
|
||||||
|
$this->errors = $b->errors;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -697,11 +697,13 @@ class Export
|
|||||||
$sql.= 'label,';
|
$sql.= 'label,';
|
||||||
$sql.= 'type,';
|
$sql.= 'type,';
|
||||||
$sql.= 'field,';
|
$sql.= 'field,';
|
||||||
|
$sql.= 'fk_user,';
|
||||||
$sql.= 'filter';
|
$sql.= 'filter';
|
||||||
$sql.= ') VALUES (';
|
$sql.= ') VALUES (';
|
||||||
$sql.= "'".$this->db->escape($this->model_name)."',";
|
$sql.= "'".$this->db->escape($this->model_name)."',";
|
||||||
$sql.= "'".$this->db->escape($this->datatoexport)."',";
|
$sql.= "'".$this->db->escape($this->datatoexport)."',";
|
||||||
$sql.= "'".$this->db->escape($this->hexa)."',";
|
$sql.= "'".$this->db->escape($this->hexa)."',";
|
||||||
|
$sql.= "'".$user->id."',";
|
||||||
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
|
$sql.= "'".$this->db->escape($this->hexafiltervalue)."'";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
|
|||||||
@ -551,7 +551,8 @@ if ($step == 2 && $datatoexport)
|
|||||||
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
|
print '<input type="hidden" name="datatoexport" value="'.$datatoexport.'">';
|
||||||
print '<table><tr><td colspan="2">';
|
print '<table><tr><td colspan="2">';
|
||||||
print $langs->trans("SelectExportFields").' ';
|
print $langs->trans("SelectExportFields").' ';
|
||||||
$htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1);
|
if(empty($conf->global->EXPORTS_SHARE_MODELS))$htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1,$user->id);
|
||||||
|
else $htmlother->select_export_model($exportmodelid,'exportmodelid',$datatoexport,1);
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@ -1082,6 +1083,7 @@ if ($step == 4 && $datatoexport)
|
|||||||
$sql = "SELECT rowid, label";
|
$sql = "SELECT rowid, label";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
|
||||||
$sql.= " WHERE type = '".$datatoexport."'";
|
$sql.= " WHERE type = '".$datatoexport."'";
|
||||||
|
if(empty($conf->global->EXPORTS_SHARE_MODELS))$sql.=" AND fk_user=".$user->id;
|
||||||
$sql.= " ORDER BY rowid";
|
$sql.= " ORDER BY rowid";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
424
htdocs/fichinter/class/api_interventions.class.php
Normal file
424
htdocs/fichinter/class/api_interventions.class.php
Normal file
@ -0,0 +1,424 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Luracast\Restler\RestException;
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API class for fichinters
|
||||||
|
*
|
||||||
|
* @access protected
|
||||||
|
* @class DolibarrApiAccess {@requires user,external}
|
||||||
|
*/
|
||||||
|
class Interventions extends DolibarrApi
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||||
|
*/
|
||||||
|
static $FIELDS = array(
|
||||||
|
'socid',
|
||||||
|
'fk_project',
|
||||||
|
'description'
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||||
|
*/
|
||||||
|
static $FIELDSLINE = array(
|
||||||
|
'description',
|
||||||
|
'date',
|
||||||
|
'duree'
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var fichinter $fichinter {@type fichinter}
|
||||||
|
*/
|
||||||
|
public $fichinter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*/
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
global $db, $conf;
|
||||||
|
$this->db = $db;
|
||||||
|
$this->fichinter = new Fichinter($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get properties of a Expense Report object
|
||||||
|
*
|
||||||
|
* Return an array with Expense Report informations
|
||||||
|
*
|
||||||
|
* @param int $id ID of Expense Report
|
||||||
|
* @return array|mixed Data without useless information
|
||||||
|
*
|
||||||
|
* @throws RestException
|
||||||
|
*/
|
||||||
|
function get($id)
|
||||||
|
{
|
||||||
|
if(! DolibarrApiAccess::$user->rights->ficheinter->lire) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->fichinter->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Intervention report not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fichinter->fetchObjectLinked();
|
||||||
|
return $this->_cleanObjectDatas($this->fichinter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of interventions
|
||||||
|
*
|
||||||
|
* Return a list of interventions
|
||||||
|
*
|
||||||
|
* @param string $sortfield Sort field
|
||||||
|
* @param string $sortorder Sort order
|
||||||
|
* @param int $limit Limit for list
|
||||||
|
* @param int $page Page number
|
||||||
|
* @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i}
|
||||||
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||||
|
* @return array Array of order objects
|
||||||
|
*
|
||||||
|
* @throws RestException
|
||||||
|
*/
|
||||||
|
function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
|
||||||
|
global $db, $conf;
|
||||||
|
|
||||||
|
$obj_ret = array();
|
||||||
|
|
||||||
|
// case of external user, $thirdparty_ids param is ignored and replaced by user's socid
|
||||||
|
$socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids;
|
||||||
|
|
||||||
|
// If the internal user must only see his customers, force searching by him
|
||||||
|
$search_sale = 0;
|
||||||
|
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id;
|
||||||
|
|
||||||
|
$sql = "SELECT t.rowid";
|
||||||
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as t";
|
||||||
|
|
||||||
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
|
||||||
|
|
||||||
|
$sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')';
|
||||||
|
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
|
||||||
|
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
|
||||||
|
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
|
||||||
|
// Insert sale filter
|
||||||
|
if ($search_sale > 0)
|
||||||
|
{
|
||||||
|
$sql .= " AND sc.fk_user = ".$search_sale;
|
||||||
|
}
|
||||||
|
// Add sql filters
|
||||||
|
if ($sqlfilters)
|
||||||
|
{
|
||||||
|
if (! DolibarrApi::_checkFilters($sqlfilters))
|
||||||
|
{
|
||||||
|
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
|
||||||
|
}
|
||||||
|
$regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||||
|
$sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
|
if ($limit) {
|
||||||
|
if ($page < 0)
|
||||||
|
{
|
||||||
|
$page = 0;
|
||||||
|
}
|
||||||
|
$offset = $limit * $page;
|
||||||
|
|
||||||
|
$sql.= $db->plimit($limit + 1, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog("API Rest request");
|
||||||
|
$result = $db->query($sql);
|
||||||
|
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||||
|
while ($i < $min)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
|
$fichinter_static = new Fichinter($db);
|
||||||
|
if($fichinter_static->fetch($obj->rowid)) {
|
||||||
|
$obj_ret[] = $this->_cleanObjectDatas($fichinter_static);
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new RestException(503, 'Error when retrieve fichinter list : '.$db->lasterror());
|
||||||
|
}
|
||||||
|
if( ! count($obj_ret)) {
|
||||||
|
throw new RestException(404, 'No finchinter found');
|
||||||
|
}
|
||||||
|
return $obj_ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create intervention object
|
||||||
|
*
|
||||||
|
* @param array $request_data Request data
|
||||||
|
* @return int ID of intervention
|
||||||
|
*/
|
||||||
|
function post($request_data = NULL)
|
||||||
|
{
|
||||||
|
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||||
|
throw new RestException(401, "Insuffisant rights");
|
||||||
|
}
|
||||||
|
// Check mandatory fields
|
||||||
|
$result = $this->_validate($request_data);
|
||||||
|
foreach($request_data as $field => $value) {
|
||||||
|
$this->fichinter->$field = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->fichinter->create(DolibarrApiAccess::$user) < 0) {
|
||||||
|
throw new RestException(500, "Error creating fichinter", array_merge(array($this->fichinter->error), $this->fichinter->errors));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->fichinter->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get lines of an intervention
|
||||||
|
*
|
||||||
|
* @param int $id Id of intervention
|
||||||
|
*
|
||||||
|
* @url GET {id}/lines
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
/* TODO
|
||||||
|
function getLines($id) {
|
||||||
|
if(! DolibarrApiAccess::$user->rights->ficheinter->lire) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->fichinter->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Intervention not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
$this->fichinter->getLinesArray();
|
||||||
|
$result = array();
|
||||||
|
foreach ($this->fichinter->lines as $line) {
|
||||||
|
array_push($result,$this->_cleanObjectDatas($line));
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a line to given intervention
|
||||||
|
*
|
||||||
|
* @param int $id Id of intervention to update
|
||||||
|
* @param array $request_data Request data
|
||||||
|
*
|
||||||
|
* @url POST {id}/lines
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
function postLine($id, $request_data = NULL)
|
||||||
|
{
|
||||||
|
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||||
|
throw new RestException(401, "Insuffisant rights");
|
||||||
|
}
|
||||||
|
// Check mandatory fields
|
||||||
|
$result = $this->_validateLine($request_data);
|
||||||
|
|
||||||
|
foreach($request_data as $field => $value) {
|
||||||
|
$this->fichinter->$field = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Intervention not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
|
||||||
|
$updateRes = $this->fichinter->addLine(
|
||||||
|
DolibarrApiAccess::$user,
|
||||||
|
$id,
|
||||||
|
$this->fichinter->description,
|
||||||
|
$this->fichinter->date,
|
||||||
|
$this->fichinter->duree
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($updateRes > 0) {
|
||||||
|
return $updateRes;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new RestException(400, $this->fichinter->error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate an intervention
|
||||||
|
*
|
||||||
|
* If you get a bad value for param notrigger check, provide this in body
|
||||||
|
* {
|
||||||
|
* "notrigger": 0
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* @param int $id Intervention ID
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
|
*
|
||||||
|
* @url POST {id}/validate
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function validate($id, $notrigger=0)
|
||||||
|
{
|
||||||
|
if(! DolibarrApiAccess::$user->rights->ficheinter->creer) {
|
||||||
|
throw new RestException(401, "Insuffisant rights");
|
||||||
|
}
|
||||||
|
$result = $this->fichinter->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Intervention not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->fichinter->setValid(DolibarrApiAccess::$user, $notrigger);
|
||||||
|
if ($result == 0) {
|
||||||
|
throw new RestException(304, 'Error nothing done. May be object is already validated');
|
||||||
|
}
|
||||||
|
if ($result < 0) {
|
||||||
|
throw new RestException(500, 'Error when validating Intervention: '.$this->commande->error);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fichinter->fetchObjectLinked();
|
||||||
|
|
||||||
|
return $this->_cleanObjectDatas($this->fichinter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close an intervention
|
||||||
|
*
|
||||||
|
* @param int $id Intervention ID
|
||||||
|
*
|
||||||
|
* @url POST {id}/close
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function closeFichinter($id)
|
||||||
|
{
|
||||||
|
if(! DolibarrApiAccess::$user->rights->ficheinter->creer)
|
||||||
|
{
|
||||||
|
throw new RestException(401, "Insuffisant rights");
|
||||||
|
}
|
||||||
|
$result = $this->fichinter->fetch($id);
|
||||||
|
if (! $result) {
|
||||||
|
throw new RestException(404, 'Intervention not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->fichinter->setStatut(3);
|
||||||
|
|
||||||
|
if ($result == 0) {
|
||||||
|
throw new RestException(304, 'Error nothing done. May be object is already closed');
|
||||||
|
}
|
||||||
|
if ($result < 0) {
|
||||||
|
throw new RestException(500, 'Error when closing Intervention: '.$this->fichinter->error);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->fichinter->fetchObjectLinked();
|
||||||
|
|
||||||
|
return $this->_cleanObjectDatas($this->fichinter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate fields before create or update object
|
||||||
|
*
|
||||||
|
* @param array $data Data to validate
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* @throws RestException
|
||||||
|
*/
|
||||||
|
function _validate($data)
|
||||||
|
{
|
||||||
|
$fichinter = array();
|
||||||
|
foreach (Interventions::$FIELDS as $field) {
|
||||||
|
if (!isset($data[$field]))
|
||||||
|
throw new RestException(400, "$field field missing");
|
||||||
|
$fichinter[$field] = $data[$field];
|
||||||
|
}
|
||||||
|
return $fichinter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clean sensible object datas
|
||||||
|
*
|
||||||
|
* @param object $object Object to clean
|
||||||
|
* @return array Array of cleaned object properties
|
||||||
|
*/
|
||||||
|
function _cleanObjectDatas($object) {
|
||||||
|
|
||||||
|
$object = parent::_cleanObjectDatas($object);
|
||||||
|
|
||||||
|
unset($object->statuts_short);
|
||||||
|
unset($object->statuts_logo);
|
||||||
|
unset($object->statuts);
|
||||||
|
|
||||||
|
return $object;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validate fields before create or update object
|
||||||
|
*
|
||||||
|
* @param array $data Data to validate
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* @throws RestException
|
||||||
|
*/
|
||||||
|
function _validateLine($data)
|
||||||
|
{
|
||||||
|
$fichinter = array();
|
||||||
|
foreach (Interventions::$FIELDSLINE as $field) {
|
||||||
|
if (!isset($data[$field]))
|
||||||
|
throw new RestException(400, "$field field missing");
|
||||||
|
$fichinter[$field] = $data[$field];
|
||||||
|
}
|
||||||
|
return $fichinter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -128,7 +128,7 @@ class Fichinter extends CommonObject
|
|||||||
$sql.= " WHERE sc.fk_user = " .$user->id;
|
$sql.= " WHERE sc.fk_user = " .$user->id;
|
||||||
$clause = "AND";
|
$clause = "AND";
|
||||||
}
|
}
|
||||||
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element, 1).")";
|
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -157,7 +157,7 @@ class Fichinter extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function create($user, $notrigger=0)
|
function create($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
global $conf, $user, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create ref=".$this->ref);
|
dol_syslog(get_class($this)."::create ref=".$this->ref);
|
||||||
|
|
||||||
|
|||||||
@ -101,6 +101,21 @@ if (empty($reshook))
|
|||||||
$result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int'));
|
$result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int'));
|
||||||
if ($result < 0) dol_print_error($db,$object->error);
|
if ($result < 0) dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
if ($action == 'update_extras') {
|
||||||
|
$object->fetch($id);
|
||||||
|
|
||||||
|
// Fill array 'array_options' with data from update form
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute'));
|
||||||
|
|
||||||
|
if ($ret < 0) $error++;
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$result = $object->insertExtraFields();
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
}
|
||||||
|
if ($error) $action = 'edit_extras';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -779,7 +794,7 @@ if ($object->id > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_REPEATCONTACTONEACHTAB))
|
if (! empty($conf->global->MAIN_DUPLICATE_CONTACTS_TAB_ON_MAIN_CARD))
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
// List of contacts
|
// List of contacts
|
||||||
|
|||||||
@ -210,11 +210,12 @@ class PaiementFourn extends Paiement
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
$invoice=new FactureFournisseur($this->db);
|
||||||
|
$invoice->fetch($facid);
|
||||||
|
|
||||||
// If we want to closed payed invoices
|
// If we want to closed payed invoices
|
||||||
if ($closepaidinvoices)
|
if ($closepaidinvoices)
|
||||||
{
|
{
|
||||||
$invoice=new FactureFournisseur($this->db);
|
|
||||||
$invoice->fetch($facid);
|
|
||||||
$paiement = $invoice->getSommePaiement();
|
$paiement = $invoice->getSommePaiement();
|
||||||
//$creditnotes=$invoice->getSumCreditNotesUsed();
|
//$creditnotes=$invoice->getSumCreditNotesUsed();
|
||||||
$creditnotes=0;
|
$creditnotes=0;
|
||||||
@ -228,17 +229,34 @@ class PaiementFourn extends Paiement
|
|||||||
}
|
}
|
||||||
else dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing.");
|
else dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regenerate documents of invoices
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||||
|
{
|
||||||
|
$outputlangs = $langs;
|
||||||
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $invoice->thirdparty->default_lang;
|
||||||
|
if (! empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
}
|
||||||
|
$ret = $invoice->fetch($facid); // Reload to get new records
|
||||||
|
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid);
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog('PaiementFourn::Create Montant non numerique',LOG_ERR);
|
dol_syslog(get_class($this).'::Create Amount line '.$key.' not a number. We discard it.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -22,5 +22,12 @@
|
|||||||
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
|
||||||
-- Note: fields with type BLOB/TEXT can't have default value.
|
-- Note: fields with type BLOB/TEXT can't have default value.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- For 8.0
|
-- For 8.0
|
||||||
|
|
||||||
ALTER TABLE llx_societe ADD COLUMN fk_entrepot integer DEFAULT 0;
|
ALTER TABLE llx_societe ADD COLUMN fk_entrepot integer DEFAULT 0;
|
||||||
|
|
||||||
|
ALTER TABLE llx_projet ADD COLUMN bill_time integer DEFAULT 0;
|
||||||
@ -39,26 +39,26 @@ create table llx_commandedet
|
|||||||
remise real DEFAULT 0, -- montant de la remise
|
remise real DEFAULT 0, -- montant de la remise
|
||||||
fk_remise_except integer NULL, -- Lien vers table des remises fixes
|
fk_remise_except integer NULL, -- Lien vers table des remises fixes
|
||||||
price real, -- prix final
|
price real, -- prix final
|
||||||
subprice double(24,8) DEFAULT 0, -- P.U. HT (exemple 100)
|
subprice double(24,8) DEFAULT 0, -- P.U. HT (exemple 100)
|
||||||
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale
|
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantite et incluant remise ligne et globale
|
||||||
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
|
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
|
||||||
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1
|
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1
|
||||||
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2
|
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2
|
||||||
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
|
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
|
||||||
product_type integer DEFAULT 0,
|
product_type integer DEFAULT 0, -- 0 or 1. Value 9 may be used by some modules (amount of line may not be included into generated discount if value is 9).
|
||||||
date_start datetime DEFAULT NULL, -- date debut si service
|
date_start datetime DEFAULT NULL, -- date debut si service
|
||||||
date_end datetime DEFAULT NULL, -- date fin si service
|
date_end datetime DEFAULT NULL, -- date fin si service
|
||||||
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
||||||
|
|
||||||
buy_price_ht double(24,8) DEFAULT 0, -- buying price
|
buy_price_ht double(24,8) DEFAULT 0, -- buying price
|
||||||
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
|
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
|
||||||
|
|
||||||
special_code integer DEFAULT 0, -- code pour les lignes speciales
|
special_code integer DEFAULT 0, -- code for special lines (may be 1=transport, 2=ecotax, 3=option, moduleid=...)
|
||||||
rang integer DEFAULT 0,
|
rang integer DEFAULT 0,
|
||||||
fk_unit integer DEFAULT NULL, -- lien vers table des unités
|
fk_unit integer DEFAULT NULL, -- lien vers table des unités
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
|
|
||||||
fk_commandefourndet integer DEFAULT NULL, -- link to detail line of commande fourn (resplenish)
|
fk_commandefourndet integer DEFAULT NULL, -- link to detail line of commande fourn (resplenish)
|
||||||
|
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
multicurrency_code varchar(255),
|
multicurrency_code varchar(255),
|
||||||
|
|||||||
@ -47,7 +47,7 @@ create table llx_facturedet
|
|||||||
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line
|
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line
|
||||||
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2 for total quantity of line
|
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2 for total quantity of line
|
||||||
total_ttc double(24,8), -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
|
total_ttc double(24,8), -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
|
||||||
product_type integer DEFAULT 0,
|
product_type integer DEFAULT 0, -- 0 or 1. Value 9 may be used by some modules (amount of line may not be included into generated discount if value is 9).
|
||||||
date_start datetime DEFAULT NULL, -- date start if service
|
date_start datetime DEFAULT NULL, -- date start if service
|
||||||
date_end datetime DEFAULT NULL, -- date end if service
|
date_end datetime DEFAULT NULL, -- date end if service
|
||||||
info_bits integer DEFAULT 0, -- VAT NPR or not (for france only)
|
info_bits integer DEFAULT 0, -- VAT NPR or not (for france only)
|
||||||
@ -57,7 +57,7 @@ create table llx_facturedet
|
|||||||
|
|
||||||
fk_code_ventilation integer DEFAULT 0 NOT NULL, -- Id in table llx_accounting_bookeeping to know accounting account for product line
|
fk_code_ventilation integer DEFAULT 0 NOT NULL, -- Id in table llx_accounting_bookeeping to know accounting account for product line
|
||||||
|
|
||||||
special_code integer DEFAULT 0, -- code pour les lignes speciales
|
special_code integer DEFAULT 0, -- code for special lines (may be 1=transport, 2=ecotax, 3=option, moduleid=...)
|
||||||
rang integer DEFAULT 0, -- position of line
|
rang integer DEFAULT 0, -- position of line
|
||||||
fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines
|
fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
|
|||||||
@ -42,6 +42,7 @@ create table llx_projet
|
|||||||
--budget_days real, -- budget in days is sum of field planned_workload of tasks
|
--budget_days real, -- budget in days is sum of field planned_workload of tasks
|
||||||
opp_amount double(24,8),
|
opp_amount double(24,8),
|
||||||
budget_amount double(24,8),
|
budget_amount double(24,8),
|
||||||
|
bill_time integer DEFAULT 0, -- Set to 1 if time spent must be converted into invoices
|
||||||
model_pdf varchar(255),
|
model_pdf varchar(255),
|
||||||
import_key varchar(14) -- Import key
|
import_key varchar(14) -- Import key
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -44,7 +44,7 @@ create table llx_propaldet
|
|||||||
total_localtax1 double(24,8) DEFAULT 0, -- Total localtax1
|
total_localtax1 double(24,8) DEFAULT 0, -- Total localtax1
|
||||||
total_localtax2 double(24,8) DEFAULT 0, -- Total localtax2
|
total_localtax2 double(24,8) DEFAULT 0, -- Total localtax2
|
||||||
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
|
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
|
||||||
product_type integer DEFAULT 0,
|
product_type integer DEFAULT 0, -- 0 or 1. Value 9 may be used by some modules (amount of line may not be included into generated discount if value is 9).
|
||||||
date_start datetime DEFAULT NULL, -- date debut si service
|
date_start datetime DEFAULT NULL, -- date debut si service
|
||||||
date_end datetime DEFAULT NULL, -- date fin si service
|
date_end datetime DEFAULT NULL, -- date fin si service
|
||||||
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
||||||
@ -52,8 +52,8 @@ create table llx_propaldet
|
|||||||
buy_price_ht double(24,8) DEFAULT 0, -- buying price
|
buy_price_ht double(24,8) DEFAULT 0, -- buying price
|
||||||
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
|
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
|
||||||
|
|
||||||
special_code integer DEFAULT 0, -- code pour les lignes speciales
|
special_code integer DEFAULT 0, -- code for special lines (may be 1=transport, 2=ecotax, 3=option, moduleid=...)
|
||||||
rang integer DEFAULT 0, -- ordre affichage sur la propal
|
rang integer DEFAULT 0, -- ordre affichage sur la propal
|
||||||
fk_unit integer DEFAULT NULL, -- lien vers table des unités
|
fk_unit integer DEFAULT NULL, -- lien vers table des unités
|
||||||
|
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
|
|||||||
@ -33,8 +33,6 @@ create table llx_societe
|
|||||||
|
|
||||||
statut tinyint DEFAULT 0, -- statut
|
statut tinyint DEFAULT 0, -- statut
|
||||||
parent integer,
|
parent integer,
|
||||||
tms timestamp,
|
|
||||||
datec datetime, -- creation date
|
|
||||||
|
|
||||||
status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité)
|
status tinyint DEFAULT 1, -- cessation d'activité ( 1 -- en activité, 0 -- cessation d'activité)
|
||||||
|
|
||||||
@ -57,15 +55,15 @@ create table llx_societe
|
|||||||
fk_typent integer DEFAULT 0, --
|
fk_typent integer DEFAULT 0, --
|
||||||
fk_forme_juridique integer DEFAULT 0, -- juridical status
|
fk_forme_juridique integer DEFAULT 0, -- juridical status
|
||||||
fk_currency varchar(3), -- default currency
|
fk_currency varchar(3), -- default currency
|
||||||
siren varchar(128), -- IDProf1: siren or RCS for france
|
siren varchar(128), -- IDProf1: siren or RCS for france, ...
|
||||||
siret varchar(128), -- IDProf2: siret for france
|
siret varchar(128), -- IDProf2: siret for france, ...
|
||||||
ape varchar(128), -- IDProf3: code ape for france
|
ape varchar(128), -- IDProf3: code ape for france, ...
|
||||||
idprof4 varchar(128), -- IDProf4: nu for france
|
idprof4 varchar(128), -- IDProf4: nu for france
|
||||||
idprof5 varchar(128), -- IDProf5: nu for france
|
idprof5 varchar(128), -- IDProf5: nu for france
|
||||||
idprof6 varchar(128), -- IDProf6: nu for france
|
idprof6 varchar(128), -- IDProf6: nu for france
|
||||||
tva_intra varchar(20), -- tva
|
tva_intra varchar(20), -- tva
|
||||||
capital double(24,8), -- capital de la societe
|
capital double(24,8) DEFAULT NULL, -- capital de la societe
|
||||||
fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
|
fk_stcomm integer DEFAULT 0 NOT NULL, -- commercial statut
|
||||||
note_private text, --
|
note_private text, --
|
||||||
note_public text, --
|
note_public text, --
|
||||||
model_pdf varchar(255),
|
model_pdf varchar(255),
|
||||||
@ -79,8 +77,6 @@ create table llx_societe
|
|||||||
customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1
|
customer_bad tinyint DEFAULT 0, -- mauvais payeur 0/1
|
||||||
customer_rate real DEFAULT 0, -- taux fiabilite client (0 a 1)
|
customer_rate real DEFAULT 0, -- taux fiabilite client (0 a 1)
|
||||||
supplier_rate real DEFAULT 0, -- taux fiabilite fournisseur (0 a 1)
|
supplier_rate real DEFAULT 0, -- taux fiabilite fournisseur (0 a 1)
|
||||||
fk_user_creat integer NULL, -- utilisateur qui a cree l'info
|
|
||||||
fk_user_modif integer, -- utilisateur qui a modifie l'info
|
|
||||||
remise_client real DEFAULT 0, -- remise systematique pour le client
|
remise_client real DEFAULT 0, -- remise systematique pour le client
|
||||||
mode_reglement tinyint, -- mode de reglement
|
mode_reglement tinyint, -- mode de reglement
|
||||||
cond_reglement tinyint, -- condition de reglement
|
cond_reglement tinyint, -- condition de reglement
|
||||||
@ -99,10 +95,17 @@ create table llx_societe
|
|||||||
default_lang varchar(6), -- default language
|
default_lang varchar(6), -- default language
|
||||||
logo varchar(255) DEFAULT NULL,
|
logo varchar(255) DEFAULT NULL,
|
||||||
canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default)
|
canvas varchar(32) DEFAULT NULL, -- type of canvas if used (null by default)
|
||||||
import_key varchar(14), -- import key
|
fk_entrepot integer DEFAULT 0, -- if we need a link between third party and warehouse
|
||||||
webservices_url varchar(255), -- supplier webservice url
|
webservices_url varchar(255), -- supplier webservice url
|
||||||
webservices_key varchar(128), -- supplier webservice key
|
webservices_key varchar(128), -- supplier webservice key
|
||||||
|
|
||||||
fk_multicurrency integer,
|
tms timestamp, -- last modification date
|
||||||
multicurrency_code varchar(255)
|
datec datetime, -- creation date
|
||||||
|
fk_user_creat integer NULL, -- utilisateur qui a cree l'info
|
||||||
|
fk_user_modif integer, -- utilisateur qui a modifie l'info
|
||||||
|
|
||||||
|
fk_multicurrency integer,
|
||||||
|
multicurrency_code varchar(255),
|
||||||
|
|
||||||
|
import_key varchar(14) -- import key
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -269,9 +269,10 @@ MAIN_MAIL_SMTP_SERVER=SMTP/SMTPS Host (By default in php.ini: <b>%s</b>)
|
|||||||
MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems)
|
MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=SMTP/SMTPS Port (Not defined into PHP on Unix like systems)
|
||||||
MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems)
|
MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=SMTP/SMTPS Host (Not defined into PHP on Unix like systems)
|
||||||
MAIN_MAIL_EMAIL_FROM=Sender email for automatic emails (By default in php.ini: <b>%s</b>)
|
MAIN_MAIL_EMAIL_FROM=Sender email for automatic emails (By default in php.ini: <b>%s</b>)
|
||||||
MAIN_MAIL_ERRORS_TO=Sender email used for error returns emails sent
|
MAIN_MAIL_ERRORS_TO=Email used as 'Errors-To' field in emails sent
|
||||||
MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to
|
MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to
|
||||||
MAIN_DISABLE_ALL_MAILS=Disable all emails sendings (for test purposes or demos)
|
MAIN_DISABLE_ALL_MAILS=Disable all emails sendings (for test purposes or demos)
|
||||||
|
MAIN_MAIL_FORCE_SENDTO=Send all emails to (instead of real recipients, for test purposes)
|
||||||
MAIN_MAIL_SENDMODE=Method to use to send EMails
|
MAIN_MAIL_SENDMODE=Method to use to send EMails
|
||||||
MAIN_MAIL_SMTPS_ID=SMTP ID if authentication required
|
MAIN_MAIL_SMTPS_ID=SMTP ID if authentication required
|
||||||
MAIN_MAIL_SMTPS_PW=SMTP Password if authentication required
|
MAIN_MAIL_SMTPS_PW=SMTP Password if authentication required
|
||||||
@ -415,7 +416,7 @@ ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (
|
|||||||
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||||
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>- idfilter is necessarly a primary int key<br>- filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>- idfilter is necessarly a primary int key<br>- filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||||
ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||||
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Example : Societe:societe/class/societe.class.php
|
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Examples :<br>Societe:societe/class/societe.class.php<br>Contact:contact/class/contact.class.php
|
||||||
LibraryToBuildPDF=Library used for PDF generation
|
LibraryToBuildPDF=Library used for PDF generation
|
||||||
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
|
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
|
||||||
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)<br>2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)<br>3 : local tax apply on products without vat (localtax is calculated on amount without tax)<br>4 : local tax apply on products including vat (localtax is calculated on amount + main vat)<br>5 : local tax apply on services without vat (localtax is calculated on amount without tax)<br>6 : local tax apply on services including vat (localtax is calculated on amount + tax)
|
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (localtax is calculated on amount without tax)<br>2 : local tax apply on products and services including vat (localtax is calculated on amount + main tax)<br>3 : local tax apply on products without vat (localtax is calculated on amount without tax)<br>4 : local tax apply on products including vat (localtax is calculated on amount + main vat)<br>5 : local tax apply on services without vat (localtax is calculated on amount without tax)<br>6 : local tax apply on services including vat (localtax is calculated on amount + tax)
|
||||||
|
|||||||
@ -14,6 +14,9 @@ OkCheckFingerprintValidityButChainIsKo=Archived log seems valid compared to prev
|
|||||||
AddedByAuthority=Stored into remote authority
|
AddedByAuthority=Stored into remote authority
|
||||||
NotAddedByAuthorityYet=Not yet stored into remote authority
|
NotAddedByAuthorityYet=Not yet stored into remote authority
|
||||||
ShowDetails=Show stored details
|
ShowDetails=Show stored details
|
||||||
|
logPAYMENT_VARIOUS_CREATE=Payment (not assigned to invoice) created
|
||||||
|
logPAYMENT_VARIOUS_MODIFY=Payment (not assigned to invoice) modified
|
||||||
|
logPAYMENT_VARIOUS_DELETE=Payment (not assigned to invoice) logical deletion
|
||||||
logPAYMENT_ADD_TO_BANK=Payment added to bank
|
logPAYMENT_ADD_TO_BANK=Payment added to bank
|
||||||
logPAYMENT_CUSTOMER_CREATE=Customer payment created
|
logPAYMENT_CUSTOMER_CREATE=Customer payment created
|
||||||
logPAYMENT_CUSTOMER_DELETE=Customer payment logical deletion
|
logPAYMENT_CUSTOMER_DELETE=Customer payment logical deletion
|
||||||
@ -41,7 +44,7 @@ DownloadLogCSV=Export archived logs (CSV)
|
|||||||
logDOC_PREVIEW=Preview of a validated document in order to print or download
|
logDOC_PREVIEW=Preview of a validated document in order to print or download
|
||||||
logDOC_DOWNLOAD=Download of a validated document in order to print or send
|
logDOC_DOWNLOAD=Download of a validated document in order to print or send
|
||||||
DataOfArchivedEvent=Full datas of archived event
|
DataOfArchivedEvent=Full datas of archived event
|
||||||
ImpossibleToReloadObject=Object (type %s, id %s) removed (see 'Full data' link for unerasable saved data)
|
ImpossibleToReloadObject=Original object (type %s, id %s) not linked (see 'Full datas' column to get unalterable saved data)
|
||||||
BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
|
BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
|
||||||
BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
|
BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
|
||||||
BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log).
|
BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log).
|
||||||
|
|||||||
@ -56,6 +56,7 @@ Address=Address
|
|||||||
State=State/Province
|
State=State/Province
|
||||||
StateShort=State
|
StateShort=State
|
||||||
Region=Region
|
Region=Region
|
||||||
|
Region-State=Region - State
|
||||||
Country=Country
|
Country=Country
|
||||||
CountryCode=Country code
|
CountryCode=Country code
|
||||||
CountryId=Country id
|
CountryId=Country id
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# Dolibarr language file - Source file is en_US - compta
|
# Dolibarr language file - Source file is en_US - compta
|
||||||
MenuFinancial=Billing / Payment
|
MenuFinancial=Billing | Payment
|
||||||
TaxModuleSetupToModifyRules=Go to <a href="%s">Taxes module setup</a> to modify rules for calculation
|
TaxModuleSetupToModifyRules=Go to <a href="%s">Taxes module setup</a> to modify rules for calculation
|
||||||
TaxModuleSetupToModifyRulesLT=Go to <a href="%s">Company setup</a> to modify rules for calculation
|
TaxModuleSetupToModifyRulesLT=Go to <a href="%s">Company setup</a> to modify rules for calculation
|
||||||
OptionMode=Option for accountancy
|
OptionMode=Option for accountancy
|
||||||
|
|||||||
@ -87,6 +87,7 @@ MailingModuleDescEmailsFromFile=Emails from file
|
|||||||
MailingModuleDescEmailsFromUser=Emails input by user
|
MailingModuleDescEmailsFromUser=Emails input by user
|
||||||
MailingModuleDescDolibarrUsers=Users with Emails
|
MailingModuleDescDolibarrUsers=Users with Emails
|
||||||
MailingModuleDescThirdPartiesByCategories=Third parties (by categories)
|
MailingModuleDescThirdPartiesByCategories=Third parties (by categories)
|
||||||
|
SendingFromWebInterfaceIsNotAllowed=Sending from web interface is not allowed.
|
||||||
|
|
||||||
# Libelle des modules de liste de destinataires mailing
|
# Libelle des modules de liste de destinataires mailing
|
||||||
LineInFile=Line %s in file
|
LineInFile=Line %s in file
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
# Dolibarr language file - Source file is en_US - salaries
|
# Dolibarr language file - Source file is en_US - salaries
|
||||||
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Accounting account used for user third parties
|
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT=Accounting account used for user third parties
|
||||||
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=The dedicated accounting account defined on user card will be used for Subledger accouting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated user accouting account on user is not defined.
|
SALARIES_ACCOUNTING_ACCOUNT_PAYMENT_Desc=The dedicated accounting account defined on user card will be used for Subledger accouting only. This one will be used for General Ledger and as default value of Subledger accounting if dedicated user accouting account on user is not defined.
|
||||||
SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for personnel expenses
|
SALARIES_ACCOUNTING_ACCOUNT_CHARGE=Accounting account by default for wage payments
|
||||||
Salary=Salary
|
Salary=Salary
|
||||||
Salaries=Salaries
|
Salaries=Salaries
|
||||||
NewSalaryPayment=New salary payment
|
NewSalaryPayment=New salary payment
|
||||||
|
|||||||
@ -25,8 +25,8 @@ Chartofaccounts=Plan contable
|
|||||||
CurrentDedicatedAccountingAccount=Cuenta contable dedicada
|
CurrentDedicatedAccountingAccount=Cuenta contable dedicada
|
||||||
AssignDedicatedAccountingAccount=Nueva cuenta a asignar
|
AssignDedicatedAccountingAccount=Nueva cuenta a asignar
|
||||||
InvoiceLabel=Etiqueta factura
|
InvoiceLabel=Etiqueta factura
|
||||||
OverviewOfAmountOfLinesNotBound=Ver la cantidad de líneas no ligadas a cuentas contables
|
OverviewOfAmountOfLinesNotBound=Ver la cantidad de líneas no vinculadas a una cuenta contable
|
||||||
OverviewOfAmountOfLinesBound=Ver la cantidad de líneas ligadas a cuentas contables
|
OverviewOfAmountOfLinesBound=Ver la cantidad de líneas vinculadas a una cuenta contable
|
||||||
OtherInfo=Otra información
|
OtherInfo=Otra información
|
||||||
DeleteCptCategory=Eliminar la cuenta contable del grupo
|
DeleteCptCategory=Eliminar la cuenta contable del grupo
|
||||||
ConfirmDeleteCptCategory=¿Está seguro de querer eliminar esta cuenta contable del grupo de cuentas contables?
|
ConfirmDeleteCptCategory=¿Está seguro de querer eliminar esta cuenta contable del grupo de cuentas contables?
|
||||||
@ -158,7 +158,7 @@ NumPiece=Apunte
|
|||||||
TransactionNumShort=Núm. transacción
|
TransactionNumShort=Núm. transacción
|
||||||
AccountingCategory=Grupos personalizados
|
AccountingCategory=Grupos personalizados
|
||||||
GroupByAccountAccounting=Agrupar por cuenta contable
|
GroupByAccountAccounting=Agrupar por cuenta contable
|
||||||
AccountingAccountGroupsDesc=You can define here some groups of accounting account. They will be used for personalized accounting reports.
|
AccountingAccountGroupsDesc=Puedes definir aquí algunos grupos de cuentas contables. Se usarán para informes de contabilidad personalizados.
|
||||||
ByAccounts=Por cuentas
|
ByAccounts=Por cuentas
|
||||||
ByPredefinedAccountGroups=Por grupos predefinidos
|
ByPredefinedAccountGroups=Por grupos predefinidos
|
||||||
ByPersonalizedAccountGroups=Por grupos personalizados
|
ByPersonalizedAccountGroups=Por grupos personalizados
|
||||||
@ -173,7 +173,7 @@ DelBookKeeping=Eliminar los registros del Libro Mayor
|
|||||||
FinanceJournal=Diario financiero
|
FinanceJournal=Diario financiero
|
||||||
ExpenseReportsJournal=Diario informe de gastos
|
ExpenseReportsJournal=Diario informe de gastos
|
||||||
DescFinanceJournal=El diario financiero incluye todos los tipos de pagos por cuenta bancaria
|
DescFinanceJournal=El diario financiero incluye todos los tipos de pagos por cuenta bancaria
|
||||||
DescJournalOnlyBindedVisible=Esta es una vista de registros que están vinculados a una cuenta contable y pueden ser registrados en el Libro Mayor.
|
DescJournalOnlyBindedVisible=Esta es una vista del registro vinculado a una cuenta contable y que se puede registrar en el Libro Mayor.
|
||||||
VATAccountNotDefined=Cuenta contable para IVA no definida
|
VATAccountNotDefined=Cuenta contable para IVA no definida
|
||||||
ThirdpartyAccountNotDefined=Cuenta contable de tercero no definida
|
ThirdpartyAccountNotDefined=Cuenta contable de tercero no definida
|
||||||
ProductAccountNotDefined=Cuenta contable de producto no definida
|
ProductAccountNotDefined=Cuenta contable de producto no definida
|
||||||
@ -191,7 +191,7 @@ DescThirdPartyReport=Consulte aquí el listado de clientes y proveedores y sus c
|
|||||||
ListAccounts=Listado de cuentas contables
|
ListAccounts=Listado de cuentas contables
|
||||||
UnknownAccountForThirdparty=Cuenta contable de tercero desconocida, usaremos %s
|
UnknownAccountForThirdparty=Cuenta contable de tercero desconocida, usaremos %s
|
||||||
UnknownAccountForThirdpartyBlocking=Cuenta contable de tercero desconocida. Error de bloqueo
|
UnknownAccountForThirdpartyBlocking=Cuenta contable de tercero desconocida. Error de bloqueo
|
||||||
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third party account and waiting account not defined. Blocking error
|
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Cuenta del terceros desconocida y cuenta de espera no definida. Error de bloqueo
|
||||||
|
|
||||||
Pcgtype=Grupo de cuenta
|
Pcgtype=Grupo de cuenta
|
||||||
Pcgsubtype=Subgrupo de cuenta
|
Pcgsubtype=Subgrupo de cuenta
|
||||||
@ -224,6 +224,8 @@ GeneralLedgerSomeRecordWasNotRecorded=Algunas de las operaciones que no podrán
|
|||||||
NoNewRecordSaved=No hay más registros para el diario
|
NoNewRecordSaved=No hay más registros para el diario
|
||||||
ListOfProductsWithoutAccountingAccount=Listado de productos sin cuentas contables
|
ListOfProductsWithoutAccountingAccount=Listado de productos sin cuentas contables
|
||||||
ChangeBinding=Cambiar la unión
|
ChangeBinding=Cambiar la unión
|
||||||
|
Accounted=Contabilizada en el Libro Mayor
|
||||||
|
NotYetAccounted=Aún no contabilizada en el Libro Mayor
|
||||||
|
|
||||||
## Admin
|
## Admin
|
||||||
ApplyMassCategories=Aplicar categorías en masa
|
ApplyMassCategories=Aplicar categorías en masa
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user