contract_id
This commit is contained in:
@@ -245,16 +245,16 @@ long WrenchContractStatus( CVars in, CVars &out )
|
|||||||
case CONTRACT_CANCEL_CONTRACT:
|
case CONTRACT_CANCEL_CONTRACT:
|
||||||
out["result"] = "CONTRACT_CANCEL_CONTRACT";
|
out["result"] = "CONTRACT_CANCEL_CONTRACT";
|
||||||
|
|
||||||
ret = load_db_record( out, "SELECT id AS job_id, * FROM members_jobs_contract "
|
ret = load_db_record( out, "SELECT id AS contract_id, * FROM members_jobs_contract "
|
||||||
" WHERE status IN (1,2) AND delivery_date < now() "
|
" WHERE status IN (1,2) AND delivery_date < now() "
|
||||||
" AND contract='%s' AND id=%lu AND member_id =%lu AND refund_date IS NULL",in["job_contract"].c_str(),in["contract_id"].Long(),in["member_id"].Long() );
|
" AND contract='%s' AND id=%lu AND member_id =%lu AND refund_date IS NULL",in["job_contract"].c_str(),in["contract_id"].Long(),in["member_id"].Long() );
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
if ( out["job_id"].Long() <0 ){
|
if ( out["contract_id"].Long() <0 ){
|
||||||
out["result"] = "General failure";
|
out["result"] = "General failure";
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_CANCEL_CONTRACT, out["job_id"].Long() );
|
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_CANCEL_CONTRACT, out["contract_id"].Long() );
|
||||||
// make sure the update was done
|
// make sure the update was done
|
||||||
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND member_id =%lu",CONTRACT_CANCEL_CONTRACT,in["contract_id"].Long(),in["member_id"].Long() ) )
|
if ( load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND id=%lu AND member_id =%lu",CONTRACT_CANCEL_CONTRACT,in["contract_id"].Long(),in["member_id"].Long() ) )
|
||||||
{
|
{
|
||||||
@@ -269,7 +269,7 @@ long WrenchContractStatus( CVars in, CVars &out )
|
|||||||
{ // if you reserve pauments
|
{ // if you reserve pauments
|
||||||
//char offer_code[15] = "";
|
//char offer_code[15] = "";
|
||||||
//GetOfferCode(offer_id, offer_code, sizeof (offer_code)); // this stamp the offer code directly in that call
|
//GetOfferCode(offer_id, offer_code, sizeof (offer_code)); // this stamp the offer code directly in that call
|
||||||
pgsql_exec("UPDATE members_jobs_contract SET updated = now(),payment_date=now(),refund_date=now() WHERE id = %lu",out["job_id"].Long());
|
pgsql_exec("UPDATE members_jobs_contract SET updated = now(),payment_date=now(),refund_date=now() WHERE id = %lu",out["contract_id"].Long());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user