phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r320 - trunk/coprop/include


From: phpcompta-dev
Subject: [Phpcompta-dev] r320 - trunk/coprop/include
Date: Sun, 25 Mar 2012 22:12:50 +0200 (CEST)

Author: danydb
Date: 2012-03-25 22:12:50 +0200 (Sun, 25 Mar 2012)
New Revision: 320

Modified:
   trunk/coprop/include/appel_fond.inc.php
Log:
Coprop : Correction si balance incorrecte

Modified: trunk/coprop/include/appel_fond.inc.php
===================================================================
--- trunk/coprop/include/appel_fond.inc.php     2012-03-25 19:46:41 UTC (rev 
319)
+++ trunk/coprop/include/appel_fond.inc.php     2012-03-25 20:12:50 UTC (rev 
320)
@@ -34,46 +34,114 @@
 // Demande génération
 if (isset($calc))
 {
-    try
-    {
+       try
+       {
 
 // Génére écriture comptable dans journal choisi
-        switch ($aft)
-        {
-            case -1:
-                throw  new Exception("Choississez le type de calcul");
-                break;
-            case 1:
-                $appel_fond = new Coprop_Appel_Fond();
-                $appel_fond->compute_budget($_GET);
-                break;
-            case 2:
-                $appel_fond = new Coprop_Appel_Fond();
-                 $appel_fond->compute_amount($_GET);
-                break;
-        }
+               switch ($aft)
+               {
+                       case -1:
+                               throw new Exception("Choississez le type de 
calcul");
+                               break;
+                       case 1:
+                               $appel_fond = new Coprop_Appel_Fond();
+                               $appel_fond->compute_budget($_GET);
+                               break;
+                       case 2:
+                               $appel_fond = new Coprop_Appel_Fond();
+                               $appel_fond->compute_amount($_GET);
+                               break;
+               }
 
-        $appel_fond->display_ledger();
+               $appel_fond->display_ledger();
 
 
-        exit();
-    }
-    catch (Exception $e)
-    {
-        alert($e->getMessage());
-    }
+               exit();
+       }
+       catch (Exception $e)
+       {
+               alert($e->getMessage());
+       }
 }
 // correct
 
-if ( isset ($_POST['correct']))
+if (isset($_POST['correct']))
 {
        $appel_fond = new Coprop_Appel_Fond();
-       $appel_fond->id=$_POST['af_id'];
-       $ledger=new Acc_Ledger($cn,$_POST['p_jrn']);
+       $appel_fond->id = $_POST['af_id'];
+       $ledger = new Acc_Ledger($cn, $_POST['p_jrn']);
 
        echo '<FORM METHOD="GET" class="print">';
-               echo $ledger->input($_POST,0);
-               echo 
HtmlInput::request_to_hidden(array('amount','key','w_categorie_appel','b_id','aft','bud_pct','p_date','ac',
 'plugin_code','sa'));
+       echo $ledger->input($_POST, 0);
+       echo HtmlInput::request_to_hidden(array('amount', 'key', 
'w_categorie_appel', 'b_id', 'aft', 'bud_pct', 'p_date', 'ac', 'plugin_code', 
'sa'));
+       echo HtmlInput::extension() . dossier::hidden();
+       echo HtmlInput::hidden('action', 'confirm');
+       echo HtmlInput::hidden('af_id', $appel_fond->id);
+       echo HtmlInput::submit('save', 'Sauve');
+
+       echo HtmlInput::button('add', _('Ajout d\'une ligne'), 
'onClick="quick_writing_add_row()"');
+       echo '</form>';
+       echo '<div class="info">' .
+       _('Débit') . ' = <span id="totalDeb"></span>  ' .
+       _('Crédit') . ' = <span id="totalCred"></span>  ' .
+       _('Difference') . ' = <span id="totalDiff"></span></div> ';
+       echo "<script>checkTotalDirect();</script>";
+       echo '</div>';
+
+       exit();
+}
+// save
+if (isset($_POST['confirm']))
+{
+       try
+       {
+
+               $ledger = new Acc_Ledger($cn, $_POST['p_jrn']);
+               $ledger->with_concerned = false;
+               $ledger->save($_POST);
+               echo "<h2>Opération sauvée</h2>";
+               echo HtmlInput::detail_op($ledger->jr_id, $ledger->internal);
+               echo $ledger->input($_POST, 1);
+               $appel_fond = new Coprop_Appel_Fond();
+               $appel_fond->id = $_POST['af_id'];
+               $appel_fond->confirm();
+               exit();
+       }
+       catch (Exception $e)
+       {
+               alert($e->getMessage());
+
+               exit();
+       }
+}
+// Montre écran confirmation
+if (isset($_GET['save']))
+{
+       try
+       {
+               $ledger = new Acc_Ledger($cn, $_GET['p_jrn']);
+               $ledger->with_concerned = false;
+               $res = $ledger->input($_GET, 1);
+               echo '<form method="POST">';
+
+               echo HtmlInput::hidden('af_id', $_GET['af_id']);
+
+               echo $res;
+               echo HtmlInput::submit('confirm', 'Confirmer');
+               echo HtmlInput::submit('correct', 'Corriger');
+               echo '</form>';
+               exit();
+       }
+       catch (Exception $e)
+       {
+               alert($e->getMessage());
+               $appel_fond = new Coprop_Appel_Fond();
+               $appel_fond->id = $_GET['af_id'];
+               $ledger = new Acc_Ledger($cn, $_GET['p_jrn']);
+
+               echo '<FORM METHOD="GET" class="print">';
+               echo $ledger->input($_GET, 0);
+               echo HtmlInput::get_to_hidden(array('amount', 'key', 
'w_categorie_appel', 'b_id', 'aft', 'bud_pct', 'p_date', 'ac', 'plugin_code', 
'sa'));
                echo HtmlInput::extension() . dossier::hidden();
                echo HtmlInput::hidden('action', 'confirm');
                echo HtmlInput::hidden('af_id', $appel_fond->id);
@@ -87,61 +155,31 @@
                _('Difference') . ' = <span id="totalDiff"></span></div> ';
                echo "<script>checkTotalDirect();</script>";
                echo '</div>';
-
-       exit();
+               exit();
+       }
 }
-// save
-if ( isset($_POST['confirm']))
-{
-       $ledger=new Acc_Ledger($cn,$_POST['p_jrn']);
-       $ledger->with_concerned=false;
-       $ledger->save($_POST);
-       echo "<h2>Opération sauvée</h2>";
-       echo HtmlInput::detail_op($ledger->jr_id,$ledger->internal);
-       echo $ledger->input($_GET,1);
-       $appel_fond = new Coprop_Appel_Fond();
-       $appel_fond->id=$_POST['af_id'];
-       $appel_fond->confirm();
-       exit();
-}
-// Montre écran confirmation
-if ( isset ($_GET['save']))
-{
-       /**
-        address@hidden manque correction
-        */
-       echo '<form method="POST">';
-       $ledger=new Acc_Ledger($cn,$_GET['p_jrn']);
-       echo HtmlInput::hidden('af_id',$_GET['af_id']);
-       $ledger->with_concerned=false;
-       echo $ledger->input($_GET,1);
-       echo HtmlInput::submit('confirm','Confirmer');
-       echo HtmlInput::submit('correct','Corriger');
-       echo '</form>';
-       exit();
-}
 
 
 
 // Detail : propose de faire un appel de fond
 $date = new IDate('p_date');
-$date->value=HtmlInput::default_value('p_date',"",$_GET);
+$date->value = HtmlInput::default_value('p_date', "", $_GET);
 
 $amount = new INum('amount');
-$amount->value=HtmlInput::default_value('amount',0,$_GET);
+$amount->value = HtmlInput::default_value('amount', 0, $_GET);
 
 $ledger = new Acc_Ledger($cn, 0);
 $led_appel_fond = $ledger->select_ledger('ODS', 3);
-$led_appel_fond->selected = 
(isset($_GET['p_jrn']))?$_GET['p_jrn']:$g_copro_parameter->journal_appel;
+$led_appel_fond->selected = (isset($_GET['p_jrn'])) ? $_GET['p_jrn'] : 
$g_copro_parameter->journal_appel;
 
 $copro = new ICard();
 $categorie_appel = new ICard();
 $categorie_appel->label = " Appel de fond : " . HtmlInput::infobulle(0);
 $categorie_appel->name = "w_categorie_appel";
 $categorie_appel->tabindex = 1;
-$categorie_appel->value = 
isset($_GET['w_categorie_appel'])?$_GET['w_categorie_appel']:"";
+$categorie_appel->value = isset($_GET['w_categorie_appel']) ? 
$_GET['w_categorie_appel'] : "";
 $categorie_appel->table = 0;
-$categorie_appel->selected=(isset($_GET['key']))?$_GET['key']:-1;
+$categorie_appel->selected = (isset($_GET['key'])) ? $_GET['key'] : -1;
 
 // name of the field to update with the name of the card
 $categorie_appel->set_attribute('label', 'w_categorie_appel_label');
@@ -169,7 +207,7 @@
 
 $key = new ISelect("key");
 $key->value = $cn->make_array("select cr_id,cr_name from 
coprop.clef_repartition");
-$key->selected=HtmlInput::default_value('key',-1,$_GET);
+$key->selected = HtmlInput::default_value('key', -1, $_GET);
 
 $f_add_button = new IButton('add_card');
 $f_add_button->label = _('Nouvelle fiche ');
@@ -182,25 +220,25 @@
 // Budget
 $budget_sel = new ISelect("b_id");
 $budget_sel->value = $cn->make_array("select b_id,b_name from coprop.budget 
order by b_name");
-$budget_sel->selected=HtmlInput::default_value('b_id',-1,$_GET);
+$budget_sel->selected = HtmlInput::default_value('b_id', -1, $_GET);
 
 // pourcentage
 $budget_pct = new INum("bud_pct", 0);
-$budget_pct->value=HtmlInput::default_value('bud_pct',0,$_GET);
+$budget_pct->value = HtmlInput::default_value('bud_pct', 0, $_GET);
 
 // select between budget or amount
 $appel_fond_type = new ISelect("aft");
 $appel_fond_type->value = array(
-    array("value" => -1, 'label' => 'Faites votre choix'),
-    array("value" => 1, 'label' => 'Appel de fond par budget'),
-    array("value" => 2, 'label' => 'Appel de fond par montant')
+       array("value" => -1, 'label' => 'Faites votre choix'),
+       array("value" => 1, 'label' => 'Appel de fond par budget'),
+       array("value" => 2, 'label' => 'Appel de fond par montant')
 );
 $onchange = " onchange=\"appel_fond_show() \"";
 $appel_fond_type->javascript = $onchange;
-$appel_fond_type->selected=HtmlInput::default_value('aft',-1,$_GET);
+$appel_fond_type->selected = HtmlInput::default_value('aft', -1, $_GET);
 
 echo '<form method="get">';
-echo HtmlInput::request_to_hidden(array('ac', 'plugin_code', 'sa','gDossier'));
+echo HtmlInput::request_to_hidden(array('ac', 'plugin_code', 'sa', 
'gDossier'));
 require_once 'template/appel_fond.php';
 echo HtmlInput::submit('calc', "Calculer");
 echo '</form>';



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]