} require XOOPS_ROOT_PATH . '/footer.php'; die; break; case "getbpartnerinfo": include_once "../simantz/class/SelectCtrl.inc.php"; $ctrl = new SelectCtrl(); include "../bpartner/class/BPSelectCtrl.inc.php"; $bpctrl = new BPSelectCtrl(); include "../bpartner/class/BPartner.php"; $bp = new BPartner(); $bpartner_id = $_REQUEST['bpartner_id']; $bp->fetchBpartnerData($bpartner_id); $addressxml = str_replace(">", "}}}", str_replace("<", "{{{", $bpctrl->getSelectAddress(0, "N", $bpartner_id))); $termsxml = str_replace(">", "}}}", str_replace("<", "{{{", $bpctrl->getSelectTerms($bp->terms_id, "N"))); $contactxml = str_replace(">", "}}}", str_replace("<", "{{{", $bpctrl->getSelectContacts(0, 'N', "", "", " and bpartner_id={$bpartner_id}"))); $currencyxml = str_replace(">", "}}}", str_replace("<", "{{{", $ctrl->getSelectCurrency($bp->currency_id))); $salesagent = $bp->inchargeperson; echo "<result><address>{$addressxml}</address><terms>{$termsxml}</terms><contact>{$contactxml}</contact><currency>{$currencyxml}</currency><salesagent>{$salesagent}</salesagent><bpartneraccounts_id>{$bp->creditoraccounts_id}</bpartneraccounts_id><status>1</status></result>"; die; break; case "checkaddresstext": include "../bpartner/class/Address.inc.php"; $add = new Address(); $add->fetchAddress($_REQUEST['address_id']); echo $add->address_street; die; break; case "searchpaymentline": $log->showLog(4, "access action:searchpaymentline"); // $wherestring=" WHERE payment_id=".$_REQUEST['payment_id'];
public function getInputForm($action = "new") { global $userid, $simbizctrl, $ctrl, $defaultorganization_id; $this->log->showLog(3, "Access Payment getInputForm()"); if ($o->track1_id == "") { $o->track1_id = 0; } if ($o->track2_id == "") { $o->track2_id = 0; } if ($o->track3_id == "") { $o->track3_id = 0; } $track1option = $simbizctrl->getSelectTrack($this->track1_id, "Y", " AND trackheader_id =1"); $track2option = $simbizctrl->getSelectTrack($this->track2_id, "Y", " AND trackheader_id =2"); $track3option = $simbizctrl->getSelectTrack($this->track3_id, "Y", " AND trackheader_id =3"); if ($action == "new") { include "../simbiz/class/Track.inc.php"; $track = new Trackclass(); $track_array = $track->getTrackName(); $this->track1_name = $track_array['track1_name']; $this->track2_name = $track_array['track2_name']; $this->track3_name = $track_array['track3_name']; $this->bpartneraccounts_id = 0; $tableheader = "New Payment"; $attnoption = "<option value='0'>Null</option>"; $uidoption = $ctrl->getSelectUsers($userid); $termsoption = "<option value='0'>Null</option>"; $addressoption = "<option value='0'>Null</option>"; $currencyoption = "<option value='0'>Null</option>"; $branchctrl = $ctrl->selectionOrganization($userid, $defaultorganization_id); $this->payment_id = 0; $this->document_no = $this->getNextNo(); $this->document_date = date("Y-m-d", time()); $this->exchangerate = 1; $this->subtotal = 0; $this->localamt = 0; } else { $tableheader = "Edit Payment"; include_once "../simantz/class/SelectCtrl.inc.php"; $ctrl = new SelectCtrl(); include "../bpartner/class/BPSelectCtrl.inc.php"; $bpctrl = new BPSelectCtrl(); include "../bpartner/class/BPartner.php"; $bp = new BPartner(); $bpartner_id = $_REQUEST['bpartner_id']; $bp->fetchBpartnerData($bpartner_id); $addressxml = $bpctrl->getSelectAddress($this->address_id, "N", $o->bpartner_id); $termsxml = $bpctrl->getSelectTerms($this->terms_id, "N"); $contactxml = $bpctrl->getSelectContacts($this->contacts_id, 'N', "", "", " and bpartner_id={$this->bpartner_id}"); $currencyxml = $ctrl->getSelectCurrency($this->currency_id); $branchctrl = $ctrl->selectionOrganization($userid, $this->organization_id); $attnoption = $contactxml; $uidoption = $ctrl->getSelectUsers($this->preparedbyuid); $termsoption = $termsxml; $addressoption = $addressxml; $currencyoption = $currencyxml; // $branchoption="<option value='1'>HQ</option>"; } $grid = $this->getGrid($this->payment_id); $html = <<<HTML <br/> <div id='centercontainer'> <div align="center" > <table style="width:990px;text-align: left; " > <tr><td align="left">{$this->addnewctrl}</td><td align="right">{$this->searchctrl}</td></tr></table> {$noperm} <br/> <div id='errormsg' class='red' style='display:none'></div> <form onsubmit='return false' method='post' name='frmPayment' id='frmPayment' action='{$this->paymentfilename}' enctype="multipart/form-data"> <table style="text-align: left; width: 990px;" border="0" cellpadding="0" cellspacing="1" class="searchformblock"> <tbody> <tr> <td colspan="4" rowspan="1" align="center" id="idHeaderText" class="searchformheader" >{$tableheader}</td> </tr> <tr> <td class="head">Payment No</td> <td class="even"><input name='sppayment_prefix' id='sppayment_prefix' value='{$this->sppayment_prefix}'size='3'> <input name='document_no' id='document_no' value='{$this->document_no}' size='10'> Branch <select id='organization_id' name='organization_id'> {$branchctrl}</select></td> <td class="head">Business Partner</td> <td class="even"> <ntb:Combo id="cmbbpartner_id" Mode="classic" theme="{$nitobicombothemes}" InitialSearch="{$this->bpartner_name}" onselectevent="chooseBPartner();"> <ntb:ComboTextBox Width="250px" DataFieldIndex=1 ></ntb:ComboTextBox> <ntb:ComboList Width="300px" Height="200px" DatasourceUrl="../simbiz/simbizlookup.php?action=searchbpartnercombo&showNull=Y" PageSize="25" > <ntb:ComboColumnDefinition Width="130px" DataFieldIndex=1 ></ntb:ComboColumnDefinition> <ntb:ComboMenu icon="images/add.gif" OnClickEvent="window.open('../bpartner/bpartner.php')" text=" Add product..."> </ntb:ComboList> </ntb:Combo> </td> </tr> <tr> <td class="head">Date (YYYY-MM-DD)</td> <td class="even"> <input id='document_date' name='document_date' size='10' value='{$this->document_date}'> <input id='btnpaymentdate' type='button' class='btndate' onclick="{$this->showCalendar}" value="Date"></td> <td class="head">Attn To </td> <td class="even"><select id='contacts_id' name='contacts_id' >{$attnoption}</select></td> </tr> <tr> <td class="head">Ref. No</td> <td class="even"><input id='ref_no' size='10' name='ref_no' value='{$this->ref_no}'></td> </tr> <tr> <td class="head">Prepared By</td> <td class="even"><select id='preparedbyuid' name='preparedbyuid'>{$uidoption}</select></td> <td class="head">Sales Agent</td> <td class="even"><input id='salesagentname' name='salesagentname' value='{$this->salesagentname}'></td> </tr> <tr> <td class="head">Address</td> <td class="even"><select id='address_id' name='address_id' onchange=updateAddressText()>{$addressoption}</select><br/> <textarea id='address_text' name='address_text' cols='30' rows='3'>{$this->address_text}</textarea> </td> <td class="head">Currency</td> <td class="even"> <select id='currency_id' name='currency_id' onchange=comparecurrency()>{$currencyoption}</select> Exchange rate: MYR<input size='8' id='exchangerate' onchange=updateCurrency() value="{$this->exchangerate}" name="exchangerate"><br/> </td> <tr> <td class="head" colspan='4'> <input name='save' onclick='saverecord(0)' type='submit' id='submit' value='Save'> <input name='save' onclick='saverecord(1);' type='submit' id='submit' value='Complete'> <input name='save' onclick='deleterecord()' type='submit' id='delete' value='Delete'> <input name='action' name='action' value='ajaxsave' type="hidden"> <input type="button" value="Reload" onclick=javascript:reloadPayment()> <input type="button" value="Receive All" onclick=javascript:receiveAll()> <input type="button" value="Preview" onclick=javascript:previewPayment()> <input name="track1_name" id="track1_name" type="hidden" value="{$this->track1_name}"> <input name="track2_name" id="track2_name" type="hidden" value="{$this->track2_name}"> <input name="track3_name" id="track3_name" type="hidden" value="{$this->track3_name}"> <input name='payment_id' id='payment_id' value='{$this->payment_id}' title='payment_id' type='hidden'> <input name='iscomplete' id='iscomplete' value='{$this->iscomplete}' title='iscomplete' type='hidden'> <input name='bpartneraccounts_id' id='bpartneraccounts_id' value='{$this->bpartneraccounts_id}' title='bpartneraccounts_id' type='hidden'> </td> </td></tr> <tr><td colspan='4'> <div id='detaildiv'> {$grid} <small>* Update payment detail via edit column Account, Paid Amt and following column, leave Paid Amt = 0 to delete particular payment detail</small> <div style="width:476px;text-align:right" > <b style="text-align:right; height:30px; border-top: 1px solid #000; border-bottom: 3px double #000; width:300px"> Total: <label id='lblsubtotal'><input id='subtotal' style="text-align:right" size="10" name='subtotal' readonly="readonly" value='{$this->subtotal}'></label></b><br/> Outstanding : <label id='lbltotalgst'><input id='outstandingamt' size="10" style="text-align:right" name='outstandingamt' readonly="readonly" value='{$this->outstandingamt}'></label> </div> </div> </td></tr> <td class="head">Description</td> <td class="even" colspan='2'><textarea cols='70' rows='3' id='description' name='description'>{$this->description}</textarea></td> <td rowspan="2"><br/><b>Tracking information</b> <div class="searchformblock" id="trackblock"> {$this->track1_name}: <select name="track1_id" id="track1_id">{$track1option}</select><br/> {$this->track2_name}: <select name="track2_id" id="track1_id">{$track2option}</select><br/> {$this->track3_name}: <select name="track3_id" id="track1_id">{$track3option}</select><br/> </div></td> </tr><tr> <td class="head">Note</td> <td class="even" colspan='2'><textarea cols='70' rows='3' id='note' name='note'>{$this->note}</textarea></td> </tr></table> </form> HTML; return $html; }
public function getInputForm($type = "") { global $userid, $bpctrl, $ctrl, $defaultorganization_id, $havewriteperm, $sbfe; $this->log->showLog(3, "Access Quotation getInputForm()"); $bpbox = $sbfe->getBPartnerBox($this->bpartner_id, "{$this->bpartner_no} - {$this->bpartner_name}", 'bpartner_id', 'bpartner_id', '350px', 'onchange="chooseBPartner()"', $this->usedBpartnerType); // $agentbox = $sbfe->getAgentBox($this->saleagent_id, "$this->saleagent_no - $this->saleagent_name", 'saleagent_id', 'saleagent_id', '150px'); $uidoption = $bpctrl->getSelectUsers($userid); $tableheader = "Edit Quotation"; //include_once "../simantz/class/SelectCtrl.inc.php"; //$ctrl = new SelectCtrl(); include_once "../bpartner/class/BPSelectCtrl.inc.php"; $bpctrl = new BPSelectCtrl(); include_once "../bpartner/class/BPartner.php"; $bp = new BPartner(); $bpartner_id = $_REQUEST['bpartner_id']; $bp->fetchBpartnerData($bpartner_id); // $voidctrl = "<input type='button' value='Void' id='btnvoid' onclick=javascript:voidQuotation()>"; $addressxml = $bpctrl->getSelectAddress($this->address_id, "N", $this->bpartner_id); $termsxml = $bpctrl->getSelectTerms($this->terms_id, "N"); $contactxml = $bpctrl->getSelectContacts($this->contacts_id, 'N', "", "", " and bpartner_id={$this->bpartner_id}"); $currencyxml = $ctrl->getSelectCurrency($this->currency_id); $branchctrl = $ctrl->selectionOrganization($userid, $this->organization_id); $attnoption = $contactxml; $uidoption = $ctrl->getSelectUsers($this->preparedbyuid); $termsoption = $termsxml; $addressoption = $addressxml; $currencyoption = $currencyxml; // $branchoption="<option value='1'>HQ</option>"; // $grid = $this->getGrid($this->quotation_id); if ($this->issotrx == 1) { $bpartnertype = "isdebtor"; } else { $bpartnertype = "iscreditor"; } if ($havewriteperm == 1) { $savebutton = "<input type='button' name='save' onclick='saverecord(0,true)'id='submit' value='Save'/>\n <input type='button' name='complete' onclick='saverecord(1,true);' id='submit' value='Complete'/>\n <input type='button' name='save' onclick='deleterecord()' type='submit' id='delete' value='Delete'/>\n <input name='action' id='action' value='update' type='hidden'/>\n <input type='button' id='preview' value='Preview' onclick='javascript:previewQuotation()'/>\n\t<input type='button' id='btnviewhistory' name='btnviewhistory' onclick='viewhistory()' value='View Record Info'/>"; } else { $savebutton = "\n <input type='button' value='Preview' onclick='javascript:previewQuotation()'>\n <input type='button' id='btnviewhistory' value='View Record Info' name='btnviewhistory' onclick='viewhistory()'/>\t\n"; } $this->defineHeaderButton(); $subtable = $this->subtable(); $html = <<<HTML <div id="idApprovalWindows" style="display:none"></div> <div id='centercontainer'> <div align="center" > <table style="width:990px;text-align: left; " > <tr><td align="left">{$this->addnewctrl}</td><td align="right">{$this->searchctrl}</td></tr> </table> {$noperm} <div id='errormsg' class='red' style='display:none'></div> <form onsubmit='return false' method='post' name='frmQuotation' id='frmQuotation' action='{$this->quotationfilename}' enctype="multipart/form-data"> <table style="text-align: left; width: 990px;" border="0" cellpadding="0" cellspacing="1" class="searchformblock"> <tbody> <tr> <td colspan="4" rowspan="1" align="center" id="idHeaderText" class="searchformheader" >{$tableheader}</td> </tr> <tr> <td class="head">{$document}</td> <td class="even"><input name='spquotation_prefix' id='spquotation_prefix' value='{$this->spquotation_prefix}'size='3'> <input name='document_no' id='document_no' value='{$this->document_no}' size='10'> </td> <td class="head">Business Partner</td> <td class="even">{$bpbox}<img src="../simantz/images/zoom.png" style="cursor:pointer" onclick=zoomBPartner()></a> <div id='divlimit' style='float:left'></div> </td> </tr> <tr> <td class="head">Date (YYYY-MM-DD)</td> <td class="even"> <input id='document_date' name='document_date' class='datepick' size='12' value='{$this->document_date}'> <td class="head">Attn To </td> <td class="even"><select id='contacts_id' name='contacts_id' >{$attnoption}</select></td> </tr> <tr> <td class="head">Terms</td> <td class="even"><select id='terms_id' name='terms_id'>{$termsoption}</select></td> <td class="head">{$refno}</td> <td class="even"><input id='ref_no' size='20' name='ref_no' value='{$this->ref_no}'></td> </tr> <tr> <td class="head">Prepared By</td> <td class="even"><select id='preparedbyuid' name='preparedbyuid'>{$uidoption}</select></td> <td class="head">Sales Agent</td> <td class="even"> <input id='salesagentname' name='salesagentname' value='{$this->salesagentname}'> </td> </tr> <tr> <td class="head">Address</td> <td class="even"><select id='address_id' name='address_id' onchange=updateAddressText()>{$addressoption}</select><br/> <textarea id='address_text' name='address_text' cols='50' rows='3'>{$this->address_text}</textarea> </td> <td class="head">Currency</td> <td class="even"> <select id='currency_id' name='currency_id' onchange=comparecurrency()>{$currencyoption}</select> Exchange rate: MYR<input size='8' id='exchangerate' onchange=updateamount() value="{$this->exchangerate}" name="exchangerate"><br/> </td> <tr><td colspan='4'> <div id='subtable'> {$subtable} </div> <br> <div style="width:960px;align:right;text-align:right;"> <input name='quotation_id' id='quotation_id' value='{$this->quotation_id}' title='quotation_id' type='hidden'> <input name='iscomplete' id='iscomplete' value='{$this->iscomplete}' title='iscomplete' type='hidden'> {$savebutton} </div> </div> </td></tr> <td class="head">Description</td> <td class="even" colspan='2'><textarea cols='70' rows='3' id='description' name='description'>{$this->description}</textarea> <div id="temp" {$display}><a onclick="openWindowTemp()" style='cursor:pointer'><u>Browse Template<u></a> <a onclick="openWindowsaveTemp()" style='cursor:pointer'><u>Save Template<u></a></div> </td> </tr><tr> <td class="head">Note</td> <td class="even" colspan='2'><textarea cols='70' rows='3' id='note' name='note'>{$this->note}</textarea></td> </tr></table> </form> HTML; return $html; }