Task #0002046: Improve COMPTA/MENUACH/ACH

This commit is contained in:
sparkyx 2021-07-31 12:20:01 +02:00
parent 9118337bd4
commit 956385be16
5 changed files with 44 additions and 6 deletions

View file

@ -3253,6 +3253,21 @@ class Acc_Ledger extends jrn_def_sql
{
require NOALYSS_TEMPLATE."/acc_ledger-input_extra_info.php";
}
/**
* @brief attach action-followups to an operation,
* @param string $s_related_action action.ag_id separated by comma
* @see Acc_Operation
* @return boolean true success ,false nothing inserted
*/
function save_followup($s_related_action)
{
if ($this->jr_id == 0 || empty ($s_related_action)) { return false; }
$acc_operation=new Acc_Operation($this->cn);
$acc_operation->jr_id=$this->jr_id;
$acc_operation->insert_related_action($s_related_action);
return true;
}
}
?>

View file

@ -123,7 +123,10 @@ if (isset($_POST['record']))
/* Save the additional information into jrn_info */
$obj = new Acc_Ledger_Info($cn);
$obj->save_extra($Ledger->jr_id, $_POST);
//printf('<a class="line" style="display:inline" href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(), $internal);
/* save followup */
$Ledger->save_followup($http->request("action_gestion","string",""));
// Feedback
echo $Ledger->confirm($_POST, true);
if (isset($Ledger->doc))

View file

@ -86,8 +86,12 @@ elseif (isset($_POST['save']))
try
{
$ledger->save($array);
$jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($ledger->internal));
$jr_id=$ledger->jr_id;
/* save followup */
$ledger->save_followup($http->request("action_gestion","string",""));
echo '<h2>'._("Opération enregistrée")._("Piece") . h($ledger->pj) . '</h2>';
if (strcmp($ledger->pj, $_POST['e_pj']) != 0)
{

View file

@ -147,6 +147,10 @@ $post_jrn=$http->post("p_jrn", "string","");
/* Save the additional information into jrn_info */
$obj=new Acc_Ledger_Info($cn);
$obj->save_extra($Ledger->jr_id,$_POST);
/* save followup */
$Ledger->save_followup($http->request("action_gestion","string",""));
// extourne
if (isset($_POST['reverse_ck']))
{

View file

@ -35,16 +35,17 @@ $a_div=["template"=>"modele_div_id",
"invoice"=>"facturation_div_id",
"reverse"=>"reverse_div_id",
"type_operation"=>'operationtype_div_id',
"document"=>"document_div_id"];
"document"=>"document_div_id",
"action_gestion"=>"actiongestion_div_id"];
//-- Define option to display
// template : template of operation , invoice : doc. to generate, document : document
// to upload , reverse : reverse operation
if ( $ledger_type == 'ACH' || $ledger_type == 'VEN') {
$a_show=['template','repo','invoice','reverse'];
$a_show=['template','repo','invoice','reverse','action_gestion'];
$show="facturation_div_id";
} elseif ($ledger_type=='ODS') {
$a_show=['template','document','reverse','type_operation'];
$a_show=['template','document','reverse','type_operation','action_gestion'];
$show="document_div_id";
}
@ -81,6 +82,10 @@ $a_div=["template"=>"modele_div_id",
<?php if (in_array('type_operation',$a_show)) :?>
<li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Type opération")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'operationtype_div_id')"> <?php echo _('Type opération')?> </a></li>
<?php endif; ?>
<?php if (in_array('action_gestion',$a_show)) :?>
<li class="tabs" style="float: none"> <a href="javascript:void(0)" title="<?php echo _("Action gestion")?>" onclick="unselect_other_tab(this.parentNode.parentNode);this.parentNode.className='tabs_selected';show_tabs(a_tab,'actiongestion_div_id')"> <?php echo _('Action gestion')?> </a></li>
<?php endif; ?>
</ul>
</div>
<?php
@ -127,6 +132,13 @@ if (in_array('invoice',$a_show)) {
?>
</div>
<div id="actiongestion_div_id" style="display:none;height:185px;height:10rem">
Action gestion
<?php
$irelated_action=new IRelated_Action("action_gestion");
echo $irelated_action->input();
?>
</div>