develop_dict

Conflicts:
	htdocs/install/mysql/migration/6.0.0-7.0.0.sql
This commit is contained in:
Regis Houssin 2017-09-14 12:07:19 +02:00
commit a494e01f00
143 changed files with 3135 additions and 1305 deletions

View File

@ -2,19 +2,15 @@
# from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
# We use dist: precise to have php 5.3 available
dist: precise
sudo: required
language: php
php:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- nightly
# Start on every boot
services:
- memcached
addons:
mariadb: '10.0'
@ -33,10 +29,16 @@ addons:
- libapache2-mod-fastcgi
# We need pgloader for import mysql database into pgsql
- pgloader
# Start on every boot
services:
- memcached
php:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
#- hhvm only with dist: trusty
- nightly
env:
global:
@ -57,11 +59,22 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: 7.1
- php: hhvm
- php: nightly
#- env: DB=postgresql
# TODO
#- env: DB=sqlite
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.4'
env: DB=postgresql
- php: '5.5'
env: DB=postgresql
- php: '5.6'
env: DB=postgresql
- php: '7.0'
env: DB=postgresql
- php: hhvm
env: DB=postgresql
- php: nightly
env: DB=postgresql
notifications:
email:

View File

@ -162,6 +162,9 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint".
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
FIX: Removed a bad symbolic link into custom directory.
FIX: Renaming a resource ref rename also the directory of attached files.
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
FIX: #7075 : bad path for document

View File

@ -490,7 +490,7 @@ if ($id)
if (empty($reshook))
{
fieldList($fieldlist,$obj,$tabname[$id],'add');
fieldListJournal($fieldlist,$obj,$tabname[$id],'add');
}
print '<td colspan="4" align="right">';
@ -595,7 +595,7 @@ if ($id)
$error=$hookmanager->error; $errors=$hookmanager->errors;
// Show fields
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
if (empty($reshook)) fieldListJournal($fieldlist,$obj,$tabname[$id],'edit');
print '<td align="center" colspan="4">';
print '<input type="hidden" name="page" value="'.$page.'">';
@ -713,7 +713,7 @@ $db->close();
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
* @return void
*/
function fieldList($fieldlist, $obj='', $tabname='', $context='')
function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
{
global $conf,$langs,$db;
global $form, $mysoc;

View File

@ -28,7 +28,9 @@ require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
@ -51,9 +53,8 @@ if ($search_accountancy_code_end == - 1) {
$search_accountancy_code_end = '';
}
if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv.x") || GETPOST("button_export_csv")) {
$action = 'export_csv';
}
if (GETPOST("exportcsv")) $action = 'export_csv';
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
@ -66,8 +67,18 @@ $formother = new FormOther($db);
$form = new Form($db);
if (empty($search_date_start)) {
$search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
$search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$year_start = dol_print_date(dol_now(), '%Y');
$year_end = $year_start + 1;
$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);
}
if ($sortorder == "")
$sortorder = "ASC";
@ -136,7 +147,7 @@ if ($action == 'export_csv') {
}
else {
$title_page = $langs->trans("AccountBalance") . (($search_date_start || $search_date_end) ? ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end) : '');
$title_page = $langs->trans("AccountBalance");
llxHeader('', $title_page);
@ -156,7 +167,7 @@ else {
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
$button = '<input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button);
$moreforfilter = '';

View File

@ -354,7 +354,7 @@ class AccountancyCategory
}
if ($thirdparty_code != 'nofilter')
{
$sql .= " AND thirdparty_code = '".$ths->db->escape($thirdparty_code)."'";
$sql .= " AND thirdparty_code = '".$this->db->escape($thirdparty_code)."'";
}
dol_syslog(__METHOD__ . " sql=" . $sql, LOG_DEBUG);

View File

