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){
|
if($conf->global->INVOICE_USE_RETAINED_WARRANTY){
|
||||||
$rwStyle = 'display:none;';
|
$rwStyle = 'display:none;';
|
||||||
if(in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)){
|
if(in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)){
|
||||||
$rwStyle = '';
|
$rwStyle = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$retained_warranty = GETPOST('retained_warranty', 'int');
|
$retained_warranty = GETPOST('retained_warranty', 'int');
|
||||||
if(empty($retained_warranty)){
|
if(empty($retained_warranty)){
|
||||||
if(!empty($objectsrc->retained_warranty)){ // use previous situation value
|
if(!empty($objectsrc->retained_warranty)){ // use previous situation value
|
||||||
$retained_warranty = $objectsrc->retained_warranty;
|
$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 '<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 '<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
|
// Retained warranty payment term
|
||||||
print '<tr class="retained-warranty-line" style="'.$rwStyle.'" ><td class="nowrap">'.$langs->trans('PaymentConditionsShortRetainedWarranty').'</td><td colspan="2">';
|
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_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int');
|
||||||
if(empty($retained_warranty_fk_cond_reglement)){
|
if(empty($retained_warranty_fk_cond_reglement)){
|
||||||
$retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID;
|
$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
|
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;
|
$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);
|
$form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<script type="text/javascript" language="javascript">
|
print '<script type="text/javascript" language="javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$("[name=\'type\']").change(function() {
|
$("[name=\'type\']").change(function() {
|
||||||
if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
|
if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
|
||||||
{
|
{
|
||||||
$(".retained-warranty-line").show();
|
$(".retained-warranty-line").show();
|
||||||
$("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'");
|
$("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$(".retained-warranty-line").hide();
|
$(".retained-warranty-line").hide();
|
||||||
$("#new-situation-invoice-retained-warranty").val("");
|
$("#new-situation-invoice-retained-warranty").val("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("[name=\'type\']").trigger("change");
|
$("[name=\'type\']").trigger("change");
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Payment mode
|
// Payment mode
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user