/**
*
*/
- private function updateEntry($trans_id,$entry)
+ public function updateEntry($trans_id,$entry)
{
$entry_id = $entry['entry_id'];
if ( isset($entry['key_charge']) )
return $page;
}
- public function updatePost($_id)
+ public function updatePost()
{
- require_once(controler::$basedir."/views/transaction_update.php");
- $this->_model->get($_id);
- $page = new \compta\views\transaction\Update($this->_model);
+ require_once(controler::$basedir."/views/transaction_detail.php");
+ //$this->_model->get($_id);
+ $page = new \compta\views\transaction\Detail($this->_model);
+ return $page;
+ }
+ /**
+ * If successfull update, show detail, or else
+ * show entry with Field on Error. For instance
+ * - account not leaf or does not exists
+ * - amount in debit and credit
+ * - amount is zero in debit and credit
+ */
+ public function updateEntryPost()
+ {
+ require_once(controler::$basedir."/views/transaction_detail.php");
+ //$this->_model->get($_id);
+ // TODO: Get entry check result from model
+ $page = new \compta\views\transaction\Detail($this->_model);
return $page;
}
+
+ /**
+ * Display a transaction entry
+ */
+ public function entry($_tid,$_eid)
+ {
+ $model = $this->_model;
+ require_once(controler::$basedir."/views/transaction_entry.php");
+ $model->get($_tid);
+ $model->setEditEntry($_eid);
+ $page = new \compta\views\transaction\Entry($this->_model);
+ return $page;
+ }
+
+ public function search()
+ {
+ }
+
+ public function searchPost()
+ {
+ }
}
?>
$i = 0;
foreach( get_object_vars($this) as $k => $v)
{ $this->{$k} = $c[$i++]; }
+ } else
+ {
+ $this->id = -1;
}
}
/**
}
}
/**
- * Required by JsonSerializable
+ * Required by JsonSerializable. Aligned with api_booking update_Entry
*/
public function jsonSerialize()
{
return [
- 'id' => $this->id
+ 'entry_id' => $this->id
, 'entry_date' => $this->entry_date
, 'entry_type' => $this->entry_type
, 'acc_id' => $this->acc_id
{
private $summary;
-
- private $_entries;
+ private $editEntry = 0;
+
+ private $formValid = false;
+
public $_id;
public $_mouvements;
+
+ private $updatePostParams = Array( "id", "rec_trans_date" ,"rec_voucher_date" ,"rec_voucher_ref"
+ , "rec_trans_label" );
+ private $updatePostCheck = Array( "", "str_date" ,"str_date" ,"str"
+ , "str");
+ private $updateEntryPostParams = Array( "id", "rec_trans_date" ,"rec_voucher_date" ,"rec_voucher_ref"
+ , "rec_trans_label" );
+ private $updateEntryPostCheck = Array( "", "str_date" ,"str_date" ,"str"
+ , "str");
+ public $_entries = Array(); // Array of entries
/**
* Constructor
*/
{
$this->_session = $_sess;
$this->_auth_cfg = $_auth;
+ $this->_summary = new Transaction();
+ if (\AEB::$REQUEST['btRURecord'] != null)
+ {
+ $this->FormValid = $this->getUpdatePost();
+ }
+ if (\AEB::$REQUEST['btRNRecord'] != null)
+ {
+ $this->FormValid = $this->getUpdatePost();
+ }
+ /* view entry */
+ if (\AEB::$REQUEST['editEntry'] != null)
+ {
+ try
+ {
+ $this->setEditEntry ( \AEB::$REQUEST['editEntry'] );
+ } catch (Exception $e)
+ {
+ }
+ }
+ /* updateEntry */
+ if (\AEB::$REQUEST['btUpdateEntry'] != null)
+ {
+ $e = null;
+ try
+ {
+ list($this->formValid,$e) = $this->getUpdateEntryPost ( );
+ if ($this->formValid == true )
+ {
+ $this->updateEntry($this->_id,$e);
+
+ $this->get($this->_id);
+ } else
+ {
+ $this->get($this->_id);
+ }
+ } catch (Exception $e)
+ {
+ $this->get($this->_id);
+ }
+ }
}
+
private function getSession()
{
return $this->_session;
}
+
+ /**
+ * \brief Verify that $e is a number. Throw an Exception if it's not the case
+ *
+ */
+ public function setEditEntry($e)
+ {
+ $v = new \Validator();
+ $v->num_int($e,"Failed edit_entry not int");
+ $this->editEntry = $e;
+ }
+
+ /**
+ * \brief Return true if the given Entry matches the one to be edited.
+ */
+ public function isEntryEdit($e)
+ {
+ if ( ( $e->id == $this->editEntry ) && ( $this->editEntry != 0 ) )
+ {
+ return true;
+ }
+ return false;
+ }
/**
* Get Transaction data from Database
*/
}
$this->_summary = new Transaction($r['transaction']);
}
+
+ /**
+ * Get Transaction data from Database
+ */
+ private function updateEntry($trans_id,$e)
+ {
+ $_cfg = $this->_auth_cfg;
+ $pcmn = new \Booking( $this->getSession()
+ , $_cfg
+ , $this->getSession()->getDb());
+ $r = $pcmn->updateEntry($trans_id,$e->jsonSerialize()); // Get Transaction
+ }
public function getEntries()
{
return $this->_entries;
}
+ /**
+ * Get Form Parameters in case of post Transaction
+ */
+ private function getUpdateEntryPost()
+ {
+ $formValid = true;
+ $count = 0;
+ $valid = true;
+ $v = new \Validator();
+ $this->_id = \AEB::$REQUEST["entry_trans_id"];
+
+ $k = "entry_"; // Check if that key exists
+ $arr = Array("id","acc_id","entry_type","amount_debit","amount_credit");
+ $check = Array("num_int","num_int","","num_float","num_float");
+ $e = new Entry();
+
+ // Check unique parameters
+ foreach ( $arr as $param)
+ {
+ $p = $k.$param;
+ $pv = \AEB::$REQUEST[$p];
+ try {
+ $ck = $check[$count++];
+ if ($ck != "" and $pv != "")
+ {
+ if ($ck == "num_float" and $pv!= "")
+ {
+ $pv = number_format(floatval($pv),3,'.',',');
+ }
+ $v->{$ck}($pv,"Not valid ".$param." va=".$pv."\n");
+ }
+ if ($param == 'amount_debit' and $pv != 0.0 )
+ {
+ $e->amount = $pv;
+ $e->dc = 'd';
+ } else if ($param == 'amount_credit' and $pv != 0.0)
+ {
+ $e->amount = $pv;
+ $e->dc = 'c';
+ } else
+ $e->{$param} = $pv;
+ }
+ catch (\Exception $exp)
+ {
+ error_log("Parameter failure:".$exp->getMessage()."\n");
+ $formValid = false;
+ }
+ }
+ // Only add Entries with an amount not equal to 0.
+ if ($e->amount == 0.0 or ($e->acc_id == -1))
+ {
+ $formValid = false;
+ }
+ return array($formValid,$e);
+
+ }
+ /**
+ * Get Form Parameters in case of post Transaction
+ */
+ private function getUpdatePost()
+ {
+ $formValid = true;
+ $count = 0;
+ $valid = true;
+ $v = new \Validator();
+ $this->id = \AEB::$REQUEST['rec_id'];
+ $this->summary->id = $this->id;
+ // Check unique parameters
+ $f = reset($this->updatePostParams);
+ foreach ( $this->updatePostParams as $param)
+ {
+ if ($f == $param )
+ {
+ $count++;
+ continue; // skip first element.
+ }
+ $pv = \AEB::$REQUEST[$param];
+ try
+ {
+ $ck = $this->updatePostCheck[$count++];
+ if ($ck != "")
+ {
+ $v->{$ck}($pv,"Not valid ".$param." value=".$pv."\n");
+ }
+ // TODO remove once solved
+ $this->{$param} = $pv;
+ $this->summary->{str_replace("rec_","",$param)} = $pv;
+ }
+ catch (\Exception $e)
+ {
+ error_log("Parameter failure ".$e->getMessage());
+ $formValid = false;
+ }
+ }
+ // Get Through post Entries
+ $count = 0;
+ for ( ; $count < 15 ; $count++)
+ {
+ $k = 'entry'.$count.'_id'; // Check if that key exists
+ if ( \AEB::$REQUEST->offsetExists($k) == true)
+ {
+ if ( ! $this->getEntryPost(\AEB::$REQUEST[$k],$count,$v) )
+ {
+ $formValid = false;
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ /**
+ * Retrieve the parameters from one line.
+ */
+ private function getEntryPost($id,$line,$v)
+ {
+ $fvalid = true; // Form entry is valid
+ $k = "entry".$line.'_'; // Check if that key exists
+ $arr = Array("acc_id","acc_name","entry_type","amount_debit","amount_credit");
+ $check = Array("num_int","","","num_float","num_float");
+ $e = new Entry();
+ $e->id = $id;
+ $count = 0;
+ if ($line == -1)
+ {
+ $k = "entry_";
+ }
+ // Check unique parameters
+ foreach ( $arr as $param)
+ {
+ $p = $k.$param;
+ $pv = \AEB::$REQUEST[$p];
+ try {
+ $ck = $check[$count++];
+ if ($ck != "")
+ {
+ $v->{$ck}($pv,"Not valid ".$param." va=".$pv."\n");
+ }
+ if ($param == 'amount_debit' and $pv != 0.0 )
+ {
+ $e->amount = $pv;
+ $e->dc = 'd';
+ } else if ($param == 'amount_credit' and $pv != 0.0)
+ {
+ $e->amount = $pv;
+ $e->dc = 'c';
+ } else
+ $e->{$param} = $pv;
+ }
+ catch (\Exception $exp)
+ {
+ error_log("Parameter failure:".$exp->getMessage());
+ $fvalid = false;
+ }
+ }
+ // Only add Entries with an amount not equal to 0.
+ if ($e->amount != 0.0 and ($e->acc_id != -1))
+ {
+ $this->_entries[] = $e;
+ }
+ return $fvalid;
+ }
+
+ /**
+ * Adapter method Return entry account type
+ * Eg: BQ, VT, AO, AN
+ */
+ public function getEntryTypes()
+ {
+ $_cfg = $this->_auth_cfg;
+ $pcmn = new \Retrieve( $this->getSession()
+ , $_cfg
+ , $this->getSession()->getDb());
+ $r = $pcmn->getEntryTypes( ); // Get Transaction
+ return $r;
+ }
+
+ /**
/**
* Required by JsonSerializable
*/
{
return [
'transi' => $this->_summary
- , 'entries' => $this->_entries];
+ , 'entries' => $this->_entries
+ ];
}
}
$r->get('/transaction/',"transaction#index")->setRoot($ctrl_dir);
$r->get('/transaction/nouveau',"transaction#nouveau")->setRoot($ctrl_dir);
$r->get('/transaction/detail/?:id',"transaction#detail")->setRoot($ctrl_dir);
+$r->get('/transaction/entry/?:id/?:eid',"transaction#entry")->setRoot($ctrl_dir);
$r->get('/transaction/remove/?:id',"transaction#remove")->setRoot($ctrl_dir);
+$r->get('/transaction/removeEntry/?:id/?:eid',"transaction#removeEntry")->setRoot($ctrl_dir);
$r->get('/transaction/update/?:id',"transaction#update")->setRoot($ctrl_dir);
$r->post('/transaction/updatePost',"transaction#updatePost")->setRoot($ctrl_dir);
+$r->post('/transaction/updateEntryPost',"transaction#updateEntryPost")->setRoot($ctrl_dir);
/* Bilan services*/
$r->get('/bilan',"bilan#index")->setRoot($ctrl_dir);
</tbody>
<tfoot>
<tr><td id="accSoldeCompte" colspan="3">Solde:</td>
- <td id="accSoldeDebit" style="text-align:right;" >0.0</td>
- <td id="accSoldeCredit" style="text-align:right;" >0.0</td>
+ <td id="accSoldeDebit" style="text-align:right;" ></td>
+ <td id="accSoldeCredit" style="text-align:right;" ></td>
</tr>
</tfoot>
</table>
$retour->setAttribute('link',"/app/compta/services.php/".\AEB::$REQUEST['b']);
// Ok Handle solde
$solde = $this->getElementById($xml,"accSoldeCompte");
+ $solde_debit = $this->getElementById($xml,"accSoldeDebit");
+ $solde_credit = $this->getElementById($xml,"accSoldeCredit");
$el = $xml->createTextNode("compte ".$this->_model->_solde[2]);
$solde->appendChild($el);
+ $el = $xml->createTextNode("".$this->_model->_solde[0]);
+ $solde_debit->appendChild($el);
+ $el = $xml->createTextNode("".$this->_model->_solde[1]);
+ $solde_credit->appendChild($el);
}
/**
$template=<<<_EOF
<tr class="%s">
<td style="text-align:left">%s</td>
-<td style="text-align:right"><link href="/app/compta/services.php/transaction/detail/%s">%s</link></td>
+<td style="text-align:right"><link href="/app/compta/services.php/transaction/detail/%s?b=%s">%s</link></td>
<td>%s</td>
<td style="text-align:right">%s</td>
<td style="text-align:right;color:%s">%s</td></tr>
_EOF;
$frag = "";
$count = 0;
+ $back = \AEB::$REQUEST['b'].":/account/detail/".$this->_model->_id;
$lst = $this->_model->_mouvements;
foreach( $lst as $row)
{
$debit = sprintf("%.2f",$row[3]);
$credit = sprintf("%.2f",$row[4]);
$frag.=sprintf($template
- ,++$count % 2?"odd":"even" ,$row[0],$row[5] ,$row[1],$row[2]
+ ,++$count % 2?"odd":"even"
+ ,$row[0]
+ ,$row[5] ,$back,$row[1]
+ ,$row[2]
,$row[3] == 0.0 ? "" : $debit
,$row[2] > $row[3] ? "red" : "black"
,$row[4] == 0.0? "" : $credit);
// Update return link
$retour = $this->getElementById($xml,"btRetour");
$retour->removeAttribute('link');
- $retour->setAttribute('link',"/app/compta/services.php/".\AEB::$REQUEST['b']);
+ $back_array = explode(':',\AEB::$REQUEST['b']);
+ $depth = count($back_array);
+ if ($depth> 1)
+ {
+ $current_back = $back_array[$depth - 1];
+ unset( $back_array[$depth - 1] );
+
+ $b = "?b=".implode(':',$back_array);
+ $retour->setAttribute('link',"/app/compta/services.php/".$current_back.$b);
+ }else
+ {
+ $retour->setAttribute('link',"/app/compta/services.php/".\AEB::$REQUEST['b']);
+ }
// Ok Handle buttons
$panelButtons= $this->getElementById($xml,"pButtons");
$nel = $xml->createDocumentFragment();
$template=<<<_EOF
<tr class="%s">
<td style="text-align:left">%s</td>
-<td style="text-align:right"><link href="/app/compta/services.php/transaction/detail/%s">%s</link></td>
+<td style="text-align:right"><link href="/app/compta/services.php/transaction/entry/%s/%s">%s</link></td>
<td>%s</td>
<td style="text-align:right">%s</td>
<td style="text-align:right;color:%s">%s</td></tr>
_EOF;
$frag = "";
$count = 0;
+ $model = $this->_model;
$lst = $this->_model->_mouvements;
+ //$lst = $this->_model->_entries;
foreach( $lst as $row)
{
+ //$row = $row_entry->jsonSerialize();
$debit = $row[4] == 'd'?sprintf("%.2f",$row[5]):0.0;
$credit = $row[4] == 'c'?sprintf("%.2f",$row[5]):0.0;
$frag.=sprintf($template
, ++$count % 2?"odd":"even" ,$row[1]
- , $row[2] ,$row[3],$row[6]
+ , $model->_id,$row[0] ,$row[3]
+ , $row[6] /* Type */
, $debit == 0.0 ? "" : $debit
, $debit > $credit ? "red" : "black"
, $credit == 0.0? "" : $credit);
--- /dev/null
+<?php
+
+namespace compta\views\transaction;
+
+require_once(dirname(__FILE__)."/../pages.php");
+
+require_once(dirname(__FILE__)."/../api_pcmn.php");
+require_once(dirname(__FILE__)."/../api_retrieve.php");
+
+const XmlAccount =<<<XML
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xslt-param name='alias' value='/andre/'?>
+<?xml-stylesheet type="text/xsl" href="xsl/gui.xsl?alias='/andre/'"?>
+<gui langue='fr' style="padding: 0;">
+<liens/>
+<title langue='fr'>Gestion comptable</title>
+<content>
+ <script>
+ </script>
+ <script>
+ </script>
+
+<menu>
+ <item id="btRetour" link="/app/compta/services.php/" class="" title="Retour" />
+</menu>
+
+<form method="POST" action="/app/compta/services.php/transaction/updateEntryPost">
+ <panel id="pAccount" class="col-12 pg-account" style="min-height:150px;">
+ <h2 id="title" style="width:100%">Transaction</h2>
+ <p id="date" style="width:100%" >Date de Saisie : </p>
+ <p id="voucher_date" style="width:100%">Date Facture : </p>
+ <p id="voucher_ref" style="width:100%" >Réference Facture: </p>
+ <table id="tAccount" autoScroll='true' height="200" style="margin:15px 30px 15px 0px; padding:15px 0px 0px 0px;" >
+ <caption>Détail Transaction</caption>
+ <thead resp-width="100%">
+ <tr>
+ <th resp-width="10%">Date</th>
+ <th resp-width="20%">Account</th>
+ <th resp-width="30%">Account name</th>
+ <th resp-width="10%">Type</th>
+ <th resp-width="15%">Débit</th>
+ <th resp-width="15%">Crédit</th></tr>
+ </thead>
+ <tbody style="overflow:auto;">
+ </tbody>
+ <tfoot>
+ <tr><td id="accSoldeCompte" colspan="3">Solde:</td>
+ <td id="accSoldeDebit" style="text-align:right;" >0.0</td>
+ <td id="accSoldeCredit" style="text-align:right;" >0.0</td>
+ </tr>
+ </tfoot>
+ </table>
+ </panel>
+ <panel id="pButtons" resp-width="98%" class="col-12" style="min-height:14px;">
+ <!-- -->
+ </panel>
+ </form>
+ <div class="clearfix"></div>
+ <!-- Script Section -->
+ </content>
+</gui>
+XML;
+/**
+ * @brief Update GUI with the list of
+ * documents available. All decomptes
+ */
+class Entry extends \PageCompta
+ implements \IActionResult
+{
+ /* To fill combo with right selection */
+ private $selected_type = 'BQ';
+
+ function __construct($model)
+ {
+ $this->_model = $model;
+ parent::__construct(XmlAccount,true);
+ }
+
+ public function render()
+ {
+ $this->show();
+ }
+
+ /**
+ * @brief insert a script in the page to update menu link
+ *
+ */
+ private function script()
+ {
+ $s=<<<_EOF
+<script>
+(function() {
+ var mh1a = $('mh1').firstChild;
+ mh1a.href = "page_ledger.php";
+})();
+(function() {
+ var h, a, f;
+ a = document.getElementsByTagName('link');
+ for (h = 0; h < a.length; h++) {
+ f = a[h];
+ if (f.rel.toLowerCase().match(/stylesheet/) && f.href) {
+ var g = f.href.replace(/(&|\?)rnd=\d+/, '');
+ f.href = g + (g.match(/\?/) ? '&' : '?');
+ f.href += 'rnd=' + (new Date().valueOf());
+ }
+ } // for
+})()
+
+</script>
+_EOF;
+ echo $s;
+ }
+
+ /**
+ * @brief allow sub classes to modify xml file
+ */
+ protected function _updateXML(&$xml)
+ {
+ $buttons=<<<_EOF
+ <button id='btTrBack' href="/app/compta/services.php/transaction/detail/{$this->_model->_id}" style="float:left;">Retour</button>
+ <button id='btUpdateEntry' type="submit" style="float:left;margin-right: 15px;">Modifier</button>
+ <button id='btTrErase' style="float:left;" href="/app/compta/services.php/transaction/removeEntry/{$this->_model->_id}">Supprimer</button>
+_EOF;
+ $sum = $this->_model->_summary->jsonSerialize();
+ $fields= Array('title','date','voucher_ref','voucher_date');
+ $values= Array($sum['trans_label'],$sum['trans_date'],$sum['voucher_ref'],$sum['voucher_date']);
+ $tbody = $xml->getElementsByTagName('tbody');
+ $f = $tbody->item(0);
+ $nel = $xml->createDocumentFragment();
+ /* Fill Table with entries */
+ $nel->appendXML($this->fillTable());
+ $f->appendChild($nel);
+ /* Update title from xml template */
+ foreach (array_keys($fields) as $key)
+ {
+ $title = $this->getElementById($xml,$fields[$key]);
+ $el = $xml->createTextNode(" ".$values[$key]);
+ $title->appendChild($el);
+ }
+ // Update return link
+ $retour = $this->getElementById($xml,"btRetour");
+ $retour->removeAttribute('link');
+ $retour->setAttribute('link',"/app/compta/services.php/".\AEB::$REQUEST['b']);
+ // Ok Handle buttons
+ $panelButtons= $this->getElementById($xml,"pButtons");
+ $nel = $xml->createDocumentFragment();
+ $nel->appendXML($buttons);
+ $panelButtons->appendChild($nel);
+ }
+
+ /**
+ * @brief Fill bilan table
+ */
+ private function fillTable()
+ {
+ $template=<<<_EOF
+<tr class="%s">
+<td style="text-align:left">%s</td>
+<td style="text-align:left">%s</td>
+<td style="text-align:right"><link href="/app/compta/services.php/transaction/entry/%s/%s">%s</link></td>
+<td>%s</td>
+<td style="text-align:right">%s</td>
+<td style="text-align:right;color:%s">%s</td></tr>
+_EOF;
+ $templateEdit=<<<_EOF
+<tr class="%s">
+<TextField type="hidden" id="entry_trans_id" style="" value="%s"></TextField>
+<TextField type="hidden" id="entry_id" style="" value="%s"></TextField>
+<td style="text-align:left">%s</td>
+<td style="text-align:left">
+<TextField width="120" id="entry_acc_id" style="" value="%s"></TextField>
+</td>
+<td style="text-align:right">%s</td>
+<td>
+ <ComboBox width="100" id="entry_entry_type" style="">
+ %s
+ </ComboBox>
+</td>
+<td style="text-align:right">
+<TextField width="120" id="entry_amount_debit" style="" value="%01.2f"></TextField>
+</td>
+<td style="text-align:right;color:%s">
+<TextField width="120" id="entry_amount_credit" style="" value="%01.2f"></TextField>
+</td>
+</tr>
+_EOF;
+ $frag = "";
+ $count = 0;
+ $model = $this->_model;
+ //$lst = $this->_model->_mouvements;
+ $lst = $this->_model->_entries;
+/**
+ public $id = -1;
+ public $entry_date = "2022-01-01"; // Could be HA, AN, what ever
+ public $acc_id = -1;
+ public $acc_name = ""; // Account name
+ public $dc = "d"; // Debit or credit
+ public $amount = 0.0;
+ public $entry_type = "BQ"; // Could be HA, AN, what ever
+ */
+ foreach( $lst as $row)
+ {
+ $debit = $row->dc == 'd'?sprintf("%.2f",$row->amount):0.0;
+ $credit = $row->dc == 'c'?sprintf("%.2f",$row->amount):0.0;
+ if ($model->isEntryEdit($row))
+ {
+ $entryS0=<<<_EOF
+<Entry key="%s" value="%s"></Entry>
+_EOF;
+ $entryS1=<<<_EOF
+<Entry key="%s" value="%s" selected="" ></Entry>
+_EOF;
+ $types = $model->getEntryTypes();
+ $selected = "";
+ foreach ($types as $t)
+ {
+ if ($t[0] == $row->entry_type)
+ {
+ $selected.=sprintf($entryS1,$t[1],$t[0]);
+ } else
+ {
+ $selected.=sprintf($entryS0,$t[1],$t[0]);
+ }
+ }
+ $frag.=sprintf($templateEdit
+ , ++$count % 2?"odd":"even"
+ , $model->_id
+ , $row->id
+ , $row->entry_date
+ , $row->acc_id /* Account ID */
+ , $row->acc_name
+ , $selected /* Type */
+ , $debit == 0.0 ? "" : $debit
+ , $debit > $credit ? "red" : "black"
+ , $credit == 0.0? "" : $credit);
+ } else
+ {
+ $frag.=sprintf($template
+ , ++$count % 2?"odd":"even" ,$row->entry_date
+ , $row->acc_id /* Account ID */
+ , $model->_id,$row->id ,$row->acc_name
+ , $row->entry_type /* Type */
+ , $debit == 0.0 ? "" : $debit
+ , $debit > $credit ? "red" : "black"
+ , $credit == 0.0? "" : $credit);
+ }
+ }
+ return $frag;
+ }
+
+}
+
+?>
<groupcontent>
<FieldSet labelWidth="160" style="border:none 0px;">
<TextField type="hidden" id="rec_id" asp-for="_id" style=""></TextField>
- <TextField width="300" labelWidth="250" id="rec_desc" asp-for="_summary.trans_label" style="">
+ <TextField width="300" labelWidth="250" id="rec_trans_label" asp-for="_summary.trans_label" style="">
<Label style="">Intitulé</Label></TextField><br/>
- <TextField type="date" width="190" id="rec_next" asp-for="_summary.trans_date" style="">
+ <TextField type="date" width="190" id="rec_trans_date" asp-for="_summary.trans_date" style="">
<Label style="">Date enregistrement</Label></TextField><br/>
- <TextField type="date" width="190" id="rec_end" asp-for="_summary.voucher_date" style="">
+ <TextField type="date" width="190" id="rec_voucher_date" asp-for="_summary.voucher_date" style="">
<Label style="">Date Facture</Label></TextField><br/>
- <TextField width="300" id="rec_amount" asp-for="_summary.voucher_ref" style="">
+ <TextField width="300" id="rec_voucher_ref" asp-for="_summary.voucher_ref" style="">
<Label style="">Rérérence</Label></TextField><br />
</FieldSet>
</groupcontent>
<!--
-->
<button id='btRURecord' type="submit" style="float:left;margin-right: 15px;">Modifier</button>
- <button id='btRUCancel' href="#" style="float:left;">Annuler</button>
+ <button id='btRCCancel' href="#" style="float:left;">Annuler</button>
</panel>
</form>
</panel>