/** * if an array if receive the keys are * p_date * p_depot * f_idX f_id * sg_codeX * sg_type0 * * @global $cn database connx * @param $p_array * if an array if receive the keys are * p_date * p_depot * f_idX f_id * sg_codeX * sg_type0 * @param $p_readonly true or false */ function input($p_array = null, $p_readonly = false) { global $cn; if ($p_array != null) { extract($p_array); } else { $p_date = ''; $p_motif = ''; $p_depot = 0; } $date = new IDate('p_date', $p_date); $date->setReadOnly($p_readonly); $motif = new IText('p_motif', $p_motif); $motif->setReadOnly($p_readonly); $motif->size = 80; $idepo = HtmlInput::select_stock($cn, "p_depot", "W"); $idepo->setReadOnly($p_readonly); if (count($idepo->value) == 0) { NoAccess(); die; } $idepo->selected = $p_depot; if ($p_readonly) { $nb = $row; } else { if (isset($row)) { $nb = $row > MAX_ARTICLE_STOCK ? $row : MAX_ARTICLE_STOCK; } else { $nb = MAX_ARTICLE_STOCK; } } for ($e = 0; $e < $nb; $e++) { //ATTR_DEF_STOCKfiche_ $sg_code[$e] = new ICard('sg_code' . $e); $sg_code[$e]->extra = "[sql] fd_id = 500000"; $sg_code[$e]->set_attribute("typecard", $sg_code[$e]->extra); $sg_code[$e]->set_attribute("label", "label" . $e); $sg_code[$e]->value = isset(${'sg_code' . $e}) ? ${'sg_code' . $e} : ''; $sg_quantity[$e] = new INum('sg_quantity' . $e); $sg_quantity[$e]->value = isset(${'sg_quantity' . $e}) ? ${'sg_quantity' . $e} : ''; $label[$e] = new ISpan("label{$e}"); if (trim($sg_code[$e]->value) != '') { $label[$e]->value = $cn->get_value("select vw_name from vw_fiche_attr where quick_code=\$1", array($sg_code[$e]->value)); } $sg_code[$e]->setReadOnly($p_readonly); $sg_quantity[$e]->setReadOnly($p_readonly); if (isset(${'sg_type' . $e})) { $sg_type[$e] = ${'sg_type' . $e} == 'c' ? 'OUT' : 'IN'; } if (isset(${'f_id' . $e})) { $fiche[$e] = new Fiche($this->cn, ${'f_id' . $e}); } } $select_exercice = new ISelect('p_exercice'); $select_exercice->value = $cn->make_array('select distinct p_exercice,p_exercice from parm_periode order by 1 desc'); require_once NOALYSS_INCLUDE . '/template/stock_inv.php'; }
$msg = ""; for ($i = 0; $i < count($ack); $i++) { $fiche = new Fiche($cn, $ack[$i]); if ($fiche->remove(true) == 1) { $msg .= "\n " . $fiche->strAttribut(ATTR_DEF_QUICKCODE); } } if ($msg != "") { echo '<div class="content">'; echo h2(_("Fiche non effacées"), ' class="error" '); echo '<p class="error">' . _(" Ces fiches n'ont pas été effacées ") . $msg; echo '</div>'; } } } else { echo NoAccess(); } } $sql = "select f_id from fiche "; if ($allcard == 1) { $cond = ""; } else { $cond = " where f.fd_id = " . sql_string($_GET['cat']); } // Create nav bar $max = $cn->get_value("select count(*) from fiche as f " . $cond); $step = $_SESSION['g_pagesize']; $page = isset($_GET['offset']) ? $_GET['page'] : 1; $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $bar = navigation_bar($offset, $max, $step, $page); $limit = $step == -1 ? "" : " limit " . $step;
die('Appel direct ne sont pas permis'); } global $g_failed, $g_succeed; require_once NOALYSS_INCLUDE . '/class_acc_ledger_fin.php'; bcscale(2); echo '<div class="content">'; $Ledger = new Acc_Ledger_Fin($cn, 0); if (!isset($_REQUEST['p_jrn'])) { $a = $Ledger->get_first('fin'); $Ledger->id = $a['jrn_def_id']; } else { $Ledger->id = $_REQUEST['p_jrn']; } $jrn_priv = $g_user->get_ledger_access($Ledger->id); if (isset($_GET["p_jrn"]) && $jrn_priv == "X") { NoAccess(); return; } //------------------------- // save //------------------------- if (isset($_POST['save'])) { if (trim($_POST['ext']) != '' && isset($_POST['op'])) { $array = $_POST['op']; $tot = 0; $cn->start(); for ($i = 0; $i < count($array); $i++) { $cn->exec_sql('update jrn set jr_pj_number=$1 where jr_id=$2', array($_POST['ext'], $array[$i])); $tot = bcadd($tot, $cn->get_value('select qf_amount from quant_fin where jr_id=$1', array($array[$i]))); } $diff = bcsub($_POST['end_extrait'], $_POST['start_extrait']);