The ref iterates. How do I now set it as the value of the ref field?

The reference number iterates fine. I've tested many times.

Unfortunately, I don't fully understand how you mean. However, if you can show me this one thing, I'd try a few ideas and share the results. How to I write a value, any value at all, to the field?

I tried

?> <script> document.getElementByName('ref').value='001/2018'; </script><?php  // just testing  

instead of

?> document.getElementByName('ref').value= '<?php echo $ref . "';"; // I added this line

but didn't.

Right now I'm looking at includes/ui/ui_controls.inc, still on how to write to the field.

Any help?

Please have a look at the following code in sales/sales_order_entry.php

    {
        display_error(_("The entered reference is already in use."));
        $ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today()));
        if ($ref != $_SESSION['Items']->reference)
        {
            display_error(_("The reference number field has been increased. Please save the document again."));
            $_POST['ref'] = $_SESSION['Items']->reference = $ref;
            ?> document.getElementByName('ref').value= '<?php echo $ref . "';"; // I added this line
            $Ajax->activate('ref');
        }    
        set_focus('ref');
    }

After a series of tests, I can confirm that the     $ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today())); correctly gets the next unused reference number.

The only thing left is to set the value of the field to that new ref. I tried with  document.getElementByName('ref').value but not working.

Someone help me please.

About to try now. Thanks, you're awesome.

Hi all,

When I want to see transactions only by a specific user, I go to Banking and General Ledger > Journal Inquiry, then select that user. But the result doesn't filter.

How do fix this?

hi all,

With Sales Orders, deliveries and invoices, I sometimes get

The entered reference is already in use.
The reference number field has been increased. Please save the document again.

However, the increase doesn't happen. How do I fix this please?

Beyond the sales section, how can I make the reference fields increase automatically in all other transactions  - banking & GL, Dimensions, Items & Inventory, etc - when already used?

Advance thanks.

apmuthu wrote:

Take a backup from Setup => Backup/Restore and then do the voiding and then revert by restoring back if anything went wrong.

Backup and restore will always work. However, in my case, an auditor may want to see transactions that were voided days/weeks after voiding. Restoring a backup at that time means we're losing all transactions from the time of voiding.

34

(7 replies, posted in Setup)

Helpful. Thanks.

Yes, I'm very aware of the warning:

Are you sure you want to void this transaction? This action cannot be undone.

However, I still want to believe something can be done, especially before the actual voiding. Any ideas?

Is there a way to store the transaction to be voided somewhere (as a SQL statement or anything) before voiding? Or what options are available? Any wild (even seemingly absurd) idea is welcome.

36

(7 replies, posted in Setup)

I edited reporting/rep710.php

I added a.description to the $sql variable like so...

$sql = "SELECT a.*, 
        SUM(IF(ISNULL(g.amount), NULL, IF(g.amount > 0, g.amount, 0))) AS amount,
        u.user_id, a.description, 
        UNIX_TIMESTAMP(a.stamp) as unix_stamp ...

Changed the columns widths as follows

    //$cols = array(0, 60, 120, 180, 240, 340, 400, 460, 520);
    $cols = array(-10, 40, 80, 120, 170, 250, 280, 500, 560);

altered the "action" column as follows:

        if (!$myrow['description']){
        if ($myrow['gl_seq'] == null)
            $action = _('Updated');
        else
            $action = _('Created');     
        } else {
            $action = $myrow['description'];   
        }
        $rep->TextCol(6, 7, $action);

Also in admin/db/voiding_db.inc, I changed

    //add_audit_trail($type, $type_no, $date_, _("Voided.")."\n".$memo_);
    add_audit_trail($type, $type_no, $date_, _("Voided.")." ".$memo_);

This gave me my desired result - Voided transactions are now lablled "Voided" and any memo also displays.

37

(7 replies, posted in Setup)

And what does this line in config.php do?

    $show_voided_gl_trans = 1;

I changed to 0 and 1 but don't seem to see any difference anywhere.

38

(7 replies, posted in Setup)

Hi all,

how can I show voided transactions in audit trail? Instead of "CHANGED" and  "CLOSED" in the action section of the audit trail report, how can we have it read "VOIDED" for voided transactions?

Advance thanks.

39

(16 replies, posted in Accounts Receivable)

Thanks @apmuthu and @cambell. I'll update and repost.

I notice that Journal Entries with 1200 Account Receivables, the customer must be selected. When this customer is merged into another, the transaction is correctly transferred but clicking the ref # of that journal Entry in the new customer, the customer name doesn't display. Any ideas?

40

(16 replies, posted in Accounts Receivable)

I looked at how it's done in Quickbooks on youtube and I didn't like it - copying name of customer you want and pasting over the one you want to merge and delete. So I did it differently. I created the file sales/merge.php and the code as follows:

<?php

$path_to_root = "..";
$page_security = 'SA_CUSTOMER';

include_once($path_to_root . "/sales/includes/cart_class.inc");
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/sales/includes/sales_ui.inc");
include_once($path_to_root . "/sales/includes/ui/sales_order_ui.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");
include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
include_once($path_to_root . "/reporting/includes/reporting.inc");
include_once($path_to_root . "/includes/ui/ui_controls.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/sales/includes/db/customers_db.inc");

$js = '';

