diff --git a/wrenchboard/email/JOB/job_offer_cancel.mailfile b/wrenchboard/email/JOB/job_offer_cancel.mailfile index 7834068f..9062056f 100644 --- a/wrenchboard/email/JOB/job_offer_cancel.mailfile +++ b/wrenchboard/email/JOB/job_offer_cancel.mailfile @@ -89,7 +89,7 @@ img {height: auto;}
- +
@@ -101,7 +101,7 @@ img {height: auto;} @@ -123,7 +123,7 @@ img {height: auto;} Offer ID @@ -180,7 +180,7 @@ img {height: auto;} @@ -201,7 +201,7 @@ img {height: auto;} @@ -210,12 +210,12 @@ img {height: auto;} @@ -235,7 +235,6 @@ img {height: auto;}
-

The offer below from a {{site_name}} with details below is canceled.

+

The offer below from a {{site_name}} with details below is canceled.

- {{offer_code}} + {{offer_code}}
- +
® {{site_name}} 2022
- You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. + You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
- Facebook + Facebook - Twitter + Twitter
- - + diff --git a/wrenchboard/email/JOB/job_offer_rejected.mailfile b/wrenchboard/email/JOB/job_offer_rejected.mailfile index 4d35ffba..bc7c3e2e 100644 --- a/wrenchboard/email/JOB/job_offer_rejected.mailfile +++ b/wrenchboard/email/JOB/job_offer_rejected.mailfile @@ -89,7 +89,7 @@ img {height: auto;}
- +
@@ -101,7 +101,7 @@ img {height: auto;} @@ -123,7 +123,7 @@ img {height: auto;} Offer ID @@ -187,7 +187,7 @@ img {height: auto;} @@ -208,7 +208,7 @@ img {height: auto;} @@ -217,12 +217,12 @@ img {height: auto;} @@ -241,8 +241,5 @@ img {height: auto;}
-

You have rejected the job offer from a {{site_name}} user with details below.

+

You have rejected the job offer from a {{site_name}} user with details below.

- {{offer_code}} + {{offer_code}}
- +
® {{site_name}} 2022
- You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us. + You received this email because a user sent a job to you from {{site_name}}. If you get this email in error, please contact us.
- Facebook + Facebook - Twitter + Twitter
- - - diff --git a/wrenchboard/src/shared_tool/email.cc b/wrenchboard/src/shared_tool/email.cc index cb54690b..1a3edea2 100644 --- a/wrenchboard/src/shared_tool/email.cc +++ b/wrenchboard/src/shared_tool/email.cc @@ -590,7 +590,7 @@ long job_email(long mailtype, CVars in, CVars &out) { case JOBS_OFFER_CANCEL_MAIL: - if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu AND o.status = 3", in["offer_id"].Long())) { + if (load_db_record(x, "SELECT o.*,to_char(o.expire, 'Day Mon dd, yyyy HH:MI AM') AS expire2,j.title,j.description,j.timeline_days,j.price FROM members_jobs_offer o LEFT JOIN members_jobs j ON j.id =o.job_id WHERE o.id = %lu ", in["offer_id"].Long())) { vars2form(x, form); form.LetStr("subject", "Job Offer Canceled"); form.LetStr("email", x["email"].c_str()); diff --git a/wrenchboard/src/shared_tool/jobs.cc b/wrenchboard/src/shared_tool/jobs.cc index 677ffd21..08c626f3 100644 --- a/wrenchboard/src/shared_tool/jobs.cc +++ b/wrenchboard/src/shared_tool/jobs.cc @@ -488,7 +488,7 @@ long WrenchConcludeJobsOffer(CVars in, CVars &out) { if (WrenchRefundoffer(y, out) == PHP_CREATED_OK) { pgsql_exec("UPDATE members_jobs_offer SET status = 4 WHERE id = %lu AND offer_code='%s' ", out["offer_id"].Long(), in["offer_code"].c_str()); // REFUND THE MONEY - job_email(JOBS_OFFER_CANCEL_MAIL, in, out); // the email will come from offer table + job_email(JOBS_OFFER_CANCEL_MAIL, y, out); // the email will come from offer table } } break; diff --git a/wrenchboard/src/shared_tool/payments.cc b/wrenchboard/src/shared_tool/payments.cc index dc7cca91..e388bf3c 100644 --- a/wrenchboard/src/shared_tool/payments.cc +++ b/wrenchboard/src/shared_tool/payments.cc @@ -662,9 +662,11 @@ long WrenchRefundoffer( CVars in, CVars &out ) } - long retDb2 = load_db_record( out, "SELECT * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id); + long retDb2 = load_db_record( out, "SELECT id AS current_payment_id, * FROM members_payments WHERE id =%lu AND what_offer = %lu AND member_id=%lu AND code = 'OFDPS' AND status = 1 AND flags = 4 AND confirmation IS NOT NULL",payment_id,offer_id,member_id); if (retDb2) { + long current_payment_id = out["current_payment_id"].Long(); + CVars x; x["member_id"] = in["member_id"]; x["member_id"].set_valid( true ); x["code"] = in["code"]; x["code"].set_valid( true ); @@ -683,13 +685,13 @@ long WrenchRefundoffer( CVars in, CVars &out ) ret = PHP_CREATED_OK; x["flags"] = FLAG_START; x["flags"].set_valid( true ); // done not completed yet // now generate the confirmation - // pgsql_exec("UPDATE members SET balance=balance + %lu WHERE id = %lu",x["amount"].Long() + x["fee"].Long(),in["member_id"].Long() ); char confirmation[15] = ""; Confirmation(payment_id, confirmation, sizeof (confirmation)); // this stamp the offer code directly in that call UpdateMemberWallet( member_id, wallet_id,x["amount"].Long(), payment_id); // correct this dont send amount x["flags"] = FLAG_OK; x["flags"].set_valid( true ); x["payment_id"] = payment_id; x["payment_id"].set_valid( true ); - pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id ); + pgsql_exec("UPDATE members_payments SET flags = %lu WHERE id = %lu",x["flags"].Long(),payment_id ); + pgsql_exec("UPDATE members_payments SET flags = 7 WHERE id = %lu",current_payment_id ); //pgsql_exec("UPDATE members_jobs_offer SET payment_id = %lu WHERE id = %lu",x["payment_id"].Long(),x["what_offer"].Long() ); load_db_record( out, "SELECT * FROM members_payments WHERE id = %lu ", payment_id ); } else {