[fix] [minor] sql query related changes in purchase common
[fix] [minor] sql query related changes in purchase common

saurabh6790/tru_app_back,saurabh6790/omnisys-app,mbauskar/omnitech-demo-erpnext,suyashphadtare/vestasi-erp-final,indictranstech/trufil-erpnext,indictranstech/buyback-erp,gangadhar-kadam/prjapp,gangadhar-kadam/powapp,gangadhar-kadam/smrterp,mbauskar/phrerp,rohitwaghchaure/GenieManager-erpnext,rohitwaghchaure/digitales_erpnext,gangadhar-kadam/helpdesk-erpnext,indictranstech/trufil-erpnext,sheafferusa/erpnext,shitolepriya/test-erp,gangadhar-kadam/laganerp,tmimori/erpnext,mbauskar/omnitech-demo-erpnext,gangadharkadam/saloon_erp,hatwar/buyback-erpnext,rohitwaghchaure/erpnext-receipher,gangadhar-kadam/helpdesk-erpnext,indictranstech/phrerp,njmube/erpnext,saurabh6790/ON-RISAPP,gangadharkadam/verveerp,rohitwaghchaure/erpnext-receipher,gangadhar-kadam/verve_erp,indictranstech/erpnext,saurabh6790/trufil_app,gangadharkadam/saloon_erp,indictranstech/phrerp,saurabh6790/omn-app,saurabh6790/aimobilize-app-backup,indictranstech/internal-erpnext,indictranstech/biggift-erpnext,pombredanne/erpnext,Tejal011089/med2-app,saurabh6790/omnit-app,gangadharkadam/letzerp,susuchina/ERPNEXT,Suninus/erpnext,indictranstech/biggift-erpnext,SPKian/Testing,mahabuber/erpnext,gangadharkadam/contributionerp,saurabh6790/med_app_rels,indictranstech/vestasi-erpnext,mbauskar/internal-hr,netfirms/erpnext,pombredanne/erpnext,indictranstech/vestasi-erpnext,Tejal011089/fbd_erpnext,suyashphadtare/vestasi-erp-1,indictranstech/biggift-erpnext,SPKian/Testing,susuchina/ERPNEXT,indictranstech/erpnext,gangadhar-kadam/verve_live_erp,Drooids/erpnext,hernad/erpnext,ShashaQin/erpnext,gangadhar-kadam/verve_live_erp,mbauskar/alec_frappe5_erpnext,rohitwaghchaure/digitales_erpnext,pawaranand/phrerp,indictranstech/buyback-erp,saurabh6790/trufil_app,sheafferusa/erpnext,indictranstech/osmosis-erpnext,dieface/erpnext,pombredanne/erpnext,mbauskar/sapphire-erpnext,SPKian/Testing,hanselke/erpnext-1,saurabh6790/medsynaptic1-app,meisterkleister/erpnext,gangadhar-kadam/helpdesk-erpnext,gangadhar-kadam/latestchurcherp,fuhongliang/erpnext,njmube/erpnext,indictranstech/tele-erpnext,treejames/erpnext,gangadharkadam/v5_erp,gangadhar-kadam/verve_test_erp,saurabh6790/test-med-app,rohitwaghchaure/erpnext_smart,saurabh6790/omnisys-app,Tejal011089/Medsyn2_app,mbauskar/omnitech-erpnext,mbauskar/phrerp,gangadharkadam/sterp,saurabh6790/aimobilize-app-backup,mahabuber/erpnext,indictranstech/focal-erpnext,geekroot/erpnext,tmimori/erpnext,dieface/erpnext,suyashphadtare/sajil-final-erp,Tejal011089/digitales_erpnext,gangadharkadam/office_erp,saurabh6790/tru_app_back,Tejal011089/trufil-erpnext,saurabh6790/aimobilize,shft117/SteckerApp,saurabh6790/medsyn-app,suyashphadtare/sajil-erp,rohitwaghchaure/GenieManager-erpnext,indictranstech/erpnext,gangadhar-kadam/verve_live_erp,indictranstech/internal-erpnext,saurabh6790/test-med-app,saurabh6790/medapp,saurabh6790/test-erp,treejames/erpnext,gangadharkadam/contributionerp,aruizramon/alec_erpnext,hatwar/focal-erpnext,indictranstech/Das_Erpnext,shft117/SteckerApp,gangadhar-kadam/latestchurcherp,Tejal011089/huntercamp_erpnext,suyashphadtare/vestasi-update-erp,Drooids/erpnext,mbauskar/Das_Erpnext,gangadharkadam/v6_erp,gangadhar-kadam/smrterp,saurabh6790/medsynaptic-app,Tejal011089/med2-app,indictranstech/tele-erpnext,pombredanne/erpnext,dieface/erpnext,Tejal011089/paypal_erpnext,gangadhar-kadam/latestchurcherp,mbauskar/omnitech-erpnext,indictranstech/phrerp,hatwar/buyback-erpnext,aruizramon/alec_erpnext,Tejal011089/digitales_erpnext,SPKian/Testing2,saurabh6790/omnitech-apps,gangadharkadam/contributionerp,geekroot/erpnext,Tejal011089/huntercamp_erpnext,saurabh6790/medsyn-app1,gangadharkadam/sher,rohitwaghchaure/GenieManager-erpnext,indictranstech/osmosis-erpnext,gangadharkadam/saloon_erp_install,saurabh6790/medsynaptic1-app,indictranstech/reciphergroup-erpnext,saurabh6790/med_new_app,mbauskar/Das_Erpnext,gsnbng/erpnext,gangadharkadam/vlinkerp,indictranstech/internal-erpnext,Tejal011089/paypal_erpnext,gangadhar-kadam/nassimapp,gangadharkadam/v5_erp,gangadharkadam/saloon_erp,gangadharkadam/office_erp,gangadharkadam/v5_erp,gangadhar-kadam/verve_test_erp,indictranstech/tele-erpnext,SPKian/Testing2,suyashphadtare/vestasi-erp-final,susuchina/ERPNEXT,Drooids/erpnext,hernad/erpnext,sagar30051991/ozsmart-erp,suyashphadtare/gd-erp,hernad/erpnext,gangadhar-kadam/verve_live_erp,mbauskar/Das_Erpnext,BhupeshGupta/erpnext,indictranstech/trufil-erpnext,rohitwaghchaure/erpnext-receipher,anandpdoshi/erpnext,saurabh6790/med_app_rels,gangadharkadam/v4_erp,indictranstech/biggift-erpnext,gangadharkadam/saloon_erp_install,sagar30051991/ozsmart-erp,indictranstech/tele-erpnext,indictranstech/buyback-erp,treejames/erpnext,fuhongliang/erpnext,gangadharkadam/letzerp,Tejal011089/osmosis_erpnext,SPKian/Testing2,gangadharkadam/v4_erp,Tejal011089/osmosis_erpnext,suyashphadtare/vestasi-erp-1,saurabh6790/omni-apps,hanselke/erpnext-1,netfirms/erpnext,suyashphadtare/vestasi-erp-1,saurabh6790/test_final_med_app,mbauskar/helpdesk-erpnext,BhupeshGupta/erpnext,suyashphadtare/vestasi-erp-jan-end,geekroot/erpnext,indictranstech/osmosis-erpnext,njmube/erpnext,shft117/SteckerApp,indictranstech/reciphergroup-erpnext,gangadharkadam/saloon_erp_install,netfirms/erpnext,Tejal011089/trufil-erpnext,Tejal011089/fbd_erpnext,mbauskar/sapphire-erpnext,ShashaQin/erpnext,saurabh6790/medapp,gangadharkadam/verveerp,sheafferusa/erpnext,gangadharkadam/v4_erp,hatwar/Das_erpnext,indictranstech/internal-erpnext,saurabh6790/omnit-app,gangadharkadam/saloon_erp_install,mbauskar/omnitech-demo-erpnext,indictranstech/buyback-erp,indictranstech/focal-erpnext,indictranstech/erpnext,gangadharkadam/verveerp,suyashphadtare/vestasi-erp-final,gangadharkadam/verveerp,Tejal011089/digitales_erpnext,fuhongliang/erpnext,ThiagoGarciaAlves/erpnext,gangadharkadam/saloon_erp,shft117/SteckerApp,mbauskar/internal-hr,Tejal011089/Medsyn2_app,indictranstech/reciphergroup-erpnext,mbauskar/phrerp,Tejal011089/digitales_erpnext,saurabh6790/test-erp,gangadhar-kadam/nassimapp,suyashphadtare/vestasi-erp-jan-end,mbauskar/alec_frappe5_erpnext,mbauskar/internal-hr,hatwar/focal-erpnext,saurabh6790/omn-app,suyashphadtare/gd-erp,MartinEnder/erpnext-de,gangadharkadam/vlinkerp,gangadharkadam/tailorerp,gangadharkadam/letzerp,aruizramon/alec_erpnext,gangadhar-kadam/powapp,4commerce-technologies-AG/erpnext,saurabh6790/pow-app,meisterkleister/erpnext,gangadharkadam/v5_erp,saurabh6790/omni-apps,saurabh6790/omnitech-apps,gangadhar-kadam/laganerp,gangadhar-kadam/verve_erp,ShashaQin/erpnext,gangadharkadam/smrterp,BhupeshGupta/erpnext,suyashphadtare/test,gmarke/erpnext,indictranstech/focal-erpnext,mahabuber/erpnext,BhupeshGupta/erpnext,gsnbng/erpnext,indictranstech/fbd_erpnext,shitolepriya/test-erp,saurabh6790/alert-med-app,indictranstech/Das_Erpnext,suyashphadtare/vestasi-erp-jan-end,saurabh6790/medsynaptic-app,mbauskar/omnitech-demo-erpnext,sagar30051991/ozsmart-erp,anandpdoshi/erpnext,gangadharkadam/sher,saurabh6790/test-erp,rohitwaghchaure/erpnext_smart,suyashphadtare/vestasi-erp-jan-end,mbauskar/omnitech-erpnext,Tejal011089/osmosis_erpnext,gangadhar-kadam/verve_test_erp,suyashphadtare/vestasi-update-erp,suyashphadtare/sajil-final-erp,MartinEnder/erpnext-de,rohitwaghchaure/New_Theme_Erp,gangadhar-kadam/verve_erp,fuhongliang/erpnext,Tejal011089/paypal_erpnext,tmimori/erpnext,saurabh6790/med_new_app,ThiagoGarciaAlves/erpnext,Tejal011089/trufil-erpnext,gangadhar-kadam/verve-erp,mbauskar/helpdesk-erpnext,Suninus/erpnext,indictranstech/fbd_erpnext,indictranstech/vestasi-erpnext,suyashphadtare/gd-erp,saurabh6790/medsyn-app,sheafferusa/erpnext,ThiagoGarciaAlves/erpnext,gangadharkadam/johnerp,saurabh6790/OFF-RISAPP,Aptitudetech/ERPNext,MartinEnder/erpnext-de,mbauskar/helpdesk-erpnext,gangadhar-kadam/verve-erp,anandpdoshi/erpnext,indictranstech/reciphergroup-erpnext,saurabh6790/OFF-RISAPP,dieface/erpnext,gangadharkadam/letzerp,mbauskar/Das_Erpnext,Suninus/erpnext,gangadharkadam/vlinkerp,aruizramon/alec_erpnext,Tejal011089/huntercamp_erpnext,shitolepriya/test-erp,gsnbng/erpnext,gangadharkadam/smrterp,hatwar/Das_erpnext,4commerce-technologies-AG/erpnext,gmarke/erpnext,saurabh6790/test_final_med_app,indictranstech/Das_Erpnext,gangadharkadam/contributionerp,rohitwaghchaure/New_Theme_Erp,gangadhar-kadam/verve_erp,suyashphadtare/sajil-final-erp,gangadharkadam/sterp,mbauskar/phrerp,gmarke/erpnext,ThiagoGarciaAlves/erpnext,gangadharkadam/v6_erp,hatwar/buyback-erpnext,hanselke/erpnext-1,hanselke/erpnext-1,Tejal011089/osmosis_erpnext,suyashphadtare/vestasi-update-erp,gangadhar-kadam/hrerp,mbauskar/alec_frappe5_erpnext,Tejal011089/fbd_erpnext,gmarke/erpnext,indictranstech/vestasi-erpnext,gangadharkadam/v4_erp,geekroot/erpnext,meisterkleister/erpnext,Tejal011089/paypal_erpnext,mbauskar/alec_frappe5_erpnext,Suninus/erpnext,pawaranand/phrerp,gangadhar-kadam/hrerp,indictranstech/focal-erpnext,susuchina/ERPNEXT,mahabuber/erpnext,saurabh6790/alert-med-app,rohitwaghchaure/erpnext_smart,hatwar/Das_erpnext,mbauskar/sapphire-erpnext,Tejal011089/huntercamp_erpnext,gangadhar-kadam/helpdesk-erpnext,rohitwaghchaure/GenieManager-erpnext,gangadhar-kadam/verve-erp,gangadharkadam/tailorerp,suyashphadtare/gd-erp,gangadhar-kadam/prjapp,pawaranand/phrerp,mbauskar/sapphire-erpnext,indictranstech/fbd_erpnext,meisterkleister/erpnext,gangadharkadam/office_erp,anandpdoshi/erpnext,Drooids/erpnext,indictranstech/trufil-erpnext,gangadharkadam/johnerp,saurabh6790/medsyn-app1,saurabh6790/ON-RISAPP,gangadhar-kadam/verve_test_erp,4commerce-technologies-AG/erpnext,netfirms/erpnext,suyashphadtare/sajil-erp,MartinEnder/erpnext-de,ShashaQin/erpnext,Tejal011089/fbd_erpnext,pawaranand/phrerp,mbauskar/helpdesk-erpnext,gangadharkadam/v6_erp,indictranstech/osmosis-erpnext,hernad/erpnext,SPKian/Testing2,saurabh6790/pow-app,indictranstech/Das_Erpnext,rohitwaghchaure/digitales_erpnext,indictranstech/fbd_erpnext,SPKian/Testing,rohitwaghchaure/New_Theme_Erp,rohitwaghchaure/New_Theme_Erp,suyashphadtare/sajil-erp,gangadhar-kadam/powapp,rohitwaghchaure/digitales_erpnext,hatwar/focal-erpnext,hatwar/focal-erpnext,suyashphadtare/test,shitolepriya/test-erp,hatwar/buyback-erpnext,mbauskar/omnitech-erpnext,suyashphadtare/test,gangadhar-kadam/laganerp,treejames/erpnext,saurabh6790/aimobilize,sagar30051991/ozsmart-erp,indictranstech/phrerp,gangadhar-kadam/latestchurcherp,gangadharkadam/v6_erp,gangadharkadam/vlinkerp,tmimori/erpnext,njmube/erpnext,rohitwaghchaure/erpnext-receipher,saurabh6790/test-erp,hatwar/Das_erpnext,gsnbng/erpnext,Tejal011089/trufil-erpnext