PM-2320 "Fix: Add DEL_RISK_DATE field in tables Delegation..." SOLVED
Issue:
El nuevo campo DEL_RISK_DATE no refleja la fecha correcta
Cause:
No se tiene de manera completa la formula para el calculo
de la fecha
Solution:
Se a completado la formula
This commit is contained in:
@@ -356,17 +356,18 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
$aCalendarUID = '';
|
$aCalendarUID = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
//use the dates class to calculate dates
|
//Calendar - Use the dates class to calculate dates
|
||||||
$calendar = new calendar();
|
$calendar = new calendar();
|
||||||
|
|
||||||
$arrayCalendarData = array();
|
$arrayCalendarData = array();
|
||||||
|
|
||||||
if ($calendar->pmCalendarUid == "") {
|
if ($calendar->pmCalendarUid == "") {
|
||||||
$calendar->getCalendar(null, $task->getProUid(), $this->getTasUid());
|
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
|
||||||
|
|
||||||
$arrayCalendarData = $calendar->getCalendarData();
|
$arrayCalendarData = $calendar->getCalendarData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Due date
|
||||||
/*$iDueDate = $calendar->calculateDate( $this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT'] //hours or days, ( we only accept this two types or maybe weeks
|
/*$iDueDate = $calendar->calculateDate( $this->getDelDelegateDate(), $aData['TAS_DURATION'], $aData['TAS_TIMEUNIT'] //hours or days, ( we only accept this two types or maybe weeks
|
||||||
);*/
|
);*/
|
||||||
$dueDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $aData["TAS_DURATION"], $aData["TAS_TIMEUNIT"], $arrayCalendarData);
|
$dueDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $aData["TAS_DURATION"], $aData["TAS_TIMEUNIT"], $arrayCalendarData);
|
||||||
@@ -378,10 +379,22 @@ class AppDelegation extends BaseAppDelegation
|
|||||||
public function calculateRiskDate($dueDate, $risk)
|
public function calculateRiskDate($dueDate, $risk)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$numDueDate = strtotime($dueDate); //Seconds
|
$riskTime = strtotime($dueDate) - strtotime($this->getDelDelegateDate()); //Seconds
|
||||||
$numDueDate = $numDueDate - ($numDueDate * $risk);
|
$riskTime = $riskTime - ($riskTime * $risk);
|
||||||
|
|
||||||
$riskDate = date("Y-m-d H:i:s", round($numDueDate));
|
//Calendar - Use the dates class to calculate dates
|
||||||
|
$calendar = new calendar();
|
||||||
|
|
||||||
|
$arrayCalendarData = array();
|
||||||
|
|
||||||
|
if ($calendar->pmCalendarUid == "") {
|
||||||
|
$calendar->getCalendar(null, $this->getProUid(), $this->getTasUid());
|
||||||
|
|
||||||
|
$arrayCalendarData = $calendar->getCalendarData();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Risk date
|
||||||
|
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), round($riskTime / (60 * 60)), "HOURS", $arrayCalendarData);
|
||||||
|
|
||||||
//Return
|
//Return
|
||||||
return $riskDate;
|
return $riskDate;
|
||||||
|
|||||||
Reference in New Issue
Block a user