Ejemplo n.º 1
0
function SaveCostCode()
{
    $cc = new ACC_CostCodes();
    PdoDataAccess::FillObjectByArray($cc, $_POST);
    if (empty($_POST["IsBlockable"])) {
        $cc->IsBlockable = "NO";
    }
    $where = " cc.IsActive='YES' AND level1=?";
    $param = array($cc->level1);
    if ($cc->level2 * 1 > 0) {
        $where .= " AND level2=?";
        $param[] = $cc->level2;
    } else {
        $where .= " AND level2 is null";
    }
    if ($cc->level3 * 1 > 0) {
        $where .= " AND level3=?";
        $param[] = $cc->level3;
    } else {
        $where .= " AND level3 is null";
    }
    $dt = ACC_CostCodes::SelectCost($where, $param);
    if ($dt->rowCount() > 0) {
        $record = $dt->fetch();
        if ($record["CostID"] != $cc->CostID) {
            Response::createObjectiveResponse(false, 'کد حساب تکراری است');
            die;
        }
    }
    if ($cc->CostID == '') {
        $res = $cc->InsertCost();
    } else {
        $res = $cc->UpdateCost();
    }
    Response::createObjectiveResponse($res, $cc->popExceptionDescription());
    die;
}
Ejemplo n.º 2
0
<?php

//--------------------------
// developer:	Jafarkhani
// Date:        94.06
//--------------------------
require_once '../header.inc.php';
require_once 'baseinfo.class.php';
require_once '../global/ManageReport.class.php';
require_once inc_reportGenerator;
Manage_Report::BeginReport();
echo "<br><br>";
$dataTable = ACC_CostCodes::SelectCost(" 1=1 order by Costcode");
$rpg = new ReportGenerator();
$rpg->addColumn("کد حساب", "CostCode");
$rpg->addColumn("گروه حساب", "LevelTitle0");
$rpg->addColumn("حساب کل", "LevelTitle1");
$rpg->addColumn("معین", "LevelTitle2");
$rpg->addColumn("جزء معین", "LevelTitle3");
$rpg->mysql_resource = $dataTable;
$rpg->generateReport();
die;