Update card.php
new setting vars FICHINTER_USE_SERVICE_DURATION
This commit is contained in:
parent
2164729bad
commit
bcf9bdc92e
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
* Copyright (C) 201 Charlie Benke <charlies@patas-monkey.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -250,22 +251,12 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
|||||||
$prod->getMultiLangs();
|
$prod->getMultiLangs();
|
||||||
// We show if duration is present on service (so we get it)
|
// We show if duration is present on service (so we get it)
|
||||||
$prod->fetch($lines[$i]->fk_product);
|
$prod->fetch($lines[$i]->fk_product);
|
||||||
if ($prod->duration_value)
|
if ($prod->duration_value && $prod->duration_unit == 'h' && $conf->global->FICHINTER_USE_SERVICE_DURATION)
|
||||||
{
|
{
|
||||||
switch($prod->duration_unit)
|
$durationproduct=$prod->duration_value * 3600 * $lines[$i]->qty;
|
||||||
{
|
|
||||||
case 'h':
|
|
||||||
$durationproduct=$prod->duration_value * 3600 * $lines[$i]->qty;
|
|
||||||
break;
|
|
||||||
case 'd':
|
|
||||||
$durationproduct=$prod->duration_value * 3600 * 24 * $lines[$i]->qty;
|
|
||||||
break;
|
|
||||||
case 'w':
|
|
||||||
$durationproduct=$prod->duration_value * 3600 * 24 * 7 * $lines[$i]->qty;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
$durationproduct=3600;
|
||||||
$outputlangs = $langs;
|
$outputlangs = $langs;
|
||||||
$newlang='';
|
$newlang='';
|
||||||
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
|
||||||
@ -294,11 +285,11 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
|
|||||||
$date_intervention=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
|
$date_intervention=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
|
||||||
if ($product_type == 1)
|
if ($product_type == 1)
|
||||||
{ //service
|
{ //service
|
||||||
$duration = ($durationproduct ? $durationproduct : 3600);
|
$duration = $durationproduct;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //product
|
{ //product
|
||||||
$duration = 0;
|
$duration = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$predef = '';
|
$predef = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user