page("Merge Customers", false, false, "", $js);

        $deletecustomer = $_POST['deletecustomer'];
        $keepcustomer = $_POST['keepcustomer'];
        
        
        if ($keepcustomer  && $deletecustomer){                
        
        if ($keepcustomer == $deletecustomer) 
            die("<center>You chose the same customer in both selections. Cannot merge a customer with himself/herself. <br /><br /><a href=\"merge.php\">Reload</a><br /><br /><br />");
        $sql = "UPDATE 0_debtor_trans SET `debtor_no` = $keepcustomer, branch_code = (select branch_code from 0_cust_branch where debtor_no = $keepcustomer limit 1) WHERE `debtor_no` = $deletecustomer";
        $result = db_query($sql, "An error occured");

        $sql = "UPDATE 0_sales_orders SET `debtor_no` = $keepcustomer, delivery_address = '', contact_phone = '', deliver_to = '', branch_code = (select branch_code from 0_cust_branch where debtor_no = $keepcustomer limit 1) WHERE `debtor_no` = $deletecustomer";
        $result = db_query($sql, "An error occured");

        $sql = "UPDATE 0_cust_allocations SET `person_id` = $keepcustomer WHERE `person_id` = $deletecustomer";
        $result = db_query($sql, "An error occured");

        $sql = "DELETE FROM 0_debtors_master where debtor_no = $deletecustomer"; 
        $result = db_query($sql, "An error occured");

        $sql = "DELETE FROM 0_cust_branch where debtor_no = $deletecustomer"; 
        $result = db_query($sql, "An error occured");

        $sql = "DELETE FROM 0_crm_contacts where type = 'customer' AND entity_id = $deletecustomer"; 
        $result = db_query($sql, "An error occured");

        $sql = "DELETE FROM 0_crm_contacts where type = 'cust_branch' AND entity_id = (select branch_code from 0_cust_branch where debtor_no = $deletecustomer)"; 
        $result = db_query($sql, "An error occured");

        $sql = "DELETE FROM 0_crm_persons where type = 'customer' AND id = (select person_id from 0_crm_contacts where type = 'customer' AND entity_id = $deletecustomer limit 1)"; 
        $result = db_query($sql, "An error occured");
        
    header("Location: ..");
        }

    $sql = "SELECT  debtor_no,  name FROM  `0_debtors_master`  ORDER BY 'name' ASC ";
    $result = db_query($sql, "An error occured");
echo "<form method=\"post\">";
echo "<center><br /><br /><b class=\"headingtext\">NOTE: THIS ACTION IS IRREVOCABLE</b><br /><br /><table style= \"width:70% \">  <tr>  <td colspan= \"6 \">Merge & Delete this customer</td>  <th> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  </th>  <td colspan= \"6 \">Keep this customer</td>   </tr>  <tr>  <td colspan= \"6 \"><select id= \"deletecustomer\" name= \"deletecustomer\" class= \"combo2 \" title= \"Merge & Delete customer \" _last= \"14 \">";

    while ($myrow = db_fetch($result))
    {
        echo "<option value= \"" . $myrow['debtor_no'] . " \">" . $myrow['name'] . " </option>"; 
    }

    echo "</select></td>  <td colspan= \"2 \"><font size= \"6 \"> &nbsp; &nbsp; &rArr; &nbsp; &nbsp; &nbsp; </font> </td><td colspan= \"6 \"><select id= \"keepcustomer\" name= \"keepcustomer\" class= \"combo2 \" title= \"Merge & keep customer \" _last= \"14 \">";
    
    
    $sql = "SELECT  debtor_no,  name FROM  `0_debtors_master`  ORDER BY 'name' ASC ";
    $result = db_query($sql, "An error occured");
        while ($myrow = db_fetch($result))
    {
        //echo $myrow['debtor_no'] . " " . $myrow['name'] . "<br />";
        echo "<option value= \"" . $myrow['debtor_no'] . " \">" . $myrow['name'] . " </option>"; 
    }
    
    echo "</select></td>  </tr>";


echo "</table>";

echo "<br /><br /><br /><input type=\"submit\" value=\" Merge Customers \"> &nbsp; &nbsp; <input type=\"submit\" formaction=\"..\" value=\" Cancel \" > </center>";
//&nbsp; &nbsp; <input type=\"submit\" formaction=\"..\" value=\" Cancel \" >
echo "</form><br /><br /><br />";

end_page();

As much as I can see, it works fine. Any Comments?

41

(16 replies, posted in Accounts Receivable)

Hi all,

I have several customers duplicated. For example, XYZ Ltd, XYZ Company Ltd and XYZ all have transactions (payments, invoices, deliveries, orders, etc) but this is just the same customer. How can I merge them so that all their transactions are under one name instead of several?

Advance thanks.

Hi,

instead of customer balances report to use sale invoices, I want it to use delivery rather.

I'm looking at rep101.php now and I see ST_SALESINVOICE and ST_CUSTDELIVERY but don't know how to proceed.

Any help please?

joe wrote:

Use dimensions for the branches. It will work fine for you.

Joe

It worked for me perfectly. Thanks a zillion.

Thanks for the quick reply.

I'm going to do it that way. I'll let you all know how it goes.

Thanks again.

Hi all,

I want to setup FA such that I can have all three branches of my company using the same installation. I want it this was so that I can generate reports for each branch and also reports for all 3 together.

For instance I want to be able to generate profit and loss statements, sales reports, expense reports, etc for any of the branches and also for all of them put together.

Any ideas?

Thanks in advance.

Let me help you.
davidkumi [AT] gmail [DOT] com

Let's get it done.
        davidkumi AT gmail DOT com

if you still need this help or any other, don't hesitate
   davidkumi AT gmail.com

Contact me davidkumi@gmail.com