if ($total == '') {
$error['total'] = 'Toplam is required';
}

Bu sorgu Total in 0 olduğu zaman hataya sebep oluyo olabilir bu kısmı yorum satırına alıp bir dene kayıt yaparsa == yerine === yapmayı bir dene