# Changing Table Color by last order time

**URL:** <https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773>\
**Category:** V5 Question\
**Created:** [November 15, 2018, 12:36pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773 "2018-11-15T12:36:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasenbear](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@Nasenbear](https://forum.sambapos.com/u/Nasenbear)\
**Post date:** [November 15, 2018, 12:36pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/1 "2018-11-15T12:36:04Z")

</div>

Hey there,

I already worked a lot with Sambapos 4 and now i Want to Upgrade to V.5.  
Until our new Session is Starting (Just a Summer Restaurant) I want to set up the system.

I want that the Entity change the Color after Last order time. I already found the Tutorial by using a get.Color function [Change Table color according ticket time status](https://forum.sambapos.com/t/change-table-color-according-ticket-time-status/13325)  
but it seems to be for the hole Ticket time. I tried to use the {LAST ORDER TIME} instead of {ENTITY STATE MINUTES:Status} in the state Display format, but it doesn’t work.  
When there isn’t a way to use the last order time, maybe there is a way to make a rule to change the states between “checked table” and “new order”?  
I hope there is someone who can help me.

Greeting from Germany.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 15, 2018, 1:58pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/2 "2018-11-15T13:58:59Z")

</div>

When you add orders it updates the ticket status so entity time will be wince last status update which on default setup would be the last time orders were added/ticket closed.

---

<div class="post-metadata">

**Author:** ![Nasenbear](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@Nasenbear](https://forum.sambapos.com/u/Nasenbear)\
**Post date:** [November 15, 2018, 2:24pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/3 "2018-11-15T14:24:06Z")

</div>

Hey JTRTech

thanks for you reply.

The Problem is, that it DONT change / Update the ticket State after closing the ticket. When i add new orders the State Change to “New Orders” but it dont “reset” the time and color. After opening the Ticket again, the state is set to “unpaid”

 ![Screenshoot1](https://forum.sambapos.com/uploads/default/original/3X/e/c/eceaf9e529f403f860d357f9086ad1adec23bb4e.jpeg)  
unbezahlt = unpaid  
Neue Bestellungen = New Orders

übermittelt = submitted  
Neu = New

 ![Screenshoot2](https://forum.sambapos.com/uploads/default/original/3X/6/2/624fb87ebedacb4e21f7a3f293713cbe1ecf3ec1.jpeg)

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 15, 2018, 3:08pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/4 "2018-11-15T15:08:14Z")

</div>

Show you entity state formatting?  
The ticket state is changes because it was unpaid, then new orders when added then after submition it is changed back to unpaid.  
If your format isnt changing then the issue would be there, either looking at wrong state or something like that.

---

<div class="post-metadata">

**Author:** ![Nasenbear](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@Nasenbear](https://forum.sambapos.com/u/Nasenbear)\
**Post date:** [November 15, 2018, 3:21pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/5 "2018-11-15T15:21:37Z")

</div>

![Unbenannt-4](https://forum.sambapos.com/uploads/default/original/3X/2/7/27c2dc271357287359db464fdaa14ba725a5c889.jpeg)  
 ![Unbenannt-5](https://forum.sambapos.com/uploads/default/original/3X/2/9/29806d195fe4f40ea309cf1fe389771beb0d6230.jpeg)  
 ![Screenshoot3](https://forum.sambapos.com/uploads/default/original/3X/e/0/e02c6cb5ad195d569325cd031683f17179b888ae.jpeg)

When i Create the Ticket for the first time, everything is okay. but it dont refresh the time after adding a new Order.

---

<div class="post-metadata">

**Author:** ![JTRTech](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jtrtech/32/21270_2.png) [@JTRTech](https://forum.sambapos.com/u/JTRTech)\
**Post date:** [November 15, 2018, 4:09pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/6 "2018-11-15T16:09:21Z")

</div>

You have set the formatting on new orders state?  
As soon as you close the ticket it goes to unpaid, so show the unpaid status formatting.  
ALso sho the script.

---

<div class="post-metadata">

**Author:** ![Nasenbear](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/n/57b2e6/32.png) [@Nasenbear](https://forum.sambapos.com/u/Nasenbear)\
**Post date:** [November 15, 2018, 4:34pm UTC](https://forum.sambapos.com/t/changing-table-color-by-last-order-time/18773/7 "2018-11-15T16:34:26Z")

</div>

I Got it.

Two days im working on it - Finaly i have the solution.

I had to Add **“Update Entity State”** to **Rule \> New Order Adding Rule** and set the status to **"New Orders"**

 ![Screenshoot6](https://forum.sambapos.com/uploads/default/original/3X/b/c/bcb7a6124eda288d941ad3319aaeec5f7a7b0e1b.jpeg)
