Sales order printing format of transaction date

We are using drag and drop printing formatting for sales orders and purchase orders.

While everything works fine for the purchase order format using the function to reformat the date transaction to did– MMM – YYYY the same format when used for sales orders does not give identical results as it mixes up the month and date (inverts).

Please refer to the attached screenshot of sales order and purchase order print forms.

We have used the following custom HTML code for the formatting.

Purchase Order

{{ doc.name }} | {{ frappe.utils.formatdate(doc.get_formatted('transaction_date'), "dd-MMM-yyyy") }}

Hi @tyag . Try this

{{ doc.get_formatted("transaction_date") }}

I think you have not understood. I used exactly this function (both in PO and SO). however the formatting is incorrect when it comes to SO while it works as designed for the PO.

In the above example the date should be 9th may and not fifth September, however as you can see from the screenshot it says 5th Sep.

@tyag . Refer this link to setup erp server’s date format

and still if issue persists please check your code

Again , I think the problem description is probably still unclear - my mistake of not explaining this more explicitly i guess…

The same function {{ doc.get_formatted(“transaction_date”) }} when used in Purchase Order Print HTML formatting prints out the date in the correct format dd/mm/yyyy BUT when used in the Sales Order Print HTML formatting prints out the date in incorrect format mm/dd/yyyy.

This obviously can’t be server time related as in that case it should behave consistently between SO and PO. I believe the issue is some bug in the code of Sales Order Custom Print formatting that is rendering the date ignoring the function {{ doc.get_formatted(“transaction_date”) }}

Can someone look into this and revert…perhaps you could try this on your own system to replicate.

Im on Version ERPNext: v8.0.10

Try this:
{{ frappe.utils.formatdate(doc.get_formatted('transaction_date'), "dd/MMMM/yy") }}