fix cmd fourn no msg

This commit is contained in:
jpb 2021-07-21 08:26:41 +02:00
parent d61b831737
commit 32f9b1a556
2 changed files with 7 additions and 4 deletions

View File

@ -68,6 +68,7 @@ if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf-
if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier'))) {
$colspan++; // With this, there is a column move button
}
//print $object->element;
// Lines for extrafield
$objectline = null;
@ -674,16 +675,17 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
<?php
}
?>
<?php if ($this->table_element_line != 'commande_fournisseurdet' || $this->table_element_line == 'facture_fourn_det') { ?>
$("#date_start, #date_end").focusout(function()
{
if ( $(this).val() == '' && !$(this).hasClass("error") ) {
$(this).addClass('error');
}else{
$(this).removeClass('error');
}
});
<?php } ?>
/* When changing predefined product, we reload list of supplier prices required for margin combo */
$("#idprod, #idprodfournprice").change(function()
{
@ -712,8 +714,6 @@ if (!empty($usemargins) && $user->rights->margins->creer) {
function(data) {
console.log("Load unit price end, we got value "+data.price_ht);
// service and we setted mandatory_period to true
if (data.mandatory_period == 1 && data.type == 1 ) {
jQuery("#date_start").addClass("error");

View File

@ -184,12 +184,15 @@ if (($line->info_bits & 2) == 2) {
if (!$line->date_start || !$line->date_end) {
// show warning under line
// we need to fetch product associated to line for some test
if ($object->element != 'order_supplier'){
$res = $line->fetch_product();
if ($res > 0 ) {
if ($line->product->isService() && $line->product->isMandatoryPeriod()) {
print '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSet").'</span></div>';
}
}
}
}