security update link,module_filters,search_api_solr,ubercart,views
This commit is contained in:
@@ -27,7 +27,7 @@ class UbercartTaxesTestCase extends UbercartTestHelper {
|
||||
parent::setUp($modules, $permissions);
|
||||
}
|
||||
|
||||
function testInclusiveTaxes() {
|
||||
public function testInclusiveTaxes() {
|
||||
$this->drupalLogin($this->adminUser);
|
||||
|
||||
// Create a 20% inclusive tax rate.
|
||||
@@ -149,7 +149,7 @@ class UbercartTaxesTestCase extends UbercartTestHelper {
|
||||
$this->assertText('$16.80' . $rate->inclusion_text, 'Tax inclusive price appears on the printable invoice.');
|
||||
}
|
||||
|
||||
function loadTaxLine($order_id) {
|
||||
protected function loadTaxLine($order_id) {
|
||||
$order = uc_order_load($order_id, TRUE);
|
||||
foreach ($order->line_items as $line) {
|
||||
if ($line['type'] == 'tax') {
|
||||
@@ -159,7 +159,7 @@ class UbercartTaxesTestCase extends UbercartTestHelper {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
function assertTaxLineCorrect($line, $rate, $when) {
|
||||
protected function assertTaxLineCorrect($line, $rate, $when) {
|
||||
$this->assertTrue($line, t('The tax line item was saved to the order ' . $when));
|
||||
$this->assertTrue(number_format($rate * $this->product->sell_price, 2) == number_format($line['amount'], 2), t('Stored tax line item has the correct amount ' . $when));
|
||||
$this->assertFieldByName('line_items[' . $line['line_item_id'] . '][li_id]', $line['line_item_id'], t('Found the tax line item ID ' . $when));
|
||||
@@ -167,7 +167,7 @@ class UbercartTaxesTestCase extends UbercartTestHelper {
|
||||
$this->assertText(uc_currency_format($line['amount']), t('Tax display has the correct amount ' . $when));
|
||||
}
|
||||
|
||||
function testStoredTaxDisplay() {
|
||||
public function testStoredTaxDisplay() {
|
||||
$this->drupalLogin($this->adminUser);
|
||||
|
||||
// Enable a payment method for the payment preview checkout pane.
|
||||
@@ -281,7 +281,7 @@ class UbercartTaxesTestCase extends UbercartTestHelper {
|
||||
}
|
||||
}
|
||||
|
||||
function testTaxProductClassUpdate() {
|
||||
public function testTaxProductClassUpdate() {
|
||||
$this->drupalLogin($this->adminUser);
|
||||
|
||||
// Create a new product class.
|
||||
|
@@ -12,6 +12,7 @@ function uc_taxes_admin_settings() {
|
||||
$header = array(t('Name'), t('Rate'), t('Taxed products'), t('Taxed product types'), t('Taxed line items'), t('Weight'), array('data' => t('Operations'), 'colspan' => 4));
|
||||
|
||||
$rows = array();
|
||||
$options = array('query' => array('token' => drupal_get_token('uc_taxes_clone')));
|
||||
foreach (uc_taxes_rate_load() as $rate_id => $rate) {
|
||||
$rows[] = array(
|
||||
check_plain($rate->name),
|
||||
@@ -22,7 +23,7 @@ function uc_taxes_admin_settings() {
|
||||
$rate->weight,
|
||||
l(t('edit'), 'admin/store/settings/taxes/' . $rate_id . '/edit'),
|
||||
l(t('conditions'), 'admin/store/settings/taxes/manage/uc_taxes_' . $rate_id),
|
||||
l(t('clone'), 'admin/store/settings/taxes/' . $rate_id . '/clone'),
|
||||
l(t('clone'), 'admin/store/settings/taxes/' . $rate_id . '/clone', $options),
|
||||
l(t('delete'), 'admin/store/settings/taxes/' . $rate_id . '/delete'),
|
||||
);
|
||||
}
|
||||
@@ -211,6 +212,10 @@ function uc_taxes_form_submit($form, &$form_state) {
|
||||
* Clones a tax rate.
|
||||
*/
|
||||
function uc_taxes_clone($rate_id) {
|
||||
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'uc_taxes_clone')) {
|
||||
return MENU_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
// Load the source rate object.
|
||||
$rate = uc_taxes_rate_load($rate_id);
|
||||
$name = $rate->name;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* @param $order
|
||||
* An order object or an order id.
|
||||
*
|
||||
* @return
|
||||
* @return array
|
||||
* An array of tax line item objects keyed by a module-specific id.
|
||||
*/
|
||||
function hook_uc_calculate_tax($order) {
|
||||
@@ -45,7 +45,7 @@ function hook_uc_calculate_tax($order) {
|
||||
|
||||
foreach (uc_taxes_rate_load() as $tax) {
|
||||
if ($use_same_rates) {
|
||||
foreach ((array)$order->line_items as $old_line) {
|
||||
foreach ((array) $order->line_items as $old_line) {
|
||||
if ($old_line['type'] == 'tax' && $old_line['data']['tax_id'] == $tax->id) {
|
||||
$tax->rate = $old_line['data']['tax_rate'];
|
||||
break;
|
||||
|
@@ -11,9 +11,8 @@ files[] = tests/uc_taxes.test
|
||||
|
||||
configure = admin/store/settings/taxes
|
||||
|
||||
; Information added by Drupal.org packaging script on 2016-07-16
|
||||
version = "7.x-3.10"
|
||||
; Information added by Drupal.org packaging script on 2019-03-06
|
||||
version = "7.x-3.12"
|
||||
core = "7.x"
|
||||
project = "ubercart"
|
||||
datestamp = "1468644909"
|
||||
|
||||
datestamp = "1551862392"
|
||||
|
@@ -7,7 +7,6 @@
|
||||
* Allows tax rules to be set up and applied to orders.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Implements hook_permission().
|
||||
*/
|
||||
@@ -15,7 +14,7 @@ function uc_taxes_permission() {
|
||||
return array(
|
||||
'configure taxes' => array(
|
||||
'title' => t('Configure taxes'),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -230,7 +229,7 @@ function uc_taxes_uc_order($op, $order, $arg2) {
|
||||
uc_order_log_changes($order->order_id, $changes);
|
||||
usort($order->line_items, 'uc_weight_sort');
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +274,8 @@ function uc_line_item_tax_display($op, $order) {
|
||||
*
|
||||
* @param $tax
|
||||
* A tax object as returned by hook_uc_taxes_calculate().
|
||||
* @return
|
||||
*
|
||||
* @return array
|
||||
* A line item array suitable for returning from line item callbacks.
|
||||
*/
|
||||
function _uc_taxes_to_line_item($tax) {
|
||||
@@ -341,7 +341,7 @@ function uc_line_item_tax_subtotal($op, $order) {
|
||||
*
|
||||
* @param $rate
|
||||
* The tax rate object to be saved.
|
||||
* @param $reset
|
||||
* @param bool $reset
|
||||
* If TRUE, resets the Rules cache after saving. Defaults to TRUE.
|
||||
*
|
||||
* @return
|
||||
@@ -392,7 +392,6 @@ function uc_taxes_rate_save($rate, $reset = TRUE) {
|
||||
return $rate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* List all the taxes that can apply to an order.
|
||||
*
|
||||
@@ -644,7 +643,7 @@ function uc_taxes_apply_tax($order, $tax) {
|
||||
}
|
||||
$amount = $taxable_amount * $tax->rate;
|
||||
if ($amount) {
|
||||
$line_item = (object)array(
|
||||
$line_item = (object) array(
|
||||
'id' => $tax->id,
|
||||
'name' => $tax->name,
|
||||
'amount' => $amount,
|
||||
|
@@ -2,8 +2,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file contains the default Rules configurations that allow conditions to
|
||||
* be applied to taxes.
|
||||
* Default Rules configurations for uc_taxes.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user