Changeset 3373026
- Timestamp:
- 10/05/2025 05:54:51 AM (6 months ago)
- Location:
- wpos-lite-version/tags/3.0
- Files:
-
- 3 edited
-
includes/Core.php (modified) (1 diff)
-
includes/api/Auth.php (modified) (1 diff)
-
lib/class-op-receipt.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpos-lite-version/tags/3.0/includes/Core.php
r3372336 r3373026 1786 1786 } 1787 1787 1788 public function formatShortcode($html){ 1789 $payment_methods = '<ul class="payment-methods">'; 1790 $payment_methods .= '<% payment_method.forEach(function(payment){ %>'; 1791 $payment_methods .= '<li><%= payment.name %> : <%= payment.paid %></li>'; 1792 1793 $payment_methods .= '<% if (payment.code == "cash" && payment.return > 0) { %>'; 1794 $payment_methods .= '<li>'.__('Return','wpos-lite').' : <%= payment.return %></li>'; 1795 $payment_methods .= '<% } %>'; 1796 1797 $payment_methods .= '<% }); %>'; 1798 $payment_methods .= '</ul>'; 1799 $rules = array( 1800 '< %' => '<%', 1801 '[customer_name]' => '<%= customer.name %>', 1802 '[customer_phone]' => '<%= customer.phone %>', 1803 '[customer_firstname]' => '<%= customer.firstname %>', 1804 '[customer_lastname]' => '<%= customer.lastname %>', 1805 '[sale_person]' => '<% if(typeof sale_person_name != "undefined") { %> <%= sale_person_name %> <% } %>', 1806 '[created_at]' => '<%= created_at %>', 1807 '[order_number]' => '<%= order_number %>', 1808 '[order_number_format]' => '<%= order_number_format %>', 1809 '[order_note]' => '<%= note %>', 1810 '[customer_email]' => '<%= customer.email %>', 1811 '[payment_method]' => $payment_methods, 1812 ); 1813 return str_replace(array_keys($rules), array_values($rules), html_entity_decode($html)); 1814 } 1815 1788 1816 public function formatReceiptSetting($setting,$op_incl_tax_mode= false) 1789 1817 { -
wpos-lite-version/tags/3.0/includes/api/Auth.php
r3373005 r3373026 254 254 "pos_desk_checkout_update" => "no", 255 255 "pos_cart_item_incl_tax_mode" => "no", 256 "receipt_full_template" => '', 257 "pos_kitchen_receipt_template" => '', 258 "pos_delivery_receipt_template" => '', 259 "pos_decal_receipt_template" => '', 256 "receipt_full_template" => $setting['receipt_full_template'], 260 257 // "pos_online_order_submit" => "yes", 261 258 "pos_default_shipping_code" => $setting['pos_default_shipping_code'], -
wpos-lite-version/tags/3.0/lib/class-op-receipt.php
r3372336 r3373026 53 53 'default_template' => '' 54 54 ); 55 if($openpos_type == 'restaurant')56 {57 $result['kitchen_receipt'] = array(58 'code' => 'kitchen_receipt',59 'label' => __('Kitchen Receipt','wpos-lite'),60 'sample_data' => 'desk_formatted.json',61 'sample_template' => 'kitchen_receipt_template.txt',62 'sample_template_css' => 'kitchen_receipt_css.txt',63 'default_template' => ''64 );65 $result['delivery_receipt'] = array(66 'code' => 'delivery_receipt',67 'label' => __('Delivery Receipt','wpos-lite'),68 'sample_data' => 'delivery_formatted.json',69 'sample_template' => 'delivery_receipt_template.txt',70 'sample_template_css' => 'delivery_receipt_css.txt',71 'default_template' => ''72 );73 $result['product_decal'] = array(74 'code' => 'product_decal',75 'label' => __('Product Decal','wpos-lite'),76 'sample_data' => 'items_formatted.json',77 'sample_template' => 'product_decal_template.txt',78 'sample_template_css' => 'product_decal_css.txt',79 'default_template' => ''80 );81 }82 55 return $result; 83 56 … … 635 608 public function op_setting_data($session_response_data){ 636 609 global $OPENPOS_SETTING; 637 $openpos_type = $OPENPOS_SETTING->get_option('openpos_type','openpos_pos');638 610 global $OPENPOS_CORE; 611 639 612 //receipt_full_template 640 613 $login_cashdrawer_id = $session_response_data['login_cashdrawer_id']; … … 651 624 $gift_receipt = $this->get_register_gift_template($login_cashdrawer_id); 652 625 $current_zreport = $this->get_zreport_template($login_cashdrawer_id); 653 $current_kitchen = $this->get_kitchen_template($login_cashdrawer_id); 654 $current_delivery = $this->get_delivery_template($login_cashdrawer_id); 655 $current_decal = $this->get_decal_template($login_cashdrawer_id); 626 627 628 $file_name = 'receipt_template_body.txt'; 629 $receipt_content_file_path = rtrim(WPOSL_DIR,'/').'/default/'.$file_name; 630 $receipt_content = file_get_contents($receipt_content_file_path); 631 632 $receipt = array( 633 'padding_top' => $OPENPOS_SETTING->get_option('receipt_padding_top','openpos_receipt'), 634 'padding_right' => $OPENPOS_SETTING->get_option('receipt_padding_right','openpos_receipt'), 635 'padding_bottom' => $OPENPOS_SETTING->get_option('receipt_padding_bottom','openpos_receipt'), 636 'padding_left' => $OPENPOS_SETTING->get_option('receipt_padding_left','openpos_receipt'), 637 'paper_width' => $OPENPOS_SETTING->get_option('receipt_width','openpos_receipt'), 638 'custom_css' => $OPENPOS_SETTING->get_option('receipt_css','openpos_receipt'), 639 'content' => $OPENPOS_CORE->formatShortcode('<div id="top" class="receipt-header">'.$OPENPOS_SETTING->get_option('receipt_template_header','openpos_receipt').'</div><div class="receipt-body">'.$receipt_content.'</div><div class="receipt-bottom">'.$OPENPOS_SETTING->get_option('receipt_template_footer','openpos_receipt').'</div>') 640 ); 656 641 if($receipt && !empty($receipt)) 657 642 { … … 680 665 681 666 $session_response_data['pos_report_template']= $this->generate_full_receipt_template($current_zreport,'report'); 682 }683 if($openpos_type == 'restaurant')684 {685 if($current_kitchen && !empty($current_kitchen))686 {687 688 $session_response_data['setting']['pos_kitchen_receipt_template']= $this->generate_full_receipt_template($current_kitchen,'kitchen');689 }else{690 $file_name = 'kitchen_receipt_template_full.txt';691 $kitchen_file_path = rtrim(WPOSL_DIR,'/').'/default/'.$file_name;692 $kitchen_receipt_template = file_get_contents($kitchen_file_path);693 694 $session_response_data['setting']['pos_kitchen_receipt_template']= $kitchen_receipt_template;695 }696 if($current_delivery && !empty($current_delivery))697 {698 699 $session_response_data['setting']['pos_delivery_receipt_template']= $this->generate_full_receipt_template($current_delivery,'delivery');700 701 }else{702 $file_name = 'delivery_receipt_template_full.txt';703 $kitchen_file_path = rtrim(WPOSL_DIR,'/').'/default/'.$file_name;704 $kitchen_receipt_template = file_get_contents($kitchen_file_path);705 706 $session_response_data['setting']['pos_delivery_receipt_template']= $kitchen_receipt_template;707 }708 if($current_decal && !empty($current_decal))709 {710 711 $session_response_data['setting']['pos_decal_receipt_template']= $this->generate_full_receipt_template($current_decal,'decal');712 713 }else{714 $file_name = 'product_decal_template_full.txt';715 $kitchen_file_path = rtrim(WPOSL_DIR,'/').'/default/'.$file_name;716 $kitchen_receipt_template = file_get_contents($kitchen_file_path);717 718 $session_response_data['setting']['pos_decal_receipt_template']= $kitchen_receipt_template;719 }720 721 667 } 722 668
Note: See TracChangeset
for help on using the changeset viewer.