29require 
'../../main.inc.php';
 
   30require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
 
   31require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/bookkeeping.class.php';
 
   32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formaccounting.class.php';
 
   33require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
 
   34require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
 
   35require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
 
   36require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
 
   39$langs->loadLangs(array(
"accountancy", 
"bills", 
"compta"));
 
   41$action = 
GETPOST(
'action', 
'aZ09');
 
   42$cancel = 
GETPOST(
'cancel', 
'aZ09');
 
   44$optioncss = 
GETPOST(
'optioncss', 
'aZ'); 
 
   48$piece_num = 
GETPOST(
"piece_num", 
'int'); 
 
   53$accountingaccount_number = 
GETPOST(
'accountingaccount_number', 
'alphanohtml');
 
   54$accountingaccount->fetch(
null, $accountingaccount_number, 
true);
 
   55$accountingaccount_label = $accountingaccount->label;
 
   57$journal_code = 
GETPOST(
'code_journal', 
'alpha');
 
   58$accountingjournal->fetch(
null, $journal_code);
 
   59$journal_label = $accountingjournal->label;
 
   61$subledger_account = 
GETPOST(
'subledger_account', 
'alphanohtml');
 
   62if ($subledger_account == -1) {
 
   63  $subledger_account = 
null;
 
   65$subledger_label = 
GETPOST(
'subledger_label', 
'alphanohtml');
 
   67$label_operation = 
GETPOST(
'label_operation', 
'alphanohtml');
 
   71$save = 
GETPOST(
'save', 
'alpha');
 
   75$update = 
GETPOST(
'update', 
'alpha');
 
   77  $action = 
'confirm_update';
 
   83if (!isModEnabled(
'accounting')) {
 
   86if ($user->socid > 0) {
 
   89if (!$user->hasRight(
'accounting', 
'mouvements', 
'lire')) {
 
   99  header(
"Location: ".DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php');
 
  103if ($action == 
"confirm_update") {
 
  106  if (((
float) $debit != 0.0) && ((
float) $credit != 0.0)) {
 
  111  if (empty($accountingaccount_number) || $accountingaccount_number == 
'-1') {
 
  113    setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
"AccountAccountingShort")), 
null, 
'errors');
 
  120    $result = $object->fetch($id, 
null, $mode);
 
  125      $object->numero_compte = $accountingaccount_number;
 
  126      $object->subledger_account = $subledger_account;
 
  127      $object->subledger_label = $subledger_label;
 
  128      $object->label_compte = $accountingaccount_label;
 
  129      $object->label_operation = $label_operation;
 
  130      $object->debit = $debit;
 
  131      $object->credit = $credit;
 
  133      if ((
float) $debit != 0.0) {
 
  134        $object->montant = $debit; 
 
  135        $object->amount = $debit;
 
  138      if ((
float) $credit != 0.0) {
 
  139        $object->montant = $credit; 
 
  140        $object->amount = $credit;
 
  144      $result = $object->update($user, 
false, $mode);
 
  148        if ($mode != 
'_tmp') {
 
  159} elseif ($action == 
"add") {
 
  162  if (((
float) $debit != 0.0) && ((
float) $credit != 0.0)) {
 
  167  if (empty($accountingaccount_number) || $accountingaccount_number == 
'-1') {
 
  169    setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
"AccountAccountingShort")), 
null, 
'errors');
 
  176    $object->numero_compte = $accountingaccount_number;
 
  177    $object->subledger_account = $subledger_account;
 
  178    $object->subledger_label = $subledger_label;
 
  179    $object->label_compte = $accountingaccount_label;
 
  180    $object->label_operation = $label_operation;
 
  181    $object->debit = $debit;
 
  182    $object->credit = $credit;
 
  183    $object->doc_date = (string) 
GETPOST(
'doc_date', 
'alpha');
 
  184    $object->doc_type = (string) 
GETPOST(
'doc_type', 
'alpha');
 
  185    $object->piece_num = $piece_num;
 
  186    $object->doc_ref = (string) 
GETPOST(
'doc_ref', 
'alpha');
 
  187    $object->code_journal = $journal_code;
 
  188    $object->journal_label = $journal_label;
 
  192    if ((
float) $debit != 0.0) {
 
  193      $object->montant = $debit; 
 
  194      $object->amount = $debit;
 
  198    if ((
float) $credit != 0.0) {
 
  199      $object->montant = $credit; 
 
  200      $object->amount = $credit;
 
  204    $result = $object->createStd($user, 
false, $mode);
 
  210      if ($mode != 
'_tmp') {
 
  220} elseif ($action == 
"confirm_delete") {
 
  223  $result = $object->fetch($id, 
null, $mode);
 
  224  $piece_num = $object->piece_num;
 
  229    $result = $object->delete($user, 
false, $mode);
 
  235} elseif ($action == 
"confirm_create") {
 
  240  if (!$journal_code || $journal_code == 
'-1') {
 
  241    setEventMessages($langs->trans(
'ErrorFieldRequired', $langs->transnoentitiesnoconv(
"Journal")), 
null, 
'errors');
 
  245  if (!
GETPOST(
'doc_ref', 
'alpha')) {
 
  246    setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Piece")), 
null, 
'errors');
 
  252    $object->label_compte = 
'';
 
  256    $object->doc_type = 
GETPOST(
'doc_type', 
'alpha');
 
  257    $object->piece_num = 
GETPOST(
'next_num_mvt', 
'alpha');
 
  258    $object->doc_ref = 
GETPOST(
'doc_ref', 
'alpha');
 
  259    $object->code_journal = $journal_code;
 
  260    $object->journal_label = $journal_label;
 
  262    $object->fk_docdet = 0;
 
  263    $object->montant = 0; 
 
  266    $result = $object->createStd($user, 0, $mode);
 
  270      if ($mode != 
'_tmp') {
 
  275      $piece_num = $object->piece_num;
 
  280if ($action == 
'setdate') {
 
  282  $result = $object->updateByMvt($piece_num, 
'doc_date', $db->idate($datedoc), $mode);
 
  286    if ($mode != 
'_tmp') {
 
  293if ($action == 
'setjournal') {
 
  294  $result = $object->updateByMvt($piece_num, 
'code_journal', $journal_code, $mode);
 
  295  $result = $object->updateByMvt($piece_num, 
'journal_label', $journal_label, $mode);
 
  299    if ($mode != 
'_tmp') {
 
  306if ($action == 
'setdocref') {
 
  307  $refdoc = 
GETPOST(
'doc_ref', 
'alpha');
 
  308  $result = $object->updateByMvt($piece_num, 
'doc_ref', $refdoc, $mode);
 
  312    if ($mode != 
'_tmp') {
 
  320if ($action == 
'valid') {
 
  321  $result = $object->transformTransaction(0, $piece_num);
 
  325    header(
"Location: list.php?sortfield=t.piece_num&sortorder=asc");
 
  335$form = 
new Form($db);
 
  338$title = $langs->trans(
"CreateMvts");
 
  339$help_url = 
'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilité_en_Partie_Double';
 
  343if ($action == 
'delete') {
 
  344  $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$id.
'&mode='.$mode, $langs->trans(
'DeleteMvt'), $langs->trans(
'ConfirmDeleteMvt', $langs->transnoentitiesnoconv(
"RegistrationInAccounting")), 
'confirm_delete', 
'', 0, 1);
 
  348if ($action == 
'create') {
 
  352  $next_num_mvt = $object->getNextNumMvt(
'_tmp');
 
  354  if (empty($next_num_mvt)) {
 
  358  print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="create_mvt" method="POST">';
 
  359  if ($optioncss != 
'') {
 
  360    print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  362  print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  363  print 
'<input type="hidden" name="action" value="confirm_create">'.
"\n";
 
  364  print 
'<input type="hidden" name="next_num_mvt" value="'.$next_num_mvt.
'">'.
"\n";
 
  365  print 
'<input type="hidden" name="mode" value="_tmp">'.
"\n";
 
  369  print 
'<table class="border centpercent">';
 
  377  print 
'<td class="titlefieldcreate fieldrequired">'.$langs->trans(
"Docdate").
'</td>';
 
  379  print $form->selectDate(
'', 
'doc_date', 
'', 
'', 
'', 
"create_mvt", 1, 1);
 
  384  print 
'<td class="fieldrequired">'.$langs->trans(
"Codejournal").
'</td>';
 
  385  print 
'<td>'.$formaccounting->select_journal($journal_code, 
'code_journal', 0, 0, 1, 1).
'</td>';
 
  389  print 
'<td class="fieldrequired">'.$langs->trans(
"Piece").
'</td>';
 
  390  print 
'<td><input type="text" class="minwidth200" name="doc_ref" value="'.GETPOST(
'doc_ref', 
'alpha').
'"></td>';
 
  404  print $form->buttonsSaveCancel(
"Create");
 
  410  $result = $object->fetchPerMvt($piece_num, $mode);
 
  415  if (!empty($object->piece_num)) {
 
  416    $backlink = 
'<a href="'.DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php?restore_lastsearch_values=1">'.$langs->trans(
'BackToList').
'</a>';
 
  418    if ($mode == 
'_tmp') {
 
  426    $head[$h][0] = $_SERVER[
'PHP_SELF'].
'?piece_num='.$object->piece_num.($mode ? 
'&mode='.$mode : 
'');
 
  427    $head[$h][1] = $langs->trans(
"Transaction");
 
  428    $head[$h][2] = 
'transaction';
 
  435    print 
'<div class="fichecenter">';
 
  436    print 
'<div class="fichehalfleft">';
 
  438    print 
'<div class="underbanner clearboth"></div>';
 
  439    print 
'<table class="border tableforfield" width="100%">';
 
  443    print 
'<td class="titlefield">'.$langs->trans(
"NumMvts").
'</td>';
 
  444    print 
'<td>'.($mode == 
'_tmp' ? 
'<span class="opacitymedium" title="Id tmp '.$object->piece_num.
'">'.$langs->trans(
"Draft").
'</span>' : $object->piece_num).
'</td>';
 
  449    print 
'<table class="nobordernopadding centpercent"><tr><td>';
 
  450    print $langs->trans(
'Docdate');
 
  452    if ($action != 
'editdate') {
 
  453      print 
'<td class="right"><a class="editfielda reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=editdate&token='.newToken().
'&piece_num='.urlencode($object->piece_num).
'&mode='.urlencode($mode).
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetDate'), 1).
'</a></td>';
 
  455    print 
'</tr></table>';
 
  456    print 
'</td><td colspan="3">';
 
  457    if ($action == 
'editdate') {
 
  458      print 
'<form name="setdate" action="'.$_SERVER[
"PHP_SELF"].
'?piece_num='.$object->piece_num.
'" method="post">';
 
  459      if ($optioncss != 
'') {
 
  460        print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  462      print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  463      print 
'<input type="hidden" name="action" value="setdate">';
 
  464      print 
'<input type="hidden" name="mode" value="'.$mode.
'">';
 
  465      print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 
'doc_date', 
'', 
'', 
'', 
"setdate");
 
  466      print 
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
 
  469      print $object->doc_date ? 
dol_print_date($object->doc_date, 
'day') : 
' ';
 
  476    print 
'<table class="nobordernopadding" width="100%"><tr><td>';
 
  477    print $langs->trans(
'Codejournal');
 
  479    if ($action != 
'editjournal') {
 
  480      print 
'<td class="right"><a class="editfielda reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=editjournal&token='.newToken().
'&piece_num='.urlencode($object->piece_num).
'&mode='.urlencode($mode).
'">'.
img_edit($langs->transnoentitiesnoconv(
'Edit'), 1).
'</a></td>';
 
  482    print 
'</tr></table>';
 
  484    if ($action == 
'editjournal') {
 
  485      print 
'<form name="setjournal" action="'.$_SERVER[
"PHP_SELF"].
'?piece_num='.$object->piece_num.
'" method="post">';
 
  486      if ($optioncss != 
'') {
 
  487        print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  489      print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  490      print 
'<input type="hidden" name="action" value="setjournal">';
 
  491      print 
'<input type="hidden" name="mode" value="'.$mode.
'">';
 
  492      print $formaccounting->select_journal($object->code_journal, 
'code_journal', 0, 0, array(), 1, 1);
 
  493      print 
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
 
  496      print $object->code_journal;
 
  503    print 
'<table class="nobordernopadding centpercent"><tr><td>';
 
  504    print $langs->trans(
'Piece');
 
  506    if ($action != 
'editdocref') {
 
  507      print 
'<td class="right"><a class="editfielda reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=editdocref&token='.newToken().
'&piece_num='.urlencode($object->piece_num).
'&mode='.urlencode($mode).
'">'.
img_edit($langs->transnoentitiesnoconv(
'Edit'), 1).
'</a></td>';
 
  509    print 
'</tr></table>';
 
  511    if ($action == 
'editdocref') {
 
  512      print 
'<form name="setdocref" action="'.$_SERVER[
"PHP_SELF"].
'?piece_num='.$object->piece_num.
'" method="post">';
 
  513      if ($optioncss != 
'') {
 
  514        print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  516      print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  517      print 
'<input type="hidden" name="action" value="setdocref">';
 
  518      print 
'<input type="hidden" name="mode" value="'.$mode.
'">';
 
  519      print 
'<input type="text" size="20" name="doc_ref" value="'.dol_escape_htmltag($object->doc_ref).
'">';
 
  520      print 
'<input type="submit" class="button button-edit" value="'.$langs->trans(
'Modify').
'">';
 
  523      print $object->doc_ref;
 
  532    print 
'<div class="fichehalfright">';
 
  534    print 
'<div class="underbanner clearboth"></div>';
 
  535    print 
'<table class="border tableforfield centpercent">';
 
  538    if (!empty($object->doc_type)) {
 
  540      print 
'<td class="titlefield">'.$langs->trans(
"Doctype").
'</td>';
 
  541      print 
'<td>'.$object->doc_type.
'</td>';
 
  547    print 
'<td class="titlefield">'.$langs->trans(
"DateCreation").
'</td>';
 
  549    print $object->date_creation ? 
dol_print_date($object->date_creation, 
'day') : 
' ';
 
  554    if ($mode != 
"_tmp") {
 
  557      print 
'<td class="titlefield">' . $langs->trans(
"DateExport") . 
'</td>';
 
  559      print $object->date_export ? 
dol_print_date($object->date_export, 
'dayhour') : 
' ';
 
  565      print 
'<td class="titlefield">' . $langs->trans(
"DateValidation") . 
'</td>';
 
  567      print $object->date_validation ? 
dol_print_date($object->date_validation, 
'dayhour') : 
' ';
 
  618    print 
'<div class="clearboth"></div>';
 
  622    $result = $object->fetchAllPerMvt($piece_num, $mode); 
 
  630      print 
'<form action="'.$_SERVER[
"PHP_SELF"].
'?piece_num='.$object->piece_num.
'" method="post">';
 
  631      if ($optioncss != 
'') {
 
  632        print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
  634      print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  635      print 
'<input type="hidden" name="doc_date" value="'.$object->doc_date.
'">'.
"\n";
 
  636      print 
'<input type="hidden" name="doc_type" value="'.$object->doc_type.
'">'.
"\n";
 
  637      print 
'<input type="hidden" name="doc_ref" value="'.$object->doc_ref.
'">'.
"\n";
 
  638      print 
'<input type="hidden" name="code_journal" value="'.$object->code_journal.
'">'.
"\n";
 
  639      print 
'<input type="hidden" name="fk_doc" value="'.$object->fk_doc.
'">'.
"\n";
 
  640      print 
'<input type="hidden" name="fk_docdet" value="'.$object->fk_docdet.
'">'.
"\n";
 
  641      print 
'<input type="hidden" name="mode" value="'.$mode.
'">'.
"\n";
 
  643      if (count($object->linesmvt) > 0) {
 
  644        print 
'<div class="div-table-responsive-no-min">';
 
  645        print 
'<table class="noborder centpercent">';
 
  650        print 
'<tr class="liste_titre">';
 
  657        if (empty($object->date_validation)) {
 
  666        if (!empty($object->linesmvt[0])) {
 
  667          $tmpline = $object->linesmvt[0];
 
  668          if (!empty($tmpline->numero_compte)) {
 
  670            $object->linesmvt[] = $line;
 
  674        foreach ($object->linesmvt as $line) {
 
  675          print 
'<tr class="oddeven" data-lineid="'.((int) $line->id).
'">';
 
  676          $total_debit += $line->debit;
 
  677          $total_credit += $line->credit;
 
  679          if ($action == 
'update' && $line->id == $id) {
 
  680            print 
'<!-- td columns in edit mode -->';
 
  682            print $formaccounting->select_account((GETPOSTISSET(
"accountingaccount_number") ? 
GETPOST(
"accountingaccount_number", 
"alpha") : $line->numero_compte), 
'accountingaccount_number', 1, array(), 1, 1, 
'minwidth200 maxwidth500');
 
  690              print $formaccounting->select_auxaccount((GETPOSTISSET(
"subledger_account") ? 
GETPOST(
"subledger_account", 
"alpha") : $line->subledger_account), 
'subledger_account', 1, 
'maxwidth250', 
'', 
'subledger_label');
 
  692              print 
'<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET(
"subledger_account") ? 
GETPOST(
"subledger_account", 
"alpha") : $line->subledger_account).
'" placeholder="'.
dol_escape_htmltag($langs->trans(
"SubledgerAccount")).
'">';
 
  695            print 
'<br><input type="text" class="maxwidth150" name="subledger_label" value="'.(GETPOSTISSET(
"subledger_label") ? 
GETPOST(
"subledger_label", 
"alpha") : $line->subledger_label).
'" placeholder="'.
dol_escape_htmltag($langs->trans(
"SubledgerAccountLabel")).
'">';
 
  697            print 
'<td><input type="text" class="minwidth200" name="label_operation" value="'.(GETPOSTISSET(
"label_operation") ? 
GETPOST(
"label_operation", 
"alpha") : $line->label_operation).
'"></td>';
 
  698            print 
'<td class="right"><input type="text" size="6" class="right" name="debit" value="'.(GETPOSTISSET(
"debit") ? 
GETPOST(
"debit", 
"alpha") : 
price($line->debit)).
'"></td>';
 
  699            print 
'<td class="right"><input type="text" size="6" class="right" name="credit" value="'.(GETPOSTISSET(
"credit") ? 
GETPOST(
"credit", 
"alpha") : 
price($line->credit)).
'"></td>';
 
  701            print 
'<input type="hidden" name="id" value="'.$line->id.
'">'.
"\n";
 
  702            print 
'<input type="submit" class="button" name="update" value="'.$langs->trans(
"Update").
'">';
 
  704          } elseif (empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) {
 
  705            if ($action == 
"" || $action == 
'add') {
 
  706              print 
'<!-- td columns in add mode -->';
 
  708              print $formaccounting->select_account(
'', 
'accountingaccount_number', 1, array(), 1, 1, 
'minwidth200 maxwidth500');
 
  716                print $formaccounting->select_auxaccount(
'', 
'subledger_account', 1, 
'maxwidth250', 
'', 
'subledger_label');
 
  718                print 
'<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . 
dol_escape_htmltag($langs->trans(
"SubledgerAccount")) . 
'">';
 
  720              print 
'<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . 
dol_escape_htmltag($langs->trans(
"SubledgerAccountLabel")) . 
'">';
 
  722              print 
'<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . 
'"/></td>';
 
  723              print 
'<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
 
  724              print 
'<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
 
  725              print 
'<td class="center"><input type="submit" class="button small" name="save" value="' . $langs->trans(
"Add") . 
'"></td>';
 
  728            print 
'<!-- td columns in display mode -->';
 
  729            $resultfetch = $accountingaccount->fetch(
null, $line->numero_compte, 
true);
 
  731            if ($resultfetch > 0) {
 
  732              print $accountingaccount->getNomUrl(0, 1, 1, 
'', 0);
 
  734              print $line->numero_compte.
' <span class="warning">('.$langs->trans(
"AccountRemovedFromCurrentChartOfAccount").
')</span>';
 
  737            print 
'<td>'.length_accounta($line->subledger_account);
 
  738            if ($line->subledger_label) {
 
  739              print 
' - <span class="opacitymedium">'.$line->subledger_label.
'</span>';
 
  742            print 
'<td>'.$line->label_operation.
'</td>';
 
  743            print 
'<td class="right nowraponall amount">'.($line->debit != 0 ? 
price($line->debit) : 
'').
'</td>';
 
  744            print 
'<td class="right nowraponall amount">'.($line->credit != 0 ? 
price($line->credit) : 
'').
'</td>';
 
  746            print 
'<td class="center nowraponall">';
 
  747            if (empty($line->date_export) && empty($line->date_validation)) {
 
  748              print 
'<a class="editfielda reposition" href="' . $_SERVER[
"PHP_SELF"] . 
'?action=update&id=' . $line->id . 
'&piece_num=' . urlencode($line->piece_num) . 
'&mode=' . urlencode($mode) . 
'&token=' . urlencode(newToken()) . 
'">';
 
  749              print 
img_edit(
'', 0, 
'class="marginrightonly"');
 
  752              print 
'<a class="editfielda nohover cursornotallowed reposition disabled" href="#" title="'.dol_escape_htmltag($langs->trans(
"ForbiddenTransactionAlreadyExported")).
'">';
 
  753              print 
img_edit($langs->trans(
"ForbiddenTransactionAlreadyExported"), 0, 
'class="marginrightonly"');
 
  757            if (empty($line->date_validation)) {
 
  758              $actiontodelete = 
'delete';
 
  759              if ($mode == 
'_tmp' || $action != 
'delmouv') {
 
  760                $actiontodelete = 
'confirm_delete';
 
  763              print 
'<a href="' . $_SERVER[
"PHP_SELF"] . 
'?action=' . $actiontodelete . 
'&id=' . $line->id . 
'&piece_num=' . urlencode($line->piece_num) . 
'&mode=' . urlencode($mode) . 
'&token=' . urlencode(newToken()) . 
'">';
 
  767              print 
'<a class="editfielda nohover cursornotallowed disabled" href="#" title="'.dol_escape_htmltag($langs->trans(
"ForbiddenTransactionAlreadyExported")).
'">';
 
  768              print 
img_delete($langs->trans(
"ForbiddenTransactionAlreadyValidated"));
 
  777        $total_debit = 
price2num($total_debit, 
'MT');
 
  778        $total_credit = 
price2num($total_credit, 
'MT');
 
  780        if ($total_debit != $total_credit) {
 
  781          setEventMessages(
null, array($langs->trans(
'MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 
'warnings');
 
  787        if ($mode == 
'_tmp' && $action == 
'') {
 
  789          print 
'<div class="center">';
 
  790          if ($total_debit == $total_credit) {
 
  791            print 
'<a class="button" href="'.$_SERVER[
"PHP_SELF"].
'?piece_num='.$object->piece_num.
'&action=valid">'.$langs->trans(
"ValidTransaction").
'</a>';
 
  793            print 
'<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans(
"MvtNotCorrectlyBalanced", $debit, $credit)).
'" value="'.
dol_escape_htmltag($langs->trans(
"ValidTransaction")).
'">';
 
  797          print 
'<a class="button button-cancel" href="'.DOL_URL_ROOT.
'/accountancy/bookkeeping/list.php">'.$langs->trans(
"Cancel").
'</a>';
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage accounting accounts.
Class to manage accounting journals.
Class to manage Ledger (General Ledger and Subledger)
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...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.