noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 04/05: Task #1055 - Onglet dans confirmation


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 04/05: Task #1055 - Onglet dans confirmation VEN ACH ODS et FIN
Date: Tue, 25 Nov 2014 22:36:39 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit b7468ba6d371c1ce275b8e3257d923b065420154
Author: Dany De Bontridder <address@hidden>
Date:   Tue Nov 25 23:17:44 2014 +0100

    Task #1055 - Onglet dans confirmation VEN ACH ODS et FIN
---
 include/class_acc_ledger.php          |    7 ++--
 include/class_acc_ledger_fin.php      |    8 ++--
 include/class_acc_ledger_purchase.php |   36 +++++++++++++++++----
 include/class_acc_ledger_sold.php     |   57 +++++++++++++++++++-------------
 include/class_pre_operation.php       |    2 +-
 include/compta_ach.inc.php            |   38 ++++++++++++++++++----
 include/compta_ods.inc.php            |    5 ++-
 include/compta_ven.inc.php            |   37 +++++++++++++++++----
 include/operation_ods_confirm.inc.php |    4 ++
 9 files changed, 140 insertions(+), 54 deletions(-)

diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index 03c2097..728ee22 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -1482,7 +1482,8 @@ class Acc_Ledger extends jrn_def_sql
                                if (!isset(${'amount' . $i}))
                                        ${'amount' . $i} = '';
                        }
-                       $ret.="<tr>";
+                        $class=($i%2==0)?' class="even" ':' class="odd" ';
+                       $ret.="<tr $class> ";
                        if (trim(${'qc_' . $i}) != "")
                        {
                                $oqc = new Fiche($this->db);
@@ -1544,7 +1545,7 @@ class Acc_Ledger extends jrn_def_sql
 
                        $ret.="</tr>";
                }
-               $ret.=tr(td('') . td(_('Totaux')) . td($total_deb, 
'class="num"') . td($total_cred, 'class="num"'), 'class="footer"');
+               $ret.=tr(td('') . td(_('Totaux')) . td($total_deb, 
'class="num"') . td($total_cred, 'class="num"'), 'class="highlight"');
                $ret.="</table>";
                if ($g_parameter->MY_ANALYTIC != 'nu' && $p_readonly == false)
                        $ret.='<input type="button" class="button" value="' . 
