51

(9 replies, posted in Reporting)

Differences as follows

File: <unsaved>
01: ---   \reporting\rep115ORIGINAL.php
02: +++\reporting\rep115.php
03: @@ -29,7 +29,7 @@
04:  
05:  print_customer_balances();
06:  
07: -function get_open_balance($debtorno, $to)
08: +function get_open_balance($debtorno, $branchcode, $to)
09:  {
10:      if ($to)
11:          $to = date2sql($to);
12: @@ -43,17 +43,18 @@
13:      $sql .= "SUM(IF(t.type = ".ST_SALESINVOICE.", 1, -1) *
14:          (abs(t.ov_amount + t.ov_gst + t.ov_freight + t.ov_freight_tax + t.ov_discount) - abs(t.alloc))) AS OutStanding
15:          FROM ".TB_PREF."debtor_trans t
16: -        WHERE t.debtor_no = ".db_escape($debtorno)
17: +        WHERE t.debtor_no = ".db_escape($debtorno)."
18: +        AND t.branch_code=".db_escape($branchcode)
19:          ." AND t.type <> ".ST_CUSTDELIVERY;
20:      if ($to)
21:          $sql .= " AND t.tran_date < '$to'";
22: -    $sql .= " GROUP BY debtor_no";
23: +    // $sql .= " GROUP BY debtor_no";
24:  
25:      $result = db_query($sql,"No transactions were returned");
26:      return db_fetch($result);
27:  }
28:  
29: -function get_transactions($debtorno, $from, $to, $only_rec)
30: +function get_transactions($debtorno, $branchcode, $from, $to, $only_rec)
31:  {
32:      $from = date2sql($from);
33:      $to = date2sql($to);
34: @@ -82,7 +83,8 @@
35:          LEFT JOIN $allocated_to ON alloc_to.trans_type = trans.type AND alloc_to.trans_no = trans.trans_no
36:          WHERE trans.tran_date >= '$from'
37:          AND trans.tran_date <= '$to'
38: -        AND trans.debtor_no = ".db_escape($debtorno);
39: +        AND trans.debtor_no = ".db_escape($debtorno)."
40: +        AND trans.branch_code=".db_escape($branchcode);
41:      $sql .= " AND trans.type <> ".ST_CUSTDELIVERY;
42:      $sql .= " AND ISNULL(voided.id)
43:          ORDER BY trans.tran_date ";
44: @@ -158,7 +160,7 @@
45:      $cols = array(0, 100, 130, 190, 250, 320, 385, 450, 515);
46:      //$cols = array(0, 70, 140, 180, 230, 270, 350, 445, 495, 555);
47:  
48: -    $headers = array(_('Name'), '', '', _('Open Balance'), _('Debit'), _('Credit'), '', _('Balance'));
49: +    $headers = array(_('Name'), '', _('Branch'), _('Open Balance'), _('Debit'), _('Credit'), '', _('Balance'));
50:  
51:      $aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
52:  
53: @@ -179,7 +181,7 @@
54:  
55:      $grandtotal = array(0,0,0,0);
56:  
57: -    $sql = "SELECT ".TB_PREF."debtors_master.debtor_no, name, curr_code FROM ".TB_PREF."debtors_master
58: +    $sql = "SELECT ".TB_PREF."debtors_master.debtor_no, name, br_name, branch_code, curr_code FROM ".TB_PREF."debtors_master
59:          INNER JOIN ".TB_PREF."cust_branch
60:          ON ".TB_PREF."debtors_master.debtor_no=".TB_PREF."cust_branch.debtor_no
61:          INNER JOIN ".TB_PREF."areas
62: @@ -204,7 +206,7 @@
63:          $sql .= " WHERE ".TB_PREF."salesman.salesman_code=".db_escape($folk);
64:      }
65:  
66: -    $sql .= " GROUP BY ".TB_PREF."debtors_master.debtor_no ORDER BY name";
67: +    // $sql .= " GROUP BY ".TB_PREF."debtors_master.debtor_no ORDER BY name";
68:  
69:      $result = db_query($sql, "The customers could not be retrieved");
70:  
71: @@ -215,7 +217,7 @@
72:  
73:          $accumulate = 0;
74:          $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
75: -        $bal = get_open_balance($myrow['debtor_no'], $from, $convert);
76: +        $bal = get_open_balance($myrow['debtor_no'], $myrow['branch_code'], $from, $convert);
77:          $init[0] = $init[1] = 0.0;
78:          $init[0] = round2(abs($bal['charges'] * $rate), $dec);
79:          $init[1] = round2(Abs($bal['credits'] * $rate), $dec);
80: @@ -223,7 +225,7 @@
81:          $init[3] = $init[0] - $init[1];
82:          $accumulate += $init[3];
83:  
84: -        $res = get_transactions($myrow['debtor_no'], $from, $to, false);
85: +        $res = get_transactions($myrow['debtor_no'], $myrow['branch_code'], $from, $to, false);
86:  
87:          $total = array(0,0,0,0);
88:          for ($i = 0; $i < 4; $i++)
89: @@ -279,6 +281,7 @@
90:          }
91:          if ($no_zeros && $total[3] == 0.0 && $curr_db == 0.0 && $curr_cr == 0.0) continue;
92:          $rep->TextCol(0, 2, $myrow['name']);
93: +        $rep->TextCol(2, 3, $myrow['br_name']);
94:          $rep->AmountCol(3, 4, $total[3] + $curr_cr - $curr_db, $dec);
95:          $rep->AmountCol(4, 5, $curr_db, $dec);
96:          $rep->AmountCol(5, 6, $curr_cr, $dec);

