$acc->fetchAccounts($_REQUEST["accounts_id"]); if ($acc->account_type == 4) { echo 1; } else { echo 0; } die; break; default: //and (account_type=4 or account_type=7) include "menu.php"; $xoTheme->addScript($url . '/modules/simantz/include/validatetext.js'); $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); $o->showJavascript(); $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y'); //$o->accounclassctrl=$ctrl->getAccClass(0,'N'); // $o->accountsfromctrl=$ctrl->getSelectAccounts(0,'Y',"onchange='reloadAccountFrom(this.value)'","accountsfrom_id",""); $o->accountsfromctrl = $simbizctrl->getSelectAccounts(0, 'Y', "onchange='reloadAccountFrom(this.value)'", "accountsfrom_id", ""); //$o->accountstoctrl=$ctrl->getSelectAccounts(0,'Y',"onchange='reloadAccountTo(this.value)'","accountsto_id",""); $o->currencyctrl = $ctrl->getSelectCurrency($defaultcurrency_id, 'N', "currency_id", "", "onchange='refreshCurrency(this.value)'"); // $o->bpartnerctrl=$ctrl->getSelectBPartner(0,'Y',"style='display:none' onchange='changePaidFrom(this.selectedIndex)'"); //echo "<input name='bpartner_id' value='0' type='hidden'>"; $o->preparedby = $xoopsUser->getVar("name"); $o->getInputForm("new", 0, $token); //$o->showPaymentVoucherTable("WHERE f.paymentvoucher_id>0 and f.organization_id=$defaultorganization_id","ORDER BY f.paymentvoucher_no limit 0,30"); $o->showPaymentVoucherTable("WHERE f.paymentvoucher_id>0 and f.organization_id={$defaultorganization_id} and f.iscomplete=0", "ORDER BY f.paymentvoucher_no"); break; } echo "</td>"; require XOOPS_ROOT_PATH . '/footer.php';
} if ($o->bpartnergroup_id == "") { $o->bpartnergroup_id = 0; } if ($o->currency_id == "") { $o->currency_id = 0; } $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); $o->bpartnergroupctrl = $bpctrl->getSelectBPartnerGroup($o->bpartnergroup_id, 'Y'); $o->industryctrl = $bpctrl->getSelectIndustry($o->industry_id, 'Y'); $o->groupctrl = $ctrl->getUserGroup($o->groupid, 'Y'); $o->pricelistctrl = "<input name='pricelist_id' value='0' type='hidden'>"; $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N'); $o->termsctrl = $bpctrl->getSelectTerms($o->terms_id, 'Y'); if ($issimbiz) { $o->debtoraccountsctrl = $simbizctrl->getSelectAccounts($o->debtoraccounts_id, 'Y', "onchange=''", "debtoraccounts_id", " and a.account_type=2 "); $o->creditoraccountsctrl = $simbizctrl->getSelectAccounts($o->creditoraccounts_id, 'Y', "onchange=''", "creditoraccounts_id", " and a.account_type=3 "); } else { $o->debtoraccountsctrl = "<input type='text' name='debtoraccounts_id' value='{$o->debtoraccounts_id}'>"; $o->creditoraccountsctrl = "<input type='text' name='creditoraccounts_id' value='{$o->creditoraccounts_id}'>"; } if ($issales) { $o->salespricelistctrl = '<select name="salespricelist_id" id="salespricelist_id">' . $simerpctrl->getSelectPriceList($o->salespricelist_id, 'Y', " AND issotrx=1 ") . '</select >'; } else { $o->salespricelistctrl = "Sales Module doesn't exist <input type='hidden' name='salespricelist_id' value='0'>"; } if ($ispurchase) { $o->purchasepricelistctrl = '<select name="purchasepricelist_id" id="purchasepricelist_id">' . $simerpctrl->getSelectPriceList($o->purchasepricelist_id, 'Y', " AND issotrx=0 ") . '</select >'; } else { $o->purchasepricelistctrl = "Purchase Module doesn't exist <input type='hidden' name='purchasepricelist_id' value='0'>"; }
$o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); //$o->debtoraccountsctrl=$ctrl->getSelectAccounts($o->debtoraccounts_id,'Y',"","debtoraccounts_id","AND placeholder=0 AND account_type =2"); //$o->creditoraccountsctrl=$ctrl->getSelectAccounts($o->creditoraccounts_id,'Y',"","creditoraccounts_id","AND placeholder=0 AND account_type =3"); $o->getInputForm("new", -1, $token); $o->showBPartnerGroupTable("WHERE g.bpartnergroup_id>0 and g.organization_id={$defaultorganization_id}", "ORDER BY g.defaultlevel,g.bpartnergroup_name"); } break; //when user request to edit particular organization //when user request to edit particular organization case "edit": if ($o->fetchBPartnerGroup($o->bpartnergroup_id)) { //create a new token for editing a form $token = $s->createToken($tokenlife, "CREATE_ACG"); $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y'); if ($issimbiz) { $o->debtoraccountsctrl = $simbizctrl->getSelectAccounts($o->debtoraccounts_id, 'Y', "", "debtoraccounts_id", "AND placeholder=0 AND account_type =2"); $o->creditoraccountsctrl = $simbizctrl->getSelectAccounts($o->creditoraccounts_id, 'Y', "", "creditoraccounts_id", "AND placeholder=0 AND account_type =3"); } else { $o->debtoraccountsctrl = "<input name='debtoraccounts_id' value='0'>"; $o->creditoraccountsctrl = "<input name='creditoraccounts_id' value='0'>"; } $o->getInputForm("edit", $o->bpartnergroup, $token); $o->showBPartnerGroupTable("WHERE g.bpartnergroup_id>0 and g.organization_id={$defaultorganization_id}", "ORDER BY g.defaultlevel,g.bpartnergroup_name"); } else { //if can't find particular organization from database, return error message redirect_header("bpartnergroup.php", 3, "Some error on viewing your bpartnergroup data, probably database corrupted"); } break; //when user press save for change existing organization data //when user press save for change existing organization data case "update":
$accapi = new AccountsAPI(); $result = $accapi->reverseBatch($o->batch_id); if ($result) { $o->iscomplete = 0; $o->batch_id = 0; $o->updateReceipt(); redirect_header("receipt.php?action=edit&receipt_id={$o->receipt_id}", $pausetime, "Record reactivated, transaction in accounts is reversed."); } else { redirect_header("receipt.php?action=edit&receipt_id={$o->receipt_id}", $pausetime, "<b style='color:red'>Receipt can't reactivated due to internal error.</b>"); } } break; case "showSearchForm": include "menu.php"; $o->iscomplete = ""; $o->accountsfromctrl = $simbizctrl->getSelectAccounts(0, 'Y', "", "accountsfrom_id", "and (account_type=1 OR account_type=2 OR account_type=3)"); //$o->accountstoctrl=$ctrl->getSelectAccounts(0,'Y',"","accountsto_id","and (account_type=4 or account_type=7)"); $o->currencyctrl = $ctrl->getSelectCurrency(0, 'Y'); $o->bpartnerctrl = $simbizctrl->getSelectBPartner(0, 'Y'); $o->showSearchForm(); break; case "search": include "menu.php"; $o->datefrom = $_POST['datefrom']; $o->dateto = $_POST['dateto']; $o->receiptfrom_no = $_POST['receiptfrom_no']; $o->receiptto_no = $_POST['receiptto_no']; $o->iscomplete = $_POST['iscomplete']; if ($o->currency_id == "") { $o->currency_id = 0; }