@ -108,29 +108,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
@ -144,7 +121,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@ -169,13 +146,29 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilCustomer") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
@ -214,8 +207,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@ -241,8 +234,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
@ -271,8 +276,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@ -298,7 +303,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
@ -367,6 +385,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print "</table>\n";
print '</div>';
if (! empty($conf->margin->enabled)) {
print "<br>\n";
print '<div class="div-table-responsive-no-min">';

View File

@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("compta");
@ -60,6 +62,10 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination
@ -109,6 +115,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_amount = '';
$search_account = '';
$search_vat = '';
$search_month = '';
$search_year = '';
}
// Mass actions
@ -174,6 +182,7 @@ if ($massaction == 'ventil') {
*/
$form = new Form($db);
$formother = new FormOther($db);
llxHeader('', $langs->trans("Ventilation"));
@ -216,6 +225,19 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("l.tva_tx",$search_vat,1);
}
if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
} else {
@ -246,6 +268,15 @@ if ($result) {
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@ -280,7 +311,11 @@ if ($result) {
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';

View File

@ -104,29 +104,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
@ -140,7 +117,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@ -168,13 +145,25 @@ print $langs->trans("DescVentilExpenseReport") . '<br>';
print $langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
$y = $year_current;
@ -195,8 +184,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@ -218,9 +207,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';
@ -249,8 +250,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@ -272,9 +273,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';

View File

@ -32,6 +32,8 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("compta");
@ -58,6 +60,10 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination
@ -103,6 +109,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_amount = '';
$search_account = '';
$search_vat = '';
$search_month = '';
$search_year = '';
}
// Mass actions
@ -169,6 +177,7 @@ if ($massaction == 'ventil') {
*/
$form = new Form($db);
$formother = new FormOther($db);
llxHeader('', $langs->trans("ExpenseReportsVentilation"));
@ -203,6 +212,19 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("erd.tva_tx",$search_vat,1);
}
if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
}
else if ($search_year > 0)
{
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
$sql .= $db->order($sortfield, $sortorder);
@ -228,6 +250,15 @@ if ($result) {
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_expensereport) $param.='&search_expensereport='.urlencode($search_expensereport);
if ($search_label) $param.='&search_label='.urlencode($search_label);
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@ -263,7 +294,11 @@ if ($result) {
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
@ -313,6 +348,7 @@ if ($result) {
// Ref Expense report
print '<td>' . $expensereport_static->getNomUrl(1) . '</td>';
// Date
print '<td align="center">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
// Fees label

View File

@ -68,6 +68,7 @@ $in_bookkeeping = GETPOST('in_bookkeeping','aZ09');
if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
$now = dol_now();
$action = GETPOST('action','aZ09');
// Security check
@ -102,12 +103,15 @@ $idpays = $mysoc->country_id;
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop_company,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop_user,";
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='user'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on bu2.url_id=u.rowid";
$sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal;
@ -145,6 +149,7 @@ $result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
//print $sql;
// Variables
$account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
@ -170,13 +175,31 @@ if ($result) {
{
$obj = $db->fetch_object($result);
// Set accountancy code (for bank and thirdparty)
$lineisapurchase = -1;
$lineisasale = -1;
// Old method to detect if it's a sale or purchase
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase=1;
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale=1;
// Try a more reliable method to detect if record is a supplier payment or a customer payment
if ($lineisapurchase < 0)
{
if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
}
if ($lineisasale < 0)
{
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
}
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
//var_dump($lineisapurchase); //var_dump($lineisasale);
// Set accountancy code for bank
$compta_bank = $obj->account_number;
// Set accountancy code for thirdparty
$compta_soc = 'NotDefined';
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)')
if ($lineisapurchase > 0)
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)')
if ($lineisasale > 0)
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
$tabcompany[$obj->rowid] = array (
@ -185,6 +208,7 @@ if ($result) {
'code_compta' => $compta_soc,
);
// Set accountancy code for user
$compta_user = (! empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee);
$tabuser[$obj->rowid] = array (
@ -200,6 +224,7 @@ if ($result) {
$tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; // CHQ, VIR, LIQ, CB, ...
$tabpay[$obj->rowid]["ref"] = $obj->label; // By default. Not unique. May be changed later
$tabpay[$obj->rowid]["fk_bank"] = $obj->rowid;
$tabpay[$obj->rowid]["bank_account_ref"] = $obj->baref;
$tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account;
if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) {
$tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]);
@ -212,7 +237,7 @@ if ($result) {
//var_dump($tabpay);
// By default
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or old record with no links in bank_url.
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
$tabtype[$obj->rowid] = 'unknown';
// get_url may return -1 which is not traversable
@ -602,6 +627,8 @@ if (! $error && $action == 'writebookkeeping') {
}
}
// Export
if ($action == 'exportcsv') { // ISO and not UTF8 !
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
@ -735,18 +762,34 @@ if (empty($action) || $action == 'view') {
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
// Test that setup is complete
$sql='SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
$resql=$db->query($sql);
if ($resql)
{
$obj=$db->fetch_object($resql);
if ($obj->nb > 0)
{
print '<br>'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>');
}
}
else dol_print_error($db);
// Button to write into Ledger
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
|| empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
@ -754,15 +797,15 @@ if (empty($action) || $action == 'view') {
<script type="text/javascript">
function launch_export() {
console.log("Set value into form and submit");
$("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("exportcsv");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
function writebookkeeping() {
console.log("Set value into form and submit");
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
</script>';
@ -796,8 +839,10 @@ if (empty($action) || $action == 'view') {
// Bank
foreach ( $tabbq[$key] as $k => $mt )
{
//var_dump($tabpay[$key]);
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
print '<tr class="oddeven">';
print "<td><!-- Bank bank.rowid=".$key."--></td>";
print "<td></td>";
print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>";
// Ledger account
@ -818,11 +863,14 @@ if (empty($action) || $action == 'view') {
}
else print $accounttoshow;*/
print "</td>";
if ($val['soclib'] == '') {
print "<td>" . $langs->trans("Bank") . " - " . $reflabel . "</td>";
} else {
print "<td>" . $langs->trans("Bank") . " - " . $val['soclib'] . "</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>";
@ -833,14 +881,15 @@ if (empty($action) || $action == 'view') {
if (is_array($tabtp[$key])) {
foreach ( $tabtp[$key] as $k => $mt ) {
if ($k != 'type') {
print '<!-- Thirdparty bank.rowid='.$key.' -->';
print '<tr class="oddeven">';
print "<td><!-- Thirdparty bank.rowid=".$key." --></td>";
print "<td></td>";
print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>";
// Ledger account
print "<td>";
$account_ledger = $k;
// Try to force general ledger account depending on type
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
@ -877,7 +926,11 @@ if (empty($action) || $action == 'view') {
{
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
{
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
/*var_dump($tabpay[$key]);
var_dump($tabtype[$key]);
var_dump($tabbq[$key]);*/
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown").'</span>';
}
else print $accounttoshowsubledger;
}
@ -892,8 +945,9 @@ if (empty($action) || $action == 'view') {
}
} else {
foreach ( $tabbq[$key] as $k => $mt ) {
print '<!-- Wait bank.rowid='.$key.' -->';
print '<tr class="oddeven">';
print "<td><!-- Wait bank.rowid=".$key." --></td>";
print "<td></td>";
print "<td>" . $date . "</td>";
print "<td>" . $ref . "</td>";
// Ledger account
@ -936,7 +990,7 @@ $db->close();
* Return source for doc_ref of a bank transaction
*
* @param string $val Array of val
* @param string $typerecord Type of record
* @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
* @return string|unknown
*/
function getSourceDocRef($val, $typerecord)

View File

@ -510,7 +510,7 @@ if (empty($action) || $action == 'view') {
// Button to write into Ledger
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
@ -518,11 +518,12 @@ if (empty($action) || $action == 'view') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
}
//print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
//print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
print '
<script type="text/javascript">
function launch_export() {

View File

@ -539,22 +539,23 @@ if (empty($action) || $action == 'view') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
}
print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
print '
<script type="text/javascript">
function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("exportcsv");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
function writebookkeeping() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
</script>';

View File

@ -559,22 +559,23 @@ if (empty($action) || $action == 'view') {
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
}
else {
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
}
print '<input type="button" class="butAction" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />';
print '</div>';
// TODO Avoid using js. We can use a direct link with $param
print '
<script type="text/javascript">
function launch_export() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("exportcsv");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("exportcsv");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
function writebookkeeping() {
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
$("div.fiche form input[name=\"action\"]").val("writebookkeeping");
$("div.fiche form input[type=\"submit\"]").click();
$("div.fiche form input[name=\"action\"]").val("");
}
</script>';

View File

@ -105,29 +105,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'fixaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
@ -140,7 +117,7 @@ if ($action == 'validatehistory') {
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.= ")";
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
@ -168,10 +145,25 @@ print $langs->trans("DescVentilSupplier") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
//print '<div class="inline-block divButAction">';
// TODO Remove this. Should be done always or into the repair.php script.
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
//print '</div>';
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
$y = $year_current;
@ -191,8 +183,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@ -214,8 +206,20 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
@ -245,8 +249,8 @@ for($i = 1; $i <= 12; $i ++) {
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
}
@ -268,9 +272,21 @@ if ($resql) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
{
print $langs->trans("Unknown");
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';

View File

@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
// Langs
$langs->load("compta");
@ -60,6 +62,10 @@ $search_desc = GETPOST('search_desc', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
$search_account = GETPOST('search_account', 'alpha');
$search_vat = GETPOST('search_vat', 'alpha');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$btn_ventil = GETPOST('ventil', 'alpha');
// Load variable for pagination
@ -110,6 +116,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
$search_amount = '';
$search_account = '';
$search_vat = '';
$search_month = '';
$search_year = '';
}
// Mass actions
@ -176,6 +184,7 @@ if ($massaction == 'ventil') {
*/
$form = new Form($db);
$formother = new FormOther($db);
llxHeader('', $langs->trans("SuppliersVentilation"));
@ -218,6 +227,19 @@ if (strlen(trim($search_account))) {
if (strlen(trim($search_vat))) {
$sql .= natural_search("l.tva_tx",$search_vat,1);
}
if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
$sql .= $db->order($sortfield, $sortorder);
@ -243,6 +265,15 @@ if ($result) {
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_invoice) $param.='&search_invoice='.urlencode($search_invoice);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_desc) $param.='&search_desc='.urlencode($search_desc);
if ($search_amount) $param.='&search_amount='.urlencode($search_amount);
if ($search_vat) $param.='&search_vat='.urlencode($search_vat);
$arrayofmassactions = array(
'ventil'=>$langs->trans("Ventilate")
@ -279,7 +310,11 @@ if ($result) {
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
$formother->select_year($search_year,'search_year',1, 20, 5);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';

View File

@ -203,7 +203,7 @@ if ($conf->facture->enabled)
print '</td>';
}
print "</tr>\n";
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
@ -263,40 +263,6 @@ $helptext.='%YEAR%, %MONTH%, %DAY%';
form_constantes($constantes, 0, $helptext);
print '<br>';
/*
* Editing global variables not related to a specific theme
*/
$constantes=array(
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL',
'ADHERENT_AUTOREGISTER_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_MAIL',
'ADHERENT_MAIL_VALID_SUBJECT',
'ADHERENT_MAIL_VALID',
'ADHERENT_MAIL_COTIS_SUBJECT',
'ADHERENT_MAIL_COTIS',
'ADHERENT_MAIL_RESIL_SUBJECT',
'ADHERENT_MAIL_RESIL',
'ADHERENT_MAIL_FROM',
);
print load_fiche_titre($langs->trans("Other"),'','');
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
$helptext.='%YEAR%, %MONTH%, %DAY%';
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported
form_constantes($constantes, 0, $helptext);
dol_fiche_end();

View File

@ -0,0 +1,190 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2012 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) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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/adherents/admin/adherent.php
* \ingroup member
* \brief Page to setup the module Foundation
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
$langs->load("admin");
$langs->load("members");
if (! $user->admin) accessforbidden();
$type=array('yesno','texte','chaine');
$action = GETPOST('action','alpha');
/*
* Actions
*/
//
if ($action == 'updateall')
{
$db->begin();
$res1=$res2=$res3=$res4=$res5=$res6=0;
$res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
$res2=dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
$res3=dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
$res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
// Use vat for invoice creation
if ($conf->facture->enabled)
{
$res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
$res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
}
}
if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0)
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback();
}
else
{
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
$db->commit();
}
}
// Action mise a jour ou ajout d'une constante
if ($action == 'update' || $action == 'add')
{
$constname=GETPOST('constname','alpha');
$constvalue=(GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue'));
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE' || $constname=='ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue='';
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
{
if ($constvalue) $constvalue=0;
else $constvalue=1;
}
$consttype=GETPOST('consttype','alpha');
$constnote=GETPOST('constnote');
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
// Action activation d'un sous module du module adherent
if ($action == 'set')
{
$result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value'),'',0,'',$conf->entity);
if ($result < 0)
{
print $db->error();
}
}
// Action desactivation d'un sous module du module adherent
if ($action == 'unset')
{
$result=dolibarr_del_const($db,GETPOST('name','alpha'),$conf->entity);
if ($result < 0)
{
print $db->error();
}
}
/*
* View
*/
$form = new Form($db);
$help_url='EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros';
llxHeader('',$langs->trans("MembersSetup"),$help_url);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
$head = member_admin_prepare_head();
dol_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateall">';
/*
* Editing global variables not related to a specific theme
*/
$constantes=array(
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_NOTIF_MAIL',
'ADHERENT_AUTOREGISTER_MAIL_SUBJECT',
'ADHERENT_AUTOREGISTER_MAIL',
'ADHERENT_MAIL_VALID_SUBJECT',
'ADHERENT_MAIL_VALID',
'ADHERENT_MAIL_COTIS_SUBJECT',
'ADHERENT_MAIL_COTIS',
'ADHERENT_MAIL_RESIL_SUBJECT',
'ADHERENT_MAIL_RESIL',
'ADHERENT_MAIL_FROM',
);
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
$helptext.='%YEAR%, %MONTH%, %DAY%';
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported
form_constantes($constantes, 0, $helptext);
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -43,6 +43,12 @@ if (! $user->admin) accessforbidden();
* Actions
*/
if ($action == 'setMEMBER_ENABLE_PUBLIC')
{
if (GETPOST('value')) dolibarr_set_const($db, 'MEMBER_ENABLE_PUBLIC', 1, 'chaine', 0, '', $conf->entity);
else dolibarr_set_const($db, 'MEMBER_ENABLE_PUBLIC', 0, 'chaine', 0, '', $conf->entity);
}
if ($action == 'update')
{
$public=GETPOST('MEMBER_ENABLE_PUBLIC');
@ -94,7 +100,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
dol_fiche_head($head, 'public', $langs->trans("Members"), -1, 'user');
dol_fiche_head($head, 'website', $langs->trans("Members"), -1, 'user');
if ($conf->use_javascript_ajax)
{
@ -135,99 +141,109 @@ if ($conf->use_javascript_ajax)
print $langs->trans("BlankSubscriptionFormDesc").'<br><br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="right">'.$langs->trans("Value").'</td>';
print "</tr>\n";
// Allow public form
print '<tr class="oddeven"><td>';
print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
print "</td></tr>\n";
// Force Type
$adht = new AdherentType($db);
print '<tr class="oddeven drag" id="trforcetype"><td>';
print $langs->trans("ForceMemberType");
print '</td><td width="60" align="right">';
$listofval = array(-1 => $langs->trans("Undefined"));
$listofval += $adht->liste_array();
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0);
print "</td></tr>\n";
// Amount
print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
print "</td></tr>\n";
// Can edit
print '<tr class="oddeven" id="tredit"><td>';
print $langs->trans("CanEditAmount");
print '</td><td align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
print "</td></tr>\n";
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled))
$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' ';
if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
// Button off, click to enable
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=1'.$param.'">';
$enabledisablehtml.=img_picto($langs->trans("Disabled"),'switch_off');
$enabledisablehtml.='</a>';
}
else
{
// Button on, click to disable
$enabledisablehtml.='<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMEMBER_ENABLE_PUBLIC&value=0'.$param.'">';
$enabledisablehtml.=img_picto($langs->trans("Activated"),'switch_on');
$enabledisablehtml.='</a>';
}
print $enabledisablehtml;
print '<input type="hidden" id="MEMBER_ENABLE_PUBLIC" name="MEMBER_ENABLE_PUBLIC" value="'.(empty($conf->global->MEMBER_ENABLE_PUBLIC)?0:1).'">';
print '<br>';
if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="right">'.$langs->trans("Value").'</td>';
print "</tr>\n";
// Force Type
$adht = new AdherentType($db);
print '<tr class="oddeven drag" id="trforcetype"><td>';
print $langs->trans("ForceMemberType");
print '</td><td width="60" align="right">';
$listofval = array(-1 => $langs->trans("Undefined"));
$listofval += $adht->liste_array();
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0);
print "</td></tr>\n";
// Amount
print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
print "</td></tr>\n";
// Can edit
print '<tr class="oddeven" id="tredit"><td>';
print $langs->trans("CanEditAmount");
print '</td><td align="right">';
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
print "</td></tr>\n";
// Jump to an online payment page
print '<tr class="oddeven" id="trpayment"><td>';
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td align="right">';
$listofval=array();
$listofval['-1']=$langs->trans('No');
$listofval['all']=$langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')';
if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
if (! empty($conf->stripe->enabled)) $listofval['stripe']='Stripe';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),0);
print "</td></tr>\n";
// Jump to an online payment page
print '<tr class="oddeven" id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
print '</table>';
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
}
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled))
{
// Jump to an online payment page
print '<tr class="oddeven" id="tremail"><td>';
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
print '</td><td align="right">';
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
print "</td></tr>\n";
}
print '</table>';
dol_fiche_end();
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</center>';
print '</form>';
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
if ($conf->multicompany->enabled) {
$entity_qr='?entity='.$conf->entity;
} else {
$entity_qr='';
if (! empty($conf->global->MEMBER_ENABLE_PUBLIC))
{
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('','object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
if ($conf->multicompany->enabled) {
$entity_qr='?entity='.$conf->entity;
} else {
$entity_qr='';
}
print '<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.$entity_qr.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.$entity_qr.'</a>';
}
print '<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.$entity_qr.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.$entity_qr.'</a>';
/*
print '<table class="border" cellspacing="0" cellpadding="3">';
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'..'</td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
print '</table>';
*/
llxFooter();

View File

@ -76,6 +76,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
*/
function assign_values(&$action, $id)
{
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
@ -114,14 +115,14 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
/**
* Fetch datas list
* Fetch datas list and save into ->list_datas
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response

View File

@ -1743,21 +1743,26 @@ else
// Show links to link elements
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
// Link for paypal payment
/*
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice', $object->ref);
}
*/
// Shon online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
if ($useonlinepayment)
{
print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref);
}
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element
/* Already in tab Agenda/Events
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'member', $socid);
$somethingshown = $formactions->showactions($object, 'member', $socid, 1);
*/
print '</div></div></div>';

View File

@ -199,6 +199,9 @@ class Adherent extends CommonObject
$infos.= $langs->transnoentities("Town").": ".$this->town."\n";
$infos.= $langs->transnoentities("Country").": ".$this->country."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
$infos.= $langs->transnoentities("PhonePro").": ".$this->phone."\n";
$infos.= $langs->transnoentities("PhonePerso").": ".$this->phone_perso."\n";
$infos.= $langs->transnoentities("PhoneMobile").": ".$this->phone_mobile."\n";
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
@ -243,6 +246,11 @@ class Adherent extends CommonObject
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
'%TYPE%'=>$msgishtml?dol_htmlentitiesbr($this->type):$this->type,
'%PHONE_PRO%'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
'%PHONE_PERSO%'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
'%PHONE_MOBILE%'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
// For backward compatibility
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,

View File

@ -789,14 +789,10 @@ if ($rowid > 0)
if ($object->statut > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription">'.$langs->trans("AddSubscription")."</a></div>";
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
print "<br>\n";
print '</div>';
print '<br>';
}
}
/*
* List of subscriptions
*/
@ -882,24 +878,21 @@ if ($rowid > 0)
{
dol_print_error($db);
}
// Link for paypal payment
if (! empty($conf->paypal->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('membersubscription',$object->ref);
}
// Link for stripe payment
if (! empty($conf->stripe->enabled))
{
include_once DOL_DOCUMENT_ROOT.'/stripe/lib/stripe.lib.php';
print showStripePaymentUrl('membersubscription',$object->ref);
}
}
// Shon online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
if ($useonlinepayment)
{
print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('membersubscription', $object->ref);
}
/*
* Add new subscription form
*/

View File

@ -402,21 +402,15 @@ if ($rowid && $action != 'edit')
// Show links to link elements
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
// Link for paypal payment
/*
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice', $object->ref);
}
*/
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
// List of actions on element
/*
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
*/
print '</div></div></div>';

View File

@ -157,7 +157,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("fiscalmonthstart",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'alpha'),'chaine',0,'',$conf->entity);
@ -547,8 +547,8 @@ if ($action == 'edit' || $action == 'updateedit')
print "</tr>\n";
print '<tr class="oddeven"><td><label for="fiscalmonthstart">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '</td></tr>';
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'SOCIETE_FISCAL_MONTH_START',0,1) . '</td></tr>';
print "</table>";

View File

@ -248,8 +248,8 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
// Page
$texthelp=$langs->trans("PageUrlForDefaultValues");
if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php');
else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php');
if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php', 'societe/card.php?abc=val1&def=val2');
else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php', 'societe/card.php?abc=val1&def=val2');
$texturl=$form->textwithpicto($langs->trans("Url"), $texthelp);
print_liste_field_titre($texturl,$_SERVER["PHP_SELF"],'page,param','',$param,'',$sortfield,$sortorder);
// Field

View File

@ -1153,7 +1153,7 @@ if ($id)
}
if ($id == 4) print '<td></td>';
print '<td colspan="3" align="right">';
print '<td colspan="3" align="center">';
if ($action != 'edit')
{
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';

View File

@ -20,145 +20,10 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
include_once DOL_DOCUMENT_ROOT.'/admin/dolistore/class/PSWebServiceLibrary.class.php';
/**
* Class DolistoreModel
*/
class DolistoreModel
{
function get_categories($parent = 0)
{
if (!isset($this->categories)) die('not possible');
if ($parent != 0) {
$html = '<ul>';
} else {
$html = '';
}
$nbofcateg = count($this->categories);
for ($i = 0; $i < $nbofcateg; $i++)
{
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '
.'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'"'
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'" '
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} else {
}
}
if ($html == '<ul>') {
return '';
}
if ($parent != 0) {
return $html.'</ul>';
} else {
return $html;
}
}
function get_products()
{
global $langs, $conf;
$html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ?
$newapp = '';
if ($last_month < strtotime($product->date_add)) {
$newapp .= '<span class="newApp">'.$langs->trans('New').'</span> ';
}
// check updated ?
if ($last_month < strtotime($product->date_upd) && $newapp == '') {
$newapp .= '<span class="updatedApp">'.$langs->trans('Updated').'</span> ';
}
// add image or default ?
if ($product->id_default_image != '') {
$image_url = dol_buildPath('/dolistore/ajax/image.php?id_product=', 2).$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'.
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.dol_buildPath('/dolistore/img/NoImageAvailable.png', 2).'" />';
}
// free or pay ?
if ($product->price > 0) {
$price = '<h3>'.price(round((float) $product->price * $this->vat_rate, 2)).'&nbsp;&euro;</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.dol_buildPath('/dolistore/img/follow.png',
2).'" /></a>';
} else {
$price = $langs->trans('Free');
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.dol_buildPath('/dolistore/img/Download-128.png',
2).'" /></a>';
}
//checking versions
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible
$version = '<span class="compatible">'.$langs->trans('CompatibleUpTo', $product->dolibarr_max,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = '';
} else {
//never compatible, module expired
$version = '<span class="notcompatible">'.$langs->trans('NotCompatible', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
} else {
//need update
$version = '<span class="compatibleafterupdate">'.$langs->trans('CompatibleAfterUpdate', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
//output template
$html .= '<tr class="app '.$parity.' '.$compatible.'">
<td align="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle"><a target="_blank" href="'.$this->shop_url.$product->id.'">'.$product->name->language[$this->lang].'</a><span class="details button">Details</span>'
.'<br/><small>'.$version.'</small></h2>
<small> '.dol_print_date(strtotime($product->date_upd)).' - '.$langs->trans('Référence').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang].'</td>
<td style="display:none;" class="long_description">'.$product->description->language[$this->lang].'</td>
<td class="margeCote" align="right">'.$price.'</td>
<td class="margeCote">'.$download_link.'</td>
</tr>';
}
return $html;
}
function get_previous_link($text = '<<')
{
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
}
function get_next_link($text = '>>')
{
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
}
}
/**
* Class Dolistore
*/
class Dolistore extends DolistoreModel
class Dolistore
{
// params
public $start // beginning of pagination
@ -173,6 +38,11 @@ class Dolistore extends DolistoreModel
, $lang // the integer representing the lang in the store
, $debug_api; // usefull if no dialog
/**
* Constructor
*
* @param array $options Options
*/
function __construct($options = array('start' => 0, 'end' => 10, 'per_page' => 50, 'categorie' => 0))
{
global $conf, $langs;
@ -254,6 +124,139 @@ class Dolistore extends DolistoreModel
}
}
function get_categories($parent = 0)
{
if (!isset($this->categories)) die('not possible');
if ($parent != 0) {
$html = '<ul>';
} else {
$html = '';
}
$nbofcateg = count($this->categories);
for ($i = 0; $i < $nbofcateg; $i++)
{
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '
.'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'"'
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang])).'" '
.'>'.$cat->name->language[$this->lang].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} else {
}
}
if ($html == '<ul>') {
return '';
}
if ($parent != 0) {
return $html.'</ul>';
} else {
return $html;
}
}
/**
* Return list of product formated for output
*
* @return string HTML output
*/
function get_products()
{
global $langs, $conf;
$html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ?
$newapp = '';
if ($last_month < strtotime($product->date_add)) {
$newapp .= '<span class="newApp">'.$langs->trans('New').'</span> ';
}
// check updated ?
if ($last_month < strtotime($product->date_upd) && $newapp == '') {
$newapp .= '<span class="updatedApp">'.$langs->trans('Updated').'</span> ';
}
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang].', '.$langs->trans('Version').' '.$product->module_version.'">'.
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/dolistore/img/NoImageAvailable.png" />';
}
// free or pay ?
if ($product->price > 0) {
$price = '<h3>'.price(round((float) $product->price * $this->vat_rate, 2)).'&nbsp;&euro;</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} else {
$price = '<h3>'.$langs->trans('Free').'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link.= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
}
//checking versions
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible
$version = '<span class="compatible">'.$langs->trans('CompatibleUpTo', $product->dolibarr_max,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = '';
} else {
//never compatible, module expired
$version = '<span class="notcompatible">'.$langs->trans('NotCompatible', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
} else {
//need update
$version = '<span class="compatibleafterupdate">'.$langs->trans('CompatibleAfterUpdate', DOL_VERSION,
$product->dolibarr_min, $product->dolibarr_max).'</span>';
$compatible = 'NotCompatible';
}
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app '.$parity.' '.$compatible.'">
<td align="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang]
.'<br/><small>'.$version.'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang].'</td>
<td style="display:none;" class="long_description">'.$product->description->language[$this->lang].'</td>
<td class="margeCote" align="center">'.$price.'
</td>
<td class="margeCote">'.$download_link.'</td>
</tr>';
}
return $html;
}
function get_previous_link($text = '<<')
{
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
}
function get_next_link($text = '>>')
{
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
}
function get_previous_url()
{
$param_array = array();

View File

@ -115,7 +115,9 @@ div.divsearchfield {
tr.app {
height:250px;
}
tr.app td {
border-bottom: 1px solid #888;
}
div#newsDoli.tabBar {
margin-top: 50px;
margin-right: 30px;
@ -225,6 +227,7 @@ tr.NotCompatible:hover{
}
#listing-content{
width: 75%;
float: right;
}
}
span.details{

View File

@ -70,13 +70,13 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
print $langs->trans("SetupDescription1").' ';
print $langs->trans("AreaForAdminOnly").' ';
print $langs->trans("SetupDescription2", $langs->trans("MenuCompanySetup"), $langs->trans("Modules"))."<br><br>";
print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
print '<br>';
// Show info setup company
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->trans("Setup"), $langs->trans("MenuCompanySetup"));
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
if (! empty($setupcompanynotcomplete))
{
$langs->load("errors");
@ -88,7 +88,7 @@ print '<br>';
print '<br>';
// Show info setup module
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->trans("Setup"), $langs->trans("Modules"));
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{
$langs->load("errors");

View File

@ -832,44 +832,50 @@ if ($mode == 'marketplace')
if (empty($conf->global->MAIN_DISABLE_DOLISTORE_SEARCH) && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span>';
print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
$previouslink = $dolistore->get_previous_link();
$nextlink = $dolistore->get_next_link();
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">'
?>
<br><br>
<div class="tabBar">
<form method="POST" id="searchFormList" action="<?php echo $dolistore->url ?>">
<form method="POST" class="centpercent" id="searchFormList" action="<?php echo $dolistore->url ?>">
<input type="hidden" name="mode" value="marketplace" />
<div class="divsearchfield"><?php echo $langs->trans('Mot-cle') ?>:
<div class="divsearchfield"><?php echo $langs->trans('Keyword') ?>:
<input name="search_keyword" placeholder="<?php echo $langs->trans('Chercher un module') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
</div>
<div class="divsearchfield">
<input class="button butAction searchDolistore" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="button butActionDelete" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Tout afficher') ?></a>
</div><br><br><br style="clear: both">
<input class="button" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="button" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
&nbsp;
</div>
<div class="divsearchfield right">
<?php
print $previouslink;
print $nextlink;
?>
</div>
</form>
</div>
<?php
print '</div></div>';
print '<div class="clearboth"></div>';
?>
<div id="category-tree-left">
<ul class="tree">
<?php echo $dolistore->get_categories(); ?>
</ul>
</div>
<div id="listing-content">
<table summary="list_of_modules" id="list_of_modules" class="liste" width="100%">
<thead>
<tr class="liste_titre">
<td colspan="100%"><?php echo $dolistore->get_previous_link() ?> <?php echo $dolistore->get_next_link() ?> <span style="float:right"><?php echo $langs->trans('AchatTelechargement') ?></span></td>
</tr>
</thead>
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
<tbody id="listOfModules">
<?php echo $dolistore->get_products($categorie); ?>
</tbody>
<tfoot>
<tr class="liste_titre">
<td colspan="100%"><?php echo $dolistore->get_previous_link() ?> <?php echo $dolistore->get_next_link() ?> <span style="float:right"><?php echo $langs->trans('AchatTelechargement') ?></span></td>
</tr>
</tfoot>
</table>
</div>

View File

@ -1548,17 +1548,32 @@ class Categorie extends CommonObject
dol_mkdir($dir);
}
if (file_exists($dir))
{
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage))
if (file_exists($dir)) {
if (is_array($file['name']) && count($file['name']) > 0)
{
// Create thumbs
$this->addThumbs($originImage);
$nbfile = count($file['name']);
for ($i = 0; $i <= $nbfile; $i ++) {
$originImage = $dir . $file['name'][$i];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
} else {
$originImage = $dir . $file['name'];
// Cree fichier en taille origine
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
if (file_exists($originImage)) {
// Create thumbs
$this->addThumbs($originImage);
}
}
}
}

View File

@ -670,7 +670,7 @@ if ($action == 'create')
}
// Title
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Label").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
// Full day
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked':'').'></td></tr>';

View File

@ -860,9 +860,10 @@ class ActionComm extends CommonObject
* @param string $filter Other filter
* @param string $sortfield Sort on this field
* @param string $sortorder ASC or DESC
* @param string $limit Limit number of answers
* @return array or string Error string if KO, array with actions if OK
*/
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='', $sortorder='')
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='datep', $sortorder='DESC', $limit=0)
{
global $conf, $langs;
@ -879,6 +880,7 @@ class ActionComm extends CommonObject
}
if (! empty($filter)) $sql.= $filter;
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
if ($limit) $sql.=$db->plimit($limit);
dol_syslog(get_class()."::getActions", LOG_DEBUG);
$resql=$db->query($sql);

View File

@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
}
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) {
$sqlwhere[]= " (t.fk_pays IN (".$db->escape(implode(',',$arrayquery['contact_country']))."))";
$sqlwhere[]= " (t.fk_pays IN (".$this->db->escape(implode(',',$arrayquery['contact_country']))."))";
}
if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) {
$sqlwhere[]= " (t.statut IN (".$db->escape(implode(',',$arrayquery['contact_status']))."))";
$sqlwhere[]= " (t.statut IN (".$this->db->escape(implode(',',$arrayquery['contact_status']))."))";
}
if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) {
$sqlwhere[]= " (t.civility IN ('".$db->escape(implode("','",$arrayquery['contact_civility']))."'))";
$sqlwhere[]= " (t.civility IN ('".$this->db->escape(implode("','",$arrayquery['contact_civility']))."'))";
}
if ($arrayquery['contact_no_email']!='') {
$sqlwhere[]= " (t.no_email='".$db->escape($arrayquery['contact_no_email'])."')";
$sqlwhere[]= " (t.no_email='".$this->db->escape($arrayquery['contact_no_email'])."')";
}
if ($arrayquery['contact_update_st_dt']!='') {
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";

View File

@ -1376,7 +1376,7 @@ if ($action == 'create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";
@ -2373,7 +2373,7 @@ if ($action == 'create')
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'propal', $socid);
$somethingshown = $formactions->showactions($object, 'propal', $socid, 1);
print '</div></div></div>';
}

