<?php include_once "../../../includes/basics/basics.inc"; global $f; if (!empty($_GET['bu_org_id']) && !empty($_GET['find_bu_details'])) { $data = []; $bu_org_id = $_GET['bu_org_id']; $ar_transaction_type = ar_transaction_type::find_all_by_buOrgId($bu_org_id); $ar_trnx_type_stmt = $f->select_field_from_object('transaction_type', $ar_transaction_type, 'ar_transaction_type_id', 'ar_transaction_type', '', 'transaction_type', '', 1); $data['ar_transaction_type'] = $ar_trnx_type_stmt; $legal_org_id = org::find_by_id($bu_org_id)->legal_org_id; $ledger_id = legal::find_by_orgId($legal_org_id)->ledger_id; $data['ledger_id'] = $ledger_id; if (!empty($ledger_id)) { $ledger = new gl_ledger(); $ledger_i = $ledger->findBy_id($ledger_id); if ($ledger_i) { $data['currency'] = $ledger_i->currency_code; $gp = new gl_period(); $all_open_periods = $gp->find_all_periods($ledger_id, 'OPEN'); $period_id = $gp->current_open_period($ledger_id, 'OPEN')->gl_period_id; $period_name_stmt = $f->select_field_from_object('period_id', $all_open_periods, 'gl_period_id', 'period_name', $period_id, 'period_id', '', 1); $data['period_name_stmt'] = $period_name_stmt; $data['period_id'] = $period_id; $data['output_tax'] = $f->select_field_from_object('tax_code_id', mdm_tax_code::find_all_outTax_by_bu_org_id($bu_org_id), 'mdm_tax_code_id', 'tax_code', '', '', 'output_tax medium', '', '', '', '', '', 'percentage'); } } if (count($data) == 0) { return false; } else { echo header('Content-Type: application/json');
$locator = new locator_v(); $locator->org_id = !empty($param['org_id'][0]) ? $param['org_id'][0] : ''; $locator->subinventory_id = !empty($param['subinventory_id'][0]) ? $param['subinventory_id'][0] : ''; $locator->locator_id = !empty($param['locator_id'][0]) ? $param['locator_id'][0] : ''; $data_obj_a = $locator->findBy_parameter(); break; case 'SUBINV': $sub = new subinventory(); $sub->org_id = !empty($param['org_id'][0]) ? $param['org_id'][0] : ''; $sub->subinventory_id = !empty($param['subinventory_id'][0]) ? $param['subinventory_id'][0] : ''; $data_obj_a = $sub->findBy_parameter_withOrgDetails(); break; case 'ORG': case 'INV': $org_id = !empty($param['org_id'][0]) ? $param['org_id'][0] : ''; $data_obj_a = org::find_by_id($org_id); break; default: break; } if (!empty($data_obj_a) && is_array($data_obj_a)) { foreach ($data_obj_a as $data_obj) { $bc_lr = new bc_label_request(); $bc_lr->sys_printer_id = $sl->sys_printer_id; $bc_lr->bc_label_format_header_id = $sl->bc_label_format_header_id; $xml_content = $bc_lr->generate_label($data_obj); $bc_lr->print_XMLlabel($xml_content); } $err_msg .= '<br>Label is Successfullyprinted'; } else { if (!empty($data_obj_a)) {