diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 408b762358e..aced29bc125 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -96,7 +96,9 @@ print "\n"; _printOnOff('INVOICE_USE_SITUATION', $langs->trans('UseSituationInvoices')); _printOnOff('INVOICE_USE_SITUATION_CREDIT_NOTE', $langs->trans('UseSituationInvoicesCreditNote')); -_printOnOff('INVOICE_USE_SITUATION_RETAINED_WARRANTY', $langs->trans('Retainedwarranty')); +_printOnOff('INVOICE_USE_RETAINED_WARRANTY',$langs->trans('Retainedwarranty')); +_printOnOff('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION',$langs->trans('RetainedwarrantyOnlyForSituation')); +_printOnOff('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL',$langs->trans('RetainedwarrantyOnlyForSituationFinal')); $metas = array( 'type' => 'number', diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5038079085b..593e33734c5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -136,7 +136,12 @@ if ($user->socid) $socid = $user->socid; $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft); - +// retained warranty invoice available type +if(empty($conf->global->USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION)) { + $RetainedWarrantyInvoiceAvailableType = array( Facture::TYPE_SITUATION, Facture::TYPE_STANDARD); +} else { + $RetainedWarrantyInvoiceAvailableType = array( Facture::TYPE_SITUATION ); +} /* * Actions @@ -1308,18 +1313,17 @@ if (empty($reshook)) $object->situation_counter = 1; $object->situation_final = 0; $object->situation_cycle_ref = $object->newCycle(); - - - $object->retained_warranty = GETPOST('retained_warranty', 'int'); - $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - - $retained_warranty_date_limit = GETPOST('retained_warranty_date_limit'); - if (!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)) { - $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); - } - $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); } + $object->retained_warranty = GETPOST('retained_warranty', 'int'); + $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + + $retained_warranty_date_limit = GETPOST('retained_warranty_date_limit'); + if(!empty($retained_warranty_date_limit) && $db->jdate($retained_warranty_date_limit)){ + $object->retained_warranty_date_limit = $db->jdate($retained_warranty_date_limit); + } + $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); + $object->fetch_thirdparty(); // If creation from another object of another module (Example: origin=propal, originid=1) @@ -1714,6 +1718,23 @@ if (empty($reshook)) $object->origin = $origin; $object->origin_id = $originid; + // retained warranty + if(!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) + { + $retained_warranty = GETPOST('retained_warranty'); + if(price2num($retained_warranty) > 0) + { + $object->retained_warranty = price2num($retained_warranty); + } + + if(GETPOST('retained_warranty_fk_cond_reglement', 'int') > 0) + { + $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + } + + $object->retained_warranty_date_limit = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : $object->calculate_date_lim_reglement($object->retained_warranty_fk_cond_reglement); + } + foreach ($object->lines as $i => &$line) { $line->origin = $object->origin; @@ -3309,40 +3330,41 @@ if ($action == 'create') $form->select_conditions_paiements(GETPOSTISSET('cond_reglement_id') ? GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id'); print ''; - if (!empty($conf->global->INVOICE_USE_SITUATION)) - { - if ($conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) { - $rwStyle = 'display:none;'; - if (GETPOST('type', 'int') == Facture::TYPE_SITUATION) { - $rwStyle = ''; - } - $retained_warranty = GETPOST('retained_warranty', 'int'); - $retained_warranty = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; - print ''.$langs->trans('RetainedWarranty').''; - print '%'; + if($conf->global->INVOICE_USE_RETAINED_WARRANTY){ - // Retained warranty payment term - print ''.$langs->trans('PaymentConditionsShortRetainedWarranty').''; - $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $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 ''; + $rwStyle = 'display:none;'; + if(in_array(GETPOST('type', 'int'), $RetainedWarrantyInvoiceAvailableType)){ + $rwStyle = ''; + } - print ''; - } + + $retained_warranty = GETPOST('retained_warranty', 'int'); + $retained_warranty = !empty($retained_warranty)?$retained_warranty:$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; + print '' . $langs->trans('RetainedWarranty') . ''; + print '%'; + + // Retained warranty payment term + print '' . $langs->trans('PaymentConditionsShortRetainedWarranty') . ''; + $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement)? $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 ''; + + print ''; } // Payment mode @@ -4243,89 +4265,82 @@ elseif ($id > 0 || !empty($ref)) print ''; } - $displayWarranty = false; - if (($object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY)))) - { - // Check if this situation invoice is 100% for real - if (!empty($object->situation_final) && !empty($object->lines)) { - $displayWarranty = true; - foreach ($object->lines as $i => $line) { - if ($line->product_type < 2 && $line->situation_percent < 100) { - $displayWarranty = false; - break; - } - } - } + if(!empty($object->retained_warranty) || !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { - // Retained Warranty - print ''; - print ''; - if ($action != 'editretainedwarranty' && $user->rights->facture->creer) { - print ''; - } + $displayWarranty = true; + if(!in_array($object->type, $RetainedWarrantyInvoiceAvailableType) && empty($object->retained_warranty)){ + $displayWarranty = false; + } - print '
'; - print $langs->trans('RetainedWarranty'); - print 'id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'
'; - print ''; - if ($action == 'editretainedwarranty') - { - print '
'; - print ''; - print ''; - print ''; - print ''; - print '
'; - } - else - { - print price($object->retained_warranty).'%'; - } - print ''; + if($displayWarranty) + { - // Retained warranty payment term - print ''; - print ''; - if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer) { - print ''; - } + // Retained Warranty + print '
'; - print $langs->trans('PaymentConditionsShortRetainedWarranty'); - print 'id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'
'; + print ''; + if ($action != 'editretainedwarranty' && $user->rights->facture->creer) { + print ''; + } - print '
'; + print $langs->trans('RetainedWarranty'); + print 'id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).'
'; - print '
'; - $defaultDate = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : strtotime('-1 years', $object->date_lim_reglement); - if ($object->date > $defaultDate) { - $defaultDate = $object->date; - } + print '
'; + print ''; + if ($action == 'editretainedwarranty') + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + } + else + { + print price($object->retained_warranty).'%'; + } + print ''; - if ($action == 'editretainedwarrantypaymentterms') - { - //date('Y-m-d',$object->date_lim_reglement) - print '
'; - print ''; - print ''; - $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $object->retained_warranty_fk_cond_reglement; - $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $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 ''; - print '
'; - } - else - { - $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); - if (!$displayWarranty) { - print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" '); - } - } - print ''; + // Retained warranty payment term + print ''; + print ''; + if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer) { + print ''; + } + print '
'; + print $langs->trans('PaymentConditionsShortRetainedWarranty'); + print 'id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).'
'; + print ''; + $defaultDate = !empty($object->retained_warranty_date_limit) ? $object->retained_warranty_date_limit : strtotime('-1 years', $object->date_lim_reglement); + if ($object->date > $defaultDate) { + $defaultDate = $object->date; + } + + if ($action == 'editretainedwarrantypaymentterms') + { + //date('Y-m-d',$object->date_lim_reglement) + print '
'; + print ''; + print ''; + $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $object->retained_warranty_fk_cond_reglement; + $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $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 ''; + print '
'; + } + else + { + $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); + if (!$displayWarranty) { + print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" '); + } + } + print ''; - if ($displayWarranty) - { // Retained Warranty payment date limit print ''; print '
'; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cb2bf087652..30f3867a843 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -297,9 +297,9 @@ class Facture extends CommonInvoice 'situation_cycle_ref' =>array('type'=>'smallint(6)', 'label'=>'Situation cycle ref', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>230), 'situation_counter' =>array('type'=>'smallint(6)', 'label'=>'Situation counter', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION', 'visible'=>-1, 'position'=>235), 'situation_final' =>array('type'=>'smallint(6)', 'label'=>'Situation final', 'enabled'=>'empty($conf->global->INVOICE_USE_SITUATION) ? 0 : 1', 'visible'=>-1, 'position'=>240), - 'retained_warranty' =>array('type'=>'double', 'label'=>'Retained warranty', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>245), - 'retained_warranty_date_limit' =>array('type'=>'date', 'label'=>'Retained warranty date limit', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>250), - 'retained_warranty_fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Retained warranty fk cond reglement', 'enabled'=>'$conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>255), + 'retained_warranty' =>array('type'=>'double', 'label'=>'Retained warranty', 'enabled'=>'$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>245), + 'retained_warranty_date_limit' =>array('type'=>'date', 'label'=>'Retained warranty date limit', 'enabled'=>'$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>250), + 'retained_warranty_fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Retained warranty fk cond reglement', 'enabled'=>'$conf->global->INVOICE_USE_RETAINED_WARRANTY', 'visible'=>-1, 'position'=>255), 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermsCode', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>260), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermsLocation', 'enabled'=>'$conf->incoterm->enabled', 'visible'=>-1, 'position'=>265), 'date_pointoftax' =>array('type'=>'date', 'label'=>'DatePointOfTax', 'enabled'=>'$conf->global->INVOICE_POINTOFTAX_DATE', 'visible'=>-1, 'position'=>270), @@ -4606,6 +4606,42 @@ class Facture extends CommonInvoice return $hasDelay; } + /** + * Currently used for documents generation : to know if retained warranty need to be displayed + * @return bool + */ + function displayRetainedWarranty(){ + global $conf; + + // TODO : add a flag on invoices to store this conf : USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL + + // note : we dont need to test USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION because if $this->retained_warranty is not empty it's because it was set when this conf was active + + $displayWarranty = false; + if(!empty($this->retained_warranty)) { + $displayWarranty = true; + + if ($this->type == Facture::TYPE_SITUATION && !empty($conf->global->USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL)) { + // Check if this situation invoice is 100% for real + $displayWarranty = false; + if (!empty($this->situation_final)) { + $displayWarranty = true; + } elseif (!empty($this->lines) && $this->status == Facture::STATUS_DRAFT) { + // $object->situation_final need validation to be done so this test is need for draft + $displayWarranty = true; + + foreach ($this->lines as $i => $line) { + if ($line->product_type < 2 && $line->situation_percent < 100) { + $displayWarranty = false; + break; + } + } + } + } + } + + return $displayWarranty; + } /** * @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT) @@ -4621,7 +4657,7 @@ class Facture extends CommonInvoice $retainedWarrantyAmount = 0; // Billed - retained warranty - if ($this->type == Facture::TYPE_SITUATION) + if($this->type == Facture::TYPE_SITUATION && !empty($conf->global->USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL)) { $displayWarranty = true; // Check if this situation invoice is 100% for real @@ -4659,7 +4695,10 @@ class Facture extends CommonInvoice if ($rounding < 0){ $rounding=min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); - return round($retainedWarrantyAmount, 2); + } + + if($rounding>0){ + return round($retainedWarrantyAmount, $rounding); } return $retainedWarrantyAmount; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index b32d82a08cb..dc685c0a893 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -188,7 +188,7 @@ $arrayfields = array( 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); -if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) +if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) { $arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86); } @@ -1002,7 +1002,7 @@ if ($resql) $facturestatic->date_lim_reglement = $db->jdate($obj->datelimite); $facturestatic->note_public = $obj->note_public; $facturestatic->note_private = $obj->note_private; - if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_SITUATION_RETAINED_WARRANTY) + if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) { $facturestatic->retained_warranty = $obj->retained_warranty; $facturestatic->retained_warranty_date_limit = $obj->retained_warranty_date_limit; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index a9d1230fdec..5ab59275666 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1663,51 +1663,32 @@ class pdf_sponge extends ModelePDFFactures // Retained warranty - if (!empty($object->situation_final) && ($object->type == Facture::TYPE_SITUATION && (!empty($object->retained_warranty)))) + if ($object->displayRetainedWarranty()) { - $displayWarranty = false; + $pdf->SetTextColor(40, 40, 40); + $pdf->SetFillColor(255, 255, 255); - // Check if this situation invoice is 100% for real - if (!empty($object->situation_final)) { - $displayWarranty = true; - } - elseif (!empty($object->lines) && $object->status == Facture::STATUS_DRAFT) { - // $object->situation_final need validation to be done so this test is need for draft - $displayWarranty = true; - foreach ($object->lines as $i => $line) { - if ($line->product_type < 2 && $line->situation_percent < 100) { - $displayWarranty = false; - break; - } - } - } + $retainedWarranty = $object->getRetainedWarrantyAmount(); + $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty; - if ($displayWarranty) { - $pdf->SetTextColor(40, 40, 40); - $pdf->SetFillColor(255, 255, 255); + // Billed - retained warranty + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); - $retainedWarranty = $total_a_payer_ttc * $object->retained_warranty / 100; - $billedWithRetainedWarranty = $object->total_ttc - $retainedWarranty; + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); - // Billed - retained warranty - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFEVOLToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); + // retained warranty + $index++; + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); + $retainedWarrantyToPayOn = $outputlangs->transnoentities("PDFEVOLRetainedWarranty").' ('.$object->retained_warranty.'%)'; + $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("PDFEVOLtoPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; - // retained warranty - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $retainedWarrantyToPayOn = $outputlangs->transnoentities("PDFEVOLRetainedWarranty").' ('.$object->retained_warranty.'%)'; - $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("PDFEVOLtoPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; - - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); - } + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); } } } diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 447630e7eb2..bf641871be9 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -163,4 +163,6 @@ INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, desc INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('CANCELED', '50', 'Canceled', 1, 0, NULL); INSERT INTO llx_c_ticket_resolution (code, pos, label, active, use_default, description) VALUES('OTHER', '90', 'Other', 1, 0, NULL); -DELETE FROM llx_const WHERE name = __ENCRYPT('DONATION_ART885')__; \ No newline at end of file +DELETE FROM llx_const WHERE name = __ENCRYPT('DONATION_ART885')__; + +UPDATE llx_const SET name = 'INVOICE_USE_RETAINED_WARRANTY' WHERE name = 'INVOICE_USE_SITUATION_RETAINED_WARRANTY' diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 6d7c61784f7..fe33c173cea 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -220,6 +220,8 @@ UseSituationInvoices=Allow situation invoice UseSituationInvoicesCreditNote=Allow situation invoice credit note Retainedwarranty=Retained warranty RetainedwarrantyDefaultPercent=Retained warranty default percent +RetainedwarrantyOnlyForSituation=Make "retained warranty" available only for situation invoices +RetainedwarrantyOnlyForSituationFinal=On situation invoices the global "retained warranty" deduction is applied only on the final situation ToPayOn=To pay on %s toPayOn=to pay on %s RetainedWarranty=Retained Warranty