addDate(NULL, '+1 month', TRUE);
$TargetForMY = substr($TargetForMY,3);
}
$IsAdmin = $_SESSION['IsAdmin'] || $_SESSION['IsSubAdmin'];
$FixedCustomer = $_SESSION['IsCustomer'];
$FixedSubDealer = $_SESSION['IsSubDealer'];
$IsHasCustomer = ($FixedCustomer || $_SESSION['HasCustomer']);
$curMonth = date('n');
$curYear = date('Y');
$custMaxDay = 0;
if ($IsHasCustomer) {
$custRow = $classBusiLogic->getCustomerMDisp(2, $_SESSION['CustomerCd']);
if (!empty($custRow)) {
$MaxMonthlyTargetDate = strtotime($custRow[0]['MaxMonthlyTargetDate']);
if ($MaxMonthlyTargetDate !== FALSE && date('n',$MaxMonthlyTargetDate)==$curMonth && date('Y',$MaxMonthlyTargetDate)==$curYear) {
$custMaxDay = date('d', $MaxMonthlyTargetDate);
}
}
}
$custMaxDay = $custMaxDay==0 ? BusiLogic::SUBDEALERMAXDAY : $SUBDEALERMAXDAY;
?>