Fix a lot of small bugs
This commit is contained in:
parent
9205bbd6a9
commit
bb5cd2063e
12 changed files with 52 additions and 51 deletions
|
|
@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -144,6 +144,7 @@ class Acc_Bilan
|
|||
/*!\brief verify that the saldo is good for the type of account */
|
||||
function verify()
|
||||
{
|
||||
bcscale(2);
|
||||
echo '<h3> Comptes normaux </h3>';
|
||||
$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 '<table >';
|
||||
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 '</table>';
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
$r.="<TR>";
|
||||
$r.="<th colspan=\"2\">code</TH>";
|
||||
$r.="<th>Commentaire</TH>";
|
||||
$r.="<th>Montant</TH>";
|
||||
$r.="<th style=\"text-align:right\">Montant</TH>";
|
||||
$r.='<th colspan="2"> Op. Concernée(s)</th>';
|
||||
|
||||
/* if we use the AC */
|
||||
|
|
@ -521,8 +521,12 @@ class Acc_Ledger_Fin extends Acc_Ledger
|
|||
// amount
|
||||
$r.='<td class="num">'.nbm($tiers_amount).'</td>';
|
||||
// concerned
|
||||
$r.='<td>';
|
||||
$r.=${"e_concerned".$i};
|
||||
$r.='<td style="text-align:center">';
|
||||
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.='</td>';
|
||||
// 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='<table class="result" style="width:75%">';
|
||||
$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++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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.="</DIV>";
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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="";
|
||||
|
|
|
|||
|
|
@ -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 '<div id="predef_form">';
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ global $g_user;
|
|||
$cn = new Database(dossier::id());
|
||||
|
||||
$id = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : -1;
|
||||
$id = (isset($_REQUEST['p_jrn_predef'])) ? $_REQUEST['p_jrn_predef'] : -1;
|
||||
$ledger = new Acc_Ledger($cn, $id);
|
||||
$first_ledger = $ledger->get_first('ODS');
|
||||
$ledger->id = ($ledger->id == -1) ? $first_ledger['jrn_def_id'] : $id;
|
||||
|
||||
/* !\brief show a form for quick_writing */
|
||||
$id = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : -1;
|
||||
$def = -1;
|
||||
$ledger->with_concerned = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -180,14 +180,17 @@ global $g_parameter;
|
|||
// pre defined operation
|
||||
//
|
||||
|
||||
if ( !isset($_REQUEST ['p_jrn']))
|
||||
if ( !isset($_REQUEST ['p_jrn']) )
|
||||
{
|
||||
$def_ledger=$Ledger->get_first('ven');
|
||||
$Ledger->id=$def_ledger['jrn_def_id'];
|
||||
}
|
||||
else
|
||||
$Ledger->id=$_REQUEST ['p_jrn'];
|
||||
|
||||
if (isset ($_REQUEST['p_jrn_predef'])){
|
||||
$Ledger->id=$_REQUEST['p_jrn_predef'];
|
||||
}
|
||||
|
||||
echo '<div id="predef_form">';
|
||||
echo '<form style="display:inline" method="GET" >';
|
||||
echo HtmlInput::hidden('ac',$_REQUEST['ac']);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5)
|
|||
$afiche[0]=array('fd_id'=>$_REQUEST['cat']);
|
||||
}
|
||||
|
||||
if ( $allcard==0 && empty($aCard))
|
||||
if ( $allcard==0 && empty($afiche))
|
||||
{
|
||||
$pdf->Cell(0,10, "Aucune fiche trouvée");//Save PDF to file
|
||||
$fDate=date('dmy-Hi');
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5 )
|
|||
|
||||
|
||||
$fd=new Fiche_Def($cn,$_REQUEST['cat']);
|
||||
if ( $allcard==1 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false )
|
||||
if ( $allcard==0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false )
|
||||
{
|
||||
echo alert("Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
|
||||
exit;
|
||||
|
|
@ -172,10 +172,13 @@ if ( $_GET['histo'] == 4 || $_GET['histo']==5 )
|
|||
for ($e=0;$e<count($afiche);$e++)
|
||||
{
|
||||
$ret=$cn->exec_sql("select f_id,ad_value from fiche join fiche_detail using(f_id) where fd_id=$1 and ad_id=1 order by 2 ",array($afiche[$e]['fd_id']));
|
||||
if ( $cn->count()==0)
|
||||
if ( $cn->count()==0 )
|
||||
{
|
||||
echo "Aucune fiche trouvée";
|
||||
exit;
|
||||
if ( $allcard==0) {
|
||||
echo "Aucune fiche trouvée";
|
||||
exit;
|
||||
} else
|
||||
continue;
|
||||
}
|
||||
echo '<h2>'.$cn->get_value("select fd_label from fiche_def where fd_id=$1",array($afiche[$e]['fd_id'])).'</h2>';
|
||||
echo '<table class="result" style="width:80%;margin-left:10%">';
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ require_once 'class_iconcerned.php';
|
|||
global $g_user;
|
||||
$cn=new Database(dossier::id());
|
||||
|
||||
$id=(isset ($_REQUEST['p_jrn']))?$_REQUEST['p_jrn']:-1;
|
||||
$id = (isset($_REQUEST['p_jrn'])) ? $_REQUEST['p_jrn'] : -1;
|
||||
$id = (isset($_REQUEST['p_jrn_predef'])) ? $_REQUEST['p_jrn_predef'] : -1;
|
||||
$ledger=new Acc_Ledger($cn,$id);
|
||||
$first_ledger=$ledger->get_first('ODS');
|
||||
$ledger->id=($ledger->id==-1)?$first_ledger['jrn_def_id']:$id;
|
||||
|
|
|
|||
|
|
@ -41,17 +41,12 @@ global $g_user;
|
|||
|
||||
$href=basename($_SERVER['PHP_SELF']);
|
||||
|
||||
// Get The priv on the selected folder
|
||||
$g_user->can_request(STOLE,1);
|
||||
|
||||
|
||||
$action= ( isset ($_GET['action']))? $_GET['action']:"";
|
||||
include_once("stock_inc.php");
|
||||
|
||||
// Adjust the stock
|
||||
if ( isset ($_POST['sub_change']))
|
||||
{
|
||||
$g_user->can_request(STOWRITE,1);
|
||||
$change=$_POST['stock_change'];
|
||||
$sg_code=$_POST['sg_code'];
|
||||
$sg_date=$_POST['sg_date'];
|
||||
|
|
@ -121,8 +116,6 @@ else
|
|||
// View details
|
||||
if ( $action == 'detail' )
|
||||
{
|
||||
// Check if User Can see the stock
|
||||
$g_user->can_request(STOLE,1);
|
||||
$sg_code=(isset ($_GET['sg_code'] ))?$_GET['sg_code']:$_POST['sg_code'];
|
||||
$year=(isset($_GET['year']))?$_GET['year']:$_POST['year'];
|
||||
$a=ViewDetailStock($cn,$sg_code,$year);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue