Hi @Nathan,
we have the same use case, where the revenue when selling item I1 in country C1 will go to income account A1, while when selling the same item to another customer in country C2, it will need to be booked against income account A2. So far, we have only figured how to set the default income account per item, but not per customer.
Have you considered using a custom script? Something like
frappe.ui.form.on('Sales Invoice',
{
refresh: function(frm) {
frm.add_custom_button( __("Apply country-wise income account"), function()
{
var items = frm.doc.items;
var income_account = "Revenue EU"; // valid income account
if (frm.doc.currency == "CHF") {
income_account = "Revenue CH"; // valid income account
}
items.forEach(function(entry) {
if (entry.income_account != null) {
frappe.model.set_value(entry.doctype, entry.name, "income_account", income_account);
}
});
});
}
});
This would be based on the sales invoice currency, a lookup on a field on the customer could be easily implemented.
Let me know if this works.