I need autoincrement irrespective of two custom fields in delivery note transaction

Hi All,
In delivery note doctype , i need autoincrement in the series counter without the irrespective fields of country and department (both are custom fields). i given the document naming rule:Expression and format:DN.YY.{custom_country_code}.{custom_department}.###. the fields are getting fetched while the series ,the problem is counter and i should update or change counter when i need

Thanks in Advance

You will better manage this, with override_doctype_class hooks and autoname method!