Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-08-28 18:31:40 +02:00
commit 79bd3e0b24
5 changed files with 125 additions and 47 deletions

View File

@ -3426,7 +3426,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= ", fk_product = ".((int) $fk_product);
$sql .= ", product_type = ".((int) $this->product_type);
$sql .= ", info_bits = ".((int) $this->info_bits);
$sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null');
$sql .= ", fk_unit = ".((int) $fk_unit);
// Multicurrency
$sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice)."";

View File

@ -3231,19 +3231,21 @@ if ($action == 'create') {
}
print '</span>';
print '</td>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayeraffiche).'</td>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayeraffiche).'</td><td>&nbsp;</td></tr>';
// Remainder to pay Multicurrency
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
print '<tr><td colspan="'.$nbcols.'" class="right">';
print '<span class="opacitymedium">';
print $langs->trans('MulticurrencyRemainderToPay');
if ($resteapayeraffiche <= 0) {
print $langs->trans('RemainderToPayBackMulticurrency');
} else {
print $langs->trans('ExcessPaidMulticurrency');
}
print '</span>';
print '</td>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'</td>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT')).'</td><td>&nbsp;</td></tr>';
}
print '<td class="nowrap">&nbsp;</td></tr>';
} else // Credit note
{
$cssforamountpaymentcomplete = 'amountpaymentneutral';
@ -3266,8 +3268,21 @@ if ($action == 'create') {
}
print '</td>';
print '</span>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($sign * $resteapayeraffiche).'</td>';
print '<td class="nowrap">&nbsp;</td></tr>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($sign * $resteapayeraffiche).'</td><td>&nbsp;</td></tr>';
// Remainder to pay back Multicurrency
if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) {
print '<tr><td colspan="'.$nbcols.'" class="right">';
print '<span class="opacitymedium">';
if ($resteapayeraffiche <= 0) {
print $langs->trans('RemainderToPayBackMulticurrency');
} else {
print $langs->trans('ExcessPaidMulticurrency');
}
print '</span>';
print '</td>';
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.(!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency).' '.price(price2num($sign * $object->multicurrency_tx * $resteapayeraffiche, 'MT')).'</td><td>&nbsp;</td></tr>';
}
// Sold credit note
// print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans('TotalTTC').' :</td>';

View File

@ -234,12 +234,17 @@ AlreadyPaidBack=Already paid back
AlreadyPaidNoCreditNotesNoDeposits=Already paid (without credit notes and down payments)
Abandoned=Abandoned
RemainderToPay=Remaining unpaid
RemainderToPayMulticurrency=Remaining unpaid, original currency
RemainderToTake=Remaining amount to take
RemainderToTakeMulticurrency=Remaining amount to take, original currency
RemainderToPayBack=Remaining amount to refund
RemainderToPayBackMulticurrency=Remaining amount to refund, original currency
Rest=Pending
AmountExpected=Amount claimed
ExcessReceived=Excess received
ExcessReceivedMulticurrency=Excess received, original currency
ExcessPaid=Excess paid
ExcessPaidMulticurrency=Excess paid, original currency
EscompteOffered=Discount offered (payment before term)
EscompteOfferedShort=Discount
SendBillRef=Submission of invoice %s
@ -591,6 +596,5 @@ SituationTotalRayToRest=Remainder to pay without taxe
PDFSituationTitle=Situation n° %d
SituationTotalProgress=Total progress %d %%
SearchUnpaidInvoicesWithDueDate=Search unpaid invoices with a due date = %s
RegisterPaymentAndClasiffiedPayed=Enter payment and classify 'Paid'
NoPaymentAvailable=No payment available for %s
PaymentRegisteredAndInvoiceSetToPaid=Payment registered and invoice %s set to paid

View File

