Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/taxes/taxes_event_handler.php
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | |||||
} while ($this->check_array($this->Application->GetVar('taxdst'), 'TaxZoneDestId', $new_id)); | } while ($this->check_array($this->Application->GetVar('taxdst'), 'TaxZoneDestId', $new_id)); | ||||
if( ($location_id && !$this->check_array($temp, 'StdDestId', $location_id)) || | if( ($location_id && !$this->check_array($temp, 'StdDestId', $location_id)) || | ||||
($zip && !$this->check_array($temp, 'DestValue', $zip)) ) | ($zip && !$this->check_array($temp, 'DestValue', $zip)) ) | ||||
{ | { | ||||
if($tax_object->GetDBField('Type') == 3 && $zip ==''){ | if ( $tax_object->GetDBField('Type') == 3 && $zip == '' ) { | ||||
continue; | break; | ||||
} | } | ||||
$temp[$new_id]['TaxZoneDestId'] = $new_id; | $temp[$new_id]['TaxZoneDestId'] = $new_id; | ||||
$temp[$new_id]['StdDestId'] = $location_id; | $temp[$new_id]['StdDestId'] = $location_id; | ||||
$temp[$new_id]['DestValue'] = $zip ? $zip : ''; | $temp[$new_id]['DestValue'] = $zip ? $zip : ''; | ||||
$this->Application->SetVar('taxdst', $temp); | $this->Application->SetVar('taxdst', $temp); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | |||||
$queryDel="DELETE FROM ".$destinations->TableName." WHERE TaxZoneId=".(int)$this->Application->GetVar('tax_id'); | $queryDel="DELETE FROM ".$destinations->TableName." WHERE TaxZoneId=".(int)$this->Application->GetVar('tax_id'); | ||||
$this->Conn->Query($queryDel); | $this->Conn->Query($queryDel); | ||||
$this->Application->DeleteVar('taxdst'); | $this->Application->DeleteVar('taxdst'); | ||||
$event->CallSubEvent('OnPreSave'); | $event->CallSubEvent('OnPreSave'); | ||||
$event->redirect = false; | $event->redirect = false; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |