Ask someone else to view the page and see if they can see it or compare with their installs. We can all generate Arabic PDFs. Hope you have the necessary fonts installed in FA.
2,126 01/13/2018 02:30:43 pm
Re: problem at creating a pdf report in Arabic (3 replies, posted in Report Bugs here)
2,127 01/13/2018 10:59:07 am
Re: Print Sales Orders (5 replies, posted in Report Bugs here)
Follow @joe's instructions by choosing the smaller number in "From" and larger Number in "To".
If the problem still occurs in your installation, then troubleshoot as below.
The function get_sales_order_header() in sales/includes/db/sales_order_db.inc is where this error emanates.
It is possible that the database may be missing some records.
Try this set of SQLs (with your table prefixes - set as 1_ here in 9 places) for each of the error pairs of type and order number in phpMyAdmin or any MySQL client:
SET @typ = 30;
SET @ono = 28; -- test with 29, 38, 71, 82 and 462 where the error occurs as well
SELECT sorder.*,
cust.name,
cust.curr_code,
cust.address,
loc.location_name,
cust.discount,
stype.sales_type,
stype.id AS sales_type_id,
stype.tax_included,
stype.factor,
ship.shipper_name,
tax_group.name AS tax_group_name,
tax_group.id AS tax_group_id,
cust.tax_id,
sorder.alloc,
IFNULL(allocs.ord_allocs, 0)+IFNULL(inv.inv_allocs ,0) AS sum_paid,
sorder.prep_amount>0 AS prepaid
FROM 1_sales_orders sorder
LEFT JOIN (SELECT trans_no_to, SUM(amt) ord_allocs FROM 1_cust_allocations
WHERE trans_type_to=30 AND trans_no_to=@ono GROUP BY trans_no_to)
allocs ON sorder.trans_type=30 AND allocs.trans_no_to=sorder.order_no
LEFT JOIN (SELECT order_, SUM(alloc) inv_allocs FROM 1_debtor_trans
WHERE TYPE=10 AND order_=@ono GROUP BY order_)
inv ON sorder.trans_type=30 AND inv.order_=sorder.order_no
LEFT JOIN 1_shippers ship ON ship.shipper_id = sorder.ship_via,
1_debtors_master cust,
1_sales_types stype,
1_tax_groups tax_group,
1_cust_branch branch,
1_locations loc
WHERE sorder.order_type=stype.id
AND branch.branch_code = sorder.branch_code
AND branch.tax_group_id = tax_group.id
AND sorder.debtor_no = cust.debtor_no
AND loc.loc_code = sorder.from_stk_loc
AND sorder.trans_type = @typ
AND sorder.order_no = @ono;2,128 01/13/2018 07:50:07 am
Re: Print Customer Balance On Invoice (13 replies, posted in Reporting)
The fix for the invoice range is not to rely on any pattern but to rely on the transaction number and type directly. Hence, replace lines 39-40 of reporting/rep107.php:
." AND trans.reference>=".db_escape(get_reference(ST_SALESINVOICE, $from))
." AND trans.reference<=".db_escape(get_reference(ST_SALESINVOICE, $to))with:
." AND trans.trans_no BETWEEN ".db_escape($from)." AND ".db_escape($to)This will result in the $sql in the get range function to be like:
SELECT trans.trans_no, trans.reference
FROM &TB_PREF&debtor_trans trans
LEFT JOIN &TB_PREF&voided voided ON trans.type=voided.type AND trans.trans_no=voided.id
WHERE trans.type=10 AND ISNULL(voided.id)
AND trans.trans_no BETWEEN '1' AND '5'
ORDER BY trans.tran_date, trans.reference@joe: see if fit to commit.
2,129 01/13/2018 07:08:11 am
Re: Importing from DacEasy (10 replies, posted in Setup)
Once you get the CSV of the customers and assuming you are using the latest FA v2.4.3 and the sql/en_US-new.sql Chart of Accounts, manually enter one typical ustomer and see the diffs in the before and after backups and construct your sqls accordingly. This will need to be carefully done in a cloned container and then migrated to the production install. The same can be done for vendors (suppliers), items (inventory), etc.
Try to revert to an earlier version of DacEasy before Sage took over. You will most probably find a non expiring version.....MBAs tend to enforce migration by such blackmail tactics - they probably cannot survive in a non-monopolistic environment - they will however wax eloquent on the virtues of their idea of a free "market economy".
2,130 01/13/2018 07:04:01 am
Re: Print Sales Orders (5 replies, posted in Report Bugs here)
There is a problem with the new pattern for references if it straddles fiscal years. See here.
2,131 01/13/2018 06:56:39 am
Re: Print Customer Balance On Invoice (13 replies, posted in Reporting)
@trafficpest: The "add this above ... below", etc are not discernible. Kindly post the whole modified rep107.php file so that a diff file can be prepared. Thanks for the "money" offer - don't bother.
@joe: there is an error in the get_invoice_range() if it straddles fiscal years with the default "pattern" of references. The year comes last in the default pattern ({001}/{YEAR})and the actual invoice number comes in first so if we choose 001/2016 to 001/2018, we miss out on 002/2016, 002/2017, etc.
The $sql in get_invoice_range() we get will be:
SELECT trans.trans_no, trans.reference
FROM &TB_PREF&debtor_trans trans
LEFT JOIN &TB_PREF&voided voided ON trans.type=voided.type AND trans.trans_no=voided.id
WHERE trans.type=10 AND ISNULL(voided.id)
AND trans.reference>='001/2016'
AND trans.reference<='001/2018'
ORDER BY trans.tran_date, trans.referenceWe inspect the above by temporarily putting in:
file_put_contents('D:/WebServers/XAMPP/htdocs/frontac24/tmp/log_file.txt', $sql, FILE_APPEND);
in line 42 of reporting/rep107.php
To alleviate this, we can change the default pattern to be {YEAR}/{001} but will that lead to other problems?
2,132 01/13/2018 06:20:33 am
Re: Void a Transaction Functionality (13 replies, posted in Setup)
The said function just saves the reflines.pattern field during setting of the Setup => Transaction Preferences.
2,133 01/12/2018 03:49:34 pm
Re: Void a Transaction Functionality (13 replies, posted in Setup)
What happens if last 2 got voided?
hence:
search refs, find highest value for that type (and year if new templated numbering is used)
search voided for highest value for that type (and year if new templated numbering is used)
Take the larger of the two and increment by 1
2,134 01/12/2018 03:28:36 pm
Re: Can print without loading PDF files or without loading Excel (1 replies, posted in Reporting)
Most browsers have native PDF Viewers that can be used to view in it and print from there. Page size and absence of styling css will make for very unwieldy html pages.
2,135 01/12/2018 04:53:02 am
Re: is funiture fixed assets? (1 replies, posted in Fixed Assets)
If it is a very small value in consideration of you total assets / turnover / expenses, it may be claimed as 100 % depreciation or expenses - consult your local auditor. Depreciation is so that the asset does not get taken away by the staff or others. Good practice is to depreciate it in the books even if it is 100%.
2,136 01/12/2018 04:49:23 am
Re: Void a Transaction Functionality (13 replies, posted in Setup)
If the voided transactions too are taken into account when the greatest customer transaction is considered, it might alleviate this situation.
2,137 01/12/2018 04:47:59 am
Re: Trouble Deleting a Dimension (4 replies, posted in Dimensions)
If there are payments or deposits whether voided or not - pertaining to any value of the dimension to be deleted, you will not be able to delete the dimension.
2,138 01/12/2018 04:44:53 am
Re: change function (1 replies, posted in Dimensions)
Sales => Direct Invoice will make for cash Invoice by default. Try to locate the script and make the default value for Dimension 1 as what you want. Dimensions are optional in the Invoice Entry forms.
2,139 01/12/2018 04:41:58 am
Re: Fixed Assets (30 replies, posted in Fixed Assets)
It is there - see this link - maybe you are using some version other than v2.4.3+.
2,140 01/10/2018 11:29:55 pm
Re: Tax Report not showing data (12 replies, posted in Reporting)
It is possible that your earlier attempt using the erroneous CoA would have some remnants that would need to have been purged before attempting a fresh install.
2,141 01/10/2018 11:26:32 pm
Re: Print Customer Balance On Invoice (13 replies, posted in Reporting)
The function needs 2 arguments and the second one $to is missing. It should be computed to be the current date/time within the function if the argument is not given.
2,142 01/10/2018 11:10:38 pm
Re: Export customer transactions in pre-defined XML format (1 replies, posted in FA Modifications)
2,143 01/10/2018 11:06:18 pm
Re: Select Multiple Level 2 dimensions for report? (4 replies, posted in Dimensions)
Only that Dimension will be filtered.
2,144 01/08/2018 06:26:06 pm
Re: Mapping Item Code with 0_gl_trans table (1 replies, posted in Reporting)
gl_trans.type_no is retail (1) or wholesale (2) taken from sales_types table.
gl_trans.type = stock_moves.type which is the Transaction Type.
stock_moves.trans_no is the actual transaction number that does not have an equivalent directly in the gl_trans table.
The gl_trans table manages all types of transactions.
The supp_trans and debtor_trans tables handle purchase and sale transactions respectively and have trans_no and type fields in them.
The supp_invoice_items and debtor_trans_details tables have the item wise records for linking with the stock_moves table on both trans_no and type fields.
2,145 01/07/2018 09:11:12 pm
Re: What are Document Date: and Event Date: in journal entries for? (6 replies, posted in Banking and General Ledger)
Make the Journal Date alone mandatory and use it for the other two dates if empty.....
2,146 01/07/2018 03:53:28 pm
Re: Modify ITEM CODE??? (10 replies, posted in Items and Inventory)
Line 146 in reporting/rep107.php calls the function get_customer_trans_details() defined at the top of includes/db/cust_trans_details_db.inc. In the said function definition, change line 21:
line.description As StockDescription,to be:
line.description AS StockDescription, item.long_description AS FullDescription,and now change the line 166 in reporting/rep107.php:
$rep->TextColLines($c++, $c, $myrow2['StockDescription'], -2);to be:
[
$rep->TextColLines($c++, $c, (($myrow2['FullDescription'] != '') ? $myrow2['FullDescription'] : $myrow2['StockDescription']), -2);The field long_description may be available in multiple tables denoting other contexts. The existing StockDescription is retained as a fallback.
Caveat: Note that as FullDescription is taken from the stock_master table's long_description field, it may not be consistently available especially if changed or deleted in it later, whereas, the StockDescription will be available even without it from the stock_master table. It may be prudent to use both when the FullDescription is available.
@joe: would you like to commit the first code change in cust_trans_details_db.inc making the long_description for those who want it as well?
2,147 01/07/2018 08:07:43 am
Topic: Customer Allocation date zero (0 replies, posted in Accounts Receivable)
When a customer payment is allocated, the date of allocation is entered as '0000-00-00' but it is correctly entered for direct cash invoices. This happens in the cust_allocations and debtor_trans tables. The $_POST['DateBanked'] or it's processed value like end of current fiscal_year should have been used.
The set of payment and full allocation transaction sqls are:
SET @alloc=400;
SET @bankcharge=5;
INSERT INTO `1_refs` VALUES
('4', '12', '001/2018');
INSERT INTO `1_bank_trans` VALUES
(NULL, '12', '4', '1', '001/2018', '2018-01-07', @alloc-@bankcharge, '0', '0', '2', '1', NULL);
INSERT INTO `1_comments` VALUES
('12', '4', '2018-01-07', 'paid by outstation cheque');
INSERT INTO `1_cust_allocations` VALUES
(NULL, '1', @alloc, '0000-00-00', '4', '12', '5', '10');
INSERT INTO `1_debtor_trans` VALUES
('4', '12', '0', '1', '1', '2018-01-07', '0000-00-00', '001/2018', '0', '0', '400', '0', '0', '0', '0', @alloc, '0', '1', '0', '0', '0', NULL, '0'),
UPDATE `1_debtor_trans` SET `alloc`=`ov_amount`-@alloc WHERE `type`='10' AND `trans_no`='5' AND `debtor_no`='4'
INSERT INTO `1_gl_trans` VALUES
(NULL, '12', '4', '2018-01-07', '1060', '', @alloc-@bankcharge, '0', '0', NULL, NULL),
(NULL, '12', '4', '2018-01-07', '1200', '', -@alloc, '0', '0', '2', '1'),
(NULL, '12', '4', '2018-01-07', '5690', '', @bankcharge, '0', '0', NULL, NULL);
INSERT INTO `1_audit_trail` VALUES
(NULL, '12', '4', '1', '2018-01-07 10:13:49', NULL, '3', '2018-01-07', '0');2,149 01/07/2018 07:18:02 am
Re: Tax Report not showing data (12 replies, posted in Reporting)
Thanks @Foxyhimself and @bazza.
Fix committed.
2,150 01/07/2018 07:09:26 am
Re: Void a Transaction Functionality (13 replies, posted in Setup)
For now, create the new invoice and then void the previous one so that you do not void the last one.
@joe / @itronics: if this is a code bug, we need to fix it forthwith.