View File

@ -938,7 +938,7 @@ class Propal extends CommonObject
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".(double) $this->multicurrency_tx;
$sql.= ")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)

View File

@ -73,6 +73,10 @@ $search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state"));
$search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$viewstatut=GETPOST('viewstatut','alpha');
$optioncss = GETPOST('optioncss','alpha');
$object_statut=GETPOST('propal_statut','alpha');
@ -80,9 +84,6 @@ $object_statut=GETPOST('propal_statut','alpha');
$sall=GETPOST('sall', 'alphanohtml');
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
@ -371,9 +372,10 @@ if ($resql)
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($sall) $param.='&sall='.urlencode($sall);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year='.urlencode($search_year);
if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer);
if ($search_societe) $param.='&search_societe='.urlencode($search_societe);
if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
@ -613,7 +615,7 @@ if ($resql)
// Date
if (! empty($arrayfields['p.date']['checked']))
{
print '<td class="liste_titre" colspan="1" align="center">';
print '<td class="liste_titre" align="center">';
//print $langs->trans('Month').': ';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
@ -624,7 +626,7 @@ if ($resql)
// Date end
if (! empty($arrayfields['p.fin_validite']['checked']))
{
print '<td class="liste_titre" colspan="1">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
}
if (! empty($arrayfields['p.total_ht']['checked']))
{

View File

@ -398,6 +398,7 @@ if (empty($reshook))
}
// Now we create same links to contact than the ones found on origin object
/* Useless, already into the create
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
{
$originforcontact = $object->origin;
@ -420,7 +421,7 @@ if (empty($reshook))
}
}
else dol_print_error($resqlcontact);
}
}*/
// Hooks
$parameters = array('objFrom' => $srcobject);
@ -1491,7 +1492,7 @@ if ($action == 'create' && $user->rights->commande->creer)
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";
@ -2591,7 +2592,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'order', $socid);
$somethingshown = $formactions->showactions($object, 'order', $socid, 1);
print '</div></div></div>';
}

View File

@ -920,7 +920,8 @@ class Commande extends CommonOrder
foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
{
$originforcontact = 'commande';
$originidforcontact = $value->id;
if (is_object($value)) $originidforcontact = $value->id;
else $originidforcontact = $value;
break; // We take first one
}
}

View File

@ -1303,6 +1303,7 @@ if (empty($reshook))
}
// Now we create same links to contact than the ones found on origin object
/* Useless, already into the create
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
{
$originforcontact = $object->origin;
@ -1325,7 +1326,7 @@ if (empty($reshook))
}
}
else dol_print_error($resqlcontact);
}
}*/
// Hooks
$parameters = array('objFrom' => $srcobject);
@ -2259,7 +2260,7 @@ if ($action == 'create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print '</td>';
}
print '</tr>' . "\n";
@ -3210,6 +3211,14 @@ else if ($id > 0 || ! empty($ref))
$facthatreplace->fetch($objectidnext);
print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')';
}
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, $object->id);
if ($result > 0){
print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>';
}
}
print '</td></tr>';
// Relative and absolute discounts
@ -4311,16 +4320,15 @@ else if ($id > 0 || ! empty($ref))
$linktoelem = $form->showLinkToObjectBlock($object, null, array('invoice'));
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
// Link for paypal payment
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice', $object->ref);
}
// Link for stripe payment
if (! empty($conf->stripe->enabled) && $object->statut != 0) {
include_once DOL_DOCUMENT_ROOT . '/stripe/lib/stripe.lib.php';
print showStripePaymentUrl('invoice', $object->ref);
// Show online payment link
$useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled));
if ($object->statut != 0 && $useonlinepayment)
{
print '<br>';
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
print showOnlinePaymentUrl('invoice', $object->ref);
}
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
@ -4328,7 +4336,7 @@ else if ($id > 0 || ! empty($ref))
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
$somethingshown = $formactions->showactions($object, 'invoice', $socid, 1);
print '</div></div></div>';
}

View File

@ -480,7 +480,7 @@ class FactureRec extends CommonInvoice
* @param int $idwarehouse Id warehouse to use for stock change.
* @return int <0 if KO, >0 if OK
*/
function delete($user, $notrigger=0, $idwarehouse=-1)
function delete(User $user, $notrigger=0, $idwarehouse=-1)
{
$rowid=$this->id;
@ -1355,45 +1355,50 @@ class FactureRec extends CommonInvoice
*/
class FactureLigneRec extends CommonInvoiceLine
{
public $element='facturedetrec';
public $table_element='facturedet_rec';
/**
* Delete line in database
*
* @return int <0 if KO, >0 if OK
* @param User $user Object user
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
*/
function delete()
function delete(User $user, $notrigger = false)
{
global $conf,$langs,$user;
$error=0;
$error=0;
$this->db->begin();
$this->db->begin();
if (! $error) {
if (! $notrigger) {
// Call triggers
$result=$this->call_trigger('LINEBILLREC_DELETE', $user);
if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
// End call triggers
}
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if ($this->db->query($sql) )
{
// Call trigger
$result=$this->call_trigger('LINEBILLREC_DELETE',$user);
if ($result < 0)
{
$this->db->rollback();
return -1;
}
// End call triggers
if (! $error)
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id;
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->error()." sql=".$sql;
$this->db->rollback();
return -1;
}
$res = $this->db->query($sql);
if($res===false) {
$error++;
$this->errors[] = $this->db->lasterror();
}
}
// Commit or rollback
if ($error) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
return 1;
}
}

View File

@ -439,7 +439,6 @@ class Facture extends CommonInvoice
$sql.= ", ".(double) $this->multicurrency_tx;
$sql.=")";
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@ -449,7 +448,6 @@ class Facture extends CommonInvoice
$this->ref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) $error++;
@ -498,7 +496,8 @@ class Facture extends CommonInvoice
foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
{
$originforcontact = 'commande';
$originidforcontact = $value->id;
if (is_object($value)) $originidforcontact = $value->id;
else $originidforcontact = $value;
break; // We take first one
}
}
@ -3844,6 +3843,9 @@ class Facture extends CommonInvoice
$line->total_ht=-100;
$line->total_ttc=-119.6;
$line->total_tva=-19.6;
$line->multicurrency_total_ht=-200;
$line->multicurrency_total_ttc=-239.2;
$line->multicurrency_total_tva=-39.2;
}
else if ($xnbp == 2) // UP is negative (free line)
{
@ -3852,6 +3854,9 @@ class Facture extends CommonInvoice
$line->total_ttc=-119.6;
$line->total_tva=-19.6;
$line->remise_percent=0;
$line->multicurrency_total_ht=-200;
$line->multicurrency_total_ttc=-239.2;
$line->multicurrency_total_tva=-39.2;
}
else if ($xnbp == 3) // Discount is 50% (product line)
{
@ -3860,6 +3865,9 @@ class Facture extends CommonInvoice
$line->total_ht=50;
$line->total_ttc=59.8;
$line->total_tva=9.8;
$line->multicurrency_total_ht=100;
$line->multicurrency_total_ttc=119.6;
$line->multicurrency_total_tva=19.6;
$line->remise_percent=50;
}
else // (product line)
@ -3869,15 +3877,23 @@ class Facture extends CommonInvoice
$line->total_ht=100;
$line->total_ttc=119.6;
$line->total_tva=19.6;
$line->remise_percent=00;
$line->multicurrency_total_ht=200;
$line->multicurrency_total_ttc=239.2;
$line->multicurrency_total_tva=39.2;
$line->remise_percent=0;
}
$this->lines[$xnbp]=$line;
$this->total_ht += $line->total_ht;
$this->total_tva += $line->total_tva;
$this->total_ttc += $line->total_ttc;
$this->multicurrency_total_ht += $line->multicurrency_total_ht;
$this->multicurrency_total_tva += $line->multicurrency_total_tva;
$this->multicurrency_total_ttc += $line->multicurrency_total_ttc;
$xnbp++;
}
$this->revenuestamp = 0;
@ -3894,6 +3910,9 @@ class Facture extends CommonInvoice
$line->total_ht=0;
$line->total_ttc=0; // 90 * 1.196
$line->total_tva=0;
$line->multicurrency_total_ht=0;
$line->multicurrency_total_ttc=0;
$line->multicurrency_total_tva=0;
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];

View File

@ -300,7 +300,7 @@ if (empty($reshook))
// Delete
if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && $user->rights->facture->supprimer)
{
$object->delete();
$object->delete($user);
header("Location: " . $_SERVER['PHP_SELF'] );
exit;
}

View File

@ -36,7 +36,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
@ -44,13 +44,17 @@ foreach($linkedObjectBlock as $key => $objectlink)
<td><?php echo $langs->trans("RepeatableInvoice"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td>
<td align="center"></td>
<td align="center"><?php echo dol_print_date($objectlink->date,'day'); ?></td>
<td align="center"><?php echo dol_print_date($objectlink->date_when,'day'); ?></td>
<td align="right"><?php
if ($user->rights->facture->lire) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
} ?></td>
<td align="right"></td>
<td align="right">
<?php
print $objectlink->getLibStatut(3);
?>
</td>
<td align="right"><a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key; ?>"><?php echo img_delete($langs->transnoentitiesnoconv("RemoveLink")); ?></a></td>
</tr>
<?php

View File

@ -585,11 +585,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyalreadypayedlabel.'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyremaindertopay.'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right">'.$alreadypayedlabel.'</td>';
print '<td align="right">'.$remaindertopay.'</td>';
print '<td align="right">'.$langs->trans('PaymentAmount').'</td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
@ -659,6 +659,29 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td align="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
print '</td>';
print '<td align="right">';
// Add remind multicurrency amount
$namef = 'multicurrency_amount_'.$objp->facid;
$nameRemain = 'multicurrency_remain_'.$objp->facid;
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
{
if ($action != 'add_paiement')
{
if (!empty($conf->use_javascript_ajax))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
}
else
{
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
}
}
print "</td>";
}
// Price
@ -695,33 +718,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print "</td>";
// Multicurrency Price
if (! empty($conf->multicurrency->enabled))
{
print '<td align="right">';
// Add remind multicurrency amount
$namef = 'multicurrency_amount_'.$objp->facid;
$nameRemain = 'multicurrency_remain_'.$objp->facid;
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
{
if ($action != 'add_paiement')
{
if (!empty($conf->use_javascript_ajax))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
}
else
{
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
}
}
print "</td>";
}
// Warning
print '<td align="center" width="16">';
//print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."<br>";
@ -754,6 +750,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
print '<td align="right"><b>'.price($sign * $total_ttc).'</b></td>';
print '<td align="right"><b>'.price($sign * $totalrecu);
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
@ -761,7 +758,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '</b></td>';
print '<td align="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
print '<td align="right" id="result" style="font-weight: bold;"></td>'; // Autofilled
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}

View File

