".$sql_bof.""; $result_bof = mysql_query($sql_bof) or die("sql_bof records error".mysql_error()); while($fields_bof = mysql_fetch_array($result_bof,MYSQL_BOTH)) { $te_bofqty = $fields_bof['bofqty']; $te_bofrate = $fields_bof['bofrate']; $te_curcur = $fields_bof['sysrno']; $te_vsvexrateo = $fields_bof['vsvexrateo']; $te_vseexrateo = $fields_bof['vseexrateo']; $te_bolexrate = $fields_bof['bolexrate']; if($te_bolexrate>0) $te_invexrate = $te_bolexrate; else if($te_vseexrateo>0) $te_invexrate = $te_vseexrateo; else $te_invexrate = $te_vsvexrateo; if($te_invexrate<=0) { echo "
".$sql_pih.""; $result_pih = mysql_query($sql_pih) or die("sql_pih records error".mysql_error()); if(mysql_num_rows($result_pih)) { $te_pilhamt_tot = 0; while ($fields_pih = mysql_fetch_array($result_pih,MYSQL_BOTH)) { $te_pilhamt = $fields_pih['pilhamt']; $te_pilhamt_tot = $te_pilhamt_tot + $te_pilhamt; } if($te_pilhamt_tot<=$te_invlkramt) { $print_flag = "N"; } else { $te_dif_tot = $te_pilhamt_tot - $te_invlkramt; } } if($print_flag == "N") { echo "