476

(1 replies, posted in Setup)

You need to change in more files. especially  we have three kind of operations,
1. sales order to delivery and delivery to invoice,
2. direct sales delivery
3. direct invoice which makes a delivery note.

so you have to do following steps to do that.
1. add a new column in users table and make the users in it, which helps to identify the users whom you want to prevent editing it, 
2. and get the field value for each logged in users and identify the user whether restricted or allowed to access.
3. There you need to get the flag and set it in side the sales module files, whether allowing it or not.

477

(3 replies, posted in Setup)

There is a bug in it. These radio buttons has name protect . But in db_import  function it was called check_value('protected');

So it should be changed to work properly.

@mark0300 while importing database it connects to replace the entire database
If you want to retain your current login and security roles these two options will help you to get it.

@joe  update the backups.php file to fix this issue.

478

(7 replies, posted in Report Bugs here)

Thanks for informing us back. Looks like we have to add a validation to show error message when the text exceeds the limit of it.

479

(22 replies, posted in Setup)

Looks like this is a strange issue. I feel the below code is missing the cust allocation.

  while ($row = db_fetch($result))
    {
        if ($row['type'] == ST_SALESINVOICE)
        {
            $deliveries = get_sales_parent_numbers($row['type'], $row['trans_no']);
            foreach ($deliveries as $delivery)
            {
                $sql = "DELETE FROM ".TB_PREF."debtor_trans_details WHERE debtor_trans_no = $delivery AND debtor_trans_type = ".ST_CUSTDELIVERY;
                db_query($sql, "Could not delete debtor trans details");
                $sql = "DELETE FROM ".TB_PREF."debtor_trans WHERE trans_no = $delivery AND type = ".ST_CUSTDELIVERY;
                db_query($sql, "Could not delete debtor trans");
                delete_attachments_and_comments(ST_CUSTDELIVERY, $delivery);
            }        
        }    
        $sql = "DELETE FROM ".TB_PREF."cust_allocations WHERE trans_no_from = {$row['trans_no']} AND trans_type_from = {$row['type']}";
        db_query($sql, "Could not delete cust allocations");
.
.
.
}

And may be it should be like this

while ($row = db_fetch($result))
    {
        if ($row['type'] == ST_SALESINVOICE)
        {
            $deliveries = get_sales_parent_numbers($row['type'], $row['trans_no']);
            foreach ($deliveries as $delivery)
            {
                $sql = "DELETE FROM ".TB_PREF."debtor_trans_details WHERE debtor_trans_no = $delivery AND debtor_trans_type = ".ST_CUSTDELIVERY;
                db_query($sql, "Could not delete debtor trans details");
                $sql = "DELETE FROM ".TB_PREF."debtor_trans WHERE trans_no = $delivery AND type = ".ST_CUSTDELIVERY;
                db_query($sql, "Could not delete debtor trans");
                delete_attachments_and_comments(ST_CUSTDELIVERY, $delivery);
            }        
                      $sql = "DELETE FROM ".TB_PREF."cust_allocations WHERE trans_no_to = {$row['trans_no']} AND trans_type_to = {$row['type']}";  // newly added 
        db_query($sql, "Could not delete cust allocations");  // newly added. 
        }    
        $sql = "DELETE FROM ".TB_PREF."cust_allocations WHERE trans_no_from = {$row['trans_no']} AND trans_type_from = {$row['type']}";
        db_query($sql, "Could not delete cust allocations");
}

I have added two more lines added newly to collect the respective invoice allocation entires delete. Like the same for supplier allocations.

If it helps feedback us to fix it in core.

From FA  the flow goes like this.

If you make sales order for 10 products and than 8 products delivered that will be recorded in delivery note. And from that 8 product you can make invoice. And here you can't invoice for remaining 2 products.

And also you can invoice for 6 products,  than only you can record payment of 6 products.

The FA sequence is like this.
1. Sales order
2. Sales delivery
3. Sales Invoice
4. Customer payment.

Alternatively  with prepaid orders
1. Prepaid sales order
2. Record payment
3. No delivery. But directly invoice for that sales order

That's the sequence. Hope I explained the flow clearly.

481

