Menu

Ticket Layour for every store

Javier
2014-09-02
2014-12-18
  • Javier

    Javier - 2014-09-02

    Hi guys

    The reason i'm getting in touch is because i want to know if is possible to set up an independent ticket layout for every store, i have my two stores conected to the database and i have configured the printer.ticket layout and wrote the address of the first store but if i do a sale on the second store it prints the ticket with the addres of the first one...

    I hope you guys can help me with this.

    Thank you in advance,

    Javier

     

    Last edit: Javier 2014-09-09
  • chris J.

    chris J. - 2014-09-02

    This is not directly possible. but I have possible a solution, I'm trying this out for you

    chris J.

     
    • Javier

      Javier - 2014-09-09

      Thank you so much Chris i will wait for your reply ;)

       
  • krulleke

    krulleke - 2014-09-03

    yes it is possible.
    it is not a clean option but is possible without Java code modification. but that is on the sales ticket. on the other tickets it is best done with a code modification.

    Pepsi

     
  • krulleke

    krulleke - 2014-09-03

    Goto <Administration> - <Maintenance> - <Resources>
    In the list there is a name matching your <machine name="">/properties
    Copy the UUID behind entry key="activecash"

    #if (${ticket.getActiveCash()} == "<PUT THE NUMBER HERE>")
        <line><text align="center" length="42">uniCenta oPOS</text></line>
        <line><text align="center" length="42">Touch Friendly Point Of Sale</text></line>
        <line><text align="center" length="42">Copyright (c) 2009-2014 uniCenta</text></line>
        <line><text align="center" length="42">Printer.Ticket</text></line>
    #end
    

    Add the above text as replacement for the current address. And replace the text <PUT THE="" NUMBER="" HERE=""> with the earlier copied UUID.
    And repeat this for every register.

    Pepsi

    PS I'll post a code modification to make is possible to do it more clean. (after release 3.80)

     
    • Javier

      Javier - 2014-09-09

      Thank you so much Pepsi im going to try this out :)

       
    • Javier

      Javier - 2014-09-11

      Hi my friend, this solution works great but had one problem. Everytime a register (pc) is turned on and have access to the POS, unicenta assign a different activecash ID so when the software is about to print the ticket it doesnt print the address on the ticket because it no longer has the previous ID.

      Is there anything i can do about it?

      Thank you so much in advance,

      Javier

       

      Last edit: Javier 2014-09-11
      • krulleke

        krulleke - 2014-09-11

        That is what i forgot.... I need to remember more things.

        I'll write the modification tommorrow. For version v3.70

        Pepsi

         
  • chris J.

    chris J. - 2014-09-11

    Krulleke is right so it will have to work.
    but instead of the UUID behind entry key="activecash"
    use UUID behind entry key="location"

    chris J.

     

    Last edit: chris J. 2014-09-11
    • krulleke

      krulleke - 2014-09-12

      Chris,

      that will not work. because ticket.getLocation or ticket.getInverntoryLocation is not declared in TicketInfo
      Or I'm doing something wrong.

      Pepsi

       
  • krulleke

    krulleke - 2014-09-12

    Here is a modification for version 3.70

    in the source code add in file src-pos\com\openbravo\pos\ticket\TicketInfo.java
    starting add line 382, just after the return m_sActiveCash; }
    As you can see the name it taken from the properties files (thanks for the one that wrote this script in another part of the java file.

         /**
         *
         * @return Machine name
         */
        public String getHost() {
          // We need acces to the config file        
          AppConfig m_config_host =  new AppConfig(new File((System.getProperty("user.home")), AppLocal.APP_ID + ".properties"));        
          m_config_host.load();
          String machineHostname =(m_config_host.getProperty("machine.hostname"));
          // we have finished with m_config_host so unload it      
          m_config_host = null;
          return machineHostname;
        } 
    

    in Printer.Ticket add for every register

    #if (${ticket.getHost()} == "<Registername>")
        <line><text align="center" length="42">testpos</text></line>
        <line><text align="center" length="42">Touch Friendly Point Of Sale</text></line>
        <line><text align="center" length="42">Copyright (c) 2009-2014 uniCenta</text></line>
        <line><text align="center" length="42">Printer.Ticket</text></line>
    #end
    

    I attached the modified java file(TicketInfo.java). And for people who don't want/know to compile themselves, also the class file (TicketInfo.class).

    Pepsi

     

    Last edit: krulleke 2014-09-12
  • krulleke

    krulleke - 2014-09-12

    My advice would be to name all the registers starting with a store number
    for example
    store 3 has 3 cash registers
    - 3CR1
    - 3CR2
    - 3CR3

    and use it the following way

    #if (${ticket.getHost().substring(0,1)} == "3")
        <line><text align="center" length="42">testpos</text></line>
        <line><text align="center" length="42">Touch Friendly Point Of Sale</text></line>
        <line><text align="center" length="42">Copyright (c) 2009-2014 uniCenta</text></line>
        <line><text align="center" length="42">Printer.Ticket</text></line>
    #end
    

    Every register that starts with a 3 will get this address. (I'll try to update it to location... but this will do the trick for now

    Pepsi

     
  • Javier

    Javier - 2014-12-18

    Hy mi friend, i just did de upgrade to version 3.9 and obviously all this changes were reverted, is there a new way to do it in this new version?

    Thank you again, ;)

    Javier

     
  • chris J.

    chris J. - 2014-12-18

    No you have to do it in the same way.
    You can copy the table resources from one of your backup

    chris J.

     

Log in to post a comment.