Exemplo n.º 1
0
    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'>&nbsp; {$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=" &nbsp;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;
    }
Exemplo n.º 2
0
 public function saveBPartnerFromTableList()
 {
     $this->log->showLog(2, "Access saveBPartnerFromTableList()");
     // die;
     global $xoopsDB, $saveHandler, $createdby, $timestamp, $defaultorganization_id;
     $tablename = "sim_bpartner";
     $pkey = "bpartner_id";
     $keyword = "BPartner";
     $controlfieldname = "bpartner_no";
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrfield = array($controlfieldname, "bpartner_name", "companyno", "bpartnergroup_id", "industry_id", "terms_id", "isactive", "defaultlevel", "created", "createdby", "updated", "updatedby", "organization_id");
         $arrfieldtype = array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%s', '%d', '%d');
         // Yes there are INSERTs to perform...
         for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, $controlfieldname), $saveHandler->ReturnInsertField($currentRecord, "bpartner_name"), $saveHandler->ReturnInsertField($currentRecord, "companyno"), $saveHandler->ReturnInsertField($currentRecord, "bpartnergroup_id"), $saveHandler->ReturnInsertField($currentRecord, "industry_id"), $saveHandler->ReturnInsertField($currentRecord, "terms_id"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "defaultlevel"), $timestamp, $createdby, $timestamp, $createdby, $defaultorganization_id);
             $controlvalue = $saveHandler->ReturnInsertField($currentRecord, $controlfieldname);
             $this->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, $pkey);
             // Now we execute this query
         }
     }
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrfield = array($controlfieldname, "bpartner_name", "companyno", "bpartnergroup_id", "industry_id", "terms_id", "isactive", "defaultlevel", "updated", "updatedby", "isdeleted");
         $arrfieldtype = array('%s', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%d', '%d');
         // Yes there are UPDATEs to perform...
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, $controlfieldname), $saveHandler->ReturnUpdateField($currentRecord, "bpartner_name"), $saveHandler->ReturnUpdateField($currentRecord, "companyno"), $saveHandler->ReturnUpdateField($currentRecord, "bpartnergroup_id"), $saveHandler->ReturnUpdateField($currentRecord, "industry_id"), $saveHandler->ReturnUpdateField($currentRecord, "terms_id"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "defaultlevel"), $timestamp, $createdby, $saveHandler->ReturnUpdateField($currentRecord, "isdeleted"));
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, $controlfieldname);
             $this->UpdateRecord($tablename, $pkey, $saveHandler->ReturnUpdateField($currentRecord), $arrfield, $arrvalue, $arrfieldtype, $controlvalue);
         }
     }
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     $classname = "class/{$keyword}.inc.php";
     include $classname;
     $this->log->showLog(3, "Include {$classname} successfully");
     $o = new BPartner();
     $this->log->showLog(3, "Inilialize {$keyword}()");
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             $o->fetchBPartner($record_id);
             $controlvalue = $o->bpartner_no;
             $isdeleted = $o->isdeleted;
             if ($o->allowDelete($record_id)) {
                 $this->DeleteRecord($tablename, $pkey, $record_id, $controlvalue, $isdeleted);
             } else {
                 $this->failfeedback .= "Cannot delete {$keyword}: {$o->followuptype_name} <br/>";
             }
         }
     }
     //$this->failfeedback.="asdasdpasd<br/>\n";
     //$this->failfeedback.="123 3443<br/>\n";
     //$this->failfeedback.="234 45656523 234<br/>\n";
     if ($this->failfeedback != "") {
         $this->failfeedback .= "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     $saveHandler->CompleteSave();
 }
Exemplo n.º 3
0
         }
         echo $o->gridjs();
         echo $o->getInputForm("edit");
     } else {
         echo "cannot access database";
     }
     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;
Exemplo n.º 4
0
<?php

