diff --git a/printserver/OrderSprinterPrintserver.exe b/printserver/OrderSprinterPrintserver.exe
index d0ba361..90469ad 100644
Binary files a/printserver/OrderSprinterPrintserver.exe and b/printserver/OrderSprinterPrintserver.exe differ
diff --git a/webapp/OrderSprinterPrintserver.exe b/webapp/OrderSprinterPrintserver.exe
index d0ba361..90469ad 100644
Binary files a/webapp/OrderSprinterPrintserver.exe and b/webapp/OrderSprinterPrintserver.exe differ
diff --git a/webapp/bill.html b/webapp/bill.html
index 196c781..61a29ea 100644
--- a/webapp/bill.html
+++ b/webapp/bill.html
@@ -15,15 +15,15 @@
-
-
+
+
+
+
+
+
-
-
-
-
)
+ * @return string
+ * @throws PHPExcel_Writer_Exception
+ */
+ public function generateStyles($generateSurroundingHTML = true) {
+ // PHPExcel object known?
+ if (is_null($this->_phpExcel)) {
+ throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
+ }
+
+ // Build CSS
+ $css = $this->buildCSS($generateSurroundingHTML);
+
+ // Construct HTML
+ $html = '';
+
+ // Start styles
+ if ($generateSurroundingHTML) {
+ $html .= ' ' . PHP_EOL;
+ }
+
+ // Return
+ return $html;
+ }
+
+ /**
+ * Build CSS styles
+ *
+ * @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { })
+ * @return array
+ * @throws PHPExcel_Writer_Exception
+ */
+ public function buildCSS($generateSurroundingHTML = true) {
+ // PHPExcel object known?
+ if (is_null($this->_phpExcel)) {
+ throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
+ }
+
+ // Cached?
+ if (!is_null($this->_cssStyles)) {
+ return $this->_cssStyles;
+ }
+
+ // Ensure that spans have been calculated
+ if (!$this->_spansAreCalculated) {
+ $this->_calculateSpans();
+ }
+
+ // Construct CSS
+ $css = array();
+
+ // Start styles
+ if ($generateSurroundingHTML) {
+ // html { }
+ $css['html']['font-family'] = 'Calibri, Arial, Helvetica, sans-serif';
+ $css['html']['font-size'] = '11pt';
+ $css['html']['background-color'] = 'white';
+ }
+
+
+ // table { }
+ $css['table']['border-collapse'] = 'collapse';
+ if (!$this->_isPdf) {
+ $css['table']['page-break-after'] = 'always';
+ }
+
+ // .gridlines td { }
+ $css['.gridlines td']['border'] = '1px dotted black';
+
+ // .b {}
+ $css['.b']['text-align'] = 'center'; // BOOL
+
+ // .e {}
+ $css['.e']['text-align'] = 'center'; // ERROR
+
+ // .f {}
+ $css['.f']['text-align'] = 'right'; // FORMULA
+
+ // .inlineStr {}
+ $css['.inlineStr']['text-align'] = 'left'; // INLINE
+
+ // .n {}
+ $css['.n']['text-align'] = 'right'; // NUMERIC
+
+ // .s {}
+ $css['.s']['text-align'] = 'left'; // STRING
+
+ // Calculate cell style hashes
+ foreach ($this->_phpExcel->getCellXfCollection() as $index => $style) {
+ $css['td.style' . $index] = $this->_createCSSStyle( $style );
+ }
+
+ // Fetch sheets
+ $sheets = array();
+ if (is_null($this->_sheetIndex)) {
+ $sheets = $this->_phpExcel->getAllSheets();
+ } else {
+ $sheets[] = $this->_phpExcel->getSheet($this->_sheetIndex);
+ }
+
+ // Build styles per sheet
+ foreach ($sheets as $sheet) {
+ // Calculate hash code
+ $sheetIndex = $sheet->getParent()->getIndex($sheet);
+
+ // Build styles
+ // Calculate column widths
+ $sheet->calculateColumnWidths();
+
+ // col elements, initialize
+ $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()) - 1;
+ $column = -1;
+ while($column++ < $highestColumnIndex) {
+ $this->_columnWidths[$sheetIndex][$column] = 42; // approximation
+ $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = '42pt';
+ }
+
+ // col elements, loop through columnDimensions and set width
+ foreach ($sheet->getColumnDimensions() as $columnDimension) {
+ if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->_defaultFont)) >= 0) {
+ $width = PHPExcel_Shared_Drawing::pixelsToPoints($width);
+ $column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1;
+ $this->_columnWidths[$sheetIndex][$column] = $width;
+ $css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt';
+
+ if ($columnDimension->getVisible() === false) {
+ $css['table.sheet' . $sheetIndex . ' col.col' . $column]['visibility'] = 'collapse';
+ $css['table.sheet' . $sheetIndex . ' col.col' . $column]['*display'] = 'none'; // target IE6+7
+ }
+ }
+ }
+
+ // Default row height
+ $rowDimension = $sheet->getDefaultRowDimension();
+
+ // table.sheetN tr { }
+ $css['table.sheet' . $sheetIndex . ' tr'] = array();
+
+ if ($rowDimension->getRowHeight() == -1) {
+ $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->_phpExcel->getDefaultStyle()->getFont());
+ } else {
+ $pt_height = $rowDimension->getRowHeight();
+ }
+ $css['table.sheet' . $sheetIndex . ' tr']['height'] = $pt_height . 'pt';
+ if ($rowDimension->getVisible() === false) {
+ $css['table.sheet' . $sheetIndex . ' tr']['display'] = 'none';
+ $css['table.sheet' . $sheetIndex . ' tr']['visibility'] = 'hidden';
+ }
+
+ // Calculate row heights
+ foreach ($sheet->getRowDimensions() as $rowDimension) {
+ $row = $rowDimension->getRowIndex() - 1;
+
+ // table.sheetN tr.rowYYYYYY { }
+ $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = array();
+
+ if ($rowDimension->getRowHeight() == -1) {
+ $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->_phpExcel->getDefaultStyle()->getFont());
+ } else {
+ $pt_height = $rowDimension->getRowHeight();
+ }
+ $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['height'] = $pt_height . 'pt';
+ if ($rowDimension->getVisible() === false) {
+ $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['display'] = 'none';
+ $css['table.sheet' . $sheetIndex . ' tr.row' . $row]['visibility'] = 'hidden';
+ }
+ }
+ }
+
+ // Cache
+ if (is_null($this->_cssStyles)) {
+ $this->_cssStyles = $css;
+ }
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Create CSS style
+ *
+ * @param PHPExcel_Style $pStyle PHPExcel_Style
+ * @return array
+ */
+ private function _createCSSStyle(PHPExcel_Style $pStyle) {
+ // Construct CSS
+ $css = '';
+
+ // Create CSS
+ $css = array_merge(
+ $this->_createCSSStyleAlignment($pStyle->getAlignment())
+ , $this->_createCSSStyleBorders($pStyle->getBorders())
+ , $this->_createCSSStyleFont($pStyle->getFont())
+ , $this->_createCSSStyleFill($pStyle->getFill())
+ );
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Create CSS style (PHPExcel_Style_Alignment)
+ *
+ * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment
+ * @return array
+ */
+ private function _createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle) {
+ // Construct CSS
+ $css = array();
+
+ // Create CSS
+ $css['vertical-align'] = $this->_mapVAlign($pStyle->getVertical());
+ if ($textAlign = $this->_mapHAlign($pStyle->getHorizontal())) {
+ $css['text-align'] = $textAlign;
+ if(in_array($textAlign,array('left','right')))
+ $css['padding-'.$textAlign] = (string)((int)$pStyle->getIndent() * 9).'px';
+ }
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Create CSS style (PHPExcel_Style_Font)
+ *
+ * @param PHPExcel_Style_Font $pStyle PHPExcel_Style_Font
+ * @return array
+ */
+ private function _createCSSStyleFont(PHPExcel_Style_Font $pStyle) {
+ // Construct CSS
+ $css = array();
+
+ // Create CSS
+ if ($pStyle->getBold()) {
+ $css['font-weight'] = 'bold';
+ }
+ if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) {
+ $css['text-decoration'] = 'underline line-through';
+ } else if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE) {
+ $css['text-decoration'] = 'underline';
+ } else if ($pStyle->getStrikethrough()) {
+ $css['text-decoration'] = 'line-through';
+ }
+ if ($pStyle->getItalic()) {
+ $css['font-style'] = 'italic';
+ }
+
+ $css['color'] = '#' . $pStyle->getColor()->getRGB();
+ $css['font-family'] = '\'' . $pStyle->getName() . '\'';
+ $css['font-size'] = $pStyle->getSize() . 'pt';
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Create CSS style (PHPExcel_Style_Borders)
+ *
+ * @param PHPExcel_Style_Borders $pStyle PHPExcel_Style_Borders
+ * @return array
+ */
+ private function _createCSSStyleBorders(PHPExcel_Style_Borders $pStyle) {
+ // Construct CSS
+ $css = array();
+
+ // Create CSS
+ $css['border-bottom'] = $this->_createCSSStyleBorder($pStyle->getBottom());
+ $css['border-top'] = $this->_createCSSStyleBorder($pStyle->getTop());
+ $css['border-left'] = $this->_createCSSStyleBorder($pStyle->getLeft());
+ $css['border-right'] = $this->_createCSSStyleBorder($pStyle->getRight());
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Create CSS style (PHPExcel_Style_Border)
+ *
+ * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border
+ * @return string
+ */
+ private function _createCSSStyleBorder(PHPExcel_Style_Border $pStyle) {
+ // Create CSS
+// $css = $this->_mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
+ // Create CSS - add !important to non-none border styles for merged cells
+ $borderStyle = $this->_mapBorderStyle($pStyle->getBorderStyle());
+ $css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important');
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Create CSS style (PHPExcel_Style_Fill)
+ *
+ * @param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill
+ * @return array
+ */
+ private function _createCSSStyleFill(PHPExcel_Style_Fill $pStyle) {
+ // Construct HTML
+ $css = array();
+
+ // Create CSS
+ $value = $pStyle->getFillType() == PHPExcel_Style_Fill::FILL_NONE ?
+ 'white' : '#' . $pStyle->getStartColor()->getRGB();
+ $css['background-color'] = $value;
+
+ // Return
+ return $css;
+ }
+
+ /**
+ * Generate HTML footer
+ */
+ public function generateHTMLFooter() {
+ // Construct HTML
+ $html = '';
+ $html .= '