Skip to content
Snippets Groups Projects

Issue #3182022 by karengrey, rszrama: Link to free resources for U.S. sales tax calculation

Issue #3182022 by karengrey, rszrama: Link to free resources for U.S. sales tax calculation

Following Ryan's recommendation to use the markup used for System Status, the simplest way to inject this to the TaxTypeListBuilder was to add additional markup to the render() function.

The markup has been added to a separate file so the TaxTypeListBuilder::render function stays looking clean.

There are conditions added so the markup is only added if there are any stores with an US or CA address.

I have also added a statement to check if commerce_avatax is enabled, which changes the text in the right column to a thank you message and a link to the AvaTax login. This text is to be finalised by Ryan/Summer Baker

A new Library has been added for a new CSS file and an images folder added with two svg files for each column. The Sales Tax Risk Assessment is interactive, it would be ideal to change this svg to be static (I couldn't scale the JPG provided in the issue without losing a fair amount of quality)

Edited by Karen Grey

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
29 29 return $row + parent::buildRow($entity);
30 30 }
31 31
32 /**
33 * {@inheritdoc}
34 */
35 public function render() {
36 // Additional markup added to promote free resources for United Sates
  • 121 132 function commerce_tax_field_widget_info_alter(array &$info) {
    122 133 $info['string_textfield']['field_types'][] = 'commerce_tax_number';
    123 134 }
    135
    136 /**
    137 * Checks store country codes for sales tax help.
    138 */
    139 function commerce_tax_sales_tax_country_check() {
    140 /** @var \Drupal\commerce_store\Entity\StoreInterface $store */
    141 $entity_type_manager = \Drupal::entityTypeManager();
    142 $stores = $entity_type_manager->getStorage('commerce_store')->loadMultiple();
  • Karen Grey added 1 commit

    added 1 commit

    • da2e3bb2 - Moved helper to TaxTypeListBuilder and changed to use a query so were not...

    Compare with previous version

  • Karen Grey added 2 commits

    added 2 commits

    • 7a2f39ef - Removed extra lines.
    • 134368ee - Added dependency injection for entityTypeManager and renamed method countryCheck

    Compare with previous version

  • Karen Grey added 1 commit

    added 1 commit

    Compare with previous version

  • Karen Grey added 1 commit

    added 1 commit

    • 70f6fdb8 - removed comment at top of twig template

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading