Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Template Roll Printer with options (for 2.2.6, 2.3, 2.3.4, 2.4.0, 2.4.4)

    Scheduled Pinned Locked Moved Captive Portal
    90 Posts 34 Posters 40.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      klm46
      last edited by

      yes i did upgrade. and the file services_captiveportal_vouchers.php was replaced by original.

      1 Reply Last reply Reply Quote 0
      • D
        DanieleIT
        last edited by

        @klm46:

        yes i did upgrade. and the file services_captiveportal_vouchers.php was replaced by original.

        You'll need to reinstall the plugin.
        Please make a backup of the original services_captiveportal_vouchers.php file as I cannot assure compatibility for versions > 2.3…
        If it works, let me know otherwise I'll have to work on it as soon as I have some spare time.  :'(

        Thanks

        1 Reply Last reply Reply Quote 0
        • GertjanG
          Gertjan
          last edited by

          This :
          @klm46:

          ….. I did not change anything - expect i did a reboot. All files are at place. ...

          has been answered by this :
          @klm46:

          yes i did upgrade. and the file services_captiveportal_vouchers.php was replaced by original.

          ;D

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          1 Reply Last reply Reply Quote 0
          • M
            michelbragaguimaraes
            last edited by

            Very Nice, this code is absolutely outstanding.

            Is there any chances to get it working on versions 2.3.x or 2.4? I am looking for this feature a long time ago and this code would fit every need I have related to the voucher system.

            I don't even know how to do it wrong when it comes about coding.

            Can you help us @DanieleIT.

            Best Regards

            Michel Braga Guimarães

            1 Reply Last reply Reply Quote 0
            • D
              DanieleIT
              last edited by

              Hello,

              It should already work for 2.3.x. Let me know if you can test it!

              For 2.4 I'll have to check as soon as I have some spare time.

              I'll let you know in this topic.

              Ciao

              1 Reply Last reply Reply Quote 0
              • D
                DanieleIT
                last edited by

                Ok.. I had some spare time today :P ;D

                Added 2.3.4 and 2.4.0 version (community edition).

                Installation method is the same as usual.
                Please check opening post for more details, instructions and downloads.

                Let me know if you are having problems with this.

                Ciao

                1 Reply Last reply Reply Quote 0
                • ExordiumE
                  Exordium
                  last edited by

                  Prints only a blank page to me (2.4.0) :-/ (Voucher roll with 21 vouchers)

                  Edit: Should not name roll# with leading zeros like "0001". All good now.

                  - pfSense Gold Subscriber -

                  Sense 1: Shuttle DS57U3 (private)
                  Sense 2: Supermicro Atom Barebone (Company Test)
                  Sense 3 : 2 x Supermicro SYS-5018D-FN8T (Company Office)

                  1 Reply Last reply Reply Quote 0
                  • iorxI
                    iorx
                    last edited by

                    function convertToHoursMins($time, $format = '%02d:%02d') {
                        if ($time < 1) {
                            return;
                        }
                        $days = floor($time / 60 / 24);
                        $hours = floor($time / 60);
                        $minutes = ($time % 60);
                    	//return sprintf($format, $hours, $minutes);
                    
                    	if ($hours > 24 && ($hours % 24) > 0)
                    		return $days." days(s) and ".$hours." hours(s)";
                    	if ($hours > 24)
                    		return $days." days(s)";
                    	if ($hours < 1)
                    		return $minutes." minute(s)";
                    	if ($hours >= 1 && $minutes == 0)
                    		return $hours." hour(s)";
                    	if ($hours >= 1 && $minutes > 0)
                    		return $hours.":".$minutes. " hours(s)";
                    }
                    

                    Slight mod for it to handle "days" (and "hours", not tested). But days work.

                    Other thing. Is it possible to make package out of this? (I've got no experience in making such, but there is probably a good wiki on the subject, haven't searched yet.)

                    Brgs,

                    1 Reply Last reply Reply Quote 0
                    • A
                      AYSMAN
                      last edited by

                      Hi,

                      The privilege for voucher printing only does not show in the list of user  privileges in version 2.4.2

                      Thanks

                      1 Reply Last reply Reply Quote 0
                      • N
                        netx34
                        last edited by

                        any tutorial using arduino to print voucher over server on pfsense, connected to pfsense allowing to send and recieve vouchers

                        1 Reply Last reply Reply Quote 0
                        • D
                          DanieleIT
                          last edited by

                          Hello,
                          My pfsense installation died today. So I had to reinstall and update PfSense to the latest 2.4.4 version. Of course I had to update the voucher roll printer to support 2.4.4.

                          I also fixed the broken links for older version.
                          Le me know!

                          Ciao

                          1 Reply Last reply Reply Quote 0
                          • iorxI
                            iorx
                            last edited by

                            Hi, (sorry for necroposting here).

                            Excellent and awesome! Kudos for keeping it working still in 2.4.4.

                            Brgs,

                            1 Reply Last reply Reply Quote 0
                            • N
                              naiksawan
                              last edited by

                              You rock!!! this is what i was looking for long... Dear one suggestion, can you add some more code to display serial no. 1,2... on coupon generated. please do let me know..
                              Many thanks.

                              1 Reply Last reply Reply Quote 0
                              • iorxI
                                iorx
                                last edited by

                                Hi,

                                Here is quick hack, apply to services_captiveportal_vouchers_print.php

                                $countofvouch = 0;
                                Is the counter and you see your self where it does its thing.

                                //print_r($sizes); /*for debugging*
                                $i = 0;
                                $countofvouch = 0;
                                
                                $maxid = count($sizes);
                                
                                echo "<div id='vouchers'>";
                                		
                                foreach ($sizes as $k => $v) 
                                {
                                	$thisVoucherDuration = $voucherDuration;
                                	$printThis = 1;
                                	
                                	if ($useRollMinutes == '1')
                                		$thisVoucherDuration = getvalidity($v);
                                	
                                	if ($printUnusedOnly == '1')
                                		if (getvalidityMinutes($v) == 0) 
                                			$printThis = 0;
                                	
                                	if ($printThis == 1) {
                                		echo "<div class='voucher'><div class='title'>#".$countofvouch.", ".$voucherTitle."</div><div class='logo'><img alt='Logo' src='voucherfiles/logo.png'></div><div class='info'>".$voucherInfo."</div><div class='vcode'>{$v}</div><div class='vtime'>".$thisVoucherDuration."</div><div class='vexpire'>".$voucherExpiration."</div></div>"; $i++;
                                		$countofvouch = $countofvouch + 1;
                                		
                                		if ($i == 21) {
                                			echo "<div class='page-break'></div>";
                                			$i = 0;
                                		}
                                	}
                                }
                                

                                Looks like this:
                                16bc691f-f890-45f3-a4c9-f0ec3168904b-image.png

                                N 1 Reply Last reply Reply Quote 1
                                • N
                                  naiksawan @iorx
                                  last edited by

                                  @iorx your are awesome dear... its worked for me. thank you very much. God bless.

                                  1 Reply Last reply Reply Quote 0
                                  • mohkhalifaM
                                    mohkhalifa
                                    last edited by

                                    Thank you so much
                                    Very nice ☺

                                    1 Reply Last reply Reply Quote 0
                                    • N
                                      naiksawan
                                      last edited by

                                      This post is deleted!
                                      GertjanG 1 Reply Last reply Reply Quote 0
                                      • GertjanG
                                        Gertjan @naiksawan
                                        last edited by

                                        @naiksawan said in Template Roll Printer with options (for 2.2.6, 2.3, 2.3.4, 2.4.0, 2.4.4):

                                        i have installed liquidsquid pkg and report i am getting is jst IP address log. could

                                        What ??

                                        And what has this to do with the subject :
                                        Template Roll Printer with options (for 2.2.6, 2.3, 2.3.4, 2.4.0, 2.4.4)
                                        ?

                                        No "help me" PM's please. Use the forum, the community will thank you.
                                        Edit : and where are the logs ??

                                        1 Reply Last reply Reply Quote 0
                                        • N
                                          naiksawan
                                          last edited by

                                          as said in comment just asked...

                                          1 Reply Last reply Reply Quote 0
                                          • GertjanG
                                            Gertjan
                                            last edited by

                                            The thing is :
                                            Ok to ask the question but the fact that people watching this thread and (getting notified) wind up with questions related to
                                            "liquidsquid pkg and report"
                                            Not printer ticket rolls etc.
                                            So you won't have any answers.

                                            liquidsquid (nad the needed Squid) usage is a totally different subject - and a complex one - because proxying on a captive portal is .... very complicated to combine with the captive portal.

                                            See also the Squid forum.

                                            No "help me" PM's please. Use the forum, the community will thank you.
                                            Edit : and where are the logs ??

                                            N 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.