30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
34 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
37 $langs->loadLangs(array(
'admin',
'errors',
'other',
'bills'));
41 $action =
GETPOST(
'action',
'aZ09');
42 $value =
GETPOST(
'value',
'alpha');
43 $label =
GETPOST(
'label',
'alpha');
44 $scandir =
GETPOST(
'scan_dir',
'alpha');
52 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
60 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
63 "", $langs->trans(
"BillsSetup"),
64 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'
67 $form =
new Form($db);
70 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
77 print '<span class="opacitymedium">'.$langs->trans(
"InvoiceFirstSituationDesc").
'</span><br><br>';
84 print '<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
85 print '<input type="hidden" name="token" value="'.newToken().
'">';
88 print '<div class="div-table-responsive-no-min">';
89 print '<table class="noborder centpercent">';
91 print '<tr class="liste_titre">';
92 print '<td>'.$langs->trans(
"Parameter").
'</td>';
93 print '<td align="center" width="60">'.$langs->trans(
"Value").
'</td>';
94 print '<td width="80"> </td>';
97 _printOnOff(
'INVOICE_USE_SITUATION', $langs->trans(
'UseSituationInvoices'));
98 _printOnOff(
'INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans(
'UseSituationInvoicesCreditNote'));
101 $confkey =
'INVOICE_USE_RETAINED_WARRANTY';
103 $arrayAvailableType = array(
107 $selected = $conf->global->$confkey;
108 $curentInput = (empty($inputCount) ? 1 : ($inputCount + 1));
109 $formSelectInvoiceType = $form->selectarray(
'value'.$curentInput, $arrayAvailableType, $selected, 1);
110 _printInputFormPart($confkey, $langs->trans(
'AllowedInvoiceForRetainedWarranty'),
'', array(), $formSelectInvoiceType);
113 _printOnOff(
'INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION', $langs->trans(
'RetainedwarrantyOnlyForSituationFinal'));
121 _printInputFormPart(
'INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', $langs->trans(
'RetainedwarrantyDefaultPercent'),
'', $metas);
124 $inputCount = empty($inputCount) ? 1 : ($inputCount + 1);
125 print '<tr class="oddeven">';
126 print '<td>'.$langs->trans(
'PaymentConditionsShortRetainedWarranty').
'</td>';
127 print '<td class="center" width="20"> </td>';
128 print '<td class="right" width="300">';
129 print '<input type="hidden" name="param'.$inputCount.
'" value="INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID">';
130 $form->select_conditions_paiements($conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID,
'value'.$inputCount, -1, 1);
154 function _updateBtn()
157 print '<div class="center">';
158 print '<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'">';
171 function _printOnOff($confkey, $title =
false, $desc =
'')
175 print '<tr class="oddeven">';
176 print '<td>'.($title ? $title : $langs->trans($confkey));
178 print '<br><small>'.$langs->trans($desc).
'</small>';
181 print '<td class="center" width="20"> </td>';
182 print '<td class="right" width="300">';
200 function _printInputFormPart($confkey, $title =
false, $desc =
'', $metas = array(), $type =
'input', $help =
false)
202 global $langs, $conf, $db, $inputCount;
204 $inputCount = empty($inputCount) ? 1 : ($inputCount + 1);
205 $form =
new Form($db);
207 $defaultMetas = array(
208 'name' =>
'value'.$inputCount
211 if ($type !=
'textarea') {
212 $defaultMetas[
'type'] =
'text';
213 $defaultMetas[
'value'] = $conf->global->{$confkey};
217 $metas = array_merge($defaultMetas, $metas);
219 foreach ($metas as $key => $values) {
220 $metascompil .=
' '.$key.
'="'.$values.
'" ';
223 print '<tr class="oddeven">';
227 print $form->textwithtooltip(($title ? $title : $langs->trans($confkey)), $langs->trans($help), 2, 1,
img_help(1,
''));
229 print $title ? $title : $langs->trans($confkey);
233 print '<br><small>'.$langs->trans($desc).
'</small>';
237 print '<td class="center" width="20"> </td>';
238 print '<td class="right" width="300">';
239 print '<input type="hidden" name="param'.$inputCount.
'" value="'.$confkey.
'">';
241 print '<input type="hidden" name="action" value="setModuleOptions">';
242 if ($type ==
'textarea') {
244 } elseif ($type ==
'input') {
245 print '<input '.$metascompil.
' />';
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.
img_help($usehelpcursor=1, $usealttitle=1)
Show help logo with cursor "?".
dol_htmlentities($string, $flags=null, $encoding= 'UTF-8', $double_encode=false)
Replace htmlentities functions.
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.
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0)
On/off button for constant.
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.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.