diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index 8c873d281..b507d67ca 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -2338,6 +2338,7 @@ class Acc_Ledger extends jrn_def_sql $doc->f_id = $e_client; $doc->md_id = $gen_doc; $doc->ag_id = 0; + $p_array['e_pj']=$this->pj; $filename=""; $doc->Generate($p_array,$p_array['e_pj']); // Move the document to the jrn diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php index 946d45f75..0c664bc87 100644 --- a/include/class_acc_ledger_purchase.php +++ b/include/class_acc_ledger_purchase.php @@ -727,8 +727,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger if ( isset($_POST['gen_invoice']) ) { $ref_doc= $this->create_document($internal,$p_array); - $this->doc= _('Document généré')." : "."
"; - $this->doc.=''.$ref_doc.''; + $this->doc=''.$ref_doc.''; } //---------------------------------------- @@ -922,8 +921,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger $r=""; $r.=dossier::hidden(); - $f_legend=_("En-tête facture fournisseur"); - $f_legend_detail=_("Détail articles acheté"); + $f_legend_detail=_("Détail articles achetés"); // Date //-- @@ -988,8 +986,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger $wLedger=$this->select_ledger('ACH',2); if ($wLedger == null) exit (_('Pas de journal disponible')); $wLedger->javascript="onChange='update_predef(\"ach\",\"f\");$add_js'"; - $label=" Journal ".HtmlInput::infobulle(2) ; - + $wLedger->table=1; $f_jrn=$wLedger->input(); // Comment @@ -1000,7 +997,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger $Commentaire->size=60; $Commentaire->tabindex=3; $label=HtmlInput::infobulle(1) ; - $f_desc=$label.$Commentaire->input("e_comm",h($e_comm)); + $f_desc=$Commentaire->input("e_comm",h($e_comm)).$label; // PJ //-- @@ -1275,46 +1272,69 @@ class Acc_Ledger_Purchase extends Acc_Ledger } $date_limit=$lPeriode->get_date_limit(); $r=""; - $r.="
"; - $r.=""._('En-tête facture fournisseur')." "; - $r.='
'; - $r.='

'.$this->get_name().'

'; - $r.='
'; $r.=''; + if ( $p_summary ) { + $jr_id=$this->db->get_value('select jr_id from jrn where jr_internal=$1',array($this->internal)); + $r.=""; + $r.=''; + $r.=''; + $r.=""; + } $r.=''; - $r.=''; - $r.=''; - $r.=''; - $r.=''; - $r.=''; + $r.=''; $r.=''; $r.=''; - $r.=''; + $r.=''; $r.=''; $r.=''; - $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + $r.=''; + if ( ! $p_summary) { + $r.=''; + } else { + + if ( strcmp($this->pj,$e_pj) != 0 ) + { + $r.=''; + } else { + $r.=''; + } + } + $r.=''; + $r.=''; + $r.=''; $r.=''; $r.='
'; + $r.=_('Détail opération '); + $r.=''; + $r.=sprintf ('%s', + $jr_id,dossier::id(),$this->internal); + $r.='
'._('Date').' '.$e_date.''._('Echeance').' '.$e_ech.' '._('Période Comptable').' '.$date_limit['p_start'].'-'.$date_limit['p_end'].'
'._('Journal').' '.h($this->get_name()).' ' . _('Date') . ' ' . hb($e_date) . '
'._('Libellé').' '.h($e_comm).' Pj :'.h($e_pj).'' . _('Echeance') . ' ' . hb($e_ech) . '
'._('Fournisseur').' '.h($e_client.':'.$client_name).' ' . _('Période Comptable') . ' ' .hb( $date_limit['p_start'] . '-' . $date_limit['p_end']) . '
' . _('Journal') . ' ' . hb($this->get_name()) . '
' . _('Libellé') . ' ' . hb($e_comm) . '
' . _('Numéro Pièce') .''. hb($e_pj) . '' . _('Numéro Pièce') .''. hb($this->pj) . + ' '._('Attention numéro pièce existante, elle a du être adaptée').'' . _('Numéro Pièce') .''. hb($this->pj) . '
' . _('Fournisseur') . ' ' . hb($e_client . ':' . $client_name) . '
'; - $r.='
'; - $r.='
'._('Détail articles achetés').''; - $r.=''; + $r.='

' . _('Détail articles achetés') . '

