order admin

This commit is contained in:
Etienne Roudeix
2013-09-24 17:04:32 +02:00
parent 4600727163
commit 7bd511c420
40 changed files with 1197 additions and 555 deletions

View File

@@ -11,16 +11,23 @@ class TaxRule extends BaseTaxRule
/**
* @param Country $country
* @param $untaxedAmount
* @param $untaxedPromoAmount
* @param null $askedLocale
*
* @return OrderProductTaxCollection
*/
public function getTaxDetail(Country $country, $untaxedAmount, $askedLocale = null)
public function getTaxDetail(Country $country, $untaxedAmount, $untaxedPromoAmount, $askedLocale = null)
{
$taxCalculator = new Calculator();
$taxCollection = new OrderProductTaxCollection();
$taxCalculator->loadTaxRule($this, $country)->getTaxedPrice($untaxedAmount, $taxCollection, $askedLocale);
$promoTaxCollection = new OrderProductTaxCollection();
$taxCalculator->loadTaxRule($this, $country)->getTaxedPrice($untaxedPromoAmount, $promoTaxCollection, $askedLocale);
foreach($taxCollection as $index => $tax) {
$tax->setPromoAmount($promoTaxCollection->getKey($index)->getAmount());
}
return $taxCollection;
}