25if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
28$cn=Dossier::connect();
47 $g_user->check_jrn(
$http->request(
"p_jrn",
"number")) !=
'W' )
56if ( isset (
$_POST[
'view_invoice'] ) )
74 if ( ! isset($correct))
76 echo
'<div class="content">';
78 echo
'<div id="confirm_div_id" style="width: 47%; float: left;">';
79 echo
h1(
_(
"Confirmation"));
80 echo
span(
_(
"Vous devez encore confirmer"),
' class="notice"');
83 echo
'<div id="confirm_div_id" style="width: 100%; float: left;">';
84 echo
'<form class="print" enctype="multipart/form-data" method="post">';
85 echo dossier::hidden();
95 $array[
'supplier']=$xmldocument->fill_supplier();
98 $array[
'customer']=$xmldocument->fill_customer($customer->id);
99 $array[
'operation']=$xmldocument->fill_operation_from_array(
$_POST);
101 if (
$array[
'due_date'] ==
'')
105 $xmldocument->set_data(
$array);
106 $xmldocument->display_error();
111 echo
'<div class="bt-center">';
112 echo
'<ul class="aligned-block">';
114 echo
HtmlInput::submit(
"record",
_(
"Confirmer"),
'onClick="return verify_ca(\'\');"',p_class:
"button");
122 if (DEBUGNOALYSS>1) { echo
"<!-- confirm_div_id -->";}
130if ( isset(
$_POST[
'record']) )
151 if ( ! isset($correct))
154 echo
'<div style="position:absolute" class="content">';
156 echo
'<div class="content">';
181 $acc_document->save_receipt();
183 ,
h($_FILES[
'pj'][
'name']));
187 if (isset(
$_POST[
'gen_invoice']))
195 if (
$g_parameter->MY_INVOICE_FORMAT !=
'BASIC' && ! empty($acc_document->d_filename ))
199 $xmldocument->build_data(
$Ledger->jr_id);
200 $code_error = $xmldocument->verify() ;
202 if ( ! empty( array_filter($code_error,
function(
$a){
if (!empty(
$a))
return true; })))
210 if ( $flag_invoice == 2 )
212 $pdf_filename=$acc_document->d_filename;
213 if ( $acc_document->d_mimetype !=
'application/pdf')
215 $pdf_filename=$acc_document->transform2pdf();
218 $acc_document->update($pdf_filename);
220 $pdf_filename=$_ENV[
'TMP'].
"/".$pdf_filename;
221 $acc_document->export_file($pdf_filename);
224 $xmldocument->set_pdf_filename($pdf_filename);
229 if (DEBUGNOALYSS > 1) {
230 $mt=date (
'ymd-Hi').
'+'.
$Ledger->jr_id;
231 $uniq= $_ENV[
'TMP']. DIRECTORY_SEPARATOR.
"$mt-e-invoice.xml";
233 chmod (
$uniq,
"0774");
234 echo \Noalyss\Dbg::echo_file(
"file save $uniq");
240 echo \Noalyss\Dbg::echo_var(1,
"oid is $oid");
242 throw new Exception (
'CV177 : cannot import e-invoice');
246 $acc_document->update_document_xml($oid);
248 . $acc_document->link_download_xml();
251 $acc_document->replace_receipt($oid);
261 catch (\Exception
$e) {
263 echo_warning(
_(
"enregistrement annulé: balance , voyer le fichier log"));
271 if ( isset(
$_POST[
'opd_name']) && trim(
$_POST[
'opd_name']) !=
"" )
279 echo
'<h1>'._(
"Enregistré").
'</h1>';
280 if ($flag_invoice == 1) {
281 echo_warning(
_(
"Impossible de générer facture électronique") );
282 $xmldocument->display_error();
288 echo
'<h2 class="h-section">'._(
'Document').
' </h2>';
298 $Ledger->save_followup(
$http->request(
"action_gestion",
"string",
""));
301 if (isset(
$_POST[
'reverse_ck']))
312 echo
_(
'Extourné au ').$p_date;
318 echo
'<span class="warning">'._(
'Opération non extournée').
326 echo
'<span class="warning">'._(
'Date invalide, opération non extournée').
'</span>';
329 echo
'<div class="bt-center">';
330 echo
'<ul class="aligned-block">';
332 echo
$Ledger->button_new_operation();
335 echo
$Ledger->button_copy_operation();
352echo
'<div class="content">';
356 $def_ledger=
$Ledger->get_first(
'ven', 2);
357 if (empty($def_ledger))
359 exit(
_(
'Pas de journal disponible'));
361 $Ledger->id=$def_ledger[
'jrn_def_id'];
373echo
'<div class="content">';
376 echo
'<span class="warning">'.$p_msg.
'</span>';
380 $payment=
$http->request(
"e_mp",
"string", 0);
385 echo
"<FORM class=\"print\" NAME=\"form_detail\" METHOD=\"POST\" >";
387 if (isset(
$_REQUEST[
'pre_def'])&&!isset(
$_POST[
'correct']) && ! isset($correct))
392 $op->set_od_id(
$http->request(
'pre_def'));
397 echo
'<div class="content">';
398 echo
$Ledger->input_paid($payment);
401 echo
'compute_all_ledger();';
404 else if (isset(
$_GET[
'create_invoice']))
407 $cp=
$http->get(
'cp',
'number',0);
414 echo
'<div class="content">';
418 echo
'compute_all_ledger();';
423 echo HtmlInput::hidden(
"ledger_type",
"VEN");
424 echo HtmlInput::hidden(
"ac",
$strac);
425 echo HtmlInput::hidden(
"sa",
"p");
427 echo HtmlInput::hidden(
"action_gestion",
$action_id);
429 echo
'<div class="content">';
433 echo
'compute_all_ledger();';
442echo
'<div class="content">';
444echo
'<div class="bt-center">';
445echo
'<ul class="aligned-block">';
447echo
HtmlInput::button(
'act',
_(
'Actualiser'),
'onClick="compute_all_ledger();"', p_class:
"button");
464 echo
'<script> update_receipt()</script>';
span($p_string, $p_extra='')
isDate($p_date)
Verifie qu'une date est bien formaté en d.m.y et est valable.
noalyss_strlentrim($p_string)
echo_warning($p_string)
warns
h1($p_string, $p_class="")
NoAccess($js=1)
Echo no access and stop.
alert($p_msg, $buffer=false)
alert in javascript
is_msie()
Check if we use IE 8 or 9.
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
foreach(array( 'l', 'gDossier') as $a) if(is_numeric($l)==false) $Ledger
if(isset( $_REQUEST[ 'show'])) if(isset($_REQUEST['del'])) $ac
_("actif, passif,charge,...")
Document used in accountancy : invoice , credit note, ... It is a specialization of Document used in ...
Manage the additionnal info for operation (from jrn), when an invoice is generated,...
: input, confirm and save new operations in edger of sales the $_POST data is an array with these key...
static from_qcode(Database $cn, string $p_qcode)
create a card from a qcode and returns a card
static echo_file($msg, $print=true)
display the file
static build_xmlinvoice(\Database $conx)
thanks MY_INVOICE_FORMAT , create the corresponding object
manage the predefined operation, link to the table op_def and op_def_detail
if($request_jrn !="" && $g_user->check_jrn($request_jrn) !='W' $p_msg)
if( $g_parameter->MY_PJ_SUGGEST=='Y') $e_date
for($e=0; $e< count($afiche); $e++) exit
create_script($p_string)
create the HTML for adding the script tags around of the script
if( $delta< 0) elseif( $delta==0)