Esempio n. 1
0
         }
         //		$o->accountsctrl=$ctrl->getSelectAccounts($o->accounts_id,'Y',"onchange=''","accounts_id",$whereaccount,'Y');
         $o->getInputForm("edit", $o->bpartner, $token);
         //	$o->showBPartnerTable("WHERE bpartner_id>0 and organization_id=$defaultorganization_id AND bpartner_name LIKE '$filterstring%' AND isactive=1","ORDER BY defaultlevel,bpartner_name");
     } else {
         //if can't find particular organization from database, return error message
         redirect_header("bpartner.php", 3, "Some error on viewing your bpartner 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":
     if ($s->check(true, $token, "CREATE_BPARTNER")) {
         $o->updatedby = $xoopsUser->getVar('uid');
         //get current uid
         if ($o->updateBPartner()) {
             //if data save successfully
             /*			if($accountmoduleexist==true && 
             				$o->accounts_id>0 && 
             				(($o->openingbalance!=$o->previousopeningbalance) || ($o->previousaccounts_id!=$o->accounts_id))) {
             					include_once "../simbiz/class/Accounts.php";
             					include_once "../simbiz/class/Transaction.php";
             					$acc = new Accounts();
             					$effectedamt=$o->openingbalance-$o->previousopeningbalance;
             					//if change debtor
             
             					$acc->updateLastBalance($o->accounts_id,$o->openingbalance,$o->previousopeningbalance,$o->bpartner_id);
             					$acc->updateOpenBalance($o->accounts_id,$effectedamt);
             					$acc->updateOpeningBalanceAccount($o->openingbalance,$o->previousopeningbalance);
             					$acc->recalculateAllParentAccounts();
             				//	$acc->updateLastBalance($o->accounts_id,$effectedamt);