Ejemplo n.º 1
0
        $o->document_no_to = $_POST['document_no_to'];
        $o->document_datefrom = $_POST['document_datefrom'];
        $o->document_dateto = $_POST['document_dateto'];
        $o->iscomplete = $_POST['iscomplete'];
        $o->accountsctrl = $simbizctrl->getSelectAccounts($o->accounts_id, 'Y', "", "accounts_id", "and (account_type<>2 AND account_type<>3)");
        $o->bpartneraccountsctrl = $simbizctrl->getSelectAccounts($o->bpartneraccounts_id, 'Y', "", "bpartneraccounts_id", "and ( account_type=2 or account_type=3)");
        $o->bpartnerctrl = $simbizctrl->getSelectBPartner($o->bpartner_id, 'Y', "", "bpartner_id", "", "N", "bpartner_id");
        $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'Y', 'currency_id', "", "");
        $o->showSearchForm();
        $o->showDebitCreditNoteTable($wherestr, "ORDER BY dcn.document_no");
        break;
    case "refreshbpartneraccounts":
        $bpartneraccounts_id = $_POST['bpartneraccounts_id'];
        include_once "class/Accounts.php";
        $acc = new Accounts();
        $acc->fetchAccounts($bpartneraccounts_id);
        if ($acc->account_type == 2) {
            $bpartnerctrl = $ctrl->getSelectBPartner(0, 'Y', "onchange='changeBPartner(this.value)'", "bpartner_id2", "and (debtoraccounts_id={$bpartneraccounts_id} and isdebtor=1)", "N", "bpartner_id2");
        } elseif ($acc->account_type == 3) {
            $bpartnerctrl = $ctrl->getSelectBPartner(0, 'Y', "onchange='changeBPartner(this.value)'", "bpartner_id2", "and (creditoraccounts_id={$bpartneraccounts_id} and iscreditor=1)", "N", "bpartner_id2");
        }
        echo <<<EOF
\t<script type="text/javascript">
\t\t\t//alert("{$o->bpartnerctrl}");\t
\t\tself.parent.document.getElementById('divbpartner').innerHtml="";
\t\t//alert(self.parent.document.getElementById('divbpartner').innerHTML);
\t\tself.parent.document.getElementById('divbpartner').innerHTML="{$bpartnerctrl}";

\t\tif({$acc->account_type} != 2 || {$acc->account_type} !=3)
\t\t\tself.parent.document.getElementById('bpartner_id').value=0;
\t</script>
Ejemplo n.º 2
0
     break;
 case "ajaxgetTaxInfo":
     include "../simbiz/class/Tax.php";
     $tax_id = $_REQUEST["tax_id"];
     $rowno = $_REQUEST["rowno"];
     $tax = new Tax();
     $tax->fetchTax($tax_id);
     $arr = array("rowno" => $rowno, "total_tax" => $tax->total_tax, "status" => 1);
     echo json_encode($arr);
     break;
 case "getAccountInfo":
     include "../simbiz/class/Accounts.php";
     $accounts_id = $_REQUEST["accounts_id"];
     $rowno = $_REQUEST["rowno"];
     $acc = new Accounts();
     $acc->fetchAccounts($accounts_id);
     $arr = array("rowno" => $rowno, "tax_id" => $acc->tax_id, "status" => 1);
     echo json_encode($arr);
     break;
     break;
 case "ajaxdelete":
     $o->payment_id = $_POST['payment_id'];
     echo "<?xml version='1.0' encoding='utf-8' ?><Result>";
     if (!$o->deletePayment($o->payment_id)) {
         echo "<status>0</status><detail><msg>Cannot delete this record due to internal error</msg></detail>";
     } else {
         echo "<status>1</status><detail><msg>C</msg></detail>";
     }
     echo "</Result>";
     break;
 default:
Ejemplo n.º 3
0
     $wherestr = $o->genWhereString();
     $o->showPaymentVoucherTable("WHERE f.paymentvoucher_id>0 and f.organization_id={$defaultorganization_id} {$wherestr}", "ORDER BY f.paymentvoucher_no");
     break;
 case "getaccountinfo":
     include "../simantz/class/SelectCtrl.inc.php";
     $ctrl = new SelectCtrl();
     include "../simbiz/class/SimbizSelectCtrl.inc.php";
     $simbizctrl = new SimbizSelectCtrl();
     $accounts_id = $_REQUEST['accounts_id'];
     echo $simbizctrl->getSelectBPartner(0, 'Y', "", "bpartner_id", " and (creditoraccounts_id ={$accounts_id} or debtoraccounts_id={$accounts_id})");
     die;
     break;
 case "checkisbank":
     include "../simbiz/class/Accounts.php";
     $acc = new Accounts();
     $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');
Ejemplo n.º 4
0
<?php

include "system.php";
include 'class/Accounts.php';
$o = new Accounts();
$action = $_REQUEST['action'];
$o->updated = date("Y-m-d H:i:s", time());
$o->updatedby = $xoopsUser->getVar("uid");
switch ($action) {
    case "ajaxfetch":
        if ($o->fetchAccounts($_REQUEST['accounts_id'])) {
            $o->returnAccountsXML();
        } else {
            echo "<xml><errortext>Cannot retrieve accounts_id:" . $_REQUEST['accounts_id'] . "</errortext></xml>";
        }
        break;
    case "ajaxgetaccounttree":
        echo $o->showChildAccountTree(0, 0);
        break;
    case "ajaxdelete":
        $o->accounts_id = $_POST['accounts_id'];
        if (!$o->deleteAccounts($o->accounts_id)) {
            echo "Warning! Cannot delete this account due to unknown reason.";
        } else {
            echo "Delete record successfully.";
        }
        break;
    case "ajaxsave":
        $o->accounts_id = $_POST['accounts_id'];
        $o->accounts_name = $_POST['accounts_name'];
        $o->defaultlevel = $_POST['defaultlevel'];