From d0b3614c5778980e03e570af5efd620194920d5e Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Tue, 28 Jan 2020 15:31:03 +0100 Subject: [PATCH] Default receipt template --- htdocs/core/modules/modReceiptPrinter.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index f2d207e1983..f61ba3a026f 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -132,13 +132,15 @@ class modReceiptPrinter extends DolibarrModules */ public function init($options = '') { - global $conf; + global $conf, $langs; // Clean before activation $this->remove($options); $sql = array( "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), fk_type integer, fk_profile integer, parameter varchar(128), entity integer) ENGINE=innodb;", "CREATE TABLE IF NOT EXISTS ".MAIN_DB_PREFIX."printer_receipt_template (rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(128), template text, entity integer) ENGINE=innodb;", - ); + "DELETE FROM ".MAIN_DB_PREFIX."printer_receipt_template WHERE name = '".$langs->trans('Default')."';", + "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt_template (name,template,entity) VALUES ('".$langs->trans('Default')."', '\r\n\r\n\r\n\r\n\r\nFacture \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n', 1);", + ); return $this->_init($sql, $options); } }