Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
13701 มุมมอง

Hello,

in my invoice I would like to have a text / hint for the customer depending on the payment term.
If payment_term contains "prepaid" then print "You really have to pay before you get your item!"

How can I do this? I got the following working:
You really have to pay before you get your item! Please use the following number as reference: [[ ((o.payment_term.name == '100% Vorkasse') or removeParentNode('para')) and '' ]] [[ o.number ]]

But I would like to have "contains", not "==".

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

[[ 'prepaid' in o.payment_term.name and 'You really have to pay before you get your item!' ]]

Operation Result
x in s True if an item of s is equal to x, else False

This table summarizes the comparison operations:

Operation Meaning Notes
< strictly less than  
<= less than or equal  
> strictly greater than  
>= greater than or equal  
== equal  
!= not equal (1)
is object identity  
is not negated object identity  
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Try this code will help you

[[  payment_term == 'prepaid' and  "You really have to pay before you get your item!" ]]
อวตาร
ละทิ้ง
ผู้เขียน

I'm sorry - was not clear enough: I have 2 (or more) prepaid options: 100% prepaid, 50% prepaid/50% before shipment aso.), all contain the word "prepaid", that is the goal

I did'n get you. can specify more ?

ผู้เขียน

okay, I'll try: payment terms available: 100% prepaid, 50% prepaid, 25% prepaid, in 30 days, in 3 days, aso.

For each invoice with a condition containing "prepaid" I would like to add / highlight: "You really have to pay before you get your item! Please use the following ..."

[[ payment_term == '100% prepaid' or payment_term == '50% prepaid' or payment_term == '100% prepaid' or payment_term == '25% prepaid' and "You really have to pay before you get your item!" ]] try this otherwise you can create method and do.

ผู้เขียน

found a link to phyton types: https://docs.python.org/2/library/stdtypes.html#boolean-operations-and-or-not

so this seems to work - it's a bit simpler than to type each condition, could you test and confirm:

[[ 'prepaid' in o.payment_term.name and 'You really have to pay before you get your item!' ]]

[[ 'prepaid' in o.payment_term.name and 'You really have to pay before you get your item!' ]] yes this will work.

ผู้เขียน

thanks a lot

Have you got solution ?

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ธ.ค. 23
4144
1
ก.พ. 25
891
0
ต.ค. 24
1750
0
ส.ค. 24
1572
0
ม.ค. 24
2061