34 require
'../../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
43 $langs->loadLangs(array(
'companies',
'bills',
'banks',
'compta'));
45 $action =
GETPOST(
'action',
'alpha');
46 $confirm =
GETPOST(
'confirm',
'alpha');
47 $optioncss =
GETPOST(
'optioncss',
'alpha');
49 $facid =
GETPOST(
'facid',
'int');
50 $socid =
GETPOST(
'socid',
'int');
51 $accountid =
GETPOST(
'accountid',
'int');
53 $month =
GETPOST(
'month',
'int');
56 $search_ref =
GETPOST(
"search_ref",
"alpha");
57 $search_account =
GETPOST(
"search_account",
"int");
58 $search_paymenttype =
GETPOST(
"search_paymenttype");
59 $search_amount =
GETPOST(
"search_amount",
'alpha');
60 $search_company =
GETPOST(
"search_company",
'alpha');
61 $search_payment_num =
GETPOST(
'search_payment_num',
'alpha');
63 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
64 $sortfield =
GETPOST(
"sortfield",
'alpha');
65 $sortorder =
GETPOST(
"sortorder",
'alpha');
67 if (empty($page) || $page == -1) { $page = 0; }
68 $offset = $limit * $page;
69 $pageprev = $page - 1;
70 $pagenext = $page + 1;
71 if (!$sortorder) $sortorder =
"DESC";
72 if (!$sortfield) $sortfield =
"p.rowid";
75 $amountsresttopay = array();
78 $multicurrency_amounts = array();
79 $multicurrency_amountsresttopay = array();
84 $socid = $user->socid;
90 $hookmanager->initHooks(array(
'paymentsupplierlist'));
94 $extrafields->fetch_name_optionals_label($object->table_element);
96 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
98 $arrayfields = array();
106 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
109 $search_account =
"";
111 $search_paymenttype =
"";
112 $search_payment_num =
"";
113 $search_company =
"";
117 $search_array_options = array();
120 $parameters = array(
'socid'=>$socid);
121 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
122 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
126 if ($action ==
'add_paiement' || ($action ==
'confirm_paiement' && $confirm ==
'yes'))
133 $atleastonepaymentnotnull = 0;
134 $multicurrency_totalpayment = 0;
138 foreach ($_POST as $key => $value)
140 if (substr($key, 0, 7) ==
'amount_')
142 $cursorfacid = substr($key, 7);
144 if (!empty($amounts[$cursorfacid])) {
145 $atleastonepaymentnotnull++;
146 if (is_numeric($amounts[$cursorfacid])) {
147 $totalpayment = $totalpayment + $amounts[$cursorfacid];
152 $result = $tmpinvoice->fetch($cursorfacid);
154 $amountsresttopay[$cursorfacid] =
price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement());
155 if ($amounts[$cursorfacid])
158 if ($amounts[$cursorfacid] && (abs($amounts[$cursorfacid]) > abs($amountsresttopay[$cursorfacid])))
161 $formquestion[
'text'] =
img_warning($langs->trans(
"PaymentHigherThanReminderToPaySupplier")).
' '.$langs->trans(
"HelpPaymentHigherThanReminderToPaySupplier");
164 if ($datepaye && ($datepaye < $tmpinvoice->date))
166 $langs->load(
"errors");
172 $formquestion[$i++] = array(
'type' =>
'hidden',
'name' => $key,
'value' => $_POST[$key]);
173 } elseif (substr($key, 0, 21) ==
'multicurrency_amount_')
175 $cursorfacid = substr($key, 21);
177 $multicurrency_totalpayment += $multicurrency_amounts[$cursorfacid];
178 if (!empty($multicurrency_amounts[$cursorfacid])) $atleastonepaymentnotnull++;
179 $result = $tmpinvoice->fetch($cursorfacid);
181 $multicurrency_amountsresttopay[$cursorfacid] =
price2num($tmpinvoice->total_ttc - $tmpinvoice->getSommePaiement(1));
182 if ($multicurrency_amounts[$cursorfacid])
185 if ($multicurrency_amounts[$cursorfacid] && (abs($multicurrency_amounts[$cursorfacid]) > abs($multicurrency_amountsresttopay[$cursorfacid])))
188 $formquestion[
'text'] =
img_warning($langs->trans(
"PaymentHigherThanReminderToPaySupplier")).
' '.$langs->trans(
"HelpPaymentHigherThanReminderToPaySupplier");
191 if ($datepaye && ($datepaye < $tmpinvoice->date))
193 $langs->load(
"errors");
199 $formquestion[$i++] = array(
'type' =>
'hidden',
'name' => $key,
'value' =>
GETPOST($key,
'int'));
204 if ($_POST[
'paiementid'] <= 0)
206 setEventMessages($langs->transnoentities(
'ErrorFieldRequired', $langs->transnoentities(
'PaymentMode')), null,
'errors');
210 if (!empty($conf->banque->enabled))
215 setEventMessages($langs->transnoentities(
'ErrorFieldRequired', $langs->transnoentities(
'AccountToCredit')), null,
'errors');
220 if (empty($totalpayment) && empty($multicurrency_totalpayment) && empty($atleastonepaymentnotnull))
222 setEventMessages($langs->transnoentities(
'ErrorFieldRequired', $langs->trans(
'PaymentAmount')), null,
'errors');
226 if (empty($datepaye))
228 setEventMessages($langs->transnoentities(
'ErrorFieldRequired', $langs->transnoentities(
'Date')), null,
'errors');
233 if ($totalpayment > 0 && $multicurrency_totalpayment > 0)
235 setEventMessages($langs->transnoentities(
'ErrorPaymentInBothCurrency'), null,
'errors');
243 if ($action ==
'add_paiement')
256 if ($action ==
'confirm_paiement' && $confirm ==
'yes')
263 foreach ($amounts as $key => $value)
266 $tmpinvoice->fetch($key);
270 $amounts[$key] = - abs($newvalue);
274 foreach ($multicurrency_amounts as $key => $value)
277 $tmpinvoice->fetch($key);
281 $multicurrency_amounts[$key] = - abs($newvalue);
293 $thirdparty =
new Societe($db);
294 if ($socid > 0) $thirdparty->fetch($socid);
298 $paiement->datepaye = $datepaye;
299 $paiement->amounts = $amounts;
300 $paiement->multicurrency_amounts = $multicurrency_amounts;
301 $paiement->paiementid =
GETPOST(
'paiementid',
'int');
303 $paiement->num_payment =
GETPOST(
'num_paiement',
'alphanohtml');
304 $paiement->note_private =
GETPOST(
'comment',
'alpha');
305 $paiement->num_payment = $paiement->num_payment;
306 $paiement->note_private = $paiement->note_private;
310 $paiement_id = $paiement->create($user, (
GETPOST(
'closepaidinvoices') ==
'on' ? 1 : 0), $thirdparty);
311 if ($paiement_id < 0)
320 $result = $paiement->addPaymentToBank($user,
'payment_supplier',
'(SupplierInvoicePayment)', $accountid,
'',
'');
334 foreach ($paiement->amounts as $key => $amount)
337 if (is_numeric($amount) && $amount <> 0)
339 if ($invoiceid != 0) $invoiceid = -1;
340 else $invoiceid = $facid;
343 if ($invoiceid > 0) $loc = DOL_URL_ROOT.
'/fourn/facture/card.php?facid='.$invoiceid;
344 else $loc = DOL_URL_ROOT.
'/fourn/paiement/card.php?id='.$paiement_id;
345 header(
'Location: '.$loc);
359 $form =
new Form($db);
362 $supplierstatic =
new Societe($db);
365 llxHeader(
'', $langs->trans(
'ListPayment'));
367 if ($action ==
'create' || $action ==
'confirm_paiement' || $action ==
'add_paiement')
370 $result = $object->fetch($facid);
373 $dateinvoice = ($datefacture ==
'' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 :
'') : $datefacture);
375 $sql =
'SELECT s.nom as name, s.rowid as socid,';
376 $sql .=
' f.rowid, f.ref, f.ref_supplier, f.total_ttc as total, f.fk_mode_reglement, f.fk_account';
377 if (!$user->rights->societe->client->voir && !$socid) $sql .=
", sc.fk_soc, sc.fk_user ";
378 $sql .=
' FROM '.MAIN_DB_PREFIX.
'societe as s, '.MAIN_DB_PREFIX.
'facture_fourn as f';
379 if (!$user->rights->societe->client->voir && !$socid) $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
380 $sql .=
' WHERE f.fk_soc = s.rowid';
381 $sql .=
' AND f.rowid = '.$facid;
382 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
383 $resql = $db->query($sql);
386 $num = $db->num_rows(
$resql);
389 $obj = $db->fetch_object(
$resql);
390 $total = $obj->total;
395 if (!empty($conf->use_javascript_ajax))
397 print "\n".
'<script type="text/javascript" language="javascript">';
398 print '$(document).ready(function () {
400 function _elemToJson(selector)
403 $.map(selector.serializeArray(), function(n,i)
405 subJson[n["name"]] = n["value"];
410 function callForResult(imgId)
413 var form = $("#payment_form");
415 json["invoice_type"] = $("#invoice_type").val();
416 json["amountPayment"] = $("#amountpayment").attr("value");
417 json["amounts"] = _elemToJson(form.find("input.amount"));
418 json["remains"] = _elemToJson(form.find("input.remain"));
421 json["imgClicked"] = imgId;
424 $.post("'.DOL_URL_ROOT.
'/compta/ajaxpayment.php", json, function(data)
426 json = $.parseJSON(data);
430 for (var key in json)
432 if (key == "result") {
433 if (json["makeRed"]) {
434 $("#"+key).addClass("error");
436 $("#"+key).removeClass("error");
438 json[key]=json["label"]+" "+json[key];
439 $("#"+key).text(json[key]);
440 } else {console.log(key);
441 form.find("input[name*=\""+key+"\"]").each(function() {
442 $(this).attr("value", json[key]);
448 $("#payment_form").find("input.amount").change(function() {
451 $("#payment_form").find("input.amount").keyup(function() {
459 print ' $(document).ready(function () {';
460 print ' $(".AutoFillAmout").on(\'click touchstart\', function(){
461 $("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value")).trigger("change");
465 print ' </script>'.
"\n";
468 print '<form id="payment_form" name="addpaiement" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
469 print '<input type="hidden" name="token" value="'.newToken().
'">';
470 print '<input type="hidden" name="action" value="add_paiement">';
471 print '<input type="hidden" name="facid" value="'.$facid.
'">';
472 print '<input type="hidden" name="ref_supplier" value="'.$obj->ref_supplier.
'">';
473 print '<input type="hidden" name="socid" value="'.$obj->socid.
'">';
474 print '<input type="hidden" name="type" id="invoice_type" value="'.$object->type.
'">';
475 print '<input type="hidden" name="societe" value="'.$obj->name.
'">';
479 print '<table class="border centpercent">';
481 print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans(
'Company').
'</td><td>';
482 $supplierstatic->id = $obj->socid;
483 $supplierstatic->name = $obj->name;
484 print $supplierstatic->getNomUrl(1,
'supplier');
486 print '<tr><td class="fieldrequired">'.$langs->trans(
'Date').
'</td><td>';
487 print $form->selectDate($dateinvoice,
'',
'',
'', 0,
"addpaiement", 1, 1, 0,
'',
'', $object->date);
489 print '<tr><td class="fieldrequired">'.$langs->trans(
'PaymentMode').
'</td><td>';
490 $form->select_types_paiements(empty($_POST[
'paiementid']) ? $obj->fk_mode_reglement : $_POST[
'paiementid'],
'paiementid');
492 if (!empty($conf->banque->enabled))
494 print '<tr><td class="fieldrequired">'.$langs->trans(
'Account').
'</td><td>';
495 $form->select_comptes(empty($accountid) ? $obj->fk_account : $accountid,
'accountid', 0,
'', 2);
498 print '<tr><td> </td></tr>';
500 print '<tr><td>'.$langs->trans(
'Numero').
'</td><td><input name="num_paiement" type="text" value="'.(empty($_POST[
'num_paiement']) ?
'' : $_POST[
'num_paiement']).
'"></td></tr>';
501 print '<tr><td>'.$langs->trans(
'Comments').
'</td>';
502 print '<td class="tdtop">';
503 print '<textarea name="comment" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.
'">'.(empty($_POST[
'comment']) ?
'' : $_POST[
'comment']).
'</textarea></td></tr>';
508 $parameters = array(
'facid'=>$facid,
'ref'=>$ref,
'objcanvas'=>$objcanvas);
509 $reshook = $hookmanager->executeHooks(
'paymentsupplierinvoices', $parameters, $object, $action);
510 $error = $hookmanager->error; $errors = $hookmanager->errors;
516 $sql =
'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.type, f.total_ht, f.total_ttc,';
517 $sql .=
' f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc,';
518 $sql .=
' f.datef as df, f.date_lim_reglement as dlr,';
519 $sql .=
' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am';
520 $sql .=
' FROM '.MAIN_DB_PREFIX.
'facture_fourn as f';
521 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
522 $sql .=
" WHERE f.entity = ".$conf->entity;
523 $sql .=
' AND f.fk_soc = '.$object->socid;
524 $sql .=
' AND f.paye = 0';
525 $sql .=
' AND f.fk_statut = 1';
528 $sql .=
' AND f.type IN (0,1,3,5)';
530 $sql .=
' AND f.type = 2';
533 $sql .=
' GROUP BY f.datef, f.ref, f.ref_supplier, f.rowid, f.type, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef, f.date_lim_reglement';
535 $sql .=
' ORDER BY f.datef ASC, f.ref ASC';
537 $resql = $db->query($sql);
540 $num = $db->num_rows(
$resql);
546 if (!empty($conf->use_javascript_ajax)) {
548 print "\n".
'<script type="text/javascript" language="javascript">';
549 print ' $(document).ready(function () {';
550 print ' $(".AutoFillAmout").on(\'click touchstart\', function(){
551 $("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value"));
554 print ' </script>'.
"\n";
557 print '<div class="div-table-responsive-no-min">';
558 print '<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
560 print '<tr class="liste_titre">';
561 print
'<td>'.$langs->trans(
'Invoice').
'</td>';
562 print
'<td>'.$langs->trans(
'RefSupplier').
'</td>';
563 print
'<td class="center">'.$langs->trans(
'Date').
'</td>';
564 print
'<td class="center">'.$langs->trans(
'DateMaxPayment').
'</td>';
565 if (!empty($conf->multicurrency->enabled)) print
'<td>'.$langs->trans(
'Currency').
'</td>';
566 if (!empty($conf->multicurrency->enabled)) print
'<td class="right">'.$langs->trans(
'MulticurrencyAmountTTC').
'</td>';
567 if (!empty($conf->multicurrency->enabled)) print
'<td class="right">'.$langs->trans(
'MulticurrencyAlreadyPaid').
'</td>';
568 if (!empty($conf->multicurrency->enabled)) print
'<td class="right">'.$langs->trans(
'MulticurrencyRemainderToPay').
'</td>';
569 print
'<td class="right">'.$langs->trans(
'AmountTTC').
'</td>';
570 print
'<td class="right">'.$langs->trans(
'AlreadyPaid').
'</td>';
571 print
'<td class="right">'.$langs->trans(
'RemainderToPay').
'</td>';
572 print
'<td class="center">'.$langs->trans(
'PaymentAmount').
'</td>';
573 if (!empty($conf->multicurrency->enabled)) print
'<td class="center">'.$langs->trans(
'MulticurrencyPaymentAmount').
'</td>';
581 $objp = $db->fetch_object(
$resql);
587 $invoice->fetch($objp->facid);
589 $invoicesupplierstatic->ref = $objp->ref;
590 $invoicesupplierstatic->id = $objp->facid;
592 $paiement = $invoice->getSommePaiement();
593 $creditnotes = $invoice->getSumCreditNotesUsed();
594 $deposits = $invoice->getSumDepositsUsed();
595 $alreadypayed =
price2num($paiement + $creditnotes + $deposits,
'MT');
596 $remaintopay =
price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,
'MT');
599 if (!empty($conf->multicurrency->enabled))
601 $multicurrency_payment = $invoice->getSommePaiement(1);
602 $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1);
603 $multicurrency_deposits = $invoice->getSumDepositsUsed(1);
604 $multicurrency_alreadypayed =
price2num($multicurrency_payment + $multicurrency_creditnotes + $multicurrency_deposits,
'MT');
605 $multicurrency_remaintopay =
price2num($invoice->multicurrency_total_ttc - $multicurrency_payment - $multicurrency_creditnotes - $multicurrency_deposits,
'MT');
608 print
'<tr class="oddeven'.(($invoice->id == $facid) ?
' highlight' :
'').
'">';
611 print
'<td class="nowraponall">';
612 print $invoicesupplierstatic->getNomUrl(1);
616 print
'<td>'.$objp->ref_supplier.
'</td>';
621 print
'<td class="center nowraponall">';
624 print
'<td class="center"><b>!!!</b></td>';
630 print
'<td class="center nowraponall">';
633 if ($invoice->hasDelay())
640 print
'<td class="center"><b>--</b></td>';
644 if (!empty($conf->multicurrency->enabled))
647 print
'<td class="center">'.$objp->multicurrency_code.
"</td>\n";
649 print
'<td class="right">';
650 if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
652 print
price($objp->multicurrency_total_ttc);
656 print
'<td class="right">';
657 if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
659 print
price($objp->multicurrency_am);
663 print
'<td class="right">';
664 if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
666 print
price($objp->multicurrency_total_ttc - $objp->multicurrency_am);
671 print
'<td class="right">'.price($sign * $objp->total_ttc).
'</td>';
673 print
'<td class="right">'.price($sign * $objp->am);
674 if ($creditnotes) print
'+'.price($creditnotes);
675 if ($deposits) print
'+'.price($deposits);
678 print
'<td class="right">'.price($sign * $remaintopay).
'</td>';
681 print
'<td class="center nowraponall">';
683 $namef =
'amount_'.$objp->facid;
684 $nameRemain =
'remain_'.$objp->facid;
686 if ($action !=
'add_paiement')
688 if (!empty($conf->use_javascript_ajax))
689 print
img_picto(
"Auto fill",
'rightarrow',
"class='AutoFillAmout' data-rowname='".$namef.
"' data-value='".($sign * $remaintopay).
"'");
690 print
'<input type="hidden" class="remain" name="'.$nameRemain.
'" value="'.$remaintopay.
'">';
693 print
'<input type="text" size="8" name="'.$namef.
'_disabled" value="'.
dol_escape_htmltag(
GETPOST($namef)).
'" disabled>';
699 if (!empty($conf->multicurrency->enabled))
701 print
'<td class="right">';
704 $namef =
'multicurrency_amount_'.$objp->facid;
705 $nameRemain =
'multicurrency_remain_'.$objp->facid;
707 if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
709 if ($action !=
'add_paiement')
711 if (!empty($conf->use_javascript_ajax))
712 print
img_picto(
"Auto fill",
'rightarrow',
"class='AutoFillAmout' data-rowname='".$namef.
"' data-value='".($sign * $multicurrency_remaintopay).
"'");
713 print
'<input type=hidden class="multicurrency_remain" name="'.$nameRemain.
'" value="'.$multicurrency_remaintopay.
'">';
714 print
'<input type="text" size="8" class="multicurrency_amount" name="'.$namef.
'" value="'.$_POST[$namef].
'">';
716 print
'<input type="text" size="8" name="'.$namef.
'_disabled" value="'.$_POST[$namef].
'" disabled>';
717 print
'<input type="hidden" name="'.$namef.
'" value="'.$_POST[$namef].
'">';
724 $total += $objp->total_ht;
725 $total_ttc += $objp->total_ttc;
726 $totalrecu += $objp->am;
727 $totalrecucreditnote += $creditnotes;
728 $totalrecudeposits += $deposits;
734 print
'<tr class="liste_total">';
735 print
'<td colspan="4" class="left">'.$langs->trans(
'TotalTTC').
':</td>';
736 if (!empty($conf->multicurrency->enabled)) print
'<td> </td>';
737 if (!empty($conf->multicurrency->enabled)) print
'<td> </td>';
738 if (!empty($conf->multicurrency->enabled)) print
'<td> </td>';
739 if (!empty($conf->multicurrency->enabled)) print
'<td> </td>';
740 print
'<td class="right"><b>'.price($sign * $total_ttc).
'</b></td>';
741 print
'<td class="right"><b>'.price($sign * $totalrecu);
742 if ($totalrecucreditnote) print
'+'.price($totalrecucreditnote);
743 if ($totalrecudeposits) print
'+'.price($totalrecudeposits);
745 print
'<td class="right"><b>'.price($sign *
price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,
'MT')).
'</b></td>';
746 print
'<td class="center" id="result" style="font-weight: bold;"></td>';
747 if (!empty($conf->multicurrency->enabled)) print
'<td class="right" id="multicurrency_result" style="font-weight: bold;"></td>';
761 if ($action !=
'add_paiement')
763 print
'<br><div class="center"><input type="checkbox" checked name="closepaidinvoices"> '.$langs->trans(
"ClosePaidInvoicesAutomatically");
764 print
'<br><input type="submit" class="button" value="'.$langs->trans(
'ToMakePayment').
'"></div>';
768 if ($action ==
'add_paiement')
770 $preselectedchoice = $addwarning ?
'no' :
'yes';
773 if (!empty($totalpayment)) $text = $langs->trans(
'ConfirmSupplierPayment',
price($totalpayment), $langs->trans(
"Currency".$conf->currency));
774 if (!empty($multicurrency_totalpayment))
776 $text .=
'<br>'.$langs->trans(
'ConfirmSupplierPayment',
price($multicurrency_totalpayment), $langs->trans(
"paymentInInvoiceCurrency"));
778 if (
GETPOST(
'closepaidinvoices'))
780 $text .=
'<br>'.$langs->trans(
"AllCompletelyPayedInvoiceWillBeClosed");
781 print
'<input type="hidden" name="closepaidinvoices" value="'.GETPOST(
'closepaidinvoices').
'">';
783 print $form->formconfirm(
$_SERVER[
'PHP_SELF'].
'?facid='.$facture->id.
'&socid='.$facture->socid.
'&type='.$facture->type, $langs->trans(
'PayedSuppliersPayments'), $text,
'confirm_paiement', $formquestion, $preselectedchoice);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
Class to manage suppliers invoices.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
price($amount, $form=0, $outlangs= '', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code= '')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is '...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
const TYPE_CREDIT_NOTE
Credit note invoice.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage payments for supplier invoices.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...