@ -44,7 +44,7 @@ $date_startyear=GETPOST('date_startyear','int');
$date_endmonth=GETPOST('date_endmonth','int');
$date_endday=GETPOST('date_endday','int');
$date_endyear=GETPOST('date_endyear','int');
$showaccountdetail = GETPOST('showaccountdetail','aZ09');
$showaccountdetail = GETPOST('showaccountdetail','aZ09')?GETPOST('showaccountdetail','aZ09'):'no';
// Security check
$socid = GETPOST('socid','int');
@ -156,7 +156,7 @@ $total_ttc=0;
// Affiche en-tete de rapport
if ($modecompta=="CREANCES-DETTES")
{
$name=$langs->trans("AnnualByCompanies");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">','</a>').')';
@ -170,7 +170,7 @@ if ($modecompta=="CREANCES-DETTES")
}
elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("AnnualByCompanies");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=BOOKKEEPING">','</a>').')';
@ -183,13 +183,14 @@ elseif ($modecompta=="RECETTES-DEPENSES")
}
elseif ($modecompta=="BOOKKEEPING")
{
$name=$langs->trans("AnnualByCompanies");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByPredefinedAccountGroups");
$calcmode=$langs->trans("CalcModeBookkeeping");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?date_startyear='.$tmps['year'].'&date_startmonth='.$tmps['mon'].'&date_startday='.$tmps['mday'].'&date_endyear='.$tmpe['year'].'&date_endmonth='.$tmpe['mon'].'&date_endday='.$tmpe['mday'].'&modecompta=CREANCES-DETTES">','</a>').')';
//$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1);
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectyesno('showaccountdetail',$showaccountdetail,0);
$arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year']-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($tmps['year']+1)."&modecompta=".$modecompta."'>".img_next()."</a>":"");
$description=$langs->trans("RulesResultBookkeepingPredefined");
$description.=' ('.$langs->trans("SeePageForSetup", DOL_URL_ROOT.'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin', $langs->transnoentitiesnoconv("Accountancy").' / '.$langs->transnoentitiesnoconv("Setup").' / '.$langs->trans("Chartofaccounts")).')';
@ -291,7 +292,7 @@ if ($modecompta == 'BOOKKEEPING')
// Loop on detail of all accounts
// This make 14 calls for each detail of account (NP, N and month m)
if ($showaccountdetail == 'yes')
if ($showaccountdetail != 'no')
{
$tmppredefinedgroupwhere="pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'";
$tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$charofaccountstring."'";
@ -310,7 +311,8 @@ if ($modecompta == 'BOOKKEEPING')
$resultN=$AccCat->sdc;
}
if ($resultN > 0)
if ($showaccountdetail == 'all' || $resultN > 0)
{
print '<tr>';
print '<td></td>';

View File

@ -118,7 +118,7 @@ $exportlink='';
// Affiche en-tete du rapport
if ($modecompta == 'CREANCES-DETTES')
{
$name=$langs->trans("AnnualSummaryDueDebtMode");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeDebt");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
@ -132,7 +132,7 @@ if ($modecompta == 'CREANCES-DETTES')
//$exportlink=$langs->trans("NotYetAvailable");
}
else if ($modecompta=="RECETTES-DEPENSES") {
$name=$langs->trans("AnnualSummaryInputOutputMode");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInBookkeepingMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=BOOKKEEPING">','</a>').')';
@ -145,7 +145,7 @@ else if ($modecompta=="RECETTES-DEPENSES") {
}
else if ($modecompta=="BOOKKEEPING")
{
$name=$langs->trans("AnnualSummaryDueDebtMode");
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeBookkeeping");
$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
@ -636,12 +636,12 @@ if (! empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $m
$subtotal_ht = 0;
$subtotal_ttc = 0;
$sql = "SELECT p.label as nom, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
$sql = "SELECT p.label as nom, date_format(".$column.",'%Y-%m') as dm, sum(p.amount) as amount";
$sql .= " FROM " . MAIN_DB_PREFIX . "payment_salary as p";
$sql .= " WHERE p.entity = " . $conf->entity;
$sql .= " GROUP BY p.label, dm";
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'";
$sql .= " GROUP BY p.label, dm";
dol_syslog("get social salaries payments");
$result = $db->query($sql);

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016-2017 Jamal Elbaz <jamelbaz@gmail.com>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Laurent Destailleur <eldy@destailleur.fr>
*
* 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
@ -40,7 +41,7 @@ $selectcpt = GETPOST('cpt_bk');
$id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'int');
$cancel = GETPOST('cancel','alpha');
$showaccountdetail = GETPOST('showaccountdetail','aZ09');
$showaccountdetail = GETPOST('showaccountdetail','aZ09')?GETPOST('showaccountdetail','aZ09'):'no';
$date_startmonth=GETPOST('date_startmonth','int');
@ -56,12 +57,12 @@ $nbofyear=1;
$year=GETPOST('year','int');
if (empty($year))
{
$year_current = strftime("%Y",dol_now());
$month_current = strftime("%m",dol_now());
$year_current = strftime("%Y", dol_now());
$month_current = strftime("%m", dol_now());
$year_start = $year_current - ($nbofyear - 1);
} else {
$year_current = $year;
$month_current = strftime("%m",dol_now());
$month_current = strftime("%m", dol_now());
$year_start = $year - ($nbofyear - 1);
}
$date_start=dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
@ -76,6 +77,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
// We define date_start and date_end
$year_end=$year_start + ($nbofyear - 1);
$month_start=GETPOST("month")?GETPOST("month"):($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
$date_startmonth = $month_start;
if (! GETPOST('month'))
{
if (! GETPOST("year") && $month_start > $month_current)
@ -195,7 +197,8 @@ else if ($modecompta=="BOOKKEEPING")
//$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectyesno('showaccountdetail',$showaccountdetail,0);
$arraylist=array('no'=>$langs->trans("No"), 'yes'=>$langs->trans("AccountWithNonZeroValues"), 'all'=>$langs->trans("All"));
$period.=' &nbsp; &nbsp; '.$langs->trans("DetailByAccount").' '. $form->selectarray('showaccountdetail', $arraylist, $showaccountdetail, 0);
$periodlink = $textprevyear . " " . $langs->trans("Year") . " " . $start_year . " " . $textnextyear ;
$exportlink = '';
$description=$langs->trans("RulesResultBookkeepingPersonalized").
@ -225,7 +228,16 @@ print '<th class="liste_titre"></th>';
print '<th class="liste_titre" align="right">'.$langs->trans("PreviousPeriod").'</th>';
print '<th class="liste_titre" align="right">'.$langs->trans("SelectedPeriod").'</th>';
foreach($months as $k => $v){
print '<th class="liste_titre width50" align="right" >'.$langs->trans($v).'</th>';
if (($k+1) >= $date_startmonth)
{
print '<th class="liste_titre width50" align="right" >'.$langs->trans($v).'</th>';
}
}
foreach($months as $k => $v){
if (($k+1) < $date_startmonth)
{
print '<th class="liste_titre width50" align="right" >'.$langs->trans($v).'</th>';
}
}
print '</tr>';
@ -306,16 +318,35 @@ else if ($modecompta=="BOOKKEEPING")
// Detail by month
foreach($months as $k => $v)
{
foreach($sommes as $code => $det){
$vars[$code] = $det['M'][$k];
if (($k+1) >= $date_startmonth)
{
foreach($sommes as $code => $det){
$vars[$code] = $det['M'][$k];
}
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
print '<td class="liste_total right">' . price($r) . '</td>';
$sommes[$code]['M'][$k] += $r;
}
$result = strtr($formula, $vars);
}
foreach($months as $k => $v)
{
if (($k+1) < $date_startmonth)
{
foreach($sommes as $code => $det){
$vars[$code] = $det['M'][$k];
}
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
print '<td class="liste_total right">' . price($r) . '</td>';
$sommes[$code]['M'][$k] += $r;
print '<td class="liste_total right">' . price($r) . '</td>';
$sommes[$code]['M'][$k] += $r;
}
}
@ -418,38 +449,57 @@ else if ($modecompta=="BOOKKEEPING")
print '<td align="right">' . price($totCat['NP']) . '</td>';
print '<td align="right">' . price($totCat['N']) . '</td>';
// Each month
foreach($totCat['M'] as $k => $v){
print '<td align="right">' . price($v) . '</td>';
if (($k+1) >= $date_startmonth) print '<td align="right">' . price($v) . '</td>';
}
foreach($totCat['M'] as $k => $v){
if (($k+1) < $date_startmonth) print '<td align="right">' . price($v) . '</td>';
}
print "</tr>\n";
// Loop on detail of all accounts
// This make 14 calls for each detail of account (NP, N and month m)
if ($showaccountdetail == 'yes')
if ($showaccountdetail != 'no')
{
foreach($cpts as $i => $cpt)
{
$resultNP=$totPerAccount[$cpt['account_number']]['NP'];
$resultN=$totPerAccount[$cpt['account_number']]['N'];
print '<tr>';
print '<td></td>';
print '<td class="tdoverflowmax200">';
print ' &nbsp; &nbsp; ' . length_accountg($cpt['account_number']);
print ' - ';
print $cpt['account_label'];
print '</td>';
print '<td align="right">' . price($resultNP) . '</td>';
print '<td align="right">' . price($resultN) . '</td>';
// Make one call for each month
foreach($months as $k => $v)
if ($showaccountdetail == 'all' || $resultN > 0)
{
$resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
print '<td align="right">' . price($resultM) . '</td>';
}
print '<tr>';
print '<td></td>';
print '<td class="tdoverflowmax200">';
print ' &nbsp; &nbsp; ' . length_accountg($cpt['account_number']);
print ' - ';
print $cpt['account_label'];
print '</td>';
print '<td align="right">' . price($resultNP) . '</td>';
print '<td align="right">' . price($resultN) . '</td>';
print "</tr>\n";
// Make one call for each month
foreach($months as $k => $v)
{
if (($k+1) >= $date_startmonth)
{
$resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
print '<td align="right">' . price($resultM) . '</td>';
}
}
foreach($months as $k => $v)
{
if (($k+1) < $date_startmonth)
{
$resultM=$totPerAccount[$cpt['account_number']]['M'][$k];
print '<td align="right">' . price($resultM) . '</td>';
}
}
print "</tr>\n";
}
}
}
}

View File

@ -75,6 +75,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
*/
function assign_values(&$action, $id)
{
global $limit, $offset, $sortfield, $sortorder;
global $conf, $db, $langs, $user;
global $form;
@ -113,14 +114,14 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
if ($action == 'list')
{
$this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']);
$this->LoadListDatas($limit, $offset, $sortfield, $sortorder);
}
}
/**
* Fetch datas list
* Fetch datas list and save into ->list_datas
*
* @param int $limit Limit number of responses
* @param int $offset Offset for first response

View File

@ -665,7 +665,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
}
}
// Hook fields
$parameters=array('arrayfields'=>$arrayfields);
$parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder);
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);

View File

@ -2146,7 +2146,7 @@ else
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'contract', $socid);
$somethingshown = $formactions->showactions($object, 'contract', $socid, 1);
print '</div></div></div>';

View File

@ -2264,6 +2264,8 @@ abstract class CommonObject
$error=0;
$multicurrency_tx = !empty($this->multicurrency_tx) ? $this->multicurrency_tx : 1;
// Define constants to find lines to sum
$fieldtva='total_tva';
$fieldlocaltax1='total_localtax1';
@ -2316,7 +2318,6 @@ abstract class CommonObject
$obj = $this->db->fetch_object($resql);
// Note: There is no check on detail line and no check on total, if $forcedroundingmode = 'none'
$multicurrency_tx = !empty($this->multicurrency_tx) ? $this->multicurrency_tx : 1;
if ($forcedroundingmode == '0') // Check if data on line are consistent. This may solve lines that were not consistent because set with $forcedroundingmode='auto'
{
$localtax_array=array($obj->localtax1_type,$obj->localtax1_tx,$obj->localtax2_type,$obj->localtax2_tx);
@ -2334,11 +2335,14 @@ abstract class CommonObject
}
}
$this->total_ht += $obj->total_ht; // The only field visible at end of line detail
$this->total_ht += $obj->total_ht; // The field visible at end of line detail
$this->total_tva += $obj->total_tva;
$this->total_localtax1 += $obj->total_localtax1;
$this->total_localtax2 += $obj->total_localtax2;
$this->total_ttc += $obj->total_ttc;
$this->multicurrency_total_ht += $obj->multicurrency_total_ht; // The field visible at end of line detail
$this->multicurrency_total_tva += $obj->multicurrency_total_tva;
$this->multicurrency_total_ttc += $obj->multicurrency_total_ttc;
if (! isset($total_ht_by_vats[$obj->vatrate])) $total_ht_by_vats[$obj->vatrate]=0;
if (! isset($total_tva_by_vats[$obj->vatrate])) $total_tva_by_vats[$obj->vatrate]=0;
@ -2347,7 +2351,7 @@ abstract class CommonObject
$total_tva_by_vats[$obj->vatrate] += $obj->total_tva;
$total_ttc_by_vats[$obj->vatrate] += $obj->total_ttc;
if ($forcedroundingmode == '1') // Check if we need adjustement onto line for vat
if ($forcedroundingmode == '1') // Check if we need adjustement onto line for vat. TODO This works on the company currency but not on multicurrency
{
$tmpvat=price2num($total_ht_by_vats[$obj->vatrate] * $obj->vatrate / 100, 'MT', 1);
$diff=price2num($total_tva_by_vats[$obj->vatrate]-$tmpvat, 'MT', 1);
@ -2371,26 +2375,25 @@ abstract class CommonObject
}
// Add revenue stamp to total
$this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0;
$this->total_ttc += isset($this->revenuestamp)?$this->revenuestamp:0;
$this->multicurrency_total_ttc += isset($this->revenuestamp)?($this->revenuestamp * $multicurrency_tx):0;
// Situations totals
if ($this->situation_cycle_ref && $this->situation_counter > 1) {
if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {
$prev_sits = $this->get_prev_sits();
foreach ($prev_sits as $sit) {
foreach ($prev_sits as $sit) { // $sit is an object Facture loaded with a fetch.
$this->total_ht -= $sit->total_ht;
$this->total_tva -= $sit->total_tva;
$this->total_localtax1 -= $sit->total_localtax1;
$this->total_localtax2 -= $sit->total_localtax2;
$this->total_ttc -= $sit->total_ttc;
$this->multicurrency_total_ht -= $sit->multicurrency_total_ht;
$this->multicurrency_total_tva -= $sit->multicurrency_total_tva;
$this->multicurrency_total_ttc -= $sit->multicurrency_total_ttc;
}
}
// Multicurrency
$this->multicurrency_total_ht += $this->total_ht * $multicurrency_tx;
$this->multicurrency_total_tva += $this->total_tva * $multicurrency_tx;
$this->multicurrency_total_ttc += $this->total_ttc * $multicurrency_tx;
$this->db->free($resql);
// Now update global field total_ht, total_ttc and tva
@ -2404,7 +2407,7 @@ abstract class CommonObject
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') $fieldtva='total_tva';
if ($this->element == 'propal') $fieldttc='total';
if ($this->element == 'expensereport') $fieldtva='total_tva';
if ($this->element == 'supplier_proposal') $fieldttc='total';
if ($this->element == 'supplier_proposal') $fieldttc='total';
if (empty($nodatabaseupdate))
{
@ -4210,7 +4213,7 @@ abstract class CommonObject
*
* @param int $rowid Id of line. Use the id of object if not defined. 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 optionals to find nor found, 1 if a line is found and optional 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)
{

View File

@ -83,11 +83,12 @@ class Conf
$this->file = new stdClass();
$this->db = new stdClass();
$this->global = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->user = new stdClass();
$this->syslog = new stdClass();
$this->browser = new stdClass();
$this->medias = new stdClass();
$this->multicompany = new stdClass();
//! Charset for HTML output and for storing data in memory
@ -96,7 +97,7 @@ class Conf
// First level object
// TODO Remove this part.
$this->expedition_bon = new stdClass();
$this->livraison_bon = new stdClass();
$this->livraison_bon = new stdClass();
$this->fournisseur = new stdClass();
$this->product = new stdClass();
$this->service = new stdClass();
@ -106,12 +107,12 @@ class Conf
$this->propal = new stdClass();
$this->facture = new stdClass();
$this->contrat = new stdClass();
$this->usergroup = new stdClass();
$this->usergroup = new stdClass();
$this->adherent = new stdClass();
$this->bank = new stdClass();
$this->notification = new stdClass();
$this->mailing = new stdClass();
$this->expensereport = new stdClass();
$this->expensereport = new stdClass();
}
@ -322,6 +323,10 @@ class Conf
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";
// For medias storage
$this->medias->multidir_output = array($this->entity => $rootfordata."/medias");
$this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp");
// Exception: Some dir are not the name of module. So we keep exception here for backward compatibility.
// Sous module bons d'expedition

View File

@ -64,7 +64,7 @@ class DiscountAbsolute
* @param int $fk_facture_source fk_facture_source
* @return int <0 if KO, =0 if not found, >0 if OK
*/
function fetch($rowid,$fk_facture_source=0)
function fetch($rowid, $fk_facture_source=0)
{
global $conf;
@ -386,7 +386,7 @@ class DiscountAbsolute
function getSumDepositsUsed($invoice, $multicurrency=0)
{
dol_syslog(get_class($this)."::getSumDepositsUsed", LOG_DEBUG);
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
@ -407,7 +407,7 @@ class DiscountAbsolute
dol_print_error($this->error);
return -1;
}
$resql=$this->db->query($sql);
if ($resql)
{
@ -432,7 +432,7 @@ class DiscountAbsolute
function getSumCreditNotesUsed($invoice, $multicurrency=0)
{
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
@ -453,7 +453,7 @@ class DiscountAbsolute
dol_print_error($this->error);
return -1;
}
$resql=$this->db->query($sql);
if ($resql)
{

View File

@ -155,16 +155,18 @@ class FormActions
* @param int $socid socid of user
* @param int $forceshowtitle Show title even if there is no actions to show
* @param string $morecss More css on table
* @param int $max Max number of record
* @param string $moreparambacktopage More param for the backtopage
* @return int <0 if KO, >=0 if OK
*/
function showactions($object,$typeelement,$socid=0,$forceshowtitle=0,$morecss='listactions')
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='')
{
global $langs,$conf,$user;
global $bc;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement);
$listofactions=ActionComm::getActions($this->db, $socid, $object->id, $typeelement, '', '', '', ($max?($max+1):0));
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
$num = count($listofactions);
@ -177,12 +179,15 @@ class FormActions
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
elseif ($typeelement == 'project') $title=$langs->trans('ActionsOnProject');
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
else $title=$langs->trans("Actions");
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
else $title=$langs->trans("Actions");
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">';
$urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.'&socid='.$object->socid.'&projectid='.$object->fk_project.'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>';
print load_fiche_titre($title, $buttontoaddnewevent, '');
@ -197,7 +202,7 @@ class FormActions
print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Action', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Type', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('Date', $_SERVER["PHP_SELF"], '', $page, $param, 'align="center"');
print_liste_field_titre('By', $_SERVER["PHP_SELF"], '', $page, $param, '');
print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $page, $param, 'align="right"');
print '</tr>';
@ -205,8 +210,11 @@ class FormActions
$userstatic = new User($this->db);
$cursorevent = 0;
foreach($listofactions as $action)
{
if ($max && $cursorevent >= $max) break;
$ref=$action->getNomUrl(1,-1);
$label=$action->getNomUrl(0,38);
@ -226,7 +234,7 @@ class FormActions
}
print $action->type;
print '</td>';
print '<td>'.dol_print_date($action->datep,'dayhour');
print '<td align="center">'.dol_print_date($action->datep,'dayhour');
if ($action->datef)
{
$tmpa=dol_getdate($action->datep);
@ -254,7 +262,15 @@ class FormActions
}
print '</td>';
print '</tr>';
$cursorevent++;
}
if ($max && $num > $max)
{
print '<tr class="oddeven"><td colspan="6">'.$langs->trans("More").'...</td></tr>';
}
print '</table>';
print '</div>';
}

View File

@ -509,6 +509,9 @@ class FormProjets
$sql = 'SELECT t.rowid, t.label as ref';
$projectkey='fk_origin';
break;
case "payment_various":
$sql = "SELECT t.rowid, t.num_payment as ref";
break;
case "chargesociales":
default:
$sql = "SELECT t.rowid, t.ref";

View File

@ -510,8 +510,6 @@ class FormWebsite
{
if ($lines[$i]->fk_parent == $parent)
{
$var = !$var;
//var_dump($selectedproject."--".$selectedtask."--".$lines[$i]->fk_project."_".$lines[$i]->id); // $lines[$i]->id may be empty if project has no lines
// Break on a new project
@ -1119,7 +1117,7 @@ class FormWebsite
$emptybox=new ModeleBoxes($db);
$boxlista.="\n<!-- Box left container -->\n";
$boxlista ="\n<!-- Box left container -->\n";
$boxlista.='<div id="left" class="connectedSortable">'."\n";
// Define $box_max_lines
@ -1152,7 +1150,7 @@ class FormWebsite
$boxlista.= "</div>\n";
$boxlista.= "<!-- End box left container -->\n";
$boxlistb.= "\n<!-- Box right container -->\n";
$boxlistb = "\n<!-- Box right container -->\n";
$boxlistb.= '<div id="right" class="connectedSortable">'."\n";
$ii=0;

View File

@ -185,6 +185,9 @@ class DoliDBMysqli extends DoliDB
{
dol_syslog(get_class($this) . "::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name", LOG_DEBUG);
// Can also be
// mysqli::init(); mysql::options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0'); mysqli::options(MYSQLI_OPT_CONNECT_TIMEOUT, 5);
// return mysqli::real_connect($host, $user, $pass, $db, $port);
return new mysqli($host, $login, $passwd, $name, $port);
}

View File

@ -1251,7 +1251,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='')
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="titlefield">'.$langs->trans("Description").'</td>';
print '<td>';
$text = $langs->trans("Value");
print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext');

View File

@ -1964,7 +1964,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
{
$accessallowed=1;
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
$original_file=$conf->medias->multidir_output[$entity].'/'.$original_file;
}
// Wrapping for *.log files, like when used with url http://.../document.php?modulepart=logs&file=dolibarr.log
elseif ($modulepart == 'logs' && !empty($dolibarr_main_data_root))

View File

@ -309,12 +309,25 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
// Else, retreive default values if we are not doing a sort
elseif (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_ENABLE_DEFAULT_VALUES is not set
{
if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
{
if (! empty($user->default_values)) // $user->default_values defined from menu default values
{
//var_dump($user->default_values[$relativepathstring]['createform']);
if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname];
$qualified=1;
if (isset($user->default_values[$relativepathstring]['createform_queries'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
{
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['createform_queries']);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
}
}
if ($qualified)
{
//var_dump($user->default_values[$relativepathstring]['createform']);
if (isset($user->default_values[$relativepathstring]['createform'][$paramname])) $out = $user->default_values[$relativepathstring]['createform'][$paramname];
}
}
}
// Management of default search_filters and sort order
@ -330,7 +343,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
if (isset($user->default_values[$relativepathstring]['sortorder_queries'])) // Even if paramname is sortfield, data are stored into ['sortorder...']
{
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['sortorder_queries']);
$tmpqueryarraywehave=explode('&', $_SERVER['QUERY_STRING']);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
@ -355,7 +368,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
if (isset($user->default_values[$relativepathstring]['sortorder_queries']))
{
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['sortorder_queries']);
$tmpqueryarraywehave=explode('&', $_SERVER['QUERY_STRING']);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
@ -380,7 +393,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
if (isset($user->default_values[$relativepathstring]['filters_queries']))
{
$tmpqueryarraytohave=explode('&', $user->default_values[$relativepathstring]['filters_queries']);
$tmpqueryarraywehave=explode('&', $_SERVER['QUERY_STRING']);
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
foreach($tmpqueryarraytohave as $tmpquerytohave)
{
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $qualified=0;
@ -3596,8 +3609,8 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
// Right
print '<td class="nobordernopadding valignmiddle" align="right">';
if ($sortfield) $options .= "&amp;sortfield=".$sortfield;
if ($sortorder) $options .= "&amp;sortorder=".$sortorder;
if ($sortfield) $options .= "&sortfield=".$sortfield;
if ($sortorder) $options .= "&sortorder=".$sortorder;
// Show navigation bar
$pagelist = '';
if ($savlimit != 0 && ($page > 0 || $num > $limit))

View File

@ -1808,6 +1808,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
$module='ficheinter';
$subelement='fichinter';
}
if ($objecttype == 'task') {
$classpath = 'projet/class';
$module='projet';
$subelement='task';
}
//print "objecttype=".$objecttype." module=".$module." subelement=".$subelement;
@ -2240,3 +2245,25 @@ function getModuleDirForApiClass($module)
return $moduledirforclass;
}
/*
* Return 2 hexa code randomly
*
* @param $min int Between 0 and 255
* @param $max int Between 0 and 255
* @return String
*/
function random_color_part($min=0,$max=255) {
return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT);
}
/*
* Return hexadecimal color randomly
*
* @param $min int Between 0 and 255
* @param $max int Between 0 and 255
* @return String
*/
function random_color($min=0, $max=255) {
return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max);
}

View File

@ -100,7 +100,7 @@ function member_prepare_head(Adherent $object)
$head[$h][2] = 'agenda';
$h++;
}
complete_head_from_modules($conf,$langs,$object,$head,$h,'member','remove');
return $head;
@ -152,6 +152,11 @@ function member_admin_prepare_head()
$head[$h][2] = 'general';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_emails.php';
$head[$h][1] = $langs->trans("EMails");
$head[$h][2] = 'emails';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@ -168,9 +173,9 @@ function member_admin_prepare_head()
$head[$h][2] = 'attributes_type';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/public.php';
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/website.php';
$head[$h][1] = $langs->trans("BlankSubscriptionForm");
$head[$h][2] = 'public';
$head[$h][2] = 'website';
$h++;
complete_head_from_modules($conf,$langs,'',$head,$h,'member_admin','remove');

View File

@ -88,6 +88,135 @@ function payment_supplier_prepare_head(Paiement $object) {
}
/**
* Return string with full Url
*
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
* @param string $ref Ref of object
* @return string Url string
*/
function showOnlinePaymentUrl($type,$ref)
{
global $conf, $langs;
$langs->load("PAYMENT");
$langs->load("paybox");
$servicename='Online';
$out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'<br>';
$url = getOnlinePaymentUrl(0,$type,$ref);
$out.= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
$out.= ajax_autoselect("onlinepaymenturl", 0);
return $out;
}
/**
* Return string with full Url
*
* @param int $mode 0=True url, 1=Url formated with colors
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
* @param string $ref Ref of object
* @param int $amount Amount
* @param string $freetag Free tag
* @return string Url string
*/
function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_free_tag')
{
global $conf;
$ref=str_replace(' ','',$ref);
$out='';
if ($type == 'free')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?amount='.($mode?'<font color="#666666">':'').$amount.($mode?'</font>':'').'&tag='.($mode?'<font color="#666666">':'').$freetag.($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
}
}
if ($type == 'order')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='order_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + order_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
if ($type == 'invoice')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='invoice_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + invoice_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
if ($type == 'contractline')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='contractline_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + contractline_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
if ($type == 'membersubscription')
{
$out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.='member_ref';
if ($mode == 0) $out.=urlencode($ref);
$out.=($mode?'</font>':'');
if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
{
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
else
{
$out.='&securekey='.($mode?'<font color="#666666">':'');
if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)";
if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2);
$out.=($mode?'</font>':'');
}
}
}
// For multicompany
if (! empty($out)) $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
return $out;
}
/**
* Show footer of company in HTML pages

View File

@ -50,8 +50,8 @@
* @param array $localtaxes_array Array with localtaxes info array('0'=>type1,'1'=>rate1,'2'=>type2,'3'=>rate2) (loaded by getLocalTaxesFromRate(vatrate, 0, ...) function).
* @param integer $progress Situation invoices progress (value from 0 to 100, 100 by default)
* @param double $multicurrency_tx Currency rate (1 by default)
* @param double $pu_ht_devise Amount in currency
* @return array [
* @param double $pu_devise Amount in currency
* @return array [
* 0=total_ht,
* 1=total_vat, (main vat only)
* 2=total_ttc, (total_ht + main vat + local taxes)
@ -65,15 +65,16 @@
* 10=total_tax2 for total_ht,
* 11=pu_tax1 for pu_ht, !! should not be used
* 12=pu_tax2 for pu_ht, !! should not be used
* 13=!! should not be used
* 13=?? !! should not be used
* 14=total_tax1 for total_ht_without_discount,
* 15=total_tax2 for total_ht_without_discount]
* 15=total_tax2 for total_ht_without_discount,
*
* 16=multicurrency_total_ht
* 17=multicurrency_total_tva
* 18=multicurrency_total_ttc
* 19=multicurrency_pu_ht
*/
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_ht_devise=0)
function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '', $localtaxes_array='', $progress=100, $multicurrency_tx=1, $pu_devise=0)
{
global $conf,$mysoc,$db;
@ -101,10 +102,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
//dol_syslog("Price.lib::calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
$countryid=$seller->country_id;
if (is_numeric($uselocaltax1_rate)) $uselocaltax1_rate=(float) $uselocaltax1_rate;
if (is_numeric($uselocaltax2_rate)) $uselocaltax2_rate=(float) $uselocaltax2_rate;
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
@ -143,14 +144,15 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
}
else dol_print_error($db);
}
// pu calculation from pu_devise if pu empty
if(empty($pu) && !empty($pu_ht_devise)) {
$pu = $pu_ht_devise / $multicurrency_tx;
} else {
$pu_ht_devise = $pu * $multicurrency_tx;
if(empty($pu) && !empty($pu_devise)) {
$pu = $pu_devise / $multicurrency_tx;
}
if(empty($pu_devise) && !empty($multicurrency_tx)) {
$pu_devise = $pu * $multicurrency_tx;
}
// initialize total (may be HT or TTC depending on price_base_type)
$tot_sans_remise = $pu * $qty * $progress / 100;
$tot_avec_remise_ligne = $tot_sans_remise * (1 - ($remise_percent_ligne / 100));
@ -338,13 +340,47 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
}
}
// Multicurrency
$result[16] = price2num($result[0] * $multicurrency_tx, 'MT');
$result[17] = price2num($result[1] * $multicurrency_tx, 'MT');
$result[18] = price2num($result[2] * $multicurrency_tx, 'MT');
$result[19] = price2num($pu_ht_devise, 'MU');
if ($multicurrency_tx != 1)
{
// Recal function using the multicurrency price as reference price. We must set param $multicurrency_tx to 1 to avoid infinite loop.
$newresult = calcul_price_total($qty, $pu_devise, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller, $localtaxes_array, $progress, 1, 0);
$result[16] = $newresult[0];
$result[17] = $newresult[1];
$result[18] = $newresult[2];
$result[19] = $newresult[3];
$result[20] = $newresult[4];
$result[21] = $newresult[5];
$result[22] = $newresult[6];
$result[23] = $newresult[7];
$result[24] = $newresult[8];
$result[25] = $newresult[9];
$result[26] = $newresult[10];
/*
$result[16] = price2num($result[0] * $multicurrency_tx, 'MT');
$result[17] = price2num($result[1] * $multicurrency_tx, 'MT');
$result[18] = price2num($result[2] * $multicurrency_tx, 'MT');
$result[19] = price2num($pu_devise, 'MU');
*/
}
else
{
$result[16] = $result[0];
$result[17] = $result[1];
$result[18] = $result[2];
$result[19] = $result[3];
$result[20] = $result[4];
$result[21] = $result[5];
$result[22] = $result[6];
$result[23] = $result[7];
$result[24] = $result[8];
$result[25] = $result[9];
$result[26] = $result[10];
}
//var_dump($result);
// initialize result array
//for ($i=0; $i <= 18; $i++) $result[$i] = (float) $result[$i];

