Adding a tax master for landed cost document

21 views
Skip to first unread message

driss bennani

unread,
Sep 3, 2014, 9:04:59 AM9/3/14
to erpnext-dev...@googlegroups.com
Hello everyone,
First of all, good job on frappe/erpnext, we've only started to use it recently and already love it!
We do a lot of importation and we are trying to use the Landed Cost Voucher to keep track of additional costs like customs fee, shipping etc...
I tried to edit the landed cost document and to add a link field to Purchases taxes and charges Master using the Purchase Order DocType as a reference.

From what I saw on Purchase Order, after selecting the tax master in the list, two API calls are made:
      - the first one is made with { 'options': 'Purchase+Taxes+and+Charges+Master' ; cmd:'frappe.widgets.form.utils.validate_link' } and returns 'OK'
      - the second one is made with { ... ; cmd:'erpnext.controllers.accounts_controller.get_taxes_and_charges'; ...} and returns a json containing all taxes and parameters.
And I'm guessing that some callback in js fills in the forms (if someone could tell me where does that happens, it would save me some time :) )

Unfortunately, after adding the link field to the Landed Cost Voucher DocType and selecting a tax master, the last API call with details about the various taxes never happens.

Could someone help me with this?
Or in a more general way, could someone explain how to 
       - add a document selector in another
       - get a json with relevant properties upon selection
       - edit the callback function to handle display/processing of the returned data


And a bonus question: 
   is there a way to force frappe/erpnext to use non-minified javascript files? 


Cheers,

BENNANI Driss

Rushabh Mehta

unread,
Sep 3, 2014, 1:14:51 PM9/3/14
to erpnext-dev...@googlegroups.com
On 03-Sep-2014, at 6:34 pm, driss bennani <bennan...@gmail.com> wrote:

Hello everyone,
First of all, good job on frappe/erpnext, we've only started to use it recently and already love it!

Welcome to the forum!

We do a lot of importation and we are trying to use the Landed Cost Voucher to keep track of additional costs like customs fee, shipping etc...
I tried to edit the landed cost document and to add a link field to Purchases taxes and charges Master using the Purchase Order DocType as a reference.

From what I saw on Purchase Order, after selecting the tax master in the list, two API calls are made:
      - the first one is made with { 'options': 'Purchase+Taxes+and+Charges+Master' ; cmd:'frappe.widgets.form.utils.validate_link' } and returns 'OK'
      - the second one is made with { ... ; cmd:'erpnext.controllers.accounts_controller.get_taxes_and_charges'; ...} and returns a json containing all taxes and parameters.
And I'm guessing that some callback in js fills in the forms (if someone could tell me where does that happens, it would save me some time :) )

erpnext: purchase_order.js

frappe: control.js

the first callback validates if the selected link is okay.


Unfortunately, after adding the link field to the Landed Cost Voucher DocType and selecting a tax master, the last API call with details about the various taxes never happens.

What are you trying to achieve. Open a GitHub Issue and Pull-Request - we will be happy to assist you.


Could someone help me with this?
Or in a more general way, could someone explain how to 
       - add a document selector in another

Add a "Link" field

       - get a json with relevant properties upon selection

You have to write event handlers - there are lots of ways to do this. check the 


       - edit the callback function to handle display/processing of the returned data


And a bonus question: 
   is there a way to force frappe/erpnext to use non-minified javascript files? 


do `bench frappe --watch`

this will rebuild whenever you change a file + not compress it.


Cheers,

BENNANI Driss

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/13bede07-9ee4-49cc-bbfe-1f1619887859%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages