drupal not detecting function in custom module's inc file I have a custom module, in my module call commerce_discount_add_line_item() function, it exists in commerce_discount.rules.inc, 
this modules is installed correctly and status is enabled but when I call it returns:


  ( ! ) Fatal error: Call to undefined function
  commerce_discount_add_line_item().


It is strange, why has this happened?
By default inc files are not included(only module files are included). They should be called explicitly like below before making a call to a function in that file.

module_load_include('inc', 'commerce_discount', 'commerce_discount.rules');


Further Reading on inc files and how they differ from .module files : https://drupal.stackexchange.com/a/54069/4876