View File

@ -175,6 +175,17 @@ function task_prepare_head($object)
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
// Manage discussion
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK))
{
$nbComments= $object->getNbComments();
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$head[$h][1] = $langs->trans("TaskCommentLinks");
if ($nbComments > 0) $head[$h][1].= ' <span class="badge">'.$nbComments.'</span>';
$head[$h][2] = 'task_comment';
$h++;
}
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
{
@ -187,7 +198,7 @@ function task_prepare_head($object)
$head[$h][2] = 'task_notes';
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
$filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

View File

@ -250,7 +250,7 @@ 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->accounting->enabled', __HANDLER__, 'left', 2435__+MAX_llx_menu__, 'accountancy', 'balance', 2400__+MAX_llx_menu__, '/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_balance', 'AccountBalance', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 16, __ENTITY__);
-- Reports
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->accounting->enabled', __HANDLER__, 'left', 2440__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2400__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'Reportings', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 17, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2441__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'MenuReportInOut', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 18, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2443__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPredefinedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 19, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2442__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2441__+MAX_llx_menu__, '/compta/resultat/result.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByPersonalizedAccountGroups', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 20, __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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2444__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2440__+MAX_llx_menu__, '/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ReportTurnover', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 21, __ENTITY__);
@ -259,7 +259,7 @@ 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->accounting->enabled && $leftmenu=="accountancy_report"', __HANDLER__, 'left', 2447__+MAX_llx_menu__, 'accountancy', 'accountancy_report', 2444__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy_report', 'ByProductsAndServices', 3, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 24, __ENTITY__);
-- Accounting simple
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->comptabilite->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 9__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2711__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'MenuReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2712__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2713__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 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->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2714__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);

View File

