kevco97
January 11, 2023, 9:43pm
#1
Hello everyone,
i have a issue in my print format template.
If i use this code:
{{ frappe.db.get_value(“Customer”, self.customer_name) }}
and implement them for sales invoice in print format to get the Customer ID i get the wrong customer ID. If i create a new sales invoice with a new customer i get the same customer ID.
Are the code right or which code should i use to get the right ID for every costumer at the print format template?
Thank you for your help.
Regards
Kevco97
NCP
January 12, 2023, 5:45am
#2
Hi @kevco97 ,
Please apply it.
{{ frappe.db.get_value("Customer", doc.customer, 'name') }}
Then reload and check it.
Thank You!
kevco97
January 12, 2023, 11:52am
#3
Hello NCP,
thank your for reply.
If i use your code then i get no customer ID (“None”) see enclosed.
But in the sales invoice details i can see a customer ID.
Regards
Kevco97
NCP
January 12, 2023, 11:54am
#5
Use {{doc.customer}} and check it.
kevco97
January 12, 2023, 12:07pm
#6
Hello NCP,
Thank you now it works for sales invoice.
But is this code valid for quotation & order print format template?
If i use the code i had the same issue like every quotation get the same customer ID.
Regards
kevco97
NCP
January 12, 2023, 12:15pm
#7
kevco97:
quotation
for use {{doc.party_name}}
AND
kevco97:
order
for use {{doc.customer}}
Thank You!
kevco97
January 12, 2023, 12:24pm
#8
Hi NCP,
thank you for your help now everything works fine
Have a nice day.
Regards
kevco97