(7 replies, posted in Report Bugs here)

Dude looks like the issue is not in program. I have tested in both versions. It worked fine for me.  Can you record a video with inspect element and show us the js errors if possible.

Did you install any other modules and themes?.

Is it hosted in remote server or localhost ?

Let's try the issue in next level. In case we can predict the issue.

482

(7 replies, posted in Report Bugs here)

@acaboy69, looks like the GL  entry closing date was not modified. So simply go to sys_prefs table and fine the gl_close_date and change it to previous year.

483

(7 replies, posted in Report Bugs here)

@kevinleebr  Looks like the fiscal year was set to 2019. If you change the invoice date or delivery date to 2019 it might work.

Still if you have problem you can enable debugging mode and update us the issue screenshot or something with error log. We can help you very well.

484

(2 replies, posted in Setup)

Hello dude ,

Welcome to FA  community. It's good to know.  And you have to download the dejavu  font from here

@anoopmb, you are right, its useful module here. But where the company has less people and try that. its double work for them to do it. So the first solution, we applied there is for the small companies or those who handles FA functions totally.

@joe, i have tested your solution, it works fine. looks like its very easy solution. to get the dimensions on the next invoice

@joe , great to hear it.  How about cron job connectivity. ?

Shall we make one to make it automatically on its recurrent day.

@joe,  his point is dimensions are missing. I think we are recreating the cart here.

$doc = new Cart(ST_SALESORDER, array($order_no));

And that will get the dimensions from the sales orders table.

And then it will be creating the invoice here

    $invno = $cart->write(1);

Looks like a passing parameter is missing.

If possible we can extend it to connect with Linux cron jobs to run it automatically on a certain period gap.

It's a tricky feature to add both language for a single item. We must add one more name field to store it in stock master table.

And than you can customize the sales and purchase invoice to show the second name field in it .

But for rtl,  it's a bit complex to make it both in same invoice.

490

(22 replies, posted in Setup)

@joe, your solution is good. Instead of rewriting it as journal entry. We keep the invoices alive and it's allocations alive. So it will be removed if they remove next fiscal year. 

@madosk, This is definitely a time saving way for you to implement it.  Hope your problem fixed with this. And post an reply after using this updated program. It would be a solved solution for future referring users.

491

(22 replies, posted in Setup)

How ever there is a problem with payment of next year for previous year invoice.

Let's take his example. He issued several invoices  at the end of last year and collected the payment in next year.  Which means the system needs to make one journal entry for a customer at least to record the invoice balances as opening balance and that should be allocated in the next year.

492

(12 replies, posted in Banking and General Ledger)

I will try this and update you brother. Hopefully, we can come up with a solution.

493

(22 replies, posted in Setup)

That's good idea. But you have to know which invoices are allocated. With that it's good for you to reallocate it.  Hope you got good solution. Once you implement it successfully or issues. Just drop your feedbacks and hints

494

(22 replies, posted in Setup)

The existing delete fiscal year function already handles to delete in other entries. And you don't need to study much of it. But you have to study something to create journal entry for opening balance in sales and purchase.  Before deleting it on customer invoice and supplier invoice.  We have to make this function to create opening balance. And than you can allow it to delete the entries. I can understand it would take more time to delete it. Probably . You can wrote a cron job to run it for every 10mins and in a certain length of invoices and data. The system won't freeze or fail to remove. You can run it in free time like your night time or in holidays. So you can achieve it in less time and you don't need to worry about timeouts. There you have more data. So you have to write a separate function and call it inside FA. Or call it inside cron job. That will do the process.

495

(22 replies, posted in Setup)

I am giving the way of my solution. Because I tried one functionality before for the users who are coming to FA from other software's.  Like they wanted to keep the journal of previous customer opening balances as journal entry. And when the customer make payment record the payment against that journal entries.

So the solution is to separate the invoices which are paid on 2015 and invoiced in 2014.  And than we have to summarise the balance of it and make one journal entry.  And change the allocation of invoices to that newly created journal entry to take effect. Let's say if you have 50 invoices in 2014 and paid in 2015. All these invoices needs to be removed and created one journal entry with all its balance.  After that we have to reallocate the payments against that journal entry.  Like this. We can remove all the other entries like stock balance in stock moves,

