[FIX] point_of_sale: Black background receipts
Some receipts still had part of their backgrounds black.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
.pos-receipt-print {
|
||||
/*The receipt must be in the top left corner when rendered by html2canvas*/
|
||||
margin: -8px;
|
||||
width: 512px;
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
|
||||
@@ -46,23 +46,11 @@ var PrinterMixin = {
|
||||
*/
|
||||
htmlToImg: function (receipt) {
|
||||
var self = this;
|
||||
$('.pos-receipts').html(receipt);
|
||||
$('.pos-receipts>.pos-receipt').addClass('pos-receipt-print');
|
||||
$('.pos-receipt-print').html(receipt);
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
html2canvas($('.pos-receipt-print')[0], {
|
||||
background :'#FFFFFF',
|
||||
height: $('.pos-receipt-print').outerHeight(),
|
||||
ignoreElements: function (node) {
|
||||
// By default, html2canvas copies the whole DOM even if we just capture a part
|
||||
// of it. When copying the list of products, it gets all of the product from the
|
||||
// backend. We ignore the content of <div class="pos"> to speed things up.
|
||||
if (node.className == "pos") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
onrendered: function (canvas) {
|
||||
$('.pos-receipts').empty();
|
||||
$('.pos-receipt-print').empty();
|
||||
resolve(self.process_canvas(canvas));
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-name="Chrome">
|
||||
<div class='pos-receipts'>
|
||||
<div class='pos-receipt-print'>
|
||||
<!-- here go the receipts that will be printed -->
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user