- Sat Mar 11, 2017 9:32 am
#789698
Hii
I am generating case using script task, where i fetched some data from database based on Database condition i need to create case.
I need urgent help on that. here i am provide the above please fix this issues.
I am executing script using timercrop.php.
I am generating case using script task, where i fetched some data from database based on Database condition i need to create case.
I need urgent help on that. here i am provide the above please fix this issues.
I am executing script using timercrop.php.
Code: Select all
$db="60607910158b55173f0ab52027795788";
$rent_paymentid="30197143558ae849a59b648050874163";
$APP_UID=@@APPLICATION;
$current_date=getCurrentDate();
$property_status="Active";
$property_ownership="Rented";
$select = "select count(Property_id) as totalcount from Properties_master";
$count = executeQuery($select,$db);
if (is_array($result) and count($result) > 0)
$count= $result[1]['totalcount'];
$user=@@USER_LOGGED;
$current_date=getCurrentDate();
for($i=1;$i<=$count;$i++) {
$select_data= "select date(next_payment_date), previous_payment_status, previous_payment_not_acceptance_count,
escalation_percentage, escalation_Date,rent_amount, rent_frequency
from Properties_master
where property_status='$property_status' and property_ownership='$property_ownership' Order by Property_id Desc";
$result=executeQuery($select_data,$db);
if (is_array($result) and count($result) > 0)
$next_payment_date= $result[$i]['next_payment_date'];
$next_payment_date=date('Y-m-d', strtotime("$next_payment_date"));
$previous_payment_status = $result[$i]['previous_payment_status'];
$previous_payment_not_acceptance_count = $result[$i]['previous_payment_not_acceptance_count'];
$escalation_percentage = $result[$i]['escalation_percentage'];
$escalation_Date = $result[$i]['escalation_Date'];
$rent_amount = $result[$i]['rent_amount'];
$rent_frequency = $result[$i]['rent_frequency'];
/*
if ($escalation_percentage != NULL && strtotime($escalation_Date) == strtotime($current_date)) {
$escalation_percentage=$escalation_percentage/100;
$escalation_percentage=$escalation_percentage*$rent_amount;
$rent_amount=$rent_amount+$escalation_percentage;
}*/
if (strtotime($current_date) == strtotime($next_payment_date) && $previous_payment_status=="Accepted" &&
$previous_payment_not_acceptance_count=="0")
{
$newCaseId = PMFNewCase( @@PROCESS, $user, $rent_paymentid,
array("expected_rent_payment_date"=>"$next_payment_date") );
if ($newCaseId) {
executeQuery("UPDATE APPLICATION SET APP_STATUS='TO_DO' WHERE APP_UID='$newCaseId'");
}
}
else {
executeQuery("delete from app_cache_view where APP_UID='$APP_UID' AND APP_STATUS='DRAFT'");
die();
}
}