Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027454Retail ModulesTax Exemptpublic2014-08-24 22:262015-02-09 16:23
mtaal 
marvintm 
normalminorhave not tried
scheduledopen 
5
 
 
No
0027454: Tax Exempt module does not work with q4 version, sql replacement seems to simple
I found 2 problems.
First:
I changed a line to this, this seems to work, the original line in the modeule is this:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.taxexempt/file/d46b6b9cc1fc/web/org.openbravo.retail.taxexempt/js/taxExemptButton.js#l80 [^]
I changed it to this:
  if (componentHolder && componentHolder.name === 'defaultEdit' && componentHolder.components[0] && componentHolder.components[0].name === 'msgedit' && componentHolder.components[0].components[0] && componentHolder.components[0].components[0].components && componentHolder.components[0].components[0].components.push) {

But this must be validated.

Second:
This code:
  OB.UTIL.HookManager.registerHook('OBPOS_FindTaxRate', function (args, callbacks) {
    if (args.context.get('bp').get('taxExempt')) {
      args.line.set('taxExempt', true);
    } else if (args.line.get('taxExempt')) {
      args.sql = "select * from c_tax where istaxexempt = 'true' order by validfrom desc limit 1";
    }
    OB.UTIL.HookManager.callbackExecutor(args, callbacks);
    return;
  });

Fails because the args does not have a property line. This got solved in this push:
http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ad8bc428c9f8318c2953ecd4d441551c507414a5 [^]

A bigger problems seems to be that the sql replacement proposed above does not seem to be correct, the sql query which gets replaced is really big and the replacement does not seem to cover all cases, it seems better to add the istaxexempt=true to the query.

So this issue is 2 things:
- validate that the first topic has been solved correctly
- check the sql replacement
Install taxexempt module with the q4 version and run it.
No tags attached.
depends on defect 0027455RR14Q4 closed mtaal OBPOS_FindTaxRate hooks also need the line for which they are executed 
Issue History
2014-08-24 22:26mtaalNew Issue
2014-08-24 22:26mtaalAssigned To => malsasua
2014-08-24 22:26mtaalTriggers an Emergency Pack => No
2014-08-24 22:36mtaalSummaryTax Exempt module does not work with q4 version => Tax Exempt module does not work with q4 version, sql replacement seems to simple
2014-08-24 22:36mtaalDescription Updatedbug_revision_view_page.php?rev_id=6446#r6446
2014-08-24 22:36mtaalSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=6448#r6448
2014-08-24 22:36mtaalRelationship addeddepends on 0027455
2014-09-22 16:22mtaalTarget VersionRR14Q4 =>
2015-02-05 16:50mario_castelloAssigned Tomalsasua => mario_castello
2015-02-05 16:50mario_castelloStatusnew => scheduled
2015-02-05 16:50mario_castellofix_in_branch => pi
2015-02-09 16:23mario_castelloAssigned Tomario_castello => marvintm

There are no notes attached to this issue.