Merge branch '260119-cosmetic' into unstable
* 260119-cosmetic: Fix cosmetic : align properly amount in widget invoice-customer-supplier Fix Bug : order and communication not set in XML UBL21 VAT : adapt standard invoice for not subject to VAT Appearance: add invoice or a file, additional document XMLREADER : improve appearance XMLREADER: PDF add logo XMLREADER: improve appearance PDF + contact name XMLReader : fix bug in invoiceline, 1st amount incorrect XML : cosmetic, manage long description and name Country_code: try to guess it Fix bug : XML reader : filename or description too large for PDF Cosmetic If there is no Name use Official one Improve record_log BUG : Share note fails
This commit is contained in:
commit
be8ef30498
14 changed files with 231 additions and 98 deletions
|
|
@ -72,6 +72,7 @@ BODY {
|
|||
--bg-inner-box:#DCE1EF;
|
||||
--underline-menu:#d7e8ee;
|
||||
--bg-slide:#c5d5e8;
|
||||
--end-level1:#eb7c7e;
|
||||
}
|
||||
input{
|
||||
font-family: 'OpenSansRegular';
|
||||
|
|
@ -2089,7 +2090,7 @@ div.box {
|
|||
div.box {
|
||||
width: 35rem;
|
||||
max-height: 30%;
|
||||
height: 45vh;
|
||||
height: 40rem;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -2500,6 +2501,8 @@ ul.aligned-block li {
|
|||
padding: 2rem;
|
||||
border:1px solid navy;
|
||||
margin-right:1rem;
|
||||
width: 20rem;
|
||||
|
||||
}
|
||||
/***************************************************************************
|
||||
* column in the dashboard
|
||||
|
|
@ -2513,6 +2516,7 @@ td.cut {
|
|||
}
|
||||
td.box {
|
||||
border-left: #9999ff solid 1px;
|
||||
border-radius: 10px 0px;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -3973,8 +3977,7 @@ h2.h-section {
|
|||
.nav-item.li-active.nav-item-underline::before {
|
||||
transform: scale(1);
|
||||
background-color: #d03100;
|
||||
background-image: linear-gradient(to right,#cc0000 0%,red 20%) ;
|
||||
background-image: linear-gradient(to right,darkred 0%,red 10%,red 90%,darkred);
|
||||
background-image: linear-gradient(to right,var(--end-level1) 0%,red 10%,red 90%,var(--end-level1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4171,7 +4174,7 @@ h2.h-section {
|
|||
}
|
||||
.topmenu .nav-item.nav-item-underline:hover::before,.topmenu .nav-item.nav-item-underline:focus::before {
|
||||
transform: scaleX(1) scaleY(1);
|
||||
background-image: linear-gradient(to right,darkred,red);
|
||||
background-image: linear-gradient(to right,var(--end-level1),red);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4182,7 +4185,7 @@ h2.h-section {
|
|||
|
||||
.topmenu .nav-item.nav-item-underline:hover::before,.topmenu .nav-item.nav-item-underline:focus::before {
|
||||
transform: scaleX(1) scaleY(1);
|
||||
background-image: linear-gradient(to right,darkred 0%,red 30%);
|
||||
background-image: linear-gradient(to right,var(--end-level1) 0%,red 30%);
|
||||
}
|
||||
|
||||
/*.topmenu .nav-item.nav-item-underline::before {
|
||||
|
|
@ -4258,6 +4261,8 @@ span.nb-round {
|
|||
|
||||
.bt-center {
|
||||
margin-bottom: 2rem;
|
||||
float:inherit;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -4287,4 +4292,10 @@ span.nb-round {
|
|||
|
||||
#module_setting .selectedcell {
|
||||
background-color:beige;
|
||||
}
|
||||
|
||||
#facturation_div_id{
|
||||
height:auto;
|
||||
float:left
|
||||
|
||||
}
|
||||
|
|
@ -229,6 +229,9 @@ abstract class XML_Reader
|
|||
$result = [];
|
||||
$result['ID'] = $this->get_node_value("//cac:AccountingCustomerParty[1]/cac:Party[1]/cbc:EndpointID[1]");
|
||||
$result['name'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PartyName[1]/cbc:Name[1]');
|
||||
if ($result['name'] == '') {
|
||||
$result['name'] = $this->get_node_value("//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:RegistrationName[1]");
|
||||
}
|
||||
$result['street'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:StreetName[1]');
|
||||
$result['city'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:CityName[1]');
|
||||
$result['postcode'] = $this->get_node_value('//cac:AccountingCustomerParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]');
|
||||
|
|
@ -247,12 +250,28 @@ abstract class XML_Reader
|
|||
$result = [];
|
||||
$result['ID'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cbc:EndpointID[1]");
|
||||
$result['name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyName[1]/cbc:Name[1]");
|
||||
if ($result['name'] == '') {
|
||||
$result['name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:RegistrationName[1]");
|
||||
}
|
||||
$result['street'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:StreetName[1]");
|
||||
$result['city'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:CityName[1]");
|
||||
$result['postcode'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cbc:PostalZone[1]");
|
||||
$result['country_code'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PostalAddress[1]/cac:Country[1]/cbc:IdentificationCode[1]");
|
||||
$result['company_id'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyTaxScheme[1]/cbc:CompanyID[1]");
|
||||
if ($result['company_id'] == "" ) {
|
||||
$result['company_id'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:PartyLegalEntity[1]/cbc:CompanyID[1]");
|
||||
}
|
||||
$result['scheme'] = $this->get_node("//cac:AccountingSupplierParty[1]/cac:Party[1]/cbc:EndpointID[1]")[0]->getAttribute("schemeID");
|
||||
/**
|
||||
* get contact
|
||||
<cac:Contact>
|
||||
<cbc:Name>Facturation NOALYSS</cbc:Name>
|
||||
<cbc:ElectronicMail>invoice@noalyss</cbc:ElectronicMail>
|
||||
</cac:Contact>
|
||||
*/
|
||||
$result['contact_name'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:Contact[1]/cbc:Name[1]");
|
||||
$result['contact_mail'] = $this->get_node_value("//cac:AccountingSupplierParty[1]/cac:Party[1]/cac:Contact[1]/cbc:ElectronicMail");
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
@ -378,8 +397,6 @@ abstract class XML_Reader
|
|||
/**
|
||||
*
|
||||
* @return array
|
||||
* @TODODNY
|
||||
* Implémenter les allowances
|
||||
*/
|
||||
function get_info(): array
|
||||
{
|
||||
|
|
@ -390,6 +407,7 @@ abstract class XML_Reader
|
|||
$result['InvoiceTypeCode'] =$this->get_document_type_code();
|
||||
$result['DocumentCurrencyCode'] = $this->get_node_value('cbc:DocumentCurrencyCode');
|
||||
$result['BuyerReference'] = $this->get_node_value('cbc:BuyerReference');
|
||||
$result['OrderReference'] = $this->get_node_value('//cac:OrderReference[1]/cbc:ID[1]');
|
||||
$result['ActualDeliveryDate'] = $this->get_node_value('//cac:Delivery[1]/cbc:ActualDeliveryDate[1]');
|
||||
$result['info']=array();
|
||||
|
||||
|
|
@ -410,6 +428,7 @@ abstract class XML_Reader
|
|||
public function to_pdf(): PDF
|
||||
{
|
||||
//$pdf = new PDF($cn);
|
||||
|
||||
$pdf = new PDF();
|
||||
$result = $this->get_info();
|
||||
$info=$result;
|
||||
|
|
@ -419,97 +438,133 @@ abstract class XML_Reader
|
|||
$pdf->AddPage();
|
||||
// 180 mm large
|
||||
$pdf->setFont("DejaVu", "B", 16);
|
||||
$pdf->write_cell(20, 10, "");
|
||||
$pdf->write_cell(170, 10, _("Résumé facture"),1,0,'C');
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(2);
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->write_cell(10, 10, "");
|
||||
$pdf->write_cell(170, 10, _("Résumé document"),1,0,'C');
|
||||
$pdf->line_new(20);
|
||||
$pdf->Image(NOALYSS_HOME.'/image/logo10000.png', 10, 10, 20, 0, 'PNG');
|
||||
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->write(4, sprintf(_("Document ID %s"), $result['id']));
|
||||
$pdf->ln();
|
||||
$pdf->write(4, sprintf(_("Date facture %s"), $result['IssueDate']));
|
||||
$pdf->ln();
|
||||
$pdf->write(4, sprintf(_("Date échéance %s"), $result['DueDate']));
|
||||
$pdf->ln();
|
||||
$pdf->setFont("DejaVu", "B", 8);
|
||||
$pdf->write_cell(20,4,_('Date'));
|
||||
$pdf->print_row();
|
||||
$pdf->setFont("DejaVuCond", "", 7);
|
||||
$pdf->write_multi(38,4, sprintf(_(" Facture %s"), $result['IssueDate']));
|
||||
$pdf->write_multi(38,4, sprintf(_("Echéance %s"), $result['DueDate']));
|
||||
$pdf->write_multi(38,4, sprintf(_("Livraison %s"), $result['ActualDeliveryDate']));
|
||||
$pdf->line_new();
|
||||
$pdf->write(4, sprintf(_("Type et code document %s"), $result['InvoiceTypeCode']));
|
||||
$pdf->ln();
|
||||
$pdf->write(4, sprintf(_("Devise document %s"), $result['DocumentCurrencyCode']));
|
||||
$pdf->ln();
|
||||
$pdf->write(4, sprintf(_("Référence client %s"), $result['BuyerReference']));
|
||||
$pdf->ln();
|
||||
$pdf->write(4, sprintf(_("Date Livraison %s"), $result['ActualDeliveryDate']));
|
||||
$pdf->write(4, sprintf(_("Référence commande %s"), $result['OrderReference']));
|
||||
$pdf->ln(10);
|
||||
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->write_cell(60, 4, _("Fournisseur"));
|
||||
$pdf->line_new(12);
|
||||
$pdf->line_new(6);
|
||||
$supplier = $this->get_supplier();
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$pdf->write_cell(60, 4, $supplier['name']);
|
||||
$pdf->write_cell(60, 4, $supplier['company_id']);
|
||||
$pdf->write_cell(60, 4,$supplier['scheme'].":". $supplier['ID']);
|
||||
$pdf->setFont("DejaVu", "B", 8);
|
||||
$pdf->write_multi(10, 4, "");
|
||||
$pdf->write_multi(150, 4, $supplier['name']);
|
||||
$pdf->line_new();
|
||||
$pdf->write_cell(60, 4, $supplier['street']);
|
||||
$pdf->write_cell(30, 4, $supplier['postcode']);
|
||||
$pdf->write_cell(60, 4, $supplier['city']);
|
||||
$pdf->write_cell(20, 4, $supplier['country_code']);
|
||||
$pdf->line_new(10);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVuCond", "", 7);
|
||||
$pdf->write_multi(70, 4, $supplier['street']);
|
||||
$pdf->write_multi(30, 4, $supplier['postcode']);
|
||||
$pdf->write_multi(50, 4, $supplier['city']);
|
||||
$pdf->write_cell(10, 4, $supplier['country_code']);
|
||||
$pdf->line_new();
|
||||
$pdf->write_cell(50, 4, $supplier['company_id']);
|
||||
$pdf->write_cell(50, 4,'PEPPOL ID:'.$supplier['scheme'].":". $supplier['ID']);
|
||||
$pdf->line_new();
|
||||
if ( $supplier['contact_name'] != '' || $supplier['contact_mail'] != '') {
|
||||
$pdf->write_multi(100, 4, "contact: ".$supplier['contact_name']." ". $supplier['contact_mail']);
|
||||
$pdf->line_new();
|
||||
}
|
||||
$pdf->line_new(4);
|
||||
|
||||
$customer = $this->get_customer();
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->write_cell(60, 4, _("Client"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$pdf->write_cell(60, 4, $customer['name']);
|
||||
$pdf->write_cell(60, 4, $customer['company_id']);
|
||||
$pdf->write_cell(60, 4, $customer['scheme'].":".$customer['ID']);
|
||||
$pdf->line_new(6);
|
||||
$pdf->setFont("DejaVu", "B", 8);
|
||||
$pdf->write_multi(10, 4, "");
|
||||
$pdf->write_multi(150, 4, $customer['name']);
|
||||
$pdf->line_new();
|
||||
$pdf->write_cell(60, 4, $customer['street']);
|
||||
$pdf->write_cell(40, 4, $customer['postcode']);
|
||||
$pdf->write_cell(60, 4, $customer['city']);
|
||||
$pdf->write_cell(20, 4, $customer['country_code']);
|
||||
$pdf->line_new(10);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$pdf->write_multi(70, 4, $customer['street']);
|
||||
$pdf->write_multi(30, 4, $customer['postcode']);
|
||||
$pdf->write_multi(50, 4, $customer['city']);
|
||||
$pdf->write_multi(10, 4, $customer['country_code']);
|
||||
$pdf->line_new();
|
||||
$pdf->write_cell(50, 4, $customer['company_id']);
|
||||
$pdf->write_cell(50, 4, 'PEPPOL ID:'.$customer['scheme'].":".$customer['ID']);
|
||||
$pdf->line_new(6);
|
||||
/**
|
||||
* note invoice
|
||||
*/
|
||||
if ( $info['info']['note'] != "")
|
||||
{
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->write_cell(60, 4, _("Notes"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(6);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$pdf->write_multi(50, 4,$info['info']['note']);
|
||||
$pdf->write_multi(130, 8,$info['info']['note']);
|
||||
$pdf->line_new(10);
|
||||
}
|
||||
/**
|
||||
* ITEM
|
||||
*/
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->write_cell(60, 4, _("Articles"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(6);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$result = $this->get_invoiceLine();
|
||||
$pdf->write_cell(50, 4, _("Code"), border: 'B');
|
||||
$pdf->write_cell(50, 4, _("Description"), border: 'B');
|
||||
$pdf->write_cell(30, 4, _("TVA"), border: 'B', align: 'R');
|
||||
$pdf->write_cell(25, 4, _("Quantité"), border: 'B', align: 'R');
|
||||
$pdf->write_cell(25, 4, _("Montant HT"), border: 'B', align: 'R');
|
||||
$pdf->write_cell(60, 4, _("Description"), border: 'B');
|
||||
$pdf->write_cell(20, 4, _("TVA"), border: 'B', align: 'R');
|
||||
$pdf->write_cell(20, 4, _("Prix unitaire"), border: 'B', align: 'R');
|
||||
$pdf->write_cell(20, 4, _("Quantité"), border: 'B', align: 'R');
|
||||
$pdf->write_cell(20, 4, _("Montant HT"), border: 'B', align: 'R');
|
||||
$pdf->line_new();
|
||||
|
||||
$nb_inline = count($result);
|
||||
for ($i = 0; $i < $nb_inline; $i++)
|
||||
{
|
||||
$pdf->write_cell(50, 4, $result[$i]['name']);
|
||||
$pdf->write_cell(50, 4, $result[$i]['description']);
|
||||
$pdf->write_cell(25, 4, $result[$i]['tva_percent'], align: 'R');
|
||||
$pdf->write_cell(5, 4, $result[$i]['tva_id']);
|
||||
$pdf->write_cell(25, 4, $result[$i]['quantity'], align: 'R');
|
||||
$pdf->write_cell(25, 4, nbm($result[$i]['amount']), align: 'R');
|
||||
if ( $result[$i]['description'] == '') {
|
||||
$pdf->write_multi(110, 4, $result[$i]['name']);
|
||||
}else {
|
||||
$pdf->write_multi(50, 4, $result[$i]['name']);
|
||||
$pdf->write_multi(60, 4, $result[$i]['description']);
|
||||
}
|
||||
$pdf->write_cell(20, 4, $result[$i]['tva_percent'], align: 'R');
|
||||
//$pdf->write_cell(5, 4, $result[$i]['tva_id']);
|
||||
$pdf->write_cell(20, 4, $result[$i]['unit_price'], align: 'R');
|
||||
$pdf->write_cell(20, 4, $result[$i]['quantity'], align: 'R');
|
||||
$pdf->write_cell(20, 4, nbm($result[$i]['amount']), align: 'R');
|
||||
$pdf->line_new();
|
||||
}
|
||||
$pdf->line_new(10);
|
||||
|
||||
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->write_cell(60, 4, _("Totaux"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(6);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$result = $this->get_amount_summary();
|
||||
// @TODO DNY : Qu'est-ce que LineExtension Amount ??
|
||||
|
|
@ -535,9 +590,11 @@ abstract class XML_Reader
|
|||
$nb_inline = count($result);
|
||||
if ( !empty ($result ))
|
||||
{
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->write_cell(60, 4, _("Charge et déduction"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(6);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$pdf->write_cell(20, 4, _("code"), align: 'L', border: '1');
|
||||
$pdf->write_cell(20, 4, _("Type"), border: '1');
|
||||
|
|
@ -564,13 +621,15 @@ abstract class XML_Reader
|
|||
$pdf->line_new();
|
||||
}
|
||||
}
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->write_cell(60, 4, _("TVA"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(6);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$result = $this->get_taxes();
|
||||
$pdf->write_cell(25, 4, _("% Taxe"), align: 'R', border: 'B');
|
||||
$pdf->write_cell(5, 4, _("Code taxe"), border: 'B');
|
||||
$pdf->write_cell(30, 4, _("Code taxe"), border: 'B');
|
||||
$pdf->write_cell(50, 4, _("Base"), align: 'R', border: 'B');
|
||||
$pdf->write_cell(50, 4, _("Taxe"), align: 'R', border: 'B');
|
||||
$pdf->line_new();
|
||||
|
|
@ -579,7 +638,7 @@ abstract class XML_Reader
|
|||
{
|
||||
$pdf->write_cell(25, 4, $result[$i]['tax_percent'], align: 'R');
|
||||
$pdf->write_cell(5, 4, $result[$i]['tax_id']);
|
||||
$pdf->write_cell(25, 4, $result[$i]['vatex']);
|
||||
$pdf->write_multi(25, 4, $result[$i]['vatex']);
|
||||
$pdf->write_cell(50, 4, nbm($result[$i]['taxable_amount']), align: 'R');
|
||||
$pdf->write_cell(50, 4, nbm($result[$i]['tax']), align: 'R');
|
||||
|
||||
|
|
@ -589,8 +648,11 @@ abstract class XML_Reader
|
|||
|
||||
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->write_cell(60, 4, _("Paiement"));
|
||||
$pdf->line_new(10);
|
||||
$pdf->line_new(6);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$result = $this->get_payment_mean();
|
||||
$pdf->write_cell(50, 4, _("Code"));
|
||||
|
|
@ -612,6 +674,7 @@ abstract class XML_Reader
|
|||
$pdf->write_multi(140, 4, str_replace(["\n", "\r", "\t"], " ", $result['note'][$i]));
|
||||
$pdf->line_new();
|
||||
}
|
||||
$pdf->line_new(6);
|
||||
/**
|
||||
* display name of embedded from files
|
||||
* @var $result(array of Document_Reference)
|
||||
|
|
@ -619,17 +682,19 @@ abstract class XML_Reader
|
|||
$result=$this->get_embedded_document();
|
||||
if ( count($result) > 0)
|
||||
{
|
||||
$pdf->SetTextColor(0,0,127);
|
||||
$pdf->setFont("DejaVu", "B", 12);
|
||||
$pdf->write_cell(60,4,_('Documents inclus'));
|
||||
$pdf->line_new();
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->setFont("DejaVu", "", 7);
|
||||
$nb_result=count($result);
|
||||
for ($i=0;$i< $nb_result;$i++)
|
||||
{
|
||||
$binary=$result[$i]->getBinary_object();
|
||||
$pdf->write_cell(50,4,$result[$i]->getId());
|
||||
$pdf->write_cell(50,4,$binary->filename);
|
||||
$pdf->write_cell(50,4,$result[$i]->getDescription());
|
||||
$pdf->write_multi(50,4,$result[$i]->getId());
|
||||
$pdf->write_multi(50,4,$binary->filename);
|
||||
$pdf->write_multi(50,4,$result[$i]->getDescription());
|
||||
$pdf->line_new();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,15 +143,14 @@ class XMLCreditNote_Reader extends XML_Reader
|
|||
for ($e = 0; $e < $node->length; $e++)
|
||||
{
|
||||
$row = [];
|
||||
$xml = simplexml_import_dom($node->item($e));
|
||||
$row ['quantity'] = $this->get_node_value("//cbc:CreditedQuantity", $e);
|
||||
$row ['amount'] = $this->get_node_value("//cbc:LineExtensionAmount", $e);
|
||||
$row ['description'] = $this->get_node_value("//cac:Item/cbc:Description", $e);
|
||||
$row ['name'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cbc:Name", $e);
|
||||
$row ['unit_price'] = $this->get_node_value("//cac:CreditNoteLine/cac:Price/cbc:PriceAmount", $e);
|
||||
$row ['tva_id'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
|
||||
$row ['tva_percent'] = $this->get_node_value("//cac:CreditNoteLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
|
||||
|
||||
$row ['quantity'] = $node->item($e)->getElementsByTagName("CreditedQuantity")->item(0)->textContent;
|
||||
$row ['code_quantity'] = $node->item($e)->getElementsByTagName("CreditedQuantity")->item(0)->getAttribute('unitCode');
|
||||
$row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent;
|
||||
$row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent;
|
||||
$row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent;
|
||||
$row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent;
|
||||
$row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent;
|
||||
$row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)->textContent;
|
||||
$result[] = $row;
|
||||
}
|
||||
return $result;
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ abstract class XMLInvoice extends \DOMDocument
|
|||
|
||||
}
|
||||
}
|
||||
$result['info']['communication']=($result['info']['communication']=="")?$result['id']:"";
|
||||
$result['info']['communication']=($result['info']['communication']=="")?$result['id']:$result['info']['communication'];
|
||||
$result['document']=$this->fill_document($jr_id);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -109,17 +109,17 @@ class XMLInvoice_Reader extends XML_Reader
|
|||
for ($e = 0; $e < $node->length; $e++)
|
||||
{
|
||||
$row = [];
|
||||
$row ['quantity'] = $this->get_node_value("//cbc:InvoicedQuantity", $e);
|
||||
$row ['amount'] = $this->get_node_value("//cbc:LineExtensionAmount", $e);
|
||||
$row ['description'] = $this->get_node_value("//cac:Item/cbc:Description", $e);
|
||||
$row ['name'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cbc:Name", $e);
|
||||
$row ['unit_price'] = $this->get_node_value("//cac:InvoiceLine/cac:Price/cbc:PriceAmount", $e);
|
||||
$row ['tva_id'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:ID", $e);
|
||||
$row ['tva_percent'] = $this->get_node_value("//cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent", $e);
|
||||
|
||||
$row ['quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->textContent;
|
||||
$row ['code_quantity'] = $node->item($e)->getElementsByTagName("InvoicedQuantity")->item(0)->getAttribute('unitCode');
|
||||
$row ['amount'] = $node->item($e)->getElementsByTagName("LineExtensionAmount")->item(0)->textContent;
|
||||
$row ['description'] = $node->item($e)->getElementsByTagName("Description")->item(0)?->textContent;
|
||||
$row ['name'] = $node->item($e)->getElementsByTagName("Name")->item(0)->textContent;
|
||||
$row ['unit_price'] = $node->item($e)->getElementsByTagName("PriceAmount")->item(0)->textContent;
|
||||
$row ['tva_id'] = $node->item($e)->getElementsByTagName("ID")->item(0)->textContent;
|
||||
$row ['tva_percent'] = $node->item($e)->getElementsByTagName("Percent")->item(0)->textContent;
|
||||
$result[] = $row;
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
/**
|
||||
* @brief return the code of the document
|
||||
|
|
|
|||
|
|
@ -1988,7 +1988,6 @@ EOF;
|
|||
|
||||
}
|
||||
$r.='</table>';
|
||||
$r.='</p>';
|
||||
if ( $g_parameter->MY_ANALYTIC!='nu' && !$p_summary) // use of AA
|
||||
$r.='<input type="button" class="button" value="'._('Vérifiez imputation analytique').'" onClick="verify_ca(\'\');">';
|
||||
|
||||
|
|
@ -2125,6 +2124,7 @@ EOF;
|
|||
$file=new IFile();
|
||||
$file->setAlertOnSize(true);
|
||||
$file->table=0;
|
||||
$r.='<h3 class="title">'._("Facture").'</h3>';
|
||||
$r.=_("Ajoutez une pièce justificative ");
|
||||
$r.=$file->input("pj","");
|
||||
|
||||
|
|
@ -2141,11 +2141,13 @@ EOF;
|
|||
$r.=$doc_gen->input().'<br>';
|
||||
}
|
||||
$r.='</p>';
|
||||
$r.='<h3 class="title">'._("Documents supplémentaires").'</h3>';
|
||||
$r.=$this->input_supplemental_document();
|
||||
$r.='<p>';
|
||||
$obj=new IText();
|
||||
$obj->size=50;
|
||||
$r.=_('Numero de bon de commande : ').$obj->input('bon_comm').'<br>';
|
||||
$r.=_('Autre information : ').$obj->input('other_info').'<br>';
|
||||
$r.=_('Communication').$obj->input('other_info').'<br>';
|
||||
$r.='</p>';
|
||||
$r.='</div>';
|
||||
return $r;
|
||||
|
|
|
|||
|
|
@ -1282,14 +1282,16 @@ EOF;
|
|||
$r.='<tr>'.td($other_tax_label).td(hb($other_tax_amount),'class="num"');
|
||||
}
|
||||
if ( $other_tax_amount!="") {$tot=bcadd($tot,$other_tax_amount,2);}
|
||||
$r.='<tr>'.td(_('Total TVAC')).td(hb($tot),'class="num"');
|
||||
$r.='<tr>'.td(_('Total TVAC')).td(hb($tot),'class="num"').'</tr>';
|
||||
$r.='</table>';
|
||||
} else {
|
||||
$r.='<table>';
|
||||
if ( ! empty($other_tax_label) ) {
|
||||
$r.='<tr>'.td($other_tax_label).td(hb($other_tax_amount),'class="num"');
|
||||
}
|
||||
if ( $other_tax_amount!="") {$tot=bcadd($tot,$other_tax_amount,2);}
|
||||
$r.='<br>Total '.hb($tot);
|
||||
$r.='<tr>'.td(_('Total ')).td(hb($tot),'class="num"');
|
||||
$r.='</table>';
|
||||
}
|
||||
$r.='</div>';
|
||||
|
||||
|
|
@ -1374,13 +1376,13 @@ EOF;
|
|||
*/
|
||||
|
||||
public function extra_info() {
|
||||
$r = '<div id="facturation_div_id" style="display:flex;height:185px;height:10rem">';
|
||||
$r = '<div id="facturation_div_id" style="">';
|
||||
// check for upload piece
|
||||
$file = new IFile();
|
||||
$file->table = 0;
|
||||
$file->setAlertOnSize(true);
|
||||
$r.='<p class="decale">';
|
||||
|
||||
$r.='<h3 class="title">'._("Facture").'</h3>';
|
||||
// add a receipt
|
||||
$r.=_("Ajoutez une pièce justificative ");
|
||||
$r.=$file->input("pj", "");
|
||||
|
|
@ -1398,11 +1400,15 @@ EOF;
|
|||
" union select -2,'"._("Z - Facture PDF Standard")."' ".
|
||||
" order by 2");
|
||||
$r.=$doc_gen->input() . '<br>';
|
||||
$r.='<h3 class="title">'._("Documents supplémentaires").'</h3>';
|
||||
// add a receipt
|
||||
$r.=$this->input_supplemental_document();
|
||||
|
||||
$r.='<br>';
|
||||
$obj = new IText();
|
||||
$obj->size=50;
|
||||
$r.='<p>';
|
||||
$r.=_('Numero de bon de commande') . $obj->input('bon_comm') . '<br>';
|
||||
|
||||
$r.=_('Communication') . $obj->input('other_info') . '<br>';
|
||||
$r.='</p>';
|
||||
$r.='</div>';
|
||||
|
|
|
|||
|
|
@ -263,22 +263,25 @@ class Invoice_PDF extends \PDF
|
|||
}
|
||||
$this->write_multi($col['quantity'], 4, nbm($this->data['e_quant' . $i]), '', 'R',fill:$fill);
|
||||
$this->write_multi($col['price'], 4, nbm($this->data['e_march' . $i . '_price']), '', 'R',fill:$fill);
|
||||
$this->write_multi($col['vat_code'], 4, $this->data['e_march' . $i . '_tva_id'], '', 'C',fill:$fill);
|
||||
$x = $this->data['e_march' . $i . '_tva_id'];
|
||||
if (!isset($a_tva_amount[$x]))
|
||||
if (isset ($this->data['e_march' . $i . '_tva_id']))
|
||||
{
|
||||
$a_tva_amount[$x] = 0;
|
||||
$this->write_multi($col['vat_code'], 4, $this->data['e_march' . $i . '_tva_id'], '', 'C',fill:$fill);
|
||||
$x = $this->data['e_march' . $i . '_tva_id'];
|
||||
if (!isset($a_tva_amount[$x]))
|
||||
{
|
||||
$a_tva_amount[$x] = 0;
|
||||
}
|
||||
$a_tva_amount[$x] = bcadd($a_tva_amount[$x], $this->data["e_march" . $i . "_tva_amount"], 2);
|
||||
$tot_vat = bcadd($tot_vat
|
||||
, $this->data['e_march' . $i . '_tva_amount']
|
||||
, 2);
|
||||
}
|
||||
$a_tva_amount[$x] = bcadd($a_tva_amount[$x], $this->data["e_march" . $i . "_tva_amount"], 2);
|
||||
$tot_amount = bcadd($tot_amount
|
||||
, bcmul($this->data['e_march' . $i . '_price']
|
||||
, $this->data['e_quant' . $i]
|
||||
, 2
|
||||
)
|
||||
, 2);
|
||||
$tot_vat = bcadd($tot_vat
|
||||
, $this->data['e_march' . $i . '_tva_amount']
|
||||
, 2);
|
||||
$this->line_new(4);
|
||||
if ($this->GetY()>250) {
|
||||
$this->AddPage();
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ class Tva_Rate_MTable extends Manage_Table_SQL
|
|||
'tva_peppol_code'=>_("Code TVA est utilisé pour les factures électroniques, plus d'information dans le manuel"),
|
||||
'vx_code'=>_("Code exemption pour facture PEPPOL (ubl)")
|
||||
);
|
||||
$this->setTitle(_("Détail TVA"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -158,6 +158,10 @@ if ( isset($_POST['record']) )
|
|||
$Ledger=new Acc_Ledger_Sale($cn,$post_jrn);
|
||||
try {
|
||||
$internal=$Ledger->insert($_POST);
|
||||
|
||||
/* Save the additional information into jrn_info */
|
||||
$obj=new Acc_Ledger_Info($cn);
|
||||
$obj->save_extra($Ledger->jr_id,$_POST);
|
||||
$Ledger->upload_supplemental_document($Ledger->jr_id);
|
||||
// var $receipt (string) contains the name of the file name of
|
||||
// the invoice (document created), if empty there
|
||||
|
|
@ -290,9 +294,6 @@ if ( isset($_POST['record']) )
|
|||
}
|
||||
|
||||
|
||||
/* 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",""));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ global $version_noalyss;
|
|||
define('NOALYSS_VERSION', 10000 );
|
||||
|
||||
// Database schema version
|
||||
define("DBVERSION", 206);
|
||||
define("DBVERSION", 207);
|
||||
|
||||
// version for MONO_DATABASE
|
||||
define("MONO_DATABASE", 25);
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ class PDF_Core extends TFPDF
|
|||
* @see TFPDF::SetFontSize()
|
||||
* @return void
|
||||
*/
|
||||
protected function print_row()
|
||||
function print_row()
|
||||
{
|
||||
static $e=0;
|
||||
$e++;
|
||||
|
|
|
|||
45
include/sql/patch/upgrade206.sql
Normal file
45
include/sql/patch/upgrade206.sql
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
begin;
|
||||
|
||||
CREATE OR REPLACE FUNCTION guess_country_code()
|
||||
RETURNS void
|
||||
AS
|
||||
$$
|
||||
declare
|
||||
country_code char(2);
|
||||
x record;
|
||||
begin
|
||||
for x in
|
||||
select
|
||||
f1.jft_id
|
||||
,f1.f_id
|
||||
,( select f2.ad_value from fiche_detail f2 where f2.f_id=f1.f_id and ad_id= 13) as tva_num
|
||||
,( select f3.ad_value from fiche_detail f3 where f3.f_id=f1.f_id and ad_id= 16) as country
|
||||
from
|
||||
fiche_detail f1
|
||||
where
|
||||
f1.ad_id=57
|
||||
and coalesce(f1.ad_value,'')=''
|
||||
loop
|
||||
country_code='';
|
||||
case
|
||||
when substr(x.tva_num,1,2) = 'FR' or upper(x.country)='FRANCE' then country_code='FR';
|
||||
when substr(x.tva_num,1,2) = 'BE' or upper(x.country)='BELGIQUE' then country_code='BE';
|
||||
when substr(x.tva_num,1,2) = 'LU' or upper(x.country)='LUXEMBOURG' then country_code='LU';
|
||||
when substr(x.tva_num,1,2) <> '' then country_code=upper(substr(x.tva_num,1,2));
|
||||
else
|
||||
country_code='';
|
||||
end case;
|
||||
raise notice 'tva_num % country % country_code % jft_id %s',x.tva_num,x.country,country_code,x.jft_id;
|
||||
if country_code <> '' then
|
||||
update fiche_detail set ad_value=country_code where jft_id=x.jft_id;
|
||||
end if;
|
||||
end loop;
|
||||
end;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
|
||||
select guess_country_code();
|
||||
|
||||
insert into version (val,v_description) values (207,'Guess country code ');
|
||||
commit;
|
||||
|
|
@ -49,7 +49,7 @@ foreach ($array as $item):
|
|||
<?=h($item['jr_comment'])?>
|
||||
<?=h($item['jr_date'])?>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-2" style="text-align: right">
|
||||
<?=nbm($item['jr_montant'],2)?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue