$o->preparedbyuid = $_POST['preparedbyuid']; $o->note = $_POST['note']; $o->salesagentname = $_POST['salesagentname']; $o->localamt = $_POST['localamt']; $o->address_id = $_POST['address_id']; $o->address_text = $_POST['address_text']; $o->organization_id = $_POST['organization_id']; $o->isprinted = $_POST['isprinted']; $o->contacts_id = $_POST['contacts_id']; $o->terms_id = $_POST['terms_id']; $o->preparedbyuid = $_POST['preparedbyuid']; $o->salesagentname = $_POST['salesagentname']; $o->address_text = $_POST['address_text']; $o->itemqty = 0; $o->erromsg = ''; if ($o->saveQuotationLine()) { if ($o->updateQuotation()) { $arr = array("status" => 1, "msg" => "Record save successfully."); } else { $arr = array("status" => 0, "msg" => "Cannot completely save quotation line due to internal error"); } } else { $arr = array("status" => 0, "msg" => "Cannot save quotation header due to internal error"); } echo json_encode($arr); break; case "getcurrency": $o->currency_id = $_POST['currency_id']; $o->GetCurrency(); $arr = array("currency_rate" => $o->currency_rate); echo json_encode($arr);