forked from Wavyzz/dolibarr
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
This commit is contained in:
@@ -2546,6 +2546,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
// Load event
|
// Load event
|
||||||
$res = $this->fetch($actionCommReminder->fk_actioncomm);
|
$res = $this->fetch($actionCommReminder->fk_actioncomm);
|
||||||
|
if ($res > 0) $res = $this->fetch_thirdparty();
|
||||||
if ($res > 0) {
|
if ($res > 0) {
|
||||||
// PREPARE EMAIL
|
// PREPARE EMAIL
|
||||||
$errormesg = '';
|
$errormesg = '';
|
||||||
|
|||||||
@@ -2713,6 +2713,21 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Call Hook modifyTextInfo
|
||||||
|
$parameters = array('textinfo' => $text_info);
|
||||||
|
$reshook = $hookmanager->executeHooks('modifyTextInfo', $parameters, $object, $action);
|
||||||
|
if ($reshook == 1) {
|
||||||
|
// for add information
|
||||||
|
$text_info .= $hookmanager->resPrint;
|
||||||
|
} elseif ($reshook == 0) {
|
||||||
|
// for replace information
|
||||||
|
$text_info = $hookmanager->resPrint;
|
||||||
|
} elseif ($reshook == -1) {
|
||||||
|
// for errors
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if ($notshippable == 0) {
|
if ($notshippable == 0) {
|
||||||
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft');
|
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft');
|
||||||
$text_info = $text_icon.' '.$langs->trans('Shippable').'<br>'.$text_info;
|
$text_info = $text_icon.' '.$langs->trans('Shippable').'<br>'.$text_info;
|
||||||
|
|||||||
@@ -4543,6 +4543,9 @@ if ($action == 'create') {
|
|||||||
$morehtmlref .= '</div>';
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||||
|
$object->totalcreditnotes = $totalcreditnotes;
|
||||||
|
$object->totaldeposits = $totaldeposits;
|
||||||
|
$object->remaintopay = price2num($object->total_ttc - $object->totalpaid - $object->totalcreditnotes - $object->totaldeposits, 'MT');
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '');
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '');
|
||||||
|
|
||||||
|
|||||||
@@ -436,8 +436,8 @@ if ($action == 'makepayment_confirm' && $user->hasRight('facture', 'paiement'))
|
|||||||
$paiementAmount = $facture->getSommePaiement();
|
$paiementAmount = $facture->getSommePaiement();
|
||||||
$totalcreditnotes = $facture->getSumCreditNotesUsed();
|
$totalcreditnotes = $facture->getSumCreditNotesUsed();
|
||||||
$totaldeposits = $facture->getSumDepositsUsed();
|
$totaldeposits = $facture->getSumDepositsUsed();
|
||||||
$totalpay = $paiementAmount + $totalcreditnotes + $totaldeposits;
|
$totalallpayments = $paiementAmount + $totalcreditnotes + $totaldeposits;
|
||||||
$remaintopay = price2num($facture->total_ttc - $totalpay);
|
$remaintopay = price2num($facture->total_ttc - $totalallpayments);
|
||||||
if ($remaintopay != 0) {
|
if ($remaintopay != 0) {
|
||||||
$resultBank = $facture->setBankAccount($bankid);
|
$resultBank = $facture->setBankAccount($bankid);
|
||||||
if ($resultBank < 0) {
|
if ($resultBank < 0) {
|
||||||
|
|||||||
@@ -86,11 +86,24 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="linkedcol-statut right">';
|
print '<td class="linkedcol-statut right">';
|
||||||
|
$totalallpayments = 0;
|
||||||
|
$totalcalculated = false;
|
||||||
if (method_exists($objectlink, 'getSommePaiement')) {
|
if (method_exists($objectlink, 'getSommePaiement')) {
|
||||||
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
|
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
|
||||||
|
$totalcalculated = true;
|
||||||
|
$totalallpayments += $objectlink->getSommePaiement();
|
||||||
} else {
|
} else {
|
||||||
print $objectlink->getLibStatut(3);
|
print $objectlink->getLibStatut(3);
|
||||||
}
|
}
|
||||||
|
if (method_exists($objectlink, 'getSumDepositsUsed')) {
|
||||||
|
$totalcalculated = true;
|
||||||
|
$totalallpayments += $objectlink->getSumDepositsUsed();
|
||||||
|
}
|
||||||
|
if (method_exists($objectlink, 'getSumCreditNotesUsed')) {
|
||||||
|
$totalcalculated = true;
|
||||||
|
$totalallpayments += $objectlink->getSumCreditNotesUsed();
|
||||||
|
}
|
||||||
|
print $objectlink->getLibStatut(3, ($totalcalculated ? $totalallpayments : -1));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@@ -215,6 +215,9 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
|||||||
$thirdpartystatic->code_compta = $obj->code_compta;
|
$thirdpartystatic->code_compta = $obj->code_compta;
|
||||||
//$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
//$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
|
$totalallpayments = $tmpinvoice->getSommePaiement(0);
|
||||||
|
$totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
|
||||||
|
$totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
@@ -247,7 +250,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
|||||||
|
|
||||||
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
|
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
|
||||||
|
|
||||||
print '<td>'.$tmpinvoice->getLibStatut(3, $obj->am).'</td>';
|
print '<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).'</td>';
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@@ -377,6 +380,8 @@ if ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO
|
|||||||
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
|
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
|
||||||
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
|
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
|
||||||
$alreadypaid = $facstatic->getSommePaiement();
|
$alreadypaid = $facstatic->getSommePaiement();
|
||||||
|
$alreadypaid += $facstatic->getSumCreditNotesUsed();
|
||||||
|
$alreadypaid += $facstatic->getSumDepositsUsed();
|
||||||
print '<td>'.$facstatic->getLibStatut(3, $alreadypaid).'</td>';
|
print '<td>'.$facstatic->getLibStatut(3, $alreadypaid).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$total_ht += $obj->total_ht;
|
$total_ht += $obj->total_ht;
|
||||||
|
|||||||
@@ -1270,7 +1270,7 @@ class Paiement extends CommonObject
|
|||||||
$facturestatic = new Facture($this->db);
|
$facturestatic = new Facture($this->db);
|
||||||
foreach ($arraybill as $billid) {
|
foreach ($arraybill as $billid) {
|
||||||
$facturestatic->fetch($billid);
|
$facturestatic->fetch($billid);
|
||||||
$label .= '<br> '.$facturestatic->getNomUrl(1, '', 0, 0, '', 1).' '.$facturestatic->getLibStatut(2, 1);
|
$label .= '<br> '.$facturestatic->getNomUrl(1, '', 0, 0, '', 1).' '.$facturestatic->getLibStatut(2, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ print '</span></td></tr></table></div><br>';
|
|||||||
/*
|
/*
|
||||||
* Invoices waiting for withdraw
|
* Invoices waiting for withdraw
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
|
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut as status, f.paye, f.type,";
|
||||||
$sql .= " pfd.date_demande, pfd.amount,";
|
$sql .= " pfd.date_demande, pfd.amount,";
|
||||||
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
||||||
@@ -141,10 +141,13 @@ if ($resql) {
|
|||||||
|
|
||||||
$invoicestatic->id = $obj->rowid;
|
$invoicestatic->id = $obj->rowid;
|
||||||
$invoicestatic->ref = $obj->ref;
|
$invoicestatic->ref = $obj->ref;
|
||||||
$invoicestatic->statut = $obj->fk_statut;
|
$invoicestatic->statut = $obj->status;
|
||||||
|
$invoicestatic->status = $obj->status;
|
||||||
$invoicestatic->paye = $obj->paye;
|
$invoicestatic->paye = $obj->paye;
|
||||||
$invoicestatic->type = $obj->type;
|
$invoicestatic->type = $obj->type;
|
||||||
$alreadypayed = $invoicestatic->getSommePaiement();
|
$totalallpayments = $invoicestatic->getSommePaiement(0);
|
||||||
|
$totalallpayments += $invoicestatic->getSumCreditNotesUsed(0);
|
||||||
|
$totalallpayments += $invoicestatic->getSumDepositsUsed(0);
|
||||||
|
|
||||||
$thirdpartystatic->id = $obj->socid;
|
$thirdpartystatic->id = $obj->socid;
|
||||||
$thirdpartystatic->name = $obj->name;
|
$thirdpartystatic->name = $obj->name;
|
||||||
@@ -177,7 +180,7 @@ if ($resql) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print $invoicestatic->getLibStatut(3, $alreadypayed);
|
print $invoicestatic->getLibStatut(3, $totalallpayments);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@@ -159,7 +159,9 @@ if ($id > 0) {
|
|||||||
print $fac->error."<br>";
|
print $fac->error."<br>";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$totalpaid = $fac->getSommePaiement();
|
$alreadypaid = $fac->getSommePaiement();
|
||||||
|
$alreadypaid += $fac->getSumDepositsUsed();
|
||||||
|
$alreadypaid += $fac->getSumCreditNotesUsed();
|
||||||
|
|
||||||
$userstatic->id = $objf->userid;
|
$userstatic->id = $objf->userid;
|
||||||
$userstatic->login = $objf->login;
|
$userstatic->login = $objf->login;
|
||||||
@@ -169,7 +171,7 @@ if ($id > 0) {
|
|||||||
'date' => $fac->date,
|
'date' => $fac->date,
|
||||||
'datefieldforsort' => $fac->date.'-'.$fac->ref,
|
'datefieldforsort' => $fac->date.'-'.$fac->ref,
|
||||||
'link' => $fac->getNomUrl(1),
|
'link' => $fac->getNomUrl(1),
|
||||||
'status' => $fac->getLibStatut(2, $totalpaid),
|
'status' => $fac->getLibStatut(2, $alreadypaid),
|
||||||
'amount' => $fac->total_ttc,
|
'amount' => $fac->total_ttc,
|
||||||
'author' => $userstatic->getLoginUrl(1)
|
'author' => $userstatic->getLoginUrl(1)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -724,7 +724,8 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($arrayfields['t.status']['checked'])) {
|
if (!empty($arrayfields['t.status']['checked'])) {
|
||||||
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>';
|
$totalallpayments = $obj->alreadypayed;
|
||||||
|
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $totalallpayments) . '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2533,7 +2533,16 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
|
|||||||
$tmptxt = $object->getLibStatut(5, $object->alreadypaid);
|
$tmptxt = $object->getLibStatut(5, $object->alreadypaid);
|
||||||
}
|
}
|
||||||
$morehtmlstatus .= $tmptxt;
|
$morehtmlstatus .= $tmptxt;
|
||||||
} elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan', 'tva'))) { // TODO Move this to use ->alreadypaid
|
} elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier'))) { // TODO Move this to use ->alreadypaid
|
||||||
|
$totalallpayments = $object->getSommePaiement(0);
|
||||||
|
$totalallpayments += $object->getSumCreditNotesUsed(0);
|
||||||
|
$totalallpayments += $object->getSumDepositsUsed(0);
|
||||||
|
$tmptxt = $object->getLibStatut(6, $totalallpayments);
|
||||||
|
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
|
||||||
|
$tmptxt = $object->getLibStatut(5, $totalallpayments);
|
||||||
|
}
|
||||||
|
$morehtmlstatus .= $tmptxt;
|
||||||
|
} elseif (in_array($object->element, array('chargesociales', 'loan', 'tva'))) { // TODO Move this to use ->alreadypaid
|
||||||
$tmptxt = $object->getLibStatut(6, $object->totalpaid);
|
$tmptxt = $object->getLibStatut(6, $object->totalpaid);
|
||||||
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
|
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
|
||||||
$tmptxt = $object->getLibStatut(5, $object->totalpaid);
|
$tmptxt = $object->getLibStatut(5, $object->totalpaid);
|
||||||
|
|||||||
@@ -1080,6 +1080,13 @@ class Holiday extends CommonObject
|
|||||||
$this->errors[] = "Error ".$this->db->lasterror();
|
$this->errors[] = "Error ".$this->db->lasterror();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$result = $this->insertExtraFields();
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (!$notrigger) {
|
if (!$notrigger) {
|
||||||
// Call trigger
|
// Call trigger
|
||||||
|
|||||||
@@ -196,17 +196,20 @@ if ($action == 'order' && GETPOST('valid')) {
|
|||||||
// TODO Get desc in language of thirdparty
|
// TODO Get desc in language of thirdparty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$line->tva_tx = $productsupplier->vatrate_supplier;
|
||||||
|
$tva = $line->tva_tx / 100;
|
||||||
|
|
||||||
// If we use multicurrency
|
// If we use multicurrency
|
||||||
if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) {
|
if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) {
|
||||||
$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
|
$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
|
||||||
$line->fk_multicurrency = $productsupplier->fourn_multicurrency_id;
|
$line->fk_multicurrency = $productsupplier->fourn_multicurrency_id;
|
||||||
$line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
|
$line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
|
||||||
|
$line->multicurrency_total_ht = $line->multicurrency_subprice * $qty;
|
||||||
|
$line->multicurrency_total_tva = $line->multicurrency_total_ht * $tva;
|
||||||
|
$line->multicurrency_total_ttc = $line->multicurrency_total_ht + $line->multicurrency_total_tva;
|
||||||
}
|
}
|
||||||
|
|
||||||
$line->tva_tx = $productsupplier->vatrate_supplier;
|
|
||||||
$line->subprice = $productsupplier->fourn_pu;
|
$line->subprice = $productsupplier->fourn_pu;
|
||||||
$line->total_ht = $productsupplier->fourn_pu * $qty;
|
$line->total_ht = $productsupplier->fourn_pu * $qty;
|
||||||
$tva = $line->tva_tx / 100;
|
|
||||||
$line->total_tva = $line->total_ht * $tva;
|
$line->total_tva = $line->total_ht * $tva;
|
||||||
$line->total_ttc = $line->total_ht + $line->total_tva;
|
$line->total_ttc = $line->total_ht + $line->total_tva;
|
||||||
$line->remise_percent = $productsupplier->remise_percent;
|
$line->remise_percent = $productsupplier->remise_percent;
|
||||||
|
|||||||
Reference in New Issue
Block a user