//	include_once ('../../mainfile.php');
//	include_once (XOOPS_ROOT_PATH.'/header.php');
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
include "system.php";
include "class/BPartner.inc.php";
include "class/nitobi.xml.php";
$o = new BPartner();
$action = $_REQUEST["action"];
switch ($action) {
    case "save":
        $o->bpartner_id = $_POST["bpartner_id"];
        $o->bpartner_no = $_POST["bpartner_no"];
        $o->bpartner_name = $_POST["bpartner_name"];
        $o->bpartnergroup_id = $_POST["bpartnergroup_id"];
        $o->companyno = $_POST["companyno"];
        $o->alternatename = $_POST["alternatename"];
        $o->employeecount = $_POST["employeecount"];
        $o->employee_id = $_POST["employee_id"];
        $o->industry_id = $_POST["industry_id"];
        $o->terms_id = $_POST["terms_id"];
        $o->purchasepricelist_id = $_POST["purchasepricelist_id"];
        $o->salespricelist_id = $_POST["salespricelist_id"];
        $o->isactive = $_POST["isactive"];
        if ($o->isactive == "true") {
            $o->isactive = 1;
        } else {
            $o->isactive = 0;
        }
        $o->isdebtor = $_POST["isdebtor"];
Exemplo n.º 5
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Log.php';
include_once 'class/BPartner.php';
include_once 'class/SelectCtrl.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$o = new BPartner();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
$action = "";
//marhan add here --> ajax
echo "<iframe src='bpartner.php' name='nameValidate' id='idValidate' style='display:none' ></iframe>";
echo "<div id='simit'><form name='frmValidate' target='nameValidate' method='POST'></form></div>";
////////////////////
echo <<<EOF
<A href='bpartner.php' style='color: GRAY'> [ADD NEW BUSINESS PARTNER]</A>
<A href='bpartner.php?action=search' style='color: gray'> [SEARCH BUSINESS PARTNER]</A>
<br>
<script type="text/javascript">

function sortList(idSort){

\tvar str = document.getElementById(idSort).src;
\tvar lengthStr = str.length;
\tvar type = str.substring(lengthStr-6,lengthStr-4);
\tvar fldName = idSort.replace("ids_", "");
\tvar wherestr = document.forms['frmSearchForm'].wherestr.value;
Exemplo n.º 6
0
    public function viewInputForm()
    {
        //        $grid = $this->getGrid($this->quotation_id);
        $this->address_text = str_replace("\n", "<br/>", $this->address_text);
        $this->address_text = str_replace("  ", " &nbsp;", $this->address_text);
        $this->description = str_replace("\n", "<br/>", $this->description);
        $this->description = str_replace("  ", " &nbsp;", $this->description);
        //        $balanceamt = $this->getOutstandingAmt($this->quotation_id);
        //      $paymenthistory = $this->getPaymentHistory($this->quotation_id);
        if ($this->batch_id > 0) {
            $viewjournalctrl = "  <a href='batch.php?action=view&batch_id={$this->batch_id}' target='_blank'>View Journal</a><br/>";
        }
        $tableheader = "Quotation";
        include "../bpartner/class/BPartner.php";
        $bp = new BPartner();
        $creditstatusarr = $bp->checkCreditLimit($this->bpartner_id, $this->organization_id, $this->issotrx);
        $consumecredit = $creditstatusarr["usage"];
        $creditlimit = $creditstatusarr["limitamt"];
        $credittext = "{$creditlimit}/{$consumecredit}";
        if ($this->iscomplete == 1) {
            $documentstatus = "This transaction is completed!";
            $iscompletectrl = "<input type='button' name='save' onclick='reactivateQuotation()' value='Re-activate'/>";
        } else {
            $documentstatus = "This transaction is voided, it doesn't effect account";
            $iscompletectrl = "";
        }
        $startdate = date("Y-m-", time()) . "01";
        $enddate = date("Y-m-d", time());
        $this->note = str_replace("\n", "<br/>", $this->note);
        $this->address_text = str_replace("\n", "<br/>", $this->address_text);
        $this->description = str_replace("\n", "<br/>", $this->description);
        $viewsubtable = $this->viewsubtable();
        $this->defineHeaderButton();
        $html = <<<HTML

<script>
    function reactivateQuotation(){
\t\tif(confirm("Reactivate this record? The transaction from journal will reverse automatically.")){
          var quotation_id=document.getElementById("quotation_id").value;
           var data="action=reactivate&quotation_id="+quotation_id;
            \$.ajax({
                        url: "{$this->quotationfilename}",type: "POST",data: data,cache: false,
\t\t\t\t\t\t\tsuccess: function (xml) {
                             if(xml != ""){
                             jsonObj = eval( '(' + xml + ')');

                                if(jsonObj.status==1){
                                window.location="{$this->quotationfilename}?action=edit&quotation_id={$this->quotation_id}";
                                }
                                else
                                alert("Cannot reactivate quotation! Msg: "+jsonObj.msg);
                                }
                                }
                   });

\t\t}
          }
  function previewQuotation(){
\t  
                window.open("{$this->quotationfilename}?action=pdf&quotation_id="+document.getElementById("quotation_id").value)
        }
\t\tfunction viewlinehistory(il_id){
\t\t\t//tablename=sim_country&idname=country_id&title=Country
\t\t\twindow.open("../simantz/recordinfo.php?tablename=sim_bpartner_quotationline&idname=quotationline_id&title={$menuname}&id="+il_id);
\t\t\t}

\t\tfunction viewhistory(){
\t\t\t
\t\t\twindow.open("../simantz/recordinfo.php?tablename=sim_bpartner_quotation&idname=quotation_id&title={$menuname}&id={$this->quotation_id}");

\t\t\t}

\tfunction duplicateQuotation(){
\t      var quotation_id=document.getElementById("quotation_id").value;
         //   popup('popUpDiv');
           var data="action=duplicate&quotation_id="+quotation_id;
            \$.ajax({
                        url: "{$this->quotationfilename}",type: "POST",data: data,cache: false,
                success: function (xml) {
                             if(xml != "")
//                             jsonObj = eval( '(' + xml + ')');
                            document.getElementById('idApprovalWindows').innerHTML = xml;

                            document.getElementById('idApprovalWindows').style.display = "";
           //                             popup('popUpDiv');

                }
          });

\t\t}
\t\t    function closeWindow(){
      document.getElementById('idApprovalWindows').style.display = "none";
      document.getElementById('idApprovalWindows').innerHTML = "";
    }

    </script>
    <br/>
    <div id="idApprovalWindows" style="display:none"></div>
<div id='blanket' style='display:none;'></div>

    <div class="searchformblock" style="float:right;">\t
       </div>
\t\t
    <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}
<b style='color:red;'>{$documentstatus}</b>

    <br/>

    <div id='errormsg' class='red' style='display:none'></div>
<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="5" rowspan="1" align="center" id="idHeaderText" class="searchformheader" >{$tableheader}</td>
        </tr>
        <tr>
          <td class="head">Quotation No</td>
          <td class="even">{$this->spquotation_prefix} {$this->document_no}   Branch: {$this->organization_code}</td>
          <td class="head">Business Partner</td>
          <td class="even">
                <a href="../bpartner/bpartner.php?action=viewsummary&bpartner_id={$this->bpartner_id}" target="_blank">{$this->bpartner_name}</a>
          </td>
         <td rowspan='6'></td>
     </tr>
     <tr>
        <td class="head">Date (YYYY-MM-DD)</td>
          <td class="even">{$this->document_date}
          <td class="head">Attn To </td>
          <td class="even">{$this->contacts_name}</td>
     </tr>
     <tr>
      <td class="head">Terms</td>
      <td class="even">{$this->terms_name}</td>
      <td class="head">{$refno}</td>
      <td class="even">{$this->ref_no}</td>
     </tr>
     <tr>
         <td class="head">Prepared By</td>
         <td class="even">{$this->preparedbyname}</td>
        <td class="head">Sales Agent</td>
         <td class="even">{$this->saleagent_name}</td>
</tr>
<tr>
       <td class="head">Address</td>
       <td class="even">{$this->address_text}
        </td>
         <td class="head">Currency</td>
          <td class="even">{$this->currency_code} (Exchange Rate: {$this->exchangerate})</td>
<tr><td colspan='5'>
    <div id='detaildiv'>
                {$viewsubtable}
</div>
</td></tr>

<tr><td colspan='5' style='text-align:right'>        
                <input type='button' value='Preview' onclick='javascript:previewQuotation()'/>
        <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'>
                {$iscompletectrl}
            <input type="button" value="Duplicate" onclick=duplicateQuotation()>
\t  <input type='button' id='btnviewhistory' name='btnviewhistory' onclick='viewhistory()' value='View Record Info'/>
\t</td>

<tr> <td class="head">Description</td>
<td class="even" colspan='5' style="width:70%">{$this->description}</td>
       
</tr>
</tr>
   <td class="head">Note</td>
<td class="even" colspan='3'>{$this->note}</td>
</tr></table>
</form>

</div>
</div>

HTML;
        return $html;
    }
Exemplo n.º 7
0
<?php

include_once '../simantz/class/fpdf/fpdf.php';
include_once "system.php";
//include_once "../system/class/Organization.php";
include_once "../simantz/class/Period.inc.php";
include_once "../simantz/class/BPartner.php";
//include_once "class/Accounts.php";
$org = new Organization();
$bp = new BPartner();
//$acc = new Accounts();
$header = array("No", "Item", "Unit Price", "Qty", "Amount");
$w0header = array(7, 70, 30, 50, 40);
$w1header = array(7, 70, 30, 50, 40);
$w0 = array(7, 70, 30, 35, 15, 40);
$w1 = array(7, 70, 30, 35, 15, 40);
$papertype = array("A4", "Letter");
$datefrom = "Unknown";
$dateto = "Unknown";
$marginx = array(10, 10);
$marginy = array(10, 10);
$pageheaderheight = array(80, 80);
$pagefooterheight = array(53, 53);
$reversepagefooterheight = array(-45, -45);
$agingboxwidth = array(31, 31);
$agingboxheight = array(10, 10);
$pagewidth = array(180, 190);
$tableheadertype = "TB";
//   $orginfo_startx=array(60,60);
//   $orginfo_starty=array(10,10);
$defaultfont = "Times";
Exemplo n.º 8
0
<?php

include "system.php";
include_once "../simantz/class/SelectCtrl.inc.php";
//include_once 'class/Log.php';
include_once 'class/BPartner.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
include_once "../simantz/class/datepicker/class.datepicker.php";
//include_once "../system/class/Period.php";
$dp = new datepicker($url);
$dp->dateFormat = 'Y-m-d';
$log = new Log();
$o = new BPartner();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
if (file_exists("../simbiz/class/AccountsAPI.php")) {
    include_once "../simbiz/class/SimbizSelectCtrl.inc.php";
    $simbizctrl = new SimbizSelectCtrl();
    $issimbiz = true;
}
if (file_exists("../sales/pricelist.php")) {
    include_once "../warehouse/class/SimERPSelectCtrl.inc.php";
    $simerpctrl = new SimERPSelectCtrl();
    $issales = true;
}
if (file_exists("../purchase/pricelist.php")) {
    include_once "../warehouse/class/SimERPSelectCtrl.inc.php";
    $simerpctrl = new SimERPSelectCtrl();
    $ispurchase = true;
}
Exemplo n.º 9
0
 case "refreshsubtable":
     include "../simantz/class/FormElement.php";
     include "../bpartner/class/BPartnerFormElement.inc.php";
     $fe = new FormElement();
     $sbfe = new BPartnerFormElement();
     $o->quotation_id = $_REQUEST['quotation_id'];
     $o->fetchQuotation($o->quotation_id);
     echo $o->subtable();
     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)));
     if ($o->issotrx == 1) {
         $acc_id = $bp->debtoraccounts_id;
     } else {
         $acc_id = $bp->creditoraccounts_id;
     }
     $arrcredit = $bp->checkCreditLimit($bpartner_id, $defaultorganization_id, $o->issotrx);
     $control = $arrcredit["control"];
     $limitamt = $arrcredit["limitamt"];
     $usage = $arrcredit["usage"];
Exemplo n.º 10
0
<?php

include_once "system.php";
include_once '../bpartner/class/BPartner.php';
include_once "../simantz/class/PHPJasperXML.inc";
include_once "../simantz/class/fpdf/fpdf.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$s = new XoopsSecurity();
$b = new BPartner();
//var_dump($_POST);
$industry_id = $_POST['industry_id'];
$bpartnergroup_id = $_POST['bpartnergroup_id'];
$isactive = $_POST['isactive'];
$isSearch = $_POST['isSearch'];
if (isset($_GET['filterchar'])) {
    $filterchar = $_GET['filterchar'];
    $industry_id = $_GET['industry_id'];
    $bpartnergroup_id = $_GET['bpartnergroup_id'];
    $isactive = $_GET['isactive'];
    $isSearch = $_GET['isSearch'];
}
if (isset($_POST['printreport'])) {
    //var_dump($_POST);
    $org = new Organization();
    $org->fetchOrganization($defaultorganization_id);
    $organization_name = $org->organization_name;
    $company_no = $org->companyno;
    $addresslist = "";
    foreach ($_POST['print'] as $c) {
        if ($c > 0) {
            $addresslist .= $c . ",";