Even in the case where units are same, total is still not shown with that code. Which indicates that it’s already starting with some missing code compared to the default one that is used. That’s all I’m trying to say. Otherwise, I understand that things have to be added. But It would help to see how the quantity total column is coded for example.
Please see my post #17 above:
This means they were not visible nor editable by us, but building your own custom theme you can code these functions yourself.
Actually, the default displays are no longer created using a theme the way they were when the default theme was Plain. Thus, as the program has evolved, new features were not added to obsolete starting theme code.
Check it,
{% assign sumaryIndex = -1 %}
{% assign qtyLabel = null %}
{% for column in table.columns %}
{% if column.label == "Unit price" %}
{% assign sumaryIndex = forloop.index0 | minus:1 %}
{% break %}
{% endif %}
{% assign qtyLabel = column.label %}
{% endfor %}
{% assign sumQty = 0 %}
{% assign sumPrice = 0 %}
{% assign sumAmout = 0 %}
{% assign sumTaxAmount = 0 %}
{% for row in table.rows %}
{% for cell in row.cells %}
{% assign lbl = table.columns[forloop.index0].label | strip_html %}
{% case lbl %}
{% when qtyLabel %}
{% if cell.value != null %}
{% assign sumQty = sumQty | plus: cell.value %}
{% endif %}
{% when "Price" %}
{% if cell.value != null %}
{% assign sumPrice = sumPrice | plus: cell.value %}
{% endif %}
{% when "Amount" %}
{% if cell.value != null %}
{% assign sumAmout = sumAmout | plus: cell.value %}
{% endif %}
{% when "Tax Amount" %}
{% if cell.value != null %}
{% assign sumTaxAmount = sumTaxAmount | plus: cell.value %}
{% endif %}
{% endcase %}
{% endfor %}
{% endfor %}
<table style="padding: 30px; width: 100%">
<thead>
<tr>
<td colspan="99">
<table style="margin-bottom: 20px; width: 100%"><tr>
<td style="font-weight: bold; font-size: 32px; vertical-align: top">{{ title }}</td>
{% if business.logo != null %}<td style="text-align: end"><img src="{{ business.logo }}" style="max-height: 150px; max-width: 300px; display: inline" /></td>{% endif %}
</tr></table>
<table style="margin-bottom: 20px; width: 100%"><tr>
<td style="vertical-align: top">
<div style="font-weight: bold">{{ recipient.name }}</div>
<div>{{ recipient.address | newline_to_br }}</div>
<div>{{ recipient.identifier }}</div>
</td>
<td style="text-align: end; vertical-align: top">
{% for field in fields %}
<div style="font-weight: bold">{{ field.label }}</div>
<div style="margin-bottom: 10px">{{ field.text }}</div>
{% endfor %}
</td>
{% if business.address != null %}
<td style="width: 20px"></td>
<td style="width: 1px; border-left-width: 1px; border-left-color: #000; border-left-style: solid"></td>
<td style="width: 20px"></td>
<td style="width: 1px; white-space: nowrap; vertical-align: top">
<div style="font-weight: bold">{{ business.name }}</div>
<div>{{ business.address | newline_to_br }}</div>
{% for field in business.custom_fields %}
<div>{{ field.label }} {{ field.text }}</div>
{% endfor %}
</td>
{% endif %}
</tr></table>
<div style="font-size: 14px; font-weight: bold; margin-bottom: 20px">{{ description }}</div>
</td>
</tr>
<tr>
{% for column in table.columns %}
<td style="writing-mode: horizontal-tb; border-inline-start-width: 1px; border-inline-start-style: solid; border-inline-start-color: #000; {% if forloop.last == true %} border-inline-end-width: 1px; border-inline-end-style: solid; border-inline-end-color: #000{% endif %}; text-align: {{ column.align }}; font-weight: bold; padding: 5px 10px; border-bottom-width: 1px; border-bottom-color: #000; border-top-width: 1px; border-top-color: #000; border-top-style: solid; border-bottom-style: solid{% if column.nowrap %}; width: 80px{% endif %}">{{ column.label }}</td>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in table.rows %}
<tr>
{% for cell in row.cells %}
<td style="writing-mode: horizontal-tb; border-inline-start-width: 1px; border-inline-start-style: solid; border-inline-start-color: #000; {% if forloop.last == true %} border-inline-end-width: 1px; border-inline-end-style: solid; border-inline-end-color: #000{% endif %}; padding: 5px 10px; text-align: {{ table.columns[forloop.index0].align }}; {% if table.columns[forloop.index0].nowrap %}; white-space: nowrap; width: 80px{% endif %}">{{ cell.text | newline_to_br }}</td>
{% endfor %}
</tr>
{% endfor %}
<tr>
{% for column in table.columns %}
<td style="writing-mode: horizontal-tb; border-inline-start-width: 1px; border-inline-start-style: solid; border-inline-start-color: #000; {% if forloop.last == true %} border-inline-end-width: 1px; border-inline-end-style: solid; border-inline-end-color: #000{% endif %}; border-bottom-width: 1px; border-bottom-color: #000000; border-bottom-style: solid"> </td>
{% endfor %}
</tr>
<tr>
{% for column in table.columns %}
{% if forloop.index0 >= sumaryIndex %}
{% assign lbl = column.label | strip_html %}
{% assign sumText = 0 %}
{% case lbl %}
{% when qtyLabel %}
{% assign sumText = sumQty %}
{% when "Price" %}
{% assign sumText = sumPrice %}
{% when "Amount" %}
{% assign sumText = sumAmout %}
{% when "Tax Amount" %}
{% assign sumText = sumTaxAmount %}
{% endcase %}
{% if sumText == 0 %}
<td style="writing-mode: horizontal-tb; border-inline-start-width: 1px; border-inline-start-style: solid; border-inline-start-color: #000; {% if forloop.last == true %} border-inline-end-width: 1px; border-inline-end-style: solid; border-inline-end-color: #000{% endif %}; text-align: {{ column.align }}; padding: 5px 10px; border-bottom-width: 1px; border-bottom-color: #000; border-top-width: 0px; border-top-color: #000; border-top-style: solid; border-bottom-style: solid{% if column.nowrap %}; width: 80px{% endif %}"> </td>
{% else %}
<td style="writing-mode: horizontal-tb; border-inline-start-width: 1px; border-inline-start-style: solid; border-inline-start-color: #000; {% if forloop.last == true %} border-inline-end-width: 1px; border-inline-end-style: solid; border-inline-end-color: #000{% endif %}; text-align: {{ column.align }}; padding: 5px 10px; border-bottom-width: 1px; border-bottom-color: #000; border-top-width: 0px; border-top-color: #000; border-top-style: solid; border-bottom-style: solid{% if column.nowrap %}; width: 80px{% endif %}">{{ sumText }}</td>
{% endif %}
{% else %}
<td> </td>
{% endif %}
{% endfor %}
</tr>
{% for total in table.totals %}
<tr>
<td colspan="{{ table.columns | size | minus:1 }}" style="text-align: end; padding: 5px 10px{% if total.emphasis == true %}; font-weight: bold{% endif %}">{{ total.label }}</td>
<td style="border-left-width: 1px; border-left-style: solid; border-left-color: #000; border-right-width: 1px; border-right-style: solid; border-right-color: #000; text-align: right; white-space: nowrap; border-bottom-width: 1px; border-bottom-color: #000000; border-bottom-style: solid; padding: 5px 10px{% if total.emphasis == true %}; font-weight: bold{% endif %}">{{ total.text }}</td>
</tr>
{% endfor %}
{% for field in custom_fields %}
<tr>
<td colspan="99">
<div style="font-weight: bold; padding-top: 20px">{{ field.label }}</div>
<div>{{ field.text | newline_to_br }}</div>
</td>
</tr>
{% endfor %}
<tr>
<td colspan="99">
{% if emphasis.text != null and emphasis.positive %}
<div style="text-align: center; margin-top: 40px"><span style="color: #006400; border-width: 5px; border-color: #006400; border-style: solid; padding: 10px; font-size: 20px">{{ emphasis.text | upcase }}</span></div>
{% endif %}
{% if emphasis.text != null and emphasis.negative %}
<div style="text-align: center; margin-top: 40px"><span style="color: #FF0000; border-width: 5px; border-color: #FF0000; border-style: solid; padding: 10px; font-size: 20px">{{ emphasis.text | upcase }}</span></div>
{% endif %}
</td>
</tr>
</tbody>
</table>
Thank you for clarifying. This is what I was trying to get at. I knew i wasn’t crazy lol.
@Mabaega thank you for the code, this can definitely be very helpful in my mission to make a custom theme! Lot of playing around to do.
Sorry but no! You were advised to read and we already made clear that the old themes did not support Footers because they did not exist. The default new theme does support footers but as build-in feature. Recently a user posted how to add a footer to a custom theme for the newer versions of Manager.
I already explained as demonstrated by @Mabaega that you can code yourself. You admitted that you can not do that so you are now looking for ways and means to get it done without putting any effort yourself as recommended.
As a new user to Manager you assume a lot about the old versions, so I encourage you to go to the Manager github site Releases · Manager-io/Manager · GitHub and download a version older than v22.8.9 (i.e. older than 9 August 2022) and create a new theme. You will see similar screenshots and a similar code editing scheme. It was not easier then! The coding work is the same.
And this is exactly what I’m trying to say… for users like me who are new and are starting with the new system, it would greatly help to at least have the current theme’s code as a starting point in the obsolete theme option as we’re waiting for new implementations to be ready.
As @Tut mentioned, the new features since themes went obsolete are not added to the starting theme code. I feel like you are misunderstanding me because the other 2 people completely understood what I’m trying to say. Anyways I appreciate the time you’ve put to discuss this here. I’m definitely still learning. Thanks to all.
@Footballmanager
I noticed the footer data is not exposed for custom themes (or maybe I don’t know how to access it).
I think footer data is not needed in custom themes. We can write it directly in code. or if we want the footer to be dynamic we can use a custom field as a data source.
This is how we can get the data structure exposed for the custom theme.
Maybe there is still a lot of data exposed for custom themes, I just don’t see it.
I’m sure this can give an idea of how to generate the template we want.
{{ table | json }}
{{ business | json }}
{{ recipient | json }}
{{ fields | json }}
{{ emphasis | json }}
{{ custom_fields | json}}
Output
{
"columns": [
{
"label": "#",
"align": "center",
"nowrap": true,
"total": false,
"emphasis": false,
"minWidth": true,
"alwaysShow": false
},
{
"label": "Item",
"align": "start",
"nowrap": false,
"total": false,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Description",
"align": "start",
"nowrap": false,
"total": false,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Pcs",
"align": "center",
"nowrap": true,
"total": true,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Unit price",
"align": "right",
"nowrap": true,
"total": false,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Price",
"align": "right",
"nowrap": true,
"total": true,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Discount",
"align": "right",
"nowrap": true,
"total": false,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Amount",
"align": "right",
"nowrap": true,
"total": true,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Tax",
"align": "center",
"nowrap": true,
"total": false,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Tax Amount",
"align": "right",
"nowrap": true,
"total": true,
"emphasis": false,
"minWidth": false,
"alwaysShow": false
},
{
"label": "Total",
"align": "right",
"nowrap": true,
"total": false,
"emphasis": true,
"minWidth": false,
"alwaysShow": true
}
],
"rows": [
{
"cells": [
{
"canBeHidden": false,
"text": "1"
},
{
"canBeHidden": false,
"text": "I00-001"
},
{
"canBeHidden": false,
"text": "Item 0% rate"
},
{
"value": 9.0,
"canBeHidden": false,
"text": "9"
},
{
"value": 9.0,
"canBeHidden": false,
"text": "9.00"
},
{
"value": 81.00,
"canBeHidden": false,
"text": "81.00"
},
{
"value": 3.0,
"canBeHidden": false,
"text": "3 %"
},
{
"value": 78.57,
"canBeHidden": false,
"text": "78.57"
},
{
"canBeHidden": false,
"text": "VAT 0%"
},
{
"canBeHidden": false,
"text": " "
},
{
"value": 78.57,
"canBeHidden": false,
"text": "78.57"
}
]
},
{
"cells": [
{
"canBeHidden": false,
"text": "2"
},
{
"canBeHidden": false,
"text": "I15-001"
},
{
"canBeHidden": false,
"text": "Item 15% rate"
},
{
"value": 8.0,
"canBeHidden": false,
"text": "8"
},
{
"value": 8.0,
"canBeHidden": false,
"text": "8.00"
},
{
"value": 64.00,
"canBeHidden": false,
"text": "64.00"
},
{
"value": 4.0,
"canBeHidden": false,
"text": "4 %"
},
{
"value": 61.44,
"canBeHidden": false,
"text": "61.44"
},
{
"canBeHidden": false,
"text": "VAT 15%"
},
{
"value": 9.22,
"canBeHidden": false,
"text": "9.22"
},
{
"value": 70.66,
"canBeHidden": false,
"text": "70.66"
}
]
},
{
"cells": [
{
"canBeHidden": false,
"text": "3"
},
{
"canBeHidden": false,
"text": "IEX-001"
},
{
"canBeHidden": false,
"text": "Item Exemted"
},
{
"value": 7.0,
"canBeHidden": false,
"text": "7"
},
{
"value": 7.0,
"canBeHidden": false,
"text": "7.00"
},
{
"value": 49.00,
"canBeHidden": false,
"text": "49.00"
},
{
"value": 1.0,
"canBeHidden": false,
"text": "1 %"
},
{
"value": 48.51,
"canBeHidden": false,
"text": "48.51"
},
{
"canBeHidden": false,
"text": " "
},
{
"canBeHidden": false,
"text": " "
},
{
"value": 48.51,
"canBeHidden": false,
"text": "48.51"
}
]
}
],
"totals": [
{
"class": "",
"key": "",
"label": "Sub-total",
"text": "USD 188.52",
"number": 188.52,
"emphasis": false
},
{
"class": "taxAmount",
"key": "",
"label": "VAT 15%",
"text": "USD 9.22",
"number": 9.22,
"emphasis": false
},
{
"class": "",
"key": "Total",
"label": "Total",
"text": "USD 197.74",
"number": 197.74,
"emphasis": true
}
]
}
{
"logo": "/business-logo-view?ChIJ5QqHjGq-xEYRlelZ_h7KYkOiBhZaaW1iYWJ3ZSBGaXNjYWxpc2F0aW9u",
"name": "Zimbabwe Fiscalisation",
"address": "Address 1\nAddress 2\nAddress 3",
"custom_fields": [
{
"key": "662619ac-90b6-47ff-8231-26f9f9ef779f",
"label": "Phone",
"text": "MYPHONE0000",
"value": "MYPHONE0000",
"displayAtTheTop": false
},
{
"key": "96c2e2eb-313a-4362-95f3-c4446952cdbc",
"label": "Fax",
"text": "MYFAX00000",
"value": "MYFAX00000",
"displayAtTheTop": false
},
{
"key": "78eb6fb5-f833-4ce2-bb63-5945d9513052",
"label": "eMail",
"text": "myemail@email.com",
"value": "myemail@email.com",
"displayAtTheTop": false
},
{
"key": "12d3b275-4b42-4feb-96ce-5ba146a75726",
"label": "TIN",
"text": "MYTIN000000",
"value": "MYTIN000000",
"displayAtTheTop": false
},
{
"key": "add3cda6-a87d-4f0f-add7-2a7ccdd10f52",
"label": "VAT No.",
"text": "MYVAT000000",
"value": "MYVAT000000",
"displayAtTheTop": false
}
]
}
{
"code": "C01",
"name": "CUSTOMER 01 - USD",
"address": "Customer Billing Address 1\nCustomer Billing Address 2\nCustomer Billing Address 3",
"email": "customer01@domain.com",
"telephone": null
}
[
{
"key": "InvoiceDate",
"label": "Invoice date",
"text": "16-Mar-24",
"emphasis": false
},
{
"key": "DueDate",
"label": "Due date",
"text": "15-Apr-24",
"emphasis": false
},
{
"key": "InvoiceNumber",
"label": "Invoice number",
"text": "INV-001",
"emphasis": false
}
]
{
"text": null,
"positive": false,
"negative": false
}
[
{
"key": "cf6c6f0f-90e1-42dd-be5b-3b74851094e8",
"label": "Phone",
"text": "1-234-56789",
"value": "1-234-56789",
"displayAtTheTop": false
},
{
"key": "0f8885ca-9a9f-4fcc-98c2-6b6a981c10c4",
"label": "Fax",
"text": "1-234-56789",
"value": "1-234-56789",
"displayAtTheTop": false
},
{
"key": "0387f667-953b-4064-9cff-dbb6365a8e8f",
"label": "TIN",
"text": "TINTINTINTIN",
"value": "TINTINTINTIN",
"displayAtTheTop": false
},
{
"key": "e67c4e68-e427-4e75-ba7b-cb3ba86313e7",
"label": "VAT No.",
"text": "VATVATVATVAT",
"value": "VATVATVATVAT",
"displayAtTheTop": false
},
{
"key": "",
"label": "Total amount in words",
"text": "One hundred and ninety-seven US dollars and 74/100",
"displayAtTheTop": false
}
]
Honestly I give up! You are looking for something that I over and over explained that does not exist because as @Mabaega shows you can do yourself. Especialy as a new user you should learn from what we are saying rather than keep repeating yourself and expect a different result. Because you can not code nor attempt it somehow you expect a miracle. The reality is that you either accept the status quo until the developer comes with a new way of doing things or you start learning Liquid or recruit someone that knows it and makes the theme you desire. Over and out!
@Footballmanager, you are creating a very poor reputation for yourself on this forum. As you have ignored information from other forum members, you are also ignoring what I have told you.
I did not tell you new features were left out of a current theme. I told you explicitly:
You keep asking for something that does not exist. You can write (or pay someone to write) a custom theme, and it will still work, for the time being. But there is no starting point for custom themes that produces the current default display, because they are not created via any theme whatsoever.
You can say that I was just wishing out loud, so i apologize for it coming out as me ignoring. Just trying to poor my heart out because i think this is great software. And this discussion has lead to great posts by everyone including @Mabaega , who shared some code that can potentially help many of the new users who are looking to play around with themes while they wait for new implementations. Thank you all once again for bearing with me.