Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 23.0
This commit is contained in:
commit
16f5965983
8 changed files with 31 additions and 24 deletions
|
|
@ -671,9 +671,11 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
if (!$error) {
|
||||
$newremaintopay = $object->getRemainToPay(0);
|
||||
if ($newremaintopay == 0) {
|
||||
$object->setPaid($user);
|
||||
if ($object->status == Facture::STATUS_VALIDATED) {
|
||||
$newremaintopay = $object->getRemainToPay(0);
|
||||
if ($newremaintopay == 0) {
|
||||
$object->setPaid($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -821,30 +821,36 @@ if ($object->id > 0) {
|
|||
//print $langs->trans('CustomerIBAN').' ';
|
||||
|
||||
// if societe rib in model invoice, we preselect it
|
||||
$selectedRib = '';
|
||||
$selectedRibId = 0;
|
||||
if ($object->element == 'invoice' && $object->fk_fac_rec_source) {
|
||||
$facturerec = new FactureRec($db);
|
||||
$facturerec->fetch($object->fk_fac_rec_source);
|
||||
if ($facturerec->fk_societe_rib) {
|
||||
$companyBankAccount = new CompanyBankAccount($db);
|
||||
$res = $companyBankAccount->fetch($facturerec->fk_societe_rib);
|
||||
$selectedRib = $companyBankAccount->id;
|
||||
$selectedRibId = $companyBankAccount->id;
|
||||
}
|
||||
}
|
||||
|
||||
$selectedRib = $form->selectRib($selectedRib, 'accountcustomerid', 'fk_soc='.$object->socid, $langs->trans("CustomerIBAN"), '', 1, 'maxwidth500 maxwidth250onsmartphone');
|
||||
|
||||
$defaultRibId = $object->thirdparty->getDefaultRib();
|
||||
if ($defaultRibId) {
|
||||
$companyBankAccount = new CompanyBankAccount($db);
|
||||
$res = $companyBankAccount->fetch($defaultRibId);
|
||||
if ($res > 0 && !$companyBankAccount->verif()) {
|
||||
print img_warning('Error on default bank number for IBAN : '.$langs->trans($companyBankAccount->error));
|
||||
}
|
||||
} elseif (($type != 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type == 'bank-transfer' && $object->mode_reglement_code == 'VIR')) {
|
||||
print img_warning($langs->trans("NoDefaultIBANFound"));
|
||||
$defaultRibId = 0;
|
||||
if (empty($selectedRibId)) {
|
||||
$defaultRibId = $object->thirdparty->getDefaultRib();
|
||||
$selectedRibId = (int) $defaultRibId;
|
||||
}
|
||||
|
||||
$selectedRib = $form->selectRib($selectedRibId, 'accountcustomerid', 'fk_soc='.$object->socid, $langs->trans("CustomerIBAN"), '', 1, 'maxwidth500 maxwidth250onsmartphone');
|
||||
|
||||
if (empty($selectedRibId)) {
|
||||
if ($defaultRibId) {
|
||||
$companyBankAccount = new CompanyBankAccount($db);
|
||||
$res = $companyBankAccount->fetch($defaultRibId);
|
||||
if ($res > 0 && !$companyBankAccount->verif()) {
|
||||
print img_warning('Error on default bank number for IBAN : '.$langs->trans($companyBankAccount->error));
|
||||
}
|
||||
} elseif (($type != 'bank-transfer' && $object->mode_reglement_code == 'PRE') || ($type == 'bank-transfer' && $object->mode_reglement_code == 'VIR')) {
|
||||
print img_warning($langs->trans("NoDefaultIBANFound"));
|
||||
}
|
||||
}
|
||||
|
||||
// Bank Transfer Amount
|
||||
if (getDolOptimizeSmallScreen()) {
|
||||
|
|
|
|||
|
|
@ -1431,7 +1431,7 @@ class FormFile
|
|||
// Show title of list of existing files
|
||||
$morehtmlright = '';
|
||||
if (!empty($moreoptions['showhideaddbutton']) && $conf->use_javascript_ajax) {
|
||||
$tmpurlforbutton = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery("input[type=\'file\']").click(); } void(0);';
|
||||
$tmpurlforbutton = 'javascript:console.log("open add file form");jQuery(".divattachnewfile").toggle(); if (!jQuery(".divattachnewfile").is(":hidden")) { jQuery(".divattachnewfile input[type=\'file\']").first().click();} void(0);'; // scope file picker click to the just-shown form to avoid triggering native file dialog twice when other input[type=file] exist on the page
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $tmpurlforbutton, '', $permtoeditline);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15331,8 +15331,7 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '', $us
|
|||
//var_dump($element_prop);
|
||||
//var_dump($element_prop['module'].' '.$ismodenabled);
|
||||
if (is_array($element_prop) && (empty($element_prop['module']) || $ismodenabled)) {
|
||||
if (
|
||||
$useCache === 1
|
||||
if ($useCache === 1 && $element_id > 0
|
||||
&& !empty($conf->cache['fetchObjectByElement'][$element_type])
|
||||
&& !empty($conf->cache['fetchObjectByElement'][$element_type][$element_id])
|
||||
&& is_object($conf->cache['fetchObjectByElement'][$element_type][$element_id])
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ print '<th class="linecoluht right nowraponall">'.$langs->trans('PriceUHT').'</t
|
|||
// Multicurrency HT / excl tax
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) {
|
||||
print '<th class="linecoluht_currency right" style="width: 80px">'.$langs->trans('PriceUHT');
|
||||
print ' <span class="opacitymedium">('.$langs->getCurrencySymbol($this->multicurrency_code).')<span></th>';
|
||||
print ' <span class="opacitymedium">('.$langs->getCurrencySymbol($this->multicurrency_code).')</span></th>';
|
||||
}
|
||||
|
||||
// Price TTC / incl tax
|
||||
|
|
@ -217,7 +217,7 @@ print '<th class="linecolht right">'.$langs->trans('TotalHTShort').'</th>';
|
|||
// Multicurrency
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) {
|
||||
print '<th class="linecoltotalht_currency right">'.$langs->trans('TotalHTShort');
|
||||
print ' <span class="opacitymedium">('.$langs->getCurrencySymbol($this->multicurrency_code).')<span></th>';
|
||||
print ' <span class="opacitymedium">('.$langs->getCurrencySymbol($this->multicurrency_code).')</span></th>';
|
||||
}
|
||||
|
||||
if ($outputalsopricetotalwithtax) {
|
||||
|
|
|
|||
|
|
@ -522,7 +522,7 @@ if ($line->special_code == 3) {
|
|||
print $tooltiponpriceend;
|
||||
print '</td>';
|
||||
if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) {
|
||||
print '<td class="linecolutotalht_currency nowrap right">';
|
||||
print '<td class="linecoltotalht_currency nowrap right">';
|
||||
print $tooltiponpricemultiprice;
|
||||
print price($sign * $line->multicurrency_total_ht);
|
||||
print $tooltiponpriceendmultiprice;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ if ($line->qty > 0) { ?>
|
|||
?>
|
||||
<td class="linecolht"></td>
|
||||
<?php if (isModEnabled("multicurrency") && $this->multicurrency_code && $this->multicurrency_code != $conf->currency) { ?>
|
||||
<td class="linecolutotalht_currency"></td>
|
||||
<td class="linecoltotalht_currency"></td>
|
||||
<?php } ?>
|
||||
<?php } elseif ($line->qty < 0) {
|
||||
// Base colspan if there is no module activated to display line correctly
|
||||
|
|
|
|||
|
|
@ -911,7 +911,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids))
|
|||
} else {
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven row-with-select">';
|
||||
print '<tr data-rowid="'.$holidaystatic->id.'" class="oddeven row-with-select">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
|
|
|
|||
Loading…
Reference in a new issue