@@ -1774,7 +1774,7 @@ discard block |
||
| 1774 | 1774 | print '<datalist id="pcg_type_datalist">'; |
| 1775 | 1775 | $sql = "SELECT DISTINCT pcg_type FROM " . MAIN_DB_PREFIX . "accounting_account"; |
| 1776 | 1776 | $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; |
| 1777 | - $sql .= ' AND entity in (' . getEntity('accounting_account', 0) . ')'; // Always limit to current entity. No sharing in accountancy. |
|
| 1777 | + $sql .= ' AND entity in (' . getEntity('accounting_account', 0) . ')'; // Always limit to current entity. No sharing in accountancy. |
|
| 1778 | 1778 | $sql .= ' LIMIT 50000'; // just as a sanity check |
| 1779 | 1779 | $resql = $db->query($sql); |
| 1780 | 1780 | if ($resql) { |
@@ -1851,7 +1851,7 @@ discard block |
||
| 1851 | 1851 | print '<datalist id="pcg_type_datalist">'; |
| 1852 | 1852 | $sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account'; |
| 1853 | 1853 | $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; |
| 1854 | - $sql .= ' AND entity in (' . getEntity('accounting_account', 0) . ')'; // Always limit to current entity. No sharing in accountancy. |
|
| 1854 | + $sql .= ' AND entity in (' . getEntity('accounting_account', 0) . ')'; // Always limit to current entity. No sharing in accountancy. |
|
| 1855 | 1855 | $sql .= ' LIMIT 50000'; // just as a sanity check |
| 1856 | 1856 | $resql = $db->query($sql); |
| 1857 | 1857 | if ($resql) { |
@@ -4108,7 +4108,7 @@ discard block |
||
| 4108 | 4108 | $confirm = GETPOST('confirm', 'alpha'); |
| 4109 | 4109 | $cancel = GETPOST('cancel', 'aZ09'); |
| 4110 | 4110 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)) . basename(__FILE__, '.php')); // To manage different context of search |
| 4111 | - $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 4111 | + $backtopage = GETPOST('backtopage', 'alpha'); // if not set, a default page will be used |
|
| 4112 | 4112 | $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); // if not set, $backtopage will be used |
| 4113 | 4113 | $backtopagejsfields = GETPOST('backtopagejsfields', 'alpha'); |
| 4114 | 4114 | $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 720 | 720 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 721 | 721 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 722 | - $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 722 | + $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 723 | 723 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 724 | 724 | |
| 725 | 725 | // Load variable for pagination |
@@ -1172,7 +1172,7 @@ discard block |
||
| 1172 | 1172 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 1173 | 1173 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 1174 | 1174 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 1175 | - $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 1175 | + $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 1176 | 1176 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 1177 | 1177 | |
| 1178 | 1178 | // Define begin binding date |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
| 126 | 126 | $object = new BookKeeping($db); |
| 127 | - $hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array |
|
| 127 | + $hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array |
|
| 128 | 128 | |
| 129 | 129 | $formaccounting = new FormAccounting($db); |
| 130 | 130 | $formother = new FormOther($db); |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | if (getDolGlobalString('ACCOUNTANCY_SHOW_OPENING_BALANCE')) { |
| 509 | 509 | $sql = "SELECT t.numero_compte, (SUM(t.debit) - SUM(t.credit)) as opening_balance"; |
| 510 | 510 | $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as t"; |
| 511 | - $sql .= " WHERE t.entity = " . $conf->entity; // Never do sharing into accounting features |
|
| 511 | + $sql .= " WHERE t.entity = " . $conf->entity; // Never do sharing into accounting features |
|
| 512 | 512 | $sql .= " AND t.doc_date < '" . $db->idate($search_date_start) . "'"; |
| 513 | 513 | $sql .= " GROUP BY t.numero_compte"; |
| 514 | 514 | |
@@ -1355,7 +1355,7 @@ discard block |
||
| 1355 | 1355 | |
| 1356 | 1356 | print '<br>'; |
| 1357 | 1357 | |
| 1358 | - $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
| 1358 | + $result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt |
|
| 1359 | 1359 | |
| 1360 | 1360 | if ($result < 0) { |
| 1361 | 1361 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1578,45 +1578,45 @@ discard block |
||
| 1578 | 1578 | $search_mvt_num = GETPOSTINT('search_mvt_num'); |
| 1579 | 1579 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
| 1580 | 1580 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
| 1581 | - $search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 1582 | - $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 1583 | - $search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 1584 | - $search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 1585 | - $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 1586 | - $search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 1581 | + $search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 1582 | + $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 1583 | + $search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 1584 | + $search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 1585 | + $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 1586 | + $search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 1587 | 1587 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 1588 | 1588 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 1589 | 1589 | $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 1590 | - $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 1591 | - $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 1592 | - $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 1593 | - $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 1594 | - $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 1595 | - $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 1590 | + $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 1591 | + $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 1592 | + $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 1593 | + $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 1594 | + $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 1595 | + $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 1596 | 1596 | $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); |
| 1597 | 1597 | $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); |
| 1598 | - $search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 1599 | - $search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 1600 | - $search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 1601 | - $search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 1602 | - $search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 1603 | - $search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 1598 | + $search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 1599 | + $search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 1600 | + $search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 1601 | + $search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 1602 | + $search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 1603 | + $search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 1604 | 1604 | $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); |
| 1605 | 1605 | $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); |
| 1606 | - $search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 1607 | - $search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 1608 | - $search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 1609 | - $search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 1610 | - $search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 1611 | - $search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 1606 | + $search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 1607 | + $search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 1608 | + $search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 1609 | + $search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 1610 | + $search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 1611 | + $search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 1612 | 1612 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 1613 | 1613 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 1614 | - $search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 1615 | - $search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 1616 | - $search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 1617 | - $search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 1618 | - $search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 1619 | - $search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 1614 | + $search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 1615 | + $search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 1616 | + $search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 1617 | + $search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 1618 | + $search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 1619 | + $search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 1620 | 1620 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 1621 | 1621 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 1622 | 1622 | $search_import_key = GETPOST("search_import_key", 'alpha'); |
@@ -2315,7 +2315,7 @@ discard block |
||
| 2315 | 2315 | $form_question['formatexport'] = array( |
| 2316 | 2316 | 'name' => 'formatexport', |
| 2317 | 2317 | 'type' => 'select', |
| 2318 | - 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
| 2318 | + 'label' => $langs->trans('Modelcsv'), // TODO Use Selectmodelcsv and show a select combo |
|
| 2319 | 2319 | 'values' => $listofformat, |
| 2320 | 2320 | 'default' => $formatexportset, |
| 2321 | 2321 | 'morecss' => 'minwidth200 maxwidth200' |
@@ -3035,45 +3035,45 @@ discard block |
||
| 3035 | 3035 | $search_mvt_num = GETPOSTINT('search_mvt_num'); |
| 3036 | 3036 | $search_doc_type = GETPOST("search_doc_type", 'alpha'); |
| 3037 | 3037 | $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); |
| 3038 | - $search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 3039 | - $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 3040 | - $search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 3041 | - $search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 3042 | - $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 3043 | - $search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 3038 | + $search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 3039 | + $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 3040 | + $search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 3041 | + $search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 3042 | + $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 3043 | + $search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 3044 | 3044 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 3045 | 3045 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 3046 | 3046 | $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 3047 | - $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 3048 | - $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 3049 | - $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 3050 | - $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 3051 | - $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 3052 | - $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 3047 | + $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
|
| 3048 | + $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
|
| 3049 | + $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
|
| 3050 | + $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
|
| 3051 | + $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
|
| 3052 | + $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
|
| 3053 | 3053 | $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); |
| 3054 | 3054 | $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); |
| 3055 | - $search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 3056 | - $search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 3057 | - $search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 3058 | - $search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 3059 | - $search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 3060 | - $search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 3055 | + $search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); |
|
| 3056 | + $search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); |
|
| 3057 | + $search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); |
|
| 3058 | + $search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); |
|
| 3059 | + $search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); |
|
| 3060 | + $search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); |
|
| 3061 | 3061 | $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); |
| 3062 | 3062 | $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); |
| 3063 | - $search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 3064 | - $search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 3065 | - $search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 3066 | - $search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 3067 | - $search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 3068 | - $search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 3063 | + $search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 3064 | + $search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 3065 | + $search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 3066 | + $search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 3067 | + $search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 3068 | + $search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 3069 | 3069 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 3070 | 3070 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 3071 | - $search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 3072 | - $search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 3073 | - $search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 3074 | - $search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 3075 | - $search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 3076 | - $search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 3071 | + $search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 3072 | + $search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 3073 | + $search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 3074 | + $search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 3075 | + $search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 3076 | + $search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 3077 | 3077 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 3078 | 3078 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 3079 | 3079 | $search_import_key = GETPOST("search_import_key", 'alpha'); |
@@ -4386,29 +4386,29 @@ discard block |
||
| 4386 | 4386 | $context_default = 'bookkeepingbyaccountlist'; |
| 4387 | 4387 | } |
| 4388 | 4388 | $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; |
| 4389 | - $search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 4390 | - $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 4391 | - $search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 4392 | - $search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 4393 | - $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 4394 | - $search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 4389 | + $search_date_startyear = GETPOSTINT('search_date_startyear'); |
|
| 4390 | + $search_date_startmonth = GETPOSTINT('search_date_startmonth'); |
|
| 4391 | + $search_date_startday = GETPOSTINT('search_date_startday'); |
|
| 4392 | + $search_date_endyear = GETPOSTINT('search_date_endyear'); |
|
| 4393 | + $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
|
| 4394 | + $search_date_endday = GETPOSTINT('search_date_endday'); |
|
| 4395 | 4395 | $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); |
| 4396 | 4396 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 4397 | 4397 | $search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); |
| 4398 | - $search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 4399 | - $search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 4400 | - $search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 4401 | - $search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 4402 | - $search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 4403 | - $search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 4398 | + $search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); |
|
| 4399 | + $search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); |
|
| 4400 | + $search_date_export_startday = GETPOSTINT('search_date_export_startday'); |
|
| 4401 | + $search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); |
|
| 4402 | + $search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); |
|
| 4403 | + $search_date_export_endday = GETPOSTINT('search_date_export_endday'); |
|
| 4404 | 4404 | $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); |
| 4405 | 4405 | $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); |
| 4406 | - $search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 4407 | - $search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 4408 | - $search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 4409 | - $search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 4410 | - $search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 4411 | - $search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 4406 | + $search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); |
|
| 4407 | + $search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); |
|
| 4408 | + $search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); |
|
| 4409 | + $search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); |
|
| 4410 | + $search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); |
|
| 4411 | + $search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); |
|
| 4412 | 4412 | $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); |
| 4413 | 4413 | $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); |
| 4414 | 4414 | $search_import_key = GETPOST("search_import_key", 'alpha'); |
@@ -5322,8 +5322,8 @@ discard block |
||
| 5322 | 5322 | } |
| 5323 | 5323 | //if (empty($accountg)) $accountg = '-'; |
| 5324 | 5324 | |
| 5325 | - $colspan = 0; // colspan before field 'label of operation' |
|
| 5326 | - $colspanend = 0; // colspan after debit/credit |
|
| 5325 | + $colspan = 0; // colspan before field 'label of operation' |
|
| 5326 | + $colspanend = 0; // colspan after debit/credit |
|
| 5327 | 5327 | if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 5328 | 5328 | $colspan++; |
| 5329 | 5329 | } |
@@ -423,12 +423,12 @@ discard block |
||
| 423 | 423 | if ($links[$key]['type'] == 'payment') { |
| 424 | 424 | $paymentstatic->id = $links[$key]['url_id']; |
| 425 | 425 | $paymentstatic->ref = $links[$key]['url_id']; |
| 426 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this |
|
| 426 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this |
|
| 427 | 427 | $tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id; |
| 428 | 428 | } elseif ($links[$key]['type'] == 'payment_supplier') { |
| 429 | 429 | $paymentsupplierstatic->id = $links[$key]['url_id']; |
| 430 | 430 | $paymentsupplierstatic->ref = $links[$key]['url_id']; |
| 431 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsupplierstatic->getNomUrl(2); |
|
| 431 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2); |
|
| 432 | 432 | $tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id; |
| 433 | 433 | } elseif ($links[$key]['type'] == 'company') { |
| 434 | 434 | $societestatic->id = $links[$key]['url_id']; |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $chargestatic->id = $links[$key]['url_id']; |
| 464 | 464 | $chargestatic->ref = $links[$key]['url_id']; |
| 465 | 465 | |
| 466 | - $tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2); |
|
| 466 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2); |
|
| 467 | 467 | $reg = array(); |
| 468 | 468 | if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) { |
| 469 | 469 | if ($reg[1] == 'socialcontribution') { |
@@ -480,13 +480,13 @@ discard block |
||
| 480 | 480 | // Retrieve the accounting code of the social contribution of the payment from link of payment. |
| 481 | 481 | // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. |
| 482 | 482 | $sqlmid = "SELECT cchgsoc.accountancy_code"; |
| 483 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; |
|
| 484 | - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id"; |
|
| 485 | - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid"; |
|
| 486 | - $sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; |
|
| 487 | - $sqlmid .= " WHERE bkurl.fk_bank = ".((int) $obj->rowid); |
|
| 483 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc"; |
|
| 484 | + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id"; |
|
| 485 | + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge = chgsoc.rowid"; |
|
| 486 | + $sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid AND bkurl.type = 'payment_sc'"; |
|
| 487 | + $sqlmid .= " WHERE bkurl.fk_bank = " . ((int) $obj->rowid); |
|
| 488 | 488 | |
| 489 | - dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG); |
|
| 489 | + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); |
|
| 490 | 490 | $resultmid = $db->query($sqlmid); |
| 491 | 491 | if ($resultmid) { |
| 492 | 492 | $objmid = $db->fetch_object($resultmid); |
@@ -496,14 +496,14 @@ discard block |
||
| 496 | 496 | $paymentdonstatic->id = $links[$key]['url_id']; |
| 497 | 497 | $paymentdonstatic->ref = $links[$key]['url_id']; |
| 498 | 498 | $paymentdonstatic->fk_donation = $links[$key]['url_id']; |
| 499 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentdonstatic->getNomUrl(2); |
|
| 499 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2); |
|
| 500 | 500 | $tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id; |
| 501 | 501 | $tabtp[$obj->rowid][$account_pay_donation] += $amounttouse; |
| 502 | 502 | } elseif ($links[$key]['type'] == 'member') { |
| 503 | 503 | $paymentsubscriptionstatic->id = $links[$key]['url_id']; |
| 504 | 504 | $paymentsubscriptionstatic->ref = $links[$key]['url_id']; |
| 505 | 505 | $paymentsubscriptionstatic->label = $links[$key]['label']; |
| 506 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsubscriptionstatic->getNomUrl(2); |
|
| 506 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsubscriptionstatic->getNomUrl(2); |
|
| 507 | 507 | $tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id; |
| 508 | 508 | $paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id); |
| 509 | 509 | $tabtp[$obj->rowid][$account_pay_subscription] += $amounttouse; |
@@ -511,14 +511,14 @@ discard block |
||
| 511 | 511 | $paymentvatstatic->id = $links[$key]['url_id']; |
| 512 | 512 | $paymentvatstatic->ref = $links[$key]['url_id']; |
| 513 | 513 | $paymentvatstatic->label = $links[$key]['label']; |
| 514 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentvatstatic->getNomUrl(2); |
|
| 514 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2); |
|
| 515 | 515 | $tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id; |
| 516 | 516 | $tabtp[$obj->rowid][$account_pay_vat] += $amounttouse; |
| 517 | 517 | } elseif ($links[$key]['type'] == 'payment_salary') { |
| 518 | 518 | $paymentsalstatic->id = $links[$key]['url_id']; |
| 519 | 519 | $paymentsalstatic->ref = $links[$key]['url_id']; |
| 520 | 520 | $paymentsalstatic->label = $links[$key]['label']; |
| 521 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2); |
|
| 521 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2); |
|
| 522 | 522 | $tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id; |
| 523 | 523 | |
| 524 | 524 | // This part of code is no more required. it is here to solve case where a link were missing (with v14.0.0) and keep writing in accountancy complete. |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $paymentvariousstatic->id = $links[$key]['url_id']; |
| 567 | 567 | $paymentvariousstatic->ref = $links[$key]['url_id']; |
| 568 | 568 | $paymentvariousstatic->label = $links[$key]['label']; |
| 569 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentvariousstatic->getNomUrl(2); |
|
| 569 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvariousstatic->getNomUrl(2); |
|
| 570 | 570 | $tabpay[$obj->rowid]["paymentvariousid"] = $paymentvariousstatic->id; |
| 571 | 571 | $paymentvariousstatic->fetch($paymentvariousstatic->id); |
| 572 | 572 | $account_various = (!empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word |
@@ -577,14 +577,14 @@ discard block |
||
| 577 | 577 | $paymentloanstatic->id = $links[$key]['url_id']; |
| 578 | 578 | $paymentloanstatic->ref = $links[$key]['url_id']; |
| 579 | 579 | $paymentloanstatic->fk_loan = $links[$key]['url_id']; |
| 580 | - $tabpay[$obj->rowid]["lib"] .= ' '.$paymentloanstatic->getNomUrl(2); |
|
| 580 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2); |
|
| 581 | 581 | $tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id; |
| 582 | 582 | //$tabtp[$obj->rowid][$account_pay_loan] += $amounttouse; |
| 583 | 583 | $sqlmid = 'SELECT pl.amount_capital, pl.amount_insurance, pl.amount_interest, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest'; |
| 584 | - $sqlmid .= ' FROM '.MAIN_DB_PREFIX.'payment_loan as pl, '.MAIN_DB_PREFIX.'loan as l'; |
|
| 585 | - $sqlmid .= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = '.((int) $obj->rowid); |
|
| 584 | + $sqlmid .= ' FROM ' . MAIN_DB_PREFIX . 'payment_loan as pl, ' . MAIN_DB_PREFIX . 'loan as l'; |
|
| 585 | + $sqlmid .= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = ' . ((int) $obj->rowid); |
|
| 586 | 586 | |
| 587 | - dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=".$sqlmid, LOG_DEBUG); |
|
| 587 | + dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG); |
|
| 588 | 588 | $resultmid = $db->query($sqlmid); |
| 589 | 589 | if ($resultmid) { |
| 590 | 590 | $objmid = $db->fetch_object($resultmid); |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | } |
| 595 | 595 | } elseif ($links[$key]['type'] == 'banktransfert') { |
| 596 | 596 | $accountLinestatic->fetch($links[$key]['url_id']); |
| 597 | - $tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- '.$accountLinestatic ->getNomUrl(1); |
|
| 597 | + $tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer") . '- ' . $accountLinestatic ->getNomUrl(1); |
|
| 598 | 598 | $tabtp[$obj->rowid][$account_transfer] += $amounttouse; |
| 599 | 599 | $bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']); |
| 600 | 600 | $tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2); |
@@ -707,16 +707,16 @@ discard block |
||
| 707 | 707 | // Line into bank account |
| 708 | 708 | foreach ($tabbq[$key] as $k => $mt) { |
| 709 | 709 | if ($mt) { |
| 710 | - $accountingaccount->fetch(null, $k, true); // $k is accounting bank account. TODO We should use a cache here to avoid this fetch |
|
| 710 | + $accountingaccount->fetch(null, $k, true); // $k is accounting bank account. TODO We should use a cache here to avoid this fetch |
|
| 711 | 711 | $account_label = $accountingaccount->label; |
| 712 | 712 | |
| 713 | 713 | $reflabel = ''; |
| 714 | 714 | if (!empty($val['lib'])) { |
| 715 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
| 715 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
| 716 | 716 | } |
| 717 | - $reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']); |
|
| 717 | + $reflabel .= $langs->trans("Bank") . ' ' . dol_string_nohtmltag($val['bank_account_ref']); |
|
| 718 | 718 | if (!empty($val['soclib'])) { |
| 719 | - $reflabel .= " - ".dol_string_nohtmltag($val['soclib']); |
|
| 719 | + $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); |
|
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | $bookkeeping = new BookKeeping($db); |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists |
| 753 | 753 | $error++; |
| 754 | 754 | $errorforline++; |
| 755 | - setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); |
|
| 755 | + setEventMessages('Transaction for (' . $bookkeeping->doc_type . ', ' . $bookkeeping->fk_doc . ', ' . $bookkeeping->fk_docdet . ') were already recorded', null, 'warnings'); |
|
| 756 | 756 | } else { |
| 757 | 757 | $error++; |
| 758 | 758 | $errorforline++; |
@@ -773,10 +773,10 @@ discard block |
||
| 773 | 773 | |
| 774 | 774 | $reflabel = ''; |
| 775 | 775 | if (!empty($val['lib'])) { |
| 776 | - $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : ""); |
|
| 776 | + $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib'] ? " - " : ""); |
|
| 777 | 777 | } |
| 778 | 778 | if ($tabtype[$key] == 'banktransfert') { |
| 779 | - $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); |
|
| 779 | + $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount') . ' ' . $account_transfer); |
|
| 780 | 780 | } else { |
| 781 | 781 | $reflabel .= dol_string_nohtmltag($val['soclib']); |
| 782 | 782 | } |
@@ -823,43 +823,43 @@ discard block |
||
| 823 | 823 | } elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution |
| 824 | 824 | $bookkeeping->subledger_account = ''; |
| 825 | 825 | $bookkeeping->subledger_label = ''; |
| 826 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 826 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 827 | 827 | $bookkeeping->numero_compte = $k; |
| 828 | 828 | $bookkeeping->label_compte = $accountingaccount->label; |
| 829 | 829 | } elseif ($tabtype[$key] == 'payment_vat') { |
| 830 | 830 | $bookkeeping->subledger_account = ''; |
| 831 | 831 | $bookkeeping->subledger_label = ''; |
| 832 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 832 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 833 | 833 | $bookkeeping->numero_compte = $k; |
| 834 | 834 | $bookkeeping->label_compte = $accountingaccount->label; |
| 835 | 835 | } elseif ($tabtype[$key] == 'payment_donation') { |
| 836 | 836 | $bookkeeping->subledger_account = ''; |
| 837 | 837 | $bookkeeping->subledger_label = ''; |
| 838 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 838 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 839 | 839 | $bookkeeping->numero_compte = $k; |
| 840 | 840 | $bookkeeping->label_compte = $accountingaccount->label; |
| 841 | 841 | } elseif ($tabtype[$key] == 'member') { |
| 842 | 842 | $bookkeeping->subledger_account = ''; |
| 843 | 843 | $bookkeeping->subledger_label = ''; |
| 844 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 844 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 845 | 845 | $bookkeeping->numero_compte = $k; |
| 846 | 846 | $bookkeeping->label_compte = $accountingaccount->label; |
| 847 | 847 | } elseif ($tabtype[$key] == 'payment_loan') { |
| 848 | 848 | $bookkeeping->subledger_account = ''; |
| 849 | 849 | $bookkeeping->subledger_label = ''; |
| 850 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 850 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 851 | 851 | $bookkeeping->numero_compte = $k; |
| 852 | 852 | $bookkeeping->label_compte = $accountingaccount->label; |
| 853 | 853 | } elseif ($tabtype[$key] == 'payment_various') { |
| 854 | 854 | $bookkeeping->subledger_account = $k; |
| 855 | 855 | $bookkeeping->subledger_label = $tabcompany[$key]['name']; |
| 856 | - $accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
| 856 | + $accountingaccount->fetch(null, $tabpay[$key]["account_various"], true); // TODO Use a cache |
|
| 857 | 857 | $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; |
| 858 | 858 | $bookkeeping->label_compte = $accountingaccount->label; |
| 859 | 859 | } elseif ($tabtype[$key] == 'banktransfert') { |
| 860 | 860 | $bookkeeping->subledger_account = ''; |
| 861 | 861 | $bookkeeping->subledger_label = ''; |
| 862 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 862 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 863 | 863 | $bookkeeping->numero_compte = $k; |
| 864 | 864 | $bookkeeping->label_compte = $accountingaccount->label; |
| 865 | 865 | } else { |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists |
| 883 | 883 | $error++; |
| 884 | 884 | $errorforline++; |
| 885 | - setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); |
|
| 885 | + setEventMessages('Transaction for (' . $bookkeeping->doc_type . ', ' . $bookkeeping->fk_doc . ', ' . $bookkeeping->fk_docdet . ') were already recorded', null, 'warnings'); |
|
| 886 | 886 | } else { |
| 887 | 887 | $error++; |
| 888 | 888 | $errorforline++; |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | if ($mt) { |
| 903 | 903 | $reflabel = ''; |
| 904 | 904 | if (!empty($val['lib'])) { |
| 905 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
| 905 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
| 906 | 906 | } |
| 907 | 907 | $reflabel .= dol_string_nohtmltag('WaitingAccount'); |
| 908 | 908 | |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists |
| 934 | 934 | $error++; |
| 935 | 935 | $errorforline++; |
| 936 | - setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); |
|
| 936 | + setEventMessages('Transaction for (' . $bookkeeping->doc_type . ', ' . $bookkeeping->fk_doc . ', ' . $bookkeeping->fk_docdet . ') were already recorded', null, 'warnings'); |
|
| 937 | 937 | } else { |
| 938 | 938 | $error++; |
| 939 | 939 | $errorforline++; |
@@ -948,7 +948,7 @@ discard block |
||
| 948 | 948 | if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) { |
| 949 | 949 | $error++; |
| 950 | 950 | $errorforline++; |
| 951 | - setEventMessages('We tried to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors'); |
|
| 951 | + setEventMessages('We tried to insert a non balanced transaction in book for ' . $ref . '. Canceled. Surely a bug.', null, 'errors'); |
|
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | if (!$errorforline) { |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | |
| 960 | 960 | $MAXNBERRORS = 5; |
| 961 | 961 | if ($error >= $MAXNBERRORS) { |
| 962 | - setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors'); |
|
| 962 | + setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped") . ' (>' . $MAXNBERRORS . ')', null, 'errors'); |
|
| 963 | 963 | break; // Break in the foreach |
| 964 | 964 | } |
| 965 | 965 | } |
@@ -977,15 +977,15 @@ discard block |
||
| 977 | 977 | |
| 978 | 978 | // Must reload data, so we make a redirect |
| 979 | 979 | if (count($tabpay) != $error) { |
| 980 | - $param = 'id_journal='.$id_journal; |
|
| 981 | - $param .= '&date_startday='.$date_startday; |
|
| 982 | - $param .= '&date_startmonth='.$date_startmonth; |
|
| 983 | - $param .= '&date_startyear='.$date_startyear; |
|
| 984 | - $param .= '&date_endday='.$date_endday; |
|
| 985 | - $param .= '&date_endmonth='.$date_endmonth; |
|
| 986 | - $param .= '&date_endyear='.$date_endyear; |
|
| 987 | - $param .= '&in_bookkeeping='.$in_bookkeeping; |
|
| 988 | - header("Location: ".$_SERVER['PHP_SELF'].($param ? '?'.$param : '')); |
|
| 980 | + $param = 'id_journal=' . $id_journal; |
|
| 981 | + $param .= '&date_startday=' . $date_startday; |
|
| 982 | + $param .= '&date_startmonth=' . $date_startmonth; |
|
| 983 | + $param .= '&date_startyear=' . $date_startyear; |
|
| 984 | + $param .= '&date_endday=' . $date_endday; |
|
| 985 | + $param .= '&date_endmonth=' . $date_endmonth; |
|
| 986 | + $param .= '&date_endyear=' . $date_endyear; |
|
| 987 | + $param .= '&in_bookkeeping=' . $in_bookkeeping; |
|
| 988 | + header("Location: " . $_SERVER['PHP_SELF'] . ($param ? '?' . $param : '')); |
|
| 989 | 989 | exit; |
| 990 | 990 | } |
| 991 | 991 | } |
@@ -998,20 +998,20 @@ discard block |
||
| 998 | 998 | |
| 999 | 999 | $filename = 'journal'; |
| 1000 | 1000 | $type_export = 'journal'; |
| 1001 | - include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; |
|
| 1001 | + include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php'; |
|
| 1002 | 1002 | |
| 1003 | 1003 | // CSV header line |
| 1004 | - print '"'.$langs->transnoentitiesnoconv("BankId").'"'.$sep; |
|
| 1005 | - print '"'.$langs->transnoentitiesnoconv("Date").'"'.$sep; |
|
| 1006 | - print '"'.$langs->transnoentitiesnoconv("PaymentMode").'"'.$sep; |
|
| 1007 | - print '"'.$langs->transnoentitiesnoconv("AccountAccounting").'"'.$sep; |
|
| 1008 | - print '"'.$langs->transnoentitiesnoconv("LedgerAccount").'"'.$sep; |
|
| 1009 | - print '"'.$langs->transnoentitiesnoconv("SubledgerAccount").'"'.$sep; |
|
| 1010 | - print '"'.$langs->transnoentitiesnoconv("Label").'"'.$sep; |
|
| 1011 | - print '"'.$langs->transnoentitiesnoconv("AccountingDebit").'"'.$sep; |
|
| 1012 | - print '"'.$langs->transnoentitiesnoconv("AccountingCredit").'"'.$sep; |
|
| 1013 | - print '"'.$langs->transnoentitiesnoconv("Journal").'"'.$sep; |
|
| 1014 | - print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep; |
|
| 1004 | + print '"' . $langs->transnoentitiesnoconv("BankId") . '"' . $sep; |
|
| 1005 | + print '"' . $langs->transnoentitiesnoconv("Date") . '"' . $sep; |
|
| 1006 | + print '"' . $langs->transnoentitiesnoconv("PaymentMode") . '"' . $sep; |
|
| 1007 | + print '"' . $langs->transnoentitiesnoconv("AccountAccounting") . '"' . $sep; |
|
| 1008 | + print '"' . $langs->transnoentitiesnoconv("LedgerAccount") . '"' . $sep; |
|
| 1009 | + print '"' . $langs->transnoentitiesnoconv("SubledgerAccount") . '"' . $sep; |
|
| 1010 | + print '"' . $langs->transnoentitiesnoconv("Label") . '"' . $sep; |
|
| 1011 | + print '"' . $langs->transnoentitiesnoconv("AccountingDebit") . '"' . $sep; |
|
| 1012 | + print '"' . $langs->transnoentitiesnoconv("AccountingCredit") . '"' . $sep; |
|
| 1013 | + print '"' . $langs->transnoentitiesnoconv("Journal") . '"' . $sep; |
|
| 1014 | + print '"' . $langs->transnoentitiesnoconv("Note") . '"' . $sep; |
|
| 1015 | 1015 | print "\n"; |
| 1016 | 1016 | |
| 1017 | 1017 | foreach ($tabpay as $key => $val) { |
@@ -1024,24 +1024,24 @@ discard block |
||
| 1024 | 1024 | if ($mt) { |
| 1025 | 1025 | $reflabel = ''; |
| 1026 | 1026 | if (!empty($val['lib'])) { |
| 1027 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
| 1027 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
| 1028 | 1028 | } |
| 1029 | - $reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']); |
|
| 1029 | + $reflabel .= $langs->trans("Bank") . ' ' . dol_string_nohtmltag($val['bank_account_ref']); |
|
| 1030 | 1030 | if (!empty($val['soclib'])) { |
| 1031 | - $reflabel .= " - ".dol_string_nohtmltag($val['soclib']); |
|
| 1031 | + $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); |
|
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | - print '"'.$key.'"'.$sep; |
|
| 1035 | - print '"'.$date.'"'.$sep; |
|
| 1036 | - print '"'.$val["type_payment"].'"'.$sep; |
|
| 1037 | - print '"'.length_accountg(html_entity_decode($k)).'"'.$sep; |
|
| 1038 | - print '"'.length_accounta(html_entity_decode($k)).'"'.$sep; |
|
| 1039 | - print " ".$sep; |
|
| 1040 | - print '"'.$reflabel.'"'.$sep; |
|
| 1041 | - print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep; |
|
| 1042 | - print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep; |
|
| 1043 | - print '"'.$journal.'"'.$sep; |
|
| 1044 | - print '"'.dol_string_nohtmltag($ref).'"'.$sep; |
|
| 1034 | + print '"' . $key . '"' . $sep; |
|
| 1035 | + print '"' . $date . '"' . $sep; |
|
| 1036 | + print '"' . $val["type_payment"] . '"' . $sep; |
|
| 1037 | + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; |
|
| 1038 | + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; |
|
| 1039 | + print " " . $sep; |
|
| 1040 | + print '"' . $reflabel . '"' . $sep; |
|
| 1041 | + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; |
|
| 1042 | + print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; |
|
| 1043 | + print '"' . $journal . '"' . $sep; |
|
| 1044 | + print '"' . dol_string_nohtmltag($ref) . '"' . $sep; |
|
| 1045 | 1045 | print "\n"; |
| 1046 | 1046 | } |
| 1047 | 1047 | } |
@@ -1052,35 +1052,35 @@ discard block |
||
| 1052 | 1052 | if ($mt) { |
| 1053 | 1053 | $reflabel = ''; |
| 1054 | 1054 | if (!empty($val['lib'])) { |
| 1055 | - $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : ""); |
|
| 1055 | + $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib'] ? " - " : ""); |
|
| 1056 | 1056 | } |
| 1057 | 1057 | if ($tabtype[$key] == 'banktransfert') { |
| 1058 | - $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); |
|
| 1058 | + $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount') . ' ' . $account_transfer); |
|
| 1059 | 1059 | } else { |
| 1060 | 1060 | $reflabel .= dol_string_nohtmltag($val['soclib']); |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | - print '"'.$key.'"'.$sep; |
|
| 1064 | - print '"'.$date.'"'.$sep; |
|
| 1065 | - print '"'.$val["type_payment"].'"'.$sep; |
|
| 1066 | - print '"'.length_accountg(html_entity_decode($k)).'"'.$sep; |
|
| 1063 | + print '"' . $key . '"' . $sep; |
|
| 1064 | + print '"' . $date . '"' . $sep; |
|
| 1065 | + print '"' . $val["type_payment"] . '"' . $sep; |
|
| 1066 | + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; |
|
| 1067 | 1067 | if ($tabtype[$key] == 'payment_supplier') { |
| 1068 | - print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER').'"'.$sep; |
|
| 1068 | + print '"' . getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') . '"' . $sep; |
|
| 1069 | 1069 | } elseif ($tabtype[$key] == 'payment') { |
| 1070 | - print '"'.getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER').'"'.$sep; |
|
| 1070 | + print '"' . getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') . '"' . $sep; |
|
| 1071 | 1071 | } elseif ($tabtype[$key] == 'payment_expensereport') { |
| 1072 | - print '"'.getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT').'"'.$sep; |
|
| 1072 | + print '"' . getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') . '"' . $sep; |
|
| 1073 | 1073 | } elseif ($tabtype[$key] == 'payment_salary') { |
| 1074 | - print '"'.getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT').'"'.$sep; |
|
| 1074 | + print '"' . getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') . '"' . $sep; |
|
| 1075 | 1075 | } else { |
| 1076 | - print '"'.length_accountg(html_entity_decode($k)).'"'.$sep; |
|
| 1076 | + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; |
|
| 1077 | 1077 | } |
| 1078 | - print '"'.length_accounta(html_entity_decode($k)).'"'.$sep; |
|
| 1079 | - print '"'.$reflabel.'"'.$sep; |
|
| 1080 | - print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep; |
|
| 1081 | - print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep; |
|
| 1082 | - print '"'.$journal.'"'.$sep; |
|
| 1083 | - print '"'.dol_string_nohtmltag($ref).'"'.$sep; |
|
| 1078 | + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; |
|
| 1079 | + print '"' . $reflabel . '"' . $sep; |
|
| 1080 | + print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; |
|
| 1081 | + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; |
|
| 1082 | + print '"' . $journal . '"' . $sep; |
|
| 1083 | + print '"' . dol_string_nohtmltag($ref) . '"' . $sep; |
|
| 1084 | 1084 | print "\n"; |
| 1085 | 1085 | } |
| 1086 | 1086 | } |
@@ -1089,21 +1089,21 @@ discard block |
||
| 1089 | 1089 | if ($mt) { |
| 1090 | 1090 | $reflabel = ''; |
| 1091 | 1091 | if (!empty($val['lib'])) { |
| 1092 | - $reflabel .= dol_string_nohtmltag($val['lib'])." - "; |
|
| 1092 | + $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; |
|
| 1093 | 1093 | } |
| 1094 | 1094 | $reflabel .= dol_string_nohtmltag('WaitingAccount'); |
| 1095 | 1095 | |
| 1096 | - print '"'.$key.'"'.$sep; |
|
| 1097 | - print '"'.$date.'"'.$sep; |
|
| 1098 | - print '"'.$val["type_payment"].'"'.$sep; |
|
| 1099 | - print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')).'"'.$sep; |
|
| 1100 | - print '"'.length_accounta(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')).'"'.$sep; |
|
| 1096 | + print '"' . $key . '"' . $sep; |
|
| 1097 | + print '"' . $date . '"' . $sep; |
|
| 1098 | + print '"' . $val["type_payment"] . '"' . $sep; |
|
| 1099 | + print '"' . length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')) . '"' . $sep; |
|
| 1100 | + print '"' . length_accounta(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')) . '"' . $sep; |
|
| 1101 | 1101 | print $sep; |
| 1102 | - print '"'.$reflabel.'"'.$sep; |
|
| 1103 | - print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep; |
|
| 1104 | - print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep; |
|
| 1105 | - print '"'.$journal.'"'.$sep; |
|
| 1106 | - print '"'.dol_string_nohtmltag($ref).'"'.$sep; |
|
| 1102 | + print '"' . $reflabel . '"' . $sep; |
|
| 1103 | + print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep; |
|
| 1104 | + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; |
|
| 1105 | + print '"' . $journal . '"' . $sep; |
|
| 1106 | + print '"' . dol_string_nohtmltag($ref) . '"' . $sep; |
|
| 1107 | 1107 | print "\n"; |
| 1108 | 1108 | } |
| 1109 | 1109 | } |
@@ -1128,23 +1128,23 @@ discard block |
||
| 1128 | 1128 | $salarystatic = new Salary($db); |
| 1129 | 1129 | $variousstatic = new PaymentVarious($db); |
| 1130 | 1130 | |
| 1131 | - $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); |
|
| 1131 | + $title = $langs->trans("GenerationOfAccountingEntries") . ' - ' . $accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); |
|
| 1132 | 1132 | |
| 1133 | 1133 | llxHeader('', dol_string_nohtmltag($title)); |
| 1134 | 1134 | |
| 1135 | 1135 | $nom = $title; |
| 1136 | 1136 | $builddate = dol_now(); |
| 1137 | 1137 | //$description = $langs->trans("DescFinanceJournal") . '<br>'; |
| 1138 | - $description = $langs->trans("DescJournalOnlyBindedVisible").'<br>'; |
|
| 1138 | + $description = $langs->trans("DescJournalOnlyBindedVisible") . '<br>'; |
|
| 1139 | 1139 | |
| 1140 | 1140 | $listofchoices = array( |
| 1141 | 1141 | 'notyet' => $langs->trans("NotYetInGeneralLedger"), |
| 1142 | 1142 | 'already' => $langs->trans("AlreadyInGeneralLedger") |
| 1143 | 1143 | ); |
| 1144 | - $period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0); |
|
| 1145 | - $period .= ' - '.$langs->trans("JournalizationInLedgerStatus").' '.$form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); |
|
| 1144 | + $period = $form->selectDate($date_start ? $date_start : -1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end ? $date_end : -1, 'date_end', 0, 0, 0, '', 1, 0); |
|
| 1145 | + $period .= ' - ' . $langs->trans("JournalizationInLedgerStatus") . ' ' . $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1); |
|
| 1146 | 1146 | |
| 1147 | - $varlink = 'id_journal='.$id_journal; |
|
| 1147 | + $varlink = 'id_journal=' . $id_journal; |
|
| 1148 | 1148 | $periodlink = ''; |
| 1149 | 1149 | $exportlink = ''; |
| 1150 | 1150 | |
@@ -1155,14 +1155,14 @@ discard block |
||
| 1155 | 1155 | if (getDolGlobalString('ACCOUNTANCY_FISCAL_PERIOD_MODE') != 'blockedonclosed') { |
| 1156 | 1156 | // Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed) |
| 1157 | 1157 | // Fiscal period test |
| 1158 | - $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_fiscalyear WHERE entity = ".((int) $conf->entity); |
|
| 1158 | + $sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "accounting_fiscalyear WHERE entity = " . ((int) $conf->entity); |
|
| 1159 | 1159 | $resql = $db->query($sql); |
| 1160 | 1160 | if ($resql) { |
| 1161 | 1161 | $obj = $db->fetch_object($resql); |
| 1162 | 1162 | if ($obj->nb == 0) { |
| 1163 | - print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheFiscalPeriodIsNotDefined"); |
|
| 1164 | - $desc = ' : '.$langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}'); |
|
| 1165 | - $desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("FiscalPeriod").'</strong>', $desc); |
|
| 1163 | + print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("TheFiscalPeriodIsNotDefined"); |
|
| 1164 | + $desc = ' : ' . $langs->trans("AccountancyAreaDescFiscalPeriod", 4, '{link}'); |
|
| 1165 | + $desc = str_replace('{link}', '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("FiscalPeriod") . '</strong>', $desc); |
|
| 1166 | 1166 | print $desc; |
| 1167 | 1167 | print '</div>'; |
| 1168 | 1168 | } |
@@ -1172,14 +1172,14 @@ discard block |
||
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | 1174 | // Bank test |
| 1175 | - $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."bank_account WHERE entity = ".((int) $conf->entity)." AND fk_accountancy_journal IS NULL AND clos=0"; |
|
| 1175 | + $sql = "SELECT COUNT(rowid) as nb FROM " . MAIN_DB_PREFIX . "bank_account WHERE entity = " . ((int) $conf->entity) . " AND fk_accountancy_journal IS NULL AND clos=0"; |
|
| 1176 | 1176 | $resql = $db->query($sql); |
| 1177 | 1177 | if ($resql) { |
| 1178 | 1178 | $obj = $db->fetch_object($resql); |
| 1179 | 1179 | if ($obj->nb > 0) { |
| 1180 | - print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount"); |
|
| 1181 | - $desc = ' : '.$langs->trans("AccountancyAreaDescBank", 6, '{link}'); |
|
| 1182 | - $desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>', $desc); |
|
| 1180 | + print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount"); |
|
| 1181 | + $desc = ' : ' . $langs->trans("AccountancyAreaDescBank", 6, '{link}'); |
|
| 1182 | + $desc = str_replace('{link}', '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("BankAccounts") . '</strong>', $desc); |
|
| 1183 | 1183 | print $desc; |
| 1184 | 1184 | print '</div>'; |
| 1185 | 1185 | } |
@@ -1192,9 +1192,9 @@ discard block |
||
| 1192 | 1192 | if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1' |
| 1193 | 1193 | || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1' |
| 1194 | 1194 | || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == "" || getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT') == '-1') { |
| 1195 | - print($desc ? '' : '<br>').'<div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
|
| 1196 | - $desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
|
| 1197 | - $desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc); |
|
| 1195 | + print($desc ? '' : '<br>') . '<div class="warning">' . img_warning() . ' ' . $langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
|
| 1196 | + $desc = ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
|
| 1197 | + $desc = str_replace('{link}', '<strong>' . $langs->transnoentitiesnoconv("MenuAccountancy") . '-' . $langs->transnoentitiesnoconv("Setup") . "-" . $langs->transnoentitiesnoconv("MenuDefaultAccounts") . '</strong>', $desc); |
|
| 1198 | 1198 | print $desc; |
| 1199 | 1199 | print '</div>'; |
| 1200 | 1200 | } |
@@ -1203,17 +1203,17 @@ discard block |
||
| 1203 | 1203 | print '<br><div class="tabsAction tabsActionNoBottom centerimp">'; |
| 1204 | 1204 | |
| 1205 | 1205 | if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL') && $in_bookkeeping == 'notyet') { |
| 1206 | - print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />'; |
|
| 1206 | + print '<input type="button" class="butAction" name="exportcsv" value="' . $langs->trans("ExportDraftJournal") . '" onclick="launch_export();" />'; |
|
| 1207 | 1207 | } |
| 1208 | 1208 | |
| 1209 | 1209 | if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER') == '-1' |
| 1210 | 1210 | || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == "" || getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER') == '-1') { |
| 1211 | - print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />'; |
|
| 1211 | + print '<input type="button" class="butActionRefused classfortooltip" title="' . dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")) . '" value="' . $langs->trans("WriteBookKeeping") . '" />'; |
|
| 1212 | 1212 | } else { |
| 1213 | 1213 | if ($in_bookkeeping == 'notyet') { |
| 1214 | - print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />'; |
|
| 1214 | + print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />'; |
|
| 1215 | 1215 | } else { |
| 1216 | - print '<a class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>'; |
|
| 1216 | + print '<a class="butActionRefused classfortooltip" name="writebookkeeping">' . $langs->trans("WriteBookKeeping") . '</a>'; |
|
| 1217 | 1217 | } |
| 1218 | 1218 | } |
| 1219 | 1219 | |
@@ -1245,14 +1245,14 @@ discard block |
||
| 1245 | 1245 | print '<div class="div-table-responsive">'; |
| 1246 | 1246 | print '<table class="noborder centpercent">'; |
| 1247 | 1247 | print '<tr class="liste_titre">'; |
| 1248 | - print "<td>".$langs->trans("Date")."</td>"; |
|
| 1249 | - print "<td>".$langs->trans("Piece").' ('.$langs->trans("ObjectsRef").")</td>"; |
|
| 1250 | - print "<td>".$langs->trans("AccountAccounting")."</td>"; |
|
| 1251 | - print "<td>".$langs->trans("SubledgerAccount")."</td>"; |
|
| 1252 | - print "<td>".$langs->trans("LabelOperation")."</td>"; |
|
| 1253 | - print '<td class="center">'.$langs->trans("PaymentMode")."</td>"; |
|
| 1254 | - print '<td class="right">'.$langs->trans("AccountingDebit")."</td>"; |
|
| 1255 | - print '<td class="right">'.$langs->trans("AccountingCredit")."</td>"; |
|
| 1248 | + print "<td>" . $langs->trans("Date") . "</td>"; |
|
| 1249 | + print "<td>" . $langs->trans("Piece") . ' (' . $langs->trans("ObjectsRef") . ")</td>"; |
|
| 1250 | + print "<td>" . $langs->trans("AccountAccounting") . "</td>"; |
|
| 1251 | + print "<td>" . $langs->trans("SubledgerAccount") . "</td>"; |
|
| 1252 | + print "<td>" . $langs->trans("LabelOperation") . "</td>"; |
|
| 1253 | + print '<td class="center">' . $langs->trans("PaymentMode") . "</td>"; |
|
| 1254 | + print '<td class="right">' . $langs->trans("AccountingDebit") . "</td>"; |
|
| 1255 | + print '<td class="right">' . $langs->trans("AccountingCredit") . "</td>"; |
|
| 1256 | 1256 | print "</tr>\n"; |
| 1257 | 1257 | |
| 1258 | 1258 | $r = ''; |
@@ -1267,29 +1267,29 @@ discard block |
||
| 1267 | 1267 | if ($mt) { |
| 1268 | 1268 | $reflabel = ''; |
| 1269 | 1269 | if (!empty($val['lib'])) { |
| 1270 | - $reflabel .= $val['lib']." - "; |
|
| 1270 | + $reflabel .= $val['lib'] . " - "; |
|
| 1271 | 1271 | } |
| 1272 | - $reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref']; |
|
| 1272 | + $reflabel .= $langs->trans("Bank") . ' ' . $val['bank_account_ref']; |
|
| 1273 | 1273 | if (!empty($val['soclib'])) { |
| 1274 | - $reflabel .= " - ".$val['soclib']; |
|
| 1274 | + $reflabel .= " - " . $val['soclib']; |
|
| 1275 | 1275 | } |
| 1276 | 1276 | |
| 1277 | 1277 | //var_dump($tabpay[$key]); |
| 1278 | - print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->'; |
|
| 1278 | + print '<!-- Bank bank.rowid=' . $key . ' type=' . $tabpay[$key]['type'] . ' ref=' . $tabpay[$key]['ref'] . '-->'; |
|
| 1279 | 1279 | print '<tr class="oddeven">'; |
| 1280 | 1280 | |
| 1281 | 1281 | // Date |
| 1282 | - print "<td>".$date."</td>"; |
|
| 1282 | + print "<td>" . $date . "</td>"; |
|
| 1283 | 1283 | |
| 1284 | 1284 | // Ref |
| 1285 | - print "<td>".dol_escape_htmltag($ref)."</td>"; |
|
| 1285 | + print "<td>" . dol_escape_htmltag($ref) . "</td>"; |
|
| 1286 | 1286 | |
| 1287 | 1287 | // Ledger account |
| 1288 | 1288 | $accounttoshow = length_accountg($k); |
| 1289 | 1289 | if (empty($accounttoshow) || $accounttoshow == 'NotDefined') { |
| 1290 | - $accounttoshow = '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>'; |
|
| 1290 | + $accounttoshow = '<span class="error">' . $langs->trans("BankAccountNotDefined") . '</span>'; |
|
| 1291 | 1291 | } |
| 1292 | - print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">'; |
|
| 1292 | + print '<td class="maxwidth300" title="' . dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)) . '">'; |
|
| 1293 | 1293 | print $accounttoshow; |
| 1294 | 1294 | print "</td>"; |
| 1295 | 1295 | |
@@ -1305,12 +1305,12 @@ discard block |
||
| 1305 | 1305 | |
| 1306 | 1306 | // Label operation |
| 1307 | 1307 | print '<td>'; |
| 1308 | - print $reflabel; // This is already html escaped content |
|
| 1308 | + print $reflabel; // This is already html escaped content |
|
| 1309 | 1309 | print "</td>"; |
| 1310 | 1310 | |
| 1311 | - print '<td class="center">'.$val["type_payment"]."</td>"; |
|
| 1312 | - print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
| 1313 | - print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
| 1311 | + print '<td class="center">' . $val["type_payment"] . "</td>"; |
|
| 1312 | + print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
| 1313 | + print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
| 1314 | 1314 | print "</tr>"; |
| 1315 | 1315 | |
| 1316 | 1316 | $i++; |
@@ -1323,22 +1323,22 @@ discard block |
||
| 1323 | 1323 | if ($mt) { |
| 1324 | 1324 | $reflabel = ''; |
| 1325 | 1325 | if (!empty($val['lib'])) { |
| 1326 | - $reflabel .= $val['lib'].($val['soclib'] ? " - " : ""); |
|
| 1326 | + $reflabel .= $val['lib'] . ($val['soclib'] ? " - " : ""); |
|
| 1327 | 1327 | } |
| 1328 | 1328 | if ($tabtype[$key] == 'banktransfert') { |
| 1329 | - $reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer; |
|
| 1329 | + $reflabel .= $langs->trans('TransitionalAccount') . ' ' . $account_transfer; |
|
| 1330 | 1330 | } else { |
| 1331 | 1331 | $reflabel .= $val['soclib']; |
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | - print '<!-- Thirdparty bank.rowid='.$key.' -->'; |
|
| 1334 | + print '<!-- Thirdparty bank.rowid=' . $key . ' -->'; |
|
| 1335 | 1335 | print '<tr class="oddeven">'; |
| 1336 | 1336 | |
| 1337 | 1337 | // Date |
| 1338 | - print "<td>".$date."</td>"; |
|
| 1338 | + print "<td>" . $date . "</td>"; |
|
| 1339 | 1339 | |
| 1340 | 1340 | // Ref |
| 1341 | - print "<td>".dol_escape_htmltag($ref)."</td>"; |
|
| 1341 | + print "<td>" . dol_escape_htmltag($ref) . "</td>"; |
|
| 1342 | 1342 | |
| 1343 | 1343 | // Ledger account |
| 1344 | 1344 | $account_ledger = $k; |
@@ -1369,9 +1369,9 @@ discard block |
||
| 1369 | 1369 | if ($tabtype[$key] == 'unknown') { |
| 1370 | 1370 | // We will accept writing, but into a waiting account |
| 1371 | 1371 | if (!getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') || getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') == '-1') { |
| 1372 | - $accounttoshow = '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>'; |
|
| 1372 | + $accounttoshow = '<span class="error small">' . $langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking') . '</span>'; |
|
| 1373 | 1373 | } else { |
| 1374 | - $accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'))).'</span>'; // We will use a waiting account |
|
| 1374 | + $accounttoshow = '<span class="warning small">' . $langs->trans('UnknownAccountForThirdparty', length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'))) . '</span>'; // We will use a waiting account |
|
| 1375 | 1375 | } |
| 1376 | 1376 | } else { |
| 1377 | 1377 | // We will refuse writing |
@@ -1394,11 +1394,11 @@ discard block |
||
| 1394 | 1394 | if ($tabtype[$key] == 'member') { |
| 1395 | 1395 | $errorstring = 'MainAccountForSubscriptionPaymentNotDefined'; |
| 1396 | 1396 | } |
| 1397 | - $accounttoshow = '<span class="error small">'.$langs->trans($errorstring).'</span>'; |
|
| 1397 | + $accounttoshow = '<span class="error small">' . $langs->trans($errorstring) . '</span>'; |
|
| 1398 | 1398 | } |
| 1399 | 1399 | } |
| 1400 | - print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">'; |
|
| 1401 | - print $accounttoshow; // This is a HTML string |
|
| 1400 | + print '<td class="maxwidth300" title="' . dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)) . '">'; |
|
| 1401 | + print $accounttoshow; // This is a HTML string |
|
| 1402 | 1402 | print "</td>"; |
| 1403 | 1403 | |
| 1404 | 1404 | // Subledger account |
@@ -1414,12 +1414,12 @@ discard block |
||
| 1414 | 1414 | if (!empty($tabcompany[$key]['code_compta'])) { |
| 1415 | 1415 | if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) { |
| 1416 | 1416 | // For such case, if subledger is not defined, we won't use subledger accounts. |
| 1417 | - $accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>'; |
|
| 1417 | + $accounttoshowsubledger = '<span class="warning small">' . $langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored") . '</span>'; |
|
| 1418 | 1418 | } else { |
| 1419 | - $accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>'; |
|
| 1419 | + $accounttoshowsubledger = '<span class="warning small">' . $langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']) . '</span>'; |
|
| 1420 | 1420 | } |
| 1421 | 1421 | } else { |
| 1422 | - $accounttoshowsubledger = '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>'; |
|
| 1422 | + $accounttoshowsubledger = '<span class="error small">' . $langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking") . '</span>'; |
|
| 1423 | 1423 | } |
| 1424 | 1424 | } |
| 1425 | 1425 | } else { |
@@ -1427,16 +1427,16 @@ discard block |
||
| 1427 | 1427 | } |
| 1428 | 1428 | } |
| 1429 | 1429 | print '<td class="maxwidth300">'; |
| 1430 | - print $accounttoshowsubledger; // This is a html string |
|
| 1430 | + print $accounttoshowsubledger; // This is a html string |
|
| 1431 | 1431 | print "</td>"; |
| 1432 | 1432 | |
| 1433 | - print "<td>".$reflabel."</td>"; |
|
| 1433 | + print "<td>" . $reflabel . "</td>"; |
|
| 1434 | 1434 | |
| 1435 | - print '<td class="center">'.$val["type_payment"]."</td>"; |
|
| 1435 | + print '<td class="center">' . $val["type_payment"] . "</td>"; |
|
| 1436 | 1436 | |
| 1437 | - print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
| 1437 | + print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
| 1438 | 1438 | |
| 1439 | - print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
| 1439 | + print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
| 1440 | 1440 | |
| 1441 | 1441 | print "</tr>"; |
| 1442 | 1442 | |
@@ -1448,14 +1448,14 @@ discard block |
||
| 1448 | 1448 | if ($mt) { |
| 1449 | 1449 | $reflabel = ''; |
| 1450 | 1450 | if (!empty($val['lib'])) { |
| 1451 | - $reflabel .= $val['lib']." - "; |
|
| 1451 | + $reflabel .= $val['lib'] . " - "; |
|
| 1452 | 1452 | } |
| 1453 | 1453 | $reflabel .= 'WaitingAccount'; |
| 1454 | 1454 | |
| 1455 | - print '<!-- Wait bank.rowid='.$key.' -->'; |
|
| 1455 | + print '<!-- Wait bank.rowid=' . $key . ' -->'; |
|
| 1456 | 1456 | print '<tr class="oddeven">'; |
| 1457 | - print "<td>".$date."</td>"; |
|
| 1458 | - print "<td>".$ref."</td>"; |
|
| 1457 | + print "<td>" . $date . "</td>"; |
|
| 1458 | + print "<td>" . $ref . "</td>"; |
|
| 1459 | 1459 | // Ledger account |
| 1460 | 1460 | print "<td>"; |
| 1461 | 1461 | /*if (empty($accounttoshow) || $accounttoshow == 'NotDefined') |
@@ -1468,10 +1468,10 @@ discard block |
||
| 1468 | 1468 | // Subledger account |
| 1469 | 1469 | print "<td>"; |
| 1470 | 1470 | print "</td>"; |
| 1471 | - print "<td>".dol_escape_htmltag($reflabel)."</td>"; |
|
| 1472 | - print '<td class="center">'.$val["type_payment"]."</td>"; |
|
| 1473 | - print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>"; |
|
| 1474 | - print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>"; |
|
| 1471 | + print "<td>" . dol_escape_htmltag($reflabel) . "</td>"; |
|
| 1472 | + print '<td class="center">' . $val["type_payment"] . "</td>"; |
|
| 1473 | + print '<td class="right nowraponall amount">' . ($mt < 0 ? price(-$mt) : '') . "</td>"; |
|
| 1474 | + print '<td class="right nowraponall amount">' . ($mt >= 0 ? price($mt) : '') . "</td>"; |
|
| 1475 | 1475 | print "</tr>"; |
| 1476 | 1476 | |
| 1477 | 1477 | $i++; |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | |
| 1483 | 1483 | if (!$i) { |
| 1484 | 1484 | $colspan = 8; |
| 1485 | - print '<tr class="oddeven"><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 1485 | + print '<tr class="oddeven"><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 1486 | 1486 | } |
| 1487 | 1487 | |
| 1488 | 1488 | print "</table>"; |
@@ -1537,78 +1537,78 @@ discard block |
||
| 1537 | 1537 | $sqlmid = ''; |
| 1538 | 1538 | if ($typerecord == 'payment') { |
| 1539 | 1539 | if (getDolGlobalInt('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { |
| 1540 | - $sqlmid = "SELECT payfac.fk_facture as id, ".$db->ifsql('f1.rowid IS NULL', 'f.ref', 'f1.ref')." as ref"; |
|
| 1541 | - $sqlmid .= " FROM ".$db->prefix()."paiement_facture as payfac"; |
|
| 1542 | - $sqlmid .= " LEFT JOIN ".$db->prefix()."facture as f ON f.rowid = payfac.fk_facture"; |
|
| 1543 | - $sqlmid .= " LEFT JOIN ".$db->prefix()."societe_remise_except as sre ON sre.fk_facture_source = payfac.fk_facture"; |
|
| 1544 | - $sqlmid .= " LEFT JOIN ".$db->prefix()."facture as f1 ON f1.rowid = sre.fk_facture"; |
|
| 1545 | - $sqlmid .= " WHERE payfac.fk_paiement=".((int) $val['paymentid']); |
|
| 1540 | + $sqlmid = "SELECT payfac.fk_facture as id, " . $db->ifsql('f1.rowid IS NULL', 'f.ref', 'f1.ref') . " as ref"; |
|
| 1541 | + $sqlmid .= " FROM " . $db->prefix() . "paiement_facture as payfac"; |
|
| 1542 | + $sqlmid .= " LEFT JOIN " . $db->prefix() . "facture as f ON f.rowid = payfac.fk_facture"; |
|
| 1543 | + $sqlmid .= " LEFT JOIN " . $db->prefix() . "societe_remise_except as sre ON sre.fk_facture_source = payfac.fk_facture"; |
|
| 1544 | + $sqlmid .= " LEFT JOIN " . $db->prefix() . "facture as f1 ON f1.rowid = sre.fk_facture"; |
|
| 1545 | + $sqlmid .= " WHERE payfac.fk_paiement=" . ((int) $val['paymentid']); |
|
| 1546 | 1546 | } else { |
| 1547 | 1547 | $sqlmid = "SELECT payfac.fk_facture as id, f.ref as ref"; |
| 1548 | - $sqlmid .= " FROM ".$db->prefix()."paiement_facture as payfac"; |
|
| 1549 | - $sqlmid .= " INNER JOIN ".$db->prefix()."facture as f ON f.rowid = payfac.fk_facture"; |
|
| 1550 | - $sqlmid .= " WHERE payfac.fk_paiement=".((int) $val['paymentid']); |
|
| 1548 | + $sqlmid .= " FROM " . $db->prefix() . "paiement_facture as payfac"; |
|
| 1549 | + $sqlmid .= " INNER JOIN " . $db->prefix() . "facture as f ON f.rowid = payfac.fk_facture"; |
|
| 1550 | + $sqlmid .= " WHERE payfac.fk_paiement=" . ((int) $val['paymentid']); |
|
| 1551 | 1551 | } |
| 1552 | 1552 | $ref = $langs->transnoentitiesnoconv("Invoice"); |
| 1553 | 1553 | } elseif ($typerecord == 'payment_supplier') { |
| 1554 | 1554 | $sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref'; |
| 1555 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f"; |
|
| 1556 | - $sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".((int) $val["paymentsupplierid"]); |
|
| 1555 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac, " . MAIN_DB_PREFIX . "facture_fourn as f"; |
|
| 1556 | + $sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=" . ((int) $val["paymentsupplierid"]); |
|
| 1557 | 1557 | $ref = $langs->transnoentitiesnoconv("SupplierInvoice"); |
| 1558 | 1558 | } elseif ($typerecord == 'payment_expensereport') { |
| 1559 | 1559 | $sqlmid = 'SELECT e.rowid as id, e.ref'; |
| 1560 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as pe, ".MAIN_DB_PREFIX."expensereport as e"; |
|
| 1561 | - $sqlmid .= " WHERE pe.rowid=".((int) $val["paymentexpensereport"])." AND pe.fk_expensereport = e.rowid"; |
|
| 1560 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as pe, " . MAIN_DB_PREFIX . "expensereport as e"; |
|
| 1561 | + $sqlmid .= " WHERE pe.rowid=" . ((int) $val["paymentexpensereport"]) . " AND pe.fk_expensereport = e.rowid"; |
|
| 1562 | 1562 | $ref = $langs->transnoentitiesnoconv("ExpenseReport"); |
| 1563 | 1563 | } elseif ($typerecord == 'payment_salary') { |
| 1564 | 1564 | $sqlmid = 'SELECT s.rowid as ref'; |
| 1565 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; |
|
| 1566 | - $sqlmid .= " WHERE s.rowid=".((int) $val["paymentsalid"]); |
|
| 1565 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s"; |
|
| 1566 | + $sqlmid .= " WHERE s.rowid=" . ((int) $val["paymentsalid"]); |
|
| 1567 | 1567 | $ref = $langs->transnoentitiesnoconv("SalaryPayment"); |
| 1568 | 1568 | } elseif ($typerecord == 'sc') { |
| 1569 | 1569 | $sqlmid = 'SELECT sc.rowid as ref'; |
| 1570 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc"; |
|
| 1571 | - $sqlmid .= " WHERE sc.rowid=".((int) $val["paymentscid"]); |
|
| 1570 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementcharge as sc"; |
|
| 1571 | + $sqlmid .= " WHERE sc.rowid=" . ((int) $val["paymentscid"]); |
|
| 1572 | 1572 | $ref = $langs->transnoentitiesnoconv("SocialContribution"); |
| 1573 | 1573 | } elseif ($typerecord == 'payment_vat') { |
| 1574 | 1574 | $sqlmid = 'SELECT v.rowid as ref'; |
| 1575 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v"; |
|
| 1576 | - $sqlmid .= " WHERE v.rowid=".((int) $val["paymentvatid"]); |
|
| 1575 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "tva as v"; |
|
| 1576 | + $sqlmid .= " WHERE v.rowid=" . ((int) $val["paymentvatid"]); |
|
| 1577 | 1577 | $ref = $langs->transnoentitiesnoconv("PaymentVat"); |
| 1578 | 1578 | } elseif ($typerecord == 'payment_donation') { |
| 1579 | 1579 | $sqlmid = 'SELECT payd.fk_donation as ref'; |
| 1580 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd"; |
|
| 1581 | - $sqlmid .= " WHERE payd.fk_donation=".((int) $val["paymentdonationid"]); |
|
| 1580 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd"; |
|
| 1581 | + $sqlmid .= " WHERE payd.fk_donation=" . ((int) $val["paymentdonationid"]); |
|
| 1582 | 1582 | $ref = $langs->transnoentitiesnoconv("Donation"); |
| 1583 | 1583 | } elseif ($typerecord == 'payment_loan') { |
| 1584 | 1584 | $sqlmid = 'SELECT l.rowid as ref'; |
| 1585 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l"; |
|
| 1586 | - $sqlmid .= " WHERE l.rowid=".((int) $val["paymentloanid"]); |
|
| 1585 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_loan as l"; |
|
| 1586 | + $sqlmid .= " WHERE l.rowid=" . ((int) $val["paymentloanid"]); |
|
| 1587 | 1587 | $ref = $langs->transnoentitiesnoconv("LoanPayment"); |
| 1588 | 1588 | } elseif ($typerecord == 'payment_various') { |
| 1589 | 1589 | $sqlmid = 'SELECT v.rowid as ref'; |
| 1590 | - $sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v"; |
|
| 1591 | - $sqlmid .= " WHERE v.rowid=".((int) $val["paymentvariousid"]); |
|
| 1590 | + $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_various as v"; |
|
| 1591 | + $sqlmid .= " WHERE v.rowid=" . ((int) $val["paymentvariousid"]); |
|
| 1592 | 1592 | $ref = $langs->transnoentitiesnoconv("VariousPayment"); |
| 1593 | 1593 | } |
| 1594 | 1594 | // Add warning |
| 1595 | 1595 | if (empty($sqlmid)) { |
| 1596 | - dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING); |
|
| 1596 | + dol_syslog("Found a typerecord=" . $typerecord . " not supported", LOG_WARNING); |
|
| 1597 | 1597 | } |
| 1598 | 1598 | |
| 1599 | 1599 | if ($sqlmid) { |
| 1600 | - dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG); |
|
| 1600 | + dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG); |
|
| 1601 | 1601 | $resultmid = $db->query($sqlmid); |
| 1602 | 1602 | if ($resultmid) { |
| 1603 | 1603 | while ($objmid = $db->fetch_object($resultmid)) { |
| 1604 | - $ref .= ' '.$objmid->ref; |
|
| 1604 | + $ref .= ' ' . $objmid->ref; |
|
| 1605 | 1605 | } |
| 1606 | 1606 | } else { |
| 1607 | 1607 | dol_print_error($db); |
| 1608 | 1608 | } |
| 1609 | 1609 | } |
| 1610 | 1610 | |
| 1611 | - $ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300 |
|
| 1611 | + $ref = dol_trunc($langs->transnoentitiesnoconv("BankId") . ' ' . $val['fk_bank'] . ' - ' . $ref, 295); // 295 + 3 dots (...) is < than max size of 300 |
|
| 1612 | 1612 | return $ref; |
| 1613 | 1613 | } |
| 1614 | 1614 | } |
@@ -1970,7 +1970,7 @@ discard block |
||
| 1970 | 1970 | |
| 1971 | 1971 | foreach ($arrayofvat[$key] as $k => $mt) { |
| 1972 | 1972 | if ($mt) { |
| 1973 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 1973 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 1974 | 1974 | $account_label = $accountingaccount->label; |
| 1975 | 1975 | |
| 1976 | 1976 | // get compte id and label |
@@ -2572,7 +2572,7 @@ discard block |
||
| 2572 | 2572 | $cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined'); |
| 2573 | 2573 | $rcctva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined'); |
| 2574 | 2574 | $rcdtva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined'); |
| 2575 | - $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
| 2575 | + $country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC'] |
|
| 2576 | 2576 | |
| 2577 | 2577 | $i = 0; |
| 2578 | 2578 | while ($i < $num) { |
@@ -2878,7 +2878,7 @@ discard block |
||
| 2878 | 2878 | // Product / Service |
| 2879 | 2879 | if (!$errorforline) { |
| 2880 | 2880 | foreach ($tabht[$key] as $k => $mt) { |
| 2881 | - $resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 2881 | + $resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 2882 | 2882 | $label_account = $accountingaccount->label; |
| 2883 | 2883 | |
| 2884 | 2884 | // get compte id and label |
@@ -2978,7 +2978,7 @@ discard block |
||
| 2978 | 2978 | |
| 2979 | 2979 | foreach ($arrayofvat[$key] as $k => $mt) { |
| 2980 | 2980 | if ($mt) { |
| 2981 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 2981 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 2982 | 2982 | $label_account = $accountingaccount->label; |
| 2983 | 2983 | |
| 2984 | 2984 | $bookkeeping = new BookKeeping($db); |
@@ -3336,7 +3336,7 @@ discard block |
||
| 3336 | 3336 | } |
| 3337 | 3337 | |
| 3338 | 3338 | // Button to write into Ledger |
| 3339 | - $acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['','-1']); |
|
| 3339 | + $acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['', '-1']); |
|
| 3340 | 3340 | if ($acctSupplierNotConfigured) { |
| 3341 | 3341 | print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
| 3342 | 3342 | $desc = ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
@@ -3916,7 +3916,7 @@ discard block |
||
| 3916 | 3916 | |
| 3917 | 3917 | // Move a part of the retained warrenty into the account of warranty |
| 3918 | 3918 | if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY') && $obj->retained_warranty > 0) { |
| 3919 | - $retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value) |
|
| 3919 | + $retained_warranty = (float) price2num($total_ttc * $obj->retained_warranty / 100, 'MT'); // Calculate the amount of warrenty for this line (using the percent value) |
|
| 3920 | 3920 | $tabwarranty[$obj->rowid][$compta_soc] += $retained_warranty; |
| 3921 | 3921 | $total_ttc -= $retained_warranty; |
| 3922 | 3922 | } |
@@ -4197,7 +4197,7 @@ discard block |
||
| 4197 | 4197 | // Product / Service |
| 4198 | 4198 | if (!$errorforline) { |
| 4199 | 4199 | foreach ($tabht[$key] as $k => $mt) { |
| 4200 | - $resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 4200 | + $resultfetch = $accountingaccount->fetch(null, $k, true); // TODO Use a cache |
|
| 4201 | 4201 | $label_account = $accountingaccount->label; |
| 4202 | 4202 | |
| 4203 | 4203 | // get compte id and label |
@@ -4273,7 +4273,7 @@ discard block |
||
| 4273 | 4273 | |
| 4274 | 4274 | foreach ($arrayofvat[$key] as $k => $mt) { |
| 4275 | 4275 | if ($mt) { |
| 4276 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 4276 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 4277 | 4277 | $label_account = $accountingaccount->label; |
| 4278 | 4278 | |
| 4279 | 4279 | $bookkeeping = new BookKeeping($db); |
@@ -4334,7 +4334,7 @@ discard block |
||
| 4334 | 4334 | if (is_array($tabrevenuestamp[$key])) { |
| 4335 | 4335 | foreach ($tabrevenuestamp[$key] as $k => $mt) { |
| 4336 | 4336 | if ($mt) { |
| 4337 | - $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 4337 | + $accountingaccount->fetch(null, $k, true); // TODO Use a cache for label |
|
| 4338 | 4338 | $label_account = $accountingaccount->label; |
| 4339 | 4339 | |
| 4340 | 4340 | $bookkeeping = new BookKeeping($db); |
@@ -4455,7 +4455,7 @@ discard block |
||
| 4455 | 4455 | foreach ($tabfac as $key => $val) { |
| 4456 | 4456 | $companystatic->id = $tabcompany[$key]['id']; |
| 4457 | 4457 | $companystatic->name = $tabcompany[$key]['name']; |
| 4458 | - $companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated |
|
| 4458 | + $companystatic->code_compta = $tabcompany[$key]['code_compta']; // deprecated |
|
| 4459 | 4459 | $companystatic->code_compta_client = $tabcompany[$key]['code_compta']; |
| 4460 | 4460 | $companystatic->code_client = $tabcompany[$key]['code_client']; |
| 4461 | 4461 | $companystatic->client = 3; |
@@ -4639,7 +4639,7 @@ discard block |
||
| 4639 | 4639 | } |
| 4640 | 4640 | |
| 4641 | 4641 | // Button to write into Ledger |
| 4642 | - $acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['','-1']); |
|
| 4642 | + $acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['', '-1']); |
|
| 4643 | 4643 | if ($acctCustomerNotConfigured) { |
| 4644 | 4644 | print '<br><div class="warning">' . img_warning() . ' ' . $langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); |
| 4645 | 4645 | $desc = ' : ' . $langs->trans("AccountancyAreaDescMisc", 4, '{link}'); |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | */ |
| 348 | 348 | public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0, $noouput = 0) |
| 349 | 349 | { |
| 350 | - global $db, $conf, $langs; // The tpl file use $db |
|
| 351 | - global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
| 350 | + global $db, $conf, $langs; // The tpl file use $db |
|
| 351 | + global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php |
|
| 352 | 352 | |
| 353 | 353 | // Define name of file to save |
| 354 | 354 | $filename = 'general_ledger-' . $this->getFormatCode($formatexportset); |
@@ -2239,7 +2239,7 @@ discard block |
||
| 2239 | 2239 | } |
| 2240 | 2240 | } elseif ($line->doc_type == 'customer_invoice') { |
| 2241 | 2241 | if (($line->amount) < 0) { |
| 2242 | - $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
| 2242 | + $nature_piece = 'AC'; // Currently, only the sign of amount allows to know the type of invoice (standard or credit note). Other solution is to analyse debit/credit/role of account. TODO Add column doc_type_long or make amount mandatory with rule on sign. |
|
| 2243 | 2243 | } else { |
| 2244 | 2244 | $nature_piece = 'FC'; |
| 2245 | 2245 | } |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | $object->gender = trim(GETPOST("gender", 'alphanohtml')); |
| 552 | 552 | $object->login = trim(GETPOST("login", 'alphanohtml')); |
| 553 | 553 | if (GETPOSTISSET('pass')) { |
| 554 | - $object->pass = trim(GETPOST("pass", 'none')); // For password, we must use 'none' |
|
| 554 | + $object->pass = trim(GETPOST("pass", 'none')); // For password, we must use 'none' |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | $object->societe = trim(GETPOST("societe", 'alphanohtml')); // deprecated |
@@ -606,10 +606,10 @@ discard block |
||
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | // Check if we need to also synchronize password information |
| 609 | - $nosyncuserpass = 1; // no by default |
|
| 609 | + $nosyncuserpass = 1; // no by default |
|
| 610 | 610 | if (GETPOSTISSET('pass')) { |
| 611 | 611 | if ($object->user_id) { // If member is linked to a user |
| 612 | - $nosyncuserpass = 0; // We may try to sync password |
|
| 612 | + $nosyncuserpass = 0; // We may try to sync password |
|
| 613 | 613 | if ($user->id == $object->user_id) { |
| 614 | 614 | if (!$user->hasRight('user', 'self', 'password')) { |
| 615 | 615 | $nosyncuserpass = 1; // Disable synchronizing |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $email = preg_replace('/\s+/', '', GETPOST("member_email", 'alpha')); |
| 720 | 720 | $url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL)); |
| 721 | 721 | $login = GETPOST("member_login", 'alphanohtml'); |
| 722 | - $pass = GETPOST("password", 'none'); // For password, we use 'none' |
|
| 722 | + $pass = GETPOST("password", 'none'); // For password, we use 'none' |
|
| 723 | 723 | $photo = GETPOST("photo", 'alphanohtml'); |
| 724 | 724 | $morphy = GETPOST("morphy", 'alphanohtml'); |
| 725 | 725 | $public = GETPOST("public", 'alphanohtml'); |
@@ -1538,7 +1538,7 @@ discard block |
||
| 1538 | 1538 | $maxfilesizearray = getMaxFileSizeArray(); |
| 1539 | 1539 | $maxmin = $maxfilesizearray['maxmin']; |
| 1540 | 1540 | if ($maxmin > 0) { |
| 1541 | - print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 1541 | + print '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 1542 | 1542 | } |
| 1543 | 1543 | print '<input type="file" class="flat" name="photo" id="photoinput">'; |
| 1544 | 1544 | print '</td></tr>'; |
@@ -2638,7 +2638,7 @@ discard block |
||
| 2638 | 2638 | } |
| 2639 | 2639 | |
| 2640 | 2640 | $dataseries = []; |
| 2641 | - $dataseries[] = [$langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']]; // Draft, not yet validated |
|
| 2641 | + $dataseries[] = [$langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']]; // Draft, not yet validated |
|
| 2642 | 2642 | $dataseries[] = [$langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']]; |
| 2643 | 2643 | $dataseries[] = [$langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']]; |
| 2644 | 2644 | $dataseries[] = [$langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']]; |
@@ -2949,7 +2949,7 @@ discard block |
||
| 2949 | 2949 | $search_address = GETPOST("search_address", 'alpha'); |
| 2950 | 2950 | $search_zip = GETPOST("search_zip", 'alpha'); |
| 2951 | 2951 | $search_town = GETPOST("search_town", 'alpha'); |
| 2952 | - $search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
| 2952 | + $search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state |
|
| 2953 | 2953 | $search_country = GETPOST("search_country", 'alpha'); |
| 2954 | 2954 | $search_phone = GETPOST("search_phone", 'alpha'); |
| 2955 | 2955 | $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); |
@@ -2964,7 +2964,7 @@ discard block |
||
| 2964 | 2964 | $socid = GETPOSTINT('socid'); |
| 2965 | 2965 | |
| 2966 | 2966 | $search_filter = GETPOST("search_filter", 'alpha'); |
| 2967 | - $search_status = GETPOST("search_status", 'intcomma'); // status |
|
| 2967 | + $search_status = GETPOST("search_status", 'intcomma'); // status |
|
| 2968 | 2968 | $search_datec_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datec_start_month'), GETPOSTINT('search_datec_start_day'), GETPOSTINT('search_datec_start_year')); |
| 2969 | 2969 | $search_datec_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datec_end_month'), GETPOSTINT('search_datec_end_day'), GETPOSTINT('search_datec_end_year')); |
| 2970 | 2970 | $search_datem_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datem_start_month'), GETPOSTINT('search_datem_start_day'), GETPOSTINT('search_datem_start_year')); |
@@ -3314,7 +3314,7 @@ discard block |
||
| 3314 | 3314 | $sqlfields = $sql; // $sql fields to remove for count total |
| 3315 | 3315 | |
| 3316 | 3316 | // SQL Alias adherent |
| 3317 | - $sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d"; // maybe better to use ad (adh) instead of d |
|
| 3317 | + $sql .= " FROM " . MAIN_DB_PREFIX . "adherent as d"; // maybe better to use ad (adh) instead of d |
|
| 3318 | 3318 | if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { |
| 3319 | 3319 | $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (d.rowid = ef.fk_object)"; |
| 3320 | 3320 | } |
@@ -3505,7 +3505,7 @@ discard block |
||
| 3505 | 3505 | // Output page |
| 3506 | 3506 | // -------------------------------------------------------------------- |
| 3507 | 3507 | |
| 3508 | - llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
| 3508 | + llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll |
|
| 3509 | 3509 | |
| 3510 | 3510 | $arrayofselected = is_array($toselect) ? $toselect : []; |
| 3511 | 3511 | |
@@ -4639,7 +4639,7 @@ discard block |
||
| 4639 | 4639 | global $langs; |
| 4640 | 4640 | |
| 4641 | 4641 | // Load translation files required by the page |
| 4642 | - $langs->loadLangs(array("companies","members","partnership", "other")); |
|
| 4642 | + $langs->loadLangs(array("companies", "members", "partnership", "other")); |
|
| 4643 | 4643 | |
| 4644 | 4644 | // Get parameters |
| 4645 | 4645 | $id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); |
@@ -5325,7 +5325,7 @@ discard block |
||
| 5325 | 5325 | //include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; |
| 5326 | 5326 | |
| 5327 | 5327 | |
| 5328 | - if (! ($object->id > 0)) { |
|
| 5328 | + if (!($object->id > 0)) { |
|
| 5329 | 5329 | $langs->load("errors"); |
| 5330 | 5330 | print $langs->trans("ErrorRecordNotFound"); |
| 5331 | 5331 | } |
@@ -251,7 +251,7 @@ |
||
| 251 | 251 | $this->dateh = $this->db->jdate($obj->dateh); |
| 252 | 252 | $this->datef = $this->db->jdate($obj->datef); |
| 253 | 253 | $this->amount = $obj->subscription; |
| 254 | - $this->note = $obj->note_public; // deprecated |
|
| 254 | + $this->note = $obj->note_public; // deprecated |
|
| 255 | 255 | $this->note_public = $obj->note_public; |
| 256 | 256 | $this->fk_bank = $obj->fk_bank; |
| 257 | 257 | return 1; |
@@ -522,7 +522,7 @@ |
||
| 522 | 522 | $this->amount = $obj->amount; |
| 523 | 523 | $this->caneditamount = $obj->caneditamount; |
| 524 | 524 | $this->mail_valid = $obj->mail_valid; |
| 525 | - $this->note = $obj->note_public; // deprecated |
|
| 525 | + $this->note = $obj->note_public; // deprecated |
|
| 526 | 526 | $this->note_public = $obj->note_public; |
| 527 | 527 | $this->vote = $obj->vote; |
| 528 | 528 | |
@@ -203,7 +203,7 @@ |
||
| 203 | 203 | $conf->file->main_force_https = empty($dolibarr_main_force_https) ? '' : $dolibarr_main_force_https; // Force https |
| 204 | 204 | $conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug) |
| 205 | 205 | $conf->file->instance_unique_id = empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; // Unique id of instance |
| 206 | - $conf->file->dol_main_url_root = $dolibarr_main_url_root ?? BASE_URL; // Define url inside the config file |
|
| 206 | + $conf->file->dol_main_url_root = $dolibarr_main_url_root ?? BASE_URL; // Define url inside the config file |
|
| 207 | 207 | $conf->file->dol_document_root = ['main' => (string) DOL_DOCUMENT_ROOT]; // Define array of document root directories ('/home/htdocs') |
| 208 | 208 | $conf->file->dol_url_root = ['main' => (string) DOL_URL_ROOT]; // Define array of url root path ('' or '/dolibarr') |
| 209 | 209 | if (!empty($dolibarr_main_document_root_alt)) { |