30 require
'../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
39 $langs->loadLangs(array(
'admin',
'errors',
'other',
'bills'));
42 $hookmanager->initHooks(array(
'situationinvoicesetup',
'globalsetup'));
49 $action =
GETPOST(
'action',
'aZ09');
50 $backtopage =
GETPOST(
'backtopage',
'alpha');
52 $value =
GETPOST(
'value',
'alpha');
53 $label =
GETPOST(
'label',
'alpha');
54 $modulepart =
GETPOST(
'modulepart',
'aZ09');
56 $scandir =
GETPOST(
'scan_dir',
'alpha');
64 $formSetup->newItem(
'INVOICE_USE_SITUATION')
66 ->nameText = $langs->trans(
'UseSituationInvoices');
68 $item = $formSetup->newItem(
'INVOICE_USE_SITUATION_CREDIT_NOTE')
70 ->nameText = $langs->trans(
'UseSituationInvoicesCreditNote');
77 $item = $formSetup->newItem(
'INVOICE_USE_RETAINED_WARRANTY');
78 $item->nameText = $langs->trans(
'AllowedInvoiceForRetainedWarranty');
80 $arrayAvailableType = array(
85 if ($action ==
'edit') {
86 $item->fieldInputOverride =
$form->selectarray(
'INVOICE_USE_RETAINED_WARRANTY', $arrayAvailableType, $conf->global->INVOICE_USE_RETAINED_WARRANTY, 1);
88 $item->fieldOutputOverride= isset($arrayAvailableType[$conf->global->INVOICE_USE_RETAINED_WARRANTY])?$arrayAvailableType[$conf->global->INVOICE_USE_RETAINED_WARRANTY]:
'';
94 $formSetup->newItem(
'INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION')
96 ->nameText = $langs->trans(
'RetainedwarrantyOnlyForSituationFinal');
99 $item = $formSetup->newItem(
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
100 $item->nameText = $langs->trans(
'RetainedwarrantyDefaultPercent');
101 $item->fieldAttr = array(
110 $item = $formSetup->newItem(
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID');
111 $item->nameText = $langs->trans(
'PaymentConditionsShortRetainedWarranty');
112 $form->load_cache_conditions_paiements();
113 if (!empty($conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID) && isset(
$form->cache_conditions_paiements[$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID][
'label'])) {
114 $item->fieldOutputOverride =
$form->cache_conditions_paiements[$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID][
'label'];
116 $item->fieldInputOverride =
$form->getSelectConditionsPaiements($conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID,
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID', -1, 1);
123 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
131 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
135 $langs->trans(
"BillsSetup"),
136 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'
141 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
142 print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
145 print
dol_get_fiche_head($head,
'situation', $langs->trans(
"InvoiceSituation"), -1,
'invoice');
148 print
'<span class="opacitymedium">'.$langs->trans(
"InvoiceFirstSituationDesc").
'</span><br><br>';
155 if ($action ==
'edit') {
156 print $formSetup->generateOutput(
true);
158 print $formSetup->generateOutput();
161 if (count($formSetup->items) > 0) {
162 if ($action !=
'edit') {
163 print
'<div class="tabsAction">';
164 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
168 print
'<br>'.$langs->trans(
"NothingToSetup");
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
const TYPE_STANDARD
Standard invoice.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
invoice_admin_prepare_head()
Return array head with list of tabs to view object informations.
const TYPE_SITUATION
Situation invoice.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.