@ -3,6 +3,7 @@
* Copyright (C) 2006-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -71,12 +72,22 @@ if ($mine) {
$search_task_user = $user->id; $mine = 0;
}
$search_sday = GETPOST('search_sday', 'int');
$search_smonth = GETPOST('search_smonth', 'int');
$search_syear = GETPOST('search_syear', 'int');
$search_eday = GETPOST('search_eday', 'int');
$search_emonth = GETPOST('search_emonth', 'int');
$search_eyear = GETPOST('search_eyear', 'int');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_datelimit_startday = GETPOST('search_datelimit_startday', 'int');
$search_datelimit_startmonth = GETPOST('search_datelimit_startmonth', 'int');
$search_datelimit_startyear = GETPOST('search_datelimit_startyear', 'int');
$search_datelimit_endday = GETPOST('search_datelimit_endday', 'int');
$search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int');
$search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int');
$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
// Initialize context for list
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'tasklist';
@ -191,12 +202,22 @@ if (empty($reshook)) {
$search_task_progress = "";
$search_task_user = -1;
$search_project_user = -1;
$search_sday = '';
$search_smonth = '';
$search_syear = '';
$search_eday = '';
$search_emonth = '';
$search_eyear = '';
$search_date_startday = '';
$search_date_startmonth = '';
$search_date_startyear = '';
$search_date_endday = '';
$search_date_endmonth = '';
$search_date_endyear = '';
$search_date_start = '';
$search_date_end = '';
$search_datelimit_startday = '';
$search_datelimit_startmonth = '';
$search_datelimit_startyear = '';
$search_datelimit_endday = '';
$search_datelimit_endmonth = '';
$search_datelimit_endyear = '';
$search_datelimit_start = '';
$search_datelimit_end = '';
$toselect = '';
$search_array_options = array();
}
@ -372,8 +393,18 @@ if ($search_task_progress) {
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
}
$sql .= dolSqlDateFilter('t.dateo', $search_sday, $search_smonth, $search_syear);
$sql .= dolSqlDateFilter('t.datee', $search_eday, $search_emonth, $search_eyear);
if ($search_date_start) {
$sql .= " AND t.dateo >= '".$db->idate($search_date_start)."'";
}
if ($search_date_end) {
$sql .= " AND t.dateo <= '".$db->idate($search_date_end)."'";
}
if ($search_datelimit_start) {
$sql .= " AND t.datee >= '".$db->idate($search_datelimit_start)."'";
}
if ($search_datelimit_end) {
$sql .= " AND t.datee <= '".$db->idate($search_datelimit_end)."'";
}
if ($search_all) {
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
}
@ -454,23 +485,41 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
if ($search_sday) {
$param .= '&search_sday='.urlencode($search_sday);
if ($search_date_startday) {
$param .= '&search_date_startday='.urlencode($search_date_startday);
}
if ($search_smonth) {
$param .= '&search_smonth='.urlencode($search_smonth);
if ($search_date_startmonth) {
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
}
if ($search_syear) {
$param .= '&search_syear='.urlencode($search_syear);
if ($search_date_startyear) {
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
}
if ($search_eday) {
$param .= '&search_eday='.urlencode($search_eday);
if ($search_date_endday) {
$param .= '&search_date_endday='.urlencode($search_date_endday);
}
if ($search_emonth) {
$param .= '&search_emonth='.urlencode($search_emonth);
if ($search_date_endmonth) {
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
}
if ($search_eyear) {
$param .= '&search_eyear='.urlencode($search_eyear);
if ($search_date_endyear) {
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
}
if ($search_datelimit_startday) {
$param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday);
}
if ($search_datelimit_startmonth) {
$param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth);
}
if ($search_datelimit_startyear) {
$param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear);
}
if ($search_datelimit_endday) {
$param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday);
}
if ($search_datelimit_endmonth) {
$param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth);
}
if ($search_datelimit_endyear) {
$param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear);
}
if ($socid) {
$param .= '&socid='.urlencode($socid);
@ -646,22 +695,26 @@ if (!empty($arrayfields['t.description']['checked'])) {
}
// Start date
if (!empty($arrayfields['t.dateo']['checked'])) {
print '<td class="liste_titre center minwidth150">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
print '<input class="flat" type="text" size="1" maxlength="2" name="search_sday" value="'.$search_sday.'">';
}
print '<input class="flat" type="text" size="1" maxlength="2" name="search_smonth" value="'.$search_smonth.'">';
print $formother->selectyear($search_syear ? $search_syear : -1, 'search_syear', 1, 20, 5, 0, 0, '', 'valignmiddle width75', 1);
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>';
print '</td>';
}
// End date
if (!empty($arrayfields['t.datee']['checked'])) {
print '<td class="liste_titre center minwidth150">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
print '<input class="flat" type="text" size="1" maxlength="2" name="search_eday" value="'.$search_eday.'">';
}
print '<input class="flat" type="text" size="1" maxlength="2" name="search_emonth" value="'.$search_emonth.'">';
print $formother->selectyear($search_eyear ? $search_eyear : -1, 'search_eyear', 1, 20, 5, 0, 0, '', 'valignmiddle width75', 1);
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
// TODO Add option late
//print '<br><input type="checkbox" name="search_option" value="late"'.($option == 'late' ? ' checked' : '').'> '.$langs->trans("Alert");
print '</div>';
print '</td>';
}
if (!empty($arrayfields['p.ref']['checked'])) {

View File

@ -491,6 +491,12 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
// Add joins from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " WHERE e.entity IN (".getEntity('reception').")";
if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no permission to see all
$sql .= " AND e.fk_soc = sc.fk_soc";