fix indentation
This commit is contained in:
parent
e6b29aa0f0
commit
4b4f69c76a
@ -3388,25 +3388,25 @@ if ($action == 'create')
|
||||
|
||||
|
||||
if($conf->global->INVOICE_USE_RETAINED_WARRANTY){
|
||||
$rwStyle = 'display:none;';
|
||||
$rwStyle = 'display:none;';
|
||||
if(in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)){
|
||||
$rwStyle = '';
|
||||
}
|
||||
|
||||
$retained_warranty = GETPOST('retained_warranty', 'int');
|
||||
$retained_warranty = GETPOST('retained_warranty', 'int');
|
||||
if(empty($retained_warranty)){
|
||||
if(!empty($objectsrc->retained_warranty)){ // use previous situation value
|
||||
$retained_warranty = $objectsrc->retained_warranty;
|
||||
}
|
||||
}
|
||||
$retained_warranty_js_default = !empty($retained_warranty)?$retained_warranty:$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
|
||||
$retained_warranty_js_default = !empty($retained_warranty)?$retained_warranty:$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
|
||||
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('RetainedWarranty').'</td><td colspan="2">';
|
||||
print '<input id="new-situation-invoice-retained-warranty" name="retained_warranty" type="number" value="'.$retained_warranty.'" step="0.01" min="0" max="100" />%';
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('RetainedWarranty').'</td><td colspan="2">';
|
||||
print '<input id="new-situation-invoice-retained-warranty" name="retained_warranty" type="number" value="'.$retained_warranty.'" step="0.01" min="0" max="100" />%';
|
||||
|
||||
// Retained warranty payment term
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('PaymentConditionsShortRetainedWarranty').'</td><td colspan="2">';
|
||||
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||
// Retained warranty payment term
|
||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('PaymentConditionsShortRetainedWarranty').'</td><td colspan="2">';
|
||||
$retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||
if(empty($retained_warranty_fk_cond_reglement)){
|
||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value
|
||||
@ -3415,26 +3415,26 @@ if ($action == 'create')
|
||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
||||
}
|
||||
}
|
||||
$form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1);
|
||||
print '</td></tr>';
|
||||
$form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function() {
|
||||
$("[name=\'type\']").change(function() {
|
||||
if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
|
||||
{
|
||||
$(".retained-warranty-line").show();
|
||||
$("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'");
|
||||
}
|
||||
else{
|
||||
$(".retained-warranty-line").hide();
|
||||
$("#new-situation-invoice-retained-warranty").val("");
|
||||
}
|
||||
});
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function() {
|
||||
$("[name=\'type\']").change(function() {
|
||||
if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
|
||||
{
|
||||
$(".retained-warranty-line").show();
|
||||
$("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'");
|
||||
}
|
||||
else{
|
||||
$(".retained-warranty-line").hide();
|
||||
$("#new-situation-invoice-retained-warranty").val("");
|
||||
}
|
||||
});
|
||||
|
||||
$("[name=\'type\']").trigger("change");
|
||||
});
|
||||
</script>';
|
||||
$("[name=\'type\']").trigger("change");
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
// Payment mode
|
||||
|
||||
Loading…
Reference in New Issue
Block a user