31 require
'../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formsetup.class.php';
40 $langs->loadLangs(array(
'admin',
'errors',
'other',
'bills'));
43 $hookmanager->initHooks(array(
'situationinvoicesetup',
'globalsetup'));
50 $action =
GETPOST(
'action',
'aZ09');
51 $backtopage =
GETPOST(
'backtopage',
'alpha');
53 $value =
GETPOST(
'value',
'alpha');
54 $label =
GETPOST(
'label',
'alpha');
55 $modulepart =
GETPOST(
'modulepart',
'aZ09');
57 $scandir =
GETPOST(
'scan_dir',
'alpha');
65 $formSetup->newItem(
'INVOICE_USE_SITUATION')
67 ->nameText = $langs->trans(
'UseSituationInvoices');
69 $item = $formSetup->newItem(
'INVOICE_USE_SITUATION_CREDIT_NOTE')
71 ->nameText = $langs->trans(
'UseSituationInvoicesCreditNote');
78 $item = $formSetup->newItem(
'INVOICE_USE_RETAINED_WARRANTY');
79 $item->nameText = $langs->trans(
'AllowedInvoiceForRetainedWarranty');
81 $arrayAvailableType = array(
86 if ($action ==
'edit') {
87 $item->fieldInputOverride =
$form->selectarray(
'INVOICE_USE_RETAINED_WARRANTY', $arrayAvailableType, $conf->global->INVOICE_USE_RETAINED_WARRANTY, 1);
89 $item->fieldOutputOverride= isset($arrayAvailableType[$conf->global->INVOICE_USE_RETAINED_WARRANTY])?$arrayAvailableType[$conf->global->INVOICE_USE_RETAINED_WARRANTY]:
'';
95 $formSetup->newItem(
'INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION')
97 ->nameText = $langs->trans(
'RetainedwarrantyOnlyForSituationFinal');
100 $item = $formSetup->newItem(
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT');
101 $item->nameText = $langs->trans(
'RetainedwarrantyDefaultPercent');
102 $item->fieldAttr = array(
111 $item = $formSetup->newItem(
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID');
112 $item->nameText = $langs->trans(
'PaymentConditionsShortRetainedWarranty');
113 $form->load_cache_conditions_paiements();
114 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'])) {
115 $item->fieldOutputOverride =
$form->cache_conditions_paiements[$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID][
'label'];
117 $item->fieldInputOverride =
$form->getSelectConditionsPaiements($conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID,
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID', -1, 1);
124 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
132 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
134 $help_yrl =
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura';
139 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
140 print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
143 print
dol_get_fiche_head($head,
'situation', $langs->trans(
"InvoiceSituation"), -1,
'invoice');
146 print
'<span class="opacitymedium">'.$langs->trans(
"InvoiceFirstSituationDesc").
'</span><br><br>';
153 if ($action ==
'edit') {
154 print $formSetup->generateOutput(
true);
156 print $formSetup->generateOutput();
159 if (count($formSetup->items) > 0) {
160 if ($action !=
'edit') {
161 print
'<div class="tabsAction">';
162 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
166 print
'<br>'.$langs->trans(
"NothingToSetup");
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
const TYPE_STANDARD
Standard invoice.
const TYPE_SITUATION
Situation invoice.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
invoice_admin_prepare_head()
Return array head with list of tabs to view object informations.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.