'; + $r.='
'; $r.=''; - $r.=""; - $r.=""; - $r.=""; - /* vat use */ - if ( $g_parameter->MY_TVA_USE=='Y') - { + $r.=""; + $r.=""; + $r.=""; + $r.=""; + + + if ($g_parameter->MY_TVA_USE == 'Y') { + $r.=""; + $r.=''; + $r.=''; + $r.=''; + } else { + $r.=''; $r.=""; - $r.=""; - $r.=''; - $r.=''; - $r.=''; - } - else - { - $r.=""; - $r.='"; } /* if we use the AC */ @@ -1387,7 +1407,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger $r.=''; - $r.=''; $r.='
Code"._('Dénomination').""._('prix')."" . _('Code') . "" . _('Dénomination') . "" . _('prix') . "" . _('quantité') . "" . _('tva') . " ' . _('Montant TVA') . '' . _('Montant HTVA') . '' . _('Montant TVAC') . '' . _('Montant') . '"._('quantité')."tva '._('Montant TVA').''._('Montant HTVA').''._('Montant TVAC').'"._('quantité')." '._('Total')."'; $r.=${"e_march".$i}; $r.=''; + $r.=''; $r.=$fiche_name; $r.=''; @@ -1448,52 +1468,27 @@ class Acc_Ledger_Purchase extends Acc_Ledger $r.='
'; if ( $g_parameter->MY_ANALYTIC!='nu' && !$p_summary) // use of AA $r.=''; - $r.='
'; - - if ( ! $p_summary ) - $r.='
'; - else - $r.='
'; - $r.='
Totaux'; - $tot=round(bcadd($tot_amount,$tot_tva),2); - $r.='
'; - - $r.='
'._('Total HTVA'); - if ($g_parameter->MY_TVA_USE=='Y') - { - foreach ($tva as $i=>$value) - { - $oTva->set_parameter('id',$i); + $r.='

Totaux

'; + $tot = round(bcadd($tot_amount, $tot_tva), 2); + /* use VAT */ + if ($g_parameter->MY_TVA_USE == 'Y') { + $r.=''; + $r.=''; + $r.=td(hb(nbm($tot_amount) ),'class="num"'); + foreach ($tva as $i => $value) { + $oTva->set_parameter('id', $i); $oTva->load(); - $r.='
'._('TVA à ').$oTva->get_parameter('label'); + $r.=''; + $r.=td(hb(nbm($tva[$i])),'class="num"'); } - - $r.='
'._('Total TVA'); - $r.='
'._(' TVAC'); - + $r.=''.td(_('Total TVA')).td(hb(nbm($tot_tva)),'class="num"'); + $r.=''.td(_('Total TVAC')).td(hb(nbm($tot)),'class="num"'); + $r.='
Total HTVA
TVA ' . $oTva->get_parameter('label').'
'; + } else { + $r.='
Total '.nbm(hb($tot)); } - $r.="
"; - - - $r.='
'; - $r.='
'.nbm($tot_amount).''; - - if ( $g_parameter->MY_TVA_USE=='Y') - { - foreach ($tva as $i=>$value) - { - $r.='
'.nbm($tva[$i]); - } - $r.='
'.nbm($tot_tva).''; - $r.='
'.nbm($tot).''; - } - $r.="
"; - - - - $r.='
'; - $r.='
'; + /* Add hidden */ $r.=HtmlInput::hidden('e_client',$e_client); $r.=HtmlInput::hidden('nb_item',$nb_item); @@ -1530,33 +1525,35 @@ class Acc_Ledger_Purchase extends Acc_Ledger } if ( ! $p_summary ) $r.=$this->extra_info(); - if ($g_parameter->MY_STOCK == 'Y') - { - $sel = HtmlInput::select_stock($this->db, 'repo', 'W'); - $sel->readOnly = $p_summary; - if ($p_summary == true) - $sel->selected = $repo; - $r.="
"; - $r.='

Dépôt

'; - $r.="

Dans le dépôt : "; - $r.=$sel->input(); - $r.='

'; - $r.='
'; - } + // Show the available repository + if ($g_parameter->MY_STOCK == 'Y') { + $sel = HtmlInput::select_stock($this->db, 'repo', 'W'); + $sel->readOnly = $p_summary; + if ($p_summary == true) + $sel->selected = $repo; + $r.='

Dépôt

'; + $r.="

Dans le dépôt : "; + $r.=$sel->input(); + $r.='

'; + } if ( $e_mp!=0 && strlen (trim (${'e_mp_qcode_'.$e_mp})) != 0 ) { $r.=HtmlInput::hidden('e_mp_qcode_'.$e_mp,${'e_mp_qcode_'.$e_mp}); $r.=HtmlInput::hidden('acompte',$acompte); $r.=HtmlInput::hidden('e_comm_paiement',$e_comm_paiement); /* needed for generating a invoice */ - $r.=HtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_mp}); + $r.=HtmlInput::hidden('qcode_benef', ${'e_mp_qcode_' . $e_mp}); $fname = new Fiche($this->db); $fname->get_by_qcode(${'e_mp_qcode_' . $e_mp}); - $r.="
"; + /*$r.="
"; $r.='

' . "Payé par " . ${'e_mp_qcode_' . $e_mp} . " ".$fname->getName() ."

". '

'._('Déduction acompte ').h($acompte).'

'. - _('Libellé :' ).h($e_comm_paiement).'
'; + _('Libellé :' ).h($e_comm_paiement).'
';*/ + $r.='

' . "Payé par " . ${'e_mp_qcode_' . $e_mp} . + " " . $fname->getName() . '

' . '

' . _('Déduction acompte ') . h($acompte) . '

' . + _('Libellé :') . h($e_comm_paiement) ; + $r.='
'; $r.='
'; } // check for upload piece @@ -1573,8 +1570,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger public function extra_info() { $r=""; - $r.='
'; - $r.='
'._('Document à générer').''; + $r.='

Facturation

'; // check for upload piece $file=new IFile(); $file->table=0; @@ -1584,7 +1580,6 @@ class Acc_Ledger_Purchase extends Acc_Ledger if ( $this->db->count_sql("select md_id,md_name from document_modele where md_affect='ACH'") > 0 ) { - $r.='
'; $r.=_('ou générer un document').' '; // We propose to generate the fee note $doc_gen=new ISelect(); @@ -1598,8 +1593,6 @@ class Acc_Ledger_Purchase extends Acc_Ledger $obj=new IText(); $r.=_('Numero de bon de commande : ').$obj->input('bon_comm').'
'; $r.=_('Autre information : ').$obj->input('other_info').'
'; - $r.="
"; - $r.='
'; return $r; } diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php index f6426c900..791e79514 100644 --- a/include/class_acc_ledger_sold.php +++ b/include/class_acc_ledger_sold.php @@ -613,7 +613,6 @@ class Acc_Ledger_Sold extends Acc_Ledger { } $date_limit = $lPeriode->get_date_limit(); $r = ""; - $r.='
'; $r.=''; if ( $p_summary ) { $jr_id=$this->db->get_value('select jr_id from jrn where jr_internal=$1',array($this->internal)); @@ -872,7 +871,6 @@ class Acc_Ledger_Sold extends Acc_Ledger { } $r.=HtmlInput::hidden("e_quant" . $i, ${"e_quant" . $i}); } - $r.=""; return $r; } diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php index 4579191d0..aab51e7de 100644 --- a/include/compta_ach.inc.php +++ b/include/compta_ach.inc.php @@ -60,24 +60,22 @@ if (isset($_POST['view_invoice'])) if (!isset($correct)) { echo '
'; - echo h2info('Confirmation'); + echo h1('Confirmation',''); + echo_warning("Attention, cette opération n'est pas encore sauvée : vous devez encore confirmer"); + echo '
'; echo dossier::hidden(); echo $Ledger->confirm($_POST); echo HtmlInput::hidden('ac', $_REQUEST['ac']); - $chk = new ICheckBox(); - $chk->selected = false; echo '
'; - echo $chk->input('opd_save'); - echo "Sauvez cette opération comme modèle d'opération ?"; - echo '
'; + echo "

Modèle d'opération

"; + echo "Donnez un nom pour sauver cette opération comme modèle
"; $opd_name = new IText('opd_name'); echo "Nom du modèle " . $opd_name->input(); - - echo '
'; + echo '
'; echo HtmlInput::submit("record", _("Enregistrement"), 'onClick="return verify_ca(\'\');"'); echo HtmlInput::submit('correct', _("Corriger")); echo ''; @@ -113,7 +111,7 @@ if (isset($_POST['record'])) /* Save the predefined operation */ - if (isset($_POST['opd_save']) ) + if ( isset($_POST['opd_name']) && trim($_POST['opd_name']) != "" ) { $opd = new Pre_op_ach($cn); $opd->get_post(); @@ -123,26 +121,25 @@ if (isset($_POST['record'])) /* Show button */ $jr_id = $cn->get_value('select jr_id from jrn where jr_internal=$1', array($internal)); - echo '

Enregistrement

'; - echo "

" . _('Opération sauvée') . " $internal "; - if ($Ledger->pj != '') - echo ' Piece : ' . h($Ledger->pj); - echo "

"; - if (strcmp($Ledger->pj, $_POST['e_pj']) != 0) - { - echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . '

'; - } + echo '

Enregistrement

'; + // echo "

" . _('Opération sauvée') . " $internal "; + // if ($Ledger->pj != '') + // echo ' Piece : ' . h($Ledger->pj); + // echo "

"; + // if (strcmp($Ledger->pj, $_POST['e_pj']) != 0) + // { + // echo '

' . _('Attention numéro pièce existante, elle a du être adaptée') . '

'; + // } /* Save the additional information into jrn_info */ $obj = new Acc_Ledger_Info($cn); $obj->save_extra($Ledger->jr_id, $_POST); - printf('%s
', $jr_id, dossier::id(), $internal); + //printf('%s
', $jr_id, dossier::id(), $internal); // Feedback echo $Ledger->confirm($_POST, true); if (isset($Ledger->doc)) { - echo ''; + echo '

Document

'; echo $Ledger->doc; - echo '
'; } echo '
'; @@ -239,4 +236,5 @@ echo ''; exit(); -// end record invoice \ No newline at end of file +// end record invoice +?> \ No newline at end of file diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php index 46d1b389a..26b19849d 100644 --- a/include/compta_ven.inc.php +++ b/include/compta_ven.inc.php @@ -74,7 +74,6 @@ global $g_parameter; echo_warning("Attention, cette opération n'est pas encore sauvée : vous devez encore confirmer"); - echo '
'; echo '
'; echo dossier::hidden(); echo $Ledger->confirm($_POST ); @@ -91,7 +90,6 @@ global $g_parameter; echo HtmlInput::submit('correct',_("Corriger")); echo ''; - echo '
'; echo ''; exit(); }