diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index fa7a152a2..3420617d1 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -66,15 +66,10 @@ $html = var_export($_REQUEST, true);
switch ($op)
{
case "remove_anc":
- if ($user->check_action(CAOD))
$cn->exec_sql("delete from operation_analytique where oa_group=$1", array($_GET['oa']));
break;
case "rm_stock":
require_once('constant.security.php');
- if ($user->check_action(STOWRITE) == 0)
- {
- exit();
- }
$cn->exec_sql('delete from stock_goods where sg_id=$1', array($s_id));
$html = escape_xml($s_id);
header('Content-type: text/xml; charset=UTF-8');
@@ -537,5 +532,5 @@ EOF;
case 'autoanc':
require_once('ajax_auto_anc_card.php');
break;
-
+
}
\ No newline at end of file
diff --git a/include/class_acc_bilan.php b/include/class_acc_bilan.php
index dad824b1e..f20d791c5 100644
--- a/include/class_acc_bilan.php
+++ b/include/class_acc_bilan.php
@@ -144,6 +144,7 @@ class Acc_Bilan
/*!\brief verify that the saldo is good for the type of account */
function verify()
{
+ bcscale(2);
echo '
Comptes normaux
';
$this->warning('Actif avec un solde crediteur','ACT','D');
$this->warning('Passif avec un solde debiteur','PAS','C');
@@ -171,7 +172,7 @@ class Acc_Bilan
$sql.="and $sql_periode";
$credit_actif=$this->db->get_value($sql);
- $total_actif=abs($debit_actif-$credit_actif);
+ $total_actif=abs(bcsub($debit_actif,$credit_actif));
echo '';
echo tr(td( 'Total actif ').td($total_actif,'style="text-align:right"'));
@@ -187,13 +188,13 @@ class Acc_Bilan
" where j_debit='f' and (pcm_type='PAS' or pcm_type='PASINV') ";
$sql.="and $sql_periode";
$credit_passif=$this->db->get_value($sql);
- $total_passif=abs($debit_passif-$credit_passif);
+ $total_passif=abs(bcsub($debit_passif,$credit_passif));
/* diff actif / passif */
echo tr(td('Total passif ').td($total_passif,'style="text-align:right"'));
if ( $total_actif != $total_passif )
{
- $diff=$total_actif-$total_passif;
+ $diff=bcsub($total_actif,$total_passif);
echo tr(td(' Difference Actif - Passif ').td($diff,'style="text-align:right"'),'style="font-weight:bolder"');
}
@@ -208,7 +209,7 @@ class Acc_Bilan
" where j_debit='f' and (pcm_type='CHA' or pcm_type='CHAINV')";
$sql.="and $sql_periode";
$credit_charge=$this->db->get_value($sql);
- $total_charge=abs($debit_charge-$credit_charge);
+ $total_charge=abs(bcsub($debit_charge,$credit_charge));
echo tr(td('Total charge ').td($total_charge,'style="text-align:right"'));
@@ -223,10 +224,10 @@ class Acc_Bilan
" where j_debit='f' and (pcm_type='PRO' or pcm_type='PROINV')";
$sql.="and $sql_periode";
$credit_pro=$this->db->get_value($sql);
- $total_pro=abs($debit_pro-$credit_pro);
+ $total_pro=abs(bcsub($debit_pro,$credit_pro));
echo tr(td('Total produit ').td($total_pro,'style="text-align:right"'));
- $diff=$total_pro-$total_charge;
+ $diff=bcsub($total_pro,$total_charge);
echo tr( td("Difference Produit - Charge",'style="padding-right:20px"').td($diff,'style="text-align:right"'),'style="font-weight:bolder"');
echo '
';
@@ -296,7 +297,7 @@ class Acc_Bilan
* \param $p_handle the handle to the file
* \param
* \param
- *
+ *
*
* \return
*/
@@ -324,9 +325,9 @@ class Acc_Bilan
}// end read form line per line
}
/*!\brief generate the ods document
- * \param the handle to the template file
- * \return the xml
- *@note
+ * \param the handle to the template file
+ * \return the xml
+ *@note
* Sur une seule ligne il y a plusieurs données, donc il y a plusieurs boucles, pour les autres documents
* cela devrait être fait aussi, actuellement ces documents, n'acceptent qu'une formule par ligne.
*@note
@@ -352,13 +353,13 @@ class Acc_Bilan
ob_start();
/* unzip the document */
$zip = new Zip_Extended;
- if ($zip->open($work_file) === TRUE)
+ if ($zip->open($work_file) === TRUE)
{
$zip->extractTo($dirname.DIRECTORY_SEPARATOR);
$zip->close();
- } else
+ } else
{
- echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
+ echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
}
ob_end_clean();
@@ -391,7 +392,7 @@ class Acc_Bilan
// the line contains the magic <<
$tmp="";
-
+
while (preg_match_all($regex,$line_rtf,$f2) > 0 )
{
// the f2 array contains all the magic << in the line
@@ -606,13 +607,13 @@ class Acc_Bilan
case 'ods':
/* header("Pragma: public");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
- header("Cache-Control: must-revalidate");
+ header("Cache-Control: must-revalidate");
if ( $this->b_type == 'odt' )
header('Content-type: application/vnd.oasis.opendocument.text');
if ( $this->b_type == 'ods' )
header('Content-type: application/vnd.oasis.opendocument.spreadsheet');
header('Content-Disposition: attachment;filename="'.$this->b_name.'.odt"',FALSE);
- header("Accept-Ranges: bytes");
+ header("Accept-Ranges: bytes");
*/
ob_start();
// save the file in a temp folder
@@ -636,14 +637,14 @@ class Acc_Bilan
*/
ob_start();
$zip = new Zip_Extended;
- if ($zip->open($work_file) === TRUE)
+ if ($zip->open($work_file) === TRUE)
{
$zip->extractTo($dirname.DIRECTORY_SEPARATOR);
$zip->close();
- }
- else
+ }
+ else
{
- echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
+ echo __FILE__.":".__LINE__."cannot unzip model ".$filename;
}
// Remove the file we do not need anymore
diff --git a/include/class_acc_ledger_fin.php b/include/class_acc_ledger_fin.php
index e66b808de..85fa22a44 100644
--- a/include/class_acc_ledger_fin.php
+++ b/include/class_acc_ledger_fin.php
@@ -472,7 +472,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
$r.="";
$r.="| code | ";
$r.="Commentaire | ";
- $r.="Montant | ";
+ $r.="Montant | ";
$r.=' Op. Concernée(s) | ';
/* if we use the AC */
@@ -521,8 +521,12 @@ class Acc_Ledger_Fin extends Acc_Ledger
// amount
$r.=''.nbm($tiers_amount).' | ';
// concerned
- $r.='';
- $r.=${"e_concerned".$i};
+ $r.=' | ';
+ if (${"e_concerned".$i} != '')
+ {
+ $jr_internal=$this->db->get_value("select jr_internal from jrn where jr_id=$1",array(${"e_concerned".$i}));
+ $r.=HtmlInput::detail_op(${"e_concerned".$i},$jr_internal);
+ }
$r.=' | ';
// encode the pa
if ( $g_parameter->MY_ANALYTIC!='nu' && preg_match("/^[6,7]/",$fTiers->strAttribut(ATTR_DEF_ACCOUNT))==1 ) // use of AA
@@ -636,7 +640,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
$amount=0.0;
$idx_operation=0;
$ret='';
- $ret.=tr(th('Quick Code').th('Nom').th('Libellé').th('Montant'));
+ $ret.=tr(th('Quick Code').th('Nom').th('Libellé').th('Montant',' style="text-align:right"'));
// Credit = goods
for ( $i = 0; $i < $nb_item;$i++)
{
diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php
index 7c83e4d90..f9547b870 100644
--- a/include/class_acc_ledger_sold.php
+++ b/include/class_acc_ledger_sold.php
@@ -331,7 +331,6 @@ class Acc_Ledger_Sold extends Acc_Ledger
$tva[$idx_tva]+=$tva_item;
else
$tva[$idx_tva]=$tva_item;
- var_dump($oTva->get_parameter("both_side"));
if ($oTva->get_parameter("both_side")==0) $tot_tva=round(bcadd($tva_item,$tot_tva),2);
}
@@ -1283,7 +1282,6 @@ class Acc_Ledger_Sold extends Acc_Ledger
$r.=HtmlInput::button('add_item',_('Ajout article'), ' onClick="ledger_add_row()"');
- $r.="";
return $r;
}
diff --git a/include/class_contact.php b/include/class_contact.php
index c928ed347..e2f573382 100644
--- a/include/class_contact.php
+++ b/include/class_contact.php
@@ -42,12 +42,12 @@ class contact extends Fiche
/*! Summary
**************************************************
* \brief show the default screen
- *
+ *
* \param p_search (filter)
- *
+ *
* \return string to display
*/
- function Summary($p_search="",$p_action="",$p_sql="")
+ function Summary($p_search="",$p_action="",$p_sql="",$p_nothing=false)
{
$p_search=sql_string($p_search);
$extra_sql="";
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index 6f202a8d1..7417c6bf7 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -169,6 +169,9 @@ if (!isset($_REQUEST ['p_jrn']))
else
$Ledger->id = $_REQUEST ['p_jrn'];
+if (isset ($_REQUEST['p_jrn_predef'])){
+ $Ledger->id=$_REQUEST['p_jrn_predef'];
+}
// pre defined operation
//
echo '