* Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * 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 * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/compta/tva/card.php * \ingroup tax * \brief Page of VAT payments */ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; if (isModEnabled('accounting')) { include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; } // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills')); $id = GETPOST("id", 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST("action", "aZ09"); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $refund = GETPOST("refund", "int"); if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { $auto_create_payment = GETPOST("auto_create_paiement", "int"); } else { $auto_create_payment = empty($conf->global->CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT); } if (empty($refund)) { $refund = 0; } $datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); $datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); // Initialize technical objects $object = new Tva($db); $extrafields = new ExtraFields($db); $diroutputmassaction = $conf->tax->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('taxvatcard', 'globalcard')); // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); if (empty($action) && empty($id) && empty($ref)) { $action = 'view'; } // Load object if ($id > 0) { $object->fetch($id); } $permissiontoread = $user->rights->tax->charges->lire; $permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1].'/vat'; // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'tax', '', 'tva', 'charges'); /* * Actions */ $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } if ($cancel && !$id) { header("Location: list.php"); exit; } if ($action == 'setlib' && $user->rights->tax->charges->creer) { $object->fetch($id); $result = $object->setValueFrom('label', GETPOST('lib', 'alpha'), '', '', 'text', '', $user, 'TAX_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } if ($action == 'setdatev' && $user->rights->tax->charges->creer) { $object->fetch($id); $object->datev = $datev; $result = $object->update($user); if ($result < 0) { dol_print_error($db, $object->error); } $action = ''; } // payment mode if ($action == 'setmode' && $user->rights->tax->charges->creer) { $object->fetch($id); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } // Bank account if ($action == 'setbankaccount' && $user->rights->tax->charges->creer) { $object->fetch($id); $result = $object->setBankAccount(GETPOST('fk_account', 'int')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } // Classify paid if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes') { $object->fetch($id); $result = $object->setPaid($user); } if ($action == 'reopen' && $user->rights->tax->charges->creer) { $result = $object->fetch($id); if ($object->paye) { $result = $object->setUnpaid($user); if ($result > 0) { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit(); } else { setEventMessages($object->error, $object->errors, 'errors'); } } } if ($action == 'add' && !$cancel) { $error = 0; $object->fk_account = GETPOST("accountid", 'int'); $object->type_payment = GETPOST("type_payment", 'alphanohtml'); $object->num_payment = GETPOST("num_payment", 'alphanohtml'); $object->datev = $datev; $object->datep = $datep; $amount = price2num(GETPOST("amount", 'alpha')); if ($refund == 1) { $amount = -$amount; } $object->amount = $amount; $object->label = GETPOST("label", 'alpha'); $object->note = GETPOST("note", 'restricthtml'); $object->note_private = GETPOST("note", 'restricthtml'); if (empty($object->datep)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")), null, 'errors'); $error++; } if (empty($object->datev)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PeriodEndDate")), null, 'errors'); $error++; } if (!empty($auto_create_payment) && (empty($object->type_payment) || $object->type_payment < 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } if (empty($object->amount)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } if (!empty($auto_create_payment) && ($object->fk_account <= 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("AccountToCredit")), null, 'errors'); $error++; } if (!$error) { $ret = $object->create($user); if ($ret < 0) { $error++; } // Auto create payment if (!empty($auto_create_payment) && !$error) { $db->begin(); // Create a line of payments $paiement = new PaymentVAT($db); $paiement->chid = $object->id; $paiement->datepaye = $datep; $paiement->amounts = array($object->id=>$amount); // Tableau de montant $paiement->paiementtype = GETPOST("type_payment", 'alphanohtml'); $paiement->num_payment = GETPOST("num_payment", 'alphanohtml'); $paiement->note = GETPOST("note", 'restricthtml'); if (!$error) { $paymentid = $paiement->create($user, (int) GETPOST('closepaidtva')); if ($paymentid < 0) { $error++; setEventMessages($paiement->error, null, 'errors'); $action = 'create'; } } if (!$error) { $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOST('accountid', 'int'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); } } if (!$error) { $db->commit(); } else { $db->rollback(); } } if (empty($error)) { header("Location: card.php?id=" . $object->id); exit; } } $action = 'create'; } if ($action == 'confirm_delete' && $confirm == 'yes') { $result = $object->fetch($id); $totalpaid = $object->getSommePaiement(); if (empty($totalpaid)) { $db->begin(); $ret = $object->delete($user); if ($ret > 0) { if ($object->fk_bank) { $accountline = new AccountLine($db); $result = $accountline->fetch($object->fk_bank); if ($result > 0) { $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) } } if ($result >= 0) { $db->commit(); header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php'); exit; } else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } else { setEventMessages($langs->trans('DisabledBecausePayments'), null, 'errors'); } } if ($action == 'update' && !GETPOST("cancel") && $user->rights->tax->charges->creer) { $amount = price2num(GETPOST('amount', 'alpha'), 'MT'); if (empty($amount)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); $action = 'edit'; } elseif (!is_numeric($amount)) { setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } else { $result = $object->fetch($id); $object->amount = $amount; $result = $object->update($user); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } } } // Action clone object if ($action == 'confirm_clone' && $confirm != 'yes') { $action = ''; } if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->charges->creer)) { $db->begin(); $originalId = $id; $object->fetch($id); if ($object->id > 0) { $object->id = $object->ref = null; $object->paye = 0; if (GETPOST('clone_label', 'alphanohtml')) { $object->label = GETPOST('clone_label', 'alphanohtml'); } else { $object->label = $langs->trans("CopyOf").' '.$object->label; } $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); if ($newdateperiod) { $object->datev = $newdateperiod; } //if ($object->check()) { $id = $object->create($user); if ($id > 0) { $db->commit(); $db->close(); header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else { $id = $originalId; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } //} } else { $db->rollback(); dol_print_error($db, $object->error); } } /* * View */ $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); $title = $langs->trans("VAT")." - ".$langs->trans("Card"); $help_url = ''; llxHeader('', $title, $help_url); if ($id) { $result = $object->fetch($id); if ($result <= 0) { dol_print_error($db); exit; } } // Form to enter VAT if ($action == 'create') { print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New")); if (!empty($conf->use_javascript_ajax)) { print "\n".''."\n"; } print '
'; print ''; print ''; print dol_get_fiche_head(); print ''; print ''; print "\n"; // Label if ($refund == 1) { $label = $langs->trans("VATRefund"); } else { $label = $langs->trans("VATPayment"); } print ''; print ''; // Amount print ''; print ''; // Auto create payment print ''; print ''."\n"; print ''; print ''; // Type payment print '\n"; print ""; if (isModEnabled("banque")) { // Bank account print ''; } // Number print ''."\n"; // Comments print ''; print ''; print ''; print ''; // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'; //print $langs->trans("Type"); print ''; print '
'; print ''; print '   '; print ''; print '
'; print '
'.$langs->trans("Label").'
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1); print '
'.$langs->trans("Amount").'