_('verifie Imputation Analytique') . '" onClick="verify_ca(\'\');">';
@@ -3837,7 +3838,7 @@ class Acc_Ledger extends jrn_def_sql
         public function select_depot($p_readonly, $p_repo)
         {
             global $g_parameter;
-            $r='<div id="repo_div_id">';
+            $r='<div id="repo_div_id" style="height:185px;height:10rem;">';
             // Show the available repository
             if ($g_parameter->MY_STOCK=='Y')
             {
diff --git a/include/class_acc_ledger_fin.php b/include/class_acc_ledger_fin.php
index 8dc9423..bbea164 100644
--- a/include/class_acc_ledger_fin.php
+++ b/include/class_acc_ledger_fin.php
@@ -740,7 +740,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
                        $this->db->start();
                        $amount = 0.0;
                        $idx_operation = 0;
-                       $ret = '<table class="result" style="width:75%">';
+                       $ret = '<table class="result" >';
                        $ret.=tr(th('Date').th('n° interne') . th('Quick Code') 
. th('Nom') . th('Libellé') . th('Montant', ' style="text-align:right"'));
                        // Credit = goods
                        $get_solde=true;
@@ -889,7 +889,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
                                                {
                                                        // Add a "concerned 
operation to bound these op.together
                                                        //
-                            $rec = new Acc_Reconciliation($this->db);
+                                                        $rec = new 
Acc_Reconciliation($this->db);
                                                        $rec->set_jr_id($jr_id);
 
                                                        if (isNumber($rRapt) == 
1)
@@ -932,8 +932,8 @@ class Acc_Ledger_Fin extends Acc_Ledger
                                $js_detail = HtmlInput::detail_op($jr_id, 
$internal);
                                // Compute display
                                $row = td($e_date).td($js_detail) . 
td(${"e_other$i"}) . td($fPoste->strAttribut(ATTR_DEF_NAME)) . td(${"e_other" . 
$i . "_comment"}) . td(nbm(${"e_other$i" . "_amount"}), 'class="num"');
-
-                               $ret.=tr($row);
+                                $class=($i%2==0)?' class="even" ':' 
class="odd" ';
+                               $ret.=tr($row,$class);
 
 
                                if ($i == 0)
diff --git a/include/class_acc_ledger_purchase.php 
b/include/class_acc_ledger_purchase.php
index fbc100d..62e44d1 100644
--- a/include/class_acc_ledger_purchase.php
+++ b/include/class_acc_ledger_purchase.php
@@ -1393,7 +1393,6 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             $r.='<th style="text-align:right">' . _('Montant TVAC') . '</th>';
         } else {
             $r.='<th style="text-align:right">' . _('Montant') . '</th>';
-            $r.="<th style=\"text-align:right\">"._('quantité')."</th>";
         }
 
         /* if we use the AC */
@@ -1522,14 +1521,37 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             $r.='</tr>';
 
         }
-
+        // Add the sum
+        $decalage=($g_parameter->MY_TVA_USE == 
'Y')?'<td></td><td></td><td></td><td></td>':'<td></td>';
+         $tot = round(bcadd($tot_amount, $tot_tva), 2);
+        $tot_tva=nbm($tot_tva);
+        $tot=nbm($tot);
+        $str_tot=_('Totaux');
+        $tot_amount=nbm($tot_amount);
+        $r.=<<<EOF
+<tr class="highlight">
+    {$decalage}            
+     <td>
+                {$str_tot}
+     </td>
+    <td class="num">
+        {$tot_tva}
+    </td>
+    <td class="num">
+        {$tot_amount}
+    </td>
+    <td class="num">
+        {$tot_amount}
+    </td>
+EOF;
 
         $r.='</table>';
         $r.='</p>';
         if ( $g_parameter->MY_ANALYTIC!='nu' && !$p_summary) // use of AA
             $r.='<input type="button" class="button" value="'._('Vérifiez 
imputation analytique').'" onClick="verify_ca(\'\');">';
+        
+        $r.=(! $p_summary )?'<div id="total_div_id" 
style="float:right;width:30%;margin-top:50px;">':'<div>';
         $r.='<h2>Totaux</h2>';
-        $r.='<p class="decale">';
         $tot = round(bcadd($tot_amount, $tot_tva), 2);
         /* use VAT */
         if ($g_parameter->MY_TVA_USE == 'Y') {
@@ -1549,7 +1571,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
         } else {
             $r.='<br>Total '.hb(nbm($tot));
         }
-        $r.='</p>';
+        $r.='</div>';
         /*  Add hidden */
         $r.=HtmlInput::hidden('e_client',$e_client);
         $r.=HtmlInput::hidden('nb_item',$nb_item);
@@ -1584,8 +1606,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             $r.=HtmlInput::hidden("e_quant".$i,${"e_quant".$i});
 
         }
-       if ( ! $p_summary )
-            $r.=$this->extra_info();
+       
        // Show the available repository
         if ($g_parameter->MY_STOCK == 'Y') {
             $sel = HtmlInput::select_stock($this->db, 'repo', 'W');
@@ -1631,7 +1652,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
     public function extra_info()
     {
         $r="";
-        $r.='<h2> Facturation</h2>';
+        $r = '<div id="facturation_div_id" style="height:185px;height:10rem">';
         $r.='<p class="decale">';
         // check for upload piece
         $file=new IFile();
@@ -1656,6 +1677,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
         $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;
     }
 
diff --git a/include/class_acc_ledger_sold.php 
b/include/class_acc_ledger_sold.php
index 3d98b1f..1c5a44b 100644
--- a/include/class_acc_ledger_sold.php
+++ b/include/class_acc_ledger_sold.php
@@ -797,15 +797,38 @@ class Acc_Ledger_Sold extends Acc_Ledger {
 
             $r.='</tr>';
         } // end loop item
-
+        //
+        // Add the sum
+        $decalage=($g_parameter->MY_TVA_USE == 
'Y')?'<td></td><td></td><td></td><td></td>':'<td></td>';
+         $tot = round(bcadd($tot_amount, $tot_tva), 2);
+        $tot_tva=nbm($tot_tva);
+        $tot=nbm($tot);
+        $str_tot=_('Totaux');
+        $tot_amount=nbm($tot_amount);
+        $r.=<<<EOF
+<tr class="highlight">
+    {$decalage}            
+     <td>
+                {$str_tot}
+     </td>
+    <td class="num">
+        {$tot_tva}
+    </td>
+    <td class="num">
+        {$tot_amount}
+    </td>
+    <td class="num">
+        {$tot_amount}
+    </td>
+EOF;
 
         $r.='</table>';
         $r.='</p>';
         if ($g_parameter->MY_ANALYTIC != 'nu' && ! $p_summary) // use of AA
             $r.='<input type="button" class="button" value="' . _('Vérifiez 
Imputation Analytique') . '" onClick="verify_ca(\'\');">';
+        $r.=(! $p_summary )?'<div id="total_div_id" 
style="float:right;width:30%;margin-top:50px;">':'<div>';
         $r.='<h2>Totaux</h2>';
-        $r.='<p class="decale">';
-        $tot = round(bcadd($tot_amount, $tot_tva), 2);
+       
         /* use VAT */
         if ($g_parameter->MY_TVA_USE == 'Y') {
             $r.='<table>';
@@ -824,13 +847,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
         } else {
             $r.='<br>Total '.hb(nbm($tot));
         }
-       $r.='</p>';
-        if (!$p_summary) {
-            $r.=$this->extra_info();
-        }
-        
-     
-
+        $r.='</div>';
         /*  Add hidden */
         $r.=HtmlInput::hidden('e_client', $e_client);
         $r.=HtmlInput::hidden('nb_item', $nb_item);
@@ -849,18 +866,12 @@ class Acc_Ledger_Sold extends Acc_Ledger {
 
         $e_mp = (isset($e_mp)) ? $e_mp : 0;
         $r.=HtmlInput::hidden('e_mp', $e_mp);
-        // Show the available repository
-        if ($g_parameter->MY_STOCK == 'Y') {
-            $sel = HtmlInput::select_stock($this->db, 'repo', 'W');
-            $sel->readOnly = $p_summary;
-            if ($p_summary == true)
-                $sel->selected = $repo;
-            $r.='<h2>Dépôt</h2>';
-            $r.="<p class=\"decale\"> Dans le dépôt : ";
-            $r.=$sel->input();
-            $r.='</p>';
+        
+        if ( isset($repo) )  {
+            // Show the available repository
+            $r.= $this->select_depot($p_summary,$repo);
         }
-        /* Paid by */
+
         /* if the paymethod is not 0 and if a quick code is given */
         if ($e_mp != 0 && strlen(trim(${'e_mp_qcode_' . $e_mp})) != 0) {
             $r.=HtmlInput::hidden('e_mp_qcode_' . $e_mp, ${'e_mp_qcode_' . 
$e_mp});
@@ -900,8 +911,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
      */
 
     public function extra_info() {
-        $r = "";
-        $r.='<h2> Facturation</h2>';
+        $r = '<div id="facturation_div_id" style="height:185px;height:10rem">';
         // check for upload piece
         $file = new IFile();
         $file->table = 0;
@@ -926,6 +936,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
         $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;
     }
 
diff --git a/include/class_pre_operation.php b/include/class_pre_operation.php
index fd2bf21..69e8e4c 100644
--- a/include/class_pre_operation.php
+++ b/include/class_pre_operation.php
@@ -51,7 +51,7 @@ class Pre_operation
      * @return HTML  string
      */
     static function save_propose() {
-        $r="<h2>Modèle d'opération</h2>";
+        $r="";
         $r.= '<p class="decale">';
         $r.= "Donnez un nom pour sauver cette opération comme modèle <br>";
         $opd_name = new IText('opd_name');
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index 3e187b3..77a2ca7 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -62,24 +62,48 @@ if (isset($_POST['view_invoice']))
        if (!isset($correct))
        {
                echo '<div class="content">';
-                echo h1('Confirmation','');
-                echo_warning("Attention, cette opération n'est pas encore 
sauvée : vous devez encore confirmer");
+               echo '<div id="confirm_div_id" style="width: 47%; float: 
left;">';
+                echo h1(_("Confirmation"));
+                echo '</div>';
 
+                echo '<div id="warning_ven_id" class="notice" style="width: 
50%; margin-left: 0px; float: right;">';
+                echo h2(_("Attention, cette opération n'est pas encore sauvée 
: vous devez encore confirmer"),' class="notice"');
+                echo '</div>';
 
-               echo '<form enctype="multipart/form-data" method="post" 
class="print">';
+               echo '<div id="confirm_div_id" style="width: 100%; float: 
left;">';
+                echo '<form enctype="multipart/form-data" method="post" 
class="print">';
                echo dossier::hidden();
 
                echo $Ledger->confirm($_POST);
                echo HtmlInput::hidden('ac', $_REQUEST['ac']);
-               echo '<div style="clear:both">';
-
+                            ?>
+<div id="tab_id" >
+<ul class="tabs">
+    <li class="tabs_selected"><a href="javascript:void(0)" title="<?php echo 
_("Générer une facture ou charger un document")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';$('modele_div_id').hide();$('repo_div_id').hide();$('facturation_div_id').show();"><?php
 echo _('Facture')?></a></li>
+    <li class="tabs"> <a href="javascript:void(0)" title="<?php echo _("Choix 
du dépôt")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';$('modele_div_id').hide();$('facturation_div_id').hide();$('repo_div_id').show();">
 <?php echo _('Dépôt')?> </a></li>
+    <li class="tabs"> <a href="javascript:void(0)" title="<?php echo _("Modèle 
à sauver")?>"  
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';$('facturation_div_id').hide();$('repo_div_id').hide();$('modele_div_id').show()">
 <?php echo _('Modèle')?> </a></li>
+</ul>
+<?php
+               echo $Ledger->select_depot(false, -1);
+                echo $Ledger->extra_info();
+                
+                echo '<div id="modele_div_id" 
style="display:none;height:185px;height:10rem">';
                 echo Pre_operation::save_propose();
                 echo '</div>';
-               echo HtmlInput::submit("record", _("Enregistrement"), 
'onClick="return verify_ca(\'\');"');
+
+                echo HtmlInput::submit("record", _("Enregistrement"), 
'onClick="return verify_ca(\'\');"');
                echo HtmlInput::submit('correct', _("Corriger"));
                echo '</form>';
+               echo '</div>'; /* tab_id */
                echo '</div>';
-               echo '</div>';
+                ?>
+<script>
+    $('repo_div_id').hide();
+    $('modele_div_id').hide();
+</script>
+<?php
+            echo '</div>';
+            return;
 
                return;
        }
diff --git a/include/compta_ods.inc.php b/include/compta_ods.inc.php
index 0af21c0..70e6269 100644
--- a/include/compta_ods.inc.php
+++ b/include/compta_ods.inc.php
@@ -84,7 +84,7 @@ elseif (isset($_POST['summary']))
 elseif (isset($_POST['save']))
 {
        $array = $_POST;
-
+        echo '<div class="content">';
        try
        {
                $ledger->save($array);
@@ -98,7 +98,7 @@ elseif (isset($_POST['save']))
                printf('<a class="detail" style="display:inline" 
href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(), 
$ledger->internal);
 
                // show feedback
-               echo '<div id="jrn_name_div">'; echo '<h2 id="jrn_name" 
class="title"  style="display:inline">' . $ledger->get_name() . '</h2>'; echo 
'</div>';
+               echo '<div id="jrn_name_div">'; echo '<h2 id="jrn_name"  
style="display:inline">' . $ledger->get_name() . '</h2>'; echo '</div>';
                echo $ledger->confirm($_POST, true);
        }
        catch (Exception $e)
@@ -107,6 +107,7 @@ elseif (isset($_POST['save']))
                alert($e->getMessage());
                 $p_msg=$e->getMessage();
        }
+        echo '</div>';
        return;
 }
 return;
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index 0291246..52c48f7 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -71,23 +71,46 @@ $p_msg="";
         if ( ! isset($correct))
         {
             echo '<div class="content">';
-            echo h1(_("Confirmation"),'');
-            echo_warning(_("Attention, cette opération n'est pas encore sauvée 
: vous devez encore confirmer"));
 
+            echo '<div id="confirm_div_id" style="width: 47%; float: left;">';
+            echo h1(_("Confirmation"));
+            echo '</div>';
 
+            echo '<div id="warning_ven_id" class="notice" style="width: 50%; 
margin-left: 0px; float: right;">';
+            echo h2(_("Attention, cette opération n'est pas encore sauvée : 
vous devez encore confirmer"),' class="notice"');
+            echo '</div>';
+            
+            echo '<div id="confirm_div_id" style="width: 100%; float: left;">';
             echo '<form class="print" enctype="multipart/form-data" 
method="post">';
             echo dossier::hidden();
             echo $Ledger->confirm($_POST );
-                       echo HtmlInput::hidden('ac',$_REQUEST['ac']);
-           echo '<div style="clear:both">';
-            
+            echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+            ?>
+<div id="tab_id" >
+<ul class="tabs">
+    <li class="tabs_selected"><a href="javascript:void(0)" 
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';$('modele_div_id').hide();$('repo_div_id').hide();$('facturation_div_id').show();"><?php
 echo _('Facture')?></a></li>
+    <li class="tabs"> <a href="javascript:void(0)" 
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';$('modele_div_id').hide();$('facturation_div_id').hide();$('repo_div_id').show();">
 <?php echo _('Dépôt')?> </a></li>
+    <li class="tabs"> <a href="javascript:void(0)" 
onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';$('facturation_div_id').hide();$('repo_div_id').hide();$('modele_div_id').show()">
 <?php echo _('Modèle')?> </a></li>
+</ul>
+<?php
+            echo $Ledger->select_depot(false, -1);
+            echo $Ledger->extra_info();
+           echo '<div id="modele_div_id" 
style="display:none;height:185px;height:10rem">';
             echo Pre_operation::save_propose();
            echo '</div>';
+            
            echo HtmlInput::hidden('ac',$_REQUEST['ac']);
             echo 
HtmlInput::submit("record",_("Enregistrement"),'onClick="return 
verify_ca(\'\');"');
             echo HtmlInput::submit('correct',_("Corriger"));
             echo '</form>';
-
+            echo '</div>';
+            echo '</div>'; /* tab_id */
+?>
+<script>
+    $('repo_div_id').hide();
+    $('modele_div_id').hide();
+</script>
+<?php
             echo '</div>';
             return;
         }
@@ -132,7 +155,7 @@ $p_msg="";
             }
 
             /* Show button  */
-            echo '<h1 > Enregistrement </h1>';
+            echo '<h1 style="float:right;margin-right:20%"> Enregistrement 
</h1>';
 
             echo $Ledger->confirm($_POST,true);
             /* Show link for Invoice */
diff --git a/include/operation_ods_confirm.inc.php 
b/include/operation_ods_confirm.inc.php
index 872093f..e9e7a23 100644
--- a/include/operation_ods_confirm.inc.php
+++ b/include/operation_ods_confirm.inc.php
@@ -33,6 +33,10 @@ echo '<div id="jrn_name_div">';
 echo '<h2 id="jrn_name" style="display:inline">' . $ledger->get_name() . 
'</h2>';
 echo '</div>';
 
+echo '<div id="warning_ven_id" class="notice" style="width: 50%; margin-left: 
0px; float: right;">';
+echo h2(_("Attention, cette opération n'est pas encore sauvée : vous devez 
encore confirmer"),' class="notice"');
+echo '</div>';
+
 echo '<FORM METHOD="POST" class="print">';
 echo HtmlInput::request_to_hidden(array('ac'));
 echo $ledger->confirm($_POST,false);



reply via email to

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