<?php
//共通
require_once '../../base/common.php';

$logger = new logger(basename(__FILE__));
$logger->info("===af241x_index_start===");
$logger->info('post', $_POST);

$assign_var["noeventClassHeader"] = "";
$assign_var["noeventClassBody"]   = "";

//POPUP
$assign_var["hasPopCucd"] = "1"; //afm03
$assign_var["hasPopCuscd"] = "1"; //afm02
$assign_var["hasPopJan"] = "1"; //afm02
$assign_var["hasPopKtktcd"] = "1"; //afm05
$assign_var["hasPopAf241x1"] = "1";  //伝票検索

$header = Array(
  "newmode" => "NEW",
  "r30" => "0", //0:伝票チェックしない
);
$valutil = new getValueUtil();

try {
  //総額得意先の単価入力 CUTAXCLS
  $ret994x = $valutil->getAxm994("CUTAXCLS");
  if ($ret994x == null) {
    $header["cutaxcls"] = "0";
  } else {
    if ($stringUtil->isEmpty($ret994x["r01"])) {
      $header["cutaxcls"] = "0";
    } else {
      $header["cutaxcls"] = $ret994x["r01"];
    }
  }

  //axm99r.kflg=r30
  $ret994x2 = $valutil->getAxm994("KFLG");
  if ($ret994x2 == null) {
    $header["r30"] = "0";  //伝票チェックしない
  } else {
    if ($stringUtil->isEmpty($ret994x2["r03"])) {
      $header["r30"] = "0";  //伝票チェックしない
    } else {
      $header["r30"] = substr($ret994x2["r03"],0,1);
    }
  }

} catch(userException $ue) {
  $assign_var["hasError"] = true;
  $assign_var["errorMsg"] = $ue->getMessage();
} catch(Exception $e) {
  $assign_var["hasError"] = true;
  $assign_var["errorMsg"] = $e->getMessage();
}

$assign_var["header"] = $header;
$logger->info("header", $header);

// 初期表示
$dataList = Array(
);
$obj = [];
array_push($dataList, $obj);

$logger->info("dataList", $dataList);
$assign_var["dataList"] = $dataList;

//Smartyへアサイン
$logger->info("assign_var",$assign_var);
$smarty->assign($assign_var);
$smarty->display("index");

$logger->info("=== af241x_index_end ===");
?>
