Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
5026de62f7
@ -1162,19 +1162,24 @@ if (empty($action) || $action == 'view') {
|
|||||||
//var_dump($tabpay[$key]);
|
//var_dump($tabpay[$key]);
|
||||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Date
|
||||||
print "<td>".$date."</td>";
|
print "<td>".$date."</td>";
|
||||||
print "<td>".$ref."</td>";
|
|
||||||
|
// Ref
|
||||||
|
print "<td>".dol_escape_htmltag($ref)."</td>";
|
||||||
|
|
||||||
// Ledger account
|
// Ledger account
|
||||||
print "<td>";
|
|
||||||
$accounttoshow = length_accountg($k);
|
$accounttoshow = length_accountg($k);
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
$accounttoshow = '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||||
} else {
|
|
||||||
print $accounttoshow;
|
|
||||||
}
|
}
|
||||||
|
print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">';
|
||||||
|
print $accounttoshow;
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
print '<td class="maxwidth300">';
|
||||||
/*$accounttoshow = length_accountg($k);
|
/*$accounttoshow = length_accountg($k);
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||||
{
|
{
|
||||||
@ -1182,9 +1187,12 @@ if (empty($action) || $action == 'view') {
|
|||||||
}
|
}
|
||||||
else print $accounttoshow;*/
|
else print $accounttoshow;*/
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "<td>";
|
|
||||||
print $reflabel;
|
// Label operation
|
||||||
|
print '<td>';
|
||||||
|
print $reflabel; // This is already html escaped content
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||||
@ -1208,10 +1216,14 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Date
|
||||||
print "<td>".$date."</td>";
|
print "<td>".$date."</td>";
|
||||||
print "<td>".$ref."</td>";
|
|
||||||
|
// Ref
|
||||||
|
print "<td>".dol_escape_htmltag($ref)."</td>";
|
||||||
|
|
||||||
// Ledger account
|
// Ledger account
|
||||||
print "<td>";
|
|
||||||
$account_ledger = $k;
|
$account_ledger = $k;
|
||||||
// Try to force general ledger account depending on type
|
// Try to force general ledger account depending on type
|
||||||
if ($tabtype[$key] == 'payment') {
|
if ($tabtype[$key] == 'payment') {
|
||||||
@ -1240,9 +1252,9 @@ if (empty($action) || $action == 'view') {
|
|||||||
if ($tabtype[$key] == 'unknown') {
|
if ($tabtype[$key] == 'unknown') {
|
||||||
// We will accept writing, but into a waiting account
|
// We will accept writing, but into a waiting account
|
||||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
|
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
|
||||||
print '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
$accounttoshow = '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
$accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We will refuse writing
|
// We will refuse writing
|
||||||
@ -1265,15 +1277,15 @@ if (empty($action) || $action == 'view') {
|
|||||||
if ($tabtype[$key] == 'member') {
|
if ($tabtype[$key] == 'member') {
|
||||||
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
||||||
}
|
}
|
||||||
print '<span class="error small">'.$langs->trans($errorstring).'</span>';
|
$accounttoshow = '<span class="error small">'.$langs->trans($errorstring).'</span>';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print $accounttoshow;
|
|
||||||
}
|
}
|
||||||
|
print '<td class="maxwidth300" title="'.dol_escape_htmltag(dol_string_nohtmltag($accounttoshow)).'">';
|
||||||
|
print $accounttoshow;
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
$accounttoshowsubledger = '';
|
||||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger
|
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger
|
||||||
$accounttoshowsubledger = length_accounta($k);
|
$accounttoshowsubledger = length_accounta($k);
|
||||||
if ($accounttoshow != $accounttoshowsubledger) {
|
if ($accounttoshow != $accounttoshowsubledger) {
|
||||||
@ -1285,18 +1297,20 @@ if (empty($action) || $action == 'view') {
|
|||||||
if (!empty($tabcompany[$key]['code_compta'])) {
|
if (!empty($tabcompany[$key]['code_compta'])) {
|
||||||
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
|
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
|
||||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||||
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
$accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
$accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
$accounttoshowsubledger = '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
print $accounttoshowsubledger;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$accounttoshowsubledger = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
print '<td class="maxwidth300">';
|
||||||
|
print $accounttoshowsubledger;
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
print "<td>".$reflabel."</td>";
|
print "<td>".$reflabel."</td>";
|
||||||
|
|||||||
@ -507,7 +507,9 @@ class Documents extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
$objectType = $modulepart;
|
$objectType = $modulepart;
|
||||||
if (! empty($object->id) && ! empty($object->table_element)) $objectType = $object->table_element;
|
if (! empty($object->id) && ! empty($object->table_element)) {
|
||||||
|
$objectType = $object->table_element;
|
||||||
|
}
|
||||||
|
|
||||||
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||||
if (empty($filearray)) {
|
if (empty($filearray)) {
|
||||||
|
|||||||
@ -1238,7 +1238,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "ALTER TABLE ".$table;
|
$sql = "ALTER TABLE ".$table;
|
||||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||||
if (in_array($field_desc['type'], array('double', 'tinyint', 'int', 'varchar')) && $field_desc['value']) {
|
if (in_array($field_desc['type'], array('double', 'varchar')) && $field_desc['value']) {
|
||||||
$sql .= "(".$field_desc['value'].")";
|
$sql .= "(".$field_desc['value'].")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4070,7 +4070,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||||
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||||
'conferenceorbooth', 'eventorganization'
|
'conferenceorbooth', 'eventorganization',
|
||||||
|
'stamp', 'signature'
|
||||||
))) {
|
))) {
|
||||||
$fakey = $pictowithouttext;
|
$fakey = $pictowithouttext;
|
||||||
$facolor = '';
|
$facolor = '';
|
||||||
|
|||||||
@ -791,16 +791,11 @@ END;
|
|||||||
|
|
||||||
// Barcode type
|
// Barcode type
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('BarcodeType').'</td>';
|
print '<td>'.$langs->trans('GencodBuyPrice').'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $formbarcode->selectBarcodeType(($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE")), 'fk_barcode_type', 1);
|
print img_picto('', 'barcode', 'class="pictofixedwidth"');
|
||||||
print '</td>';
|
print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1);
|
||||||
print '</tr>';
|
print ' <input class="flat" name="barcode" value="'.(GETPOSTISSET('barcode') ? GETPOST('barcode') : ($rowid ? $object->supplier_barcode : '')).'"></td>';
|
||||||
|
|
||||||
// Barcode value
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans('BarcodeValue').'</td>';
|
|
||||||
print '<td>'.img_picto('', 'barcode', 'class="pictofixedwidth"').'<input class="flat" name="barcode" value="'.($rowid ? $object->supplier_barcode : '').'"></td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -544,7 +544,7 @@ class Tasks extends DolibarrApi
|
|||||||
$this->task->timespent_datehour = $newdate;
|
$this->task->timespent_datehour = $newdate;
|
||||||
$this->task->timespent_withhour = 1;
|
$this->task->timespent_withhour = 1;
|
||||||
$this->task->timespent_duration = $duration;
|
$this->task->timespent_duration = $duration;
|
||||||
$this->task->timespent_fk_user = $user_id;
|
$this->task->timespent_fk_user = $uid;
|
||||||
$this->task->timespent_note = $note;
|
$this->task->timespent_note = $note;
|
||||||
|
|
||||||
$result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0);
|
$result = $this->task->addTimeSpent(DolibarrApiAccess::$user, 0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user