contract fix
This commit is contained in:
@@ -121,15 +121,15 @@ long WrenchContractStatus( CVars in, CVars &out )
|
||||
|
||||
case CONTRACT_ACCEPT_COMPLETE:
|
||||
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() CONTRACT_ACCEPT_COMPLETE" );
|
||||
ret = load_db_record( out, "SELECT * FROM members_jobs_contract WHERE status = %lu AND contract='%s' AND id=%lu "
|
||||
ret = load_db_record( out, "SELECT *, id AS job_id FROM members_jobs_contract WHERE status = %lu AND contract='%s' AND id=%lu "
|
||||
" AND member_id =%lu",CONTRACT_NOTIFY_COMPLETE,in["job_contract"].c_str(),in["contract_id"].Long(),in["member_id"].Long() );
|
||||
logfmt( logINFO, "~~~~ ~~~~~ WrenchContractStatus() ret 1 = %lu",ret );
|
||||
if (ret)
|
||||
if (ret && out["job_id"].Long() > 0 )
|
||||
{
|
||||
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_ACCEPT_COMPLETE, in["job_id"].Long() );
|
||||
pgsql_exec("UPDATE members_jobs_contract SET status = %lu,updated=now() WHERE id = %lu",CONTRACT_ACCEPT_COMPLETE, out["job_id"].Long() );
|
||||
// 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_ACCEPT_COMPLETE,in["contract_id"].Long(),in["member_id"].Long() ) )
|
||||
" AND member_id =%lu",CONTRACT_ACCEPT_COMPLETE,in["contract_id"].Long(),in["member_id"].Long() ) > 0 )
|
||||
{
|
||||
//let us do the accounting parts here now
|
||||
CVars y;
|
||||
@@ -145,7 +145,7 @@ long WrenchContractStatus( CVars in, CVars &out )
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
out["error_msg"] ="valid_contract_not_found";
|
||||
}
|
||||
//----------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user