initialize wallet

This commit is contained in:
CHIEFSOFT\ameye
2023-11-11 07:22:22 -05:00
parent 0a18c32ef7
commit 0eb97ab4ad
@@ -742,8 +742,17 @@ long WrenchFamilyWallet(CVars in, CVars &out){
map<const char*, const char*>f = pgsql_fetch_assoc(res0, 0);
map_to_cvars(f, rec0);
family_member_id = rec0["family_member_id"].Long();
CVars vw;
if( load_db_record(vw, "SELECT c.code AS currency from members m LEFT JOIN currency c ON c.country = m.country WHERE m.id=%lu AND m.country IS NOT NULL",in["member_id"].Long())> 0 ){
logfmt(logINFO, "********~~~~~~~~ WrenchFamilyWallet() ------ CheckWallet() = %lu",parent_member_id);
// vw["currency"] = "NAIRA"; // this might become a variable based on the country
//vw["currency"].set_valid( true );
long wallet_id = CheckWallet(family_member_id,vw); // making sure we have a wallet
}
}
else{
out["error_msg"] ="member_family_wallet_not_found";
return 0;
}