[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4298 - in phpcompta/trunk/include: . template
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4298 - in phpcompta/trunk/include: . template |
Date: |
Wed, 2 Nov 2011 22:45:12 +0100 (CET) |
Author: danydb
Date: 2011-11-02 22:45:11 +0100 (Wed, 02 Nov 2011)
New Revision: 4298
Added:
phpcompta/trunk/include/history_operation.inc.php
Modified:
phpcompta/trunk/include/class_acc_ledger.php
phpcompta/trunk/include/class_acc_ledger_purchase.php
phpcompta/trunk/include/compta_ach.inc.php
phpcompta/trunk/include/template/ledger_detail_ach.php
Log:
Finish rewriting for ACH and ODS
Modified: phpcompta/trunk/include/class_acc_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger.php 2011-11-02 20:21:55 UTC
(rev 4297)
+++ phpcompta/trunk/include/class_acc_ledger.php 2011-11-02 21:45:11 UTC
(rev 4298)
@@ -2358,7 +2358,7 @@
$and='';
$user=new User($this->db);
- $p_action=$ledger_type;
+ $p_action=$ledger_type;
if ( $r_jrn == -1 )
{
Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_purchase.php 2011-11-02
20:21:55 UTC (rev 4297)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php 2011-11-02
21:45:11 UTC (rev 4298)
@@ -181,11 +181,11 @@
*/
$a_poste=split(',',$tva_rate->tva_poste);
- if (
+ if (
$this->db->get_value('select count(*) from tmp_pcmn where
pcm_val=$1',array($a_poste[0])) == 0 ||
$this->db->get_value('select count(*) from tmp_pcmn where
pcm_val=$1',array($a_poste[1])) == 0 )
throw new Exception(_(" La TVA ".$tva_rate->tva_label."
utilise des postes comptables inexistants"));
-
+
}
/* check if all card has a ATTR_DEF_ACCOUNT*/
$fiche=new Fiche($this->db);
@@ -235,12 +235,12 @@
$a=new Acc_Parm_Code($this->db,$key[1]);
if ( $this->db->count_sql('select pcm_val from tmp_pcmn
where pcm_val=$1',array($a->p_value))==0)
throw new Exception ($key[1]._("ce code n'a pas de poste
comptable, créez ce poste : [".$a->p_value."]"));
- }
+ }
if ( ! $fiche->empty_attribute($key[0]) && !
$fiche->empty_attribute($key[2]))
{
$nd_str=$fiche->strAttribut($key[2]);
if ( $nd_str != '')
- {
+ {
$poste_nd=new Acc_Account_Ledger($this->db,$nd_str);
if ( $poste_nd->load() == false)
{
@@ -548,7 +548,7 @@
if ( $tot_nd != 0)
{
$dna_default=new Acc_Parm_Code($this->db,'DNA');
-
+
/* save op. */
if ( ! $fiche->empty_attribute(ATTR_DEF_ACCOUNT_ND))
{
@@ -610,7 +610,7 @@
$dna=$dna_default->p_value;
}
$dna=($dna=='')?$dna_default->p_value:$dna;
-
+
$acc_operation->amount=$tot_tva_nd;
$acc_operation->poste=$dna;
if ( $tot_tva_nd > 0 )
$tot_debit=bcadd($tot_debit,$tot_tva_nd);
@@ -800,18 +800,18 @@
/*
* save also into quant_fin
*/
-
+
/* get ledger property */
$ledger=new Acc_Ledger_Fin($this->db,$acc_pay->jrn);
$prop=$ledger->get_propertie();
-
+
/* if ledger is FIN then insert into quant_fin */
if ( $prop['jrn_def_type'] == 'FIN' )
{
$ledger->insert_quant_fin($acfiche->id,$mp_jr_id,$cust->id,bcmul($cust_amount,-1));
}
-
-
+
+
}
}//end try
catch (Exception $e)
@@ -967,7 +967,7 @@
$add_js="update_pj();";
}
$add_js.='get_last_date();';
-
+ $add_js.='update_name();';
$wLedger=$this->select_ledger('ACH',2);
if ($wLedger == null) exit (_('Pas de journal disponible'));
$wLedger->javascript="onChange='update_predef(\"ach\",\"f\");$add_js'";
@@ -1222,16 +1222,21 @@
return $r;
}
- /*!\brief show the summary of the operation and propose to save it
- *\param array contains normally $_POST. It proposes also to save
+ /address@hidden show the summary of the operation and propose to save it
+ address@hidden array contains normally $_POST. It proposes also to save
* the Analytic accountancy
- *\return string
+ * @param $p_summary true to confirm false, show only the result in RO
+ address@hidden string
*/
- function confirm($p_array)
+ function confirm($p_array,$p_summary=false)
{
extract ($p_array);
- $this->verify($p_array) ;
- $anc=null;
+
+ // we don't need to verify if we need only a feedback
+ if ( ! $p_summary )
+ $this->verify($p_array) ;
+
+ $anc=null;
// to show a select list for the analytic
// if analytic is op (optionnel) there is a blank line
$owner = new Own($this->db);
@@ -1286,6 +1291,7 @@
$r.="<th>tva</th>";
$r.='<th> '._('Montant TVA').'</th>';
$r.='<th>'._('Montant HTVA').'</th>';
+ $r.='<th>'._('Totaux').'</th>';
}
else
{
@@ -1314,6 +1320,7 @@
//--
for ($i = 0; $i < $nb_item;$i++)
{
+ $tot_row=0;
if ( strlen(trim(${"e_march".$i})) == 0 ) continue;
/* retrieve information for card */
@@ -1353,9 +1360,10 @@
else
$tva[$idx_tva]=$tva_item;
$tot_tva=round(bcadd($tva_item,$tot_tva),2);
+ $tot_row=bcadd($tot_row,$tva_item);
}
$tot_amount=round(bcadd($tot_amount,$amount),2);
-
+ $tot_row=bcadd($tot_row,$amount);
$r.='<tr>';
$r.='<td>';
$r.=${"e_march".$i};
@@ -1367,7 +1375,7 @@
$r.=nbm(${"e_march".$i."_price"});
$r.='</td>';
$r.='<td align="right">';
- $r.=${"e_quant".$i};
+ $r.=nbm(${"e_quant".$i});
$r.='</td>';
if ($owner->MY_TVA_USE == 'Y')
{
@@ -1377,11 +1385,13 @@
$r.='<td align="right">';
$r.=nbm($tva_item);
$r.='</td>';
+ $r.='<td align="right">';
+ $r.=nbm(round($amount,2));
+ $r.='</td>';
}
- $r.='<td align="right">';
- $r.=nbm(round($amount,2));
+ $r.='<td align="right">';
+ $r.=nbm(round($tot_row,2));
$r.='</td>';
-
// encode the pa
if ( $owner->MY_ANALYTIC!='nu') // use of AA
{
@@ -1389,7 +1399,7 @@
$anc_op=new Anc_Operation($this->db);
$null=($owner->MY_ANALYTIC=='op')?1:0;
$r.='<td>';
- $p_mode=1;
+ $p_mode=($p_summary==false)?1:0;
$p_array['pa_id']=$a_anc;
/* op is the operation it contains either a sequence or a
jrnx.j_id */
$r.=HtmlInput::hidden('op[]=',$i);
@@ -1404,12 +1414,14 @@
$r.='</table>';
- if ( $owner->MY_ANALYTIC!='nu') // use of AA
- $r.='<input type="button" class="button" value="'._('verifie
CA').'" onClick="verify_ca(\'\');">';
+ if ( $owner->MY_ANALYTIC!='nu' && !$p_summary) // use of AA
+ $r.='<input type="button" class="button" value="'._('Vérifiez
imputation analytique').'" onClick="verify_ca(\'\');">';
$r.='</fieldset>';
- $r.='<div
style="width:40%;position:float;float:right;text-align:right;padding-left:5%;padding-right:5%;color:blue;font-size:1.2em;font-weight:bold">';
-
+ if ( ! $p_summary )
+ $r.='<div
style="width:40%;position:float;float:right;text-align:right;padding-left:5%;padding-right:5%;color:blue;font-size:1.2em;font-weight:bold">';
+ else
+ $r.='<div
style="width:60%;position:float;float:left;text-align:right;padding-left:5%;padding-right:5%;color:blue;font-size:1.2em;font-weight:bold">';
$r.='<fieldset> <legend>Totaux</legend>';
$tot=round(bcadd($tot_amount,$tot_tva),2);
$r.='<div
style="position:float;float:left;text-align:right;padding-left:5%;padding-right:5%;color:blue;font-size:1.2em;font-weight:bold">';
@@ -1492,7 +1504,7 @@
}
// check for upload piece
- $r.=$this->extra_info();
+ if ( ! $p_summary ) $r.=$this->extra_info();
return $r;
}
Modified: phpcompta/trunk/include/compta_ach.inc.php
===================================================================
--- phpcompta/trunk/include/compta_ach.inc.php 2011-11-02 20:21:55 UTC (rev
4297)
+++ phpcompta/trunk/include/compta_ach.inc.php 2011-11-02 21:45:11 UTC (rev
4298)
@@ -29,48 +29,11 @@
require_once('class_ipopup.php');
$gDossier=dossier::id();
-$p_action=(isset($_REQUEST['p_action']))?$_REQUEST['p_action']:'';
-
$cn=new Database(dossier::id());
//menu = show a list of ledger
$str_dossier=dossier::get();
$ac="ac=".$_REQUEST['ac'];
-$array=array(
- array('?ledger_type=ACH&sa=n&'.$str_dossier."&$ac",_('Nouvelle
dépense'),_('Nouvel achat ou dépense'),1),
- array('?ledger_type=ACH&sa=l&'.$str_dossier."&$ac",_('Liste
achat'),_('Liste des achats'),2),
- array('?ledger_type=ACH&sa=lnp&'.$str_dossier."&$ac",_('Liste
dépenses non payées'),_('Liste des ventes non payées'),3)
- );
-$sa=(isset ($_REQUEST['sa']))?$_REQUEST['sa']:-1;
-$def=1;
-switch ($sa)
-{
-case 'n':
- $def=1;
- $use_predef=0;
- break;
-case 'p':
- $def=1;
- $use_predef=1;
- break;
-case 'l':
- $def=2;
- break;
-case 'lnp':
- $def=3;
- break;
-}
-//if ( $_REQUEST['p_action'] == 'fournisseur') $def=5;
-echo '<div class="lmenu">';
-echo ShowItem($array,'H','mtitle','mtitle',$def);
-echo '</div>';
-$href=basename($_SERVER['PHP_SELF'])."?$ac&$str_dossier";
-//----------------------------------------------------------------------
-// Encode a new invoice
-// empty form for encoding
-//----------------------------------------------------------------------
-if ( $def==1 || $def == 4 )
-{
// Check privilege
if ( isset($_REQUEST['p_jrn']))
if ( $g_user->check_jrn($_REQUEST['p_jrn']) != 'W' )
@@ -96,13 +59,14 @@
if ( ! isset($correct))
{
echo '<div class="content">';
+ echo h2info('Confirmation');
+ echo '<h2 id="jrn_name">'.$Ledger->get_name().'</h2>';
- echo '<form action="'.$href.'" enctype="multipart/form-data"
method="post">';
- echo HtmlInput::hidden('sa','n');
- echo HtmlInput::hidden('p_action','ach');
+ echo '<form enctype="multipart/form-data" method="post">';
echo dossier::hidden();
+
echo $Ledger->confirm($_POST );
- echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+ echo HtmlInput::hidden('ac',$_REQUEST['ac']);
$chk=new ICheckBox();
$chk->selected=false;
echo '<div style="float:left;clear:both">';
@@ -139,9 +103,13 @@
alert($e->getMessage());
$correct=1;
}
+ // record the invoice
if ( ! isset($correct))
{
echo '<div class="content">';
+
+ echo '<h2 id="jrn_name">'.$Ledger->get_name().'</h2>';
+
$Ledger=new Acc_Ledger_Purchase($cn,$_POST['p_jrn']);
$internal=$Ledger->insert($_POST);
@@ -157,7 +125,7 @@
/* Show button */
$jr_id=$cn->get_value('select jr_id from jrn where
jr_internal=$1',array($internal));
- echo '<h2 class="info"
style="margin-left:20%;width:60%;margin-right:20%;">'.$Ledger->get_name().'</h2>';
+ echo '<h2 class="info"> Enregistrement </h2>';
echo "<h2 >"._('Opération sauvée')." $internal ";
if ( $Ledger->pj != '') echo ' Piece : '.h($Ledger->pj);
echo "</h2>";
@@ -174,7 +142,8 @@
$obj->save_extra($Ledger->jr_id,$_POST);
printf ('<a class="detail" style="display:inline"
href="javascript:modifyOperation(%d,%d)">%s</a><hr>',
$jr_id,dossier::id(),$internal);
- echo HtmlInput::button_anchor(_('Nouvelle
dépense'),$href.'?p_action=ach&sa=n&'.dossier::get());
+ // Feedback
+ echo $Ledger->confirm($_POST,true);
echo '</div>';
exit();
}
@@ -185,14 +154,13 @@
// ------------------------------
echo '<div class="content">';
- echo "<FORM class=\"print\"NAME=\"form_detail\" METHOD=\"POST\" >";
+ //
+
$array=(isset($_POST['correct'])||isset ($correct))?$_POST:null;
$Ledger=new Acc_Ledger_Purchase($cn,0);
-//
-// pre defined operation
-//
+
if ( !isset($_REQUEST ['p_jrn']))
{
$def_ledger=$Ledger->get_first('ach');
@@ -201,9 +169,23 @@
else
$Ledger->id=$_REQUEST ['p_jrn'];
+ echo '<h2 id="jrn_name">'.$Ledger->get_name().'</h2>';
+// pre defined operation
+//
+ echo '<form method="GET" action="do.php">';
+ echo dossier::hidden();
+ echo HtmlInput::hidden('p_jrn_predef',$Ledger->id);
+ echo HtmlInput::hidden('ac',$_REQUEST['ac']);
+ $op=new Pre_op_ach($cn);
+ $op->set('ledger',$Ledger->id);
+ $op->set('ledger_type',"ACH");
+ $op->set('direct','f');
+ echo $op->form_get();
+ echo '</form>';
+ echo "<FORM class=\"print\"NAME=\"form_detail\" METHOD=\"POST\" >";
/* request for a predefined operation */
- if ( isset($use_predef) && $use_predef == 1 && isset($_REQUEST['pre_def'])
)
+ if ( isset($_GET['use_opd']) && isset($_REQUEST['pre_def']) && !
isset($_POST['correct']))
{
// used a predefined operation
//
@@ -240,112 +222,22 @@
echo '</div>';
echo "</FORM>";
- echo '<form method="GET" action="'.$href.'">';
- echo HtmlInput::hidden("sa","p");
- echo HtmlInput::hidden("p_action","ach");
- echo dossier::hidden();
- echo HtmlInput::hidden('p_jrn_predef',$Ledger->id);
- $op=new Pre_op_ach($cn);
- $op->set('ledger',$Ledger->id);
- $op->set('ledger_type',"ACH");
- $op->set('direct','f');
- echo $op->form_get();
+ if ( ! isset ($_POST['e_date'])) echo create_script(" get_last_date()");
- echo '</form>';
- echo create_script(" get_last_date()");
-
echo '</div>';
exit();
-}
+// end record invoice
+
+
//-------------------------------------------------------------------------------
// Listing
//--------------------------------------------------------------------------------
if ( $def == 2 )
{
- echo '<div class="content">';
-// Check privilege
- if ( isset($_REQUEST['p_jrn']) &&
- $g_user->check_jrn($_REQUEST['p_jrn']) == 'X')
- {
- NoAccess();
- exit -1;
- }
- $Ledger=new Acc_Ledger_Purchase($cn,0);
- if ( !isset($_REQUEST['p_jrn']))
- {
- $Ledger->id=-1;
- }
- else
- $Ledger->id=$_REQUEST['p_jrn'];
- echo $Ledger->display_search_form();
- //------------------------------
- // UPdate the payment
- //------------------------------
- if ( isset ( $_GET ['paid']))
- {
- $Ledger->update_paid($_GET);
- }
- $p_array=$_GET;
- /* by default we should the default period */
- if ( ! isset($p_array['date_start']))
- {
- $period=$g_user->get_periode();
- $per=new Periode($cn,$period);
- list($date_start,$date_end)=$per->get_date_limit();
- $p_array['date_start']=$date_start;
- $p_array['date_end']=$date_end;
- }
- /* compute the sql stmt */
- list($sql,$where)=$Ledger->build_search_sql($p_array);
-
- $max_line=$cn->count_sql($sql);
-
- $step=$_SESSION['g_pagesize'];
- $page=(isset($_GET['offset']))?$_GET['page']:1;
- $offset=(isset($_GET['offset']))?$_GET['offset']:0;
- $bar=jrn_navigation_bar($offset,$max_line,$step,$page);
-
-
- echo '<form method="GET" id="fpaida" class="print" action="'.$href.'">';
- echo HtmlInput::hidden("sa","l");
- echo HtmlInput::hidden("p_action","ach");
- echo dossier::hidden();
- echo $bar;
- list($count,$html)= $Ledger->list_operation($sql,$offset,1);
- echo $html;
- echo $bar;
-
$r=HtmlInput::get_to_hidden(array('l','date_start','date_end','desc','amount_min','amount_max','qcode','accounting','unpaid','gDossier','ledger_type','p_action'));
- if (isset($_GET['r_jrn'])) {
- foreach ($_GET['r_jrn'] as $k=>$v)
- $r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
- }
- echo $r;
-
- echo '<p>'.HtmlInput::submit('paid',_('Mise à jour
paiement')).IButton::select_checkbox('fpaida').IButton::unselect_checkbox('fpaida').'</p>';
-
- echo '</form>';
- /*
- * Export to csv
- */
-
$r=HtmlInput::get_to_hidden(array('l','date_start','date_end','desc','amount_min','amount_max','qcode','accounting','unpaid','gDossier','ledger_type','p_action'));
- if (isset($_GET['r_jrn'])) {
- foreach ($_GET['r_jrn'] as $k=>$v)
- $r.=HtmlInput::hidden('r_jrn['.$k.']',$v);
- }
- echo '<form action="export.php" method="get">';
- echo $r;
- echo HtmlInput::hidden('act','CSV/histo');
- echo HtmlInput::submit('viewsearch','Export vers CSV');
-
- echo '</form>';
-
- echo '</div>';
- exit();
-
}
//---------------------------------------------------------------------------
// Listing unpaid
Added: phpcompta/trunk/include/history_operation.inc.php
===================================================================
--- phpcompta/trunk/include/history_operation.inc.php
(rev 0)
+++ phpcompta/trunk/include/history_operation.inc.php 2011-11-02 21:45:11 UTC
(rev 4298)
@@ -0,0 +1,137 @@
+<?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
+ *
+ */
+require_once 'class_acc_ledger_purchase.php';
+require_once 'class_acc_ledger_fin.php';
+require_once 'class_acc_ledger_sold.php';
+require_once 'class_acc_ledger.php';
+global $g_user,$cn;
+
+if ( isset ($_GET['ledger_type']))
+{
+ $ledger_type=$_GET['ledger_type'];
+ switch($ledger_type)
+ {
+ case 'ACH':
+ $Ledger = new Acc_Ledger_Purchase($cn, 0);
+ break;
+ case 'ODS':
+ $Ledger=new Acc_Ledger($cn,0);
+ break;
+ case 'VEN':
+ $Ledger=new Acc_Ledger_Sold($cn,0);
+ break;
+
+ }
+}
+echo '<div class="content">';
+// Check privilege
+if (isset($_REQUEST['p_jrn']) &&
+ $g_user->check_jrn($_REQUEST['p_jrn']) == 'X')
+{
+
+ NoAccess();
+ exit - 1;
+}
+
+
+if (!isset($_REQUEST['p_jrn']))
+{
+ $Ledger->id = -1;
+}
+else
+ $Ledger->id = $_REQUEST['p_jrn'];
+echo $Ledger->display_search_form();
+//------------------------------
+// UPdate the payment
+//------------------------------
+if (isset($_GET ['paid']))
+{
+ $Ledger->update_paid($_GET);
+}
+$p_array = $_GET;
+
+/* by default we should the default period */
+if (!isset($p_array['date_start']))
+{
+ $period = $g_user->get_periode();
+ $per = new Periode($cn, $period);
+ list($date_start, $date_end) = $per->get_date_limit();
+ $p_array['date_start'] = $date_start;
+ $p_array['date_end'] = $date_end;
+}
+/* compute the sql stmt */
+list($sql, $where) = $Ledger->build_search_sql($p_array);
+
+$max_line = $cn->count_sql($sql);
+
+$step = $_SESSION['g_pagesize'];
+$page = (isset($_GET['offset'])) ? $_GET['page'] : 1;
+$offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;
+$bar = jrn_navigation_bar($offset, $max_line, $step, $page);
+
+
+echo '<form method="GET" id="fpaida" class="print">';
+echo HtmlInput::hidden("ledger_type", "ACH");
+echo HtmlInput::hidden("ac", $_REQUEST['ac']);
+echo dossier::hidden();
+echo $bar;
+list($count, $html) = $Ledger->list_operation($sql, $offset, 1);
+echo $html;
+echo $bar;
+$r = HtmlInput::get_to_hidden(array('l', 'date_start', 'date_end', 'desc',
'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier',
'ledger_type', 'p_action'));
+if (isset($_GET['r_jrn']))
+{
+ foreach ($_GET['r_jrn'] as $k => $v)
+ $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v);
+}
+echo $r;
+
+echo '<p>' . HtmlInput::submit('paid', _('Mise à jour paiement')) .
IButton::select_checkbox('fpaida') . IButton::unselect_checkbox('fpaida') .
'</p>';
+
+echo '</form>';
+/*
+ * Export to csv
+ */
+$r = HtmlInput::get_to_hidden(array('l', 'date_start', 'date_end', 'desc',
'amount_min', 'amount_max', 'qcode', 'accounting', 'unpaid', 'gDossier',
'ledger_type', 'p_action'));
+if (isset($_GET['r_jrn']))
+{
+ foreach ($_GET['r_jrn'] as $k => $v)
+ $r.=HtmlInput::hidden('r_jrn[' . $k . ']', $v);
+}
+echo '<form action="export.php" method="get">';
+echo $r;
+echo HtmlInput::hidden('act', 'CSV/histo');
+echo HtmlInput::submit('viewsearch', 'Export vers CSV');
+
+echo '</form>';
+
+echo '</div>';
+exit();
+?>
Modified: phpcompta/trunk/include/template/ledger_detail_ach.php
===================================================================
--- phpcompta/trunk/include/template/ledger_detail_ach.php 2011-11-02
20:21:55 UTC (rev 4297)
+++ phpcompta/trunk/include/template/ledger_detail_ach.php 2011-11-02
21:45:11 UTC (rev 4298)
@@ -18,7 +18,7 @@
$date=new
IDate('p_date');
$date->value=format_date($obj->det->jr_date);
echo
td('Date').td($date->input());
-
+
?>
</td>
<tr>
@@ -27,16 +27,16 @@
$date_ech=new
IDate('p_ech');
$date_ech->value=format_date($obj->det->jr_ech);
echo
td('Echeance').td($date_ech->input());
-
+
?>
</td>
</tr>
-
+
<tr><td>
<?
$bk=new
Fiche($cn,$obj->det->array[0]['qp_supplier']);
echo td(_('Client'));
-
+
$view_history=
sprintf('<A class="detail" HREF="javascript:view_history_card(\'%s\',\'%s\')"
>%s</A>',
$bk->id, $gDossier, $bk->get_quick_code());
echo
td(h($bk->getName())).td($view_history);;
@@ -45,21 +45,21 @@
</tr>
<tr>
<td>
- <?
+ <?
$itext=new IText('npj');
$itext->value=$obj->det->jr_pj_number;
echo
td(_('Pièce')).td($itext->input());
?>
- </td>
+ </td>
<tr>
<td>
- <?
+ <?
$itext=new
IText('lib');
$itext->value=$obj->det->jr_comment;
$itext->size=40;
echo
td(_('Libellé')).td($itext->input(),' colspan="2" ');
-
-
+
+
?>
</td>
</tr>
@@ -79,7 +79,7 @@
$inote->value=$obj->det->note;
echo $inote->input();
?>
-
+
</td>
</tr>
</table>
@@ -106,7 +106,7 @@
echo th(_('HTVA'), 'style="text-align:right"');
echo th(_('TVA'), 'style="text-align:right"');
echo th(_('TVAC'), 'style="text-align:right"');
-}else
+}else
echo th(_('Total'), 'style="text-align:right"');
if ($owner->MY_ANALYTIC != 'nu' && $div=='popup'){
@@ -119,9 +119,9 @@
/* add hidden variables pa[] to hold the value of pa_id */
echo Anc_Plan::hidden($a_anc);
}
-echo '</tr>';
+echo '</tr>';
for ($e=0;$e<count($obj->det->array);$e++) {
- $row='';
+ $row='';
$q=$obj->det->array[$e];
$fiche=new Fiche($cn,$q['qp_fiche']);
$view_history= sprintf('<A class="detail" style="text-decoration:underline"
HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>',
@@ -130,7 +130,7 @@
$row=td($view_history);
$sym_tva='';
- if ( $owner->MY_TVA_USE=='Y') {
+ if ( $owner->MY_TVA_USE=='Y' && $q['qp_vat_code'] != '') {
/* retrieve TVA symbol */
$tva=new Acc_Tva($cn,$q['qp_vat_code']);
$tva->load();
@@ -169,9 +169,9 @@
echo HtmlInput::hidden('op[]',$anc_op->j_id);
/* compute total price */
bcscale(2);
-
+
$row.=$anc_op->display_table(1,$htva,$div);
-
+
} else {
$row.=td('');
}
@@ -194,7 +194,7 @@
<?=_('Ecritures comptables')?>
</legend>
-<?
+<?
/* if it is not in a popup, the details are hidden */
if ( $div != 'popup') {
$ib=new IButton ("a".$div);
@@ -206,7 +206,7 @@
$ib->label='Cacher';
$ib->javascript="g('detail_".$div."').style.display='none';g('a".$div."').style.display='block';";
echo $ib->input();
- } else
+ } else
echo '<div class="content">';
$detail=new Acc_Misc($cn,$obj->jr_id);
$detail->get();
@@ -238,7 +238,7 @@
/* $row=td($q[$e]['j_poste']); */
/* $row.=td($q[$e]['j_qcode']); */
if ( $q[$e]['j_qcode'] !='') {
- // nom de la fiche
+ // nom de la fiche
$ff=new Fiche($cn);
$ff->get_by_qcode( $q[$e]['j_qcode']);
$row.=td($ff->strAttribut(h(ATTR_DEF_NAME)));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4298 - in phpcompta/trunk/include: . template,
phpcompta-dev <=