E-INVOICE : show the XML to download

This commit is contained in:
sparkyx 2025-10-01 18:31:41 +02:00
parent d2a199ffce
commit 472406aa3f
12 changed files with 113 additions and 98 deletions

View file

@ -81,44 +81,6 @@ class Database extends DatabaseCore
. ",dbname = ".$this->get_dbname()
. "]";
}
/***
* \brief Save a "piece justificative" , the name must be a receipt
*
* \param $seq jr_grpt_id
* \return $oid of the lob file if success
* null if a error occurs
*
*/
function save_receipt($seq)
{
/**
* pj is the $_FILES key
*/
$oid = $this->upload('pj');
if ($oid == false) {
return false;
}
// Remove old document
$ret = $this->exec_sql("select jr_pj from jrn where jr_grpt_id=$1"
,[$seq]);
if (pg_num_rows($ret) != 0) {
$r = pg_fetch_array($ret, 0);
$old_oid = $r['jr_pj'];
if (strlen($old_oid??"") != 0)
$this->lo_unlink( $old_oid);
}
// Load new document
$this->exec_sql("update jrn set jr_pj=$1 , jr_pj_name=$2,
jr_pj_type=$3 where jr_grpt_id=$4",
array($oid, $_FILES['pj']['name'], $_FILES['pj']['type'], $seq));
if ( $_FILES['pj']['type'] == 'text/xml'
|| $_FILES['pj']['type'] == 'application/xml'
)
{
}
return $oid;
}
/**
* \brief Get version of a database, the content of the