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

I wanna to add a field betwen Quantity and Unit Price, name field is Discount,, i can add name header field, but i can't add connection to the database,, how to get field database for Discount?

thanks...

อวตาร
ละทิ้ง
ผู้เขียน

Help Me,,,,

It is functional field might be value is not stored in database. so you cannot get value directly. you can define your own method in parser class to get discount value. pass amount and discount percentage from line into that method and return the specific discount value.

คำตอบที่ดีที่สุด

In Settings --> Configuration --> Sales,
      Enable "Allow setting a discount on sales order lines".

After enabling the Discount field will be available at report.

To get field name for Discount:
      ==> Activate Developer mode and hower to your field.  
      ==> Go to Settings --> Technical --> Database structure --> Models and search for "sale.order".  Now you can see the list of fields available at Sale order 

อวตาร
ละทิ้ง