Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7890)
+++ /lib/wpsg_calculation.class.php	(revision 7891)
@@ -193,5 +193,5 @@
 		
 		public function addCoupon($set, $bruttonetto, $tax_key, $amount = 1, $code = false, $id = false, $order_voucher_id = 0) {
-			
+
 			$tax_key = $this->normalizeTaxKey($tax_key);
 			
@@ -714,17 +714,21 @@
 						if ($cr['bruttonetto'] === WPSG_NETTO) {
 
-							$set_netto = $scope_netto; //wpsg_tf($set);
-			 							
+							$scope_netto = max($set_netto, $cr['set']);
+
+							$set_netto = $scope_netto;
+
 							list($set_netto, $set_brutto) = $this->calculateTaxPart(WPSG_NETTO, $set_netto, $cr['tax_key']);
-			
+
 						} else {
 
+							$scope_brutto = max($scope_brutto, $cr['set']);
+
 							if (wpsg_isTrue($cr['data']['targetCountry'])) {
-				
+
 								$tax_key_part = preg_replace('/\_(.*)/', '', $cr['tax_key']);
 				
 								$tax_default = $this->arCountry[$this->getDefaultCountryID()][$tax_key_part.'_'.$this->getDefaultCountryID()];
 								$tax_target = $this->arCountry[$this->getTargetCountryID()][$tax_key_part.'_'.$this->getTargetCountryID()];
-				
+
 								$set_brutto = wpsg_calculatePreis(
 									//wpsg_calculatePreis(wpsg_tf($set), WPSG_NETTO, $tax_default),
@@ -735,8 +739,10 @@
 				
 							} else {
-				
+
 								$set_brutto = $scope_brutto; //wpsg_tf($set);
 				
 							}
+
+							//if ($cr['set'] < abs($set_brutto)) $set_brutto = -1 * $cr['set'];
 
 							if (($this->arCalculation['sum']['brutto'] + $set_brutto) < 0) $set_brutto = -1 * $this->arCalculation['sum']['brutto'];
@@ -752,9 +758,13 @@
 
 							if ($this->arCalculation['sum']['topay_brutto'] + $set_brutto < 0) {
-								
+
 								$set_brutto = $this->arCalculation['sum']['topay_brutto'];
 								$this->arCalculation['sum']['topay_brutto'] = 0;
 								
-							} else $this->arCalculation['sum']['topay_brutto'] += $set_brutto;
+							} else {
+
+								$this->arCalculation['sum']['topay_brutto'] += $set_brutto;
+
+							}
 
 						}