'.$langs->trans("DatePayment").''; print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1); print '
'.$langs->trans("PaymentMode").''; print $form->select_types_paiements(GETPOST("type_payment", 'int'), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); print "
'.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // List of bank account available print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print '
'.$langs->trans("Comments").'
'; print dol_get_fiche_end(); print '
'; print '
'; print ' '.$langs->trans("ClosePaidVATAutomatically").''; print '
'; print '
'; print ''; print '     '; print ''; print '
'; print '
'; } // View mode if ($id > 0) { $head = vat_prepare_head($object); $totalpaid = $object->getSommePaiement(); // Clone confirmation if ($action === 'clone') { $formquestion = array( array('type' => 'text', 'name' => 'clone_label', 'label' => $langs->trans("Label"), 'value' => $langs->trans("CopyOf").' '.$object->label), ); //$formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVAT', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 240); } if ($action == 'paid') { $text = $langs->trans('ConfirmPayVAT'); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans('PayVAT'), $text, "confirm_paid", '', '', 2); } if ($action == 'delete') { $text = $langs->trans('ConfirmDeleteVAT'); print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('DeleteVAT'), $text, 'confirm_delete', '', '', 2); } if ($action == 'edit') { print "
id&action=update\" method=\"post\">"; print ''; } print dol_get_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); $morehtmlref = '
'; // Label of social contribution $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project $morehtmlref .= '
'; $linkback = ''.$langs->trans("BackToList").''; $object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', ''); print '
'; print '
'; print '
'; print ''; // Label //print ''; /*print ""; print '';*/ print ''; if ($action == 'edit') { print ''; } else { print ''; } // Mode of payment print ''; // Bank account if (isModEnabled("banque")) { print ''; print ''; } // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("DatePayment").''; print dol_print_date($object->datep, 'day'); print '
'; print $form->editfieldkey($form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")), 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); print ''; print $form->editfieldval("PeriodEndDate", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day'); //print dol_print_date($object->datev,'day'); print '
' . $langs->trans("Amount") . '
' . $langs->trans("Amount") . '' . price($object->amount) . '
'; print ''; if ($action != 'editmode') { print ''; } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'
'; print '
'; if ($action == 'editmode') { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'mode_reglement_id'); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->type_payment, 'none'); } print '
'; print ''; } print '
'; print $langs->trans('BankAccount'); print ''; if ($action != 'editbankaccount' && $user->rights->tax->charges->creer) { print 'id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'
'; print '
'; if ($action == 'editbankaccount') { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print '
'; print '
'; print '
'; $nbcols = 3; if (isModEnabled("banque")) { $nbcols++; } /* * Payments */ $sql = "SELECT p.rowid, p.num_paiement as num_payment, p.datep as dp, p.amount,"; $sql .= " c.code as type_code,c.libelle as paiement_type,"; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal'; $sql .= " FROM ".MAIN_DB_PREFIX."payment_vat as p"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepaiement = c.id"; $sql .= ", ".MAIN_DB_PREFIX."tva as tva"; $sql .= " WHERE p.fk_tva = ".((int) $id); $sql .= " AND p.fk_tva = tva.rowid"; $sql .= " AND tva.entity IN (".getEntity('tax').")"; $sql .= " ORDER BY dp DESC"; //print $sql; $resql = $db->query($sql); if ($resql) { $totalpaid = 0; $num = $db->num_rows($resql); $i = 0; $total = 0; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; print ''; print ''; print ''; if (isModEnabled("banque")) { print ''; } print ''; print ''; if ($num > 0) { $bankaccountstatic = new Account($db); while ($i < $num) { $objp = $db->fetch_object($resql); print ''; print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; $bankaccountstatic->number = $objp->banumber; $bankaccountstatic->currency_code = $objp->bacurrency_code; if (isModEnabled('accounting')) { $bankaccountstatic->account_number = $objp->account_number; $accountingjournal = new AccountingJournal($db); $accountingjournal->fetch($objp->fk_accountancy_journal); $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); } print ''; } print '\n"; print ""; $totalpaid += $objp->amount; $i++; } } else { print ''; print ''; print ''; } print '\n"; print '\n"; $resteapayer = $object->amount - $totalpaid; $cssforamountpaymentcomplete = 'amountpaymentcomplete'; print '"; print '\n"; print "
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").'
'; print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'; if ($bankaccountstatic->id) { print $bankaccountstatic->getNomUrl(1, 'transactions'); } print ''.price($objp->amount)."
'.$langs->trans("None").'
'.$langs->trans("AlreadyPaid")." :".price($totalpaid)."
'.$langs->trans("AmountExpected")." :".price($object->amount)."
'.$langs->trans("RemainderToPay")." :'.price($resteapayer)."
"; print '
'; $db->free($resql); } else { dol_print_error($db); } print '
'; print '
'; print '
'; print dol_get_fiche_end(); if ($action == 'edit') { print $form->buttonsSaveCancel(); print "
\n"; } // Buttons for actions print '
'."\n"; if ($action != 'edit') { // Reopen if ($object->paye && $user->rights->tax->charges->creer) { print '"; } // Edit if ($object->paye == 0 && $user->rights->tax->charges->creer) { print '"; } // Emit payment if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->tax->charges->creer) { print ''; } // Classify 'paid' if ($object->paye == 0 && ( (round($resteapayer) <= 0 && $object->amount > 0) || (round($resteapayer) >= 0 && $object->amount < 0) ) && $user->rights->tax->charges->creer) { print '"; } // Clone if ($user->rights->tax->charges->creer) { print '"; } if (!empty($user->rights->tax->charges->supprimer) && empty($totalpaid)) { print ''; } else { print ''; } } print '
'."\n"; // Select mail models is same action as presend if (GETPOST('modelselected')) { $action = 'presend'; } if ($action != 'presend') { print '
'; print ''; // ancre $includedocgeneration = 1; // Documents if ($includedocgeneration) { $objref = dol_sanitizeFileName($object->ref); $relativepath = $objref.'/'.$objref.'.pdf'; $filedir = $conf->tax->dir_output.'/vat/'.$objref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; //$genallowed = $user->rights->tax->charges->lire; // If you can read, you can build the PDF to read content $genallowed = 0; $delallowed = $user->rights->tax->charges->creer; // If you can create/edit, you can remove a file on card print $formfile->showdocuments('tax-vat', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); } // Show links to link elements //$linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject')); //$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); print '
'; /* $MAXEVENT = 10; $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); */ print '
'; } //Select mail models is same action as presend if (GETPOST('modelselected')) { $action = 'presend'; } // Presend form $modelmail = 'vat'; $defaulttopic = 'InformationMessage'; $diroutput = $conf->tax->dir_output; $trackid = 'vat'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } llxFooter(); $db->close();