@ -1122,7 +1122,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/compta/resultat/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_report",$langs->trans("Reportings"),1,$user->rights->accounting->comptarapport->lire, '', $mainmenu, 'ca');
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("ReportInOut"),2,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=accountancy_report",$langs->trans("MenuReportInOut"),2,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=accountancy_report",$langs->trans("ByPredefinedAccountGroups"),3,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/resultat/result.php?leftmenu=accountancy_report",$langs->trans("ByPersonalizedAccountGroups"),3,$user->rights->accounting->comptarapport->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/',$leftmenu)) $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report",$langs->trans("ReportTurnover"),2,$user->rights->accounting->comptarapport->lire);
@ -1139,7 +1139,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// Bilan, resultats
$newmenu->add("/compta/resultat/index.php?leftmenu=report&amp;mainmenu=accountancy",$langs->trans("Reportings"),0,$user->rights->compta->resultat->lire, '', $mainmenu, 'ca');
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("ReportInOut"),1,$user->rights->compta->resultat->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/index.php?leftmenu=report",$langs->trans("MenuReportInOut"),1,$user->rights->compta->resultat->lire);
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/clientfourn.php?leftmenu=report",$langs->trans("ByCompanies"),2,$user->rights->compta->resultat->lire);
/* On verra ca avec module compabilite expert
if ($usemenuhider || empty($leftmenu) || preg_match('/report/',$leftmenu)) $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire);
@ -1468,8 +1468,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=outofdate",$langs->trans("MenuMembersNotUpToDate"),2,$user->rights->adherent->lire);
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=0",$langs->trans("MenuMembersResiliated"),2,$user->rights->adherent->lire);
$newmenu->add("/adherents/stats/index.php?leftmenu=members",$langs->trans("MenuMembersStats"),1,$user->rights->adherent->lire);
if (! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
if ($usemenuhider || empty($leftmenu) || $leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
if (! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && ($usemenuhider || empty($leftmenu) || $leftmenu=='none' || $leftmenu=="members" || $leftmenu=="export")) $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
$newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
$newmenu->add("/adherents/index.php?leftmenu=members&amp;mainmenu=members",$langs->trans("Subscriptions"),0,$user->rights->adherent->cotisation->lire);
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=-1,1&amp;mainmenu=members",$langs->trans("NewSubscription"),1,$user->rights->adherent->cotisation->creer);

View File

@ -859,6 +859,8 @@ class pdf_einstein extends ModelePDFCommandes
// Show VAT by rates and total
$pdf->SetFillColor(248,248,248);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull=0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
@ -1032,7 +1034,6 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
}
@ -1045,7 +1046,7 @@ class pdf_einstein extends ModelePDFCommandes
//$creditnoteamount=$object->getSumCreditNotesUsed();
//$depositsamount=$object->getSumDepositsUsed();
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if (! empty($object->paye)) $resteapayer=0;
if ($deja_regle > 0)

View File

@ -84,7 +84,7 @@ class pdf_rouget extends ModelePdfExpedition
}
$this->posxpicture=$this->posxweightvol - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images
if ($this->page_largeur < 210) // To work with US executive format
{
$this->posxweightvol-=20;
@ -92,7 +92,7 @@ class pdf_rouget extends ModelePdfExpedition
$this->posxqtyordered-=20;
$this->posxqtytoship-=20;
}
if (! empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
{
$this->posxweightvol += ($this->posxqtytoship - $this->posxqtyordered);
@ -139,17 +139,17 @@ class pdf_rouget extends ModelePdfExpedition
if (! empty($conf->global->MAIN_GENERATE_SHIPMENT_WITH_PICTURE))
{
$objphoto = new Product($this->db);
for ($i = 0 ; $i < $nblignes ; $i++)
{
if (empty($object->lines[$i]->fk_product)) continue;
$objphoto = new Product($this->db);
$objphoto->fetch($object->lines[$i]->fk_product);
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
$dir = $conf->product->dir_output.'/'.$pdir;
$realpath='';
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
@ -169,17 +169,17 @@ class pdf_rouget extends ModelePdfExpedition
{
$filename=$obj['photo'];
}
$realpath = $dir.$filename;
break;
}
if ($realpath) $realpatharray[$i]=$realpath;
}
}
if (count($realpatharray) == 0) $this->posxpicture=$this->posxweightvol;
if (count($realpatharray) == 0) $this->posxpicture=$this->posxweightvol;
if ($conf->expedition->dir_output)
{
// Definition de $dir et $file
@ -219,7 +219,7 @@ class pdf_rouget extends ModelePdfExpedition
// Set nblignes with the new facture lines content after hook
$nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs);
$heightforinfotot = 8; // Height reserved to output the info and total part
@ -282,11 +282,11 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$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_incoterms+1);
$tab_top = $nexY+6;
$height_incoterms += 4;
}
@ -343,7 +343,7 @@ class pdf_rouget extends ModelePdfExpedition
// 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;
}
@ -400,7 +400,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->startTransaction();
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxpicture-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pageposafter=$pdf->getPage();
if ($pageposafter > $pageposbefore) // There is a pagebreak
{
@ -434,10 +434,10 @@ class pdf_rouget extends ModelePdfExpedition
$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.
@ -456,29 +456,29 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetXY($this->posxweightvol, $curY);
$weighttxt='';
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight)
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->weight)
{
$weighttxt=round($object->lines[$i]->weight * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->weight_units,"weight");
}
$voltxt='';
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume)
if ($object->lines[$i]->fk_product_type == 0 && $object->lines[$i]->volume)
{
$voltxt=round($object->lines[$i]->volume * $object->lines[$i]->qty_shipped, 5).' '.measuring_units_string($object->lines[$i]->volume_units?$object->lines[$i]->volume_units:0,"volume");
}
$pdf->writeHTMLCell($this->posxqtyordered - $this->posxweightvol + 2, 3, $this->posxweightvol - 1, $curY, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt, 0, 0, false, true, 'C');
//$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 3, $weighttxt.(($weighttxt && $voltxt)?'<br>':'').$voltxt,'','C');
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
{
$pdf->SetXY($this->posxqtyordered, $curY);
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 3, $object->lines[$i]->qty_asked,'','C');
}
$pdf->SetXY($this->posxqtytoship, $curY);
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C');
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT))
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT))
{
$pdf->SetXY($this->posxpuht, $curY);
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht-1), 3, price($object->lines[$i]->subprice, 0, $outputlangs),'','R');
@ -489,7 +489,7 @@ class pdf_rouget extends ModelePdfExpedition
$nexY+=3;
if ($weighttxt && $voltxt) $nexY+=2;
// Add line
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
{
@ -548,7 +548,7 @@ class pdf_rouget extends ModelePdfExpedition
}
// Affiche zone totaux
$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
// Pied de page
$this->_pagefoot($pdf,$object,$outputlangs);
@ -614,7 +614,7 @@ class pdf_rouget extends ModelePdfExpedition
}*/
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED)) $largcol2 = ($this->posxqtyordered - $this->posxweightvol);
else $largcol2 = ($this->posxqtytoship - $this->posxweightvol);
$useborder=0;
$index = 0;
@ -628,12 +628,12 @@ class pdf_rouget extends ModelePdfExpedition
$totalOrdered=$tmparray['ordered'];
$totalToShip=$tmparray['toship'];
// Set trueVolume and volume_units not currently stored into database
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
if ($object->trueWidth && $object->trueHeight && $object->trueDepth)
{
$object->trueVolume=price(($object->trueWidth * $object->trueHeight * $object->trueDepth), 0, $outputlangs, 0, 0);
$object->volume_units=$object->size_units * 3;
}
if ($totalWeight!='') $totalWeighttoshow=showDimensionInBestUnit($totalWeight, 0, "weight", $outputlangs);
if ($totalVolume!='') $totalVolumetoshow=showDimensionInBestUnit($totalVolume, 0, "volume", $outputlangs);
if ($object->trueWeight) $totalWeighttoshow=showDimensionInBestUnit($object->trueWeight, $object->weight_units, "weight", $outputlangs);
@ -642,48 +642,48 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetFillColor(255,255,255);
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1);
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
{
$pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1);
}
$pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1);
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
$pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1);
$pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1);
}
// Total Weight
if ($totalWeighttoshow)
{
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1);
$index++;
}
if ($totalVolumetoshow)
{
$pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1);
$index++;
}
if (! $totalWeighttoshow && ! $totalVolumetoshow) $index++;
$pdf->SetTextColor(0,0,0);
return ($tab2_top + ($tab2_hl * $index));
}
/**
* Show table for lines
*
@ -730,7 +730,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetXY($this->posxweightvol-1, $tab_top+1);
$pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), 2, $outputlangs->transnoentities("WeightVolShort"),'','C');
}
if (empty($conf->global->SHIPPING_PDF_HIDE_ORDERED))
{
$pdf->line($this->posxqtyordered-1, $tab_top, $this->posxqtyordered-1, $tab_top + $tab_height);
@ -740,14 +740,14 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->MultiCell(($this->posxqtytoship - $this->posxqtyordered), 2, $outputlangs->transnoentities("QtyOrdered"),'','C');
}
}
$pdf->line($this->posxqtytoship-1, $tab_top, $this->posxqtytoship-1, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxqtytoship, $tab_top+1);
$pdf->MultiCell(($this->posxpuht - $this->posxqtytoship), 2, $outputlangs->transnoentities("QtyToShip"),'','C');
}
if(!empty($conf->global->MAIN_PDF_SHIPPING_DISPLAY_AMOUNT_HT)) {
$pdf->line($this->posxpuht-1, $tab_top, $this->posxpuht-1, $tab_top + $tab_height);
@ -756,7 +756,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetXY($this->posxpuht-1, $tab_top+1);
$pdf->MultiCell(($this->posxtotalht - $this->posxpuht), 2, $outputlangs->transnoentities("PriceUHT"),'','C');
}
$pdf->line($this->posxtotalht-1, $tab_top, $this->posxtotalht-1, $tab_top + $tab_height);
if (empty($hidetop))
{
@ -765,7 +765,7 @@ class pdf_rouget extends ModelePdfExpedition
}
}
}
/**
@ -782,7 +782,7 @@ class pdf_rouget extends ModelePdfExpedition
global $conf,$langs,$mysoc;
$langs->load("orders");
$default_font_size = pdf_getPDFFontSize($outputlangs);
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
@ -798,7 +798,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetFont('','B', $default_font_size + 3);
$w = 110;
$posy=$this->marge_haute;
$posx=$this->page_largeur-$this->marge_droite-$w;
@ -865,7 +865,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetFont('','', $default_font_size + 1);
$posy+=5;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
@ -878,7 +878,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R');
}
if (! empty($object->thirdparty->code_client))
{
$posy+=4;
@ -906,7 +906,7 @@ class pdf_rouget extends ModelePdfExpedition
if ($result >= 0)
{
//$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects
$pdf->SetFont('','', $default_font_size - 2);
$text=$linkedobject->ref;
if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')';
@ -941,7 +941,7 @@ class pdf_rouget extends ModelePdfExpedition
$hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
// Show sender frame
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
@ -952,7 +952,7 @@ class pdf_rouget extends ModelePdfExpedition
$pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
$pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(255,255,255);
// Show sender name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B',$default_font_size);

View File

@ -214,9 +214,9 @@ class pdf_crabe extends ModelePDFFactures
{
$object->fetch_thirdparty();
$deja_regle = $object->getSommePaiement();
$amount_credit_notes_included = $object->getSumCreditNotesUsed();
$amount_deposits_included = $object->getSumDepositsUsed();
$deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
// Definition of $dir and $file
if ($object->specimen)
@ -773,7 +773,7 @@ class pdf_crabe extends ModelePDFFactures
// Loop on each deposits and credit notes included
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,";
$sql.= " re.description, re.fk_facture_source,";
$sql.= " f.type, f.datef";
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re, ".MAIN_DB_PREFIX ."facture as f";
@ -798,7 +798,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top+$y);
$pdf->MultiCell(20, 3, dol_print_date($obj->datef,'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
$pdf->MultiCell(20, 3, price(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
$pdf->MultiCell(20, 3, $text, 0, 'L', 0);
$pdf->SetXY($tab3_posx+58, $tab3_top+$y);
@ -817,7 +817,7 @@ class pdf_crabe extends ModelePDFFactures
// Loop on each payment
// TODO Call getListOfPaymentsgetListOfPayments instead of hard coded sql
$sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount,";
$sql = "SELECT p.datep as date, p.fk_paiement, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
$sql.= " cp.code";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."paiement as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id AND cp.entity = " . getEntity('c_paiement', 2);
@ -837,7 +837,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($tab3_posx, $tab3_top+$y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0);
$pdf->MultiCell(20, 3, price($sign * (($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);
@ -1062,6 +1062,8 @@ class pdf_crabe extends ModelePDFFactures
// Show VAT by rates and total
$pdf->SetFillColor(248,248,248);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull=0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
@ -1272,7 +1274,6 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1);
}
@ -1280,10 +1281,10 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,0);
$creditnoteamount=$object->getSumCreditNotesUsed();
$depositsamount=$object->getSumDepositsUsed();
$creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if ($object->paye) $resteapayer=0;
if ($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0)

View File

@ -40,28 +40,28 @@ class pdf_standard extends ModelePDFProduct
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.3 = array(5, 3)
*/
public $phpmin = array(5, 2);
public $phpmin = array(5, 2);
/**
* Dolibarr version of the loaded document
* @public string
@ -77,7 +77,7 @@ class pdf_standard extends ModelePDFProduct
public $marge_basse;
public $emetteur; // Objet societe qui emet
/**
* Constructor
@ -105,7 +105,7 @@ class pdf_standard extends ModelePDFProduct
$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
$this->option_codeproduitservice = 0; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
@ -145,7 +145,7 @@ class pdf_standard extends ModelePDFProduct
$outputlangs->load("deliveries");
$nblignes = count($object->lines);
if ($conf->produit->dir_output)
{
// Definition of $dir and $file
@ -160,7 +160,7 @@ class pdf_standard extends ModelePDFProduct
$dir = $conf->produit->dir_output . "/" . $objectref;
$file = $dir . "/" . $objectref . ".pdf";
}
$productFournisseur = new ProductFournisseur($this->db);
$supplierprices = $productFournisseur->list_product_fournisseur_price($object->id);
$object->supplierprices = $supplierprices;
@ -191,11 +191,11 @@ class pdf_standard extends ModelePDFProduct
$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);
@ -242,7 +242,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->SetFont('','B', $default_font_size);
$pdf->writeHTMLCell(190, 3, $this->marge_gauche, $tab_top, dol_htmlentitiesbr($object->label), 0, 1);
$nexY = $pdf->GetY();
$pdf->SetFont('','', $default_font_size);
$pdf->writeHTMLCell(190, 3, $this->marge_gauche, $nexY, dol_htmlentitiesbr($object->description), 0, 1);
$nexY = $pdf->GetY();
@ -270,7 +270,7 @@ class pdf_standard extends ModelePDFProduct
$nexY = $pdf->GetY();
}
// Affiche notes
// TODO There is no public note on product yet
$notetoshow=empty($object->note_public)?'':$object->note_public;
@ -424,7 +424,7 @@ class pdf_standard extends ModelePDFProduct
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva;
else $tvaligne=$object->lines[$i]->total_tva;
$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
@ -518,13 +518,10 @@ class pdf_standard extends ModelePDFProduct
$bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
}
*/
// Affiche zone infos
//$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
// Affiche zone totaux
//$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
// Pied de page
$this->_pagefoot($pdf,$object,$outputlangs);
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
@ -559,7 +556,7 @@ class pdf_standard extends ModelePDFProduct
}
}
/**
* Show table for lines
*
@ -576,42 +573,42 @@ class pdf_standard extends ModelePDFProduct
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='')
{
global $conf;
// Force to disable hidetop and hidebottom
$hidebottom=0;
if ($hidetop) $hidetop=-1;
$currency = !empty($currency) ? $currency : $conf->currency;
$default_font_size = pdf_getPDFFontSize($outputlangs);
// Amount in (at tab_top - 1)
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
if (empty($hidetop))
{
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency));
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
}
$pdf->SetDrawColor(128,128,128);
$pdf->SetFont('','', $default_font_size - 1);
// Output Rect
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
if (empty($hidetop))
{
$pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
$pdf->SetXY($this->posxdesc-1, $tab_top+1);
$pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
}
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
{
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
@ -621,14 +618,14 @@ class pdf_standard extends ModelePDFProduct
$pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
}
}
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
if (empty($hidetop))
{
$pdf->SetXY($this->posxup-1, $tab_top+1);
$pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
}
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
if (empty($hidetop))
{
@ -642,7 +639,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
}
if($conf->global->PRODUCT_USE_UNITS) {
$pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
if (empty($hidetop)) {
@ -651,7 +648,7 @@ class pdf_standard extends ModelePDFProduct
'C');
}
}
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if (empty($hidetop))
{
@ -661,7 +658,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
}
}
if ($this->atleastonediscount)
{
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
@ -672,7 +669,7 @@ class pdf_standard extends ModelePDFProduct
$pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
}
}
/**
* Show top header of page.
*
@ -686,33 +683,33 @@ class pdf_standard extends ModelePDFProduct
function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey="")
{
global $conf,$langs,$hookmanager;
$outputlangs->load("main");
$outputlangs->load("bills");
$outputlangs->load("propal");
$outputlangs->load("companies");
$outputlangs->load("orders");
$default_font_size = pdf_getPDFFontSize($outputlangs);
if ($object->type == 1) $titlekey='ServiceSheet';
else $titlekey='ProductSheet';
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
// Show Draft Watermark
if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
{
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
}
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('','B', $default_font_size + 3);
$posy=$this->marge_haute;
$posx=$this->page_largeur-$this->marge_droite-100;
$pdf->SetXY($this->marge_gauche,$posy);
// Logo
$logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
if ($this->emetteur->logo)
@ -735,23 +732,23 @@ class pdf_standard extends ModelePDFProduct
$text=$this->emetteur->name;
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
}
$pdf->SetFont('','B', $default_font_size + 3);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities($titlekey);
$pdf->MultiCell(100, 3, $title, '', 'R');
$pdf->SetFont('','B',$default_font_size);
$posy+=5;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
$posy+=1;
$pdf->SetFont('','', $default_font_size - 1);
/*if ($object->ref_client)
{
$posy+=5;
@ -759,13 +756,13 @@ class pdf_standard extends ModelePDFProduct
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
}*/
/*$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
*/
// Get contact
/*
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
@ -781,24 +778,24 @@ class pdf_standard extends ModelePDFProduct
$pdf->MultiCell(100, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}*/
$posy+=2;
// Show list of linked objects
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
if ($showaddress)
{
/*
// Sender properties
$carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
// Show sender
$posy=42;
$posx=$this->marge_gauche;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
$hautcadre=40;
// Show sender frame
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('','', $default_font_size - 2);
@ -808,23 +805,23 @@ class pdf_standard extends ModelePDFProduct
$pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
$pdf->SetTextColor(0,0,60);
// Show sender name
$pdf->SetXY($posx+2,$posy+3);
$pdf->SetFont('','B', $default_font_size);
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
$posy=$pdf->getY();
// Show sender information
$pdf->SetXY($posx+2,$posy);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
*/
}
$pdf->SetTextColor(0,0,0);
}
/**
* Show footer of page. Need this->emetteur object
*
@ -840,6 +837,6 @@ class pdf_standard extends ModelePDFProduct
$showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
return pdf_pagefoot($pdf,$outputlangs,'PRODUCT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
}
}

View File

@ -1012,6 +1012,8 @@ class pdf_azur extends ModelePDFPropales
// Show VAT by rates and total
$pdf->SetFillColor(248,248,248);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$this->atleastoneratenotnull=0;
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{
@ -1188,7 +1190,6 @@ class pdf_azur extends ModelePDFPropales
$pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
$total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1);
}

View File

@ -719,6 +719,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$useborder=0;
// Total TTC
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60);
@ -729,6 +730,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
$creditnoteamount=0;
$depositsamount=0;
//$creditnoteamount=$object->getSumCreditNotesUsed();
//$depositsamount=$object->getSumDepositsUsed();
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if (! empty($object->paye)) $resteapayer=0;
if ($deja_regle > 0)
{
$index++;
@ -745,7 +754,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle), $useborder, 'R', 1);
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetTextColor(0,0,0);
}
@ -879,6 +888,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
*/
function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
{
global $conf;
$sign=1;
if ($object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
$tab3_posx = 120;
$tab3_top = $posy + 8;
$tab3_width = 80;
@ -912,8 +926,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetFont('','', $default_font_size - 4);
// Loop on each deposits and credit notes included
//
// Loop on each payment
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount,";
$sql = "SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
$sql.= " cp.code";
$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX."paiementfourn as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON p.fk_paiement = cp.id AND cp.entity = " . getEntity('c_paiement', 2);
@ -931,7 +948,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($tab3_posx, $tab3_top+$y);
$pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date),'day',false,$outputlangs,true), 0, 'L', 0);
$pdf->SetXY($tab3_posx+21, $tab3_top+$y);
$pdf->MultiCell(20, 3, price($row->amount), 0, 'L', 0);
$pdf->MultiCell(20, 3, price($sign * (($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0);
$pdf->SetXY($tab3_posx+40, $tab3_top+$y);
$oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $row->code);

View File

@ -917,7 +917,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
//$creditnoteamount=$object->getSumCreditNotesUsed();
//$depositsamount=$object->getSumDepositsUsed();
//print "x".$creditnoteamount."-".$depositsamount;exit;
$resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
$resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
if (! empty($object->paye)) $resteapayer=0;
if ($deja_regle > 0)

View File

@ -49,7 +49,7 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
public function isActive()
{
global $conf;
// This function does not exists on some ISP (Ex: Free in France)
if (!function_exists('openlog')) return 0;
@ -81,15 +81,15 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface
*/
public function checkConfiguration()
{
global $langs;
global $conf, $langs;
$errors = array();
$facility = SYSLOG_FACILITY;
$facility = constant($conf->global->SYSLOG_FACILITY);
if ($facility)
{
// Only LOG_USER supported on Windows
if (! empty($_SERVER["WINDIR"])) $facility='LOG_USER';
if (! empty($_SERVER["WINDIR"])) $facility=constant('LOG_USER');
dol_syslog("admin/syslog: facility ".$facility);
}

View File

@ -313,7 +313,7 @@ class doc_generic_user_odt extends ModelePDFUser
{
$socobject=$object->client;
}
// Open and load template
require_once ODTPHP_PATH.'odf.php';
try {
@ -332,7 +332,7 @@ class doc_generic_user_odt extends ModelePDFUser
$this->error=$e->getMessage();
return -1;
}
// Make substitutions into odt
$array_user=$this->get_substitutionarray_user($object,$outputlangs);
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
@ -366,7 +366,7 @@ class doc_generic_user_odt extends ModelePDFUser
{
}
}
// Replace labels translated
$tmparray=$outputlangs->get_translations_for_substitutions();
foreach($tmparray as $key=>$value)
@ -422,12 +422,13 @@ class doc_generic_user_odt extends ModelePDFUser
return -1;
}
function get_substitutionarray_object($object,$outputlangs) {
function get_substitutionarray_object($object,$outputlangs,$array_key='object') {
$array_other=array();
foreach($object as $key => $value) {
if(!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value;
if (!is_array($value) && !is_object($value)) {
$array_other[$array_key.'_'.$key] = $value;
}
}
}
return $array_other;
}

View File

@ -35,13 +35,13 @@ elseif ($module == 'project') { $permission=$user->rights->projet->creer; }
elseif ($module == 'action') { $permission=$user->rights->agenda->myactions->create; }
elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer; }
elseif ($module == 'project_task') { $permission=$user->rights->projet->creer; }
elseif (! isset($permission) && isset($user->rights->$module->creer))
{
$permission=$user->rights->$module->creer;
elseif (! isset($permission) && isset($user->rights->$module->creer))
{
$permission=$user->rights->$module->creer;
}
elseif (! isset($permission) && isset($user->rights->$module->write))
{
$permission=$user->rights->$module->write;
$permission=$user->rights->$module->write;
}
$formcompany= new FormCompany($db);
@ -55,8 +55,8 @@ $userstatic=new User($db);
<div class="div-table-responsive">
<div class="tagtable centpercent noborder allwidth">
<?php
if ($permission) {
<?php
if ($permission) {
?>
<form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("Nature"); ?></div>
@ -72,7 +72,7 @@ if ($permission) {
$var=true;
if (empty($hideaddcontactforuser))
{
?>
<form class="tagtr impair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
@ -87,10 +87,10 @@ if ($permission) {
<?php
$tmpobject=$object;
if ($object->element == 'shipping' && is_object($objectsrc)) $tmpobject=$objectsrc;
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
echo $formcompany->selectTypeContact($tmpobject, '', 'type','internal');
?></div>
<div class="tagtd">&nbsp;</div>
<div class="tagtd right"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
<div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
</form>
<?php
@ -98,7 +98,7 @@ if ($permission) {
if (empty($hideaddcontactforthirdparty))
{
?>
<form class="tagtr pair" action="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id; ?>" method="POST">
@ -110,9 +110,9 @@ if ($permission) {
<div class="tagtd nowrap noborderbottom"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>
<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
<?php $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$object->socid; ?>
<?php
// add company icon before select list
if ($selectedCompany)
<?php
// add company icon before select list
if ($selectedCompany)
{
echo img_object('', 'company', 'class="hideonsmartphone"');
}
@ -129,14 +129,14 @@ if ($permission) {
$formcompany->selectTypeContact($tmpobject, '', 'type','external'); ?>
</div>
<div class="tagtd noborderbottom">&nbsp;</div>
<div class="tagtd right noborderbottom">
<div class="tagtd center noborderbottom">
<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (! $nbofcontacts) echo ' disabled'; ?>>
</div>
</form>
<?php
<?php
}
}
}
?>
<form class="tagtr liste_titre liste_titre_add formnoborder">

View File

@ -747,6 +747,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Set societeforaction.
if ($object->socid > 0) $societeforaction->fetch($object->socid);
$projectid = isset($object->fk_project)?$object->fk_project:0;
if ($object->element == 'project') $projectid = $object->id;
// Insertion action
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db);
@ -754,7 +757,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->code = 'AC_'.$action;
$actioncomm->label = $object->actionmsg2;
$actioncomm->note = $object->actionmsg; // TODO Replace with $actioncomm->email_msgid ? $object->email_content : $object->actionmsg
$actioncomm->fk_project = isset($object->fk_project)?$object->fk_project:0;
$actioncomm->fk_project = $projectid;
$actioncomm->datep = $now;
$actioncomm->datef = $now;
$actioncomm->durationp = 0;

View File

@ -2126,7 +2126,7 @@ else if ($id || $ref)
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'shipping',$socid);
$somethingshown = $formactions->showactions($object,'shipping',$socid,1);
print '</div></div></div>';
}

View File

@ -1708,7 +1708,7 @@ else if ($id > 0 || ! empty($ref))
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'fichinter',$socid);
$somethingshown = $formactions->showactions($object,'fichinter',$socid,1);
print '</div></div></div>';
}

View File

@ -559,9 +559,10 @@ class Fichinter extends CommonObject
/**
* Returns amount based on user thm
*
* @return float amount
* @return float Amount
*/
function getAmount() {
function getAmount()
{
global $db;
$amount = 0;
@ -571,13 +572,44 @@ class Fichinter extends CommonObject
$thm = $this->author->thm;
foreach($this->lines as &$line) {
$amount+=$line->qty * $thm;
foreach($this->lines as $line) {
$amount += ($line->duration / 60 / 60 * $thm);
}
return $amount;
return price2num($amount, 'MT');
}
/**
* Create a document onto disk according to template module.
*
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$langs;
$langs->load("interventions");
if (! dol_strlen($modele)) {
$modele = 'soleil';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->FICHEINTER_ADDON_PDF)) {
$modele = $conf->global->FICHEINTER_ADDON_PDF;
}
}
$modelpath = "core/modules/fichinter/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
/**

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
@ -1805,8 +1805,9 @@ class FactureFournisseur extends CommonInvoice
$response = new WorkboardResponse();
$response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
$response->label=$langs->trans("SupplierBillsToPay");
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0&mainmenu=accountancy&leftmenu=suppliers_bills';
$response->img=img_object('',"bill");
$response->img=img_object($langs->trans("Bills"),"bill");
$facturestatic = new FactureFournisseur($this->db);

View File

@ -1459,7 +1459,7 @@ if ($action=='create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
}
print '</td>';
@ -2732,7 +2732,8 @@ elseif (! empty($object->id))
print '</form>';
print "<br>";
}
if ($action != 'makeorder')
if ($action != 'makeorder')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
@ -2791,7 +2792,7 @@ if ($action != 'makeorder')
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'order_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
$somethingshown = $formactions->showactions($object,'order_supplier',$socid,1,'listaction'.($genallowed?'largetitle':''));

View File

@ -203,7 +203,7 @@ if (!empty($object->id))
// List of actions on element
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'project',0);*/
$somethingshown = $formactions->showactions($object,'project',0);*/
// List of todo actions
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);

View File

@ -1487,7 +1487,7 @@ if ($action == 'create')
});
</script>';
}
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=0&fournisseur=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">'.$langs->trans("AddThirdParty").'</a>';
}
print '</td></tr>';
@ -2815,7 +2815,7 @@ else
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'invoice_supplier',$socid,0,'listaction'.($genallowed?'largetitle':''));
$somethingshown = $formactions->showactions($object,'invoice_supplier',$socid,1,'listaction'.($genallowed?'largetitle':''));
print '</div></div></div>';
//print '</td></tr></table>';

