db->query("truncate table tbl_voucherdetails"); foreach($importedVoucherDetails as $importedVoucherDetail): $this->db->insert("tbl_voucherdetails",$importedVoucherDetail); endforeach; echo "Vouche Details Imported Successfully!!\n"; ?>
voucherdetail_id [1] => voucher_id [2] => entry_no [3] => transaction_date [4] => [5] => narration [6] => dr [7] => cr [8] => cheque [9] => cheque_details [10] => currency [11] => exrate [12] => fcdr [13] => fccr [14] => branch_id [15] => fiscalyear_id [16] => created_on [17] => created_by [18] => remarks [19] => status */ if(sizeof($importedLine)>0): $dbVoucherDetail=new stdClass; $dbVoucherDetail->voucherdetail_id=$importedLine[1]; $dbVoucherDetail->voucher_id=$importedLine[2]; $dbVoucherDetail->entry_no=$importedLine[3]; $dbVoucherDetail->transaction_date=dbDate($importedLine[4]); $dbVoucherDetail->account_id=$importedLine[5]; $dbVoucherDetail->narration=$importedLine[6]; $dbVoucherDetail->dr=$importedLine[7]; $dbVoucherDetail->cr=$importedLine[8];//$_SESSION['FiscalYearID']; $dbVoucherDetail->cheque=$importedLine[9];//$_SESSION['BranchID']; $dbVoucherDetail->cheque_details=$importedLine[10]; $dbVoucherDetail->currency=$importedLine[11]; $dbVoucherDetail->exrate=$importedLine[12]; $dbVoucherDetail->fcdr=$importedLine[13]; $dbVoucherDetail->fccr=$importedLine[14]; $dbVoucherDetail->branch_id=$_SESSION['BranchID'];//$importedLine[47]; $dbVoucherDetail->fiscalyear_id=$_SESSION['FiscalYearID'];//$importedLine[47]; $dbVoucherDetail->created_on=dbDate($importedLine[15]); $dbVoucherDetail->created_by=$importedLine[16]; $dbVoucherDetail->remarks=$importedLine[19]; $dbVoucherDetail->status=$importedLine[20]; if(!in_array($dbVoucherDetail,$importedVoucherDetails)) $importedVoucherDetails[]=$dbVoucherDetail; return $importedVoucherDetails; endif; return ""; } ?>