Quite difficult for me to edit Javascript ![]()
401 07/07/2018 02:16:50 pm
Re: Date and Time in Date_row (8 replies, posted in FA Modifications)
402 07/06/2018 06:51:00 pm
Topic: Transaction References : The value is not incremented (10 replies, posted in Setup)
This topic has been discussed in various posts but now I want to discuss a different scope.
Any Transaction form picks the value of next reference from Transaction References table and Upon new record creation it sets the next reference in Transaction References table.
This process is very natural but sometimes, not always but rarely the value doesn't increment in Transaction References. The User see the message "The reference is already in use " . Then the user has to manually increment the value in Transaction References.
I could not find the reason why the increment stucks but it is not always like this.
What could be the fix for this problem?
403 07/06/2018 06:12:11 pm
Re: Access setup: Edit one's own transactions (6 replies, posted in Setup)
@davidkumi, you need to change the core as below
Paste the code below at Line 660 in includes\datachecks.inc
if (!$_SESSION['wa_current_user']->can_access('SA_EDITOWNRSTRANS'))
{
$audit = get_audit_trail_last($trans_type, $trans_no);
if ($_SESSION['wa_current_user']->user == $audit['user'])
{
if (!$msg)
$msg = '<b>'._("You have no edit access to transactions created by YOURSELF.").'</b>';
display_note($msg);
display_footer_exit();
}
}Add the code below at Line 131 in includes/access_levels.inc
'SA_EDITOWNTRANS' => array(SS_SPEC|7, _("Edit Own transactions")), Hope this works
404 07/06/2018 02:30:20 am
Re: Date and Time in Date_row (8 replies, posted in FA Modifications)
Yes, I want to input time manually. What could be the changes?
405 07/05/2018 11:40:42 pm
Re: Date and Time in Date_row (8 replies, posted in FA Modifications)
I tried changing the datatype of the field from date -> datetime in mysql. It gives me two options (ON UPDATE) AND (CURRENT TIMESTAMP). I tried both cases
After changing this data type the behaviour of FA remains unchanged while the value being stored at database is like this
2018-07-04 00:00:00
No input is taken from FA for the Time.
406 07/05/2018 05:20:14 pm
Topic: Date and Time in Date_row (8 replies, posted in FA Modifications)
Using Date_row function with date picker can we input both Date and Time?
407 07/03/2018 08:11:55 am
Re: Adding Item Category Filter to the core (5 replies, posted in Setup)
Yes this is Necessary. We shall add this in the Core
408 06/28/2018 02:07:11 am
Topic: Can We Connect FA to remote Database (3 replies, posted in Setup)
Is it possible to connect FA to remote Database? I have many companies on my installation but I want only 2 companies to connect to remote database. Is it possible?
409 06/25/2018 11:02:18 am
Re: REST API (86 replies, posted in Modules Add-on's)
I want to Add New Customer and then Record its Sales Order using API from an external website. On my installation multiple companies are running but this feature is needed only for one Company. How can I do this?
410 06/16/2018 06:43:34 am
Re: FA with Batch/Serial/Lot Number Tracking System (19 replies, posted in FA Modifications)
How much?
411 06/14/2018 05:49:25 pm
Re: FA with Batch/Serial/Lot Number Tracking System (19 replies, posted in FA Modifications)
Greate @kvvaradha.
Is this going to be commercial or open source?
412 06/09/2018 06:04:42 pm
Re: Account Code to be define as int (4 replies, posted in Banking and General Ledger)
@poncho1234
Stack Over Flow natsort() solution worked like a charm. Thanks A Lot.
413 06/09/2018 07:48:39 am
Re: FA with Batch/Serial/Lot Number Tracking System (19 replies, posted in FA Modifications)
@kvvaradha, the automatic calculation of average cost of the product will be done as a whole or batch wise? I mean will there be only one Avg Cost of the product irrespective of batch or Each batch will have its own Avg Cost?
414 06/09/2018 07:45:00 am
Re: Account Code to be define as int (4 replies, posted in Banking and General Ledger)
Thanks @Joe,
Yes I understand, but Actually I needed a customization to automatically pick the Next Available Account Code for the Given Account Type. It worked Fine till Code 2899 but when it reaches 28100 it is not picking the next value 28101 because the order sequence of Varchar says 28100 is smaller than 2899.
Converting it to INT is working fine but I fear it may cause anomalies. Any Ideas?
415 06/08/2018 06:54:43 pm
Re: FA with Batch/Serial/Lot Number Tracking System (19 replies, posted in FA Modifications)
http://fa.kvcodes.com/batch/inventory/adjustments.php?NewAdjustment=1
The above link is not working. I wanted to check how adjustment takes care of Batch No.
Rest What I have analyzed is that Batch number will be introduced to the System at the time of Purchases.
It is a very good and useful feature.
416 06/08/2018 06:30:44 pm
Topic: Account Code to be define as int (4 replies, posted in Banking and General Ledger)
In chart_master table if I change the data type of account_code field from Varchar to int, will it cause any anomaly in relationships with other tables?
I have kept all Account Codes as Integer
417 06/06/2018 10:52:07 am
Topic: inactive column in Table 0_crm_persons (0 replies, posted in Accounts Receivable)
There is an inactive column in Table 0_crm_persons which is inactive.
Is it deliberately set inactive or by mistake.
I need to have this activated in sales/manage/customer_branches.php Contacts tab.
418 06/02/2018 12:21:44 pm
Re: Proforma Invoice (PI) issue while generating new PI (1 replies, posted in Report Bugs here)
Yes this is a serious issue I have also been facing for long time. The issue Arises when the transaction is recorded (almost for all transactions like sales, purchases, gl transactions) but the Reference Number is not incremented to then next one in the Table reflines
This doesn't happen every time but some time. No behavior could be recorded that after how many transactions this fails to increment.
419 05/30/2018 12:37:31 am
Re: Editing a Direct Invoice entry (3 replies, posted in FA Modifications)
yes
420 05/28/2018 09:01:43 pm
Re: Editing a Direct Invoice entry (3 replies, posted in FA Modifications)
While creating Direct Invoice, the system automatically creates Direct GRN. This GRN is supposed to be the source for Direct Invoice. The src_id is actually the id of GRN
421 05/09/2018 04:20:48 am
Topic: Adding Attachments to Dimension (2 replies, posted in Dimensions)
Shouldn't we customize the function
safe_exit() as below in dimension_entry.php
function safe_exit()
{
global $path_to_root;
$trans_no=isset($_GET['AddedID']) ? $_GET['AddedID'] : $_GET['UpdatedID'];
hyperlink_no_params("", _("Enter a &new dimension"));
echo "<br>";
hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", _("&Select an existing dimension"));
echo "<br>";
hyperlink_no_params($path_to_root . "/admin/attachments.php?filterType=40&trans_no=$trans_no", _("&Add Attachment"));
display_footer_exit();
}422 05/05/2018 03:17:48 pm
Re: Providing fix for Import Multiple Journal Entries module in v2.4rc1 (6 replies, posted in Modules Add-on's)
@Braath Waate you are right
423 05/01/2018 06:44:33 am
Re: Providing fix for Import Multiple Journal Entries module in v2.4rc1 (6 replies, posted in Modules Add-on's)
I have modified import_multiplejournalentries.php to add Journal Entries for Customers and Suppliers
<?php
/**********************************************
Author: Tom Hallman
Name: Import Multiple Journal Entries/Deposits/Payments v2.3
Free software under GNU GPL
***********************************************/
$page_security = 'SA_CSVMULTIJOURNALIMPORT';
$path_to_root="../..";
include_once($path_to_root . "/includes/ui/items_cart.inc");
include_once($path_to_root . "/gl/includes/db/gl_db_trans.inc");
include_once($path_to_root . "/includes/session.inc");
add_access_extensions();
// Turn these next two lines on for debugging
//error_reporting(E_ALL);
//ini_set("display_errors", "on");
//--------------------------------------------------------------------------------------------------
function init_entry(&$entry,$type,$date,$reference) // See gl/gl_journal::create_cart() & gl/gl_bank::handle_new_order()
{
$entry = new items_cart($type);
$entry->order_id = 0;
$entry->tran_date = $date;
$entry->reference = $reference;
$entry->memo_ = 'Imported via \'Import Multiple Journal Entries\' plugin';
}
//--------------------------------------------------------------------------------------------------
function import_type_list_row($label, $name, $selected=null, $submit_on_change=false)
{
$arr = array(
ST_JOURNAL=> "Journal Entry",
ST_BANKDEPOSIT=> "Deposit",
ST_BANKPAYMENT=> "Payment"
);
echo "<tr><td class='label'>$label</td><td>";
echo array_selector($name, $selected, $arr,
array(
'select_submit'=> $submit_on_change,
'async' => false,
));
echo "</td></tr>\n";
}
//--------------------------------------------------------------------------------------------------
function check_journal_entry(&$entry, $entryid)
{
// Check that this journal entry adds up!
if (abs($entry->gl_items_total()) > 0.0001)
{
display_error("Error: journal entry with entryid '$entryid' does not balance (import file: '{$_FILES['imp']['name']}')");
return true;
}
}
function write_trans($type, $entry, $curEntryId, $bank_account)
{
if ($type == ST_JOURNAL)
{
if (!check_journal_entry($entry, $curEntryId));
write_journal_entries($entry, false, false); // FA built-in function
}
elseif ($type == ST_BANKDEPOSIT || $type == ST_BANKPAYMENT) {
add_bank_transaction($entry->trans_type, $bank_account, $entry, $entry->tran_date, // FA built-in function
false, false, false, $entry->reference, $entry->memo_, false);
}
}
//--------------------------------------------------------------------------------------------------
function get_dimension_id_from_reference($ref)
{
if ($ref == null || trim($ref) == '')
return 0;
$sql = "SELECT id FROM ".TB_PREF."dimensions WHERE reference LIKE ".db_escape($ref);
$result = db_query($sql, "could not get dimension from reference");
$row = db_fetch_row($result);
return $row[0];
}
//--------------------------------------------------------------------------------------------------
// Begin the UI
include_once($path_to_root . "/includes/ui.inc");
page("Import Multiple Journal Entries / Deposits / Payments");
// If the import button was selected, we'll process the form here. (If not, skip to actual content below.)
if (isset($_POST['import']))
{
if (isset($_FILES['imp']) && $_FILES['imp']['name'] != '')
{
$filename = $_FILES['imp']['tmp_name'];
$sep = $_POST['sep'];
$type = $_POST['type'];
$bank_account = isset($_POST['bank_account']) ? $_POST['bank_account'] : "";
// Open the file
$fp = @fopen($filename, "r");
if (!$fp)
{
display_error("Error opening file $filename");
} else {
// Initialize first entryid & date to be null so that a new one is established
$curEntryId = $curDate = null;
// Prepare the DB to receive the imported journal entries
begin_transaction();
// Process the import file
$line = 0;
$entryCount = 0;
$error = false;
$errCnt = 0;
while ($data = fgetcsv($fp, 4096, $sep))
{
// Skip the first line, as it's a header
if ($line++ == 0) continue;
// Skip blank lines (which shouldn't happen in a well-formed CSV, but we'll be safe)
if (count($data) == 1) continue;
// Parse the row of data; Format: entryid,date,reference,accountcode,dimension1,dimension2,amount,memo
list($entryid, $date, $reference, $code, $dim1_ref, $dim2_ref, $amt, $memo, $person_id) = $data;
// If the entryid has changed, create the current journal entry (if there was one) and start a new one
if ($entryid != $curEntryId) {
// Check that date is properly-formatted
if (!is_date($date)) {
display_error("Error: date '$date' not properly formatted (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
// Check that the date is in range
if (!is_date_in_fiscalyear($date)) {
display_error("Error: date not in fiscal year (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
// Assign a default reference if it is not specified
if ($reference == '') {
// If the entryid has shifted but date is the same, it needs another reference
if ($date == $curDate)
$refCount++;
else // else the entryid and date have shifted, so we can start with a new reference
$refCount = 1;
list($day, $month, $year) = explode_date_to_dmy($date);
$reference = "$month/$day-$refCount";
}
// Check that the reference is not in use
global $Refs;
if (!$Refs->is_new_reference($reference,$type)) {
display_error("Error: reference '$reference' is already in use (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
// All good! Initialize a new entry
if ($curEntryId != null) {
if (!$error)
{
write_trans($type, $entry, $curEntryId, $bank_account);
$entryCount++;
}
}
if ($error)
$errCnt++;
$error = false;
init_entry($entry,$type,$date,$reference);
$curEntryId = $entryid;
$curDate = $date;
}
if ($entryid == '') {
display_error("Error: entryid not specified (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
// Check that the account code exists
if (get_gl_account($code) == null) {
display_error("Error: Could not find account code '$code' (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
// Check that dimension 1 exists
$dim1 = get_dimension_id_from_reference($dim1_ref);
if ($dim1_ref != '' && $dim1 == null) {
display_error("Error: Could not find dimension with reference '$dim1_ref' (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
// Check that dimension 2 exists
$dim2 = get_dimension_id_from_reference($dim2_ref);
if ($dim2_ref != '' && $dim2 == null) {
display_error("Error: Could not find dimension with reference '$dim2_ref' (line $line in import file '{$_FILES['imp']['name']}')");
$error = true;
}
if ($type == ST_BANKDEPOSIT)
$amt = -$amt;
// Add to the journal entry / deposit / payment
if (!$error)
$entry->add_gl_item($code, $dim1, $dim2, $amt, $memo,'',$person_id);
}
// Process final entries in the file
if (!$error)
{
if ($curEntryId != null) {
write_trans($type, $entry, $curEntryId, $bank_account);
$entryCount++;
}
} else
$errCnt++;
@fclose($fp);
// Commit import to database
if (!$errCnt)
commit_transaction();
if ($type == ST_JOURNAL)
$typeString = "journal entries";
elseif ($type == ST_BANKDEPOSIT)
$typeString = "deposits";
elseif ($type == ST_BANKPAYMENT)
$typeString = "payments";
if (!$errCnt) {
if ($entryCount > 0)
display_notification_centered("$entryCount $typeString have been imported.");
else
display_error("Import file contained no $typeString.");
}
}
}
else
display_error("No import file selected");
}
start_form(true);
start_table(TABLESTYLE2);
if (!isset($_POST['type']))
$_POST['type'] = ST_JOURNAL;
if (!isset($_POST['sep']))
$_POST['sep'] = ",";
echo ' | ';
echo "<a href=https://my.pakerp.net/modules/import_multijournalentries/Journal_Entry.cs>Click Here To Download Sample File For Import </a>";
echo "<br> There should be no Comma (,) in any value in any column. Please double check before import";
echo "<br> For Customers Opening Balance person_id shall contain debtor_no field value and code shall be Accounts Receivable Code.";
echo "<br> For Suppliers Opening Balance person_id shall contain supplier_id field value and code shall be Accounts Payable Code.";
table_section_title("Import Settings");
import_type_list_row("Import Type:", 'type', $_POST['type'], true);
if ($_POST['type'] != ST_JOURNAL)
bank_accounts_list_row( $_POST['type'] == ST_BANKPAYMENT ? _("From:") : _("To:"), 'bank_account', null, false);
text_row("Field Separator:", 'sep', $_POST['sep'], 2, 1);
label_row("Import File:", "<input type='file' id='imp' name='imp'>");
end_table(1);
submit_center('import', "Perform Import");//,true,false,'process',ICON_SUBMIT);
end_form();
end_page();This is very helpful to record opening balances of all Trial Balance Accounts when shifting to FA from any other ERP.
424 04/30/2018 02:56:43 pm
Re: Ajax Times out in Print Recurring Invoices (3 replies, posted in Accounts Receivable)
ini_set('max_execution_time', 300);
Worked in my case
425 04/29/2018 11:21:11 am
Topic: Ajax Times out in Print Recurring Invoices (3 replies, posted in Accounts Receivable)
One of my client creates Recurring Invoices that are around 230 invoices.
When he clicks to Print Recurring Invoices the Ajax fails to show the print preview. The document is however created in the company's pdf folder but Print Preview is not shown.
HOw to resolve this issue. Any Idea?
