Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 17.0
This commit is contained in:
commit
3069a97a46
@ -24,6 +24,6 @@ Method to encode/decode ZATCA string is available in test/phpunit/BarcodeTest.ph
|
|||||||
|
|
||||||
* FOR QR-Bill in switzerland
|
* FOR QR-Bill in switzerland
|
||||||
----------------------------
|
----------------------------
|
||||||
Syntax of QR Code https://www.swiss-qr-invoice.org/fr/
|
Syntax of QR Code - See file ig-qr-bill-v2.2-fr.pdf (more doc on https://www.swiss-qr-invoice.org/downloads/)
|
||||||
Syntax of complentary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
|
Syntax of complentary field named "structured information of invoice S1": https://www.swiss-qr-invoice.org/downloads/qr-bill-s1-syntax-fr.pdf
|
||||||
To test/validate: https://www.swiss-qr-invoice.org/validator/
|
To test/validate: https://www.swiss-qr-invoice.org/validator/
|
||||||
|
|||||||
71291
dev/resources/iso-normes/qr-bar-codes/ig-qr-bill-v2.2-fr.pdf
Normal file
71291
dev/resources/iso-normes/qr-bar-codes/ig-qr-bill-v2.2-fr.pdf
Normal file
File diff suppressed because one or more lines are too long
@ -1760,21 +1760,34 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$complementaryinfo .= '/30/'.$this->thirdparty->tva_intra;
|
$complementaryinfo .= '/30/'.$this->thirdparty->tva_intra;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
$bankaccount = new Account($this->db);
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
$s = '';
|
$s = '';
|
||||||
$s .= "SPC\n";
|
$s .= "SPC\n";
|
||||||
$s .= "0200\n";
|
$s .= "0200\n";
|
||||||
$s .= "1\n";
|
$s .= "1\n";
|
||||||
|
// Info Seller ("Compte / Payable à")
|
||||||
if ($this->fk_account > 0) {
|
if ($this->fk_account > 0) {
|
||||||
// Bank BAN if country is LI or CH
|
// Bank BAN if country is LI or CH. TODO Add a test to check than IBAN start with CH or LI
|
||||||
// TODO Add
|
|
||||||
$bankaccount = new Account($this->db);
|
|
||||||
$bankaccount->fetch($this->fk_account);
|
$bankaccount->fetch($this->fk_account);
|
||||||
$s .= $bankaccount->iban."\n";
|
$s .= $bankaccount->iban."\n";
|
||||||
} else {
|
} else {
|
||||||
$s .= "\n";
|
$s .= "\n";
|
||||||
}
|
}
|
||||||
// Seller
|
if ($bankaccount->id > 0 && getDolGlobalString('PDF_SWISS_QRCODE_USE_OWNER_OF_ACCOUNT_AS_CREDITOR')) {
|
||||||
|
// If a bank account is prodived and we ask to use it as creditor, we use the bank address
|
||||||
|
// TODO In a future, we may always use this address, and if name/address/zip/town/country differs from $mysoc, we can use the address of $mysoc into the final seller field ?
|
||||||
|
$s .= "S\n";
|
||||||
|
$s .= dol_trunc($bankaccount->proprio, 70, 'right', 'UTF-8', 1)."\n";
|
||||||
|
$addresslinearray = explode("\n", $bankaccount->owner_address);
|
||||||
|
$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
|
||||||
|
$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
|
||||||
|
/*$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
|
||||||
|
$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
|
||||||
|
$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/
|
||||||
|
} else {
|
||||||
$s .= "S\n";
|
$s .= "S\n";
|
||||||
$s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n";
|
$s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n";
|
||||||
$addresslinearray = explode("\n", $mysoc->address);
|
$addresslinearray = explode("\n", $mysoc->address);
|
||||||
@ -1783,7 +1796,8 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
|
$s .= dol_trunc($mysoc->zip, 16, 'right', 'UTF-8', 1)."\n";
|
||||||
$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
|
$s .= dol_trunc($mysoc->town, 35, 'right', 'UTF-8', 1)."\n";
|
||||||
$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";
|
$s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";
|
||||||
// Final seller
|
}
|
||||||
|
// Final seller (Ultimate seller) ("Créancier final" = "En faveur de")
|
||||||
$s .= "\n";
|
$s .= "\n";
|
||||||
$s .= "\n";
|
$s .= "\n";
|
||||||
$s .= "\n";
|
$s .= "\n";
|
||||||
@ -1805,13 +1819,18 @@ abstract class CommonInvoice extends CommonObject
|
|||||||
$s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n";
|
$s .= dol_trunc($this->thirdparty->country_code, 2, 'right', 'UTF-8', 1)."\n";
|
||||||
// ID of payment
|
// ID of payment
|
||||||
$s .= "NON\n"; // NON or QRR
|
$s .= "NON\n"; // NON or QRR
|
||||||
$s .= "\n"; // QR Code if previous field is QRR
|
$s .= "\n"; // QR Code reference if previous field is QRR
|
||||||
|
// Free text
|
||||||
if ($complementaryinfo) {
|
if ($complementaryinfo) {
|
||||||
$s .= $complementaryinfo."\n";
|
$s .= $complementaryinfo."\n";
|
||||||
} else {
|
} else {
|
||||||
$s .= "\n";
|
$s .= "\n";
|
||||||
}
|
}
|
||||||
$s .= "EPD\n";
|
$s .= "EPD\n";
|
||||||
|
// More text, complementary info
|
||||||
|
if ($complementaryinfo) {
|
||||||
|
$s .= $complementaryinfo."\n";
|
||||||
|
}
|
||||||
$s .= "\n";
|
$s .= "\n";
|
||||||
//var_dump($s);exit;
|
//var_dump($s);exit;
|
||||||
return $s;
|
return $s;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user