</ul>
    <div id="modele_div_id">
        <?php 
echo Pre_operation::save_propose();
?>
    </div>
    <div id="reverse_div_id" style="display:none;height:185px;height:10rem">
    <?php 
$reverse_date = new IDate('reverse_date');
$reverse_ck = new ICheckBox('reverse_ck');
echo _('Extourne opération') . " " . $reverse_ck->input() . " ";
echo $reverse_date->input();
?>
    </div>
    <div id="document_div_id" style="display:none;height:185px;height:10rem">
      <?php 
$file = new IFile();
$file->table = 0;
echo '<p class="decale">';
echo _("Ajoutez une pièce justificative ");
echo $file->input("pj", "");
echo '</p>';
?>
    </div>
</div>
<?php 
echo HtmlInput::submit("save", _("Confirmer"));
echo HtmlInput::submit("correct", _("Corriger"));
?>
</FORM>
示例#2
0
</td>
</tr>
<tr>

<tr>
<td>
<?php 
echo _("Fichier");
$s = dossier::get();
echo '<A HREF="show_document_modele.php?md_id=' . $doc->md_id . '&' . $s . '">(fichier actuel)</a>';
?>
</td>
<td>
<?php 
$file = new IFile('doc');
echo $file->input();
?>
</td>
</tr>

<tr>
<td>
<?php 
echo _("Dernier numéro utilisé pour ce type de document");
?>
</td>
<td>
<?php 
$last = 0;
if ($cn->exist_sequence("seq_doc_type_" . $doc->md_type)) {
    $ret = $cn->get_array("select last_value,is_called from seq_doc_type_" . $doc->md_type);
 /**
  * @brief show the form for loading a template
  * @param p_action for the field action = destination url
  *
  *
  * @return string containing the forms
  */
 function form()
 {
     $r = '<p class="notice">';
     $r .= 'Veuillez introduire les mod&egrave;les servant à g&eacute;n&eacute;rer vos documents';
     $r .= '</p>';
     $r .= '<form enctype="multipart/form-data"  method="post">';
     $r .= dossier::hidden();
     // we need to add the sub action as hidden
     $h = new IHidden();
     $h->name = "sa";
     $h->value = "add_document";
     $r .= $h->input();
     $r .= '<table>';
     $t = new IText();
     $t->name = "md_name";
     $r .= "<tr><td> Nom </td><td>" . $t->input() . "</td>";
     $r .= "</tr>";
     $r .= "<tr><td>Catégorie de document </td>";
     $w = new ISelect();
     $w->name = "md_type";
     $w->value = $this->cn->make_array('select dt_id,dt_value from document_type order by dt_value');
     $r .= "<td>" . $w->input() . "</td></tr>";
     $r .= '<tr>';
     $r .= td(_('Affectation'));
     $waffect = new ISelect();
     $waffect->name = 'md_affect';
     $waffect->value = array(array('value' => 'ACH', 'label' => _('Uniquement journaux achat')), array('value' => 'VEN', 'label' => _('Uniquement journaux vente')), array('value' => 'GES', 'label' => _('Partie gestion')));
     $r .= td($waffect->input());
     $r .= '</tr>';
     $f = new IFile();
     $f->name = "doc";
     $r .= "<tr><td>fichier</td><td> " . $f->input() . "</td></tr>";
     $start = new IText();
     $start->name = "start_seq";
     $start->size = 9;
     $start->value = "0";
     $r .= "<tr><td> Numerotation commence a</td><td> " . $start->input() . "</td>";
     $r .= '<td class="notice">Si vous laissez &agrave; 0, la num&eacute;rotation ne changera pas, la prochaine facture sera n+1, n étant le n° que vous avez donn&eacute;</td>';
     $r .= "</tr>";
     $r .= '</table>';
     $r .= HtmlInput::submit('add_document', 'Ajout');
     $r .= "</form></p>";
     return $r;
 }
示例#4
0
    $wNom = new IText();
    $wNom->name = "database";
    $wNom->size = 30;
    echo '<td>' . $wNom->input() . '</td></tr>';
    echo '<tr><td>' . _("Type de backup") . " :" . '</td>';
    $chk = new IRadio();
    $chk->name = "t";
    $chk->value = "d";
    echo '<td> ' . $chk->input() . _("Dossier") . '</td>';
    echo '</tr><tr><td></td>';
    $chk->name = "t";
    $chk->value = "m";
    echo '<td>' . $chk->input() . _("Modele") . '</td>';
    echo '<tr>';
    $file = new IFile();
    $file->name = "file";
    $file->value = "mod";
    echo td(_('Fichier ')) . td($file->input());
    $desc = new ITextarea('desc');
    echo '</tr>';
    echo '</table>';
    echo "<p>Description </p>";
    $desc->heigh = 4;
    $desc->width = 60;
    echo $desc->input();
    echo '<p>';
    echo HtmlInput::submit("", _("Restauration"));
    echo '</p>';
    echo '</form>';
    echo '</div>';
}
示例#5
0
     $rap->id = 0;
     echo $rap->form(15);
     echo HtmlInput::submit("record", _("Sauve"));
     echo '</form>';
     echo '<span class="notice">' . _("Les lignes vides seront effacées") . '</span>';
     echo "</DIV>";
     echo '<DIV class="content">';
     echo '<form method="post" enctype="multipart/form-data">';
     echo '<h1> Importation</h1>';
     echo dossier::hidden();
     $rap->id = 0;
     $wUpload = new IFile();
     $wUpload->name = 'report';
     $wUpload->value = 'report_value';
     echo _('Importer ce rapport') . ' ';
     echo $wUpload->input();
     echo HtmlInput::submit("upload", _("Sauve"));
     echo '</form>';
     echo '<span class="notice">' . _("Les lignes vides seront effacées") . '</span>';
     echo "</DIV>";
 }
 if ($action == "view") {
     echo '<DIV class="content">';
     $rap->id = $_REQUEST['fr_id'];
     echo '<form method="post" style="display:inline">';
     $rap->load();
     echo h1($rap->name);
     echo $rap->form();
     echo HtmlInput::hidden("fr_id", $rap->id);
     echo HtmlInput::hidden("action", "record");
     echo HtmlInput::submit("update", _("Mise a jour"));
 public function extra_info()
 {
     $r = '<div id="facturation_div_id" style="height:185px;height:10rem">';
     // check for upload piece
     $file = new IFile();
     $file->table = 0;
     $r .= '<p class="decale">';
     $r .= _("Ajoutez une pièce justificative ");
     $r .= $file->input("pj", "");
     if ($this->db->count_sql("select md_id,md_name from document_modele where md_affect='VEN'") > 0) {
         $r .= _('ou générer une facture') . ' <input type="checkbox" name="gen_invoice" CHECKED>';
         // We propose to generate  the invoice and some template
         $doc_gen = new ISelect();
         $doc_gen->name = "gen_doc";
         $doc_gen->value = $this->db->make_array("select md_id,md_name " . " from document_modele where md_affect='VEN'");
         $r .= $doc_gen->input() . '<br>';
     }
     $r .= '<br>';
     $obj = new IText();
     $r .= _('Numero de bon de commande : ') . $obj->input('bon_comm') . '<br>';
     $r .= _('Autre information : ') . $obj->input('other_info') . '<br>';
     $r .= '</p>';
     $r .= '</div>';
     return $r;
 }
 public function confirm($p_array, $p_nothing = 0)
 {
     global $g_parameter, $g_user;
     $r = "";
     bcscale(2);
     extract($p_array);
     $pPeriode = new Periode($this->db);
     if ($this->check_periode() == true) {
         $pPeriode->p_id = $periode;
     } else {
         if (isDate($e_date) != null) {
             $pPeriode->find_periode($e_date);
         } else {
             $pPeriode->p_id = $g_user->get_periode();
         }
     }
     list($l_date_start, $l_date_end) = $pPeriode->get_date_limit();
     $exercice = $pPeriode->get_exercice();
     $r .= '';
     $r .= '<fieldset><legend>Banque, caisse </legend>';
     $r .= '<div id="jrn_name_div">';
     $r .= '<h2 id="jrn_name" style="display:inline">' . $this->get_name() . '</h2>';
     $r .= '</div>';
     $r .= '<TABLE  width="100%">';
     //  Date
     //--
     $r .= "<tr>";
     if ($chdate == 1) {
         $r .= '<td> Date : </td><td>' . $e_date;
     }
     // Periode
     //--
     $r .= "<td>";
     $r .= "Période comptable </td><td>";
     $r .= $l_date_start . ' - ' . $l_date_end;
     $r .= "</td>";
     $r .= "</tr>";
     // Ledger (p_jrn)
     //--
     $r .= '<tr>';
     $r .= '<td> Journal </td>';
     $this->id = $p_jrn;
     $r .= '<td>';
     $r .= h($this->get_name());
     $r .= '</td>';
     $r .= '</tr>';
     //retrieve bank name
     $bk_id = $this->get_bank();
     $fBank = new Fiche($this->db, $bk_id);
     $e_bank_account_label = $this->get_bank_name();
     $filter_year = "  j_tech_per in (select p_id from parm_periode where  p_exercice='" . $exercice . "')";
     $acc_account = new Acc_Account_Ledger($this->db, $fBank->strAttribut(ATTR_DEF_ACCOUNT));
     $asolde = $acc_account->get_solde_detail($filter_year);
     $deb = $asolde['debit'];
     $cred = $asolde['credit'];
     $solde = bcsub($deb, $cred);
     $new_solde = $solde;
     $r .= "<TR><td colspan=\"4\"> Banque ";
     $r .= $e_bank_account_label;
     $r .= "</TABLE>";
     $r .= '</fieldset>';
     $r .= '<div class="myfieldset"><h1 class="legend">Extrait de compte</h1>';
     //--------------------------------------------------
     // Saldo begin end
     //-------------------------------------------------
     $r .= '<table>';
     $r .= '<tr>';
     // Extrait
     //--
     $r .= tr('<td> Numéro d\'extrait</td>' . td(h($e_pj)));
     $r .= '<tr><td >Solde début extrait </td>';
     $r .= '<td style="num">' . nbm($first_sold) . '</td></tr>';
     $r .= '<tr><td>Solde fin extrait </td>';
     $r .= '<td style="num">' . nbm($last_sold) . '</td></tr>';
     $r .= '</table>';
     $r .= '<h1 class="legend">Opérations financières</h1>';
     //--------------------------------------------------
     // financial operation
     //-------------------------------------------------
     $r .= '<TABLE style="width:100%" id="fin_item">';
     $r .= "<TR>";
     if ($chdate == 2) {
         $r .= '<th>Date</th>';
     }
     $r .= "<th style=\"width:auto;text-align:left\" colspan=\"2\">Nom</TH>";
     $r .= "<th style=\"text-align:left\" >Commentaire</TH>";
     $r .= "<th style=\"text-align:right\">Montant</TH>";
     $r .= '<th colspan="2"> Op. Concern&eacute;e(s)</th>';
     /* if we use the AC */
     if ($g_parameter->MY_ANALYTIC != 'nu') {
         $anc = new Anc_Plan($this->db);
         $a_anc = $anc->get_list();
         $x = count($a_anc);
         /* set the width of the col */
         $r .= '<th colspan="' . $x . '">' . _('Compt. Analytique') . '</th>';
         /* add hidden variables pa[] to hold the value of pa_id */
         $r .= Anc_Plan::hidden($a_anc);
     }
     $r .= "</TR>";
     // Parse each " tiers"
     $tot_amount = 0;
     //--------------------------------------------------
     // For each items
     //--------------------------------------------------
     for ($i = 0; $i < $nb_item; $i++) {
         $tiers = isset(${"e_other" . $i}) ? ${"e_other" . $i} : "";
         if (strlen(trim($tiers)) == 0) {
             continue;
         }
         $tiers_label = "";
         $tiers_amount = round(${"e_other{$i}" . "_amount"}, 2);
         $tot_amount = bcadd($tot_amount, $tiers_amount);
         $tiers_comment = h(${"e_other{$i}" . "_comment"});
         // If $tiers has a value
         $fTiers = new Fiche($this->db);
         $fTiers->get_by_qcode($tiers);
         $tiers_label = $fTiers->strAttribut(ATTR_DEF_NAME);
         $r .= "<TR>";
         if ($chdate == 2) {
             $r .= td(${"dateop" . $i});
         }
         $r .= "<td>" . ${'e_other' . $i} . "</TD>";
         // label
         $r .= '<TD style="width:25%;border-bottom:1px dotted grey;">';
         $r .= $fTiers->strAttribut(ATTR_DEF_NAME);
         $r .= '</td>';
         // Comment
         $r .= '<td style="width:40%">' . $tiers_comment . '</td>';
         // amount
         $r .= '<td class="num">' . nbm($tiers_amount) . '</td>';
         // concerned
         $r .= '<td style="text-align:center">';
         if (${"e_concerned" . $i} != '') {
             $jr_internal = $this->db->get_array("select jr_internal from jrn where jr_id in (" . ${"e_concerned" . $i} . ")");
             $comma = "";
             for ($x = 0; $x < count($jr_internal); $x++) {
                 $r .= $comma . HtmlInput::detail_op(${"e_concerned" . $i}, $jr_internal[$x]['jr_internal']);
                 $comma = " , ";
             }
         }
         $r .= '</td>';
         // encode the pa
         if ($g_parameter->MY_ANALYTIC != 'nu' && preg_match("/^[6,7]/", $fTiers->strAttribut(ATTR_DEF_ACCOUNT)) == 1) {
             // show form
             $anc_op = new Anc_Operation($this->db);
             $null = $g_parameter->MY_ANALYTIC == 'op' ? 1 : 0;
             $r .= '<td>';
             $p_mode = 1;
             $p_array['pa_id'] = $a_anc;
             /* op is the operation it contains either a sequence or a jrnx.j_id */
             $r .= HtmlInput::hidden('op[]=', $i);
             $r .= $anc_op->display_form_plan($p_array, $null, $p_mode, $i, $tiers_amount);
             $r .= '</td>';
         }
         $r .= '</TR>';
     }
     $r .= "</TABLE>";
     // saldo
     $r .= '<br>Ancien solde = ' . $solde;
     $new_solde += $tot_amount;
     $r .= '<br>Nouveau solde = ' . $new_solde;
     $r .= '<br>Difference =' . $tot_amount;
     // check for upload piece
     $file = new IFile();
     $r .= "<br>Ajoutez une pi&egrave;ce justificative ";
     $r .= $file->input("pj", "");
     $r .= '</div>';
     //--------------------------------------------------
     // Hidden variables
     //--------------------------------------------------
     $r .= dossier::hidden();
     $r .= HtmlInput::hidden('p_jrn', $this->id);
     $r .= HtmlInput::hidden('nb_item', $nb_item);
     $r .= HtmlInput::hidden('last_sold', $last_sold);
     $r .= HtmlInput::hidden('first_sold', $first_sold);
     $r .= HtmlInput::hidden('e_pj', $e_pj);
     $r .= HtmlInput::hidden('e_pj_suggest', $e_pj_suggest);
     $r .= HtmlInput::hidden('e_date', $e_date);
     $mt = microtime(true);
     $r .= HtmlInput::hidden('mt', $mt);
     if (isset($periode)) {
         $r .= HtmlInput::hidden('periode', $periode);
     }
     $r .= dossier::hidden();
     $r .= HtmlInput::hidden('sa', 'n', 'chdate');
     for ($i = 0; $i < $nb_item; $i++) {
         $tiers = isset(${"e_other" . $i}) ? ${"e_other" . $i} : "";
         $r .= HtmlInput::hidden('e_other' . $i, $tiers);
         $r .= HtmlInput::hidden('e_other' . $i, $tiers);
         $r .= HtmlInput::hidden('e_other' . $i . '_comment', ${'e_other' . $i . '_comment'});
         $r .= HtmlInput::hidden('e_other' . $i . '_amount', ${'e_other' . $i . '_amount'});
         $r .= HtmlInput::hidden('e_concerned' . $i, ${'e_concerned' . $i});
         $r .= HtmlInput::hidden('dateop' . $i, ${'dateop' . $i});
         $r .= HtmlInput::hidden('chdate', $chdate);
     }
     return $r;
 }