From: Vincent Vanwaelscappel Date: Fri, 12 Mar 2021 09:57:45 +0000 (+0100) Subject: wait #4345 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c488f8ca73612d6db1407d06551eaa4d1dbeb0a2;p=fluidbook-html5.git wait #4345 @1.5 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index b475c9e2..03bc86e3 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -87,7 +87,7 @@ FluidbookCartPuma.prototype = { }, getColumns: function () { - return ['Catalogue', 'Catégorie', 'Ligne', 'Sexe', 'Modèle', 'Couleur', 'Désignation', 'Tarif', 'PVC', 'Image', 'PACK']; + return ['Image|onlyprint', 'Catalogue', 'Catégorie', 'Ligne', 'Sexe', 'Modèle', 'Couleur', 'Désignation', 'Tarif', 'PVC', 'Image|noprint', 'PACK']; }, getExcelColumns: function () { @@ -111,19 +111,30 @@ FluidbookCartPuma.prototype = { return '
' + this.fluidbook.l10n.__('your cart is empty') + '
'; } - var columns = this.getColumns(); var $this = this; - var content = ''; - content += ''; + var columns = this.getColumns(); + var head = ''; $.each(columns, function (k, v) { - content += ''; + var e = v.split('|'); + var cls = e.length === 1 ? '' : ' class="' + e[1] + '"' + head += ''; }); - content += ''; - content += ''; + head += ''; + head += ''; + + var content = '
' + v + '' + e[0] + '
'; + content += head; content += ''; $.each(this.getItems(), function (i, ref) { - content += ''; + if(i%12===0 && i>0){ + content+=''; + }else { + content += ''; + } $.each(columns, function (k, v) { + var e = v.split('|'); + var cls = e.length === 1 ? '' : ' class="' + e[1] + '"' + v = e[0]; var value = $this.data[ref][v]; if (v === 'PVC' || v === 'Tarif') { value = $this.formatPrice(value, '€'); @@ -134,7 +145,7 @@ FluidbookCartPuma.prototype = { value = '-'; } } - content += ''; + content += ''; }); content += ''; content += ''; @@ -170,7 +181,7 @@ FluidbookCartPuma.prototype = { getExportFileName: function () { var date = new Date(); - return this.fluidbook.settings.title + ' - Cart - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay(); + return this.fluidbook.settings.title + ' - Cart - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate(); }, exportXLS: function () { @@ -231,8 +242,8 @@ FluidbookCartPuma.prototype = { } row[v] = val; }); - var r=sheet.addRow(row); - r.height=Math.round(150/$this.data[ref]['zoom_image_ratio']); + var r = sheet.addRow(row); + r.height = Math.round(150 / $this.data[ref]['zoom_image_ratio']); }); $.each(columnsLabels, function (k, v) { sheet.getColumn(k + 1).numFmt = fmt[v]; @@ -243,7 +254,7 @@ FluidbookCartPuma.prototype = { base64: 'data:image/jpeg;base64,' + $this.data[ref]['zoom_url'], extension: 'jpeg', }); - sheet.addImage(img, {tl: {col:0, row: i + 1}, br: {col: 1, row: i + 2}, editAs: 'twoCell'}); + sheet.addImage(img, {tl: {col: 0, row: i + 1}, br: {col: 1, row: i + 2}, editAs: 'twoCell'}); }); workbook.xlsx.writeBuffer().then(function (data) { diff --git a/style/cart/puma.less b/style/cart/puma.less index 063b3444..44470cc8 100644 --- a/style/cart/puma.less +++ b/style/cart/puma.less @@ -68,10 +68,22 @@ font-size: 8px; width: 100%; + tr.break { + page-break-after: always; + } + td, th { vertical-align: top; padding: 5px; + &.onlyprint { + display: table-cell; + } + + &.noprint { + display: none; + } + &:last-child { display: none; } @@ -87,6 +99,14 @@ font-size: 11px; text-align: center; + &.onlyprint { + display: none; + } + + &.noprint { + display: table-cell; + } + span { display: block; max-width: 120px; @@ -121,6 +141,7 @@ tr { background-color: #fff; color: #000 + } }
' + value + '' + value + '' + getSpriteIcon('interface-close') + '