52

(3 replies, posted in Reporting)

Change orientation...Landscape/Horizontal is the easy way.
Or
Download as excel file and format how you want.
Or
Adjust column widths and font sizes in file if you know what you are doing

53

(9 replies, posted in Reporting)

I've modified rep115 a little; this is the result

Its a permanent modification so no option to turn off/on

If this meets the requirements I'll publish code changes and if ok will make it into an extension.

A total for the customer could be confusing as the customer has its own branch too and it can be selected in sales.

54

(82 replies, posted in FA Modifications)

@joe I've PM-ed you; please read as soon as possible its quite urgent

55

(82 replies, posted in FA Modifications)

@joe looks excellent.

I've changed access setup as login was sys admin and assume that wasn't what you wanted? If it was my apologies for meddling.
Tried to PM earlier but you didn't answer.

@apmuthu, the problem is on line 161 when the function 'get_demand_asm_qty' is called. I verified this by commenting out the line and with approx 3.5k items in the inventory the report ran in less than 5 seconds, where as before uncommented it timed out.

get_demand_asm_qty line 104 in includes/db/manufacturing_db.inc calls another function stock_demand_manufacture also in the same file (line 54) this from what I understand cycles for up to 10 reiterations per item

Retentive tax works fine if you enter a tax as negative, you will have to modify the database directly as FA does not allow negative taxes.

Have a look at giving MySQL more resources - increase query memory, etc. Its not really on-topic here, but google will give you lots of help.
Just found a a post by apmuthu which deals with just this issue and there's a link to a page for tuning MySQL.
You may want to also google about the WAMP/MAMP/LAMP you are using.

Have a look at apmuthu's post, if still problems reply with version numbers of FA, PHP, MySQL and WAMP type and version

59

(15 replies, posted in Setup)

Study FA tax's in the wiki and linked pages, and you will find that each item can have its own tax.

60

(52 replies, posted in Modules Add-on's)

@kvvaradha - OK, Bit busy at the moment, but I'll have a think and post something.

Also, it seems 'Bin Number' is a definite inclusion in Items.

61

(52 replies, posted in Modules Add-on's)

@kvvaradha - It has been made clear by Joe/Janus that there will be no more DB changes in 2.4, i.e, Any modifications requiring DB changes will not be considered for V2.4 only for 2.5 and if they consider the modifications are right for FA.

Its relatively easy to add extra fields to the core, not so easy to include them in FA functionality, but including them now brings all the disadvantages of modifying core files - upgrades, management, etc.

Given the above a module seemed to be the only viable solution. The module I wrote is quite 'bulky' as I tried to incorporate as many additional fields as I thought users would want. (Each user/business would want there own fields) The original 'integrated' version did not work, which leads to the current version using extra pages: The remains bearing not much resemblance to the initial idea :-(

So my thoughts on your mod are - I'd think I'd leave just the custom fields from my module in, 4 for each of customers, Items and suppliers, that way users can label the fields to what they want. You can use any code from the module.

62

(7 replies, posted in Fixed Assets)

You still may have a problem - the error warning states 20,0 not 20.0

63

(7 replies, posted in Fixed Assets)

Have you changed the character used for a decimal point?

This is what you want

65

(7 replies, posted in Banking and General Ledger)

Create a new company

66

(7 replies, posted in Banking and General Ledger)

Will HOSPITAL be a separate tax paying entity?

67

(3 replies, posted in Setup)

Would customer branches be sufficient? Try it out on your training copy first.

Use this version and you can write what you want on what document you want

69

(21 replies, posted in Wish List)

This users post has a different take on the tax system in Pakistan?

@boxygen - this doesn't answer your question; could you just rename the module, keeping the existing security settings?

Retested - with item set to 'Editable Description' all now working - @joe thank you for your time and patience in explaining this.

I 'expected' as did the OP, that just adding the Supplier Purchasing Data would be all that's necessary; would it be possible to make this less prone to user error or lack of user knowledge?
Maybe:-
Remove the requirement for 'Editable Description' when using Supplier Purchasing Data description.
Or
When supplier purchasing data for an item is added, check if item is 'Editable Description' if not change it?

If not possible for 2.4; perhaps something for 2.5?

@joe

joe wrote:

When receiving items for the Purchase Order, the Suppliers item description is shown.

But that's not what is happening, in the GRN the original item description is being shown

I have tried PHP 5.6.x

The actual issue is:-

When you receive the goods, in the GRN the original item description is displayed, not the edited description that was entered in the PO.

So to keep the edited description you have to change the GRN item description - is this the intended functionality?
And if you do not change the item description in the GRN the original item description is written to the Supplier purchase data.

Please follow the steps all the way through to the GRN in post#2 above and you will see the issue.

@apmuthu, track what I did in post #2 above

As stated logged in and out.

2.4.7  on both linux and wampserver, MySQL version 10.2.26-MariaDB, PHP version 7.2.21, MySQL version 5.7.21, PHP version 7.0.29 respectively; Latest versions of chrome and firefox

@Joe, @apmuthu. I was using editable description - checkbox checked