You have to remove related entries in
audit trail
Bank trans
Comments,
Cust allocations
Debtor trans
Debtor trans details
Gl trans
Journal
Grn_items, batch
Purch_orders
Purch_order_details
Sales orders
Sales orders details
Stock moves
Supp trans
Supp trans details
Trans tax details
Wo orders,

And other tables if anything affecting the yearly data. 
May be If you see tother

496

(20 replies, posted in Report Bugs here)

@detkenn if you see more depreciation , do list them, some one will find solution to it.

@detkenn - not everyone is expert in accounting.  Sometimes a learning accountant,  like new joiny or new person, might make mistake in account selection. And sometimes by mistake. We might choose wrong account and input it by accidently, in this cases the careless mistake can be highlighted. Most of accounting software's  also have this feature to check before make entries.

Hope this feature would be helpful for others.

cedricktshiyoyo wrote:

A thousand times thanks brother @kvvaradha . The code worked perfectly.
This was exactly what I needed. I will modify it little bit with your permission for other accounts too.

Big thanks again!!!

That's good to hear it.

If you modify the code, I feel it's very much usefull to FA  community. So provide it for us to update FA  core.

@Joe,  can you check this to update it to core. May be its useful feature for others.

Your second option is fine I feel. Because sometimes. People may make reverse entries once they made mistake in another form. So I think the warning would be fine. At the same time even if they post it with warning. It should work and submit the journal entry.

Here is a screenshot for reference what i talked. And code i modified in gl_journal.php

// New function to check it 
function check_account_selection($code, $amount){
    $sql = "SELECT ms.*, cl.class_name, cl.ctype FROM ".TB_PREF."chart_master AS ms LEFT JOIN ".TB_PREF."chart_types AS tp ON ms.account_type= tp.id LEFT JOIN ".TB_PREF."chart_class AS cl ON cl.cid = tp.class_id WHERE account_code= ".db_escape($code);
    $res = db_query($sql, "Cant get the chart class selection");
    if(db_num_rows($res) == 1 ){
        if($row = db_fetch($res)){
            if($row['ctype'] == CL_EXPENSE && $amount > 0)
                display_warning(_("You are entered the Expense under the debit side"));
            if($row['ctype'] == CL_ASSETS  && $amount < 0 )
                display_warning(_("You are entered the Asset in credit side"));
        }
    }

}
function handle_new_item()
{
    if (!check_item_data())
        return;


    if (input_num('AmountDebit') > 0)
        $amount = input_num('AmountDebit');
    else
        $amount = -input_num('AmountCredit');
    
    check_account_selection(get_post('code_id'), $amount);  // This is new line in existing code
    

    $_SESSION['journal_items']->add_gl_item($_POST['code_id'], $_POST['dimension_id'],
        $_POST['dimension2_id'], $amount, $_POST['LineMemo'], '', get_post('person_id'));
      unset($_SESSION['journal_items']->tax_info);
    line_start_focus();
}

abd for updating of exiting entry.

 
function handle_update_item()
{
    if($_POST['UpdateItem'] != "" && check_item_data())
    {
        if (input_num('AmountDebit') > 0)
            $amount = input_num('AmountDebit');
        else
            $amount = -input_num('AmountCredit');


        check_account_selection(get_post('code_id'), $amount); // This is new line in existing code


        $_SESSION['journal_items']->update_gl_item($_POST['Index'], $_POST['code_id'], 
            $_POST['dimension_id'], $_POST['dimension2_id'], $amount, $_POST['LineMemo'], '', get_post('person_id'));
        unset($_SESSION['journal_items']->tax_info);
        line_start_focus();
    }
}

@barbarian, for clinic management. Customers are simply the patients. So I guess you can rename the customer as patient and use it. In come cases they don't select patient name. That cases you can give a textbox to input it. And branches you don't need here.

Regarding the batch and expiry date. It's valid only for the pharma purpose.  Suppose if they are billing some charges from clinic. It should be recorded without batch.

Looks like you need to make a type selection whether it's pharma bill or service bill. Based on that batch and expiry date you can enable.