$acc->recalculateAllParentAccounts(); // $acc->recalculateAllParentAccounts(); } */ redirect_header("bpartner.php?action=view&bpartner_id={$o->bpartner_id}", $pausetime, "Your data is saved, Create More Record."); //redirect_header("bpartner.php?action=edit&bpartner_id=$latest_id",$pausetime,"Your data is saved, the new id=$latest_id"); } else { $token = $s->createToken($tokenlife, "CREATE_BPARTNER"); $log->saveLog(0, $tablebpartner, $o->updatesql, "I", "F"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->bpartnergroupctrl = $ctrl->getSelectBPartnerGroup($o->bpartnergroup_id, 'Y', "onchange='getDefaultAccount(this.value)'"); $o->industryctrl = $ctrl->getSelectIndustry($o->industry_id, 'N'); $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N'); $o->termsctrl = $ctrl->getSelectTerms($o->terms_id, 'Y'); $o->taxctrl = $ctrl->getSelectTax($o->tax_id, 'Y'); if ($accountmoduleexist == true) { $o->debtoraccountsctrl = $ctrl->getSelectAccounts($o->debtoraccounts_id, 'Y', "onchange=''", "debtoraccounts_id", ""); $o->creditoraccountsctrl = $ctrl->getSelectAccounts($o->creditoraccounts_id, 'Y', "onchange=''", "creditoraccounts_id", ""); } else { $o->debtoraccountsctrl = "Accounting Module doesn't exist <input type='hidden' name='debtoraccounts_id' value=0>"; $o->creditoraccountsctrl = "Accounting Module doesn't exist <input type='hidden' name='creditoraccounts_id' value=0>"; } // $o->accountsctrl=$ctrl->getSelectAccounts($o->accounts_id,'Y',"onchange=''","accounts_id",""); $o->getInputForm("new", -1, $token); $o->showBPartnerTable("WHERE bpartner_id>0 and organization_id={$defaultorganization_id}", "ORDER BY defaultlevel,bp.bpartner_no,bpartner_name"); } } else { // if the token is not valid or the token is expired, it back to previous form with previous inputed data $token = $s->createToken($tokenlife, "CREATE_BPARTNER");