[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5167 - in phpcompta/tags/rel650: doc include include/te
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5167 - in phpcompta/tags/rel650: doc include include/template sql |
Date: |
Sat, 8 Dec 2012 23:48:31 +0100 (CET) |
Author: danydb
Date: 2012-12-08 23:48:30 +0100 (Sat, 08 Dec 2012)
New Revision: 5167
Added:
phpcompta/tags/rel650/include/template/operation_detail_ach.php
phpcompta/tags/rel650/include/template/operation_detail_fin.php
phpcompta/tags/rel650/include/template/operation_detail_misc.php
phpcompta/tags/rel650/include/template/operation_detail_ven.php
Modified:
phpcompta/tags/rel650/doc/manuel-fr.odt
phpcompta/tags/rel650/include/class_acc_ledger.php
phpcompta/tags/rel650/include/impress_jrn.inc.php
phpcompta/tags/rel650/include/template/ledger_detail_ach.php
phpcompta/tags/rel650/sql/upgrade.sql
Log:
Ajout IMPJRN, d?\195?\169tail op?\195?\169ration
Modified: phpcompta/tags/rel650/doc/manuel-fr.odt
===================================================================
(Binary files differ)
Modified: phpcompta/tags/rel650/include/class_acc_ledger.php
===================================================================
--- phpcompta/tags/rel650/include/class_acc_ledger.php 2012-12-08 20:30:44 UTC
(rev 5166)
+++ phpcompta/tags/rel650/include/class_acc_ledger.php 2012-12-08 22:48:30 UTC
(rev 5167)
@@ -545,7 +545,7 @@
jrn_def_type,
jrn.jr_tech_per
FROM jrn join jrn_def on (jrn_def_id=jr_def_id)
- WHERE $periode $jrn order by jr_date $cond_limite";
+ WHERE $periode $jrn order by
jr_date,substring(jrn.jr_pj_number,'\\\d+$')::numeric asc $cond_limite";
$Res = $this->db->exec_sql($sql);
$Max = Database::num_row($Res);
Modified: phpcompta/tags/rel650/include/impress_jrn.inc.php
===================================================================
--- phpcompta/tags/rel650/include/impress_jrn.inc.php 2012-12-08 20:30:44 UTC
(rev 5166)
+++ phpcompta/tags/rel650/include/impress_jrn.inc.php 2012-12-08 22:48:30 UTC
(rev 5167)
@@ -1,4 +1,5 @@
<?php
+
/*
* This file is part of PhpCompta.
*
@@ -15,10 +16,10 @@
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ */
/* $Revision$ */
// Copyright Author Dany De Bontridder address@hidden
-/*! \file
+/* ! \file
* \brief ask for Printing the ledger (pdf,html)
*/
@@ -28,32 +29,34 @@
require_once('class_exercice.php');
require_once('class_dossier.php');
load_all_script();
-$gDossier=dossier::id();
+$gDossier = dossier::id();
global $g_user;
//-----------------------------------------------------
// Show the jrn and date
//-----------------------------------------------------
require_once('class_database.php');
-if ( $g_user->Admin() == 0 && $g_user->is_local_admin()==0)
+if ($g_user->Admin() == 0 && $g_user->is_local_admin() == 0)
{
- $sql="select jrn_def_id,jrn_def_name
+ $sql = "select jrn_def_id,jrn_def_name
from jrn_def join jrn_type on jrn_def_type=jrn_type_id
join user_sec_jrn on uj_jrn_id=jrn_def_id
where
uj_login='$g_user->login'
and uj_priv in ('R','W')
+ order by jrn_def_name
";
- $ret=$cn->make_array($sql);
+ $ret = $cn->make_array($sql);
}
else
{
- $ret=$cn->make_array("select jrn_def_id,jrn_def_name
- from jrn_def join jrn_type on
jrn_def_type=jrn_type_id");
-
+ $ret = $cn->make_array("select jrn_def_id,jrn_def_name
+ from jrn_def join jrn_type on jrn_def_type=jrn_type_id
+ order by jrn_def_name
+ ");
}
// Count the forbidden journaux
-$NoPriv=$cn->count_sql("select
jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
+$NoPriv = $cn->count_sql("select
jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv,
jrn_deb_max_line,jrn_cred_max_line
from jrn_def join jrn_type on jrn_def_type=jrn_type_id
join user_sec_jrn on uj_jrn_id=jrn_def_id
@@ -62,15 +65,15 @@
and uj_priv ='X'
");
// Pour voir tout les journal ?
-if ( $NoPriv == 0 && $ret != null )
+if ($NoPriv == 0 && $ret != null)
{
- $a=count($ret);
- $all=array('value'=>0,'label'=>'Tous les journaux');
- $ret[$a]=$all;
+ $a = count($ret);
+ $all = array('value' => 0, 'label' => 'Tous les journaux');
+ $ret[$a] = $all;
}
-if ( count($ret) < 1 )
- NoAccess();
-$exercice=(isset($_GET['exercice']))?$_GET['exercice']:$g_user->get_exercice();
+if (count($ret) < 1)
+ NoAccess();
+$exercice = (isset($_GET['exercice'])) ? $_GET['exercice'] :
$g_user->get_exercice();
//-----------------------------------------------------
// Form
@@ -79,56 +82,58 @@
/*
* Let you change the exercice
*/
-echo '<fieldset><legend>'._('Choississez un autre exercice').'</legend>';;
+echo '<fieldset><legend>' . _('Choississez un autre exercice') . '</legend>';
+;
echo '<form method="GET">';
echo 'Choississez un autre exercice :';
-$ex=new Exercice($cn);
-$wex=$ex->select('exercice',$exercice,' onchange="submit(this)"');
+$ex = new Exercice($cn);
+$wex = $ex->select('exercice', $exercice, ' onchange="submit(this)"');
echo $wex->input();
echo dossier::hidden();
-echo HtmlInput::get_to_hidden(array('ac','type'));
+echo HtmlInput::get_to_hidden(array('ac', 'type'));
echo '</form>';
echo '</fieldset>';
-echo '<FORM METHOD="GET">'.dossier::hidden();
-echo HtmlInput::get_to_hidden(array('ac','type'));
-echo HtmlInput::hidden('type','jrn');
+echo '<FORM METHOD="GET">' . dossier::hidden();
+echo HtmlInput::get_to_hidden(array('ac', 'type'));
+echo HtmlInput::hidden('type', 'jrn');
echo HtmlInput::get_to_hidden(array('exercice'));
echo '<TABLE ><TR>';
-$w=new ISelect();
-$w->table=1;
-$label="Choississez le journal";
-$w->selected=(isset($_GET['jrn_id']))?$_GET['jrn_id']:'';
-print td($label).$w->input("jrn_id",$ret);
+$w = new ISelect();
+$w->table = 1;
+$label = "Choississez le journal";
+$w->selected = (isset($_GET['jrn_id'])) ? $_GET['jrn_id'] : '';
+print td($label) . $w->input("jrn_id", $ret);
print '</TR>';
print '<TR>';
// filter on the current year
-$filter_year=" where p_exercice='".sql_string($exercice)."'";
+$filter_year = " where p_exercice='" . sql_string($exercice) . "'";
-$periode_start=$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') from
parm_periode $filter_year order by p_start,p_end");
-$w->selected=(isset($_GET['from_periode']))?$_GET['from_periode']:'';
-print td('Depuis').$w->input('from_periode',$periode_start);
+$periode_start = $cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY')
from parm_periode $filter_year order by p_start,p_end");
+$w->selected = (isset($_GET['from_periode'])) ? $_GET['from_periode'] : '';
+print td('Depuis') . $w->input('from_periode', $periode_start);
print '</TR>';
print '<TR>';
-$periode_end=$cn->make_array("select p_id,to_char(p_end,'DD-MM-YYYY') from
parm_periode $filter_year order by p_start,p_end");
-$w->selected=(isset($_GET['to_periode']))?$_GET['to_periode']:'';
-print td('Jusque ').$w->input('to_periode',$periode_end);
+$periode_end = $cn->make_array("select p_id,to_char(p_end,'DD-MM-YYYY') from
parm_periode $filter_year order by p_start,p_end");
+$w->selected = (isset($_GET['to_periode'])) ? $_GET['to_periode'] : '';
+print td('Jusque ') . $w->input('to_periode', $periode_end);
print "</TR><TR>";
-$a=array(
- array('value'=>0,'label'=>'Ecriture comptable'),
- array('value'=>1,'label'=>'Liste opérations')
- );
-$w->selected=1;
+$a = array(
+ array('value' => 0, 'label' => 'Ecriture comptable'),
+ array('value' => 1, 'label' => 'Liste opérations'),
+ array('value' => 2, 'label' => 'Avec Détails opérations ')
+);
+$w->selected = 1;
print '</TR>';
print '<TR>';
-$w->selected=(isset($_GET['p_simple']))?$_GET['p_simple']:'';
-echo td('Style d\'impression').$w->input('p_simple',$a);
+$w->selected = (isset($_GET['p_simple'])) ? $_GET['p_simple'] : '';
+echo td('Style d\'impression') . $w->input('p_simple', $a);
print "</TR>";
echo '</TABLE>';
-print HtmlInput::submit('bt_html','Visualisation');
+print HtmlInput::submit('bt_html', 'Visualisation');
echo '</FORM>';
@@ -139,168 +144,239 @@
// First time in html
// after in pdf or cvs
//-----------------------------------------------------
-if ( isset( $_REQUEST['bt_html'] ) )
+if (isset($_REQUEST['bt_html']))
{
- require_once("class_acc_ledger.php");
+ require_once("class_acc_ledger.php");
- $d=var_export($_GET,true);
- $Jrn=new Acc_Ledger($cn,$_GET['jrn_id']);
- $Jrn->get_name();
+ $d = var_export($_GET, true);
+ $Jrn = new Acc_Ledger($cn, $_GET['jrn_id']);
+ $Jrn->get_name();
switch ($_GET['p_simple'])
{
case "0":
- $Row=$Jrn->get_row(
$_GET['from_periode'],$_GET['to_periode']);
+ $Row = $Jrn->get_row($_GET['from_periode'],
$_GET['to_periode']);
break;
case "1":
-
$Row=$Jrn->get_rowSimple($_GET['from_periode'],$_GET['to_periode']);
+ $Row = $Jrn->get_rowSimple($_GET['from_periode'],
$_GET['to_periode']);
break;
+ case "2":
+ $Row = $Jrn->get_rowSimple($_GET['from_periode'],
$_GET['to_periode']);
+ break;
default:
var_dump($_GET['p_simple']);
- die (__FILE__.":".__LINE__." error unknown style ");
+ die(__FILE__ . ":" . __LINE__ . " error unknown style
");
}
- $rep="";
- $hid=new IHidden();
- echo '<div class="content">';
- echo '<h2 class="info">'.h($Jrn->name).'</h2>';
- echo "<table>";
- echo '<TR>';
- echo '<TD><form method="GET" ACTION="?">'.dossier::hidden().
- $hid->input("type","jrn").$hid->input('p_action','impress')."</form></TD>";
+ $rep = "";
+ $hid = new IHidden();
+ echo '<div class="content">';
+ echo '<h2 class="info">' . h($Jrn->name) . '</h2>';
+ echo "<table>";
+ echo '<TR>';
+ if ($_GET['p_simple'] == 0 || $_GET['p_simple'] == 1)
+ {
+ echo '<TD><form method="GET" ACTION="?">' . dossier::hidden() .
+ $hid->input("type", "jrn") . $hid->input('p_action', 'impress')
. "</form></TD>";
- echo '<TD><form method="GET" ACTION="export.php">'.dossier::hidden().
- HtmlInput::submit('bt_pdf',"Export PDF").
- HtmlInput::hidden('act','PDF:ledger').
- $hid->input("type","jrn").
- $hid->input("jrn_id",$Jrn->id).
- $hid->input("from_periode",$_GET['from_periode']).
- $hid->input("to_periode",$_GET['to_periode']);
- echo $hid->input("p_simple",$_GET['p_simple']);
- echo HtmlInput::get_to_hidden(array('ac','type'));
- echo "</form></TD>";
+ echo '<TD><form method="GET" ACTION="export.php">' .
dossier::hidden() .
+ HtmlInput::submit('bt_pdf', "Export PDF") .
+ HtmlInput::hidden('act', 'PDF:ledger') .
+ $hid->input("type", "jrn") .
+ $hid->input("jrn_id", $Jrn->id) .
+ $hid->input("from_periode", $_GET['from_periode']) .
+ $hid->input("to_periode", $_GET['to_periode']);
+ echo $hid->input("p_simple", $_GET['p_simple']);
+ echo HtmlInput::get_to_hidden(array('ac', 'type'));
+ echo "</form></TD>";
- echo '<TD><form method="GET" ACTION="export.php">'.dossier::hidden().
- HtmlInput::submit('bt_csv',"Export CSV").
- HtmlInput::hidden('act','CSV:ledger').
- $hid->input("type","jrn").
- $hid->input("jrn_id",$Jrn->id).
- $hid->input("from_periode",$_GET['from_periode']).
- $hid->input("to_periode",$_GET['to_periode']);
- echo $hid->input("p_simple",$_GET['p_simple']);
- echo HtmlInput::get_to_hidden(array('ac','type'));
- echo "</form></TD>";
+ echo '<TD><form method="GET" ACTION="export.php">' .
dossier::hidden() .
+ HtmlInput::submit('bt_csv', "Export CSV") .
+ HtmlInput::hidden('act', 'CSV:ledger') .
+ $hid->input("type", "jrn") .
+ $hid->input("jrn_id", $Jrn->id) .
+ $hid->input("from_periode", $_GET['from_periode']) .
+ $hid->input("to_periode", $_GET['to_periode']);
+ echo $hid->input("p_simple", $_GET['p_simple']);
+ echo HtmlInput::get_to_hidden(array('ac', 'type'));
+ echo "</form></TD>";
+ }
echo '<td style="vertical-align:top">';
echo HtmlInput::print_window();
echo '</td>';
- echo "</TR>";
+ echo "</TR>";
- echo "</table>";
- if ( count($Jrn->row ) == 0
- && $Row==null)
- exit;
+ echo "</table>";
+ if (count($Jrn->row) == 0
+ && $Row == null)
+ exit;
- echo '<TABLE class="result">';
+
/////////////////////////////////////////////////////////////////////////////////////
// Ecriture comptable
/////////////////////////////////////////////////////////////////////////////////////
- if ( $_GET['p_simple'] == 0 )
- {
- // detailled printing
- //---
- foreach ( $Jrn->row as $op )
- {
- $class="";
- if ( $op['j_date'] != '' )
- {
- $class="odd";
- }
+ if ($_GET['p_simple'] == 0)
+ {
+ echo '<TABLE class="result">';
+ // detailled printing
+ //---
+ foreach ($Jrn->row as $op)
+ {
+ $class = "";
+ if ($op['j_date'] != '')
+ {
+ $class = "odd";
+ }
- echo "<TR class=\"$class\">";
+ echo "<TR class=\"$class\">";
- echo "<TD>".$op['j_date']."</TD>";
- echo "<TD >".$op['jr_pj_number']."</TD>";
+ echo "<TD>" . $op['j_date'] . "</TD>";
+ echo "<TD >" . $op['jr_pj_number'] . "</TD>";
- if ( $op['internal']!='')
- echo
"<TD>".HtmlInput::detail_op($op['jr_id'],$op['internal'])."</TD>";
- else
- echo td();
+ if ($op['internal'] != '')
+ echo "<TD>" .
HtmlInput::detail_op($op['jr_id'], $op['internal']) . "</TD>";
+ else
+ echo td();
- echo "<TD >".$op['poste']."</TD>".
- "<TD >".$op['description']."</TD>".
- "<TD
style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
- "<TD
style=\"text-align:right\">".nbm($op['cred_montant'])."</TD>".
- "</TR>";
- }// end loop
- } // if
+ echo "<TD >" . $op['poste'] . "</TD>" .
+ "<TD >" . $op['description'] . "</TD>" .
+ "<TD style=\"text-align:right\">" .
nbm($op['deb_montant']) . "</TD>" .
+ "<TD style=\"text-align:right\">" .
nbm($op['cred_montant']) . "</TD>" .
+ "</TR>";
+ }// end loop
+ echo "</table>";
+ // show the saldo
+
+ $solde = $Jrn->get_solde($_GET['from_periode'],
$_GET['to_periode']);
+ echo "solde débiteur:" . $solde[0] . "<br>";
+ echo "solde créditeur:" . $solde[1];
+ } // if
/////////////////////////////////////////////////////////////////////////////////////
// Liste opérations
/////////////////////////////////////////////////////////////////////////////////////
+ elseif ($_GET['p_simple'] == 1)
+ {
+ // Simple printing
+ //---
+ echo '<TABLE class="result">';
+ echo "<TR>" .
+ "<th> operation </td>" .
+ "<th>Date</th>" .
+ "<th> n° de pièce </th>" .
+ "<th>internal</th>" .
+ th('Tiers') .
+ "<th>Commentaire</th>" .
+ "<th>Total opération</th>" .
+ "</TR>";
+ // set a filter for the FIN
+ $i = 0;
+ foreach ($Row as $line)
+ {
+ $i++;
+ $class = ($i % 2 == 0) ? ' class="even" ' : '
class="odd" ';
+ echo "<tr $class>";
+ echo "<TD>" . $line['num'] . "</TD>";
+ echo "<TD>" . $line['date'] . "</TD>";
+ echo "<TD>" . h($line['jr_pj_number']) . "</TD>";
+ echo "<TD>" . HtmlInput::detail_op($line['jr_id'],
$line['jr_internal']) . "</TD>";
+ $tiers = $Jrn->get_tiers($line['jrn_def_type'],
$line['jr_id']);
+ echo td($tiers);
+ echo "<TD>" . h($line['comment']) . "</TD>";
- elseif ( $_GET['p_simple'] == 1 )
- {
- // Simple printing
- //---
- echo "<TR>".
- "<th> operation </td>".
- "<th>Date</th>".
- "<th> n° de pièce </th>".
- "<th>internal</th>".
- th('Tiers').
- "<th>Commentaire</th>".
- "<th>Total opération</th>".
- "</TR>";
- // set a filter for the FIN
+ // echo "<TD>".$line['pj']."</TD>";
+ // If the ledger is financial :
+ // the credit must be negative and written in red
+ // Get the jrn type
+ if ($line['jrn_def_type'] == 'FIN')
+ {
+ $positive = $cn->get_value("select qf_amount
from quant_fin where jr_id=$1", array($line['jr_id']));
+ if ($cn->count() == 0)
+ $positive = 1;
+ else
+ $positive = ($positive > 0) ? 1 : 0;
- foreach ($Row as $line)
- {
- echo "<tr>";
- echo "<TD>".$line['num']."</TD>";
- echo "<TD>".$line['date']."</TD>";
- echo "<TD>".h($line['jr_pj_number'])."</TD>";
- echo
"<TD>".HtmlInput::detail_op($line['jr_id'],$line['jr_internal'])."</TD>";
- $tiers=$Jrn->get_tiers($line['jrn_def_type'],$line['jr_id']);
- echo td($tiers);
- echo "<TD>".h($line['comment'])."</TD>";
+ echo "<TD align=\"right\">";
+ echo ( $positive == 0 ) ? "<font color=\"red\">
- " . nbm($line['montant']) . "</font>" : nbm($line['montant']);
+ echo "</TD>";
+ }
+ else
+ {
+ echo "<TD align=\"right\">" .
nbm($line['montant']) . "</TD>";
+ }
+ echo "</tr>";
+ }
+ echo "</table>";
+ }
+
/////////////////////////////////////////////////////////////////////////////////////
+ // Détaillé
+
/////////////////////////////////////////////////////////////////////////////////////
+ elseif ($_GET['p_simple'] == 2)
+ {
+ foreach ($Row as $line)
+ {
+ echo '<div
style="margin-top:2px;margin-bottom:10px;border:solid 1px black">';
+ $class = ' class="odd" style="font-stretch:
expanded;font-size:12px;"';
+ echo '<table class="result" style="font-weight:
bolder;font-variant: small-caps;width:100%;">';
+ echo "<tr $class>";
+ echo '<TD style="width:5%">' . $line['date'] . "</TD>";
+ echo '<TD style="width:10%">' .
h($line['jr_pj_number']) . "</TD>";
+ echo '<TD style="width:5%">' .
HtmlInput::detail_op($line['jr_id'], $line['jr_internal']) . "</TD>";
+ $tiers = $Jrn->get_tiers($line['jrn_def_type'],
$line['jr_id']);
+ $ledger_name = $cn->get_value("select jrn_def_name from
jrn_def where jrn_def_id=$1", array($line['jr_def_id']));
+ echo '<TD style="width:20%">' . h($ledger_name) . '
</td>';
+ echo '<TD style="width:20%">' . h($tiers) . ' </td>';
+ echo '<TD style="width:30%">' . h($line['comment']) .
"</TD>";
+ echo '<TD style="text-align:right">';
+ if ($line['jrn_def_type'] == 'FIN')
+ {
+ $positive = $cn->get_value("select qf_amount
from quant_fin where jr_id=$1", array($line['jr_id']));
+ if ($cn->count() == 0)
+ $positive = 1;
+ else
+ $positive = ($positive > 0) ? 1 : 0;
- // echo "<TD>".$line['pj']."</TD>";
- // If the ledger is financial :
- // the credit must be negative and written in red
- // Get the jrn type
- if ( $line['jrn_def_type'] == 'FIN' )
- {
- $positive = $cn->get_value("select qf_amount from quant_fin where
jr_id=$1",
- array($line['jr_id']));
- if ($cn->count() != 0)
- $positive = 1;
- else
- $positive = ($positive > 0)?1:0;
+ echo ( $positive == 0 ) ? "<font color=\"red\">
- " . nbm($line['montant']) . "</font>" : nbm($line['montant']);
+ }
+ else
+ {
+ echo nbm($line['montant']) ;
+ }
+ echo "</TD>";
+ echo "</tr>";
+ echo '</table>';
+
//////////////////////////////////////////////////////////////////////////////////////////////////////
+ // Add detail for each operation
+
//////////////////////////////////////////////////////////////////////////////////////////////////////
+ $op = new Acc_Operation($cn);
+ $op->jr_id = $line['jr_id'];
+ $op->get();
+ $obj = $op->get_quant();
+ switch ($obj->signature)
+ {
+ case 'FIN':
+ require
'template/operation_detail_fin.php';
+ break;
+ case 'ACH':
+ require
'template/operation_detail_ach.php';
+ break;
+ case 'VEN':
+ require
'template/operation_detail_ven.php';
+ break;
+ case 'ODS':
+ require
'template/operation_detail_misc.php';
+ break;
+ default:
+ die("unknown type of ledger");
+ break;
+ }
+ echo '</div>';
+ //echo '<div style="display:block;height:15px"></div>';
+ } // end loop
+ }
- echo "<TD align=\"right\">";
- echo ( $positive != 0 )?"<font color=\"red\"> -
".nbm($line['montant'])."</font>":nbm($line['montant']);
- echo "</TD>";
- }
- else
- {
- echo "<TD align=\"right\">".nbm($line['montant'])."</TD>";
- }
-
- echo "</tr>";
- }
-
- } //else
- echo "</table>";
- // show the saldo
-
- $solde=$Jrn->get_solde( $_GET['from_periode'],
- $_GET['to_periode']
- );
- echo "solde débiteur:".$solde[0]."<br>";
- echo "solde créditeur:".$solde[1];
-
- echo "</div>";
- exit;
+ echo "</div>";
+ exit;
}
echo '</div>';
Modified: phpcompta/tags/rel650/include/template/ledger_detail_ach.php
===================================================================
--- phpcompta/tags/rel650/include/template/ledger_detail_ach.php
2012-12-08 20:30:44 UTC (rev 5166)
+++ phpcompta/tags/rel650/include/template/ledger_detail_ach.php
2012-12-08 22:48:30 UTC (rev 5167)
@@ -211,9 +211,9 @@
}
if ($owner->MY_TVA_USE=='Y')
- $row= td(_('Total'),'
style="font-style:italic;text-align:right;font-weight: bolder;widtg:auto"
colspan="6"');
+ $row= td(_('Total'),'
style="font-style:italic;text-align:right;font-weight: bolder;width:auto"
colspan="6"');
else
- $row= td(_('Total'),'
style="font-style:italic;text-align:right;font-weight: bolder;widtg:auto"
colspan="6"');
+ $row= td(_('Total'),'
style="font-style:italic;text-align:right;font-weight: bolder;width:auto"
colspan="6"');
$row.=td(nbm($total_htva),'class="num" style="font-style:italic;font-weight:
bolder;"');
if ($owner->MY_TVA_USE=='Y')
$row.=td("").td(nbm($total_tvac),'class="num"
style="font-style:italic;font-weight: bolder;"');
Added: phpcompta/tags/rel650/include/template/operation_detail_ach.php
===================================================================
--- phpcompta/tags/rel650/include/template/operation_detail_ach.php
(rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_ach.php
2012-12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,122 @@
+<?php
+/*
+ * This file is part of PhpCompta.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief show detail of a operation of purchase
+ *
+ */
+global $g_parameter;
+?>
+<table class="result" >
+ <?
+ bcscale(2);
+ $total_htva = 0;
+ $total_tvac = 0;
+ echo th(_('Quick Code'));
+ echo th(_('Description'));
+ if ($g_parameter->MY_TVA_USE == 'Y')
+ {
+ echo th(_('Taux TVA'), 'style="text-align:right"');
+ }
+ else
+ {
+ echo th('');
+ }
+ echo th(_('Prix/Un.'), 'style="text-align:right"');
+ echo th(_('Quantité'), 'style="text-align:right"');
+ echo th(_('Non ded'), 'style="text-align:right"');
+
+ if ($g_parameter->MY_TVA_USE == 'Y')
+ {
+ echo th(_('HTVA'), 'style="text-align:right"');
+ echo th(_('TVA'), 'style="text-align:right"');
+ echo th(_('TVAC'), 'style="text-align:right"');
+ }else
+ echo th(_('Total'), 'style="text-align:right"');
+
+ echo '</tr>';
+ for ($e = 0; $e < count($obj->det->array); $e++)
+ {
+ $row = '';
+ $q = $obj->det->array[$e];
+ $fiche = new Fiche($cn, $q['qp_fiche']);
+ $view_card_detail =
HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE), "", '
class="line" ');
+ $row = td($view_card_detail);
+ $sym_tva = '';
+
+ if ($g_parameter->MY_TVA_USE == 'Y' && $q['qp_vat_code'] != '')
+ {
+ /* retrieve TVA symbol */
+ $tva = new Acc_Tva($cn, $q['qp_vat_code']);
+ $tva->load();
+ $sym_tva = h($tva->get_parameter('label'));
+ }
+ $input = new ISpan("e_march" . $q['j_id'] . "_label");
+ $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
+ $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
+ $row.=td($input->input() . $hidden);
+ $row.=td($sym_tva, 'style="text-align:center"');
+ $pu = 0;
+ if ($q['qp_quantite'] != 0)
+ $pu = bcdiv($q['qp_price'], $q['qp_quantite']);
+ $row.=td(nbm($pu), 'class="num"');
+ $row.=td(nbm($q['qp_quantite']), 'class="num"');
+
+ $no_ded = bcadd($q['qp_dep_priv'], $q['qp_nd_amount']);
+ $row.=td(nbm($no_ded), ' style="text-align:right"');
+ $htva = $q['qp_price'];
+
+
+ $row.=td(nbm($htva), 'class="num"');
+ $tvac = bcadd($htva, $q['qp_vat']);
+ $tvac = bcadd($tvac, $q['qp_nd_tva']);
+ $tvac = bcadd($tvac, $q['qp_nd_tva_recup']);
+
+
+ if ($g_parameter->MY_TVA_USE == 'Y')
+ {
+ $tva_amount = bcadd($q['qp_vat'], $q['qp_nd_tva']);
+ $tva_amount = bcadd($tva_amount, $q['qp_nd_tva_recup']);
+ $class = "";
+ if ($q['qp_vat_sided'] <> 0)
+ {
+ $class = '
style="text-decoration:line-through"';
+ $tvac = bcsub($tvac, $q['qp_vat']);
+ }
+ $row.=td(nbm($tva_amount), 'class="num" ' . $class);
+ $row.=td(nbm($tvac), 'class="num"');
+ }
+ $total_tvac+=$tvac;
+ $total_htva+=$htva;
+ echo tr($row);
+ }
+ if ($g_parameter->MY_TVA_USE == 'Y')
+ $row = td(_('Total'), '
style="font-style:italic;text-align:right;font-weight: bolder;width:auto"
colspan="6"');
+ else
+ $row = td(_('Total'), '
style="font-style:italic;text-align:right;font-weight: bolder;width:auto"
colspan="6"');
+ $row.=td(nbm($total_htva), 'class="num"
style="font-style:italic;font-weight: bolder;"');
+ if ($g_parameter->MY_TVA_USE == 'Y')
+ $row.=td("") . td(nbm($total_tvac), 'class="num"
style="font-style:italic;font-weight: bolder;"');
+ echo tr($row);
+ ?>
+</table>
Added: phpcompta/tags/rel650/include/template/operation_detail_fin.php
===================================================================
--- phpcompta/tags/rel650/include/template/operation_detail_fin.php
(rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_fin.php
2012-12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,50 @@
+<?php
+
+/*
+ * This file is part of PhpCompta.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief show detail of a operation of fin
+ *
+ */
+echo '<table class="result">';
+echo '<tr>';
+echo th('Compte en banque');
+echo th('Tiers');
+echo th('Libellé');
+echo th('Montant');
+echo '</tr>';
+
+echo '<tr>';
+$bk = new Fiche($cn, $obj->det->array[0]['qf_bank']);
+$view_card_detail = HtmlInput::card_detail($bk->get_quick_code(),
h($bk->getName()), ' class="line" ');
+echo td($view_card_detail);
+$other = new Fiche($cn, $obj->det->array[0]['qf_other']);
+$view_card_detail = HtmlInput::card_detail($other->get_quick_code(),
h($other->getName()), ' class="line" ');
+echo td($view_card_detail);
+$comment = strip_tags($obj->det->jr_comment);
+echo td($comment);
+echo td(nbm($obj->det->array[0]['qf_amount']), ' class="inum"');
+echo '</tr>';
+echo '</table>';
+?>
+
Added: phpcompta/tags/rel650/include/template/operation_detail_misc.php
===================================================================
--- phpcompta/tags/rel650/include/template/operation_detail_misc.php
(rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_misc.php
2012-12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,86 @@
+<?php
+/*
+ * This file is part of PhpCompta.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief how detail of a misc operation
+ *
+ */
+?>
+<table class="result">
+<tr>
+<?
+ echo th(_('Poste Comptable'));
+ echo th(_('Quick Code'));
+ echo th(_('Libellé'));
+echo th(_('Débit'), 'style="text-align:right"');
+echo th(_('Crédit'), 'style="text-align:right"');
+echo '</tr>';
+$amount_idx=0;
+for ($e = 0; $e < count($obj->det->array); $e++)
+{
+ $row = '';
+ $q = $obj->det->array;
+ $view_history = sprintf('<A class="detail"
style="text-decoration:underline"
HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>',
$q[$e]['j_poste'], $gDossier, $q[$e]['j_poste']);
+
+ $row.=td($view_history);
+
+ if ($q[$e]['j_qcode'] != '')
+ {
+ $fiche = new Fiche($cn);
+ $fiche->get_by_qcode($q[$e]['j_qcode']);
+ $view_history = sprintf('<A class="detail"
style="text-decoration:underline"
HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>', $fiche->id,
$gDossier, $q[$e]['j_qcode']);
+ }
+ else
+ $view_history = '';
+ $row.=td($view_history);
+ $l_lib = $q[$e]['j_text'];
+
+ if ($l_lib != '')
+ {
+ $l_lib = $q[$e]['j_text'];
+ }
+ else if ($q[$e]['j_qcode'] != '')
+ {
+ // nom de la fiche
+ $ff = new Fiche($cn);
+ $ff->get_by_qcode($q[$e]['j_qcode']);
+ $l_lib = $ff->strAttribut(ATTR_DEF_NAME);
+ }
+ else
+ {
+ // libellé du compte
+ $name = $cn->get_value('select pcm_lib from tmp_pcmn where
pcm_val=$1', array($q[$e]['j_poste']));
+ $l_lib = $name;
+ }
+ $l_lib = strip_tags($l_lib);
+ $input = new ISpan("e_march" . $q[$e]['j_id'] . "_label");
+ $input->value = $l_lib;
+ $hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
+ $row.=td($input->input() . $hidden);
+ $montant = td(nbm($q[$e]['j_montant']), 'class="num"');
+ $row.=($q[$e]['j_debit'] == 't') ? $montant : td('');
+ $row.=($q[$e]['j_debit'] == 'f') ? $montant : td('');
+ echo tr($row);
+}
+?>
+</table>
\ No newline at end of file
Added: phpcompta/tags/rel650/include/template/operation_detail_ven.php
===================================================================
--- phpcompta/tags/rel650/include/template/operation_detail_ven.php
(rev 0)
+++ phpcompta/tags/rel650/include/template/operation_detail_ven.php
2012-12-08 22:48:30 UTC (rev 5167)
@@ -0,0 +1,107 @@
+<?php
+
+/*
+ * This file is part of PhpCompta.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief show detail of a operation of sale
+ *
+ */
+global $g_parameter;
+?>
+<table class="result">
+<?
+ bcscale(2);
+ $total_htva=0;$total_tvac=0;
+ echo th(_('Quick Code'));
+echo th(_('Description'));
+echo th(_('Prix/Un'), 'style="text-align:right"');
+echo th(_('Quantité'), 'style="text-align:right"');
+if ( $g_parameter->MY_TVA_USE == 'Y')
+ echo th(_('Taux TVA'), 'style="text-align:right"');
+else
+ echo th('');
+if ( $g_parameter->MY_TVA_USE == 'Y') {
+ echo th(_('HTVA'), 'style="text-align:right"');
+ echo th(_('TVA'), 'style="text-align:right"');
+ echo th(_('TVAC'), 'style="text-align:right"');
+} else
+ echo th(_('Total'), 'style="text-align:right"');
+
+
+echo '</tr>';
+ for ($e=0;$e<count($obj->det->array);$e++) {
+ $row='';
+ $q=$obj->det->array[$e];
+ $fiche=new Fiche($cn,$q['qs_fiche']);
+
$view_card_detail=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE),"",
' class="line" ');
+ $row.=td($view_card_detail);
+ $input = new ISpan("e_march" . $q['j_id'] . "_label");
+ $hidden = HtmlInput::hidden("j_id[]", $q['j_id']);
+ $input->value = $fiche->strAttribut(ATTR_DEF_NAME);
+
+ $row.=td($input->input().$hidden);
+ $sym_tva='';
+ $pu=0;
+ if ($q['qs_quantite'] != 0)
$pu=bcdiv($q['qs_price'],$q['qs_quantite']);
+ $row.=td(nbm($pu),'class="num"');
+ $row.=td(nbm($q['qs_quantite']),'class="num"');
+ $sym_tva='';
+ if ( $g_parameter->MY_TVA_USE=='Y' && $q['qs_vat_code'] != '') {
+ /* retrieve TVA symbol */
+ $tva=new Acc_Tva($cn,$q['qs_vat_code']);
+ $tva->load();
+ $sym_tva=(h($tva->get_parameter('label')));
+ // $sym_tva=$sym
+ }
+
+ $row.=td($sym_tva,'style="text-align:center"');
+
+ $htva=$q['qs_price'];
+
+ $row.=td(nbm($htva),'class="num"');
+ $tvac=bcadd($htva,$q['qs_vat']);
+ if ($g_parameter->MY_TVA_USE=='Y')
+ {
+ $class="";
+ if ($q['qs_vat_sided'] != 0) {
+ $class=' style="text-decoration:line-through"';
+ $tvac=bcsub($tvac,$q['qs_vat']);
+ }
+ $row.=td(nbm($q['qs_vat']),'class="num"'.$class);
+ $row.=td(nbm($tvac),'class="num"');
+ }
+ $total_tvac=bcadd($total_tvac,$tvac);
+ $total_htva=bcadd($total_htva,$htva);
+ echo tr($row);
+
+ }
+ if ($g_parameter->MY_TVA_USE=='Y')
+ $row= td(_('Total'),'
style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
+ else
+ $row= td(_('Total'),'
style="font-style:italic;text-align:right;font-weight: bolder;" colspan="5"');
+$row.=td(nbm($total_htva),'class="num" style="font-style:italic;font-weight:
bolder;"');
+if ($g_parameter->MY_TVA_USE=='Y')
+ $row.=td("").td(nbm($total_tvac),'class="num"
style="font-style:italic;font-weight: bolder;"');
+echo tr($row);
+?>
+</table>
\ No newline at end of file
Modified: phpcompta/tags/rel650/sql/upgrade.sql
===================================================================
--- phpcompta/tags/rel650/sql/upgrade.sql 2012-12-08 20:30:44 UTC (rev
5166)
+++ phpcompta/tags/rel650/sql/upgrade.sql 2012-12-08 22:48:30 UTC (rev
5167)
@@ -25,7 +25,7 @@
update tmp_pcmn set pcm_val_parent = '62' where pcm_val='6202';
-update fiche_detail set ad_value = to_number(ad_value,'9.99')*100 where ad_id
in (21,22,20,31) and ad_value is not null and ad_value <> '';
+update fiche_detail set ad_value = (to_number(ad_value,'9.99')*100)::text
where ad_id in (21,22,20,31) and ad_value is not null and ad_value <> '';
update menu_ref set me_code='ACHISTO' WHERE me_code='ACHIMP';
update menu_ref set me_code='VEHISTO' WHERE me_code='VENIMP';
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5167 - in phpcompta/tags/rel650: doc include include/template sql,
phpcompta-dev <=