
<?   
//일련번호(우리회사의 세금계산서)  //매출
     
	  $p_class= new number;
	  $ta_vno=$p_class->date_add($ta_vno,2);
	  $num_2=$p_class->date_3add($num_2);
	  $num1=$ta_year.$ta_vno;
         
	  //공급받는자
	  if($accept_ex) {
                if(!$print_flag) {
	           include "si_class/si100_company.inc";
                } else {
	           include "../si_class/si100_company.inc";
                } 
                $query_ip_kum="select ta_kum,ta_vat,ta_edate,ta_dt from ta_file where ta_uid = '$ta_uid'";
		$result_ip_kum=mysql_query($query_ip_kum);
		
		$sum_ip_kum=mysql_result($result_ip_kum,0,0);   //공금가액
		$sum_ip_kum_gong=explode(".",$sum_ip_kum);  //콤마없이 출력하기위해
		$str_sum_ip_kum=strlen($sum_ip_kum_gong[0]);//1글자씩출력
		//공란수
		$w_kum_space=11-($str_sum_ip_kum+1);

		for($i=0 ; $i<$str_sum_ip_kum ;$i++) {
		  $char_kum[$i]=substr($sum_ip_kum_gong[0],$i,1);
		}

		//$print_string_count=$str_sum_ip_kum-1;
		$ta_vat=mysql_result($result_ip_kum,0,1);   //세액
		$ta_edate=mysql_result($result_ip_kum,0,2);   //edate
                $ta_dt=mysql_result($result_ip_kum,0,3); 

		$ta_vat_gong=explode(".",$ta_vat);  //콤마없이 출력하기위해
                $str_vat_ip_kum=strlen($ta_vat_gong[0]);//1글자씩출력
		for($i=0 ; $i<$str_vat_ip_kum ;$i++) {
		  $char_vat[$i]=substr($ta_vat_gong[0],$i,1);
		}
		  
		if($ta_edate) {
                   //작성일자
                   $ta_yy_100_print=substr($ta_edate,0,4);
		   $ta_mm_100_print=substr($ta_edate,4,2);
		   $ta_dd_100_print=substr($ta_edate,6,2);
		} else {
		   $ta_yy_100_print=date('Y');
		   $ta_mm_100_print=date('m');
		   $ta_dd_100_print='31';
		}

		//금액을 콤마출력
                $p_class= new number;
		$math_ip_kum=$ta_vat+$sum_ip_kum;
                $sum_ip_kum_print=$p_class->double_comma($sum_ip_kum);
		$math_ip_kum_print=$p_class->double_comma($math_ip_kum);

		$qurty_ta_obj="select ta_mm1,ta_dd1,ta_memo1,ta_su1,ta_dan1,ta_kum1,ta_vat1,ta_mm2,ta_dd2,ta_memo2,ta_su2,ta_dan2,ta_kum2,ta_vat2,ta_mm3,ta_dd3,ta_memo3,ta_su3,ta_dan3,ta_kum3,ta_vat3,ta_mm4,ta_dd4,ta_memo4,ta_su4,ta_dan4,ta_kum4,ta_vat4,ta_bigo from ta_file where ta_uid = '$ta_uid'";
		$result_ta_obj=mysql_query($qurty_ta_obj);

		$ta_mm0  =mysql_result($result_ta_obj,0,0);  if($ta_mm0=='0') $ta_mm0=" ";
		$ta_dd0  =mysql_result($result_ta_obj,0,1);  if($ta_dd0=='0') $ta_dd0="";
		$ta_memo0=mysql_result($result_ta_obj,0,2);  if($ta_memo0==' ') $ta_memo0=""; 
		$ta_su0  =mysql_result($result_ta_obj,0,3);  if($ta_su0=='0') $ta_su0="";
		$ta_dan0 =mysql_result($result_ta_obj,0,4);  if($ta_dan0=='0') $ta_dan0="";
		$ta_kum0 =mysql_result($result_ta_obj,0,5);  if($ta_kum0=='0') $ta_kum0=""; 
		$ta_vat0 =mysql_result($result_ta_obj,0,6);  if($ta_vat0=='0') $ta_vat0="";

		$ta_mm1  =mysql_result($result_ta_obj,0,7);  if($ta_mm1=='0') $ta_mm1="";
		$ta_dd1  =mysql_result($result_ta_obj,0,8);  if($ta_dd1=='0') $ta_dd1="";
		$ta_memo1=mysql_result($result_ta_obj,0,9);  if($ta_memo1==' ') $ta_memo1="";
		$ta_su1  =mysql_result($result_ta_obj,0,10); if($ta_su1=='0') $ta_su1="";
		$ta_dan1 =mysql_result($result_ta_obj,0,11); if($ta_dan1=='0') $ta_dan1="";
		$ta_kum1 =mysql_result($result_ta_obj,0,12); if($ta_kum1=='0') $ta_kum1=""; 
		$ta_vat1 =mysql_result($result_ta_obj,0,13); if($ta_vat1=='0') $ta_vat1="";

		$ta_mm2  =mysql_result($result_ta_obj,0,14);  if($ta_mm2=='0') $ta_mm2="";
		$ta_dd2  =mysql_result($result_ta_obj,0,15);  if($ta_dd2=='0') $ta_dd2=""; 
		$ta_memo2=mysql_result($result_ta_obj,0,16);  if($ta_memo2==' ') $ta_memo2="";
		$ta_su2  =mysql_result($result_ta_obj,0,17);  if($ta_su2=='0') $ta_su2="";
		$ta_dan2 =mysql_result($result_ta_obj,0,18);  if($ta_dan2=='0') $ta_dan2="";
		$ta_kum2 =mysql_result($result_ta_obj,0,19);  if($ta_kum2=='0') $ta_kum2=""; 
		$ta_vat2 =mysql_result($result_ta_obj,0,20);  if($ta_vat2=='0') $ta_vat2="";

		$ta_mm3  =mysql_result($result_ta_obj,0,21);  if($ta_mm3=='0') $ta_mm3="";
		$ta_dd3  =mysql_result($result_ta_obj,0,22);  if($ta_dd3=='0') $ta_dd3="";
		$ta_memo3=mysql_result($result_ta_obj,0,23);  if($ta_memo3==' ') $ta_memo3="";
		$ta_su3  =mysql_result($result_ta_obj,0,24);  if($ta_su3=='0') $ta_su3="";
		$ta_dan3 =mysql_result($result_ta_obj,0,25);  if($ta_dan3=='0') $ta_dan3="";
		$ta_kum3 =mysql_result($result_ta_obj,0,26);  if($ta_kum3=='0') $ta_kum3=""; 
		$ta_vat3 =mysql_result($result_ta_obj,0,27);  if($ta_vat3=='0') $ta_vat3="";
		$ta_bigo =mysql_result($result_ta_obj,0,28);
                
                $p_class= new number; 
		   if($ta_su0!="") $ta_su0_print=$p_class->double_comma($ta_su0);
		   if($ta_su1!="") $ta_su1_print=$p_class->double_comma($ta_su1);
		   if($ta_su2!="") $ta_su2_print=$p_class->double_comma($ta_su2);
		   if($ta_su3!="") $ta_su3_print=$p_class->double_comma($ta_su3);
                   if($ta_dan0!="") $ta_dan0_print=$p_class->double_comma($ta_dan0);
		   if($ta_dan1!="") $ta_dan1_print=$p_class->double_comma($ta_dan1);
		   if($ta_dan2!="") $ta_dan2_print=$p_class->double_comma($ta_dan2);
		   if($ta_dan3!="") $ta_dan3_print=$p_class->double_comma($ta_dan3);
		   if($ta_kum0!="") $sum_kum_print0=$p_class->double_comma($ta_kum0);
		   if($ta_kum1!="") $sum_kum_print1=$p_class->double_comma($ta_kum1);
		   if($ta_kum2!="") $sum_kum_print2=$p_class->double_comma($ta_kum2);
		   if($ta_kum3!="") $sum_kum_print3=$p_class->double_comma($ta_kum3);
		   if($ta_vat0!="") $sum_vat_kum0_print=$p_class->double_comma($ta_vat0);
		   if($ta_vat1!="") $sum_vat_kum1_print=$p_class->double_comma($ta_vat1);
		   if($ta_vat2!="") $sum_vat_kum2_print=$p_class->double_comma($ta_vat2);
		   if($ta_vat3!="") $sum_vat_kum3_print=$p_class->double_comma($ta_vat3);
		
		$ta_mm[0]=$ta_mm0;$ta_mm[1]=$ta_mm1;$ta_mm[2]=$ta_mm2;$ta_mm[3]=$ta_mm3;
		$ta_dd[0]=$ta_dd0;$ta_dd[1]=$ta_dd1;$ta_dd[2]=$ta_dd2;$ta_dd[3]=$ta_dd3;
     } 
		   
	/*	 
        //공란수
		$comp_kum=$sum_ip_kum;
		settype($comp_kum,"string");
		$str_kum=strlen($comp_kum);
		
		$p_class= new number;
		$char_vatkum=explode(".",$ta_vat);
		if($char_vatkum[1]>0)
		  $sum_ip_kum+=1;  //vat에서 떨어져 나갈 금액을 계산
		settype($ta_vat,"integer");
		$math_ip_kum=$ta_vat+$sum_ip_kum;
	        $sum_ip_kum_print=$p_class->double_comma($math_ip_kum);
		$ta_vat_print=$p_class->double_comma($ta_vat);
     
	  //insert
      // $query_ta_insert="insert into ta_file 
*/
	   
?>