--- LMS.class.php	2006-08-28 18:08:39.000000000 +0200
+++ LMS.class.php-new	2006-08-28 15:09:56.000000000 +0200
@@ -1635,7 +1635,7 @@
 
 	function GetTariffList()
 	{
-		if($tarifflist = $this->DB->GetAll('SELECT tariffs.id AS id, name, tariffs.value AS value, taxes.label AS tax, taxes.value AS taxvalue, prodid, tariffs.description AS description, uprate, downrate, upceil, downceil, climit, plimit
+		if($tarifflist = $this->DB->GetAll('SELECT tariffs.id AS id, name, tariffs.value AS value, taxes.label AS tax, taxes.value AS taxvalue, prodid, tariffs.description AS description, uprate, uprate_night, downrate, downrate_night, upceil, upceil_night, downceil, downceil_night, climit, plimit
 				FROM tariffs LEFT JOIN taxes ON taxid = taxes.id ORDER BY name ASC'))
 		{
 			$assigned = $this->DB->GetAllByKey('SELECT tariffid, COUNT(*) AS count, 
@@ -1700,8 +1700,8 @@
 	function TariffAdd($tariffdata)
 	{
 		$this->SetTS('tariffs');
-		$result = $this->DB->Execute('INSERT INTO tariffs (name, description, value, taxid, prodid, uprate, downrate, upceil, downceil, climit, plimit)
-				VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
+		$result = $this->DB->Execute('INSERT INTO tariffs (name, description, value, taxid, prodid, uprate, uprate_night, downrate, downrate_night, upceil, upceil_night, downceil, downceil_night, climit, plimit)
+				VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
 				array(
 					$tariffdata['name'],
 					$tariffdata['description'],
@@ -1709,9 +1709,13 @@
 					$tariffdata['taxid'],
 					$tariffdata['prodid'],
 					$tariffdata['uprate'],
+					$tariffdata['uprate_night'],
 					$tariffdata['downrate'],
+					$tariffdata['downrate_night'],
 					$tariffdata['upceil'],
+					$tariffdata['upceil_night'],
 					$tariffdata['downceil'],
+					$tariffdata['downceil_night'],
 					$tariffdata['climit'],
 					$tariffdata['plimit']
 				)
@@ -1725,7 +1729,7 @@
 	function TariffUpdate($tariff)
 	{
 		$this->SetTS('tariffs');
-		return $this->DB->Execute('UPDATE tariffs SET name=?, description=?, value=?, taxid=?, prodid=?, uprate=?, downrate=?, upceil=?, downceil=?, climit=?, plimit=? WHERE id=?', array($tariff['name'], $tariff['description'], $tariff['value'], $tariff['taxid'], $tariff['prodid'], $tariff['uprate'], $tariff['downrate'], $tariff['upceil'], $tariff['downceil'], $tariff['climit'], $tariff['plimit'], $tariff['id']));
+		return $this->DB->Execute('UPDATE tariffs SET name=?, description=?, value=?, taxid=?, prodid=?, uprate=?, uprate_night=?, downrate=?, downrate_night=?, upceil=?, upceil_night=?, downceil=?, downceil_night=?, climit=?, plimit=? WHERE id=?', array($tariff['name'], $tariff['description'], $tariff['value'], $tariff['taxid'], $tariff['prodid'], $tariff['uprate'], $tariff['uprate_night'], $tariff['downrate'], $tariff['downrate_night'],  $tariff['upceil'], $tariff['upceil_night'], $tariff['downceil'], $tariff['downceil_night'], $tariff['climit'], $tariff['plimit'], $tariff['id']));
 	}
 
 	function TariffDelete($id)
@@ -1750,7 +1754,7 @@
 
 	function GetTariff($id)
 	{
-		$result = $this->DB->GetRow('SELECT tariffs.id AS id, name, tariffs.value AS value, taxid, taxes.label AS tax, taxes.value AS taxvalue, prodid, tariffs.description AS description, uprate, downrate, upceil, downceil, climit, plimit
+		$result = $this->DB->GetRow('SELECT tariffs.id AS id, name, tariffs.value AS value, taxid, taxes.label AS tax, taxes.value AS taxvalue, prodid, tariffs.description AS description, uprate, uprate_night, downrate, downrate_night, upceil, upceil_night, downceil, downceil_night, climit, plimit
 					FROM tariffs LEFT JOIN taxes ON taxid = taxes.id WHERE tariffs.id=?', array($id));
 		$result['customers'] = $this->DB->GetAll('SELECT customers.id AS id, COUNT(customers.id) AS cnt, '.$this->DB->Concat('upper(lastname)',"' '",'name').' AS customername FROM assignments, customers WHERE customers.id = customerid AND deleted = 0 AND tariffid = ? GROUP BY customers.id, customername ORDER BY customername', array($id));
 
@@ -1791,7 +1795,7 @@
 
 	function GetTariffs()
 	{
-		return $this->DB->GetAll('SELECT tariffs.id AS id, name, tariffs.value AS value, uprate, downrate, upceil, downceil, climit, plimit, taxid, taxes.value AS taxvalue, taxes.label AS tax, prodid
+		return $this->DB->GetAll('SELECT tariffs.id AS id, name, tariffs.value AS value, uprate, uprate_night, downrate, downrate_night, upceil, upceil_night, downceil, downceil_night, climit, plimit, taxid, taxes.value AS taxvalue, taxes.label AS tax, prodid
 					FROM tariffs LEFT JOIN taxes ON taxid = taxes.id ORDER BY tariffs.value DESC');
 	}
