whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
www
/
application
/
controllers
/
webapp
/
Upload File:
files >> //proc/self/root/home/papecmvm/www/application/controllers/webapp/Office.php
<?php use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; use Aws\CommandPool; if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require_once APPPATH."third_party/aws/autoload.php"; class Office extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('app', "model"); $CI = & get_instance(); $this->db = $CI->load->database('default', TRUE); $this->db2 = $CI->load->database('db2', TRUE); //aws $bucketname = 'paperpushbucket'; $key = 'AKIAJJ72VRLHXBD272YQ'; $secret = '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'; $this->s3 = S3Client::factory( array( 'credentials' => array( 'key' => $key, 'secret' => $secret ), 'version' => 'latest', 'region' => 'ap-south-1' ) ); } public function index() { $ses = $this->session->get_userdata(); $rid = $ses['reg_info'][0]['rid']; $data['access'] = $this->model->officeModel($rid); //echo "<pre>"; print_r($data['access']); die; $this->load->view("webapp/office_user/customer", $data); } public function viewCust($encrypted_id) { $ses = $this->session->get_userdata(); $id = $this->model->decryptdata($encrypted_id); $rid = $ses['reg_info'][0]['rid']; $userdata['data'] = $this->model->viewOfficeModel($id, $rid); $userdata['encrypted_id'] = $encrypted_id; $userdata['wise'] = $userdata['data'][0]['wise']; $where = array('code' => $userdata['data'][0]['folder_code']); $userdata['struct'] = $this->db2->get_where('cust_upload_structure', $where)->result_array(); $userdata['code'] = $userdata['data'][0]['folder_code']; //echo "<pre>"; print_r($userdata['code']); die; $this->load->view("webapp/office_user/view_cust",$userdata); } public function viewCust_x($encrypted_id) { $ses = $this->session->get_userdata(); $id = $this->model->decryptdata($encrypted_id); /*$where=array('rid' => $id); $userdata['data'] = $this->model->DetailData('tbl_registration', $where);*/ $rid = $ses['reg_info'][0]['rid']; $userdata['data'] = $this->model->viewOfficeModel($id, $rid); echo "<pre>"; print_r($userdata['data']); die; $userdata['encrypted_id'] = $encrypted_id; $wise = $userdata['data'][0]['wise']; if($wise == 'all'){ $this->load->view("webapp/office_user/view_customer_all",$userdata); }elseif($wise == 'month'){ $this->load->view("webapp/office_user/view_customer_month",$userdata); }else{ $this->load->view("webapp/office_user/view_customer",$userdata); } } public function viewCustTwo($cust_id, $noti_id) { $ses = $this->session->get_userdata(); $id = $this->model->decryptdata($cust_id); $ni = $this->model->decryptdata($noti_id); /*$where=array('rid' => $id); $userdata['data'] = $this->model->DetailData('tbl_registration', $where);*/ $rid = $ses['reg_info'][0]['rid']; $userdata['data'] = $this->model->viewOfficeModel($id, $rid); //echo "<pre>"; print_r($userdata['data']); die; $userdata['encrypted_id'] = $cust_id; $data = array('status' => 'seen'); $where=array('id' => $ni); $this->model->UpdateData('tbl_access_notification', $data, $where); $this->load->view("webapp/office_user/view_customer",$userdata); } public function seeNoti($id){ $data = array('status' => 'seen'); $where=array('ato' => $id, 'status' => 'unseen'); $this->model->UpdateData('tbl_access_notification', $data, $where); $html = ''; $resultArrauy['status'] = 'success'; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function leaderNoti($id){ $data = array('status' => 'seen'); $where=array('ato' => $id, 'status' => 'unseen'); $this->model->UpdateData('tbl_access_notification', $data, $where); $html = ''; $resultArrauy['status'] = 'success'; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function officeNoti($id){ $data = array('status' => 'seen'); $where=array('ato' => $id, 'status' => 'unseen'); $this->model->UpdateData('tbl_access_notification', $data, $where); $html = ''; $resultArrauy['status'] = 'success'; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function custData($cid, $cu_folder){ $ses = $this->session->get_userdata(); $uid = $ses['reg_info'][0]['rid']; $cid = $this->model->decryptdata($cid); $where = array( 'ufrom' => $cid, 'uto' => $uid, 'folder' => $cu_folder ); $cust_data['data'] = $this->model->DetailData('tbl_cust_uploads', $where); //echo "<pre>"; print_r($cust_data['data']); $this->load->view('webapp/office_user/view_cust_data', $cust_data); } public function custDataTwo($cid, $stage, $avail_folder){ $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; $cust_data['cid'] = $cid; $cust_id = $this->model->decryptdata($cid); /* echo $cid; echo "<br>"; echo $cust_id; echo "<br>"; echo $tt = $this->model->decryptdata($cust_data['cid']); */ $cust_data['st'] = $stage; $cust_data['data']= base64_decode($avail_folder); $ex_avail = explode('/', $cust_data['data']); $cust_data['year'] = $ex_avail[2]; $month = $ex_avail[3]; $cust_data['month2'] = substr($month, strpos($month, "_") + 1); //echo ($cust_data['month2']); die; $ufrom = $cust_id; $uto = $oid; $folder = $stage; $where_noti = array( 'ufrom' => $ufrom, 'uto' => $uto, 'folder' => $folder, 'status' => 'unseen' ); $upd = array('status' => 'seen'); $this->model->UpdateData('tbl_cust_uploads', $upd, $where_noti); if($stage == 'cheque_reg' || $stage == 'bank'){ $dirs = array_filter(glob($cust_data['data'].'/*'), 'is_file'); $q = []; foreach ($dirs as $key => $val) { $q[] = $val; } $t = []; foreach ($dirs as $key => $value) { $where = array( 'stage' => $stage, 'year' => $cust_data['year'], 'month' => $cust_data['month2'], 'path' => $value ); //$fs = $this->model->DetailData('tbl_form_status', $where); $fs = $this->model->getFormStatus($where); $t[] = $fs; } //echo "<pre>"; print_r($t); die; foreach ($t as $k => $v) { $temp = []; $data['voucher_type'] = []; $data['cid'] = ''; $data['oid'] = ''; $data['stage'] = ''; $data['year'] = ''; $data['month'] = ''; $data['path'] = ''; $data['path_two'] = ''; foreach ($v as $ke => $va) { //echo "<pre>"; print_r ($va); echo "</pre>"; if($va['voucher_type'] != '') $temp[] = $va['voucher_type']; $data['cid'] = $va['cid']; $data['oid'] = $va['oid']; $data['stage'] = $va['stage']; $data['year'] = $va['year']; $data['month'] = $va['month']; $data['path'] = $va['path']; if(!empty($va) && $va['path'] == $v[0]['path']){ $data["filled_status"] = $va['filled_status']; $data['name'] = $va['name']; }else{ $data["filled_status"] = ''; $data['name'] = ''; } } $data['path_two'] = $q[$k]; $temp = implode("|" , $temp); $data['voucher_type'] = $temp; unset($t[$k]); $t[$k] = $data ; } $cust_data['cd'] = $t; $cust_data['cst_id'] = $cid; //echo "<pre>"; print_r ($cust_data); echo "</pre>"; die; $this->load->view('webapp/office_user/view_cust_data_two', $cust_data); //end for bank and cheque_reg }else{ //echo "<pre>"; print_r ($cust_data); echo "</pre>"; die; $temp = []; $dirs = array_filter(glob($cust_data['data'].'/*'), 'is_file'); foreach ($dirs as $key => $value) { $temp[]=$value; } foreach ($temp as $k => &$v) { $where = array( 'stage' => $stage, 'year' => $cust_data['year'], 'month' => $cust_data['month2'], 'path' => $v ); //$fs = $this->model->DetailData('tbl_form_status', $where); $fs = $this->model->getFormStatus($where); //echo "<pre>"; print_r ($fs); echo "</pre>"; if(!empty($fs)){ $test["status"] = "yes"; $test["voucher_type"] = $fs[0]['voucher_type']; $test["filled_status"] = $fs[0]['filled_status']; $test['oid'] = $fs[0]['oid']; $test['name'] = $fs[0]['name']; }else{ $test["status"] = "no"; $test["voucher_type"] = ""; $test["filled_status"] = ""; $test['oid'] = '0'; $test['name'] = ''; } $test["path"] = $v; $temp[$k] = $test; } //die; //echo "<pre>"; print_r($temp); die; $cust_data['cd'] = $temp; $cust_data['cst_id'] = $cid; //echo "<pre>"; print_r($cust_data['cd']); die; $this->load->view('webapp/office_user/view_cust_data', $cust_data); } } public function check_fs(){ $where_fs = array( 'stage' => $this->input->post('stage'), 'year' => $this->input->post('year'), 'month' => $this->input->post('month'), 'path' => $this->input->post('path') ); $fs = $this->model->DetailData('tbl_form_status', $where_fs); //echo "<pre>"; print_r ($fs); echo "</pre>"; die; if(!empty($fs)){ if($fs[0]['filled_status'] == 'pending' || $fs[0]['filled_status'] == 'done'){ echo 'pending'; } } } public function form(){ //echo "<pre>"; print_r($_POST); die; /* $path = base64_decode($path); $stage = explode('/', $path); $current_stage = $stage[4]; $data['stage'] = $stage[4]; $data['path'] = $path;*/ $where_cust = array('type' => 'customer', 'status' =>'1'); $data['cust'] = $this->db2->get_where('tbl_registration', $where_cust)->result_array(); $data['max_fid'] = $this->model->maxId('tbl_form', 'fid'); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; $stg = $this->input->post('stg'); $path = $this->input->post('path'); $data['yr'] = $this->input->post('year'); $data['mn'] = $this->input->post('month'); $current_stage = $stg; $data['stg'] = $stg; $cid = $this->input->post('cid'); $data['path'] = implode('|-|', $path) ; $dec_cid = $this->model->decryptdata($cid); $data['customer_id'] = $this->model->decryptdata($cid); $data['items'] = $this->model->getDatamodel('tbl_item'); $data['expense'] = $this->model->getDatamodel('tbl_expense'); $data['ledger'] = $this->model->getFormLedger($data['customer_id']); $data['tax'] = $this->model->getDatamodel('tbl_tax'); /*$url = $this->input->post('url'); $exp_path_one = $this->input->post('path'); $epc_one = count($exp_path_one); $hid_oid = $this->input->post('hidden_oid'); if($hid_oid != $oid){ for ($z=0; $z < $epc_one; $z++) { $where_fs = array( 'stage' => $this->input->post('stg'), 'year' => $this->input->post('year'), 'month' => $this->input->post('month'), 'path' => $exp_path_one[$z] ); $fs = $this->model->DetailData('tbl_form_status', $where_fs); if(!empty($fs)){ if($fs[0]['filled_status'] == 'pending'){ $this->session->set_flashdata('msg', ' <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Error!</strong> Submission pending by other user. </div>'); redirect($url); } } } }*/ /*if($current_stage == 'cheque_reg' || $current_stage == 'bank'){ $vt = $this->input->post('voucher_type'); }else{ $vt = 'NULL'; }*/ // update in form status even form is open $exp_path = $this->input->post('path'); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { $ins_form_status = array( 'cid' => $this->model->decryptdata($this->input->post('cid')), 'oid' => $oid, 'stage' => $this->input->post('stg'), 'year' => $this->input->post('year'), 'month' => $this->input->post('month'), 'path' => $exp_path[$i], 'filled_status' => 'pending' ); $fs_count = $this->db2->get_where('tbl_form_status', array( 'cid' => $this->model->decryptdata($this->input->post('cid')), 'oid' => $oid, 'stage' => $this->input->post('stg'), 'path' => $exp_path[$i], ) )->num_rows(); /*echo $fs_count; echo "<br>";*/ if($fs_count == '0'){ $this->model->insertData('tbl_form_status', $ins_form_status); } } $data['group_all'] = $this->model->getDatamodel('tbl_group'); if($current_stage == 'contra'){ $this->load->view('webapp/office_user/contra_form', $data); }elseif($current_stage == 'receipt'){ $where = array('voucher' => 'receipt'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); $this->load->view('webapp/office_user/receipt_form', $data); }elseif($current_stage == 'payment'){ $where = array('voucher' => 'payment'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); $this->load->view('webapp/office_user/payment_form', $data); }elseif($current_stage == 'journal'){ $this->load->view('webapp/office_user/journal_form', $data); }elseif($current_stage == 'credit'){ $this->load->view('webapp/office_user/credit_form', $data); }elseif($current_stage == 'debit'){ $this->load->view('webapp/office_user/debit_form', $data); }elseif($current_stage == 'cheque_reg'){ $voucher_type = $this->input->post('voucher_type'); $data['voucher_type'] = $voucher_type; if($voucher_type == 'payment'){ $where = array('voucher' => 'payment'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); $this->load->view('webapp/office_user/payment_form', $data); }else{ $where = array('voucher' => 'receipt'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); $this->load->view('webapp/office_user/receipt_form', $data); } }elseif($current_stage == 'bank'){ $voucher_type = $this->input->post('voucher_type'); $data['voucher_type'] = $voucher_type; if($voucher_type == 'payment'){ $where = array('voucher' => 'payment'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); //echo "<pre>"; print_r ($data['rec_group']); echo "</pre>"; die; $this->load->view('webapp/office_user/payment_form', $data); }elseif($voucher_type == 'receipt'){ $where = array('voucher' => 'receipt'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); $this->load->view('webapp/office_user/receipt_form', $data); }else{ $this->load->view('webapp/office_user/contra_form', $data); } }else{ if($stg == 'purchase'){ $where = array('voucher' => 'purchase'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); }else{ $where = array('voucher' => 'sales'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $data['rec_group'] = $this->model->selGroup($where, $dec_cid); } $this->load->view('webapp/office_user/generate_form', $data); } } public function form_x($path, $cid){ $path = base64_decode($path); $stage = explode('/', $path); $current_stage = $stage[4]; $data['stage'] = $stage[4]; $data['path'] = $path; $data['customer_id'] = $this->model->decryptdata($cid); $data['items'] = $this->model->getDatamodel('tbl_item'); $data['expense'] = $this->model->getDatamodel('tbl_expense'); $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['tax'] = $this->model->getDatamodel('tbl_tax'); if($current_stage == 'contra'){ $this->load->view('webapp/office_user/contra_form', $data); }elseif($current_stage == 'receipt'){ $this->load->view('webapp/office_user/receipt_form', $data); }elseif($current_stage == 'payment'){ $this->load->view('webapp/office_user/payment_form', $data); }elseif($current_stage == 'journal'){ $this->load->view('webapp/office_user/journal_form', $data); }elseif($current_stage == 'credit'){ $this->load->view('webapp/office_user/credit_form', $data); }elseif($current_stage == 'debit'){ $this->load->view('webapp/office_user/debit_form', $data); }else{ $this->load->view('webapp/office_user/generate_form', $data); } } //add form sales public function add_form(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; // $path = explode('/', $this->input->post('path')); // $year = $path[2]; // $m1 = explode('_',$path[3]); // $month = $m1[1]; $year = $this->input->post('year'); $month = $this->input->post('month'); $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'ref_no' => $this->input->post('ref_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'm_effect' => $this->input->post('effect_main'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $count = count($this->input->post('ledger_name_sub')); $s_ledger_name = $this->input->post('ledger_name_sub'); $s_effect = $this->input->post('effect_sub'); $discount_one = $this->input->post('dis_one'); $amt_taxable = $this->input->post('amt_taxable'); $sgst = $this->input->post('sgst'); $s_aot = $this->input->post('sgst_tax_amt'); $cgst = $this->input->post('cgst'); $c_aot = $this->input->post('cgst_tax_amt'); $ugst = $this->input->post('ugst'); $u_aot = $this->input->post('ugst_tax_amt'); $igst = $this->input->post('igst'); $i_aot = $this->input->post('igst_tax_amt'); $cess_code = $this->input->post('cess_code'); $discount_two = $this->input->post('dis_two'); $item_name = $this->input->post('item_name'); $qty = $this->input->post('qty'); $rate = $this->input->post('rate'); $unit = $this->input->post('unit'); $lot_no = $this->input->post('lot_no'); for ($i=0; $i < $count; $i++) { $md = $_POST['mfg_date'][$i]; $md = date("Y-m-d", strtotime($md)); $ed = $_POST['exp_date'][$i]; $ed = date("Y-m-d", strtotime($ed)); if(empty($sgst[$i])){ $sgst[$i] = '0.00'; } if(empty($cgst[$i])){ $cgst[$i] = '0.00'; } if(empty($ugst[$i])){ $ugst[$i] = '0.00'; } if(empty($igst[$i])){ $igst[$i] = '0.00'; } if(empty($discount_one[$i])){ $discount_one[$i] = '0.00'; } if(empty($discount_two[$i])){ $discount_two[$i] = '0.00'; } $ins_sub = array( 'fid' => $ins, 's_ledger_name' => $s_ledger_name[$i], 's_effect' => $s_effect[$i], 'discount_one' => $discount_one[$i], 'amt_taxable' => $amt_taxable[$i], 'sgst' => $sgst[$i], 's_aot' => $s_aot[$i], 'cgst' => $cgst[$i], 'c_aot' => $c_aot[$i], 'ugst' => $ugst[$i], 'u_aot' => $u_aot[$i], 'igst' => $igst[$i], 'i_aot' => $i_aot[$i], 'cess_code' => $cess_code[$i], 'discount_two' => $discount_two[$i], 'item_name' => $item_name[$i], 'qty' => $qty[$i], 'rate' => $rate[$i], 'unit' => $unit[$i], 'lot_no' => $lot_no[$i], 'lot_mfg_date' => $md, 'lot_exp_date' => $ed ); $ins2 = $this->model->insertData('tbl_form_info', $ins_sub); $pass_data = $_POST; $this->tbl_other_expens_entry($ins2, $pass_data, $count, $i+1); } $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /* $ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i], 'filled_status' => 'done' ); $this->model->insertData('tbl_form_status', $ins_form_status);*/ $ins_form_status = array( 'filled_status' => 'done' ); $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //add form sales public function tbl_other_expens_entry($ins2, $pass_data, $count, $j){ $ledger_name_sub = $pass_data['ledger_name_sub']; $dynamic_name = "exp_name_".$j ; $exp_name = $pass_data[$dynamic_name]; $dynamic_amt = "exp_amt_".$j ; $exp_amt = $pass_data[$dynamic_amt]; for ($i=0; $i < count($exp_name); $i++) { $xyz = $exp_name[$i]; $xyz_amt = $exp_amt[$i]; if($xyz != ''){ $ins_exp = array('fi_id' => $ins2, 'ex_name' => $xyz, 'ex_amount' => $xyz_amt); $this->model->insertData('tbl_other_expens', $ins_exp); } } } //update form sales public function update_form($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ //echo $this->input->post('amt_gross'); die; //echo "<pre>"; print_r($_POST); die; //Update in main table $fid = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ins_main = array( 'm_date' => $m_date, 'd' => $d, 'm' => $m, 'voucher_no' => $this->input->post('voucher_no'), 'ref_no' => $this->input->post('ref_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'm_effect' => $this->input->post('effect_main'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'release_status' => 'released', 'l_noti' => 'unseen' ); $whare_main = array('fid' => $fid); $this->model->UpdateData('tbl_form', $ins_main, $whare_main); //Update in sub table $count1 = count($this->input->post('fi_id')); $fi_id = $this->input->post('fi_id'); $s_ledger_name = $this->input->post('ledger_name_sub'); //$s_effect = $this->input->post('effect_sub'); //$discount_one = $this->input->post('dis_one'); $amt_taxable = $this->input->post('amt_taxable'); $sgst = $this->input->post('sgst'); $s_aot = $this->input->post('sgst_tax_amt'); $cgst = $this->input->post('cgst'); $c_aot = $this->input->post('cgst_tax_amt'); $ugst = $this->input->post('ugst'); $u_aot = $this->input->post('ugst_tax_amt'); $igst = $this->input->post('igst'); $i_aot = $this->input->post('igst_tax_amt'); $cess_code = $this->input->post('cess_code'); $discount_two = $this->input->post('dis_two'); $item_name = $this->input->post('item_name'); $qty = $this->input->post('qty'); $rate = $this->input->post('rate'); $unit = $this->input->post('unit'); $lot_no = $this->input->post('lot_no'); for ($i=0; $i < $count1; $i++) { $md = $_POST['mfg_date'][$i]; $md = date("Y-m-d", strtotime($md)); $ed = $_POST['exp_date'][$i]; $ed = date("Y-m-d", strtotime($ed)); if(empty($sgst[$i])){ $sgst[$i] = '0.00'; } if(empty($cgst[$i])){ $cgst[$i] = '0.00'; } if(empty($ugst[$i])){ $ugst[$i] = '0.00'; } if(empty($igst[$i])){ $igst[$i] = '0.00'; } //if(empty($edit_discount_one[$i])){ $edit_discount_one[$i] = '0.00'; } if(empty($discount_two[$i])){ $discount_two[$i] = '0.00'; } $upd_sub = array( 'fid' => $fid, 's_ledger_name' => $s_ledger_name[$i], //'s_effect' => $s_effect[$i], //'discount_one' => $discount_one[$i], 'amt_taxable' => $amt_taxable[$i], 'sgst' => $sgst[$i], 's_aot' => $s_aot[$i], 'cgst' => $cgst[$i], 'c_aot' => $c_aot[$i], 'ugst' => $ugst[$i], 'u_aot' => $u_aot[$i], 'igst' => $igst[$i], 'i_aot' => $i_aot[$i], 'cess_code' => $cess_code[$i], 'discount_two' => $discount_two[$i], 'item_name' => $item_name[$i], 'qty' => $qty[$i], 'rate' => $rate[$i], 'unit' => $unit[$i], 'lot_no' => $lot_no[$i], 'lot_mfg_date' => $md, 'lot_exp_date' => $ed ); if($fi_id[$i] != ''){ $where_sub_one = array('fi_id' => $fi_id[$i]); $this->model->UpdateData('tbl_form_info', $upd_sub, $where_sub_one); }else{ $ins = $this->model->insertData('tbl_form_info', $upd_sub); } $this->db2->delete('tbl_other_expens', array('fi_id' => $fi_id[$i])); $pass_data = $_POST; if($fi_id[$i] != ''){ $this->tbl_other_expens_entry($fi_id[$i], $pass_data, $count='NULL', $i+1); }else{ $this->tbl_other_expens_entry($ins, $pass_data, $count='NULL', $i+1); } } //insert in sub table /* $count_two = count($this->input->post('ledger_name_sub')); $s_ledger_name = $this->input->post('ledger_name_sub'); $s_effect = $this->input->post('effect_sub'); $discount_one = $this->input->post('dis_one'); $amt_taxable = $this->input->post('amt_taxable'); $sgst = $this->input->post('sgst'); $s_aot = $this->input->post('sgst_tax_amt'); $cgst = $this->input->post('cgst'); $c_aot = $this->input->post('cgst_tax_amt'); $ugst = $this->input->post('ugst'); $u_aot = $this->input->post('ugst_tax_amt'); $igst = $this->input->post('igst'); $i_aot = $this->input->post('igst_tax_amt'); $cess_code = $this->input->post('cess_code'); $discount_two = $this->input->post('dis_two'); $item_name = $this->input->post('item_name'); $qty = $this->input->post('qty'); $rate = $this->input->post('rate'); $unit = $this->input->post('unit'); $lot_no = $this->input->post('lot_no'); for ($k=0; $k < $count_two; $k++) { $md = $_POST['mfg_date'][$k]; $md = date("Y-m-d", strtotime($md)); $ed = $_POST['exp_date'][$k]; $ed = date("Y-m-d", strtotime($ed)); if(empty($sgst[$k])){ $sgst[$k] = '0.00'; } if(empty($cgst[$k])){ $cgst[$k] = '0.00'; } if(empty($ugst[$k])){ $ugst[$k] = '0.00'; } if(empty($kgst[$k])){ $kgst[$k] = '0.00'; } if(empty($discount_one[$k])){ $discount_one[$k] = '0.00'; } if(empty($discount_two[$k])){ $discount_two[$k] = '0.00'; } $ins_sub = array( 'fid' => $fid, 's_ledger_name' => $s_ledger_name[$k], 's_effect' => $s_effect[$k], 'discount_one' => $discount_one[$k], 'amt_taxable' => $amt_taxable[$k], 'sgst' => $sgst[$k], 's_aot' => $s_aot[$k], 'cgst' => $cgst[$k], 'c_aot' => $c_aot[$k], 'ugst' => $ugst[$k], 'u_aot' => $u_aot[$k], 'igst' => $kgst[$k], 'i_aot' => $i_aot[$k], 'cess_code' => $cess_code[$k], 'discount_two' => $discount_two[$k], 'item_name' => $item_name[$k], 'qty' => $qty[$k], 'rate' => $rate[$k], 'unit' => $unit[$k], 'lot_no' => $lot_no[$k], 'lot_mfg_date' => $md, 'lot_exp_date' => $ed ); $in = $this->model->insertData('tbl_form_info', $ins_sub); $pass_data = $_POST; $this->tbl_other_expens_entry($in, $pass_data, $count='NULL', $k+1); } */ $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Form has been updated. </div>'); redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->sales_form_data($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['mn'] = $data['form'][0]['month']; $data['yr'] = $data['form'][0]['year']; $note_two = $data['form'][0]['note_two']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; $data['tax'] = $this->model->getDatamodel('tbl_tax'); if($noti != 'NULL'){ $where = array('fid' => $id); $sts = array('o_noti' => 'seen'); $this->model->UpdateData('tbl_form', $sts, $where); } $data['items'] = $this->model->getDatamodel('tbl_item'); $data['expn'] = $this->model->getDatamodel('tbl_expense'); $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); if(isset($note_two) && $note_two == 'form_two'){ $this->load->view("webapp/office_user/edit_form_two",$data); }else{ $this->load->view("webapp/office_user/edit_form",$data); } } } //end of update form sales //start add contra form public function add_contra(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; $year = $this->input->post('year'); $month = $this->input->post('month'); //$path = explode('/', $this->input->post('path')); //$year = $path[2]; //$m1 = explode('_',$path[3]); //$month = $m1[1]; $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'voucher_type' => $this->input->post('voucher_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /* $ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i], 'l_noti' => 'unseen' ); $this->model->insertData('tbl_form_status', $ins_form_status);*/ $ins_form_status = array( 'voucher_type' => $this->input->post('voucher_type'), 'filled_status' => 'done' ); $rec = $this->db2->get_where('tbl_form_status', $if_where)->row_array(); if(!empty($rec)){ $vt = $rec['voucher_type']; if($vt != 'NULL'){ $vt = explode('|', $vt); $vt[] = $this->input->post('voucher_type'); //echo "<pre>"; print_r ($vt); echo "</pre>"; $vt = implode('|', $vt); }else{ $vt = $this->input->post('voucher_type'); } }else{ $vt = $this->input->post('voucher_type'); } $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i], ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //end add contra form //end update contra form public function update_contra($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ $id = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $ins_main = array( 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'l_noti' => 'unseen', 'release_status' => 'released' ); $where = array("fid" => $id); $ins = $this->model->UpdateData('tbl_form', $ins_main, $where); redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->office_form_contra($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $voucher_type = $data['form'][0]['voucher_type']; $data['voucher_type'] = $voucher_type; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['items'] = $this->model->getDatamodel('tbl_item'); $this->load->view("webapp/office_user/edit_contra",$data); } } //end update contra form //start add receipt form public function add_receipt(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; $path = explode('/', $this->input->post('path')); $year = $path[2]; $m1 = explode('_',$path[3]); $month = $m1[1]; $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'voucher_type' => $this->input->post('voucher_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'ms_ledger_two' => $this->input->post('ms_ledger_two'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /* $ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'voucher_type' => $this->input->post('voucher_type'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i] ); $this->model->insertData('tbl_form_status', $ins_form_status);*/ $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $rec = $this->db2->get_where('tbl_form_status', $if_where)->row_array(); if(!empty($rec)){ $vt = $rec['voucher_type']; if($vt != 'NULL'){ $vt = explode('|', $vt); $vt[] = $this->input->post('voucher_type'); //echo "<pre>"; print_r ($vt); echo "</pre>"; $vt = implode('|', $vt); }else{ $vt = $this->input->post('voucher_type'); } }else{ $vt = $this->input->post('voucher_type'); } $ins_form_status = array( 'voucher_type' => $vt, 'filled_status' => 'done' ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //end add receipt form //start update receipt form public function update_receipt($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ //echo "<pre>"; print_r($_POST); die; $id = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $ins_main = array( 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'ms_ledger_two' => $this->input->post('ms_ledger_two'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'l_noti' => 'unseen', 'release_status' => 'released' ); $where = array("fid" => $id); $ins = $this->model->UpdateData('tbl_form', $ins_main, $where); redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->office_form_contra($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $voucher_type = $data['form'][0]['voucher_type']; $data['voucher_type'] = $voucher_type; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['items'] = $this->model->getDatamodel('tbl_item'); $where = array('voucher' => 'receipt'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $this->load->view("webapp/office_user/edit_receipt",$data); } } //end update receipt form //start add payment form public function add_payment(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; $path = explode('/', $this->input->post('path')); $year = $path[2]; $m1 = explode('_',$path[3]); $month = $m1[1]; $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'voucher_type' => $this->input->post('voucher_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'ms_ledger_two' => $this->input->post('ms_ledger_two'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /*$ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'voucher_type' => $this->input->post('voucher_type'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i] ); $this->model->insertData('tbl_form_status', $ins_form_status);*/ $ins_form_status = array( 'voucher_type' => $this->input->post('voucher_type'), 'filled_status' => 'done' ); $rec = $this->db2->get_where('tbl_form_status', $if_where)->row_array(); if(!empty($rec)){ $vt = $rec['voucher_type']; if($vt != 'NULL'){ $vt = explode('|', $vt); $vt[] = $this->input->post('voucher_type'); echo "<pre>"; print_r ($vt); echo "</pre>"; $vt = implode('|', $vt); }else{ $vt = $this->input->post('voucher_type'); } }else{ $vt = $this->input->post('voucher_type'); } $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //end add payment form //start update payment form public function update_payment($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ //echo "<pre>"; print_r($_POST); die; $id = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $ins_main = array( 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'ms_ledger_two' => $this->input->post('ms_ledger_two'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'l_noti' => 'unseen', 'release_status' => 'released' ); $where = array("fid" => $id); $ins = $this->model->UpdateData('tbl_form', $ins_main, $where); redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->office_form_contra($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $voucher_type = $data['form'][0]['voucher_type']; $data['voucher_type'] = $voucher_type; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['items'] = $this->model->getDatamodel('tbl_item'); $where = array('voucher' => 'payment'); $data['group'] = $this->model->DetailData('tbl_grouped_voucher', $where); $this->load->view("webapp/office_user/edit_payment",$data); } } //end update payment form //start add journal form public function add_journal(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); //$check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; /*$path = explode('/', $this->input->post('path')); $year = $path[2]; $m1 = explode('_',$path[3]); $month = $m1[1];*/ $year = $this->input->post('year'); $month = $this->input->post('month'); $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_effect' => $this->input->post('m_effect'), 'ms_effect' => $this->input->post('ms_effect'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'ms_ledger_two' => $this->input->post('ms_ledger_two'), 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /*$ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i] ); */ //$this->model->insertData('tbl_form_status', $ins_form_status); $ins_form_status = array( 'filled_status' => 'done' ); $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //end add journal form //start update journal form public function update_journal($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ //echo "<pre>"; print_r($_POST); die; $id = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $ins_main = array( 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_effect' => $this->input->post('m_effect'), 'ms_effect' => $this->input->post('ms_effect'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'ms_ledger_two' => $this->input->post('ms_ledger_two'), 'l_noti' => 'unseen', 'release_status' => 'released' ); $where = array("fid" => $id); $ins = $this->model->UpdateData('tbl_form', $ins_main, $where); redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->office_form_contra($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; //$data['tax'] = $this->model->getDatamodel('tbl_tax'); $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['items'] = $this->model->getDatamodel('tbl_item'); $this->load->view("webapp/office_user/edit_journal",$data); } } //end update journal form //start add credit note form public function add_credit(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; /*$path = explode('/', $this->input->post('path')); $year = $path[2]; $m1 = explode('_',$path[3]); $month = $m1[1];*/ $year = $this->input->post('year'); $month = $this->input->post('month'); $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $count = count($this->input->post('s_ledger_name')); $amt_taxable = $this->input->post('amt_taxable'); $s_ledger_name = $this->input->post('s_ledger_name'); for ($i=0; $i < $count; $i++) { $ins_sub = array( 'fid' => $ins, 's_ledger_name' => $s_ledger_name[$i], 'amt_taxable' => $amt_taxable[$i] ); $this->model->insertData('tbl_form_info', $ins_sub); } $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /* $ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i] ); */ //$this->model->insertData('tbl_form_status', $ins_form_status); $ins_form_status = array( 'filled_status' => 'done' ); $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //end add credit note form //start update credit note form public function update_credit($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ //echo "<pre>"; print_r($_POST); die; $id = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $ins_main = array( 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'l_noti' => 'unseen', 'release_status' => 'released' ); $where = array("fid" => $id); $ins = $this->model->UpdateData('tbl_form', $ins_main, $where); //Update in sub table $count1 = count($this->input->post('fi_id')); $fi_id = $this->input->post('fi_id'); $s_ledger_name_upd = $this->input->post('s_ledger_name_upd'); $amt_taxable_upd = $this->input->post('amt_taxable_upd'); //echo "<pre>"; print_r($fi_id); die; for ($i=0; $i < $count1; $i++) { if(empty($edit_sgst[$i])){ $edit_sgst[$i] = '0.00'; } if(empty($edit_cgst[$i])){ $edit_cgst[$i] = '0.00'; } if(empty($edit_ugst[$i])){ $edit_ugst[$i] = '0.00'; } if(empty($edit_igst[$i])){ $edit_igst[$i] = '0.00'; } if(empty($edit_discount_one[$i])){ $edit_discount_one[$i] = '0.00'; } if(empty($edit_discount_two[$i])){ $edit_discount_two[$i] = '0.00'; } $upd_sub = array( 's_ledger_name' => $s_ledger_name_upd[$i], 'amt_taxable' => $amt_taxable_upd[$i], ); $where_sub_one = array('fi_id' => $fi_id[$i]); $this->model->UpdateData('tbl_form_info', $upd_sub, $where_sub_one); } //insert in sub table $count_two = count($this->input->post('s_ledger_name')); $s_ledger_name = $this->input->post('s_ledger_name'); $amt_taxable = $this->input->post('amt_taxable'); for ($k=0; $k < $count_two; $k++) { if(empty($sgst[$k])){ $sgst[$k] = '0.00'; } if(empty($cgst[$k])){ $cgst[$k] = '0.00'; } if(empty($ugst[$k])){ $ugst[$k] = '0.00'; } if(empty($kgst[$k])){ $kgst[$k] = '0.00'; } if(empty($discount_one[$k])){ $discount_one[$k] = '0.00'; } if(empty($discount_two[$k])){ $discount_two[$k] = '0.00'; } $ins_sub = array( 'fid' => $id, 's_ledger_name' => $s_ledger_name[$k], 'amt_taxable' => $amt_taxable[$k], ); $this->model->insertData('tbl_form_info', $ins_sub); } redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->office_form_data($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['items'] = $this->model->getDatamodel('tbl_item'); $this->load->view("webapp/office_user/edit_credit",$data); } } //end update credit note form //start add debit note form public function add_debit(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; /*$path = explode('/', $this->input->post('path')); $year = $path[2]; $m1 = explode('_',$path[3]); $month = $m1[1];*/ $year = $this->input->post('year'); $month = $this->input->post('month'); $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'release_status' => 'released', 'approve_status' => 'panding', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $count = count($this->input->post('s_ledger_name')); $amt_taxable = $this->input->post('amt_taxable'); $s_ledger_name = $this->input->post('s_ledger_name'); for ($i=0; $i < $count; $i++) { $ins_sub = array( 'fid' => $ins, 's_ledger_name' => $s_ledger_name[$i], 'amt_taxable' => $amt_taxable[$i] ); $this->model->insertData('tbl_form_info', $ins_sub); } $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /*$ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i] ); */ //$this->model->insertData('tbl_form_status', $ins_form_status); $ins_form_status = array( 'filled_status' => 'done' ); $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } //end add debit note form //start update debit note form public function update_debit($encrypted_id, $noti='NULL'){ if($this->input->post('save') == 'Save'){ //echo "<pre>"; print_r($_POST); die; $id = $this->model->decryptdata($encrypted_id); $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $check_date = date("Y-m-d", strtotime($this->input->post('check_date'))); $ins_main = array( 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'm_ledger_name' => $this->input->post('ledger_name_main'), 'trans_type' => $this->input->post('trans_type'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'ms_ledger' => $this->input->post('ms_ledger'), 'check_no' => $this->input->post('check_no'), 'check_date' => $check_date, 'l_noti' => 'unseen', 'release_status' => 'released' ); $where = array("fid" => $id); $ins = $this->model->UpdateData('tbl_form', $ins_main, $where); //Update in sub table $count1 = count($this->input->post('fi_id')); $fi_id = $this->input->post('fi_id'); $s_ledger_name_upd = $this->input->post('s_ledger_name_upd'); $amt_taxable_upd = $this->input->post('amt_taxable_upd'); //echo "<pre>"; print_r($amt_taxable_upd); die; for ($i=0; $i < $count1; $i++) { if(empty($edit_sgst[$i])){ $edit_sgst[$i] = '0.00'; } if(empty($edit_cgst[$i])){ $edit_cgst[$i] = '0.00'; } if(empty($edit_ugst[$i])){ $edit_ugst[$i] = '0.00'; } if(empty($edit_igst[$i])){ $edit_igst[$i] = '0.00'; } if(empty($edit_discount_one[$i])){ $edit_discount_one[$i] = '0.00'; } if(empty($edit_discount_two[$i])){ $edit_discount_two[$i] = '0.00'; } $upd_sub = array( 's_ledger_name' => $s_ledger_name_upd[$i], 'amt_taxable' => $amt_taxable_upd[$i], ); $where_sub_one = array('fi_id' => $fi_id[$i]); $this->model->UpdateData('tbl_form_info', $upd_sub, $where_sub_one); } //insert in sub table $count_two = count($this->input->post('s_ledger_name')); $s_ledger_name = $this->input->post('s_ledger_name'); $amt_taxable = $this->input->post('amt_taxable'); for ($k=0; $k < $count_two; $k++) { if(empty($sgst[$k])){ $sgst[$k] = '0.00'; } if(empty($cgst[$k])){ $cgst[$k] = '0.00'; } if(empty($ugst[$k])){ $ugst[$k] = '0.00'; } if(empty($kgst[$k])){ $kgst[$k] = '0.00'; } if(empty($discount_one[$k])){ $discount_one[$k] = '0.00'; } if(empty($discount_two[$k])){ $discount_two[$k] = '0.00'; } $ins_sub = array( 'fid' => $id, 's_ledger_name' => $s_ledger_name[$k], 'amt_taxable' => $amt_taxable[$k], ); $this->model->insertData('tbl_form_info', $ins_sub); } redirect('webapp/office/form_grid'); }else{ $id = $this->model->decryptdata($encrypted_id); $data['form'] = $this->model->office_form_data($id); //echo "<pre>"; print_r($data['form']); die; $stage = $data['form'][0]['stage']; $path = $data['form'][0]['path']; $cid = $data['form'][0]['cid']; $data['stage'] = $stage; $data['path'] = $path; $data['customer_id'] = $cid; $data['ledger'] = $this->model->getDatamodel('tbl_ledger'); $data['items'] = $this->model->getDatamodel('tbl_item'); $this->load->view("webapp/office_user/edit_debit",$data); } } //end update debit note form public function form_grid($offset=0){ $ses = $this->session->get_userdata(); $data['status'] = 'all'; if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $data['form'] = $this->model->getFormModel2($oid, $config['per_page'], $offset); //$data['form'] = $this->model->getFormModel2($oid); }else{ $cnt=count($this->model->getDatamodel('tbl_form')); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $data['form'] = $this->model->getFormModel($config['per_page'], $offset); //$data['form'] = $this->model->getFormModel(); //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $this->load->view("webapp/office_user/form",$data); } public function form_grid_aprv($offset=0){ $data['status'] = 'approved'; $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid, 'approve_status' => 'approved'); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid_aprv'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $sts = 'approved'; $data['form'] = $this->model->getFormModel2($oid, $config['per_page'], $offset, $sts); //$data['form'] = $this->model->getFormModel2($oid); }else{ $where = array('approve_status' => 'approved'); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid_aprv'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $sts = 'approved'; $data['form'] = $this->model->getFormModel($config['per_page'], $offset, $sts); //$data['form'] = $this->model->getFormModel(); //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $this->load->view("webapp/office_user/form",$data); } public function form_grid_panding($offset=0){ $data['status'] = 'panding'; $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid, 'approve_status' => 'panding', 'release_status !=' => 'error'); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid_panding'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $sts = 'panding'; $data['form'] = $this->model->getFormModel2($oid, $config['per_page'], $offset, $sts); //$data['form'] = $this->model->getFormModel2($oid); }else{ $where = array('approve_status' => 'panding', 'release_status' => 'released'); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid_panding'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $sts = 'panding'; $data['form'] = $this->model->getFormModel($config['per_page'], $offset, $sts); //$data['form'] = $this->model->getFormModel(); //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $this->load->view("webapp/office_user/form",$data); } public function form_grid_rejected($offset=0){ $data['status'] = 'rejected'; $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid, 'release_status' => 'error'); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid_panding'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $sts = 'error'; $data['form'] = $this->model->getFormModelRej2($oid, $config['per_page'], $offset, $sts); //$data['form'] = $this->model->getFormModel2($oid); }else{ $where = array('release_status' => 'error'); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid_panding'; $config['total_rows'] = $cnt; $config['per_page'] = 20; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $sts = 'error'; $data['form'] = $this->model->getFormModelRej($config['per_page'], $offset, $sts); //$data['form'] = $this->model->getFormModel(); //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $this->load->view("webapp/office_user/form",$data); } public function form_grid_date(){ $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid); $data['form'] = $this->model->getFormModelDate2($oid, $fdate, $tdate); $data['nopage'] = 'no'; $data['fdate'] = $fdate; $data['tdate'] = $tdate; //echo "<pre>"; print_r($data['form']); die; }else{ $data['form'] = $this->model->getFormModelDate($fdate, $tdate); $data['nopage'] = 'no'; $data['fdate'] = $fdate; $data['tdate'] = $tdate; //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $this->load->view("webapp/office_user/form",$data); } public function form_grid_custom(){ $src = $this->input->post('voucher_srch'); $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid); $data['form'] = $this->model->getFormModelCustom2($oid, $src); $data['nopage'] = 'no'; $data['src'] = $src; //echo "<pre>"; print_r($data['form']); die; }else{ $data['form'] = $this->model->getFormModelCustom($src); $data['nopage'] = 'no'; $data['src'] = $src; //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $this->load->view("webapp/office_user/form",$data); } public function grid_type($type, $offset=0){ /*if($type != 'all'){ $where = array('approve_status' => $type); $data = $this->model->DetailData('tbl_form', $where); }else{ $data = $this->model->getDataModel('tbl_form'); }*/ $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid, 'approve_status' => $type); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid'; $config['total_rows'] = $cnt; $config['per_page'] = 50; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $data['form'] = $this->model->getAjaxFormModel2($oid, $config['per_page'], $offset, $type); //$data['form'] = $this->model->getFormModel2($oid); }else{ $where = array('approve_status' => $type); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid'; $config['total_rows'] = $cnt; $config['per_page'] = 50; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $data['form'] = $this->model->getAjaxFormModel($config['per_page'], $offset, $type); //$data['form'] = $this->model->getFormModel(); } //echo "<pre>"; print_r($data['form']); die; } public function form_grid_json($offset=0){ $ses = $this->session->get_userdata(); if($ses['reg_info'][0]['type'] == 'office_user'){ $oid = $ses['reg_info'][0]['rid']; $where = array('oid' => $oid); $cnt=count($this->model->DetailData('tbl_form', $where)); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid'; $config['total_rows'] = $cnt; $config['per_page'] = 50; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $data['form'] = $this->model->getFormModel2($oid, $config['per_page'], $offset); //$data['form'] = $this->model->getFormModel2($oid); }else{ $cnt=count($this->model->getDatamodel('tbl_form')); $this->load->library('pagination'); $config['base_url'] = base_url().'webapp/office/form_grid'; $config['total_rows'] = $cnt; $config['per_page'] = 50; $config['full_tag_open'] = '<div class="pagination"><ul class="list-inline">'; $config['full_tag_close'] = '</ul></div>'; $config['first_link'] = '« First'; $config['first_tag_open'] = '<li class="prev page">'; $config['first_tag_close'] = '</li>'; $config['last_link'] = 'Last »'; $config['last_tag_open'] = '<li class="next page">'; $config['last_tag_close'] = '</li>'; $config['next_link'] = 'Next →'; $config['next_tag_open'] = '<li class="next page">'; $config['next_tag_close'] = '</li>'; $config['prev_link'] = '← Previous'; $config['prev_tag_open'] = '<li class="prev page">'; $config['prev_tag_close'] = '</li>'; $config['cur_tag_open'] = '<li class="active"><a href="">'; $config['cur_tag_close'] = '</a></li>'; $config['num_tag_open'] = '<li class="page">'; $config['num_tag_close'] = '</li>'; $this->pagination->initialize($config); //$this->db->order_by("cid", "desc"); $data['form'] = $this->model->getFormModel($config['per_page'], $offset); //$data['form'] = $this->model->getFormModel(); //echo "<pre>"; print_r($data['form']); die; } //echo "<pre>"; print_r($data['form']); die; $data_form = $data['form']; $html = ''; foreach ($data_form as $val) { $encrypted_id = $this->model->encryptdata($val['fid']); $date = date("d-m-Y", strtotime($val['m_date'])); $as = $val['approve_status']; if($as == 'panding'){ $as2 = '<span class="label label-danger text-capitalize">'.$as.'</span>'; }else{ $as2 = '<span class="label label-success text-capitalize">'.$as.'</span>'; } $cust = $val['cname']."<br><strong class='text-danger'>".$val['stage']."</strong>"; $stage = $val['stage']; if($stage == 'contra'){ $url = base_url().'webapp/office/update_contra/'.$encrypted_id; }elseif($stage == 'receipt'){ $url = base_url().'webapp/office/update_receipt/'.$encrypted_id; }elseif($stage == 'payment'){ $url = base_url().'webapp/office/update_payment/'.$encrypted_id; }elseif($stage == 'journal'){ $url = base_url().'webapp/office/update_journal/'.$encrypted_id; }elseif($stage == 'credit'){ $url = base_url().'webapp/office/update_credit/'.$encrypted_id; }elseif($stage == 'debit'){ $url = base_url().'webapp/office/update_debit/'.$encrypted_id; }else{ $url = base_url().'webapp/office/update_form/'.$encrypted_id; } if($as != 'approved'){ $upd = '<a href='.$url.' class="btn btn-info" data-toggle="tooltip" data-placement="top" title="Update"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> </a>'; }else{ $upd=''; } if($ses['reg_info'][0]['type'] == 'admin' && $val['approve_status'] != 'approved'){ $del = '<a onclick="" href="'.base_url().'webapp/office/trash_form/'.$encrypted_id.'" class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="Delete"><i class="fa fa-trash" aria-hidden="true"></i></a>'; }else{ $del = ''; } if($as == 'approved'){ $xml = '<a data-toggle="tooltip" data-placement="top" title="Generate XML" class="btn btn-primary" href="'.base_url().'webapp/office/xml/'.$encrypted_id.'"> <i class="fa fa-file" aria-hidden="true"></i> </a>'; }else{ $xml = ''; } $html .= '<tr> <td> <input type="checkbox" name="ck" class="minimal-red" value="' . $val['fid'] . '"> </td> <td>'.$date.'<br><strong class="text-danger">Released By '.$val['name'].'</strong></td> <td>'.$as2.'</td> <td class="text-capitalize">'.$cust.'</td> <td>'.$val['voucher_no'].'</td> <td>'.$val['amt_gross'].'</td> <td>'.$upd." ".$del." ".$xml.'</td> </tr> '; } /*$resultArrauy['status'] = 'Success'; $resultArrauy['html'] = $html; $resultArrauy['pagination'] = $this->pagination->create_links(); echo json_encode($resultArrauy);*/ //echo $html; echo json_encode($html); // $this->load->view("webapp/office_user/form",$data); } public function viewForm($encrypted_id){ $id = $this->model->decryptdata($encrypted_id); $where = array('fid' => $id); $data['form'] = $this->model->DetailData('tbl_form', $where); $stage = $data['form'][0]['stage']; $voucher_type = $data['form'][0]['voucher_type']; //echo "<pre>"; print_r($data['form']); die; $noti = array('l_noti' => 'seen'); $this->model->UpdateData('tbl_form', $noti, $where); if($stage == 'contra'){ $data['frm'] = $this->model->office_form_contra($id); $this->load->view("webapp/office_user/view_form_contra",$data); }elseif($stage == 'receipt'){ $data['frm'] = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_receipt",$data); }elseif($stage == 'payment'){ $data['frm'] = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_payment",$data); }elseif($stage == 'journal'){ $data['frm'] = $this->model->office_form_journal($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_journal",$data); }elseif($stage == 'credit'){ $data['frm'] = $this->model->of_cr($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_credit",$data); }elseif($stage == 'debit'){ $data['frm'] = $this->model->of_cr($id); $this->load->view("webapp/office_user/view_form_debit",$data); }elseif($stage == 'cheque_reg'){ $data['voucher_type'] = $voucher_type; if($voucher_type == 'payment'){ $data['frm'] = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_payment",$data); }else{ $data['frm'] = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_receipt",$data); } }elseif($stage == 'bank'){ $data['voucher_type'] = $voucher_type; if($voucher_type == 'payment'){ $data['frm'] = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_payment",$data); }elseif($voucher_type == 'receipt'){ $data['frm'] = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form_receipt",$data); }else{ $data['frm'] = $this->model->office_form_contra($id); $this->load->view("webapp/office_user/view_form_contra",$data); } }else{ $data['frm'] = $this->model->sales_form_data($id); $form2 = $this->model->salesModel($id); $info_cnt = count($form2); $form3 = $this->model->salesExpenseModel($id); //echo "<pre>"; print_r($form3); $info_cnt2 = count($form3); $tot_g_sgst = 0; $tot_g_cgst = 0; $tot_g_ugst = 0; $tot_g_igst = 0; for ($g=0; $g < $info_cnt2; $g++) { //foreach ($form3 as $gst => $g) { $gamt = $form3[$g]['ex_amount']; $g_sgst = $form3[$g]['sgst']; $g_cgst = $form3[$g]['cgst']; $g_ugst = $form3[$g]['ugst']; $g_igst = $form3[$g]['igst']; if($g_sgst != '0.00'){ $g_sgst_payble = $gamt*$g_sgst/100; //echo "--payble sgst<br>"; $tot_g_sgst += $g_sgst_payble; } if($g_cgst != '0.00'){ $g_cgst_payble = $gamt*$g_cgst/100; //echo "--payble cgst<br>"; $tot_g_cgst += $g_cgst_payble; } if($g_ugst != '0.00'){ $g_ugst_payble = $gamt*$g_ugst/100; //echo "--payble ugst<br>"; $tot_g_ugst += $g_ugst_payble; } if($g_igst != '0.00'){ $g_igst_payble = $gamt*$g_igst/100; //echo "--payble cgst<br>"; $tot_g_igst += $g_igst_payble; } } $tot_g_sgst; $tot_g_cgst; $tot_g_ugst; $tot_g_igst; $tsgst = 0; $tcgst = 0; $tugst = 0; $tigst = 0; foreach ($form2 as $total => $tot) { $sgst = $tot['s_aot']; $cgst = $tot['c_aot']; $ugst = $tot['u_aot']; $igst = $tot['i_aot']; $tsgst+=$sgst; $tcgst+=$cgst; $tugst+=$ugst; $tigst+=$igst; } $tsgst; $tcgst; $tugst; $tigst; $data['tsgst'] = $tsgst+$tot_g_sgst; $data['tcgst'] = $tcgst+$tot_g_cgst; $data['tugst'] = $tugst+$tot_g_ugst; $data['tigst'] = $tigst+$tot_g_igst; //echo "<pre>"; print_r($data['frm']); die; $this->load->view("webapp/office_user/view_form",$data); } } public function removeInfo($fiid){ $where = array('fi_id' => $fiid); $this->model->DeleteData('tbl_form_info', $where); $this->model->DeleteData('tbl_other_expens', $where); } public function removeDebitInfo($fiid){ $where = array('fi_id' => $fiid); $this->model->DeleteData('tbl_form_info', $where); } public function removeExp($eid){ $where = array('eid' => $eid); $this->model->DeleteData('tbl_other_expens', $where); } public function uploadNoti($uid){ $where = array('uid' => $uid); $data = array('status' => 'seen'); $this->model->UpdateData('tbl_cust_uploads', $data, $where); } public function trash_form($fid){ $id = $this->model->decryptdata($fid); $where = array('fid' => $id); $this->model->DeleteData('tbl_form', $where); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Form has been deleted. </div>'); redirect('webapp/office/form_grid'); } public function export(){ $this->load->dbutil(); $sql = "select * from tbl_access"; $query = $this->db2->query($sql); $config = array ( 'root' => 'root', 'element' => 'element', 'newline' => "\n", 'tab' => "\t" ); $xml = $this->dbutil->xml_from_result($query, $config); $this->load->helper('file'); $file_name = './documents/myfile.xml'; write_file($file_name, $xml); // Optionally redirect to the file you (hopefully) just created redirect($file_name); } public function xml($id){ $eight_randnum = rand(11111111,99999999); $fid = $this->model->decryptdata($id); $where = array('fid' => $fid); $form = $this->model->DetailData('tbl_form', $where); $stage = $form[0]['stage']; if($stage == 'sales'){ $this->xml_sales($fid, $eight_randnum); }elseif($stage == 'contra'){ $this->xml_contra($fid, $eight_randnum); }elseif($stage == 'receipt'){ $this->xml_receipt($fid, $eight_randnum); }elseif($stage == 'journal'){ $this->xml_journal($fid, $eight_randnum); }elseif($stage == 'payment'){ $this->xml_payment($fid, $eight_randnum); }elseif($stage == 'credit'){ $this->xml_credit($fid, $eight_randnum); }elseif($stage == 'debit'){ $this->xml_debit($fid, $eight_randnum); }elseif($stage == 'purchase'){ $this->xml_purchase($fid, $eight_randnum); }elseif($stage == 'cheque_reg'){ $voucher_type = $form[0]['voucher_type']; if($voucher_type == 'payment'){ $this->xml_payment($fid, $eight_randnum); }else{ $this->xml_receipt($fid, $eight_randnum); } }elseif($stage == 'bank'){ $voucher_type = $form[0]['voucher_type']; if($voucher_type == 'payment'){ $this->xml_payment($fid, $eight_randnum); }elseif($voucher_type == 'receipt'){ $this->xml_receipt($fid, $eight_randnum); }else{ $this->xml_contra($fid, $eight_randnum); } } } public function xml2($id){ $fid = $this->model->decryptdata($id); $where = array('fid' => $fid); $form = $this->model->DetailData('tbl_form', $where); $subform = $this->model->DetailData('tbl_form_info', $where); $xml = new SimpleXMLElement('<xml/>'); foreach ($form as $key => $value) { $track = $xml->addChild('form'); $track->addChild('STAGE', $value['stage']); $track->addChild('YEAR', $value['year']); $track->addChild('MONTH', $value['month']); $track->addChild('DATE', $value['m_date']); $track->addChild('VOUCHERNO', $value['voucher_no']); $track->addChild('REFNO', $value['ref_no']); $track->addChild('LEDGERNAME', $value['m_ledger_name']); $track->addChild('EFFECT', $value['m_effect']); $track->addChild('GROSSAMT', $value['amt_gross']); } foreach ($subform as $key2 => $value2) { $track = $xml->addChild('block'); $track->addChild('s_ledger_name', $value2['s_ledger_name']); $track->addChild('s_effect', $value2['s_effect']); $track->addChild('discount_one', $value2['discount_one']); $track->addChild('amt_taxable', $value2['amt_taxable']); $track->addChild('sgst', $value2['sgst']); $track->addChild('s_aot', $value2['s_aot']); $track->addChild('cgst', $value2['cgst']); $track->addChild('c_aot', $value2['c_aot']); $track->addChild('ugst', $value2['ugst']); $track->addChild('u_aot', $value2['u_aot']); $track->addChild('igst', $value2['igst']); $track->addChild('i_aot ', $value2['i_aot']); $track->addChild('cess_code', $value2['cess_code']); $track->addChild('discount_two', $value2['discount_two']); $track->addChild('item_name', $value2['item_name']); $track->addChild('qty', $value2['qty']); $track->addChild('rate', $value2['rate']); $track->addChild('unit', $value2['unit']); $track->addChild('lot_no', $value2['lot_no']); $track->addChild('lot_mfg_date', $value2['lot_mfg_date']); $track->addChild('lot_exp_date', $value2['lot_exp_date']); $track->addChild('test', ' '); } Header('Content-type: text/xml'); print($xml->asXML()); } public function xml3($id){ $fid = $this->model->decryptdata($id); $where = array('fid' => $fid); $form = $this->model->DetailData('tbl_form', $where); //echo "<pre>"; print_r($form); die; $path = $form[0]['path']; $p = substr($path, 0, strrpos( $path, '/')); $n = substr($path, strrpos($path, '/') + 1); $n = explode('.', $n); $n = $n[0]; $ins = array('xml' => '1'); $this->model->UpdateData('tbl_form', $ins, $where); $this->load->dbutil(); $sql = "SELECT tbl_form.fid as FORMID, cid as CATID, oid as OID, stage as STAGE, year as YEAR, month as MONTH, m_date as DATE, voucher_no as VOUCHERNO, ref_no as REFFERENCE, m_ledger_name as LEDGERNAME, m_effect as EFFECT, amt_gross as GROSSAMT, s_ledger_name as SUBLEDGER, s_effect as EFFECT, discount_one as DISCOUNT_ONE, amt_taxable as TAXABLEAMT, sgst AS SGST, s_aot as SGSTTAX, cgst as CGST, c_aot as CGSTTAX, ugst AS UGST, u_aot AS UGSTTAX, igst as IGST, i_aot as IGSTTAX, cess_code as CESS, discount_two as DISCOUNT_TWO, item_name as ITEAMNAME, qty as QUANTITY, rate as RATE, unit as UNIT, lot_no as LOTNO, lot_mfg_date as MFGDATE, lot_exp_date as EXPDATE FROM tbl_form LEFT JOIN tbl_form_info ON tbl_form_info.fid=tbl_form.fid WHERE tbl_form.fid=$fid"; $query = $this->db2->query($sql); $config = array ( 'root' => 'BODY', 'element' => 'IMPORTDATA', 'newline' => "\n", 'tab' => "\t" ); //echo "<pre>"; print_r($sql); die; $xml = $this->dbutil->xml_from_result($query, $config); $this->load->helper('file'); $file_name = './'.$p.'/'.$fid.'_'.$n.'.xml'; write_file($file_name, $xml); // Optionally redirect to the file you (hopefully) just created //redirect($file_name); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> XML has been Generated. </div>'); redirect('webapp/office/form_grid'); } public function excel(){ $current=date("d-M-y"); $this->load->library('excel'); $this->excel->getActiveSheet()->setCellValue('Z1', 'AVAILABILITY'); $this->excel->setActiveSheetIndex(0); $this->excel->getActiveSheet()->setTitle('Export Information'); $this->excel->getActiveSheet()->setCellValue('A1', 'Date'); $this->excel->getActiveSheet()->setCellValue('B1', 'Voucher No.'); $this->excel->getActiveSheet()->setCellValue('C1', 'Day'); $this->excel->getActiveSheet()->setCellValue('D1', 'Month'); $this->excel->getActiveSheet()->setCellValue('E1', 'Reference No.'); $this->excel->getActiveSheet()->setCellValue('F1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('G1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('H1', 'Amount'); $this->excel->getActiveSheet()->setCellValue('I1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('J1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('K1', 'Amount'); $this->excel->getActiveSheet()->setCellValue('L1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('M1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('N1', 'Amount'); $this->excel->getActiveSheet()->setCellValue('O1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('P1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('Q1', 'Amount'); $this->excel->getActiveSheet()->setCellValue('R1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('S1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('T1', 'Amount'); $this->excel->getActiveSheet()->setCellValue('U1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('V1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('W1', 'Amount'); $this->excel->getActiveSheet()->setCellValue('X1', 'Ledger Name'); $this->excel->getActiveSheet()->setCellValue('Y1', 'Effect'); $this->excel->getActiveSheet()->setCellValue('Z1', 'Amount'); $data2['view2']=$this->model->getExcelData(); //echo "<pre>"; print_r($data2['view2']); die; $data = $data2['view2']; $this->excel->getActiveSheet()->fromArray($data, NULL, 'A2'); $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('C1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('D1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('E1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('F1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('G1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('H1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('I1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('J1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('K1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('L1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('M1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('N1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('O1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('P1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('Q1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('R1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('S1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('T1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('U1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('V1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('W1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('X1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('Y1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('Z1')->getFont()->setBold(true); $this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $filename=$current.'_Export_Information.xls'; /* $explod=explode("_",$filename); $file=$explod[0]; $file1=$explode[1]; */ header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="'.$filename.'"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); $objWriter->save('php://output'); } //functions for XML public function xml_sales($fid, $eight_randnum){ //$where = array('fid' => $fid); //$form = $this->model->DetailData('tbl_form', $where); $form = $this->model->sm($fid); $note_two = $form[0]['note_two']; if($note_two == 'form_two'){ $this->xml_sales_two($fid, $eight_randnum); } $form2 = $this->model->salesModel($fid); $form3 = $this->model->salesExpenseModel($fid); $info_cnt = count($form2); $info_cnt2 = count($form3); //echo "<pre>"; print_r($form3); die; $tot_g_sgst = 0; $tot_g_cgst = 0; $tot_g_ugst = 0; $tot_g_igst = 0; for ($g=0; $g < $info_cnt2; $g++) { //foreach ($form3 as $gst => $g) { $gamt = $form3[$g]['ex_amount']; $g_sgst = $form3[$g]['sgst']; $g_cgst = $form3[$g]['cgst']; $g_ugst = $form3[$g]['ugst']; $g_igst = $form3[$g]['igst']; if($g_sgst != '0.00'){ $g_sgst_payble = $gamt*$g_sgst/100; //echo "--payble sgst<br>"; $tot_g_sgst += $g_sgst_payble; } if($g_cgst != '0.00'){ $g_cgst_payble = $gamt*$g_cgst/100; //echo "--payble cgst<br>"; $tot_g_cgst += $g_cgst_payble; } if($g_ugst != '0.00'){ $g_ugst_payble = $gamt*$g_ugst/100; //echo "--payble ugst<br>"; $tot_g_ugst += $g_ugst_payble; } if($g_igst != '0.00'){ $g_igst_payble = $gamt*$g_igst/100; //echo "--payble cgst<br>"; $tot_g_igst += $g_igst_payble; } } $tot_g_sgst; $tot_g_cgst; $tot_g_ugst; $tot_g_igst; $all_gst_tot = $tot_g_sgst+$tot_g_cgst+$tot_g_ugst+$tot_g_igst; // sum of same other expenses $result = array(); foreach($form3 as $k => $v) { $id = $v['ex_name']; $result[$id][] = $v['ex_amount']; } $other_expense = array(); foreach($result as $key => $value) { $where_exp = array('eid' => $key); $i_name = $this->model->DetailData('tbl_expense', $where_exp); $in = $i_name[0]['ename']; $other_expense[] = array('ex_name' => $key, 'ex_amount' => array_sum($value), 'iname' => $in); } //echo '<pre>'; print_r($other_expense); // sum of same other expenses $oecnt = count($other_expense); //die; $tsgst = 0; $tcgst = 0; $tugst = 0; $tigst = 0; foreach ($form2 as $total => $tot) { $sgst = $tot['s_aot']; $cgst = $tot['c_aot']; $ugst = $tot['u_aot']; $igst = $tot['i_aot']; $tsgst+=$sgst; $tcgst+=$cgst; $tugst+=$ugst; $tigst+=$igst; } /*echo $tsgst."s<br>"; echo $tcgst."c<br>"; echo $tugst."u<br>"; echo $tigst; die; */ $frm = $this->model->sales_form_data($fid); $amt_gross = $frm[0]['amt_gross']; $new_tot_expns = 0; $amt_tax = 0; foreach ($frm as $key => $tot) { $expns = $tot['expenses']; $amt_taxable = $tot['amt_taxable']; $tot_expns = 0; if($expns != ''){ foreach ($expns as $tt => $t) { $newtt = $t['ex_amount']; $tot_expns+=$newtt; } }else{ $tot_expns = 0; } $new_tot_expns+=$tot_expns; $amt_tax+=$amt_taxable; } $new_tot_expns; $amt_tax; $tot_tax = $tsgst+$tcgst+$tugst+$tigst; $totcredit = $new_tot_expns+$tot_tax+$amt_tax+$all_gst_tot; /*echo $amt_gross."<br>"; echo $totcredit; die; */ $diff_amt = round(abs($amt_gross - $totcredit),2); $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($form[0]['date_time'])); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['l_name']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; if($amt_gross < $totcredit){ $amt_gross = $amt_gross + $diff_amt; }else{ $amt_gross = $amt_gross; } // Set the content type to be XML, so that the browser will recognise it as XML. header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Invoice Voucher View"); $adrs_list = $xml->createElement("ADDRESS.LIST", " "); $adrs_list->setAttribute("TYPE", "String"); $adrs = $xml->createElement("ADDRESS", "Gujarat, India"); $basic_buy_list = $xml->createElement("BASICBUYERADDRESS.LIST", " "); $basic_buy_list->setAttribute("TYPE", "String"); $basic_buy_adrs = $xml->createElement("BASICBUYERADDRESS", "Gujarat, India"); $OLDAUDITENTRYIDS_list = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_list->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $DATE = $xml->createElement("DATE", "".$m_date.""); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $STATENAME = $xml->createElement("STATENAME", "Gujarat"); $COUNTRYOFRESIDENCE = $xml->createElement("COUNTRYOFRESIDENCE", "India"); $PARTYNAME = $xml->createElement("PARTYNAME", "".$m_ledger_name.""); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $BASICBASEPARTYNAME = $xml->createElement("BASICBASEPARTYNAME", "".$m_ledger_name.""); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Invoice Voucher View"); $PLACEOFSUPPLY = $xml->createElement("PLACEOFSUPPLY", "Gujarat"); $BASICBUYERNAME = $xml->createElement("BASICBUYERNAME", "".$m_ledger_name.""); $BASICDATETIMEOFINVOICE = $xml->createElement("BASICDATETIMEOFINVOICE", "".$basic_date_time.""); $BASICDATETIMEOFREMOVAL = $xml->createElement("BASICDATETIMEOFREMOVAL", "".$basic_date_time.""); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $CONSIGNEESTATENAME = $xml->createElement("CONSIGNEESTATENAME", "Gujarat"); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $AUDITED = $xml->createElement("AUDITED", "No"); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $IGNOREPOSVALIDATION = $xml->createElement("IGNOREPOSVALIDATION", "No"); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $ISVATPAIDATCUSTOMS = $xml->createElement("ISVATPAIDATCUSTOMS", "No"); $ISDECLAREDTOCUSTOMS = $xml->createElement("ISDECLAREDTOCUSTOMS", "No"); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $IGNOREGSTINVALIDATION = $xml->createElement("IGNOREGSTINVALIDATION", "No"); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $ISBOENOTAPPLICABLE = $xml->createElement("ISBOENOTAPPLICABLE", "No"); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $ISOVERSEASTOURISTTRANS = $xml->createElement("ISOVERSEASTOURISTTRANS", "No"); $ISDESIGNATEDZONEPARTY = $xml->createElement("ISDESIGNATEDZONEPARTY", "No"); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "No"); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $ISINVOICE = $xml->createElement("ISINVOICE", "Yes"); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "Yes"); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $ISVOID = $xml->createElement("ISVOID", "No"); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $ISDELETED = $xml->createElement("ISDELETED", "No"); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $ALTERID = $xml->createElement("ALTERID", "29"); $MASTERID = $xml->createElement("MASTERID", "14"); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066560"); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $EWAYBILLDETAILS_LIST = $xml->createElement("EWAYBILLDETAILS.LIST", " "); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $VOUCHER->appendChild($adrs_list); $adrs_list->appendChild($adrs); $VOUCHER->appendChild($basic_buy_list); $basic_buy_list->appendChild($basic_buy_adrs); $VOUCHER->appendChild($OLDAUDITENTRYIDS_list); $OLDAUDITENTRYIDS_list->appendChild($OLDAUDITENTRYIDS); $VOUCHER->appendChild($DATE); $VOUCHER->appendChild($GUID); $VOUCHER->appendChild($STATENAME); $VOUCHER->appendChild($COUNTRYOFRESIDENCE); $VOUCHER->appendChild($PARTYNAME); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHER->appendChild($VOUCHERNUMBER); $VOUCHER->appendChild($PARTYLEDGERNAME); $VOUCHER->appendChild($BASICBASEPARTYNAME); $VOUCHER->appendChild($CSTFORMISSUETYPE); $VOUCHER->appendChild($CSTFORMRECVTYPE); $VOUCHER->appendChild($FBTPAYMENTTYPE); $VOUCHER->appendChild($PERSISTEDVIEW); $VOUCHER->appendChild($PLACEOFSUPPLY); $VOUCHER->appendChild($BASICBUYERNAME); $VOUCHER->appendChild($BASICDATETIMEOFINVOICE); $VOUCHER->appendChild($BASICDATETIMEOFREMOVAL); $VOUCHER->appendChild($VCHGSTCLASS); $VOUCHER->appendChild($CONSIGNEESTATENAME); $VOUCHER->appendChild($DIFFACTUALQTY); $VOUCHER->appendChild($ISMSTFROMSYNC); $VOUCHER->appendChild($ASORIGINAL); $VOUCHER->appendChild($AUDITED); $VOUCHER->appendChild($FORJOBCOSTING); $VOUCHER->appendChild($ISOPTIONAL); $VOUCHER->appendChild($EFFECTIVEDATE); $VOUCHER->appendChild($USEFOREXCISE); $VOUCHER->appendChild($ISFORJOBWORKIN); $VOUCHER->appendChild($ALLOWCONSUMPTION); $VOUCHER->appendChild($USEFORINTEREST); $VOUCHER->appendChild($USEFORGAINLOSS); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $VOUCHER->appendChild($USEFORCOMPOUND); $VOUCHER->appendChild($USEFORSERVICETAX); $VOUCHER->appendChild($ISEXCISEVOUCHER); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $VOUCHER->appendChild($IGNOREPOSVALIDATION); $VOUCHER->appendChild($EXCISEOPENING); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $VOUCHER->appendChild($ISVATOVERRIDDEN); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $VOUCHER->appendChild($ISVATPAIDATCUSTOMS); $VOUCHER->appendChild($ISDECLAREDTOCUSTOMS); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $VOUCHER->appendChild($ISISDVOUCHER); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $VOUCHER->appendChild($GSTNOTEXPORTED); $VOUCHER->appendChild($IGNOREGSTINVALIDATION); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $VOUCHER->appendChild($ISBOENOTAPPLICABLE); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $VOUCHER->appendChild($ISOVERSEASTOURISTTRANS); $VOUCHER->appendChild($ISDESIGNATEDZONEPARTY); $VOUCHER->appendChild($ISCANCELLED); $VOUCHER->appendChild($HASCASHFLOW); $VOUCHER->appendChild($ISPOSTDATED); $VOUCHER->appendChild($USETRACKINGNUMBER); $VOUCHER->appendChild($ISINVOICE); $VOUCHER->appendChild($MFGJOURNAL); $VOUCHER->appendChild($HASDISCOUNTS); $VOUCHER->appendChild($ASPAYSLIP); $VOUCHER->appendChild($ISCOSTCENTRE); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $VOUCHER->appendChild($ISBLANKCHEQUE); $VOUCHER->appendChild($ISVOID); $VOUCHER->appendChild($ISONHOLD); $VOUCHER->appendChild($ORDERLINESTATUS); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VOUCHER->appendChild($VATISPURCEXEMPTED); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $VOUCHER->appendChild($ISVATDUTYPAID); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $VOUCHER->appendChild($ISDELETED); $VOUCHER->appendChild($CHANGEVCHMODE); $VOUCHER->appendChild($ALTERID); $VOUCHER->appendChild($MASTERID); $VOUCHER->appendChild($VOUCHERKEY); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $VOUCHER->appendChild($AUDITENTRIES_LIST); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $VOUCHER->appendChild($EWAYBILLDETAILS_LIST); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //star for debit ledger $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$m_ledger_name.""); $GSTCLASSdl = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "Yes"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$amt_gross.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $bill_name = $xml->createElement("NAME", "".$voucher_no.""); $bill_type = $xml->createElement("BILLTYPE", "New Ref"); $bill_tds = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $bill_amount = $xml->createElement("AMOUNT", "-".$amt_gross.""); $bill_interest = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $bill_stcat = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST->appendChild($bill_name); $BILLALLOCATIONS_LIST->appendChild($bill_type); $BILLALLOCATIONS_LIST->appendChild($bill_tds); $BILLALLOCATIONS_LIST->appendChild($bill_amount); $BILLALLOCATIONS_LIST->appendChild($bill_interest); $BILLALLOCATIONS_LIST->appendChild($bill_stcat); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASSdl); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); //end for debit ledger //star for other expenses ledger for ($oe=0; $oe < $oecnt; $oe++) { $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$other_expense[$oe]['iname'].""); $GSTCLASS_oe = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$other_expense[$oe]['ex_amount'].""); $VATEXPAMOUNT_LE = $xml->createElement("VATEXPAMOUNT", "".$other_expense[$oe]['ex_amount'].""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_oe); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for other expenses ledger if($amt_gross > $totcredit){ // Start of Round of $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "Round Amount"); $GSTCLASS_oe = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$diff_amt.""); $VATEXPAMOUNT_LE = $xml->createElement("VATEXPAMOUNT", "".$diff_amt.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_oe); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); // End of Round of } //star for CGST ledger if($tcgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_Ca = $xml->createElement("ROUNDTYPE", ""); $GSTCLASS_c = $xml->createElement("GSTCLASS", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "CGST"); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$tcgst+$tot_g_cgst.""); $VATEXPAMOUNT_C = $xml->createElement("VATEXPAMOUNT", "".$tcgst+$tot_g_cgst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_Ca); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_c); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_C); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for CGST ledger //star for SGST ledger if($tsgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_S = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "SGST"); $GSTCLASS_s = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$tsgst+$tot_g_sgst.""); $AMOUNT_S = $xml->createElement("VATEXPAMOUNT", "".$tsgst+$tot_g_sgst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_S); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_s); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_S); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for SGST ledger //star for UGST ledger if($tugst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_U = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "UGST"); $GSTCLASS_u = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$tugst+$tot_g_ugst.""); $AMOUNT_U = $xml->createElement("VATEXPAMOUNT", "".$tugst+$tot_g_ugst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_U); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_u); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_U); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for UGST ledger //star for IGST ledger if($tigst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_I = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "IGST"); $GSTCLASS_i = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$tigst+$tot_g_igst.""); $AMOUNT_I = $xml->createElement("VATEXPAMOUNT", "".$tigst+$tot_g_igst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_I); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_i); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_I); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for IGST ledger for ($inv=0; $inv < $info_cnt; $inv++) { $item_name = $form2[$inv]['item']; $rate = $form2[$inv]['rate']; $discount = $form2[$inv]['discount_two']; $amount = $form2[$inv]['amt_taxable']; $qty = $form2[$inv]['qty']; $s_ledger_name = $form2[$inv]['l_name']; $ALLINVENTORYENTRIES_LIST = $xml->createElement("ALLINVENTORYENTRIES.LIST", " "); $STOCKITEMNAME = $xml->createElement("STOCKITEMNAME", "".$item_name.""); $ISDEEMEDPOSITIVE_LE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ISLASTDEEMEDPOSITIVE_LE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISAUTONEGATE = $xml->createElement("ISAUTONEGATE", "No"); $ISCUSTOMSCLEARANCE = $xml->createElement("ISCUSTOMSCLEARANCE", "No"); $ISTRACKCOMPONENT = $xml->createElement("ISTRACKCOMPONENT", "No"); $ISTRACKPRODUCTION = $xml->createElement("ISTRACKPRODUCTION", "No"); $ISPRIMARYITEM = $xml->createElement("ISPRIMARYITEM", "No"); $ISSCRAP = $xml->createElement("ISSCRAP", "No"); $RATE = $xml->createElement("RATE", "".$rate.""); $DISCOUNT = $xml->createElement("DISCOUNT", "".$discount.""); $AMOUNT = $xml->createElement("AMOUNT", "".$amount.""); $ACTUALQTY_AE = $xml->createElement("ACTUALQTY", "".$qty.""); $BILLEDQTY_AE = $xml->createElement("BILLEDQTY", "".$qty.""); $BATCHALLOCATIONS_LIST = $xml->createElement("BATCHALLOCATIONS.LIST", " "); $GODOWNNAME = $xml->createElement("GODOWNNAME", "Main Location"); $BATCHNAME = $xml->createElement("BATCHNAME", "Primary Batch"); $INDENTNO = $xml->createElement("INDENTNO", ""); $ORDERNO = $xml->createElement("ORDERNO", ""); $TRACKINGNUMBER = $xml->createElement("TRACKINGNUMBER", ""); $DYNAMICCSTISCLEARED = $xml->createElement("DYNAMICCSTISCLEARED", "No"); $AMOUNT_ba = $xml->createElement("AMOUNT", "".$amount.""); $ACTUALQTY = $xml->createElement("ACTUALQTY", "".$qty.""); $BILLEDQTY = $xml->createElement("BILLEDQTY", "".$qty.""); $ADDITIONALDETAILS_LIST = $xml->createElement("ADDITIONALDETAILS.LIST", " "); $VOUCHERCOMPONENTLIST_LIST = $xml->createElement("VOUCHERCOMPONENTLIST.LIST", " "); $ACCOUNTINGALLOCATIONS_LIST = $xml->createElement("ACCOUNTINGALLOCATIONS.LIST", " "); $OLDAUDITENTRYIDS_LIST_AIE = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_AIE->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_AIE = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME_AIE = $xml->createElement("LEDGERNAME", "".$s_ledger_name.""); $GSTCLASS_AIE = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE_AIE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM_AIE = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES_AIE = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER_AIE = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE_AIE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED_AIE = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED_AIE = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_AIE = $xml->createElement("AMOUNT", "".$amount.""); $SERVICETAXDETAILS_LIST_AIE = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_AIE = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST_AIE = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST_AIE = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AIE = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AIE = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AIE = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AIE = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_AIE1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST_AIE = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST_AL = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST_AIE = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST_AIE = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST_AIE = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST_AIE = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST_AIE1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST_AIE = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST_AIE = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST_AIE = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST_AIE1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST_AIE = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_AIE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST_AIE = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $DUTYHEADDETAILS_LIST_AIE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $SUPPLEMENTARYDUTYHEADDETAILS_LIST_AIE = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST_AIE = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST_AIE = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $EXCISEALLOCATIONS_LIST_AIE = $xml->createElement("EXCISEALLOCATIONS.LIST", " "); $EXPENSEALLOCATIONS_LIST_AIE = $xml->createElement("EXPENSEALLOCATIONS.LIST", " "); $VOUCHER->appendChild($ALLINVENTORYENTRIES_LIST); $ALLINVENTORYENTRIES_LIST->appendChild($STOCKITEMNAME); $ALLINVENTORYENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE_LE); $ALLINVENTORYENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE_LE); $ALLINVENTORYENTRIES_LIST->appendChild($ISAUTONEGATE); $ALLINVENTORYENTRIES_LIST->appendChild($ISCUSTOMSCLEARANCE); $ALLINVENTORYENTRIES_LIST->appendChild($ISTRACKCOMPONENT); $ALLINVENTORYENTRIES_LIST->appendChild($ISTRACKPRODUCTION); $ALLINVENTORYENTRIES_LIST->appendChild($ISPRIMARYITEM); $ALLINVENTORYENTRIES_LIST->appendChild($ISSCRAP); $ALLINVENTORYENTRIES_LIST->appendChild($RATE); $ALLINVENTORYENTRIES_LIST->appendChild($DISCOUNT); $ALLINVENTORYENTRIES_LIST->appendChild($AMOUNT); $ALLINVENTORYENTRIES_LIST->appendChild($ACTUALQTY_AE); $ALLINVENTORYENTRIES_LIST->appendChild($BILLEDQTY_AE); $ALLINVENTORYENTRIES_LIST->appendChild($BATCHALLOCATIONS_LIST); $BATCHALLOCATIONS_LIST->appendChild($GODOWNNAME); $BATCHALLOCATIONS_LIST->appendChild($BATCHNAME); $BATCHALLOCATIONS_LIST->appendChild($INDENTNO); $BATCHALLOCATIONS_LIST->appendChild($ORDERNO); $BATCHALLOCATIONS_LIST->appendChild($TRACKINGNUMBER); $BATCHALLOCATIONS_LIST->appendChild($DYNAMICCSTISCLEARED); $BATCHALLOCATIONS_LIST->appendChild($AMOUNT_ba); $BATCHALLOCATIONS_LIST->appendChild($ACTUALQTY); $BATCHALLOCATIONS_LIST->appendChild($BILLEDQTY); $BATCHALLOCATIONS_LIST->appendChild($ADDITIONALDETAILS_LIST); $BATCHALLOCATIONS_LIST->appendChild($VOUCHERCOMPONENTLIST_LIST); $ALLINVENTORYENTRIES_LIST->appendChild($ACCOUNTINGALLOCATIONS_LIST); $ACCOUNTINGALLOCATIONS_LIST->appendChild($OLDAUDITENTRYIDS_LIST_AIE); $OLDAUDITENTRYIDS_LIST_AIE->appendChild($OLDAUDITENTRYIDS_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($LEDGERNAME_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($GSTCLASS_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISDEEMEDPOSITIVE_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($LEDGERFROMITEM_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($REMOVEZEROENTRIES_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISPARTYLEDGER_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISLASTDEEMEDPOSITIVE_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISCAPVATTAXALTERED_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISCAPVATNOTCLAIMED_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($AMOUNT_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($SERVICETAXDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($BANKALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($BILLALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($INTERESTCOLLECTION_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($OLDAUDITENTRIES_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($AUDITENTRIES_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($INPUTCRALLOCS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($DUTYHEADDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($RATEDETAILS_LIST_AL); $ACCOUNTINGALLOCATIONS_LIST->appendChild($SUMMARYALLOCS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($STPYMTDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($TAXBILLALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($VATSTATUTORYDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($COSTTRACKALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($REFVOUCHERDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($INVOICEWISEDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($VATITCDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ADVANCETAXDETAILS_LIST_AIE); $ALLINVENTORYENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_AIE1); $ALLINVENTORYENTRIES_LIST->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST_AIE); $ALLINVENTORYENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST_AIE1); $ALLINVENTORYENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST_AIE1); $ALLINVENTORYENTRIES_LIST->appendChild($EXCISEALLOCATIONS_LIST_AIE); $ALLINVENTORYENTRIES_LIST->appendChild($EXPENSEALLOCATIONS_LIST_AIE); } $PAYROLLMODEOFPAYMENT_LIST_v = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $ATTDRECORDS_LIST_v = $xml->createElement("ATTDRECORDS.LIST", " "); $GSTEWAYCONSIGNORADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNORADDRESS.LIST", " "); $GSTEWAYCONSIGNEEADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNEEADDRESS.LIST", " "); $TEMPGSTRATEDETAILS_LIST_v = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST_v); $VOUCHER->appendChild($ATTDRECORDS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNORADDRESS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNEEADDRESS_LIST_v); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST_v); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY2 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO2 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO2->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME2 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE2 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_NAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPNAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPSTATE2); $COMPANY2->appendChild($REMOTECMPINFO2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY3 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO3 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO3->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME3 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME3 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE3 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_NAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPNAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPSTATE3); $COMPANY3->appendChild($REMOTECMPINFO3); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->appendChild($COMPANY3); $test = $xml->createElement("TALLYMESSAGE", " "); $test->setAttribute("xmlns:UDF", "TallyUDF"); //Set the attributes. /*$xml_HEADER->setAttribute("length", "0:01:15"); $xml_HEADER->setAttribute("bitrate", "64kb/s"); $xml_HEADER->setAttribute("channels", "2");*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3); //for ($i = 1; $i <2; $i++) { // $test = '$name_' . $i; // $test = $xml->createElement("TALLYMESSAGE", " "); // $test->setAttribute("xmlns:UDF", "TallyUDF"); // $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($test); //} $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function xml_contra($fid, $eight_randnum){ //$where = array('fid' => $fid); $form = $this->model->xml_contra($fid); //echo "<pre>"; print_r($form); die; $stage = $form[0]['stage']; if($stage == 'bank' || $stage == 'cheque_reg'){ $stage = $form[0]['voucher_type']; }else{ $stage = $stage; } $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['party_ledger']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $check_no = $form[0]['check_no']; $check_date = $form[0]['check_date']; $trans_type = $form[0]['trans_type']; $ms_ledger = $form[0]['sub_ledger']; header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS); $DATE = $xml->createElement("DATE", "".$m_date.""); $VOUCHER->appendChild($DATE); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->appendChild($GUID); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $VOUCHER->appendChild($NARRATION); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $VOUCHER->appendChild($VOUCHERNUMBER); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $VOUCHER->appendChild($PARTYLEDGERNAME); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $VOUCHER->appendChild($CSTFORMISSUETYPE); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $VOUCHER->appendChild($CSTFORMRECVTYPE); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $VOUCHER->appendChild($FBTPAYMENTTYPE); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); $VOUCHER->appendChild($PERSISTEDVIEW); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $VOUCHER->appendChild($VCHGSTCLASS); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $VOUCHER->appendChild($DIFFACTUALQTY); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $VOUCHER->appendChild($ISMSTFROMSYNC); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $VOUCHER->appendChild($ASORIGINAL); $AUDITED = $xml->createElement("AUDITED", "No"); $VOUCHER->appendChild($AUDITED); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $VOUCHER->appendChild($FORJOBCOSTING); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $VOUCHER->appendChild($ISOPTIONAL); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $VOUCHER->appendChild($EFFECTIVEDATE); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $VOUCHER->appendChild($USEFOREXCISE); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $VOUCHER->appendChild($ISFORJOBWORKIN); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $VOUCHER->appendChild($ALLOWCONSUMPTION); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $VOUCHER->appendChild($USEFORINTEREST); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $VOUCHER->appendChild($USEFORGAINLOSS); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $VOUCHER->appendChild($USEFORCOMPOUND); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $VOUCHER->appendChild($USEFORSERVICETAX); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $VOUCHER->appendChild($ISEXCISEVOUCHER); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $VOUCHER->appendChild($EXCISEOPENING); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $VOUCHER->appendChild($ISVATOVERRIDDEN); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $VOUCHER->appendChild($ISISDVOUCHER); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $VOUCHER->appendChild($GSTNOTEXPORTED); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $VOUCHER->appendChild($ISCANCELLED); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "Yes"); $VOUCHER->appendChild($HASCASHFLOW); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $VOUCHER->appendChild($ISPOSTDATED); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $VOUCHER->appendChild($USETRACKINGNUMBER); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $VOUCHER->appendChild($ISINVOICE); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $VOUCHER->appendChild($MFGJOURNAL); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $VOUCHER->appendChild($HASDISCOUNTS); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $VOUCHER->appendChild($ASPAYSLIP); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $VOUCHER->appendChild($ISCOSTCENTRE); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $VOUCHER->appendChild($ISBLANKCHEQUE); $ISVOID = $xml->createElement("ISVOID", "No"); $VOUCHER->appendChild($ISVOID); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $VOUCHER->appendChild($ISONHOLD); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VOUCHER->appendChild($ORDERLINESTATUS); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $VOUCHER->appendChild($VATISPURCEXEMPTED); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $VOUCHER->appendChild($ISVATDUTYPAID); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $ISDELETED = $xml->createElement("ISDELETED", "No"); $VOUCHER->appendChild($ISDELETED); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $VOUCHER->appendChild($CHANGEVCHMODE); $ALTERID = $xml->createElement("ALTERID", "14"); $VOUCHER->appendChild($ALTERID); $MASTERID = $xml->createElement("MASTERID", "9"); $VOUCHER->appendChild($MASTERID); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066536"); $VOUCHER->appendChild($VOUCHERKEY); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $VOUCHER->appendChild($AUDITENTRIES_LIST); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //ALLLEDGERENTRIES.LIST block start //$s_ledger_name = $form_info[$i]['s_ledger_name']; for ($le=0; $le < 2; $le++) { $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); //if($trans_type == 'fund_transfer'){ if($le == 0){ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$m_ledger_name.""); }else{ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger.""); } /* }else{ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$m_ledger_name.""); }*/ $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); if($le == 0){ $AMOUNT_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); }else{ $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); } //start If bill allocation is available if($trans_type == 'withdrawal'){ //if trans type is withdrawal if($le == 0){ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); $DATE_BA_1 = $xml->createElement("DATE", "".$check_date.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "Sndp & Co"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); }else{ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); } //if trans type is withdrawal }elseif($trans_type == 'diposit'){ //if trans type is diposit if($le == 0){ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); }else{ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); $DATE_BA_1 = $xml->createElement("DATE", "".$check_date.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "Sndp & Co"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); //if trans type is deposit } }else{ //For fund transfer $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); $DATE_BA_1 = $xml->createElement("DATE", "".$check_date.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "Sndp & Co"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); if($le == 0){ $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); }else{ $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); } $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); //For fund transfer } //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ } // ALLLEDGERENTRIES.LIST block end $PAYROLLMODEOFPAYMENT_LIST = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST); $ATTDRECORDS_LIST = $xml->createElement("ATTDRECORDS.LIST", " "); $VOUCHER->appendChild($ATTDRECORDS_LIST); $TEMPGSTRATEDETAILS_LIST = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST); for ($t=0; $t < 2; $t++) { # code... $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $COMPANY_1 = $xml->createElement("COMPANY", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY_1); $REMOTECMPINFO_1 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO_1->setAttribute("MERGE", "Yes"); $COMPANY_1->appendChild($REMOTECMPINFO_1); $NAME_TALLY_2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_1->appendChild($NAME_TALLY_2); $REMOTECMPNAME_1 = $xml->createElement("REMOTECMPNAME", "Sndp & Co"); $REMOTECMPINFO_1->appendChild($REMOTECMPNAME_1); $REMOTECMPSTATE_1 = $xml->createElement("REMOTECMPSTATE", "Gujarat"); $REMOTECMPINFO_1->appendChild($REMOTECMPSTATE_1); } /* $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3);*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function xml_receipt($fid, $eight_randnum){ //$where = array('fid' => $fid); $form = $this->model->office_form_receipt($fid); /*$form_info = $this->model->DetailData('tbl_form_info', $where); $fi_count = count($form_info);*/ $stage = $form[0]['stage']; if($stage == 'bank' || $stage == 'cheque_reg'){ $stage = $form[0]['voucher_type']; }else{ $b = $stage; } $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['party_ledger']; $ms_ledger = $form[0]['cr_ledger']; $ms_ledger_two = $form[0]['dr_ledger']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $trans_type = $form[0]['trans_type']; $check_no = $form[0]['check_no']; $check_date = $form[0]['check_date']; $check_date2 = str_replace(["-", ""], '', $check_date); header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS); $DATE = $xml->createElement("DATE", "".$m_date.""); $VOUCHER->appendChild($DATE); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->appendChild($GUID); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $VOUCHER->appendChild($NARRATION); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $VOUCHER->appendChild($VOUCHERNUMBER); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $VOUCHER->appendChild($PARTYLEDGERNAME); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $VOUCHER->appendChild($CSTFORMISSUETYPE); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $VOUCHER->appendChild($CSTFORMRECVTYPE); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $VOUCHER->appendChild($FBTPAYMENTTYPE); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); $VOUCHER->appendChild($PERSISTEDVIEW); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $VOUCHER->appendChild($VCHGSTCLASS); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $VOUCHER->appendChild($DIFFACTUALQTY); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $VOUCHER->appendChild($ISMSTFROMSYNC); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $VOUCHER->appendChild($ASORIGINAL); $AUDITED = $xml->createElement("AUDITED", "No"); $VOUCHER->appendChild($AUDITED); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $VOUCHER->appendChild($FORJOBCOSTING); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $VOUCHER->appendChild($ISOPTIONAL); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $VOUCHER->appendChild($EFFECTIVEDATE); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $VOUCHER->appendChild($USEFOREXCISE); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $VOUCHER->appendChild($ISFORJOBWORKIN); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $VOUCHER->appendChild($ALLOWCONSUMPTION); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $VOUCHER->appendChild($USEFORINTEREST); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $VOUCHER->appendChild($USEFORGAINLOSS); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $VOUCHER->appendChild($USEFORCOMPOUND); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $VOUCHER->appendChild($USEFORSERVICETAX); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $VOUCHER->appendChild($ISEXCISEVOUCHER); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $VOUCHER->appendChild($EXCISEOPENING); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $VOUCHER->appendChild($ISVATOVERRIDDEN); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $VOUCHER->appendChild($ISISDVOUCHER); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $VOUCHER->appendChild($GSTNOTEXPORTED); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $VOUCHER->appendChild($ISCANCELLED); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "Yes"); $VOUCHER->appendChild($HASCASHFLOW); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $VOUCHER->appendChild($ISPOSTDATED); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $VOUCHER->appendChild($USETRACKINGNUMBER); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $VOUCHER->appendChild($ISINVOICE); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $VOUCHER->appendChild($MFGJOURNAL); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $VOUCHER->appendChild($HASDISCOUNTS); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $VOUCHER->appendChild($ASPAYSLIP); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $VOUCHER->appendChild($ISCOSTCENTRE); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $VOUCHER->appendChild($ISBLANKCHEQUE); $ISVOID = $xml->createElement("ISVOID", "No"); $VOUCHER->appendChild($ISVOID); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $VOUCHER->appendChild($ISONHOLD); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VOUCHER->appendChild($ORDERLINESTATUS); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $VOUCHER->appendChild($VATISPURCEXEMPTED); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $VOUCHER->appendChild($ISVATDUTYPAID); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $ISDELETED = $xml->createElement("ISDELETED", "No"); $VOUCHER->appendChild($ISDELETED); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $VOUCHER->appendChild($CHANGEVCHMODE); $ALTERID = $xml->createElement("ALTERID", "14"); $VOUCHER->appendChild($ALTERID); $MASTERID = $xml->createElement("MASTERID", "9"); $VOUCHER->appendChild($MASTERID); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066536"); $VOUCHER->appendChild($VOUCHERKEY); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $VOUCHER->appendChild($AUDITENTRIES_LIST); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //ALLLEDGERENTRIES.LIST block start for ($i=0; $i < 2; $i++) { $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); if($i == '0'){ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger.""); }else{ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger_two.""); } $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); if($i == '0'){ $AMOUNT_1 = $xml->createElement("AMOUNT", "".$form[0]['amt_gross'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$form[0]['amt_gross'].""); }else{ $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$form[0]['amt_gross'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$form[0]['amt_gross'].""); } $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); if($trans_type == 'bank' && $i == '1'){ $DATE_BA_1 = $xml->createElement("DATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "".$ms_ledger.""); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); } //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); } /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end $PAYROLLMODEOFPAYMENT_LIST = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST); $ATTDRECORDS_LIST = $xml->createElement("ATTDRECORDS.LIST", " "); $VOUCHER->appendChild($ATTDRECORDS_LIST); $TEMPGSTRATEDETAILS_LIST = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST); for ($t=0; $t < 2; $t++) { $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $COMPANY_1 = $xml->createElement("COMPANY", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY_1); $REMOTECMPINFO_1 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO_1->setAttribute("MERGE", "Yes"); $COMPANY_1->appendChild($REMOTECMPINFO_1); $NAME_TALLY_2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_1->appendChild($NAME_TALLY_2); $REMOTECMPNAME_1 = $xml->createElement("REMOTECMPNAME", "Sndp & Co"); $REMOTECMPINFO_1->appendChild($REMOTECMPNAME_1); $REMOTECMPSTATE_1 = $xml->createElement("REMOTECMPSTATE", "Gujarat"); $REMOTECMPINFO_1->appendChild($REMOTECMPSTATE_1); } /* $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3);*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function xml_credit($fid, $eight_randnum){ $where = array('fid' => $fid); $form = $this->model->xml_credit_one($fid); //echo "<pre>"; print_r($form); die; $form_info = $this->model->xml_credit_two($fid); $fi_count = count($form_info); //echo "<pre>"; print_r($form_info); die; $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['l_name']; $ms_ledger = $form[0]['l_name_one']; //$debit_ledger = $form[0]['debit_ledger']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $trans_type = $form[0]['trans_type']; $check_no = $form[0]['check_no']; $check_date = $form[0]['check_date']; $check_date2 = str_replace(["-", ""], '', $check_date); header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "Credit Note"); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $BASICBUYERADDRESS_LIST = $xml->createElement("BASICBUYERADDRESS.LIST", " "); $BASICBUYERADDRESS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($BASICBUYERADDRESS_LIST); $BASICBUYERADDRESS = $xml->createElement("BASICBUYERADDRESS", "Gandhinagar"); $BASICBUYERADDRESS_LIST->appendChild($BASICBUYERADDRESS); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS); $DATE = $xml->createElement("DATE", "".$m_date.""); $VOUCHER->appendChild($DATE); $REFERENCEDATE = $xml->createElement("REFERENCEDATE", "".$m_date.""); $VOUCHER->appendChild($REFERENCEDATE); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->appendChild($GUID); $STATENAME = $xml->createElement("STATENAME", "Gujarat"); $VOUCHER->appendChild($STATENAME); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $VOUCHER->appendChild($NARRATION); $COUNTRYOFRESIDENCE = $xml->createElement("COUNTRYOFRESIDENCE", "India"); $VOUCHER->appendChild($COUNTRYOFRESIDENCE); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "Credit Note"); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $VOUCHER->appendChild($VOUCHERNUMBER); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $VOUCHER->appendChild($PARTYLEDGERNAME); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $VOUCHER->appendChild($CSTFORMISSUETYPE); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $VOUCHER->appendChild($CSTFORMRECVTYPE); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $VOUCHER->appendChild($FBTPAYMENTTYPE); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); $VOUCHER->appendChild($PERSISTEDVIEW); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $VOUCHER->appendChild($VCHGSTCLASS); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $VOUCHER->appendChild($DIFFACTUALQTY); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $VOUCHER->appendChild($ISMSTFROMSYNC); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $VOUCHER->appendChild($ASORIGINAL); $AUDITED = $xml->createElement("AUDITED", "No"); $VOUCHER->appendChild($AUDITED); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $VOUCHER->appendChild($FORJOBCOSTING); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $VOUCHER->appendChild($ISOPTIONAL); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $VOUCHER->appendChild($EFFECTIVEDATE); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $VOUCHER->appendChild($USEFOREXCISE); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $VOUCHER->appendChild($ISFORJOBWORKIN); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $VOUCHER->appendChild($ALLOWCONSUMPTION); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $VOUCHER->appendChild($USEFORINTEREST); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $VOUCHER->appendChild($USEFORGAINLOSS); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $VOUCHER->appendChild($USEFORCOMPOUND); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $VOUCHER->appendChild($USEFORSERVICETAX); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $VOUCHER->appendChild($ISEXCISEVOUCHER); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $VOUCHER->appendChild($EXCISEOPENING); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $VOUCHER->appendChild($ISVATOVERRIDDEN); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $VOUCHER->appendChild($ISISDVOUCHER); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $VOUCHER->appendChild($GSTNOTEXPORTED); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $VOUCHER->appendChild($ISCANCELLED); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "Yes"); $VOUCHER->appendChild($HASCASHFLOW); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $VOUCHER->appendChild($ISPOSTDATED); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $VOUCHER->appendChild($USETRACKINGNUMBER); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $VOUCHER->appendChild($ISINVOICE); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $VOUCHER->appendChild($MFGJOURNAL); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $VOUCHER->appendChild($HASDISCOUNTS); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $VOUCHER->appendChild($ASPAYSLIP); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $VOUCHER->appendChild($ISCOSTCENTRE); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $VOUCHER->appendChild($ISBLANKCHEQUE); $ISVOID = $xml->createElement("ISVOID", "No"); $VOUCHER->appendChild($ISVOID); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $VOUCHER->appendChild($ISONHOLD); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VOUCHER->appendChild($ORDERLINESTATUS); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $VOUCHER->appendChild($VATISPURCEXEMPTED); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $VOUCHER->appendChild($ISVATDUTYPAID); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $ISDELETED = $xml->createElement("ISDELETED", "No"); $VOUCHER->appendChild($ISDELETED); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $VOUCHER->appendChild($CHANGEVCHMODE); $ALTERID = $xml->createElement("ALTERID", "14"); $VOUCHER->appendChild($ALTERID); $MASTERID = $xml->createElement("MASTERID", "9"); $VOUCHER->appendChild($MASTERID); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066536"); $VOUCHER->appendChild($VOUCHERKEY); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $VOUCHER->appendChild($AUDITENTRIES_LIST); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //ALLLEDGERENTRIES.LIST block start $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger.""); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); $AMOUNT_1 = $xml->createElement("AMOUNT", "".$form[0]['amt_gross'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$form[0]['amt_gross'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); if($trans_type == 'bank'){ $DATE_BA_1 = $xml->createElement("DATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "".$ms_ledger.""); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); } //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end for ($j=0; $j < $fi_count; $j++){ //ALLLEDGERENTRIES.LIST block start $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$form_info[$j]['debit_ledger'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$form_info[$j]['amt_taxable'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$form_info[$j]['amt_taxable'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available /* $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); if($trans_type == 'bank'){ $DATE_BA_1 = $xml->createElement("DATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "".$ms_ledger.""); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); }*/ //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end }// for loop ends $PAYROLLMODEOFPAYMENT_LIST = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST); $ATTDRECORDS_LIST = $xml->createElement("ATTDRECORDS.LIST", " "); $VOUCHER->appendChild($ATTDRECORDS_LIST); $TEMPGSTRATEDETAILS_LIST = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST); for ($t=0; $t < 2; $t++) { $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $COMPANY_1 = $xml->createElement("COMPANY", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY_1); $REMOTECMPINFO_1 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO_1->setAttribute("MERGE", "Yes"); $COMPANY_1->appendChild($REMOTECMPINFO_1); $NAME_TALLY_2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_1->appendChild($NAME_TALLY_2); $REMOTECMPNAME_1 = $xml->createElement("REMOTECMPNAME", "Sndp & Co"); $REMOTECMPINFO_1->appendChild($REMOTECMPNAME_1); $REMOTECMPSTATE_1 = $xml->createElement("REMOTECMPSTATE", "Gujarat"); $REMOTECMPINFO_1->appendChild($REMOTECMPSTATE_1); } /* $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3);*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function xml_debit($fid, $eight_randnum){ //$where = array('fid' => $fid); $form = $this->model->xml_debit_one($fid); $form_info = $this->model->xml_debit_two($fid); $fi_count = count($form_info); //echo "<pre>"; print_r($form_info); die; $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['l_name']; $ms_ledger = $form[0]['l_name_one']; $ms_ledger_two = $form[0]['ms_ledger_two']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $trans_type = $form[0]['trans_type']; $check_no = $form[0]['check_no']; $check_date = $form[0]['check_date']; $check_date2 = str_replace(["-", ""], '', $check_date); header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "Debit Note"); $VOUCHER->setAttribute("ACTION", "Debit"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $BASICBUYERADDRESS_LIST = $xml->createElement("BASICBUYERADDRESS.LIST", " "); $BASICBUYERADDRESS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($BASICBUYERADDRESS_LIST); $BASICBUYERADDRESS = $xml->createElement("BASICBUYERADDRESS", " "); $BASICBUYERADDRESS_LIST->appendChild($BASICBUYERADDRESS); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS); $DATE = $xml->createElement("DATE", "".$m_date.""); $VOUCHER->appendChild($DATE); $REFERENCEDATE = $xml->createElement("REFERENCEDATE", "".$m_date.""); $VOUCHER->appendChild($REFERENCEDATE); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->appendChild($GUID); $STATENAME = $xml->createElement("STATENAME", " "); $VOUCHER->appendChild($STATENAME); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $VOUCHER->appendChild($NARRATION); $COUNTRYOFRESIDENCE = $xml->createElement("COUNTRYOFRESIDENCE", " "); $VOUCHER->appendChild($COUNTRYOFRESIDENCE); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "Debit Note"); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $VOUCHER->appendChild($VOUCHERNUMBER); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $VOUCHER->appendChild($PARTYLEDGERNAME); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $VOUCHER->appendChild($CSTFORMISSUETYPE); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $VOUCHER->appendChild($CSTFORMRECVTYPE); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $VOUCHER->appendChild($FBTPAYMENTTYPE); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); $VOUCHER->appendChild($PERSISTEDVIEW); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $VOUCHER->appendChild($VCHGSTCLASS); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $VOUCHER->appendChild($DIFFACTUALQTY); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $VOUCHER->appendChild($ISMSTFROMSYNC); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $VOUCHER->appendChild($ASORIGINAL); $AUDITED = $xml->createElement("AUDITED", "No"); $VOUCHER->appendChild($AUDITED); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $VOUCHER->appendChild($FORJOBCOSTING); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $VOUCHER->appendChild($ISOPTIONAL); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $VOUCHER->appendChild($EFFECTIVEDATE); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $VOUCHER->appendChild($USEFOREXCISE); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $VOUCHER->appendChild($ISFORJOBWORKIN); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $VOUCHER->appendChild($ALLOWCONSUMPTION); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $VOUCHER->appendChild($USEFORINTEREST); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $VOUCHER->appendChild($USEFORGAINLOSS); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $VOUCHER->appendChild($USEFORCOMPOUND); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $VOUCHER->appendChild($USEFORSERVICETAX); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $VOUCHER->appendChild($ISEXCISEVOUCHER); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $VOUCHER->appendChild($EXCISEOPENING); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $VOUCHER->appendChild($ISVATOVERRIDDEN); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $VOUCHER->appendChild($ISISDVOUCHER); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $VOUCHER->appendChild($GSTNOTEXPORTED); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $VOUCHER->appendChild($ISCANCELLED); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "Yes"); $VOUCHER->appendChild($HASCASHFLOW); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $VOUCHER->appendChild($ISPOSTDATED); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $VOUCHER->appendChild($USETRACKINGNUMBER); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $VOUCHER->appendChild($ISINVOICE); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $VOUCHER->appendChild($MFGJOURNAL); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $VOUCHER->appendChild($HASDISCOUNTS); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $VOUCHER->appendChild($ASPAYSLIP); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $VOUCHER->appendChild($ISCOSTCENTRE); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $VOUCHER->appendChild($ISBLANKCHEQUE); $ISVOID = $xml->createElement("ISVOID", "No"); $VOUCHER->appendChild($ISVOID); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $VOUCHER->appendChild($ISONHOLD); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VOUCHER->appendChild($ORDERLINESTATUS); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $VOUCHER->appendChild($VATISPURCEXEMPTED); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $VOUCHER->appendChild($ISVATDUTYPAID); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $ISDELETED = $xml->createElement("ISDELETED", "No"); $VOUCHER->appendChild($ISDELETED); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $VOUCHER->appendChild($CHANGEVCHMODE); $ALTERID = $xml->createElement("ALTERID", "14"); $VOUCHER->appendChild($ALTERID); $MASTERID = $xml->createElement("MASTERID", "9"); $VOUCHER->appendChild($MASTERID); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066536"); $VOUCHER->appendChild($VOUCHERKEY); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $VOUCHER->appendChild($AUDITENTRIES_LIST); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //ALLLEDGERENTRIES.LIST block start $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger.""); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); $ISCAPVATTAXALTERED_1 = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATTAXALTERED_1); $ISCAPVATNOTCLAIMED_1 = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATNOTCLAIMED_1); $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$form[0]['amt_gross'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$form[0]['amt_gross'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); if($trans_type == 'bank'){ $DATE_BA_1 = $xml->createElement("DATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "".$ms_ledger.""); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); } //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end for ($j=0; $j < $fi_count; $j++){ //ALLLEDGERENTRIES.LIST block start $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$form_info[$j]['credit_ledger'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); $ISCAPVATTAXALTERED_2 = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATTAXALTERED_2); $ISCAPVATNOTCLAIMED_2 = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATNOTCLAIMED_2); $AMOUNT_1 = $xml->createElement("AMOUNT", "".$form_info[$j]['amt_taxable'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$form_info[$j]['amt_taxable'].""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); if($trans_type == 'bank'){ $DATE_BA_1 = $xml->createElement("DATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$check_date2.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "".$ms_ledger.""); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); } //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end }// for loop ends $PAYROLLMODEOFPAYMENT_LIST = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST); $ATTDRECORDS_LIST = $xml->createElement("ATTDRECORDS.LIST", " "); $VOUCHER->appendChild($ATTDRECORDS_LIST); $TEMPGSTRATEDETAILS_LIST = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST); for ($t=0; $t < 2; $t++) { $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $COMPANY_1 = $xml->createElement("COMPANY", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY_1); $REMOTECMPINFO_1 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO_1->setAttribute("MERGE", "Yes"); $COMPANY_1->appendChild($REMOTECMPINFO_1); $NAME_TALLY_2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_1->appendChild($NAME_TALLY_2); $REMOTECMPNAME_1 = $xml->createElement("REMOTECMPNAME", "Sndp & Co"); $REMOTECMPINFO_1->appendChild($REMOTECMPNAME_1); $REMOTECMPSTATE_1 = $xml->createElement("REMOTECMPSTATE", "Gujarat"); $REMOTECMPINFO_1->appendChild($REMOTECMPSTATE_1); } /* $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3);*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function xml_journal($fid, $eight_randnum){ //$where = array('fid' => $fid); $form = $this->model->xml_journal($fid); //echo "<pre>"; print_r($form); die; $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['l_name']; $ms_ledger = $form[0]['l_name_one']; $ms_ledger_two = $form[0]['l_name_two']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS); $DATE = $xml->createElement("DATE", "".$m_date.""); $VOUCHER->appendChild($DATE); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->appendChild($GUID); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $VOUCHER->appendChild($NARRATION); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $VOUCHER->appendChild($VOUCHERNUMBER); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $VOUCHER->appendChild($PARTYLEDGERNAME); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $VOUCHER->appendChild($CSTFORMISSUETYPE); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $VOUCHER->appendChild($CSTFORMRECVTYPE); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $VOUCHER->appendChild($FBTPAYMENTTYPE); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); $VOUCHER->appendChild($PERSISTEDVIEW); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $VOUCHER->appendChild($VCHGSTCLASS); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $VOUCHER->appendChild($DIFFACTUALQTY); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $VOUCHER->appendChild($ISMSTFROMSYNC); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $VOUCHER->appendChild($ASORIGINAL); $AUDITED = $xml->createElement("AUDITED", "No"); $VOUCHER->appendChild($AUDITED); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $VOUCHER->appendChild($FORJOBCOSTING); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $VOUCHER->appendChild($ISOPTIONAL); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $VOUCHER->appendChild($EFFECTIVEDATE); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $VOUCHER->appendChild($USEFOREXCISE); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $VOUCHER->appendChild($ISFORJOBWORKIN); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $VOUCHER->appendChild($ALLOWCONSUMPTION); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $VOUCHER->appendChild($USEFORINTEREST); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $VOUCHER->appendChild($USEFORGAINLOSS); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $VOUCHER->appendChild($USEFORCOMPOUND); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $VOUCHER->appendChild($USEFORSERVICETAX); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $VOUCHER->appendChild($ISEXCISEVOUCHER); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $IGNOREPOSVALIDATION = $xml->createElement("IGNOREPOSVALIDATION", "No"); $VOUCHER->appendChild($IGNOREPOSVALIDATION); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $VOUCHER->appendChild($EXCISEOPENING); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $VOUCHER->appendChild($ISVATOVERRIDDEN); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $ISVATPAIDATCUSTOMS = $xml->createElement("ISVATPAIDATCUSTOMS", "No"); $VOUCHER->appendChild($ISVATPAIDATCUSTOMS); $ISDECLAREDTOCUSTOMS = $xml->createElement("ISDECLAREDTOCUSTOMS", "No"); $VOUCHER->appendChild($ISDECLAREDTOCUSTOMS); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $VOUCHER->appendChild($ISISDVOUCHER); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $VOUCHER->appendChild($GSTNOTEXPORTED); $IGNOREGSTINVALIDATION = $xml->createElement("IGNOREGSTINVALIDATION", "No"); $VOUCHER->appendChild($IGNOREGSTINVALIDATION); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $ISBOENOTAPPLICABLE = $xml->createElement("ISBOENOTAPPLICABLE", "No"); $VOUCHER->appendChild($ISBOENOTAPPLICABLE); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $ISOVERSEASTOURISTTRANS = $xml->createElement("ISOVERSEASTOURISTTRANS", "No"); $VOUCHER->appendChild($ISOVERSEASTOURISTTRANS); $ISDESIGNATEDZONEPARTY = $xml->createElement("ISDESIGNATEDZONEPARTY", "No"); $VOUCHER->appendChild($ISDESIGNATEDZONEPARTY); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $VOUCHER->appendChild($ISCANCELLED); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "No"); $VOUCHER->appendChild($HASCASHFLOW); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $VOUCHER->appendChild($ISPOSTDATED); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $VOUCHER->appendChild($USETRACKINGNUMBER); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $VOUCHER->appendChild($ISINVOICE); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $VOUCHER->appendChild($MFGJOURNAL); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $VOUCHER->appendChild($HASDISCOUNTS); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $VOUCHER->appendChild($ASPAYSLIP); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $VOUCHER->appendChild($ISCOSTCENTRE); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $VOUCHER->appendChild($ISBLANKCHEQUE); $ISVOID = $xml->createElement("ISVOID", "No"); $VOUCHER->appendChild($ISVOID); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $VOUCHER->appendChild($ISONHOLD); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VOUCHER->appendChild($ORDERLINESTATUS); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $VOUCHER->appendChild($VATISPURCEXEMPTED); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $VOUCHER->appendChild($ISVATDUTYPAID); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $ISDELETED = $xml->createElement("ISDELETED", "No"); $VOUCHER->appendChild($ISDELETED); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $VOUCHER->appendChild($CHANGEVCHMODE); $ALTERID = $xml->createElement("ALTERID", "14"); $VOUCHER->appendChild($ALTERID); $MASTERID = $xml->createElement("MASTERID", "9"); $VOUCHER->appendChild($MASTERID); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066536"); $VOUCHER->appendChild($VOUCHERKEY); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $VOUCHER->appendChild($AUDITENTRIES_LIST); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $EWAYBILLDETAILS_LIST = $xml->createElement("EWAYBILLDETAILS.LIST", " "); $VOUCHER->appendChild($EWAYBILLDETAILS_LIST); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //ALLLEDGERENTRIES.LIST block start for ($i=0; $i < 2; $i++) { if($i == 0){ $s_ledger_name = $ms_ledger; }else{ $s_ledger_name = $ms_ledger_two; } $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$s_ledger_name.""); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); if($i == 0){ $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); }else{ $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); } $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); if($i == 0){ $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); }else{ $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); } $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATTAXALTERED); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATNOTCLAIMED); if($i == 0){ $m_effect = $form[0]['m_effect']; if($m_effect == 'cr'){ $AMOUNT_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); }else{ $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); } }else{ $ms_effect = $form[0]['ms_effect']; if($ms_effect == 'cr'){ $AMOUNT_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); }else{ $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); } } $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); /* $DATE_BA_1 = $xml->createElement("DATE", "20180815"); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "20180815"); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "Sndp & Co"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "000340"); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "10000.00"); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1);*/ //end If bill allocation is available $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); } /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end $PAYROLLMODEOFPAYMENT_LIST = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST); $ATTDRECORDS_LIST = $xml->createElement("ATTDRECORDS.LIST", " "); $VOUCHER->appendChild($ATTDRECORDS_LIST); $TEMPGSTRATEDETAILS_LIST = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST); for ($t=0; $t < 2; $t++) { $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $COMPANY_1 = $xml->createElement("COMPANY", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY_1); $REMOTECMPINFO_1 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO_1->setAttribute("MERGE", "Yes"); $COMPANY_1->appendChild($REMOTECMPINFO_1); $NAME_TALLY_2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_1->appendChild($NAME_TALLY_2); $REMOTECMPNAME_1 = $xml->createElement("REMOTECMPNAME", "Sndp & Co"); $REMOTECMPINFO_1->appendChild($REMOTECMPNAME_1); $REMOTECMPSTATE_1 = $xml->createElement("REMOTECMPSTATE", "Gujarat"); $REMOTECMPINFO_1->appendChild($REMOTECMPSTATE_1); } /* $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3);*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function xml_payment($fid, $eight_randnum){ $where = array('fid' => $fid); //$form = $this->model->DetailData('tbl_form', $where); $form = $this->model->office_form_paymet($fid); $form_info = $this->model->DetailData('tbl_form_info', $where); $fi_count = count($form_info); $stage = $form[0]['stage']; if($stage == 'bank' || $stage == 'cheque_reg'){ $stage = $form[0]['voucher_type']; }else{ $stage = $stage; } $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['party_ledger']; $ms_ledger = $form[0]['debit_ledger']; $ms_ledger_two = $form[0]['credit_ledger']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $trans_type = $form[0]['trans_type']; $check_no = $form[0]['check_no']; $check_date = $form[0]['check_date']; $check_date2 = str_replace(["-", ""], '', $check_date); header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " Star One Web "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "b5a4cee1-360d-4d70-bc3f-288ba2b5f40e-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "b5a4cee1-360d-4d70-bc3f-288ba2b5f40e-0000aa05:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $VOUCHER->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS); $DATE = $xml->createElement("DATE", "".$m_date.""); $VOUCHER->appendChild($DATE); $GUID = $xml->createElement("GUID", "b5a4cee1-360d-4d70-bc3f-288ba2b5f40e-".$eight_randnum.""); $VOUCHER->appendChild($GUID); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $VOUCHER->appendChild($NARRATION); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $VOUCHER->appendChild($VOUCHERNUMBER); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $VOUCHER->appendChild($PARTYLEDGERNAME); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $VOUCHER->appendChild($CSTFORMISSUETYPE); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $VOUCHER->appendChild($CSTFORMRECVTYPE); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $VOUCHER->appendChild($FBTPAYMENTTYPE); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); $VOUCHER->appendChild($PERSISTEDVIEW); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $VOUCHER->appendChild($VCHGSTCLASS); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $VOUCHER->appendChild($DIFFACTUALQTY); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $VOUCHER->appendChild($ISMSTFROMSYNC); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $VOUCHER->appendChild($ASORIGINAL); $AUDITED = $xml->createElement("AUDITED", "No"); $VOUCHER->appendChild($AUDITED); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $VOUCHER->appendChild($FORJOBCOSTING); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $VOUCHER->appendChild($ISOPTIONAL); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $VOUCHER->appendChild($EFFECTIVEDATE); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $VOUCHER->appendChild($USEFOREXCISE); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $VOUCHER->appendChild($ISFORJOBWORKIN); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $VOUCHER->appendChild($ALLOWCONSUMPTION); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $VOUCHER->appendChild($USEFORINTEREST); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $VOUCHER->appendChild($USEFORGAINLOSS); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $VOUCHER->appendChild($USEFORCOMPOUND); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $VOUCHER->appendChild($USEFORSERVICETAX); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $VOUCHER->appendChild($ISEXCISEVOUCHER); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $IGNOREPOSVALIDATION = $xml->createElement("IGNOREPOSVALIDATION", "No"); $VOUCHER->appendChild($IGNOREPOSVALIDATION); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $VOUCHER->appendChild($EXCISEOPENING); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $VOUCHER->appendChild($ISVATOVERRIDDEN); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $ISVATPAIDATCUSTOMS = $xml->createElement("ISVATPAIDATCUSTOMS", "No"); $VOUCHER->appendChild($ISVATPAIDATCUSTOMS); $ISDECLAREDTOCUSTOMS = $xml->createElement("ISDECLAREDTOCUSTOMS", "No"); $VOUCHER->appendChild($ISDECLAREDTOCUSTOMS); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $VOUCHER->appendChild($ISISDVOUCHER); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $VOUCHER->appendChild($GSTNOTEXPORTED); $IGNOREGSTINVALIDATION = $xml->createElement("IGNOREGSTINVALIDATION", "No"); $VOUCHER->appendChild($IGNOREGSTINVALIDATION); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $ISBOENOTAPPLICABLE = $xml->createElement("ISBOENOTAPPLICABLE", "No"); $VOUCHER->appendChild($ISBOENOTAPPLICABLE); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $ISOVERSEASTOURISTTRANS = $xml->createElement("ISOVERSEASTOURISTTRANS", "No"); $VOUCHER->appendChild($ISOVERSEASTOURISTTRANS); $ISDESIGNATEDZONEPARTY = $xml->createElement("ISDESIGNATEDZONEPARTY", "No"); $VOUCHER->appendChild($ISDESIGNATEDZONEPARTY); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $VOUCHER->appendChild($ISCANCELLED); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "Yes"); $VOUCHER->appendChild($HASCASHFLOW); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $VOUCHER->appendChild($ISPOSTDATED); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $VOUCHER->appendChild($USETRACKINGNUMBER); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $VOUCHER->appendChild($ISINVOICE); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $VOUCHER->appendChild($MFGJOURNAL); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $VOUCHER->appendChild($HASDISCOUNTS); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $VOUCHER->appendChild($ASPAYSLIP); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $VOUCHER->appendChild($ISCOSTCENTRE); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $VOUCHER->appendChild($ISBLANKCHEQUE); $ISVOID = $xml->createElement("ISVOID", "No"); $VOUCHER->appendChild($ISVOID); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $VOUCHER->appendChild($ISONHOLD); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VOUCHER->appendChild($ORDERLINESTATUS); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $VOUCHER->appendChild($VATISPURCEXEMPTED); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $VOUCHER->appendChild($ISVATDUTYPAID); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $ISDELETED = $xml->createElement("ISDELETED", "No"); $VOUCHER->appendChild($ISDELETED); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $VOUCHER->appendChild($CHANGEVCHMODE); $ALTERID = $xml->createElement("ALTERID", "14"); $VOUCHER->appendChild($ALTERID); $MASTERID = $xml->createElement("MASTERID", "9"); $VOUCHER->appendChild($MASTERID); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066536"); $VOUCHER->appendChild($VOUCHERKEY); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $VOUCHER->appendChild($AUDITENTRIES_LIST); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $EWAYBILLDETAILS_LIST = $xml->createElement("EWAYBILLDETAILS.LIST", " "); $VOUCHER->appendChild($EWAYBILLDETAILS_LIST); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //ALLLEDGERENTRIES.LIST block start for ($i=0; $i < 2; $i++) { $ALLLEDGERENTRIES_LIST_1 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_1); $OLDAUDITENTRYIDS_LIST_LA_1 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_LA_1->setAttribute("TYPE", "Number"); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRYIDS_LIST_LA_1); $OLDAUDITENTRYIDS_LA_1 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_1->appendChild($OLDAUDITENTRYIDS_LA_1); if($i == 0){ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger.""); }else{ $LEDGERNAME_1 = $xml->createElement("LEDGERNAME", "".$ms_ledger_two.""); } $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERNAME_1); $GSTCLASS_1 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_1); $ISDEEMEDPOSITIVE_1 = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISDEEMEDPOSITIVE_1); $LEDGERFROMITEM_1 = $xml->createElement("LEDGERFROMITEM", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($LEDGERFROMITEM_1); $REMOVEZEROENTRIES_1 = $xml->createElement("REMOVEZEROENTRIES", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($REMOVEZEROENTRIES_1); $ISPARTYLEDGER_1 = $xml->createElement("ISPARTYLEDGER", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISPARTYLEDGER_1); $ISLASTDEEMEDPOSITIVE_1 = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISLASTDEEMEDPOSITIVE_1); $ISCAPVATTAXALTERED_1 = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATTAXALTERED_1); $ISCAPVATNOTCLAIMED_1 = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $ALLLEDGERENTRIES_LIST_1->appendChild($ISCAPVATNOTCLAIMED_1); if($i == 0){ $AMOUNT_1 = $xml->createElement("AMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "-".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); }else{ $AMOUNT_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($AMOUNT_1); $VATEXPAMOUNT_1 = $xml->createElement("VATEXPAMOUNT", "".$amt_gross.""); $ALLLEDGERENTRIES_LIST_1->appendChild($VATEXPAMOUNT_1); } $SERVICETAXDETAILS_LIST_1 = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SERVICETAXDETAILS_LIST_1); //start If bill allocation is available if($trans_type == 'cash'){ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); }else{ if($i == 1){ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); $DATE_BA_1 = $xml->createElement("DATE", "".$m_date.""); $BANKALLOCATIONS_LIST_1->appendChild($DATE_BA_1); $INSTRUMENTDATE_BA_1 = $xml->createElement("INSTRUMENTDATE", "".$m_date.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTDATE_BA_1); $NAME_BA_1 = $xml->createElement("NAME", "78e5852b-2d90-45c5-ae44-14c11f53fda2"); $BANKALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $TRANSACTIONTYPE_BA_1 = $xml->createElement("TRANSACTIONTYPE", "Cheque"); $BANKALLOCATIONS_LIST_1->appendChild($TRANSACTIONTYPE_BA_1); $PAYMENTFAVOURING_BA_1 = $xml->createElement("PAYMENTFAVOURING", "".$m_ledger_name.""); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTFAVOURING_BA_1); $CHEQUECROSSCOMMENT_BA_1 = $xml->createElement("CHEQUECROSSCOMMENT", "A/c Payee"); $BANKALLOCATIONS_LIST_1->appendChild($CHEQUECROSSCOMMENT_BA_1); $INSTRUMENTNUMBER_BA_1 = $xml->createElement("INSTRUMENTNUMBER", "".$check_no.""); $BANKALLOCATIONS_LIST_1->appendChild($INSTRUMENTNUMBER_BA_1); $UNIQUEREFERENCENUMBER_BA_1 = $xml->createElement("UNIQUEREFERENCENUMBER", "4fsc5mOvdJLoDvnD"); $BANKALLOCATIONS_LIST_1->appendChild($UNIQUEREFERENCENUMBER_BA_1); $STATUS_BA_1 = $xml->createElement("STATUS", "No"); $BANKALLOCATIONS_LIST_1->appendChild($STATUS_BA_1); $PAYMENTMODE_BA_1 = $xml->createElement("PAYMENTMODE", "Transacted"); $BANKALLOCATIONS_LIST_1->appendChild($PAYMENTMODE_BA_1); $BANKPARTYNAME_BA_1 = $xml->createElement("BANKPARTYNAME", "".$m_ledger_name.""); $BANKALLOCATIONS_LIST_1->appendChild($BANKPARTYNAME_BA_1); $ISCONNECTEDPAYMENT_BA_1 = $xml->createElement("ISCONNECTEDPAYMENT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONNECTEDPAYMENT_BA_1); $ISSPLIT_BA_1 = $xml->createElement("ISSPLIT", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISSPLIT_BA_1); $ISCONTRACTUSED_BA_1 = $xml->createElement("ISCONTRACTUSED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISCONTRACTUSED_BA_1); $ISACCEPTEDWITHWARNING_BA_1 = $xml->createElement("ISACCEPTEDWITHWARNING", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISACCEPTEDWITHWARNING_BA_1); $ISTRANSFORCED_BA_1 = $xml->createElement("ISTRANSFORCED", "No"); $BANKALLOCATIONS_LIST_1->appendChild($ISTRANSFORCED_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "".$amt_gross.""); $BANKALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $CONTRACTDETAILS_LIST_BA_1 = $xml->createElement("CONTRACTDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($CONTRACTDETAILS_LIST_BA_1); $BANKSTATUSINFO_LIST_BA_1 = $xml->createElement("BANKSTATUSINFO.LIST", " "); $BANKALLOCATIONS_LIST_1->appendChild($BANKSTATUSINFO_LIST_BA_1); //end If bill allocation is available }else{ $BANKALLOCATIONS_LIST_1 = $xml->createElement("BANKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($BANKALLOCATIONS_LIST_1); } } $BILLALLOCATIONS_LIST_1 = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$NAME_BA_1 = $xml->createElement("NAME", "21, 28 & 29"); $BILLALLOCATIONS_LIST_1->appendChild($NAME_BA_1); $BILLTYPE_BA_1 = $xml->createElement("BILLTYPE", "New Ref"); $BILLALLOCATIONS_LIST_1->appendChild($BILLTYPE_BA_1); $TDSDEDUCTEEISSPECIALRATE_BA_1 = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $BILLALLOCATIONS_LIST_1->appendChild($TDSDEDUCTEEISSPECIALRATE_BA_1); $AMOUNT_BA_1 = $xml->createElement("AMOUNT", "5000,00"); $BILLALLOCATIONS_LIST_1->appendChild($AMOUNT_BA_1); $INTERESTCOLLECTION_LIST_BA_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($INTERESTCOLLECTION_LIST_BA_1); $STBILLCATEGORIES_LIST_BA_1 = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST_1->appendChild($STBILLCATEGORIES_LIST_BA_1);*/ $ALLLEDGERENTRIES_LIST_1->appendChild($BILLALLOCATIONS_LIST_1); $INTERESTCOLLECTION_LIST_1 = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INTERESTCOLLECTION_LIST_1); $OLDAUDITENTRIES_LIST_1 = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($OLDAUDITENTRIES_LIST_1); $ACCOUNTAUDITENTRIES_LIST_1 = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ACCOUNTAUDITENTRIES_LIST_1); $AUDITENTRIES_LIST_1 = $xml->createElement("AUDITENTRIES.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($AUDITENTRIES_LIST_1); $INPUTCRALLOCS_LIST_1 = $xml->createElement("INPUTCRALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INPUTCRALLOCS_LIST_1); $DUTYHEADDETAILS_LIST_1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($DUTYHEADDETAILS_LIST_1); $EXCISEDUTYHEADDETAILS_LIST_1 = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEDUTYHEADDETAILS_LIST_1); $RATEDETAILS_LIST_1 = $xml->createElement("RATEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($RATEDETAILS_LIST_1); $SUMMARYALLOCS_LIST_1 = $xml->createElement("SUMMARYALLOCS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($SUMMARYALLOCS_LIST_1); $STPYMTDETAILS_LIST_1 = $xml->createElement("STPYMTDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($STPYMTDETAILS_LIST_1); $EXCISEPAYMENTALLOCATIONS_LIST_1 = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_1); $TAXBILLALLOCATIONS_LIST_1 = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXBILLALLOCATIONS_LIST_1); $TAXOBJECTALLOCATIONS_LIST_1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TAXOBJECTALLOCATIONS_LIST_1); $TDSEXPENSEALLOCATIONS_LIST_1 = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($TDSEXPENSEALLOCATIONS_LIST_1); $VATSTATUTORYDETAILS_LIST_1 = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATSTATUTORYDETAILS_LIST_1); $COSTTRACKALLOCATIONS_LIST_1 = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($COSTTRACKALLOCATIONS_LIST_1); $REFVOUCHERDETAILS_LIST_1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($REFVOUCHERDETAILS_LIST_1); $INVOICEWISEDETAILS_LIST_1 = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($INVOICEWISEDETAILS_LIST_1); $VATITCDETAILS_LIST_1 = $xml->createElement("VATITCDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($VATITCDETAILS_LIST_1); $ADVANCETAXDETAILS_LIST_1 = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $ALLLEDGERENTRIES_LIST_1->appendChild($ADVANCETAXDETAILS_LIST_1); } /*$ALLLEDGERENTRIES_LIST_2 = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $VOUCHER->appendChild($ALLLEDGERENTRIES_LIST_2); $OLDAUDITENTRYIDS_LIST_LA_2 = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $ALLLEDGERENTRIES_LIST_2->appendChild($OLDAUDITENTRYIDS_LIST_LA_2); $OLDAUDITENTRYIDS_LA_2 = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $OLDAUDITENTRYIDS_LIST_LA_2->appendChild($OLDAUDITENTRYIDS_LA_2); $LEDGERNAME_2 = $xml->createElement("LEDGERNAME", "Bank of Baroda"); $ALLLEDGERENTRIES_LIST_2->appendChild($LEDGERNAME_2); $GSTCLASS_2 = $xml->createElement("GSTCLASS", ""); $ALLLEDGERENTRIES_LIST_1->appendChild($GSTCLASS_2);*/ // ALLLEDGERENTRIES.LIST block end $PAYROLLMODEOFPAYMENT_LIST = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST); $ATTDRECORDS_LIST = $xml->createElement("ATTDRECORDS.LIST", " "); $VOUCHER->appendChild($ATTDRECORDS_LIST); $GSTEWAYCONSIGNORADDRESS_LIST = $xml->createElement("GSTEWAYCONSIGNORADDRESS.LIST", " "); $VOUCHER->appendChild($GSTEWAYCONSIGNORADDRESS_LIST); $GSTEWAYCONSIGNEEADDRESS_LIST = $xml->createElement("GSTEWAYCONSIGNEEADDRESS.LIST", " "); $VOUCHER->appendChild($GSTEWAYCONSIGNEEADDRESS_LIST); $TEMPGSTRATEDETAILS_LIST = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST); /* for ($t=0; $t < 2; $t++) { $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $COMPANY_1 = $xml->createElement("COMPANY", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY_1); $REMOTECMPINFO_1 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO_1->setAttribute("MERGE", "Yes"); $COMPANY_1->appendChild($REMOTECMPINFO_1); $NAME_TALLY_2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_1->appendChild($NAME_TALLY_2); $REMOTECMPNAME_1 = $xml->createElement("REMOTECMPNAME", "Sndp & Co"); $REMOTECMPINFO_1->appendChild($REMOTECMPNAME_1); $REMOTECMPSTATE_1 = $xml->createElement("REMOTECMPSTATE", "Gujarat"); $REMOTECMPINFO_1->appendChild($REMOTECMPSTATE_1); }*/ /* $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3);*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } //functions for XML public function xml_purchase($fid, $eight_randnum){ //$where = array('fid' => $fid); //$form = $this->model->DetailData('tbl_form', $where); $form = $this->model->sm($fid); $note_two = $form[0]['note_two']; if($note_two == 'form_two'){ $this->xml_purchase_two($fid, $eight_randnum); } $form2 = $this->model->salesModel($fid); $form3 = $this->model->salesExpenseModel($fid); $info_cnt = count($form2); $info_cnt2 = count($form3); //echo "<pre>"; print_r($form2); die; $tot_g_sgst = 0; $tot_g_cgst = 0; $tot_g_ugst = 0; $tot_g_igst = 0; for ($g=0; $g < $info_cnt2; $g++) { //foreach ($form3 as $gst => $g) { $gamt = $form3[$g]['ex_amount']; $g_sgst = $form3[$g]['sgst']; $g_cgst = $form3[$g]['cgst']; $g_ugst = $form3[$g]['ugst']; $g_igst = $form3[$g]['igst']; if($g_sgst != '0.00'){ $g_sgst_payble = $gamt*$g_sgst/100; //echo "--payble sgst<br>"; $tot_g_sgst += $g_sgst_payble; } if($g_cgst != '0.00'){ $g_cgst_payble = $gamt*$g_cgst/100; //echo "--payble cgst<br>"; $tot_g_cgst += $g_cgst_payble; } if($g_ugst != '0.00'){ $g_ugst_payble = $gamt*$g_ugst/100; //echo "--payble ugst<br>"; $tot_g_ugst += $g_ugst_payble; } if($g_igst != '0.00'){ $g_igst_payble = $gamt*$g_igst/100; //echo "--payble cgst<br>"; $tot_g_igst += $g_igst_payble; } } $tot_g_sgst; $tot_g_cgst; $tot_g_ugst; $tot_g_igst; $all_gst_tot = $tot_g_sgst+$tot_g_cgst+$tot_g_ugst+$tot_g_igst; // sum of same other expenses $result = array(); foreach($form3 as $k => $v) { $id = $v['ex_name']; $result[$id][] = $v['ex_amount']; } $other_expense = array(); foreach($result as $key => $value) { $where_exp = array('eid' => $key); $i_name = $this->model->DetailData('tbl_expense', $where_exp); $in = $i_name[0]['ename']; $other_expense[] = array('ex_name' => $key, 'ex_amount' => array_sum($value), 'iname' => $in); } //echo '<pre>'; print_r($other_expense); // sum of same other expenses $oecnt = count($other_expense); //die; $tsgst = 0; $tcgst = 0; $tugst = 0; $tigst = 0; foreach ($form2 as $total => $tot) { $sgst = $tot['s_aot']; $cgst = $tot['c_aot']; $ugst = $tot['u_aot']; $igst = $tot['i_aot']; $tsgst+=$sgst; $tcgst+=$cgst; $tugst+=$ugst; $tigst+=$igst; } /*echo $tsgst."s<br>"; echo $tcgst."c<br>"; echo $tugst."u<br>"; echo $tigst; die; */ $frm = $this->model->sales_form_data($fid); $amt_gross = $frm[0]['amt_gross']; $new_tot_expns = 0; $amt_tax = 0; foreach ($frm as $key => $tot) { $expns = $tot['expenses']; $amt_taxable = $tot['amt_taxable']; $tot_expns = 0; if($expns != ''){ foreach ($expns as $tt => $t) { $newtt = $t['ex_amount']; $tot_expns+=$newtt; } }else{ $tot_expns = 0; } $new_tot_expns+=$tot_expns; $amt_tax+=$amt_taxable; } $new_tot_expns; $amt_tax; $tot_tax = $tsgst+$tcgst+$tugst+$tigst; $totdebit = $new_tot_expns+$tot_tax+$amt_tax+$all_gst_tot; /*echo $amt_gross."<br>"; echo $totdebit; die; */ $diff_amt = round(abs($amt_gross - $totdebit),2); $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $m_ledger_name = $form[0]['l_name']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; if($amt_gross < $totdebit){ $amt_gross = $amt_gross + $diff_amt; }else{ $amt_gross = $amt_gross; } // Set the content type to be XML, so that the browser will recognise it as XML. header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " SANDIP COMPANY "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Invoice Voucher View"); $adrs_list = $xml->createElement("ADDRESS.LIST", " "); $adrs_list->setAttribute("TYPE", "String"); $adrs = $xml->createElement("ADDRESS", "Gujarat, India"); $basic_buy_list = $xml->createElement("BASICBUYERADDRESS.LIST", " "); $basic_buy_list->setAttribute("TYPE", "String"); $basic_buy_adrs = $xml->createElement("BASICBUYERADDRESS", "Gujarat, India"); $OLDAUDITENTRYIDS_list = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_list->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $DATE = $xml->createElement("DATE", "".$m_date.""); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $STATENAME = $xml->createElement("STATENAME", "Gujarat"); $COUNTRYOFRESIDENCE = $xml->createElement("COUNTRYOFRESIDENCE", "India"); $PARTYNAME = $xml->createElement("PARTYNAME", "".$m_ledger_name.""); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$m_ledger_name.""); $BASICBASEPARTYNAME = $xml->createElement("BASICBASEPARTYNAME", "".$m_ledger_name.""); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Invoice Voucher View"); $PLACEOFSUPPLY = $xml->createElement("PLACEOFSUPPLY", "Gujarat"); $BASICBUYERNAME = $xml->createElement("BASICBUYERNAME", "".$m_ledger_name.""); $BASICDATETIMEOFINVOICE = $xml->createElement("BASICDATETIMEOFINVOICE", "".$basic_date_time.""); $BASICDATETIMEOFREMOVAL = $xml->createElement("BASICDATETIMEOFREMOVAL", "".$basic_date_time.""); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $CONSIGNEESTATENAME = $xml->createElement("CONSIGNEESTATENAME", "Gujarat"); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $AUDITED = $xml->createElement("AUDITED", "No"); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $IGNOREPOSVALIDATION = $xml->createElement("IGNOREPOSVALIDATION", "No"); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $ISVATPAIDATCUSTOMS = $xml->createElement("ISVATPAIDATCUSTOMS", "No"); $ISDECLAREDTOCUSTOMS = $xml->createElement("ISDECLAREDTOCUSTOMS", "No"); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $IGNOREGSTINVALIDATION = $xml->createElement("IGNOREGSTINVALIDATION", "No"); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $ISBOENOTAPPLICABLE = $xml->createElement("ISBOENOTAPPLICABLE", "No"); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $ISOVERSEASTOURISTTRANS = $xml->createElement("ISOVERSEASTOURISTTRANS", "No"); $ISDESIGNATEDZONEPARTY = $xml->createElement("ISDESIGNATEDZONEPARTY", "No"); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "No"); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $ISINVOICE = $xml->createElement("ISINVOICE", "Yes"); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "Yes"); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $ISVOID = $xml->createElement("ISVOID", "No"); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $ISDELETED = $xml->createElement("ISDELETED", "No"); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $ALTERID = $xml->createElement("ALTERID", "29"); $MASTERID = $xml->createElement("MASTERID", "14"); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066560"); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $EWAYBILLDETAILS_LIST = $xml->createElement("EWAYBILLDETAILS.LIST", " "); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); $VOUCHER->appendChild($adrs_list); $adrs_list->appendChild($adrs); $VOUCHER->appendChild($basic_buy_list); $basic_buy_list->appendChild($basic_buy_adrs); $VOUCHER->appendChild($OLDAUDITENTRYIDS_list); $OLDAUDITENTRYIDS_list->appendChild($OLDAUDITENTRYIDS); $VOUCHER->appendChild($DATE); $VOUCHER->appendChild($GUID); $VOUCHER->appendChild($STATENAME); $VOUCHER->appendChild($COUNTRYOFRESIDENCE); $VOUCHER->appendChild($PARTYNAME); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHER->appendChild($VOUCHERNUMBER); $VOUCHER->appendChild($PARTYLEDGERNAME); $VOUCHER->appendChild($BASICBASEPARTYNAME); $VOUCHER->appendChild($CSTFORMISSUETYPE); $VOUCHER->appendChild($CSTFORMRECVTYPE); $VOUCHER->appendChild($FBTPAYMENTTYPE); $VOUCHER->appendChild($PERSISTEDVIEW); $VOUCHER->appendChild($PLACEOFSUPPLY); $VOUCHER->appendChild($BASICBUYERNAME); $VOUCHER->appendChild($BASICDATETIMEOFINVOICE); $VOUCHER->appendChild($BASICDATETIMEOFREMOVAL); $VOUCHER->appendChild($VCHGSTCLASS); $VOUCHER->appendChild($CONSIGNEESTATENAME); $VOUCHER->appendChild($DIFFACTUALQTY); $VOUCHER->appendChild($ISMSTFROMSYNC); $VOUCHER->appendChild($ASORIGINAL); $VOUCHER->appendChild($AUDITED); $VOUCHER->appendChild($FORJOBCOSTING); $VOUCHER->appendChild($ISOPTIONAL); $VOUCHER->appendChild($EFFECTIVEDATE); $VOUCHER->appendChild($USEFOREXCISE); $VOUCHER->appendChild($ISFORJOBWORKIN); $VOUCHER->appendChild($ALLOWCONSUMPTION); $VOUCHER->appendChild($USEFORINTEREST); $VOUCHER->appendChild($USEFORGAINLOSS); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $VOUCHER->appendChild($USEFORCOMPOUND); $VOUCHER->appendChild($USEFORSERVICETAX); $VOUCHER->appendChild($ISEXCISEVOUCHER); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $VOUCHER->appendChild($IGNOREPOSVALIDATION); $VOUCHER->appendChild($EXCISEOPENING); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $VOUCHER->appendChild($ISVATOVERRIDDEN); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $VOUCHER->appendChild($ISVATPAIDATCUSTOMS); $VOUCHER->appendChild($ISDECLAREDTOCUSTOMS); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $VOUCHER->appendChild($ISISDVOUCHER); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $VOUCHER->appendChild($GSTNOTEXPORTED); $VOUCHER->appendChild($IGNOREGSTINVALIDATION); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $VOUCHER->appendChild($ISBOENOTAPPLICABLE); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $VOUCHER->appendChild($ISOVERSEASTOURISTTRANS); $VOUCHER->appendChild($ISDESIGNATEDZONEPARTY); $VOUCHER->appendChild($ISCANCELLED); $VOUCHER->appendChild($HASCASHFLOW); $VOUCHER->appendChild($ISPOSTDATED); $VOUCHER->appendChild($USETRACKINGNUMBER); $VOUCHER->appendChild($ISINVOICE); $VOUCHER->appendChild($MFGJOURNAL); $VOUCHER->appendChild($HASDISCOUNTS); $VOUCHER->appendChild($ASPAYSLIP); $VOUCHER->appendChild($ISCOSTCENTRE); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $VOUCHER->appendChild($ISBLANKCHEQUE); $VOUCHER->appendChild($ISVOID); $VOUCHER->appendChild($ISONHOLD); $VOUCHER->appendChild($ORDERLINESTATUS); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VOUCHER->appendChild($VATISPURCEXEMPTED); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $VOUCHER->appendChild($ISVATDUTYPAID); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $VOUCHER->appendChild($ISDELETED); $VOUCHER->appendChild($CHANGEVCHMODE); $VOUCHER->appendChild($ALTERID); $VOUCHER->appendChild($MASTERID); $VOUCHER->appendChild($VOUCHERKEY); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $VOUCHER->appendChild($AUDITENTRIES_LIST); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $VOUCHER->appendChild($EWAYBILLDETAILS_LIST); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //star for credit ledger $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$m_ledger_name.""); $GSTCLASSdl = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "Yes"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$amt_gross.""); //diff_amt $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $bill_name = $xml->createElement("NAME", "".$voucher_no.""); $bill_type = $xml->createElement("BILLTYPE", "New Ref"); $bill_tds = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $bill_amount = $xml->createElement("AMOUNT", "".$amt_gross.""); $bill_interest = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $bill_stcat = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST->appendChild($bill_name); $BILLALLOCATIONS_LIST->appendChild($bill_type); $BILLALLOCATIONS_LIST->appendChild($bill_tds); $BILLALLOCATIONS_LIST->appendChild($bill_amount); $BILLALLOCATIONS_LIST->appendChild($bill_interest); $BILLALLOCATIONS_LIST->appendChild($bill_stcat); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASSdl); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); //end for debit ledger if($amt_gross > $totdebit){ // Start of Round of $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "Round Amount"); $GSTCLASS_oe = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$diff_amt.""); $VATEXPAMOUNT_LE = $xml->createElement("VATEXPAMOUNT", "".$diff_amt.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_oe); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); // End of Round of } //star for other expenses ledger for ($oe=0; $oe < $oecnt; $oe++) { $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$other_expense[$oe]['iname'].""); $GSTCLASS_oe = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$other_expense[$oe]['ex_amount'].""); $VATEXPAMOUNT_LE = $xml->createElement("VATEXPAMOUNT", "-".$other_expense[$oe]['ex_amount'].""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_oe); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for other expenses ledger //star for CGST ledger if($tcgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_Ca = $xml->createElement("ROUNDTYPE", ""); $GSTCLASS_c = $xml->createElement("GSTCLASS", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "CGST"); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $forcgst = $tcgst+$tot_g_cgst; $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$forcgst.""); $VATEXPAMOUNT_C = $xml->createElement("VATEXPAMOUNT", "-".$forcgst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_Ca); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_c); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_C); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for CGST ledger //star for SGST ledger if($tsgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_S = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "SGST"); $GSTCLASS_s = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $forsgst = $tsgst+$tot_g_sgst; $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$forsgst.""); $AMOUNT_S = $xml->createElement("VATEXPAMOUNT", "-".$forsgst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_S); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_s); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_S); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for SGST ledger //star for UGST ledger if($tugst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_U = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "UGST"); $GSTCLASS_u = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $forugst = $tugst+$tot_g_ugst; $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$forugst.""); $AMOUNT_U = $xml->createElement("VATEXPAMOUNT", "-".$forugst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_U); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_u); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_U); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for UGST ledger //star for IGST ledger if($tigst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("LEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_I = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "IGST"); $GSTCLASS_i = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $forigst = $tigst+$tot_g_igst; $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$forigst.""); $AMOUNT_I = $xml->createElement("VATEXPAMOUNT", "-".$forigst.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_I); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_i); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_I); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for IGST ledger for ($inv=0; $inv < $info_cnt; $inv++) { $item_name = $form2[$inv]['item']; $rate = $form2[$inv]['rate']; $discount = $form2[$inv]['discount_two']; $amount = $form2[$inv]['amt_taxable']; $qty = $form2[$inv]['qty']; $s_ledger_name = $form2[$inv]['l_name']; $ALLINVENTORYENTRIES_LIST = $xml->createElement("ALLINVENTORYENTRIES.LIST", " "); $STOCKITEMNAME = $xml->createElement("STOCKITEMNAME", "".$item_name.""); $ISDEEMEDPOSITIVE_LE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $ISLASTDEEMEDPOSITIVE_LE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISAUTONEGATE = $xml->createElement("ISAUTONEGATE", "No"); $ISCUSTOMSCLEARANCE = $xml->createElement("ISCUSTOMSCLEARANCE", "No"); $ISTRACKCOMPONENT = $xml->createElement("ISTRACKCOMPONENT", "No"); $ISTRACKPRODUCTION = $xml->createElement("ISTRACKPRODUCTION", "No"); $ISPRIMARYITEM = $xml->createElement("ISPRIMARYITEM", "No"); $ISSCRAP = $xml->createElement("ISSCRAP", "No"); $RATE = $xml->createElement("RATE", "".$rate.""); $DISCOUNT = $xml->createElement("DISCOUNT", "".$discount.""); $AMOUNT = $xml->createElement("AMOUNT", "-".$amount.""); $ACTUALQTY_AE = $xml->createElement("ACTUALQTY", "".$qty.""); $BILLEDQTY_AE = $xml->createElement("BILLEDQTY", "".$qty.""); $BATCHALLOCATIONS_LIST = $xml->createElement("BATCHALLOCATIONS.LIST", " "); $GODOWNNAME = $xml->createElement("GODOWNNAME", "Main Location"); $BATCHNAME = $xml->createElement("BATCHNAME", "Primary Batch"); $INDENTNO = $xml->createElement("INDENTNO", ""); $ORDERNO = $xml->createElement("ORDERNO", ""); $TRACKINGNUMBER = $xml->createElement("TRACKINGNUMBER", ""); $DYNAMICCSTISCLEARED = $xml->createElement("DYNAMICCSTISCLEARED", "No"); $AMOUNT_ba = $xml->createElement("AMOUNT", "-".$amount.""); $ACTUALQTY = $xml->createElement("ACTUALQTY", "".$qty.""); $BILLEDQTY = $xml->createElement("BILLEDQTY", "".$qty.""); $ADDITIONALDETAILS_LIST = $xml->createElement("ADDITIONALDETAILS.LIST", " "); $VOUCHERCOMPONENTLIST_LIST = $xml->createElement("VOUCHERCOMPONENTLIST.LIST", " "); $ACCOUNTINGALLOCATIONS_LIST = $xml->createElement("ACCOUNTINGALLOCATIONS.LIST", " "); $OLDAUDITENTRYIDS_LIST_AIE = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST_AIE->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_AIE = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME_AIE = $xml->createElement("LEDGERNAME", "".$s_ledger_name.""); $GSTCLASS_AIE = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE_AIE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM_AIE = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES_AIE = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER_AIE = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE_AIE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED_AIE = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED_AIE = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_AIE = $xml->createElement("AMOUNT", "-".$amount.""); $SERVICETAXDETAILS_LIST_AIE = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST_AIE = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST_AIE = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST_AIE = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AIE = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AIE = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AIE = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AIE = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_AIE1 = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST_AIE = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST_AL = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST_AIE = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST_AIE = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST_AIE = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST_AIE = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST_AIE1 = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST_AIE = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST_AIE = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST_AIE = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST_AIE1 = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST_AIE = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_AIE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST_AIE = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $DUTYHEADDETAILS_LIST_AIE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $SUPPLEMENTARYDUTYHEADDETAILS_LIST_AIE = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST_AIE = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST_AIE = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $EXCISEALLOCATIONS_LIST_AIE = $xml->createElement("EXCISEALLOCATIONS.LIST", " "); $EXPENSEALLOCATIONS_LIST_AIE = $xml->createElement("EXPENSEALLOCATIONS.LIST", " "); $VOUCHER->appendChild($ALLINVENTORYENTRIES_LIST); $ALLINVENTORYENTRIES_LIST->appendChild($STOCKITEMNAME); $ALLINVENTORYENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE_LE); $ALLINVENTORYENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE_LE); $ALLINVENTORYENTRIES_LIST->appendChild($ISAUTONEGATE); $ALLINVENTORYENTRIES_LIST->appendChild($ISCUSTOMSCLEARANCE); $ALLINVENTORYENTRIES_LIST->appendChild($ISTRACKCOMPONENT); $ALLINVENTORYENTRIES_LIST->appendChild($ISTRACKPRODUCTION); $ALLINVENTORYENTRIES_LIST->appendChild($ISPRIMARYITEM); $ALLINVENTORYENTRIES_LIST->appendChild($ISSCRAP); $ALLINVENTORYENTRIES_LIST->appendChild($RATE); $ALLINVENTORYENTRIES_LIST->appendChild($DISCOUNT); $ALLINVENTORYENTRIES_LIST->appendChild($AMOUNT); $ALLINVENTORYENTRIES_LIST->appendChild($ACTUALQTY_AE); $ALLINVENTORYENTRIES_LIST->appendChild($BILLEDQTY_AE); $ALLINVENTORYENTRIES_LIST->appendChild($BATCHALLOCATIONS_LIST); $BATCHALLOCATIONS_LIST->appendChild($GODOWNNAME); $BATCHALLOCATIONS_LIST->appendChild($BATCHNAME); $BATCHALLOCATIONS_LIST->appendChild($INDENTNO); $BATCHALLOCATIONS_LIST->appendChild($ORDERNO); $BATCHALLOCATIONS_LIST->appendChild($TRACKINGNUMBER); $BATCHALLOCATIONS_LIST->appendChild($DYNAMICCSTISCLEARED); $BATCHALLOCATIONS_LIST->appendChild($AMOUNT_ba); $BATCHALLOCATIONS_LIST->appendChild($ACTUALQTY); $BATCHALLOCATIONS_LIST->appendChild($BILLEDQTY); $BATCHALLOCATIONS_LIST->appendChild($ADDITIONALDETAILS_LIST); $BATCHALLOCATIONS_LIST->appendChild($VOUCHERCOMPONENTLIST_LIST); $ALLINVENTORYENTRIES_LIST->appendChild($ACCOUNTINGALLOCATIONS_LIST); $ACCOUNTINGALLOCATIONS_LIST->appendChild($OLDAUDITENTRYIDS_LIST_AIE); $OLDAUDITENTRYIDS_LIST_AIE->appendChild($OLDAUDITENTRYIDS_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($LEDGERNAME_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($GSTCLASS_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISDEEMEDPOSITIVE_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($LEDGERFROMITEM_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($REMOVEZEROENTRIES_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISPARTYLEDGER_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISLASTDEEMEDPOSITIVE_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISCAPVATTAXALTERED_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ISCAPVATNOTCLAIMED_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($AMOUNT_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($SERVICETAXDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($BANKALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($BILLALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($INTERESTCOLLECTION_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($OLDAUDITENTRIES_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($AUDITENTRIES_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($INPUTCRALLOCS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($DUTYHEADDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($RATEDETAILS_LIST_AL); $ACCOUNTINGALLOCATIONS_LIST->appendChild($SUMMARYALLOCS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($STPYMTDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($TAXBILLALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($VATSTATUTORYDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($COSTTRACKALLOCATIONS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($REFVOUCHERDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($INVOICEWISEDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($VATITCDETAILS_LIST_AIE); $ACCOUNTINGALLOCATIONS_LIST->appendChild($ADVANCETAXDETAILS_LIST_AIE); $ALLINVENTORYENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_AIE1); $ALLINVENTORYENTRIES_LIST->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST_AIE); $ALLINVENTORYENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST_AIE1); $ALLINVENTORYENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST_AIE1); $ALLINVENTORYENTRIES_LIST->appendChild($EXCISEALLOCATIONS_LIST_AIE); $ALLINVENTORYENTRIES_LIST->appendChild($EXPENSEALLOCATIONS_LIST_AIE); } $PAYROLLMODEOFPAYMENT_LIST_v = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $ATTDRECORDS_LIST_v = $xml->createElement("ATTDRECORDS.LIST", " "); $GSTEWAYCONSIGNORADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNORADDRESS.LIST", " "); $GSTEWAYCONSIGNEEADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNEEADDRESS.LIST", " "); $TEMPGSTRATEDETAILS_LIST_v = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST_v); $VOUCHER->appendChild($ATTDRECORDS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNORADDRESS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNEEADDRESS_LIST_v); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST_v); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY2 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO2 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO2->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME2 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE2 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_NAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPNAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPSTATE2); $COMPANY2->appendChild($REMOTECMPINFO2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY3 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO3 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO3->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME3 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME3 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE3 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_NAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPNAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPSTATE3); $COMPANY3->appendChild($REMOTECMPINFO3); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->appendChild($COMPANY3); $test = $xml->createElement("TALLYMESSAGE", " "); $test->setAttribute("xmlns:UDF", "TallyUDF"); //Set the attributes. /*$xml_HEADER->setAttribute("length", "0:01:15"); $xml_HEADER->setAttribute("bitrate", "64kb/s"); $xml_HEADER->setAttribute("channels", "2");*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3); //for ($i = 1; $i <2; $i++) { // $test = '$name_' . $i; // $test = $xml->createElement("TALLYMESSAGE", " "); // $test->setAttribute("xmlns:UDF", "TallyUDF"); // $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($test); //} $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); } public function add_sales_two(){ //echo "<pre>"; print_r($_POST); die; $m_date = date("Y-m-d", strtotime($this->input->post('date'))); $d = date("d", strtotime($this->input->post('date'))); $m = date("m", strtotime($this->input->post('date'))); $ses = $this->session->get_userdata(); $oid = $ses['reg_info'][0]['rid']; /*$path = explode('/', $this->input->post('path')); $year = $path[2]; $m1 = explode('_',$path[3]); $month = $m1[1];*/ $year = $this->input->post('year'); $month = $this->input->post('month'); $ins_main = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'd' => $d, 'm' => $m, 'path' => $this->input->post('path'), 'm_date' => $m_date, 'voucher_no' => $this->input->post('voucher_no'), 'ref_no' => $this->input->post('ref_no'), 'm_ledger_name' => $this->input->post('dr_ledger'), 'amt_gross' => $this->input->post('amt_gross'), 'narration' => $this->input->post('narration'), 'release_status' => 'released', 'approve_status' => 'panding', 'note_two' => 'form_two', 'l_noti' => 'unseen' ); $ins = $this->model->insertData('tbl_form', $ins_main); $cr_ledger = $this->input->post('cr_ledger'); $cr_amt = $this->input->post('cr_amt'); $sgst = $this->input->post('sgst'); $s_aot = $this->input->post('sgst_tax_amt'); $cgst = $this->input->post('cgst'); $c_aot = $this->input->post('cgst_tax_amt'); $ugst = $this->input->post('ugst'); $u_aot = $this->input->post('ugst_tax_amt'); $igst = $this->input->post('igst'); $i_aot = $this->input->post('igst_tax_amt'); //$cess_code = $this->input->post('cess_code'); if(empty($sgst)){ $sgst = '0.00'; } if(empty($cgst)){ $cgst = '0.00'; } if(empty($ugst)){ $ugst = '0.00'; } if(empty($igst)){ $igst = '0.00'; } if(empty($discount_one)){ $discount_one = '0.00'; } if(empty($discount_two)){ $discount_two = '0.00'; } $ins_sub = array( 'fid' => $ins, 's_ledger_name' => $cr_ledger, 'amt_taxable' => $cr_amt, 'sgst' => $sgst, 's_aot' => $s_aot, 'cgst' => $cgst, 'c_aot' => $c_aot, 'ugst' => $ugst, 'u_aot' => $u_aot, 'igst' => $igst, 'i_aot' => $i_aot, //'cess_code' => $cess_code[$i], ); $ins2 = $this->model->insertData('tbl_form_info', $ins_sub); $exp_path = explode('|-|', $this->input->post('path')); $epc = count($exp_path); for ($i=0; $i < $epc; $i++) { /* $ins_form_status = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'stage' => $this->input->post('stage'), 'year' => $year, 'month' => $month, 'path' => $exp_path[$i] ); */ //$this->model->insertData('tbl_form_status', $ins_form_status); $ins_form_status = array( 'filled_status' => 'done' ); $if_where = array( 'cid' => $this->input->post('cid'), 'oid' => $oid, 'path' => $exp_path[$i] ); $this->model->UpdateData('tbl_form_status', $ins_form_status, $if_where); } redirect('webapp/office/form_grid'); } public function xml_sales_two($fid, $eight_randnum){ //echo $eight_randnum; die; $form = $this->model->sales_two_model($fid); $cgst = $form[0]['cgst']; $c_aot = $form[0]['c_aot']; $sgst = $form[0]['sgst']; $s_aot = $form[0]['s_aot']; $ugst = $form[0]['ugst']; $u_aot = $form[0]['u_aot']; $igst = $form[0]['igst']; $i_aot = $form[0]['i_aot']; //echo "<pre>"; print_r($form); die; $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $dr_ledger = $form[0]['dr_ledger']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $cr_ledger = $form[0]['cr_ledger']; $cr_amount = $form[0]['amt_taxable']; // Set the content type to be XML, so th header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " Star One Web "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); // $adrs_list = $xml->createElement("ADDRESS.LIST", " "); // $adrs_list->setAttribute("TYPE", "String"); // $adrs = $xml->createElement("ADDRESS", "Gujarat, India"); // $basic_buy_list = $xml->createElement("BASICBUYERADDRESS.LIST", " "); // $basic_buy_list->setAttribute("TYPE", "String"); // $basic_buy_adrs = $xml->createElement("BASICBUYERADDRESS", "Gujarat, India"); $OLDAUDITENTRYIDS_list = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_list->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $DATE = $xml->createElement("DATE", "".$m_date.""); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $STATENAME = $xml->createElement("STATENAME", "Gujarat"); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $COUNTRYOFRESIDENCE = $xml->createElement("COUNTRYOFRESIDENCE", "India"); //$PARTYNAME = $xml->createElement("PARTYNAME", "".$dr_ledger.""); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $REFERENCE = $xml->createElement("REFERENCE", "".$voucher_no.""); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$dr_ledger.""); $BASICBASEPARTYNAME = $xml->createElement("BASICBASEPARTYNAME", "".$dr_ledger.""); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); //$PLACEOFSUPPLY = $xml->createElement("PLACEOFSUPPLY", "Gujarat"); $BASICBUYERNAME = $xml->createElement("BASICBUYERNAME", "".$dr_ledger.""); $BASICDATETIMEOFINVOICE = $xml->createElement("BASICDATETIMEOFINVOICE", "".$basic_date_time.""); $BASICDATETIMEOFREMOVAL = $xml->createElement("BASICDATETIMEOFREMOVAL", "".$basic_date_time.""); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $ENTEREDBY = $xml->createElement("ENTEREDBY", "Admin"); //$CONSIGNEESTATENAME = $xml->createElement("CONSIGNEESTATENAME", "Gujarat"); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $AUDITED = $xml->createElement("AUDITED", "No"); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $IGNOREPOSVALIDATION = $xml->createElement("IGNOREPOSVALIDATION", "No"); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $ISVATPAIDATCUSTOMS = $xml->createElement("ISVATPAIDATCUSTOMS", "No"); $ISDECLAREDTOCUSTOMS = $xml->createElement("ISDECLAREDTOCUSTOMS", "No"); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $IGNOREGSTINVALIDATION = $xml->createElement("IGNOREGSTINVALIDATION", "No"); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $ISBOENOTAPPLICABLE = $xml->createElement("ISBOENOTAPPLICABLE", "No"); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $ISOVERSEASTOURISTTRANS = $xml->createElement("ISOVERSEASTOURISTTRANS", "No"); $ISDESIGNATEDZONEPARTY = $xml->createElement("ISDESIGNATEDZONEPARTY", "No"); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "No"); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $ISVOID = $xml->createElement("ISVOID", "No"); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $ISDELETED = $xml->createElement("ISDELETED", "No"); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $ALTERID = $xml->createElement("ALTERID", "29"); $MASTERID = $xml->createElement("MASTERID", "14"); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066560"); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $EWAYBILLDETAILS_LIST = $xml->createElement("EWAYBILLDETAILS.LIST", " "); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); /*$VOUCHER->appendChild($adrs_list); $adrs_list->appendChild($adrs); $VOUCHER->appendChild($basic_buy_list); $basic_buy_list->appendChild($basic_buy_adrs); */ $VOUCHER->appendChild($OLDAUDITENTRYIDS_list); $OLDAUDITENTRYIDS_list->appendChild($OLDAUDITENTRYIDS); $VOUCHER->appendChild($DATE); $VOUCHER->appendChild($GUID); $VOUCHER->appendChild($STATENAME); $VOUCHER->appendChild($NARRATION); $VOUCHER->appendChild($COUNTRYOFRESIDENCE); //$VOUCHER->appendChild($PARTYNAME); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHER->appendChild($REFERENCE); $VOUCHER->appendChild($VOUCHERNUMBER); $VOUCHER->appendChild($PARTYLEDGERNAME); $VOUCHER->appendChild($BASICBASEPARTYNAME); $VOUCHER->appendChild($CSTFORMISSUETYPE); $VOUCHER->appendChild($CSTFORMRECVTYPE); $VOUCHER->appendChild($FBTPAYMENTTYPE); $VOUCHER->appendChild($PERSISTEDVIEW); //$VOUCHER->appendChild($PLACEOFSUPPLY); $VOUCHER->appendChild($BASICBUYERNAME); $VOUCHER->appendChild($BASICDATETIMEOFINVOICE); $VOUCHER->appendChild($BASICDATETIMEOFREMOVAL); $VOUCHER->appendChild($VCHGSTCLASS); $VOUCHER->appendChild($ENTEREDBY); //$VOUCHER->appendChild($CONSIGNEESTATENAME); $VOUCHER->appendChild($DIFFACTUALQTY); $VOUCHER->appendChild($ISMSTFROMSYNC); $VOUCHER->appendChild($ASORIGINAL); $VOUCHER->appendChild($AUDITED); $VOUCHER->appendChild($FORJOBCOSTING); $VOUCHER->appendChild($ISOPTIONAL); $VOUCHER->appendChild($EFFECTIVEDATE); $VOUCHER->appendChild($USEFOREXCISE); $VOUCHER->appendChild($ISFORJOBWORKIN); $VOUCHER->appendChild($ALLOWCONSUMPTION); $VOUCHER->appendChild($USEFORINTEREST); $VOUCHER->appendChild($USEFORGAINLOSS); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $VOUCHER->appendChild($USEFORCOMPOUND); $VOUCHER->appendChild($USEFORSERVICETAX); $VOUCHER->appendChild($ISEXCISEVOUCHER); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $VOUCHER->appendChild($IGNOREPOSVALIDATION); $VOUCHER->appendChild($EXCISEOPENING); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $VOUCHER->appendChild($ISVATOVERRIDDEN); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $VOUCHER->appendChild($ISVATPAIDATCUSTOMS); $VOUCHER->appendChild($ISDECLAREDTOCUSTOMS); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $VOUCHER->appendChild($ISISDVOUCHER); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $VOUCHER->appendChild($GSTNOTEXPORTED); $VOUCHER->appendChild($IGNOREGSTINVALIDATION); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $VOUCHER->appendChild($ISBOENOTAPPLICABLE); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $VOUCHER->appendChild($ISOVERSEASTOURISTTRANS); $VOUCHER->appendChild($ISDESIGNATEDZONEPARTY); $VOUCHER->appendChild($ISCANCELLED); $VOUCHER->appendChild($HASCASHFLOW); $VOUCHER->appendChild($ISPOSTDATED); $VOUCHER->appendChild($USETRACKINGNUMBER); $VOUCHER->appendChild($ISINVOICE); $VOUCHER->appendChild($MFGJOURNAL); $VOUCHER->appendChild($HASDISCOUNTS); $VOUCHER->appendChild($ASPAYSLIP); $VOUCHER->appendChild($ISCOSTCENTRE); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $VOUCHER->appendChild($ISBLANKCHEQUE); $VOUCHER->appendChild($ISVOID); $VOUCHER->appendChild($ISONHOLD); $VOUCHER->appendChild($ORDERLINESTATUS); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VOUCHER->appendChild($VATISPURCEXEMPTED); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $VOUCHER->appendChild($ISVATDUTYPAID); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $VOUCHER->appendChild($ISDELETED); $VOUCHER->appendChild($CHANGEVCHMODE); $VOUCHER->appendChild($ALTERID); $VOUCHER->appendChild($MASTERID); $VOUCHER->appendChild($VOUCHERKEY); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $VOUCHER->appendChild($AUDITENTRIES_LIST); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $VOUCHER->appendChild($EWAYBILLDETAILS_LIST); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //star for debit ledger $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$dr_ledger.""); $GSTCLASSdl = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "Yes"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$amt_gross.""); $VATEXPAMOUNT_DR = $xml->createElement("VATEXPAMOUNT", "-".$amt_gross.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $bill_name = $xml->createElement("NAME", "".$voucher_no.""); $bill_type = $xml->createElement("BILLTYPE", "New Ref"); $bill_tds = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $bill_amount = $xml->createElement("AMOUNT", "-".$amt_gross.""); $bill_interest = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $bill_stcat = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST->appendChild($bill_name); $BILLALLOCATIONS_LIST->appendChild($bill_type); $BILLALLOCATIONS_LIST->appendChild($bill_tds); $BILLALLOCATIONS_LIST->appendChild($bill_amount); $BILLALLOCATIONS_LIST->appendChild($bill_interest); $BILLALLOCATIONS_LIST->appendChild($bill_stcat); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASSdl); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_DR); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); //end for debit ledger //star for credit ledger $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$cr_ledger.""); $GSTCLASSdl = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$cr_amount.""); $VATEXPAMOUNT_CR = $xml->createElement("VATEXPAMOUNT", "".$cr_amount.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$bill_name = $xml->createElement("NAME", "vouchr no"); $bill_type = $xml->createElement("BILLTYPE", "New Ref"); $bill_tds = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $bill_amount = $xml->createElement("AMOUNT", "".$cr_amount.""); $bill_interest = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $bill_stcat = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST->appendChild($bill_name); $BILLALLOCATIONS_LIST->appendChild($bill_type); $BILLALLOCATIONS_LIST->appendChild($bill_tds); $BILLALLOCATIONS_LIST->appendChild($bill_amount); $BILLALLOCATIONS_LIST->appendChild($bill_interest); $BILLALLOCATIONS_LIST->appendChild($bill_stcat); */ $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASSdl); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_CR); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); //end for credit ledger //star for CGST ledger if($cgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); //$ROUNDTYPE_Ca = $xml->createElement("ROUNDTYPE", ""); $GSTCLASS_c = $xml->createElement("GSTCLASS", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "CGST"); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$c_aot.""); $VATEXPAMOUNT_C = $xml->createElement("VATEXPAMOUNT", "".$c_aot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); //$LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_Ca); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_c); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_C); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for CGST ledger //star for SGST ledger if($sgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); //$ROUNDTYPE_S = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "SGST"); $GSTCLASS_s = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$s_aot.""); $AMOUNT_S = $xml->createElement("VATEXPAMOUNT", "".$s_aot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); //$LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_S); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_s); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_S); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for SGST ledger //star for UGST ledger if($ugst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_U = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "UGST"); $GSTCLASS_u = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$u_aot.""); $AMOUNT_U = $xml->createElement("VATEXPAMOUNT", "".$u_aot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_U); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_u); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_U); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for UGST ledger //star for IGST ledger if($igst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_I = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "IGST"); $GSTCLASS_i = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$taot.""); $AMOUNT_I = $xml->createElement("VATEXPAMOUNT", "".$taot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_I); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_i); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_I); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for IGST ledger $PAYROLLMODEOFPAYMENT_LIST_v = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $ATTDRECORDS_LIST_v = $xml->createElement("ATTDRECORDS.LIST", " "); $GSTEWAYCONSIGNORADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNORADDRESS.LIST", " "); $GSTEWAYCONSIGNEEADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNEEADDRESS.LIST", " "); $TEMPGSTRATEDETAILS_LIST_v = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST_v); $VOUCHER->appendChild($ATTDRECORDS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNORADDRESS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNEEADDRESS_LIST_v); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST_v); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY2 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO2 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO2->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME2 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE2 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_NAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPNAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPSTATE2); $COMPANY2->appendChild($REMOTECMPINFO2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY3 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO3 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO3->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME3 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME3 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE3 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_NAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPNAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPSTATE3); $COMPANY3->appendChild($REMOTECMPINFO3); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->appendChild($COMPANY3); $test = $xml->createElement("TALLYMESSAGE", " "); $test->setAttribute("xmlns:UDF", "TallyUDF"); //Set the attributes. /*$xml_HEADER->setAttribute("length", "0:01:15"); $xml_HEADER->setAttribute("bitrate", "64kb/s"); $xml_HEADER->setAttribute("channels", "2");*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3); //for ($i = 1; $i <2; $i++) { // $test = '$name_' . $i; // $test = $xml->createElement("TALLYMESSAGE", " "); // $test->setAttribute("xmlns:UDF", "TallyUDF"); // $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($test); //} $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); die; } public function xml_purchase_two($fid, $eight_randnum){ //echo $eight_randnum; die; $form = $this->model->sales_two_model($fid); $cgst = $form[0]['cgst']; $c_aot = $form[0]['c_aot']; $sgst = $form[0]['sgst']; $s_aot = $form[0]['s_aot']; $ugst = $form[0]['ugst']; $u_aot = $form[0]['u_aot']; $igst = $form[0]['igst']; $i_aot = $form[0]['i_aot']; //echo "<pre>"; print_r($form); die; $stage = $form[0]['stage']; $date = $form[0]['m_date']; $m_date = str_replace(["-", ""], '', $date); $basic_date = date("d-M-Y", strtotime($date)); $basic_time = date("h:i", strtotime($form[0]['date_time'])); $basic_date_time = $basic_date." at ".$basic_time; $voucher_no = $form[0]['voucher_no']; $dr_ledger = $form[0]['dr_ledger']; $narration = $form[0]['narration']; $amt_gross = $form[0]['amt_gross']; $cr_ledger = $form[0]['cr_ledger']; $cr_amount = $form[0]['amt_taxable']; // Set the content type to be XML, so th header("content-type: application/xml; charset=ISO-8859-15"); // "Create" the document. $xml = new DOMDocument("1.0", "ISO-8859-15"); // Create some elements. $xml_ENVELOPE = $xml->createElement("ENVELOPE", ""); $xml_HEADER = $xml->createElement("HEADER", " "); $xml_HEADER_TALLYREQUEST = $xml->createElement("TALLYREQUEST", "Import Data"); $xml_BODY = $xml->createElement("BODY", " "); $xml_BODY_IMPORTDATA = $xml->createElement("IMPORTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDESC = $xml->createElement("REQUESTDESC", " "); $xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME = $xml->createElement("REPORTNAME", " Vouchers "); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES = $xml->createElement("STATICVARIABLES", " "); $xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY = $xml->createElement("SVCURRENTCOMPANY", " Star One Web "); $xml_BODY_IMPORTDATA_REQUESTDATA = $xml->createElement("REQUESTDATA", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->setAttribute("xmlns:UDF", "TallyUDF"); $VOUCHER = $xml->createElement("VOUCHER", " "); $VOUCHER->setAttribute("REMOTEID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $VOUCHER->setAttribute("VCHKEY", "f25d1891-6db0-4709-9bce-1398c37a0aeb-0000a93e:".$eight_randnum.""); $VOUCHER->setAttribute("VCHTYPE", "".$stage.""); $VOUCHER->setAttribute("ACTION", "Create"); $VOUCHER->setAttribute("OBJVIEW", "Accounting Voucher View"); // $adrs_list = $xml->createElement("ADDRESS.LIST", " "); // $adrs_list->setAttribute("TYPE", "String"); // $adrs = $xml->createElement("ADDRESS", "Gujarat, India"); // $basic_buy_list = $xml->createElement("BASICBUYERADDRESS.LIST", " "); // $basic_buy_list->setAttribute("TYPE", "String"); // $basic_buy_adrs = $xml->createElement("BASICBUYERADDRESS", "Gujarat, India"); $OLDAUDITENTRYIDS_list = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_list->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $DATE = $xml->createElement("DATE", "".$m_date.""); $GUID = $xml->createElement("GUID", "f25d1891-6db0-4709-9bce-1398c37a0aeb-".$eight_randnum.""); $STATENAME = $xml->createElement("STATENAME", "Gujarat"); $NARRATION = $xml->createElement("NARRATION", "".$narration.""); $COUNTRYOFRESIDENCE = $xml->createElement("COUNTRYOFRESIDENCE", "India"); //$PARTYNAME = $xml->createElement("PARTYNAME", "".$dr_ledger.""); $VOUCHERTYPENAME = $xml->createElement("VOUCHERTYPENAME", "".$stage.""); $REFERENCE = $xml->createElement("REFERENCE", "".$voucher_no.""); $VOUCHERNUMBER = $xml->createElement("VOUCHERNUMBER", "".$voucher_no.""); $PARTYLEDGERNAME = $xml->createElement("PARTYLEDGERNAME", "".$dr_ledger.""); $BASICBASEPARTYNAME = $xml->createElement("BASICBASEPARTYNAME", "".$dr_ledger.""); $CSTFORMISSUETYPE = $xml->createElement("CSTFORMISSUETYPE", ""); $CSTFORMRECVTYPE = $xml->createElement("CSTFORMRECVTYPE", ""); $FBTPAYMENTTYPE = $xml->createElement("FBTPAYMENTTYPE", "Default"); $PERSISTEDVIEW = $xml->createElement("PERSISTEDVIEW", "Accounting Voucher View"); //$PLACEOFSUPPLY = $xml->createElement("PLACEOFSUPPLY", "Gujarat"); $BASICBUYERNAME = $xml->createElement("BASICBUYERNAME", "".$dr_ledger.""); $BASICDATETIMEOFINVOICE = $xml->createElement("BASICDATETIMEOFINVOICE", "".$basic_date_time.""); $BASICDATETIMEOFREMOVAL = $xml->createElement("BASICDATETIMEOFREMOVAL", "".$basic_date_time.""); $VCHGSTCLASS = $xml->createElement("VCHGSTCLASS", ""); $ENTEREDBY = $xml->createElement("ENTEREDBY", "Admin"); //$CONSIGNEESTATENAME = $xml->createElement("CONSIGNEESTATENAME", "Gujarat"); $DIFFACTUALQTY = $xml->createElement("DIFFACTUALQTY", "No"); $ISMSTFROMSYNC = $xml->createElement("ISMSTFROMSYNC", "No"); $ASORIGINAL = $xml->createElement("ASORIGINAL", "No"); $AUDITED = $xml->createElement("AUDITED", "No"); $FORJOBCOSTING = $xml->createElement("FORJOBCOSTING", "No"); $ISOPTIONAL = $xml->createElement("ISOPTIONAL", "No"); $EFFECTIVEDATE = $xml->createElement("EFFECTIVEDATE", "".$m_date.""); $USEFOREXCISE = $xml->createElement("USEFOREXCISE", "No"); $ISFORJOBWORKIN = $xml->createElement("ISFORJOBWORKIN", "No"); $ALLOWCONSUMPTION = $xml->createElement("ALLOWCONSUMPTION", "No"); $USEFORINTEREST = $xml->createElement("USEFORINTEREST", "No"); $USEFORGAINLOSS = $xml->createElement("USEFORGAINLOSS", "No"); $USEFORGODOWNTRANSFER = $xml->createElement("USEFORGODOWNTRANSFER", "No"); $USEFORCOMPOUND = $xml->createElement("USEFORCOMPOUND", "No"); $USEFORSERVICETAX = $xml->createElement("USEFORSERVICETAX", "No"); $ISEXCISEVOUCHER = $xml->createElement("ISEXCISEVOUCHER", "No"); $EXCISETAXOVERRIDE = $xml->createElement("EXCISETAXOVERRIDE", "No"); $USEFORTAXUNITTRANSFER = $xml->createElement("USEFORTAXUNITTRANSFER", "No"); $IGNOREPOSVALIDATION = $xml->createElement("IGNOREPOSVALIDATION", "No"); $EXCISEOPENING = $xml->createElement("EXCISEOPENING", "No"); $USEFORFINALPRODUCTION = $xml->createElement("USEFORFINALPRODUCTION", "No"); $ISTDSOVERRIDDEN = $xml->createElement("ISTDSOVERRIDDEN", "No"); $ISTCSOVERRIDDEN = $xml->createElement("ISTCSOVERRIDDEN", "No"); $ISTDSTCSCASHVCH = $xml->createElement("ISTDSTCSCASHVCH", "No"); $INCLUDEADVPYMTVCH = $xml->createElement("INCLUDEADVPYMTVCH", "No"); $ISSUBWORKSCONTRACT = $xml->createElement("ISSUBWORKSCONTRACT", "No"); $ISVATOVERRIDDEN = $xml->createElement("ISVATOVERRIDDEN", "No"); $IGNOREORIGVCHDATE = $xml->createElement("IGNOREORIGVCHDATE", "No"); $ISVATPAIDATCUSTOMS = $xml->createElement("ISVATPAIDATCUSTOMS", "No"); $ISDECLAREDTOCUSTOMS = $xml->createElement("ISDECLAREDTOCUSTOMS", "No"); $ISSERVICETAXOVERRIDDEN = $xml->createElement("ISSERVICETAXOVERRIDDEN", "No"); $ISISDVOUCHER = $xml->createElement("ISISDVOUCHER", "No"); $ISEXCISEOVERRIDDEN = $xml->createElement("ISEXCISEOVERRIDDEN", "No"); $ISEXCISESUPPLYVCH = $xml->createElement("ISEXCISESUPPLYVCH", "No"); $ISGSTOVERRIDDEN = $xml->createElement("ISGSTOVERRIDDEN", "No"); $GSTNOTEXPORTED = $xml->createElement("GSTNOTEXPORTED", "No"); $IGNOREGSTINVALIDATION = $xml->createElement("IGNOREGSTINVALIDATION", "No"); $ISVATPRINCIPALACCOUNT = $xml->createElement("ISVATPRINCIPALACCOUNT", "No"); $ISBOENOTAPPLICABLE = $xml->createElement("ISBOENOTAPPLICABLE", "No"); $ISSHIPPINGWITHINSTATE = $xml->createElement("ISSHIPPINGWITHINSTATE", "No"); $ISOVERSEASTOURISTTRANS = $xml->createElement("ISOVERSEASTOURISTTRANS", "No"); $ISDESIGNATEDZONEPARTY = $xml->createElement("ISDESIGNATEDZONEPARTY", "No"); $ISCANCELLED = $xml->createElement("ISCANCELLED", "No"); $HASCASHFLOW = $xml->createElement("HASCASHFLOW", "No"); $ISPOSTDATED = $xml->createElement("ISPOSTDATED", "No"); $USETRACKINGNUMBER = $xml->createElement("USETRACKINGNUMBER", "No"); $ISINVOICE = $xml->createElement("ISINVOICE", "No"); $MFGJOURNAL = $xml->createElement("MFGJOURNAL", "No"); $HASDISCOUNTS = $xml->createElement("HASDISCOUNTS", "No"); $ASPAYSLIP = $xml->createElement("ASPAYSLIP", "No"); $ISCOSTCENTRE = $xml->createElement("ISCOSTCENTRE", "No"); $ISSTXNONREALIZEDVCH = $xml->createElement("ISSTXNONREALIZEDVCH", "No"); $ISEXCISEMANUFACTURERON = $xml->createElement("ISEXCISEMANUFACTURERON", "No"); $ISBLANKCHEQUE = $xml->createElement("ISBLANKCHEQUE", "No"); $ISVOID = $xml->createElement("ISVOID", "No"); $ISONHOLD = $xml->createElement("ISONHOLD", "No"); $ORDERLINESTATUS = $xml->createElement("ORDERLINESTATUS", "No"); $VATISAGNSTCANCSALES = $xml->createElement("VATISAGNSTCANCSALES", "No"); $VATISPURCEXEMPTED = $xml->createElement("VATISPURCEXEMPTED", "No"); $ISVATRESTAXINVOICE = $xml->createElement("ISVATRESTAXINVOICE", "No"); $VATISASSESABLECALCVCH = $xml->createElement("VATISASSESABLECALCVCH", "No"); $ISVATDUTYPAID = $xml->createElement("ISVATDUTYPAID", "Yes"); $ISDELIVERYSAMEASCONSIGNEE = $xml->createElement("ISDELIVERYSAMEASCONSIGNEE", "No"); $ISDISPATCHSAMEASCONSIGNOR = $xml->createElement("ISDISPATCHSAMEASCONSIGNOR", "No"); $ISDELETED = $xml->createElement("ISDELETED", "No"); $CHANGEVCHMODE = $xml->createElement("CHANGEVCHMODE", "No"); $ALTERID = $xml->createElement("ALTERID", "29"); $MASTERID = $xml->createElement("MASTERID", "14"); $VOUCHERKEY = $xml->createElement("VOUCHERKEY", "186083753066560"); $EXCLUDEDTAXATIONS_LIST = $xml->createElement("EXCLUDEDTAXATIONS.LIST", " "); $OLDAUDITENTRIES_LIST = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST = $xml->createElement("AUDITENTRIES.LIST", " "); $DUTYHEADDETAILS_LIST = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $SUPPLEMENTARYDUTYHEADDETAILS_LIST = $xml->createElement("SUPPLEMENTARYDUTYHEADDETAILS.LIST", " "); $EWAYBILLDETAILS_LIST = $xml->createElement("EWAYBILLDETAILS.LIST", " "); $INVOICEDELNOTES_LIST = $xml->createElement("INVOICEDELNOTES.LIST", " "); $INVOICEORDERLIST_LIST = $xml->createElement("INVOICEORDERLIST.LIST", " "); $INVOICEINDENTLIST_LIST = $xml->createElement("INVOICEINDENTLIST.LIST", " "); $ATTENDANCEENTRIES_LIST = $xml->createElement("ATTENDANCEENTRIES.LIST", " "); $ORIGINVOICEDETAILS_LIST = $xml->createElement("ORIGINVOICEDETAILS.LIST", " "); $INVOICEEXPORTLIST_LIST = $xml->createElement("INVOICEEXPORTLIST.LIST", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1->appendChild($VOUCHER); /*$VOUCHER->appendChild($adrs_list); $adrs_list->appendChild($adrs); $VOUCHER->appendChild($basic_buy_list); $basic_buy_list->appendChild($basic_buy_adrs); */ $VOUCHER->appendChild($OLDAUDITENTRYIDS_list); $OLDAUDITENTRYIDS_list->appendChild($OLDAUDITENTRYIDS); $VOUCHER->appendChild($DATE); $VOUCHER->appendChild($GUID); $VOUCHER->appendChild($STATENAME); $VOUCHER->appendChild($NARRATION); $VOUCHER->appendChild($COUNTRYOFRESIDENCE); //$VOUCHER->appendChild($PARTYNAME); $VOUCHER->appendChild($VOUCHERTYPENAME); $VOUCHER->appendChild($REFERENCE); $VOUCHER->appendChild($VOUCHERNUMBER); $VOUCHER->appendChild($PARTYLEDGERNAME); $VOUCHER->appendChild($BASICBASEPARTYNAME); $VOUCHER->appendChild($CSTFORMISSUETYPE); $VOUCHER->appendChild($CSTFORMRECVTYPE); $VOUCHER->appendChild($FBTPAYMENTTYPE); $VOUCHER->appendChild($PERSISTEDVIEW); //$VOUCHER->appendChild($PLACEOFSUPPLY); $VOUCHER->appendChild($BASICBUYERNAME); $VOUCHER->appendChild($BASICDATETIMEOFINVOICE); $VOUCHER->appendChild($BASICDATETIMEOFREMOVAL); $VOUCHER->appendChild($VCHGSTCLASS); $VOUCHER->appendChild($ENTEREDBY); //$VOUCHER->appendChild($CONSIGNEESTATENAME); $VOUCHER->appendChild($DIFFACTUALQTY); $VOUCHER->appendChild($ISMSTFROMSYNC); $VOUCHER->appendChild($ASORIGINAL); $VOUCHER->appendChild($AUDITED); $VOUCHER->appendChild($FORJOBCOSTING); $VOUCHER->appendChild($ISOPTIONAL); $VOUCHER->appendChild($EFFECTIVEDATE); $VOUCHER->appendChild($USEFOREXCISE); $VOUCHER->appendChild($ISFORJOBWORKIN); $VOUCHER->appendChild($ALLOWCONSUMPTION); $VOUCHER->appendChild($USEFORINTEREST); $VOUCHER->appendChild($USEFORGAINLOSS); $VOUCHER->appendChild($USEFORGODOWNTRANSFER); $VOUCHER->appendChild($USEFORCOMPOUND); $VOUCHER->appendChild($USEFORSERVICETAX); $VOUCHER->appendChild($ISEXCISEVOUCHER); $VOUCHER->appendChild($EXCISETAXOVERRIDE); $VOUCHER->appendChild($USEFORTAXUNITTRANSFER); $VOUCHER->appendChild($IGNOREPOSVALIDATION); $VOUCHER->appendChild($EXCISEOPENING); $VOUCHER->appendChild($USEFORFINALPRODUCTION); $VOUCHER->appendChild($ISTDSOVERRIDDEN); $VOUCHER->appendChild($ISTCSOVERRIDDEN); $VOUCHER->appendChild($ISTDSTCSCASHVCH); $VOUCHER->appendChild($INCLUDEADVPYMTVCH); $VOUCHER->appendChild($ISSUBWORKSCONTRACT); $VOUCHER->appendChild($ISVATOVERRIDDEN); $VOUCHER->appendChild($IGNOREORIGVCHDATE); $VOUCHER->appendChild($ISVATPAIDATCUSTOMS); $VOUCHER->appendChild($ISDECLAREDTOCUSTOMS); $VOUCHER->appendChild($ISSERVICETAXOVERRIDDEN); $VOUCHER->appendChild($ISISDVOUCHER); $VOUCHER->appendChild($ISEXCISEOVERRIDDEN); $VOUCHER->appendChild($ISEXCISESUPPLYVCH); $VOUCHER->appendChild($ISGSTOVERRIDDEN); $VOUCHER->appendChild($GSTNOTEXPORTED); $VOUCHER->appendChild($IGNOREGSTINVALIDATION); $VOUCHER->appendChild($ISVATPRINCIPALACCOUNT); $VOUCHER->appendChild($ISBOENOTAPPLICABLE); $VOUCHER->appendChild($ISSHIPPINGWITHINSTATE); $VOUCHER->appendChild($ISOVERSEASTOURISTTRANS); $VOUCHER->appendChild($ISDESIGNATEDZONEPARTY); $VOUCHER->appendChild($ISCANCELLED); $VOUCHER->appendChild($HASCASHFLOW); $VOUCHER->appendChild($ISPOSTDATED); $VOUCHER->appendChild($USETRACKINGNUMBER); $VOUCHER->appendChild($ISINVOICE); $VOUCHER->appendChild($MFGJOURNAL); $VOUCHER->appendChild($HASDISCOUNTS); $VOUCHER->appendChild($ASPAYSLIP); $VOUCHER->appendChild($ISCOSTCENTRE); $VOUCHER->appendChild($ISSTXNONREALIZEDVCH); $VOUCHER->appendChild($ISEXCISEMANUFACTURERON); $VOUCHER->appendChild($ISBLANKCHEQUE); $VOUCHER->appendChild($ISVOID); $VOUCHER->appendChild($ISONHOLD); $VOUCHER->appendChild($ORDERLINESTATUS); $VOUCHER->appendChild($VATISAGNSTCANCSALES); $VOUCHER->appendChild($VATISPURCEXEMPTED); $VOUCHER->appendChild($ISVATRESTAXINVOICE); $VOUCHER->appendChild($VATISASSESABLECALCVCH); $VOUCHER->appendChild($ISVATDUTYPAID); $VOUCHER->appendChild($ISDELIVERYSAMEASCONSIGNEE); $VOUCHER->appendChild($ISDISPATCHSAMEASCONSIGNOR); $VOUCHER->appendChild($ISDELETED); $VOUCHER->appendChild($CHANGEVCHMODE); $VOUCHER->appendChild($ALTERID); $VOUCHER->appendChild($MASTERID); $VOUCHER->appendChild($VOUCHERKEY); $VOUCHER->appendChild($EXCLUDEDTAXATIONS_LIST); $VOUCHER->appendChild($OLDAUDITENTRIES_LIST); $VOUCHER->appendChild($ACCOUNTAUDITENTRIES_LIST); $VOUCHER->appendChild($AUDITENTRIES_LIST); $VOUCHER->appendChild($DUTYHEADDETAILS_LIST); $VOUCHER->appendChild($SUPPLEMENTARYDUTYHEADDETAILS_LIST); $VOUCHER->appendChild($EWAYBILLDETAILS_LIST); $VOUCHER->appendChild($INVOICEDELNOTES_LIST); $VOUCHER->appendChild($INVOICEORDERLIST_LIST); $VOUCHER->appendChild($INVOICEINDENTLIST_LIST); $VOUCHER->appendChild($ATTENDANCEENTRIES_LIST); $VOUCHER->appendChild($ORIGINVOICEDETAILS_LIST); $VOUCHER->appendChild($INVOICEEXPORTLIST_LIST); //star for debit ledger $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$dr_ledger.""); $GSTCLASSdl = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "Yes"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "Yes"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "Yes"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "".$amt_gross.""); $VATEXPAMOUNT_DR = $xml->createElement("VATEXPAMOUNT", "".$amt_gross.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $bill_name = $xml->createElement("NAME", "".$voucher_no.""); $bill_type = $xml->createElement("BILLTYPE", "New Ref"); $bill_tds = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $bill_amount = $xml->createElement("AMOUNT", "".$amt_gross.""); $bill_interest = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $bill_stcat = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST->appendChild($bill_name); $BILLALLOCATIONS_LIST->appendChild($bill_type); $BILLALLOCATIONS_LIST->appendChild($bill_tds); $BILLALLOCATIONS_LIST->appendChild($bill_amount); $BILLALLOCATIONS_LIST->appendChild($bill_interest); $BILLALLOCATIONS_LIST->appendChild($bill_stcat); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASSdl); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_DR); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); //end for debit ledger //star for credit ledger $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $LEDGERNAME = $xml->createElement("LEDGERNAME", "".$cr_ledger.""); $GSTCLASSdl = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$cr_amount.""); $VATEXPAMOUNT_CR = $xml->createElement("VATEXPAMOUNT", "-".$cr_amount.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); /*$bill_name = $xml->createElement("NAME", "vouchr no"); $bill_type = $xml->createElement("BILLTYPE", "New Ref"); $bill_tds = $xml->createElement("TDSDEDUCTEEISSPECIALRATE", "No"); $bill_amount = $xml->createElement("AMOUNT", "".$cr_amount.""); $bill_interest = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $bill_stcat = $xml->createElement("STBILLCATEGORIES.LIST", " "); $BILLALLOCATIONS_LIST->appendChild($bill_name); $BILLALLOCATIONS_LIST->appendChild($bill_type); $BILLALLOCATIONS_LIST->appendChild($bill_tds); $BILLALLOCATIONS_LIST->appendChild($bill_amount); $BILLALLOCATIONS_LIST->appendChild($bill_interest); $BILLALLOCATIONS_LIST->appendChild($bill_stcat); */ $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASSdl); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_CR); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); //end for credit ledger //star for CGST ledger if($cgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); //$ROUNDTYPE_Ca = $xml->createElement("ROUNDTYPE", ""); $GSTCLASS_c = $xml->createElement("GSTCLASS", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "CGST"); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$c_aot.""); $VATEXPAMOUNT_C = $xml->createElement("VATEXPAMOUNT", "-".$c_aot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); //$LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_Ca); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_c); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($VATEXPAMOUNT_C); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for CGST ledger //star for SGST ledger if($sgst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); //$ROUNDTYPE_S = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "SGST"); $GSTCLASS_s = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$s_aot.""); $AMOUNT_S = $xml->createElement("VATEXPAMOUNT", "-".$s_aot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); //$LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_S); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_s); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_S); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for SGST ledger //star for UGST ledger if($ugst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_U = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "UGST"); $GSTCLASS_u = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$u_aot.""); $AMOUNT_U = $xml->createElement("VATEXPAMOUNT", "-".$u_aot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_U); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_u); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_U); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for UGST ledger //star for IGST ledger if($igst != '0'){ $LEDGERENTRIES_LIST = $xml->createElement("ALLLEDGERENTRIES.LIST", " "); $OLDAUDITENTRYIDS_LIST = $xml->createElement("OLDAUDITENTRYIDS.LIST", " "); $OLDAUDITENTRYIDS_LIST->setAttribute("TYPE", "Number"); $OLDAUDITENTRYIDS_ai = $xml->createElement("OLDAUDITENTRYIDS", "-1"); $ROUNDTYPE_I = $xml->createElement("ROUNDTYPE", ""); $LEDGERNAME = $xml->createElement("LEDGERNAME", "IGST"); $GSTCLASS_i = $xml->createElement("GSTCLASS", ""); $ISDEEMEDPOSITIVE = $xml->createElement("ISDEEMEDPOSITIVE", "No"); $LEDGERFROMITEM = $xml->createElement("LEDGERFROMITEM", "No"); $REMOVEZEROENTRIES = $xml->createElement("REMOVEZEROENTRIES", "No"); $ISPARTYLEDGER = $xml->createElement("ISPARTYLEDGER", "No"); $ISLASTDEEMEDPOSITIVE = $xml->createElement("ISLASTDEEMEDPOSITIVE", "No"); $ISCAPVATTAXALTERED = $xml->createElement("ISCAPVATTAXALTERED", "No"); $ISCAPVATNOTCLAIMED = $xml->createElement("ISCAPVATNOTCLAIMED", "No"); $AMOUNT_LE = $xml->createElement("AMOUNT", "-".$taot.""); $AMOUNT_I = $xml->createElement("VATEXPAMOUNT", "-".$taot.""); $SERVICETAXDETAILS_LIST = $xml->createElement("SERVICETAXDETAILS.LIST", " "); $BANKALLOCATIONS_LIST = $xml->createElement("BANKALLOCATIONS.LIST", " "); $BILLALLOCATIONS_LIST = $xml->createElement("BILLALLOCATIONS.LIST", " "); $INTERESTCOLLECTION_LIST = $xml->createElement("INTERESTCOLLECTION.LIST", " "); $OLDAUDITENTRIES_LIST_AA = $xml->createElement("OLDAUDITENTRIES.LIST", " "); $ACCOUNTAUDITENTRIES_LIST_AA = $xml->createElement("ACCOUNTAUDITENTRIES.LIST", " "); $AUDITENTRIES_LIST_AA = $xml->createElement("AUDITENTRIES.LIST", " "); $INPUTCRALLOCS_LIST_AA = $xml->createElement("INPUTCRALLOCS.LIST", " "); $DUTYHEADDETAILS_LIST_LE = $xml->createElement("DUTYHEADDETAILS.LIST", " "); $EXCISEDUTYHEADDETAILS_LIST = $xml->createElement("EXCISEDUTYHEADDETAILS.LIST", " "); $RATEDETAILS_LIST = $xml->createElement("RATEDETAILS.LIST", " "); $SUMMARYALLOCS_LIST = $xml->createElement("SUMMARYALLOCS.LIST", " "); $STPYMTDETAILS_LIST = $xml->createElement("STPYMTDETAILS.LIST", " "); $EXCISEPAYMENTALLOCATIONS_LIST = $xml->createElement("EXCISEPAYMENTALLOCATIONS.LIST", " "); $TAXBILLALLOCATIONS_LIST = $xml->createElement("TAXBILLALLOCATIONS.LIST", " "); $TAXOBJECTALLOCATIONS_LIST = $xml->createElement("TAXOBJECTALLOCATIONS.LIST", " "); $TDSEXPENSEALLOCATIONS_LIST = $xml->createElement("TDSEXPENSEALLOCATIONS.LIST", " "); $VATSTATUTORYDETAILS_LIST = $xml->createElement("VATSTATUTORYDETAILS.LIST", " "); $COSTTRACKALLOCATIONS_LIST = $xml->createElement("COSTTRACKALLOCATIONS.LIST", " "); $REFVOUCHERDETAILS_LIST = $xml->createElement("REFVOUCHERDETAILS.LIST", " "); $INVOICEWISEDETAILS_LIST = $xml->createElement("INVOICEWISEDETAILS.LIST", " "); $VATITCDETAILS_LIST_LE = $xml->createElement("VATITCDETAILS.LIST", " "); $ADVANCETAXDETAILS_LIST = $xml->createElement("ADVANCETAXDETAILS.LIST", " "); $VOUCHER->appendChild($LEDGERENTRIES_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRYIDS_LIST); $OLDAUDITENTRYIDS_LIST->appendChild($OLDAUDITENTRYIDS_ai); $LEDGERENTRIES_LIST->appendChild($ROUNDTYPE_I); $LEDGERENTRIES_LIST->appendChild($LEDGERNAME); $LEDGERENTRIES_LIST->appendChild($GSTCLASS_i); $LEDGERENTRIES_LIST->appendChild($ISDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($LEDGERFROMITEM); $LEDGERENTRIES_LIST->appendChild($REMOVEZEROENTRIES); $LEDGERENTRIES_LIST->appendChild($ISPARTYLEDGER); $LEDGERENTRIES_LIST->appendChild($ISLASTDEEMEDPOSITIVE); $LEDGERENTRIES_LIST->appendChild($ISCAPVATTAXALTERED); $LEDGERENTRIES_LIST->appendChild($ISCAPVATNOTCLAIMED); $LEDGERENTRIES_LIST->appendChild($AMOUNT_LE); $LEDGERENTRIES_LIST->appendChild($AMOUNT_I); $LEDGERENTRIES_LIST->appendChild($SERVICETAXDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($BANKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($BILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($INTERESTCOLLECTION_LIST); $LEDGERENTRIES_LIST->appendChild($OLDAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($ACCOUNTAUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($AUDITENTRIES_LIST_AA); $LEDGERENTRIES_LIST->appendChild($INPUTCRALLOCS_LIST_AA); $LEDGERENTRIES_LIST->appendChild($DUTYHEADDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($EXCISEDUTYHEADDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($RATEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($SUMMARYALLOCS_LIST); $LEDGERENTRIES_LIST->appendChild($STPYMTDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($EXCISEPAYMENTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXBILLALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TAXOBJECTALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($TDSEXPENSEALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($VATSTATUTORYDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($COSTTRACKALLOCATIONS_LIST); $LEDGERENTRIES_LIST->appendChild($REFVOUCHERDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($INVOICEWISEDETAILS_LIST); $LEDGERENTRIES_LIST->appendChild($VATITCDETAILS_LIST_LE); $LEDGERENTRIES_LIST->appendChild($ADVANCETAXDETAILS_LIST); } //end for IGST ledger $PAYROLLMODEOFPAYMENT_LIST_v = $xml->createElement("PAYROLLMODEOFPAYMENT.LIST", " "); $ATTDRECORDS_LIST_v = $xml->createElement("ATTDRECORDS.LIST", " "); $GSTEWAYCONSIGNORADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNORADDRESS.LIST", " "); $GSTEWAYCONSIGNEEADDRESS_LIST_v = $xml->createElement("GSTEWAYCONSIGNEEADDRESS.LIST", " "); $TEMPGSTRATEDETAILS_LIST_v = $xml->createElement("TEMPGSTRATEDETAILS.LIST", " "); $VOUCHER->appendChild($PAYROLLMODEOFPAYMENT_LIST_v); $VOUCHER->appendChild($ATTDRECORDS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNORADDRESS_LIST_v); $VOUCHER->appendChild($GSTEWAYCONSIGNEEADDRESS_LIST_v); $VOUCHER->appendChild($TEMPGSTRATEDETAILS_LIST_v); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY2 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO2 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO2->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME2 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME2 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE2 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_NAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPNAME2); $REMOTECMPINFO2->appendChild($REMOTECMPINFO_REMOTECMPSTATE2); $COMPANY2->appendChild($REMOTECMPINFO2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2->appendChild($COMPANY2); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3 = $xml->createElement("TALLYMESSAGE", " "); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->setAttribute("xmlns:UDF", "TallyUDF"); $COMPANY3 = $xml->createElement("COMPANY", " "); $REMOTECMPINFO3 = $xml->createElement("REMOTECMPINFO.LIST", " "); $REMOTECMPINFO3->setAttribute("MERGE", "yes"); $REMOTECMPINFO_NAME3 = $xml->createElement("NAME", "f25d1891-6db0-4709-9bce-1398c37a0aeb"); $REMOTECMPINFO_REMOTECMPNAME3 = $xml->createElement("REMOTECMPNAME", " SANDIP COMPANY "); $REMOTECMPINFO_REMOTECMPSTATE3 = $xml->createElement("REMOTECMPSTATE", " Gujarat"); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_NAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPNAME3); $REMOTECMPINFO3->appendChild($REMOTECMPINFO_REMOTECMPSTATE3); $COMPANY3->appendChild($REMOTECMPINFO3); $xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3->appendChild($COMPANY3); $test = $xml->createElement("TALLYMESSAGE", " "); $test->setAttribute("xmlns:UDF", "TallyUDF"); //Set the attributes. /*$xml_HEADER->setAttribute("length", "0:01:15"); $xml_HEADER->setAttribute("bitrate", "64kb/s"); $xml_HEADER->setAttribute("channels", "2");*/ $xml_HEADER->appendChild($xml_HEADER_TALLYREQUEST); $xml_ENVELOPE->appendChild($xml_HEADER); $xml_ENVELOPE->appendChild($xml_BODY); $xml_BODY->appendChild($xml_BODY_IMPORTDATA); $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_REPORTNAME); $xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC__SVCURRENTCOMPANY); $xml_BODY_IMPORTDATA_REQUESTDESC->appendChild($xml_BODY_IMPORTDATA_REQUESTDESC_STATICVARIABLES); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE1); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE2); $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA_TALLYMESSAGE3); //for ($i = 1; $i <2; $i++) { // $test = '$name_' . $i; // $test = $xml->createElement("TALLYMESSAGE", " "); // $test->setAttribute("xmlns:UDF", "TallyUDF"); // $xml_BODY_IMPORTDATA_REQUESTDATA->appendChild($test); //} $xml_BODY_IMPORTDATA->appendChild($xml_BODY_IMPORTDATA_REQUESTDATA); $xml->appendChild($xml_ENVELOPE); // Parse the XML. print $xml->saveXML(); die; } public function upNoti(){ $ses = $this->session->get_userdata(); $rid = $ses['reg_info'][0]['rid']; $data = $this->model->custUploads($rid); $ucnt = count($data); $html = ''; foreach($data as $key => $val){ $date = date('d-m-Y h:i:A', strtotime($val['datetime'])); $month = substr($val['month'], strpos($val['month'], "_")+1); $path = $val['year'].'/'.$month.'/'.$val['stage']; $arrayDetail = array( 'code' => $val['folder_code'], 'stage' => $val['stage'], 'year' => $val['year'], 'month' => $val['month'], 'n_id' => $val['n_id'] ); $ad = urlencode(serialize($arrayDetail)); $url = base_url().'webapp/office/file_view_noti/'.$ad; $html .= '<li class="formlink"> <a href="'.$url.'"> <h4 class="text-capitalize text-red"> <strong>'.$val["name"].'</strong> <small><i class="fa fa-clock-o"></i> '.$date.' </small> </h4> <p> '.$val["file_count"].' Document has been Uploaded. </p> <p>'.$path.'</p> </a> </li>'; } $resultArrauy['cnt'] = $ucnt; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function accNoti(){ $ses = $this->session->get_userdata(); $rid = $ses['reg_info'][0]['rid']; $notification = $this->model->officeModelNoti($rid); if(!empty($notification)){ } $new = array_filter($notification, function ($var) { return ($var['sts'] == 'unseen'); }); //echo '<pre>'; print_r($new); die; $ncnt = count($new); $html = ''; foreach ($notification as $key => $noti) { $cust_id = $this->model->encryptdata($noti['afrom']); $noti_id = $this->model->encryptdata($noti['id']); $stage = explode('|',trim($noti['given'],'|')); $stage_string = implode(', ',$stage ); $html .='<li class="'.$noti['sts'].'"> <a href="#"> <div class="pull-left"> <i class="fa fa-check-square-o text-green"></i> </div> <h4> '.$noti['name'].' <small><i class="fa fa-clock-o"></i> Avail Access - ' .date("d-m-y, h:i", strtotime($noti['date'])).' </small> </h4> <p class="text-capitalize"> '.$stage_string.' </p> </a> </li>'; } $resultArrauy['cnt'] = $ncnt; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function errNoti(){ $ses = $this->session->get_userdata(); $rid = $ses['reg_info'][0]['rid']; $form_noti_office = $this->model->formNotiOffice($rid); $form_count_office = count($form_noti_office); $new2 = array_filter($form_noti_office, function ($var) { return ($var['o_noti'] == 'unseen'); }); $ocnt = count($new2); $html = ''; $count = 0; foreach ($form_noti_office as $frm_noti_ofc) { $enc_fid = $this->model->encryptdata($frm_noti_ofc['fid']); $note = explode('|', $frm_noti_ofc['note']); $note = implode('<br> ',$note ); $stage = $frm_noti_ofc['stage']; if($stage == 'contra'){ $url = base_url().'webapp/office/update_contra/'.$enc_fid; }elseif($stage == 'receipt'){ $url = base_url().'webapp/office/update_receipt/'.$enc_fid; }elseif($stage == 'payment'){ $url = base_url().'webapp/office/update_payment/'.$enc_fid; }elseif($stage == 'journal'){ $url = base_url().'webapp/office/update_journal/'.$enc_fid; }elseif($stage == 'credit'){ $url = base_url().'webapp/office/update_credit/'.$enc_fid; }elseif($stage == 'debit'){ $url = base_url().'webapp/office/update_debit/'.$enc_fid; }elseif($stage == 'cheque_reg'){ $voucher_type = $frm_noti_ofc['voucher_type']; if($voucher_type == 'payment'){ $url = base_url().'webapp/office/update_payment/'.$enc_fid; }else{ $url = base_url().'webapp/office/update_receipt/'.$enc_fid; } }elseif($stage == 'bank'){ $voucher_type = $frm_noti_ofc['voucher_type']; if($voucher_type == 'payment'){ $url = base_url().'webapp/office/update_payment/'.$enc_fid; }elseif($voucher_type == 'receipt'){ $url = base_url().'webapp/office/update_receipt/'.$enc_fid; }else{ $url = base_url().'webapp/office/update_contra/'.$enc_fid; } }else{ $url = base_url().'webapp/office/update_form/'.$enc_fid; } $html .=' <li data-toggle="tooltip" data-html="true" data-placement="left" title="'.$note.'" class="'.$frm_noti_ofc['o_noti'].' formlink"> <a href="'.$url.'"> <h4 class="text-capitalize text-green"> <strong>'.$frm_noti_ofc['cname'].'</strong> <small><i class="fa fa-clock-o"></i> '.date('d-m-y, h:i', strtotime($frm_noti_ofc['date_time'])).' </small> </h4> <p>This form is rejected.</p> <p class="text-capitalize text-red"><strong>'.$frm_noti_ofc['release_status'].'</strong></p> </a> </li> '; $count++; } $resultArrauy['cnt'] = $ocnt; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function frmStatus(){ $ses = $this->session->get_userdata(); $rid = $ses['reg_info'][0]['rid']; $form_noti = $this->model->formNoti(); $fscnt = count($form_noti); $html = ''; foreach ($form_noti as $frm_noti) { $enc_fid = $this->model->encryptdata($frm_noti['fid']); $pt = explode('/', $frm_noti['path']); $html .=' <li class="'.$frm_noti['l_noti'].' formlink"> <a href="'.base_url().'webapp/office/viewForm/'.$enc_fid.'"> <h4 class="text-capitalize text-red"> <strong>'.$frm_noti['cname'].'</strong> <small><i class="fa fa-clock-o"></i> '.date('d-m-y, h:i', strtotime($frm_noti['date_time'])).' </small> </h4> <p> '.$pt[4].' form has been released by '.$frm_noti['oname'].' </p> </a> </li> '; } $resultArrauy['cnt'] = $fscnt; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function frmStatusTwo(){ $ses = $this->session->get_userdata(); $rid = $ses['reg_info'][0]['rid']; $form_noti = $this->model->formNotiTwo(); $fscnt = count($form_noti); $html = ''; foreach ($form_noti as $frm_noti) { $enc_fid = $this->model->encryptdata($frm_noti['fid']); $pt = explode('/', $frm_noti['path']); $html .=' <li class="'.$frm_noti['l_noti'].' formlink"> <a href="'.base_url().'webapp/office/viewForm/'.$enc_fid.'"> <h4 class="text-capitalize text-red"> <strong>'.$frm_noti['cname'].'</strong> <small><i class="fa fa-clock-o"></i> '.date('d-m-y, h:i', strtotime($frm_noti['date_time'])).' </small> </h4> <p> '.$pt[4].' form has been released again by '.$frm_noti['oname'].' </p> </a> </li> '; } $resultArrauy['cnt'] = $fscnt; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function getRejectId($id){ $html = ''; $html.=' <input type="hidden" name="fid" value="'.$id.'"> '; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } public function checkForm($id){ //$id = $this->model->decryptdata($encrypted_id); $where = array('fid' => $id); $data['form'] = $this->model->DetailData('tbl_form', $where); $stage = $data['form'][0]['stage']; $voucher_type = $data['form'][0]['voucher_type']; //echo "<pre>"; print_r($data['form']); die; $noti = array('l_noti' => 'seen'); $this->model->UpdateData('tbl_form', $noti, $where); if($stage == 'contra'){ $frm = $this->model->office_form_contra($id); $html = ''; $html .=' <table class="table table-bordered"> <tr> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name (Cr)</th> <th>Ledger Name(Dr)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['sun_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }elseif($stage == 'receipt'){ $frm = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Ledger Name (Dr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['cr_ledger'].'</td> <td>'.$frm[0]['dr_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }elseif($stage == 'payment'){ //$data['frm'] = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $frm = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Ledger Name (Dr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['credit_ledger'].'</td> <td>'.$frm[0]['debit_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }elseif($stage == 'journal'){ //$data['frm'] = $this->model->office_form_journal($id); //echo "<pre>"; print_r($data['frm']); die; $frm = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Dr.)</th> <th>Ledger Name (Cr.)</th> <th>Amount</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['cr_ledger'].'</td> <td>'.$frm[0]['dr_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> </tr> </table> '; $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }elseif($stage == 'credit'){ $frm = $this->model->of_cr($id); //echo "<pre>"; print_r($frm); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['master_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $info = $frm[0]['info']; //echo "<pre>"; print_r($info); $sub = ''; foreach ($info as $i) { $sub.=' <p><strong>Dr.</strong> '.$i['sub_ledger'].' : '.$i['amt_taxable'].'</p> '; } $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; $resultArrauy['sub'] = $sub; echo json_encode($resultArrauy); }elseif($stage == 'debit'){ $frm = $this->model->of_cr($id); $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Dr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['master_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $info = $frm[0]['info']; //echo "<pre>"; print_r($info); $sub = ''; foreach ($info as $i) { $sub.=' <p><strong>Cr.</strong> '.$i['sub_ledger'].' : '.$i['amt_taxable'].'</p> '; } $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; $resultArrauy['sub'] = $sub; echo json_encode($resultArrauy); }elseif($stage == 'cheque_reg'){ $data['voucher_type'] = $voucher_type; if($voucher_type == 'payment'){ $frm = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Ledger Name (Dr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['credit_ledger'].'</td> <td>'.$frm[0]['debit_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }else{ $frm = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['cr_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } }elseif($stage == 'bank'){ $data['voucher_type'] = $voucher_type; if($voucher_type == 'payment'){ $frm = $this->model->office_form_paymet($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Ledger Name (Dr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['credit_ledger'].'</td> <td>'.$frm[0]['debit_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }elseif($voucher_type == 'receipt'){ $frm = $this->model->office_form_receipt($id); //echo "<pre>"; print_r($data['frm']); die; $html = ''; $html .=' <table class="table table-bordered"> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name</th> <th>Ledger Name (Cr.)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['cr_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); }else{ $frm = $this->model->office_form_contra($id); $html = ''; $html .=' <table class="table table-bordered"> <tr> <th>Date</th> <th>Voucher No</th> <th>Party Ledger Name (Cr)</th> <th>Ledger Name(Dr)</th> <th>Amount</th> <th>Cheque No</th> <th>Cheque Date</th> </tr> <tr> <td>'.$frm[0]['m_date'].'</td> <td>'.$frm[0]['voucher_no'].'</td> <td>'.$frm[0]['party_ledger'].'</td> <td>'.$frm[0]['sun_ledger'].'</td> <td>'.$frm[0]['amt_gross'].'</td> <td>'.$frm[0]['check_no'].'</td> <td>'.$frm[0]['check_date'].'</td> </tr> </table> '; if($frm[0]['stage'] == 'bank' || $frm[0]['stage'] == 'cheque_reg'){ $vt = " - ".$frm[0]['voucher_type']; }else{ $vt = ''; } $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].$vt.') <br> narration : '.$frm[0]['narration'].'<br> '.$usedFIles.' '; $resultArrauy['head'] = $head; $resultArrauy['html'] = $html; echo json_encode($resultArrauy); } }else{ $frm = $this->model->sales_form_data($id); $amt_gross = $frm[0]['amt_gross']; //echo "<pre>"; print_r($frm); if($frm[0]['note_two'] == 'form_two'){ $totcredit = $frm[0]['amt_taxable']+$frm[0]['s_aot']+$frm[0]['c_aot']+$frm[0]['u_aot']+$frm[0]['i_aot']; }else{ $form2 = $this->model->salesModel($id); $info_cnt = count($form2); $form3 = $this->model->salesExpenseModel($id); //echo "<pre>"; print_r($form3); $info_cnt2 = count($form3); $tot_g_sgst = 0; $tot_g_cgst = 0; $tot_g_ugst = 0; $tot_g_igst = 0; for ($g=0; $g < $info_cnt2; $g++) { //foreach ($form3 as $gst => $g) { $gamt = $form3[$g]['ex_amount']; $g_sgst = $form3[$g]['sgst']; $g_cgst = $form3[$g]['cgst']; $g_ugst = $form3[$g]['ugst']; $g_igst = $form3[$g]['igst']; if($g_sgst != '0.00'){ $g_sgst_payble = $gamt*$g_sgst/100; //echo "--payble sgst<br>"; $tot_g_sgst += $g_sgst_payble; } if($g_cgst != '0.00'){ $g_cgst_payble = $gamt*$g_cgst/100; //echo "--payble cgst<br>"; $tot_g_cgst += $g_cgst_payble; } if($g_ugst != '0.00'){ $g_ugst_payble = $gamt*$g_ugst/100; //echo "--payble ugst<br>"; $tot_g_ugst += $g_ugst_payble; } if($g_igst != '0.00'){ $g_igst_payble = $gamt*$g_igst/100; //echo "--payble cgst<br>"; $tot_g_igst += $g_igst_payble; } } $tot_g_sgst; $tot_g_cgst; $tot_g_ugst; $tot_g_igst; $tsgst = 0; $tcgst = 0; $tugst = 0; $tigst = 0; foreach ($form2 as $total => $tot) { $sgst = $tot['s_aot']; $cgst = $tot['c_aot']; $ugst = $tot['u_aot']; $igst = $tot['i_aot']; $tsgst+=$sgst; $tcgst+=$cgst; $tugst+=$ugst; $tigst+=$igst; } $tsgst; $tcgst; $tugst; $tigst; $tsgst = $tsgst+$tot_g_sgst; $tcgst = $tcgst+$tot_g_cgst; $tugst = $tugst+$tot_g_ugst; $tigst = $tigst+$tot_g_igst; $new_tot_expns = 0; $amt_tax = 0; foreach ($frm as $key => $tot) { $expns = $tot['expenses']; $amt_taxable = $tot['amt_taxable']; $tot_expns = 0; foreach ($expns as $tt => $t) { $newtt = $t['ex_amount']; $tot_expns+=$newtt; } $new_tot_expns+=$tot_expns; $amt_tax+=$amt_taxable; } $new_tot_expns; $amt_tax; $tot_tax = $tsgst+$tcgst+$tugst+$tigst; $totcredit = $new_tot_expns+$tot_tax+$amt_tax; } if($frm[0]['stage'] == 'sales'){ $left = 'Debit'; $right = 'Credit'; }else{ $left = 'Credit'; $right = 'Debit'; } $diff_amt = round(abs($amt_gross - $totcredit),2); $html = ''; $html.=' <table class="table table-bordered"> <tr> <th>Total '.$left.' Amount</th> <th>Total '.$right.' Amount</th> </tr> <tr> <td>'.$amt_gross.'</td> <td>'.$totcredit.'</td> </tr> </table> '; $resultArrauy['html'] = $html; $path = explode('|-|',$frm[0]['path']); $usedFIles = ''; $f = 1; foreach ($path as $pth => $p) { $usedFIles.=' <a data-toggle="tooltip" data-placement="top" title="Used files" class="label label-primary" target="_blank" href="'.base_url().$p.'">File '.$f.'</a> '; $f++; } $head = ''; if($frm[0]['note_two'] == 'form_two'){ $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].' Without Inventory) <br> narration : '.$frm[0]['narration'].'<br> Different Amount : '.$diff_amt.'<br> '.$usedFIles.' '; }else{ $head.=' customer : '.$frm[0]['cname'].' ('.$frm[0]['stage'].') <br> narration : '.$frm[0]['narration'].'<br> Different Amount : '.$diff_amt.'<br> '.$usedFIles.' '; } $resultArrauy['head'] = $head; echo json_encode($resultArrauy); //$data['frm'] = $this->model->sales_form_data($id); //echo "<pre>"; print_r($data['frm']); die; //$this->load->view("webapp/office_user/view_form",$data); } } public function getUnit($id){ $data = $this->model->get_unit($id); $name = $data[0]['name']; echo json_encode($name); } public function listView() { $userdata = $this->session->userdata('reg_info'); $rid = $userdata[0]['rid']; $data['code'] = $this->input->post('code'); $data['year'] = $this->input->post('year'); $data['month'] = $this->input->post('month'); $where = array('code' => $this->input->post('code'), 'year' => $this->input->post('year')); $data['struct'] = $this->db2->get_where('cust_upload_structure', $where)->row_array(); $reg=$this->db2->get_where('tbl_registration', array('folder_code'=>$this->input->post('code')))->row_array(); $cust_id=$reg['rid']; $access=$this->db2->get_where('tbl_access', array( 'afrom'=>$cust_id, 'ato'=>$rid ))->row_array(); $data['wise'] = $access['wise']; $folder = $access['folder']; $data['avail_voucher'] = array_filter(explode('|', $folder));//use this only if office user has voucher wise acccess $data['cust_id']=$cust_id; //echo'<pre>'; print_r($data); die; $data['all_struct'] = $this->db2->get_where('cust_upload_structure', array('code' => $this->input->post('code')))->result_array(); $this->load->view("webapp/office_user/list_view", $data); } public function file_view($arrayDetail) { $str_arr = unserialize(urldecode($arrayDetail)); //echo'<pre>'; print_r($str_arr); die; $where = array( 'code'=>$str_arr['code'], 'year'=>$str_arr['year'], 'month'=>$str_arr['month'], 'stage'=>$str_arr['stage'], 'trash'=>'0' ); $data['count']=$this->db2->get_where('cust_upload', $where)->num_rows(); $data['str_arr'] = $str_arr; $data['all_struct'] = $this->db2->get_where('cust_upload_structure', array('code' => $str_arr['code']))->result_array(); $this->load->view("webapp/office_user/file_view", $data); } public function file_view_noti($arrayDetail) { $userdata = $this->session->userdata('reg_info'); $rid = $userdata[0]['rid']; $str_arr = unserialize(urldecode($arrayDetail)); //echo'<pre>'; print_r($str_arr); die; $where = array( 'code'=>$str_arr['code'], 'year'=>$str_arr['year'], 'month'=>$str_arr['month'], 'stage'=>$str_arr['stage'], 'trash'=>'0' ); $data['count']=$this->db2->get_where('cust_upload', $where)->num_rows(); $data['str_arr'] = $str_arr; $where_noti = array('n_id'=>$str_arr['n_id']); $data_noti = array('status'=>'1'); $this->model->UpdateData('cust_upload_notify', $data_noti, $where_noti); $data['all_struct'] = $this->db2->get_where('cust_upload_structure', array('code' => $str_arr['code']))->result_array(); $this->load->view("webapp/office_user/file_view", $data); } public function loadRecord_file($start=0){ $userdata = $this->session->userdata('reg_info'); $rid = $userdata[0]['rid']; $user_type=$userdata[0]['type']; $this->load->library('pagination'); // Pagging $where = array( 'code'=>$this->input->post('code'), 'year'=>$this->input->post('year'), 'month'=>$this->input->post('month'), 'stage'=>$this->input->post('stage'), 'trash'=>'0' ); $cnt=$this->db2->get_where('cust_upload', $where)->num_rows(); $rowperpage = 25; if($start != 0){ $start = ($start-1) * $rowperpage; } $ad = urlencode(serialize($where)); $config['base_url'] = base_url()."webapp/customer/view_files/".$ad; $config['use_page_numbers'] = TRUE; $config['total_rows'] = $cnt; $config['per_page'] = $rowperpage; $this->pagination->initialize($config); $userdata['pagination'] = $this->pagination->create_links(); $userdata['row'] = $start; $userdata['result']= array(); $getData=$this->model->get_cust_data('cust_upload', $where, $config["per_page"], $start); if(count($getData)>0){ foreach ($getData as $key){ //$id=$this->model->encryptdata($key["station_id"]); $cu_id = $key['cu_id']; $exp = explode('/', $key["path"]); $file = array_pop($exp); if($key["file_status"] == 0){ $status='<span class="badge bg-yellow">Pending</span>'; $action = ' <button data-id="'.$cu_id.'" data-status="1" onclick="changeStatus($(this))" type="button" class="btn bg-blue btn-xs">Receive</button> <button data-id="'.$cu_id.'" data-status="3" onclick="changeStatus($(this))" type="button" class="btn bg-red btn-xs">Reject</button> '; }elseif($key["file_status"] == 1){ $status='<span class="badge bg-blue">Received</span>'; $action = ' <button data-id="'.$cu_id.'" data-status="2" onclick="changeStatus($(this))" type="button" class="btn bg-green btn-xs">Complete</button> '; }elseif($key["file_status"] == 2){ $status='<span class="badge bg-green">Completed</span>'; $action = ''; }else{ $status='<span class="badge bg-red">Rejected</span>'; $action = ''; } if($user_type == 'office_user'){ $action_td = '<td class="act'.$cu_id.'">'.$action.'</td>'; }else{ $action_td =''; } if($user_type == 'team_leader' || $user_type == 'admin'){ if($key["file_status"] == 3){ $trash = '<button data-id="'.$cu_id.'" onclick="trashFile($(this))" class="btn bg-red btn-xs"><i class="fa fa-trash"></i></button>'; }else{ $trash = ''; } if($key['rec_datetime']!=''){ $rec_log = 'Receive : '.date('d-m-Y h:i A', strtotime($key['rec_datetime'])); }else{ $rec_log = 'Receive : '.'NA'; } if($key['comp_datetime']!=''){ $comp_log = 'Complete : '.date('d-m-Y h:i A', strtotime($key['comp_datetime'])); }else{ $comp_log = 'Complete : '.'NA'; } if($key['rej_datetime']!=''){ $rej_log = 'Reject : '.date('d-m-Y h:i A', strtotime($key['rej_datetime'])); }else{ $rej_log = 'Reject : '.'NA'; } $logs = $rec_log.' | '.$comp_log.' | '.$rej_log; $log_td='<td title="'.$logs.'"><i class="fa fa-clock-o" aria-hidden="true"></i></td>'; }else{ $trash = ''; $log_td=''; } if($this->input->post('stage') != 'reports'){ $other_td = ' <td class="sts'.$cu_id.'">'.$status.'</td> <td class="rem'.$cu_id.'">'.$key["remarks"].'</td> '.$action_td.' '.$log_td.' '; }else{ $other_td = ''; } $path = $key["path"]; $link = "https://paperpushbucket.s3.ap-south-1.amazonaws.com/".$path; $result1='<tr class="mytr'.$cu_id.'"> <td>'.$trash.' <a target="_blank" href="'.$link.'">'.$key["file_name"].'</a></td> '.$other_td.' </tr>'; $userdata['result'][] = $result1; } }else{ $result1='<tr><td colspan="7" class="text-center">No data available.</td></tr>'; $userdata['result'][] = $result1; } echo json_encode($userdata); } public function search_file($start=0){ $userdata = $this->session->userdata('reg_info'); $rid = $userdata[0]['rid']; $user_type=$userdata[0]['type']; $this->load->library('pagination'); $where = array( 'code'=>$this->input->post('code'), 'year'=>$this->input->post('year'), 'month'=>$this->input->post('month'), 'stage'=>$this->input->post('stage'), 'search'=>$this->input->post('search'), 'status'=>$this->input->post('status') ); $cnt=count($this->model->search_cust_file2($where,NULL,NULL)); $rowperpage = 25; if($start != 0){ $start = ($start-1) * $rowperpage; } $ad = urlencode(serialize($where)); $config['base_url'] = base_url()."webapp/customer/view_files/".$ad; $config['use_page_numbers'] = TRUE; $config['total_rows'] = $cnt; $config['per_page'] = $rowperpage; $this->pagination->initialize($config); $userdata['pagination'] = $this->pagination->create_links(); $userdata['row'] = $start; $getData=$this->model->search_cust_file2($where,$config["per_page"], $start); $userdata['result']= array(); if(count($getData)>0){ foreach ($getData as $key){ //$id=$this->model->encryptdata($key["station_id"]); $cu_id = $key['cu_id']; $exp = explode('/', $key["path"]); $file = array_pop($exp); if($key["file_status"] == 0){ $status='<span class="badge bg-yellow">Pending</span>'; $action = ' <button data-id="'.$cu_id.'" data-status="1" onclick="changeStatus($(this))" type="button" class="btn bg-blue btn-xs">Receive</button> <button data-id="'.$cu_id.'" data-status="3" onclick="changeStatus($(this))" type="button" class="btn bg-red btn-xs">Reject</button> '; }elseif($key["file_status"] == 1){ $status='<span class="badge bg-blue">Received</span>'; $action = ' <button data-id="'.$cu_id.'" data-status="2" onclick="changeStatus($(this))" type="button" class="btn bg-green btn-xs">Complete</button> '; }elseif($key["file_status"] == 2){ $status='<span class="badge bg-green">Completed</span>'; $action = ''; }else{ $status='<span class="badge bg-red">Rejected</span>'; $action = ''; } if($user_type == 'office_user'){ $action_td = '<td class="act'.$cu_id.'">'.$action.'</td>'; }else{ $action_td =''; } if($user_type == 'team_leader' || $user_type == 'admin'){ if($key["file_status"] == 3){ $trash = '<button class="btn bg-red btn-xs"><i class="fa fa-trash"></i></button>'; }else{ $trash = ''; } if($key['rec_datetime']!=''){ $rec_log = 'Receive : '.date('d-m-Y h:i A', strtotime($key['rec_datetime'])); }else{ $rec_log = 'Receive : '.'NA'; } if($key['comp_datetime']!=''){ $comp_log = 'Complete : '.date('d-m-Y h:i A', strtotime($key['comp_datetime'])); }else{ $comp_log = 'Complete : '.'NA'; } if($key['rej_datetime']!=''){ $rej_log = 'Reject : '.date('d-m-Y h:i A', strtotime($key['rej_datetime'])); }else{ $rej_log = 'Reject : '.'NA'; } $logs = $rec_log.' | '.$comp_log.' | '.$rej_log; $log_td='<td title="'.$logs.'"><i class="fa fa-clock-o" aria-hidden="true"></i></td>'; }else{ $trash = ''; $log_td=''; } if($this->input->post('stage') != 'reports'){ $other_td = ' <td class="sts'.$cu_id.'">'.$status.'</td> <td class="rem'.$cu_id.'">'.$key["remarks"].'</td> '.$action_td.' '.$log_td.' '; }else{ $other_td = ''; } $path = $key["path"]; $link = "https://paperpushbucket.s3.ap-south-1.amazonaws.com/".$path; $result1='<tr> <td>'.$trash.' <a href="'.$link.'">'.$key["file_name"].'</a></td> '.$other_td.' </tr>'; $userdata['result'][] = $result1; } }else{ $result1='<tr><td colspan="7" class="text-center">No matching records found</td></tr>'; $userdata['result'][] = $result1; } echo json_encode($userdata); } public function changeStatus(){ $userdata = $this->session->userdata('reg_info'); $rid = $userdata[0]['rid']; $name = $userdata[0]['name']; $sts = $this->input->post('sts'); $cu_id = $this->input->post('id'); $data = $this->db2->get_where('cust_upload', array('cu_id' => $cu_id))->row_array(); $rec_from = $data['rec_from']; $fs = $data['file_status']; $remarks = $data['remarks']; $where = array('cu_id' => $cu_id); $cust = $this->db2->get_where('tbl_registration', array('rid' => $data['cu_from']))->row_array(); $cust_name = $cust['name']; $year = $data['year']; $month = $this->getMonth($data['month']); $stage = $data['stage']; $file_name = $data['file_name']; $path = $year.'/'.$month.'/'.$stage.'/'.$file_name; if($rec_from == 0){ //echo 'fresh'; if($sts == 1){ //echo 'rec'; $upd = array('rec_from' => $rid, 'file_status' => '1', 'rec_datetime' => date('Y-m-d H:i')); $btn = '<button data-id="'.$cu_id.'" data-status="2" onclick="changeStatus($(this))" type="button" class="btn bg-green btn-xs">Complete</button>'; $msg = 'File have been received'; $status='<span class="badge bg-blue">Received</span>'; $noti = 'suc'; $rem = ''; }else{ //echo 'rej'; $rej_msg = $this->input->post('rej_msg'); $upd = array('rec_from' => $rid, 'file_status' => '3', 'remarks' => $rej_msg, 'rej_datetime' => date('Y-m-d H:i')); $btn = ''; $msg = 'File have been rejected'; $status='<span class="badge bg-red">Rejected</span>'; $noti = 'suc'; $rem = $rej_msg; $msg_admin = ' <!DOCTYPE html> <html> <head> <title>File Rejected</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg, #CF212A 0%, #003865 100%); padding: 10px; text-align: center;"> <h3>File Rejected</h3> </div> <div style="padding: 1rem;"> <p><strong>Hello,</strong></p> <p><strong>File have been rejected by '.$name.'.</strong></p> <p><strong>Reject Note: </strong>'.$rem.'</p> <p><strong>Customet Name: </strong>'.$cust_name.'</p> <p><strong>Details: </strong>'.$path.'</p> </div> </div> </body> </html>'; $to_admin='cjrajpara@gmail.com'; $sub_admin = "File Rejected"; //$this->model->emailsend_reject($to_admin, $sub_admin, $msg_admin); } $this->model->UpdateData('cust_upload',$upd,$where); }else{ //echo 'updated'; if($rid == $rec_from){ //echo 'complete'; $upd = array('rec_from' => $rid, 'file_status' => '2', 'comp_datetime' => date('Y-m-d H:i')); $this->model->UpdateData('cust_upload',$upd,$where); $msg = 'File have been completed'; $btn = ''; $status='<span class="badge bg-green">Completed</span>'; $noti = 'suc'; $rem = ''; }else{ //echo 'updated by other user'; if($fs == 1){ $msg = 'Sorry, Already received'; $btn = '<button type="button" class="btn bg-green btn-xs">Complete</button>'; $status='<span class="badge bg-blue">Received</span>'; $noti = 'err'; $rem = ''; }elseif($fs == 2){ $msg = 'Sorry, Already completed'; $btn = ''; $status='<span class="badge bg-green">Completed</span>'; $noti = 'err'; $rem = ''; }else{ $msg = 'Sorry, Already rejected'; $btn = ''; $status='<span class="badge bg-red">Rejected</span>'; $noti = 'err'; $rem = $remarks; } } } $array['btn'] = $btn; $array['msg'] = $msg; $array['status'] = $status; $array['noti'] = $noti; $array['rem'] = $rem; echo json_encode($array); } public function trashFile(){ $id = $this->input->post('id'); $this->model->UpdateData('cust_upload', array('trash' => '1'), array('cu_id' => $id)); $array['status'] = 'success'; echo json_encode($array); } public function upload(){ //echo "<pre>"; print_r($_FILES); echo "<pre>"; print_r($_POST); $bucketname = 'paperpushbucket'; $dash_url = $this->input->post('dash_url'); $code = $this->input->post('code'); $stage = $this->input->post('stage'); $year = $this->input->post('year'); $month = $this->input->post('month'); $cust_id = $this->input->post('cust_id'); $cust_data = $this->db2->get_where('tbl_registration',array('rid' => $cust_id))->row_array(); $cust_email = $cust_data['email']; $userdata = $this->session->userdata('reg_info'); $rid = $userdata[0]['rid']; $path = $code.'/'.$year.'/'.$month.'/'.$stage; $path_in = $year.'/'.$month.'/'.$stage; $count = count($_FILES['doc']['size']); for($i = 0; $i < $count; $i++){ $filename = $_FILES['doc']['name'][$i]; $ext = pathinfo($filename, PATHINFO_EXTENSION); $ext = strtolower($ext); if(!empty($ext)){ if($ext == 'jpg' || $ext == 'jpeg' || $ext == 'png' || $ext == 'pdf' || $ext == 'csv' || $ext == 'xls' || $ext == 'xlsb' || $ext == 'xlsx'){ //echo "<pre>"; print_r($_FILES); die; $rand =rand(10,100); $target_file = preg_replace("/[^a-z0-9\_\-\.]/i", '', $_FILES['doc']['name'][$i]); $new_file = $rand.'_'.$target_file; $file_name = $_FILES['doc']['name'][$i]; $temp_file_location = $_FILES['doc']['tmp_name'][$i]; //$ct = ['image/jpg', 'image/jpeg', 'image/png', 'application/csv']; if($ext == 'pdf' || $ext == 'PDF'){ $this->s3->putObject([ 'Bucket' => $bucketname, 'Key' => $path.'/'.$new_file, 'SourceFile' => $temp_file_location, 'ContentType' => 'application/pdf', //'Body' => fopen($temp_file_location, 'rb'), 'ACL' => 'public-read', ]); }else{ $this->s3->putObject([ 'Bucket' => $bucketname, 'Key' => $path.'/'.$new_file, 'SourceFile' => $temp_file_location, //'Body' => fopen($temp_file_location, 'rb'), 'ACL' => 'public-read', ]); } //insert in table $data = array( 'cu_from' => $cust_id, 'code' => $code, 'year' => $year, 'month' => $month, 'stage' => $stage, 'file_name' => $new_file, 'path' => $path.'/'.$new_file, 'rec_from' => $rid, 'date_time' => date('Y-m-d H:i:s'), ); $this->model->insertData('cust_upload', $data); } } } /*$to = 'vishal.panara@staroneweb.co.in'; $cust_email $sub = 'New files Uploaded'; $msg = ' <!DOCTYPE html> <html> <head> <title>New files Uploaded</title> </head> <body style="font-family: sans-serif;"> <div class="container" style="width:50%; margin: 0 auto; background-color: #eee; box-shadow: 1px 1px 1px 1px #a09191; margin-top: 5rem; margin-bottom: 5rem;"> <div style="color:#fff; background-image: linear-gradient(-20deg, #CF212A 0%, #003865 100%); padding: 10px; text-align: center;"> <h3>New files Uploaded</h3> </div> <div style="padding: 1rem;"> <p><strong>Hello,</strong></p> <p><strong>New file have been uploaded from in report '.$path_in.'.</strong></p> </div> </div> </body> </html>'; $this->model->emailsend($to, $sub, $msg);*/ } public function getMonth($month){ if($month == 'april'){return 'a_april';}elseif($month == 'may'){return 'b_may';}elseif($month == 'june'){return 'c_june';} elseif($month == 'july'){return 'd_july';}elseif($month == 'august'){return 'e_august';}elseif($month == 'september'){return 'f_september';}elseif($month == 'october'){return 'g_october';} elseif($month == 'november'){return 'h_november';}elseif($month == 'december'){return 'i_december';}elseif($month == 'january'){return 'j_january';}elseif($month == 'february'){return 'k_february';} elseif($month == 'march'){return 'l_march';} } } //end of controller
Copyright ©2021 || Defacer Indonesia