View File

@ -202,13 +202,13 @@ if ($result > 0)
}
$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/paiement.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
dol_banner_tab($object,'id',$linkback,1,'rowid','ref');
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';
/*print '<tr>';
@ -278,7 +278,7 @@ if ($result > 0)
print '</table>';
print '</div>';
print '<br>';
/**
@ -315,7 +315,7 @@ if ($result > 0)
while ($i < $num)
{
$objp = $db->fetch_object($resql);
print '<tr class="oddeven">';
// Ref
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.img_object($langs->trans('ShowBill'),'bill').' ';
@ -341,7 +341,7 @@ if ($result > 0)
$i++;
}
}
print "</table>\n";
$db->free($resql);
@ -386,7 +386,7 @@ if ($result > 0)
}
}
print '</div>';
print '<div class="fichecenter"><div class="fichehalfleft">';
/*
@ -409,7 +409,7 @@ if ($result > 0)
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
$somethingshown=$formactions->showactions($object,'supplier_payment',$socid,0,'listaction'.($genallowed?'largetitle':''));
$somethingshown = $formactions->showactions($object,'supplier_payment',$socid,1,'listaction'.($genallowed?'largetitle':''));
print '</div></div></div>';
//print '</td></tr></table>';

View File

@ -2209,3 +2209,100 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4782, 'PCG08-PYME','INCOME', 'XXXXXX', '7991', '4780', 'Revisión del deterioro de créditos a corto plazo empresas asociadas', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4783, 'PCG08-PYME','INCOME', 'XXXXXX', '7992', '4780', 'Revisión del deterioro de créditos a corto plazo otras partes vinculadas', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (4784, 'PCG08-PYME','INCOME', 'XXXXXX', '7993', '4780', 'Revisión del deterioro de créditos a corto plazo otras empresas', 1);
--
-- Description of the accounts in DK-STD
--
INSERT INTO llx_accounting_system (rowid, pcg_version, label, active) VALUES (5,'DK-STD', 'Standardkontoplan fra SKAT', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5082, 'DK-STD', 'Indtægter', '', '1000', '', 'Salg af varer/ydelser m. moms', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5083, 'DK-STD', 'Indtægter', '', '1010', '', 'Salg af varer EU', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5084, 'DK-STD', 'Indtægter', '', '1020', '', 'Salg af ydelser EU', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5085, 'DK-STD', 'Indtægter', '', '1030', '', 'Ej momspligtigt salg', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5086, 'DK-STD', 'Indtægter', '', '1040', '', 'Regulering igangværende arbejder', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5087, 'DK-STD', 'Omkostninger', '', '1100', '', 'Varekøb med moms', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5088, 'DK-STD', 'Omkostninger', '', '1110', '', 'Køb af varer EU', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5089, 'DK-STD', 'Omkostninger', '', '1120', '', 'Køb af ydelser EU', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5090, 'DK-STD', 'Omkostninger', '', '1130', '', 'Varelagerregulering', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5091, 'DK-STD', 'Omkostninger', '', '1140', '', 'Eget vareforbrug', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5092, 'DK-STD', 'Omkostninger', '', '1300', '', 'Repræsentation', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5093, 'DK-STD', 'Omkostninger', '', '1310', '', 'Annoncer/reklame', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5094, 'DK-STD', 'Omkostninger', '', '1320', '', 'Rejseudgifter', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5095, 'DK-STD', 'Omkostninger', '', '1330', '', 'Aviser og blade', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5096, 'DK-STD', 'Omkostninger', '', '1400', '', 'Brændstof', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5097, 'DK-STD', 'Omkostninger', '', '1410', '', 'Bilforsikring', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5098, 'DK-STD', 'Omkostninger', '', '1420', '', 'Vedligeholdelse', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5099, 'DK-STD', 'Omkostninger', '', '1430', '', 'Grøn ejerafgift mv.', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5100, 'DK-STD', 'Omkostninger', '', '1440', '', 'Leje og leasing', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5101, 'DK-STD', 'Omkostninger', '', '1450', '', 'Bilvask og pleje af bil', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5102, 'DK-STD', 'Omkostninger', '', '1460', '', 'Parkeringsudgifter', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5103, 'DK-STD', 'Omkostninger', '', '1470', '', 'Biludgifter efter statens takster', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5104, 'DK-STD', 'Omkostninger', '', '1480', '', 'Fri bil', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5105, 'DK-STD', 'Omkostninger', '', '1490', '', 'Privat andel af biludgifter', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5106, 'DK-STD', 'Omkostninger', '', '1600', '', 'Husleje uden forbrug', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5107, 'DK-STD', 'Omkostninger', '', '1610', '', 'Forbrugsudgifter (el, vand, gas og varme mv)', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5108, 'DK-STD', 'Omkostninger', '', '1620', '', 'Ejendomsskatter og forsikringer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5109, 'DK-STD', 'Omkostninger', '', '1630', '', 'Vedligeholdelse af lokaler', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5110, 'DK-STD', 'Omkostninger', '', '1700', '', 'Kontorartikler og tryksager', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5111, 'DK-STD', 'Omkostninger', '', '1705', '', 'Telefon og internet', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5112, 'DK-STD', 'Omkostninger', '', '1710', '', 'Fri telefon privat andel', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5113, 'DK-STD', 'Omkostninger', '', '1715', '', 'Anskaffelse af småaktiver', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5114, 'DK-STD', 'Omkostninger', '', '1720', '', 'Arbejdstøj', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5115, 'DK-STD', 'Omkostninger', '', '1725', '', 'Rådgiverudgifter', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5116, 'DK-STD', 'Omkostninger', '', '1730', '', 'Porto og gebyrer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5117, 'DK-STD', 'Omkostninger', '', '1735', '', 'Forsikringer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5118, 'DK-STD', 'Omkostninger', '', '1740', '', 'Bøger og faglitteratur', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5119, 'DK-STD', 'Omkostninger', '', '1745', '', 'Konstaterede tab på debitorer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5120, 'DK-STD', 'Omkostninger', '', '1750', '', 'Kassedifferencer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5121, 'DK-STD', 'Afskrivninger', '', '2000', '', 'Afskrivning driftsmidler og inventar', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5122, 'DK-STD', 'Afskrivninger', '', '2010', '', 'Afskrivning blandede driftsmidler', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5123, 'DK-STD', 'Afskrivninger', '', '2020', '', 'Afskrivninger privat andel', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5124, 'DK-STD', 'Afskrivninger', '', '2030', '', 'Gevinst og tab ved salg af aktiver', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5125, 'DK-STD', 'Finansielle poster', '', '2400', '', 'Renteindtægter bank', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5126, 'DK-STD', 'Finansielle poster', '', '2410', '', 'Renteindtægter kunder', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5127, 'DK-STD', 'Finansielle poster', '', '2500', '', 'Renteudgifter bank og realkreditinstitut', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5128, 'DK-STD', 'Finansielle poster', '', '2510', '', 'Renteudgifter leverandører', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5129, 'DK-STD', 'Finansielle poster', '', '2520', '', 'Fradragsberettigede låneomkostninger', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5130, 'DK-STD', 'Finansielle poster', '', '2530', '', 'Fradragsberettigede renteudgifter til det offentlige', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5131, 'DK-STD', 'Balance', '', '3000', '', 'Afskrivningsgrundlag primo', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5132, 'DK-STD', 'Balance', '', '3010', '', 'Årets køb', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5133, 'DK-STD', 'Balance', '', '3015', '', 'Årets forbedringer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5134, 'DK-STD', 'Balance', '', '3020', '', 'Årest salg', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5135, 'DK-STD', 'Balance', '', '3030', '', 'Årets afskrivning', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5136, 'DK-STD', 'Balance', '', '3040', '', 'Gevinst og tab', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5137, 'DK-STD', 'Balance', '', '3100', '', 'Afskrivningsgrundlag primo', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5138, 'DK-STD', 'Balance', '', '3110', '', 'Årets køb', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5139, 'DK-STD', 'Balance', '', '3115', '', 'Årets forbedringer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5140, 'DK-STD', 'Balance', '', '3120', '', 'Årets salg', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5141, 'DK-STD', 'Balance', '', '3130', '', 'Årets afskrivning', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5142, 'DK-STD', 'Balance', '', '3140', '', 'Gevinst og tab', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5143, 'DK-STD', 'Balance', '', '3900', '', 'Huslejedepositum', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5144, 'DK-STD', 'Balance', '', '4000', '', 'Kasse', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5145, 'DK-STD', 'Balance', '', '4010', '', 'Bank', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5146, 'DK-STD', 'Balance', '', '4020', '', 'Forudbetalte omkostninger', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5147, 'DK-STD', 'Balance', '', '4030', '', 'Debitorer', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5148, 'DK-STD', 'Balance', '', '4040', '', 'Varelager', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5149, 'DK-STD', 'Balance', '', '4050', '', 'Igangværende arbejder', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5150, 'DK-STD', 'Balance', '', '5000', '', 'Egenkapital primo', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5151, 'DK-STD', 'Balance', '', '5010', '', 'Årets resultat', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5152, 'DK-STD', 'Balance', '', '5020', '', 'Privat hævet', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5153, 'DK-STD', 'Balance', '', '5030', '', 'Fri bil', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5154, 'DK-STD', 'Balance', '', '5040', '', 'Statens takster', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5155, 'DK-STD', 'Balance', '', '5050', '', 'Fri telefon m.v.', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5156, 'DK-STD', 'Balance', '', '5060', '', 'Private andele', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5157, 'DK-STD', 'Balance', '', '5065', '', 'Private afskrivninger', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5158, 'DK-STD', 'Balance', '', '5070', '', 'Driftsudgifter u/fradrag', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5159, 'DK-STD', 'Balance', '', '5080', '', 'Privat udlæg', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5160, 'DK-STD', 'Balance', '', '5090', '', 'Indskud', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5161, 'DK-STD', 'Balance', '', '7000', '', 'Gæld bank og realkreditinstitut', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5162, 'DK-STD', 'Balance', '', '7010', '', 'Gæld til leverandører af varer og tjenesteydelser', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5163, 'DK-STD', 'Balance', '', '7020', '', 'Periodeafgrænsningsposter', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5164, 'DK-STD', 'Balance', '', '7030', '', 'Anden gæld', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5165, 'DK-STD', 'Balance', '', '8000', '', 'Salgsmoms', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5166, 'DK-STD', 'Balance', '', '8010', '', 'Købsmoms', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5167, 'DK-STD', 'Balance', '', '8020', '', 'Konto for afgift af varekøb i EU', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5168, 'DK-STD', 'Balance', '', '8030', '', 'Konto for afgift af købte ydelser i EU', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5169, 'DK-STD', 'Balance', '', '8040', '', 'El- afgift', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5170, 'DK-STD', 'Balance', '', '8050', '', 'Øvrige energiafgifter', 1);
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (5171, 'DK-STD', 'Balance', '', '8060', '', 'Betalt moms', 1);

View File

@ -18,7 +18,7 @@
-- Group of accounting account for French result. This is a minimal default setup.
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Exemple: 6xxxxx', 0, 0, '', '20', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Example: 7xxxxx', 0, 0, '', '10', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Example: 6xxxxx', 0, 0, '', '20', 1, 1);
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'PROFIT', 'Balance', '', 0, 1, 'VENTES+DEPENSES', '30', 1, 1);

View File

@ -42,6 +42,11 @@ ALTER TABLE llx_facture_rec ADD COLUMN suspended integer DEFAULT 0;
ALTER TABLE llx_facture_rec MODIFY COLUMN titre VARCHAR(100);
ALTER TABLE llx_contrat MODIFY COLUMN ref varchar(50);
ALTER TABLE llx_contrat MODIFY COLUMN ref_customer varchar(50);
ALTER TABLE llx_contrat MODIFY COLUMN ref_supplier varchar(50);
ALTER TABLE llx_contrat MODIFY COLUMN ref_ext varchar(50);
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
@ -63,7 +68,7 @@ ALTER TABLE llx_mailing MODIFY COLUMN langs varchar(64);
ALTER TABLE llx_facture_fourn ADD COLUMN date_pointoftax date DEFAULT NULL;
ALTER TABLE llx_facture_fourn ADD COLUMN date_valid date;
ALTER TABLE llx_bookmark DROP COLUM fk_soc;
ALTER TABLE llx_bookmark DROP COLUMN fk_soc;
ALTER TABLE llx_website MODIFY COLUMN ref varchar(128);
@ -98,14 +103,14 @@ CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
fk_range integer DEFAULT 0 NOT NULL,
coef double DEFAULT 0 NOT NULL,
offset double DEFAULT 0 NOT NULL
)ENGINE=innodb DEFAULT CHARSET=utf8;
)ENGINE=innodb;
CREATE TABLE IF NOT EXISTS llx_c_exp_tax_cat (
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(48) NOT NULL,
entity integer DEFAULT 1 NOT NULL,
active integer DEFAULT 1 NOT NULL
)ENGINE=innodb DEFAULT CHARSET=utf8;
)ENGINE=innodb;
CREATE TABLE IF NOT EXISTS llx_c_exp_tax_range (
rowid integer AUTO_INCREMENT PRIMARY KEY,
@ -113,7 +118,7 @@ CREATE TABLE IF NOT EXISTS llx_c_exp_tax_range (
range_ik double DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL,
active integer DEFAULT 1 NOT NULL
)ENGINE=innodb DEFAULT CHARSET=utf8;
)ENGINE=innodb;
INSERT INTO llx_c_type_fees (code, label, active, accountancy_code) VALUES
('EX_KME', 'ExpLabelKm', 1, '625100'),
@ -248,6 +253,18 @@ UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'CHARGE'
UPDATE llx_accounting_account SET pcg_type = 'INCOME' where pcg_type = 'VENTAS_E_INGRESOS';
UPDATE llx_accounting_account SET pcg_type = 'EXPENSE' where pcg_type = 'COMPRAS_GASTOS';
CREATE TABLE llx_projet_task_comment (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
tms timestamp,
description text NOT NULL,
fk_user integer DEFAULT NULL,
fk_task integer DEFAULT NULL,
entity integer DEFAULT 1,
import_key varchar(125) DEFAULT NULL
)ENGINE=innodb;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci;
-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8;

View File

@ -23,4 +23,4 @@ CREATE TABLE IF NOT EXISTS llx_c_exp_tax_cat (
label varchar(48) NOT NULL,
entity integer DEFAULT 1 NOT NULL,
active integer DEFAULT 1 NOT NULL
)ENGINE=innodb DEFAULT CHARSET=utf8;
)ENGINE=innodb;

View File

@ -24,4 +24,4 @@ CREATE TABLE IF NOT EXISTS llx_c_exp_tax_range (
range_ik double DEFAULT 0 NOT NULL,
entity integer DEFAULT 1 NOT NULL,
active integer DEFAULT 1 NOT NULL
)ENGINE=innodb DEFAULT CHARSET=utf8;
)ENGINE=innodb;

View File

@ -21,10 +21,10 @@
create table llx_contrat
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(30), -- contrat reference
ref_customer varchar(30), -- customer contract ref
ref_supplier varchar(30), -- supplier contract ref
ref_ext varchar(30), -- external contract ref
ref varchar(50), -- contrat reference
ref_customer varchar(50), -- customer contract ref
ref_supplier varchar(50), -- supplier contract ref
ref_ext varchar(50), -- external contract ref
entity integer DEFAULT 1 NOT NULL, -- multi company id
tms timestamp,
datec datetime, -- creation date

View File

@ -26,4 +26,4 @@ CREATE TABLE IF NOT EXISTS llx_expensereport_ik (
fk_range integer DEFAULT 0 NOT NULL,
coef double DEFAULT 0 NOT NULL,
offset double DEFAULT 0 NOT NULL
)ENGINE=innodb DEFAULT CHARSET=utf8;
)ENGINE=innodb;

View File

@ -19,6 +19,8 @@
create table llx_payment_various
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
num_payment varchar(50), -- ref
label varchar(255),
tms timestamp,
datec datetime, -- Create date
datep date, -- date de paiement
@ -26,8 +28,6 @@ create table llx_payment_various
sens smallint DEFAULT 0 NOT NULL,-- Sens of the operation: 0 for debit operation, 1 for credit operation
amount double(24,8) DEFAULT 0 NOT NULL,
fk_typepayment integer NOT NULL,
num_payment varchar(50), -- ref
label varchar(255),
accountancy_code varchar(32),
fk_projet integer DEFAULT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id

View File

@ -0,0 +1,28 @@
-- ===========================================================================
-- Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- 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/>.
--
-- ===========================================================================
CREATE TABLE llx_projet_task_comment (
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime DEFAULT NULL,
tms timestamp,
description text NOT NULL,
fk_user integer DEFAULT NULL,
fk_task integer DEFAULT NULL,
entity integer DEFAULT 1,
import_key varchar(125) DEFAULT NULL
) ENGINE=innodb;

View File

@ -375,39 +375,40 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
}
}
// Code executed only if migrate is LAST ONE. Must always be done.
if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3)
{
// Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version)
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_PRINTING'=>'newboxdefonly',
// Code executed only if migrate is LAST ONE. Must always be done.
if (versioncompare($versiontoarray,$versionranarray) >= 0 || versioncompare($versiontoarray,$versionranarray) <= -3)
{
// Reload modules (this must be always done and only into last targeted version, because code to reload module may need table structure of last version)
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_ACCOUNTING'=>'newboxdefonly',
'MAIN_MODULE_BARCODE'=>'newboxdefonly',
'MAIN_MODULE_CRON'=>'newboxdefonly',
'MAIN_MODULE_PRINTING'=>'newboxdefonly',
'MAIN_MODULE_SALARIES'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version)
);
migrate_reload_modules($db,$langs,$conf,$listofmodule);
'MAIN_MODULE_USER'=>'newboxdefonly', //This one must be always done and only into last targeted version)
);
migrate_reload_modules($db,$langs,$conf,$listofmodule);
// Reload menus (this must be always and only into last targeted version)
migrate_reload_menu($db,$langs,$conf,$versionto);
}
// Reload menus (this must be always and only into last targeted version)
migrate_reload_menu($db,$langs,$conf,$versionto);
}
// Can force activation of some module during migration with paramater 'enablemodules=MAIN_MODULE_XXX,MAIN_MODULE_YYY,...'
if (! $error && $enablemodules)
@ -4117,216 +4118,227 @@ function migrate_delete_old_dir($db,$langs,$conf)
*/
function migrate_reload_modules($db,$langs,$conf,$listofmodule=array(),$force=0)
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force);
dolibarr_install_syslog("upgrade2::migrate_reload_modules force=".$force);
// If no info is provided, we reload all modules with mode newboxdefonly.
if (count($listofmodule) == 0)
{
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly'
);
}
// If no info is provided, we reload all modules with mode newboxdefonly.
if (count($listofmodule) == 0)
{
$listofmodule=array(
'MAIN_MODULE_AGENDA'=>'newboxdefonly',
'MAIN_MODULE_SOCIETE'=>'newboxdefonly',
'MAIN_MODULE_PRODUIT'=>'newboxdefonly',
'MAIN_MODULE_SERVICE'=>'newboxdefonly',
'MAIN_MODULE_COMMANDE'=>'newboxdefonly',
'MAIN_MODULE_FACTURE'=>'newboxdefonly',
'MAIN_MODULE_FOURNISSEUR'=>'newboxdefonly',
'MAIN_MODULE_HOLIDAY'=>'newboxdefonly',
'MAIN_MODULE_USER'=>'newboxdefonly',
'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly',
'MAIN_MODULE_DON'=>'newboxdefonly',
'MAIN_MODULE_ECM'=>'newboxdefonly',
'MAIN_MODULE_PAYBOX'=>'newboxdefonly',
'MAIN_MODULE_OPENSURVEY'=>'newboxdefonly',
'MAIN_MODULE_SALARIES'=>'newboxdefonly'
);
}
foreach($listofmodule as $moduletoreload => $reloadmode)
{
if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled
foreach($listofmodule as $moduletoreload => $reloadmode)
{
if (empty($moduletoreload) || (empty($conf->global->$moduletoreload) && ! $force)) continue; // Discard reload if module not enabled
$mod=null;
$mod=null;
if ($moduletoreload == 'MAIN_MODULE_AGENDA')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) {
$mod=new modAgenda($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_API')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php';
if ($res) {
$mod=new modApi($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_BARCODE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php';
if ($res) {
$mod=new modBarcode($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_CRON')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php';
if ($res) {
$mod=new modCron($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SOCIETE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) {
$mod=new modSociete($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) {
$mod=new modProduct($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) {
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) {
$mod=new modFournisseur($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php';
if ($res) {
$mod=new modHoliday($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) {
$mod=new modDeplacement($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) {
$mod=new modDon($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) {
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) {
$mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php';
if ($res) {
$mod=new modOpenSurvey($db);
$mod->remove('noboxes'); // We need to remove because menu entries has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_AGENDA')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Agenda module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) {
$mod=new modAgenda($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_API')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Rest API module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modApi.class.php';
if ($res) {
$mod=new modApi($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_BARCODE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Barcode module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modBarcode.class.php';
if ($res) {
$mod=new modBarcode($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_CRON')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php';
if ($res) {
$mod=new modCron($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SOCIETE')
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Societe module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) {
$mod=new modSociete($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PRODUIT') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Produit module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) {
$mod=new modProduct($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SERVICE') // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Service module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
if ($res) {
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_COMMANDE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Commande module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
if ($res) {
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FACTURE') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Facture module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
if ($res) {
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_FOURNISSEUR') // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Fournisseur module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) {
$mod=new modFournisseur($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_HOLIDAY') // Permission and tabs has changed into 3.8
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Leave Request module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modHoliday.class.php';
if ($res) {
$mod=new modHoliday($db);
$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DEPLACEMENT') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Deplacement module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) {
$mod=new modDeplacement($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_DON') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Don module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) {
$mod=new modDon($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_ECM') // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate ECM module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
if ($res) {
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_PAYBOX') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Paybox module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) {
$mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_OPENSURVEY') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Opensurvey module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php';
if ($res) {
$mod=new modOpenSurvey($db);
$mod->remove('noboxes'); // We need to remove because menu entries has changed
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_SALARIES') // Permission has changed into 6.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Salaries module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSalaries.class.php';
if ($res) {
$mod=new modSalaries($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if ($moduletoreload == 'MAIN_MODULE_USER') // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate User module");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes');
$mod->init($reloadmode);
}
}
if (! empty($mod) && is_object($mod))
{
print '<tr><td colspan="4">';
print '<b>'.$langs->trans('Upgrade').'</b>: ';
print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated
print "<!-- (".$reloadmode.") -->";
print "<br>\n";
print '</td></tr>';
print '<tr><td colspan="4">';
print '<b>'.$langs->trans('Upgrade').'</b>: ';
print $langs->trans('MigrationReloadModule').' '.$mod->getName(); // We keep getName outside of trans because getName is already encoded/translated
print "<!-- (".$reloadmode.") -->";
print "<br>\n";
print '</td></tr>';
}
}
}
}

View File

@ -33,6 +33,7 @@ AlreadyInGeneralLedger=Already journalized in ledgers
NotYetInGeneralLedger=Not yet journalized in ledgers
GroupIsEmptyCheckSetup=Group is empty, check setup of the personalized accounting group
DetailByAccount=Show detail by account
AccountWithNonZeroValues=Accounts with non zero values
MainAccountForCustomersNotDefined=Main accounting account for customers not defined in setup
MainAccountForSuppliersNotDefined=Main accounting account for suppliers not defined in setup
@ -56,7 +57,7 @@ AccountancyAreaDescContrib=STEP %s: Define default accounting accounts for speci
AccountancyAreaDescDonation=STEP %s: Define default accounting accounts for donation. For this, use the menu entry %s.
AccountancyAreaDescMisc=STEP %s: Define mandatory default account and default accounting accounts for miscellaneous transactions. For this, use the menu entry %s.
AccountancyAreaDescLoan=STEP %s: Define default accounting accounts for loans. For this, use the menu entry %s.
AccountancyAreaDescBank=STEP %s: Define accounting accounts for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s.
AccountancyAreaDescBank=STEP %s: Define accounting accounts and journal code for each bank and financial accounts. For this, go on the card of each financial account. You can start from page %s.
AccountancyAreaDescProd=STEP %s: Define accounting accounts on your products/services. For this, use the menu entry %s.
AccountancyAreaDescBind=STEP %s: Check the binding between existing %s lines and accounting account is done, so application will be able to journalize transactions in Ledger in one click. Complete missing bindings. For this, use the menu entry %s.
@ -65,6 +66,7 @@ AccountancyAreaDescAnalyze=STEP %s: Add or edit existing transactions and genera
AccountancyAreaDescClosePeriod=STEP %s: Close period so we can't make modification in a future.
TheJournalCodeIsNotDefinedOnSomeBankAccount=A mandatory step in setup was not complete (accountancy code journal not defined for all bank accounts)
MenuAccountancy=Accountancy
Selectchartofaccounts=Select active chart of accounts
ChangeAndLoad=Change and load
@ -156,6 +158,7 @@ AccountingAccountGroupsDesc=You can define here some groups of accounting accoun
ByAccounts=By accounts
ByPredefinedAccountGroups=By predefined groups
ByPersonalizedAccountGroups=By personalized groups
ByYear=By year
NotMatch=Not Set
DeleteMvt=Delete Ledger lines
DelYear=Year to delete
@ -226,7 +229,7 @@ AccountingJournal=Accounting journal
NewAccountingJournal=New accounting journal
ShowAccoutingJournal=Show accounting journal
Nature=Nature
AccountingJournalType1=Various operation
AccountingJournalType1=Miscellaneous operation
AccountingJournalType2=Sales
AccountingJournalType3=Purchases
AccountingJournalType4=Bank
@ -279,5 +282,6 @@ BookeppingLineAlreayExists=Lines already existing into bookeeping
NoJournalDefined=No journal defined
Binded=Lines bound
ToBind=Lines to bind
UseMenuToSetBindindManualy=Autodection not possible, use menu <a href="%s">%s</a> to make the binding manually
WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manualy in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate.

View File

@ -201,8 +201,9 @@ DOLISTOREdescriptionLong=Instead of switching on <a href="https://www.dolistore.
NewModule=New
FreeModule=Free
CompatibleUpTo=Compatible with version %s
NotCompatible=This module does not seem compatible with your Dolibarr %s, contact its editor (%s - %s).
CompatibleAfterUpdate=This module requires an update to your Dolibarr %s, installed dolibarr %s - %s.
NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s - Max %s).
CompatibleAfterUpdate=This module requires an update to your Dolibarr %s (Min %s - Max %s).
SeeInMarkerPlace=See in Market place
Updated=Updated
Nouveauté=Novelty
AchatTelechargement=Buy / Download
@ -450,8 +451,8 @@ DependsOn=This module need the module(s)
RequiredBy=This module is required by module(s)
TheKeyIsTheNameOfHtmlField=This is the name of the HTML field. This need to have technical knowledges to read the content of the HTML page to get the key name of a field.
PageUrlForDefaultValues=You must enter here the relative url of the page. If you include parameters in URL, the default values will be effective if all parameters are set to same value. Examples:
PageUrlForDefaultValuesCreate=<br>For form to create a new thirdparty, it is <strong>%s</strong>
PageUrlForDefaultValuesList=<br>For page that list thirdparties, it is <strong>%s</strong>
PageUrlForDefaultValuesCreate=<br>For form to create a new thirdparty, it is <strong>%s</strong>,<br>If we want default only if url has some parameter, we can use <strong>%s</strong>
PageUrlForDefaultValuesList=<br>For page that list thirdparties, it is <strong>%s</strong>,<br>If we want default only if url has some parameter, we can use <strong>%s</strong>
EnableDefaultValues=Enable usage of personalized default values
EnableOverwriteTranslation=Enable usage of overwrote translation
GoIntoTranslationMenuToChangeThis=A translation has been found for the key with this code, so to change this value, you must edit it fom Home-Setup-translation.
@ -1243,6 +1244,7 @@ MemberMainOptions=Main options
AdherentLoginRequired= Manage a Login for each member
AdherentMailRequired=EMail required to create a new member
MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default
VisitorCanChooseItsPaymentMode=Visitor can choose among available payment modes
##### LDAP setup #####
LDAPSetup=LDAP Setup
LDAPGlobalParameters=Global parameters

View File

@ -1,8 +1,8 @@
# Dolibarr language file - Source file is en_US - banks
Bank=Bank
MenuBankCash=Bank/Cash
MenuVariousPayment=Various payments
MenuNewVariousPayment=New various payment
MenuVariousPayment=Miscellaneous payments
MenuNewVariousPayment=New Miscellaneous payment
BankName=Bank name
FinancialAccount=Account
BankAccount=Bank account

Some files were not shown because too many files have changed in this diff Show More