function 'get_customer_details' in '/sales/includes/db/customers_db.inc/'
is not counting type ST_JOURNAL or ST_BANKPAYMENT in the calculation for credit for sales orders giving a different result in customer_inquiry balance.
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Posts by trafficpest
function 'get_customer_details' in '/sales/includes/db/customers_db.inc/'
is not counting type ST_JOURNAL or ST_BANKPAYMENT in the calculation for credit for sales orders giving a different result in customer_inquiry balance.
If you would like to add the link and QR to your invoices etc make these changes to core
in "/includes/ui/ui_view.inc" change "if (!isset($payment_services))" to this
if (!isset($payment_services))
{
$fa_url = "https://".$_SERVER['HTTP_HOST'].strtok($_SERVER['REQUEST_URI'], '?');
$fa_url = str_replace('/reporting/reports_main.php', '', $fa_url );
$payment_services = array(
'PayPal' => "https://www.paypal.com/xclick?business=<company_email>&item_name=<comment>&amount<amount>¤cy_code=<currency>",
'StrikeOut' => $fa_url."/modules/strikeout/pay/?co=<company_no>&amount=<amount>&custId=<reference>",
'XUMM XRP' => "https://xumm.app/detect/request:{{account}}?amount=<amount>"
);
}
in "/reporting/includes/doctext.inc" change "if (@$this->formData['payment_service'])" function to this to enable new variables and qr code generation.
if (@$this->formData['payment_service']) //payment link
{
$amt = number_format($this->formData["ov_freight"] + $this->formData["ov_gst"] + $this->formData["ov_amount"], user_price_dec());
$service = $this->formData['payment_service'];
$url = payment_link($service, array(
'company_email' => $this->company['email'],
'amount' => $amt,
'company_no' => user_company(),
'document_number' => $this->formData['document_number'],
'currency' => $this->formData['curr_code'],
'trans_no' => $this->formData['trans_no'],
'type' => $this->formData['type'],
'tax_id' => $this->formData['tax_id'],
'reference' => $this->formData['reference'],
'comment' => $this->title . " " . $this->formData['reference']
));
$Footer[_("You can pay through"). " $service: "] = "$url";
if (file_exists("../modules/strikeout/pay/inc/phpqrcode/qrlib.php"))
{
include_once("../modules/strikeout/pay/inc/phpqrcode/qrlib.php");
$tmp_file = company_path(). "/pdf_files/". random_id().".png";
QRcode::png($url, $tmp_file, QR_ECLEVEL_L, 3);
$this->Image($tmp_file,486,670,100,100);
}
}
I have created a payment integration module for frontaccounting called 'strikeout' this was released as a standalone webapp before but decided to make it a direct FA extension
Currently it does 4 methods 1 more coming soon
Pick and choose the methods to enable
Strike (Standard Bitcoin and Bitcoin Lightning invoices) Custodial* Requires Account
Accept bitcoin tx and newer 2017+ lightning (instant global settlement) as the asset or home currency with 0 fees to merchant. Receiving home currency is nice if you don't want to account inventory and capital gains/losses of asset just accept payment. compatiable with all bitcoin wallets including cash app
PayPal (Venmo, PayPal, Afterpay?, & credit cards) Custodial* Requires Account
Popular payment platform that most know
LNbits (Bitcoin Lightning) Non custodial* no account needed can host at home or a friend/family
Accept bitcoin instantly with no banks automatically generate invoices at the time of payment valued at the home currency. all kinds of plugins to trigger actions automatically like spit payroll, convert asset, trigger vending machines. etc
Stripe (Cash APP, EFT, credit cards) Custodial* Requires Account
Another popular payment platform that most know, slightly better on fees and I think a little better than paypal.
BTCPayServer (Standard Bitcoin and Bitcoin Lightning invoices) coming soon* Non custodial* no account needed dont even need to host
Another opensource platform geared towards vendors even has plugins for many webstores big thing here is you can be non custodial without even hosting your it. (standard bitcoin only lightning requires you to host) It has plugins for adding other crypto assets like USDT (digital security version of USD ie. a stable coin) though nothing other than Bitcoin has lots liquidity and is truly censorship resistant.
All platforms will auto enter fa payments and fees if applicable to the gl accounts you set for each for bitcoin there is a choice to inventory.
current limitations/things to do (This is unfinished software)
Clients fees/discounts: are not enabled yet you can enter them for each method but they will not change invoiced amount yet
Currencies: Currently I have it set to USD and BTC for currency this can be changed in code but will add it to the options soon
Fiscal year: if there isnt a fiscal year that matches the date of payment it will create a fiscal year Jan 1st to Dec 31st Pre your create future years to prevent this if you dont do cal year for fiscal year
payment refs: currently it is doing a date for the payment ref num not your preference.
Payment link: This will need to be added to core to support. I have it generating QR's and links on invoices but core payment link is a little odd (unfinished) I might create some custom included reports with the link already enabled (statements, invoices, deliveries etc) @
You can find it in my FA-EXT github here strikeout fork download it in modules and set the methods up api keys etc.
https://github.com/trafficpest/FA24ext … strikeout
I dont have documentation but most of the standalone strikeout wiki docs apply
https://github.com/trafficpest/strikeout/wiki
Oh I am not sure, I never even noticed it. Looks like it calculates differently to make sure the balance sheet will balance and only allows you to do it with journal quick entries? Here is all the code I could find quickly that is ran when it is enabled.
/includes/ui/ui_view.inc
// quick entry made on account balance is special case.
if ($qe['bal_type'] == 1) // if this is quick entry based on balance - calculate it
{
// Note, that this is ugly hack overriding standard field usage
// just to make the feature available between major FA releases!
$gl_code = $qe['base_desc'];
$monthly = $qe['base_amount'] == 1.0;
if (!isset($date))
$date = Today();
if ($monthly) // marked as monthly
$begin = begin_month($date);
else
{
if (is_account_balancesheet($gl_code)) // total
$begin = "";
else
$begin = begin_fiscalyear(); // from fiscalyear begin
}
$base = get_gl_trans_from_to($begin, $date, $gl_code);
}
/gl/includes/ui/gl_journal_ui.inc
if ($qid['bal_type'] == 1)
{
$accname = get_gl_account_name($qid['base_desc']);
label_row(($qid['base_amount'] == 0 ? _("Yearly") : _("Monthly")) . " ". _("balance from account")." ".
$qid['base_desc']." ".$accname." ".submit('go', _("Go"), false, false, true),'', "colspan=2");
}
/gl/manage/gl_quick_entries.php
if ($bal_type == 1 && $_POST['type'] != QE_JOURNAL)
{
display_error( _("You can only use Balance Based together with Journal Entries."));
set_focus('base_desc');
return false;
}
/gl/manage/gl_quick_entries.php
if (get_post('type') == QE_JOURNAL && get_post('bal_type') == 1)
{
yesno_list_row(_("Period"), 'base_amount', null, _("Monthly"), _("Yearly"));
gl_all_accounts_list_row(_("Account"), 'base_desc', null, true);
}
Look here for info on quick entry
https://frontaccounting.com/fawiki/inde … amp;lang=C
You set preset double entries for common transactions to speed up time and make errors less common.
I don't use it much. I use it for payments that are owner draws to to a equity or payments I do often enough. but dont need to track supplier tx/ payable balance just debit the appropriate acct, etc. It works for deposits too but I haven't done that.
If doing a Direct Supplier Invoice (I think what you are talking about)
while creating you can click F2 to add supplier if needed or F4 to add a new inventory item if needed.
Hot keys will be shown on the bottom right of a window
It will auto create a new sales order for you.
It works on delivery or invoice both will make an new order for you.
Im guessing you get a order and schedule a delivery?
Ok so how I just did it is like this...
edit in file "/sales/inquiry/customer_inquiry.php"
add this copy function around the other link functions like "edit link"
function copy_link($row)
{
global $page_nested;
if ($page_nested)
return '';
if ($row['type'] == ST_CUSTDELIVERY)
return pager_link(_('Copy Delivery'), "/sales/sales_order_entry.php?NewDelivery="
.$row['order_'], ICON_DOC);
else if ($row['type'] == ST_SALESINVOICE)
return pager_link(_("Copy Invoice") ,
"/sales/sales_order_entry.php?NewInvoice=". $row['order_'], ICON_DOC);
}
then add "array('insert'=>true, 'fun'=>'copy_link')," $cols array at the bottom of the page my finished $cols looks like this
$cols = array(
_("Type") => array('fun'=>'systype_name', 'ord'=>''),
_("#") => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'),
_("Order") => array('fun'=>'order_view', 'align'=>'right'),
_("Reference"),
_("Date") => array('name'=>'tran_date', 'type'=>'date', 'ord'=>'desc'),
_("Due Date") => array('type'=>'date', 'fun'=>'due_date'),
_("Customer") => array('ord'=>''),
_("Branch") => array('ord'=>''),
_("Currency") => array('align'=>'center'),
_("Amount") => array('align'=>'right', 'fun'=>'fmt_amount'),
_("Balance") => array('align'=>'right', 'type'=>'amount'),
array('insert'=>true, 'fun'=>'gl_view'),
array('insert'=>true, 'fun'=>'edit_link'),
array('insert'=>true, 'fun'=>'copy_link'),
array('insert'=>true, 'fun'=>'credit_link'),
array('insert'=>true, 'fun'=>'prt_link')
);
@apmuthu and @joe
this is a simple change and would probably be handy for many people. I would consider adding it to core if you dont think it clutters the table to much.
Ok So it does what you want but with the extra step "create template" and you want to copy a new order right away right?
the "Cart" of an order can be copied by adding the order # to the url like so
https://{your-url}/sales/sales_order_entry.php?NewDelivery=0 (this is the direct delivery url)
Change the 0 to the order with the cart you want to copy.
'NewDelivery' is for direct deliveries
'NewInvoice' is for direct invoice
If I wanted to make this a super easy single click I would add a copy link to the table of the page you like to look at past orders like the Customer Transaction Inquiry
So its working out now? It is a pretty old plugin, and looks like php has changed to be quite a bit more strict recently.
downgrade php or upgrade FA are best bets
Sounds like FA does exactly what you want.
make a template for the client from a sales order / invoice. Then Template delivery or invoice depending on your sales flow.
Do it like this
make a sales order, direct delivery, or direct invoice then--> open 'sales order inquiry' and set 'tmpl' checkbox
After that anytime you want to recreate it do Template Delivery or Template Invoice
You can also make it recurrent and it will remind you to create it at a years time but I dont like how the UI Select only has the order number in the drop down list and not the customer or branch so I usually don't do this since it takes time to reference.
I tested it and it works in my install (though it worked for me prior to the fix)
I have created a mail branch in my extensions repo again with the fix.
https://github.com/trafficpest/FA24ex … tree/mail
@apmuthu I didn't forget to hash the files for init this time if you want to pull such a trivial fix. lol
OK, I checked it out for you. (mind you this is not my plugin. So Im just looking through code.)
Looks like there is a typo in class.mail.inc line 131 must be some versions of php will allow defining outside of the class while others do not. (like your 3rd server) I works on mine running PHP 8.0.30
the line should read
$this->phpmailer->CharSet = $this->charset;
Im guessing that should fix it. Let me know
I have added delivery note with shipper info on the ticket on the bottom left of the note
Find it in the route_deliveries branch below
https://github.com/trafficpest/FA24exte … Extensions
copy rep_route_deliveries_no_ship to your modules and activate it.
I haven't tested it let me know if it needs anything
Is she asking about adding the Shipping Company name(Delivery Person)? I was thinking about adding this to the route delivery report extension.
Currently you can filter by shipping company and print it out but was thinking to put the shipping company/ Person as well. This would be good for service company clients to be aware of who performed the service. In some industries it is required by law even.
I think I will add the clients number on the note as well for the delivery driver.
Ok I pushed it to my fork in the mail branch of my repo and made a pull request for @apmuthu repo
you can find it here
oh good catch! I didn't even notice that.
In the new file in the function pass the $filename then add the check if it is passed like the old version then pass it to 2nd argument in phpmailer addAttachement function. In the end the function should be this
public function attachment($file, $filename=null) {
if (!isset($filename))
$filename = basename($file);
$this->phpmailer->addAttachment($file, $filename);
}
Have you tried the FA PHPMailer extension labeled "mail"? it works really good
here it is
https://github.com/apmuthu/FA24extensio … sions/mail
only drag is you have to replace "class.mail.inc" in core with the provided one to make it work. So it will break with updates. This is why I think it should become core even if as an option.
FA email is officially broken in PHP 8+ without mods, Gmail and other mail server accounts are getting way stricter about delivery from mail(). We were getting client complaints. I think it's time to drop mail() and use phpmailer. The SMTP mail extension using phpmailer still works like a charm even in 8+ why not just include it in core? It is GNU LGPL 2.1
OK, It is all set to go there are two branches of route_deliveries
https://github.com/trafficpest/FA24extensions/tree/route_deliveries_no_ship
This works with current version of FA it has no shipper(driver) filter option available
https://github.com/trafficpest/FA24extensions/tree/route_deliveries
This version has a shipper filter by using adding an argument to a core FA function. The core change is below
https://github.com/trafficpest/FA/tree/shippers_branch
This is FA with the small function addition to filter shippers
Thank you hope this will be of use for others especially service industries
Sorry about the end if I was going to make a if statement if the table exists not to drop but to alter. But didn't get around to it.
Don't merge the route delivery plug in from my git yet.yesterday I corrected one bug and added a feature. I'll post here when it is pushed.
@Poncho I didn't know branches were optional that's a good heads up. Thank you for the plug-in it got my routing software going really easy. I needed branches to be able to support customers with multiple delivery locations. It now is routing and putting in order a hundred slips in an instant. This will save considerable time daily!
I just noticed in the include customer reporting Excel report the join has to be with branch code now to prevent branch duplicates in the query.
The Customer Additional Information screen requires a customer and branch to be set to add, update, or delete additional fields.
***Warning read the readme*** Prior to using id you already have an addfields_cust table in your database
repo is here git branch is additional_fields_w/brancheshttps://github.com/trafficpest/FA24extensions/tree/additional_fields_w/branches
https://github.com/trafficpest/FA24extensions/tree/master/Extensions/additional_fields
A new column `cust_branch_no` as 2nd primary key, was added to addfields_cust . I created new functions maintaining the old. I wasn't sure how the author @poncho wanted to go with it.
you could allow null in branch_no but I dont see why since FA creates a branch when you create a customer automatically.
You could use the `all branches` option. copy the add_field info to all branches in the customer you are working on.
I needed branches for the route_delivery extension I made. I have a few clients that have multiple delivery locations, under one account (branches)
You should consider something else for point of sale and connect it to your front accounting for full featured accounting. You could consider woocommerce or open cart for open and just have it on a tablet connected to wifi.
# README.md
## Dependencies
This plugin relies on the Additional Fields module to function. Please ensure
it is installed before use.
## Installation
1. Unzip the files into your FrontAccounting modules directory, or
Install it directly from the repository on FrontAccounting (if available).
2. In FrontAccounting, activate it in `Install/Active Extensions` under the
`Setup` tab.
3. If needed change the `access setup` to use reports.
## Usage
To use this plugin:
1. Add geocodes for clients as an additional field.
- These geocodes should be set as long,lat (default) or lat,long format.
Example: -118.265376,34.376487
- For minimum accuracy, use GPS coordinates with at least 4 decimal places.
The industry standard is 6 decimal places, allowing accuracy within 4 square
inches on Earth. Avoid using more than 6 places to accommodate location
variations when the API calls OSRM.
2. Run the new report `Route Deliveries` under `Customer` class in `reports`
- By default, this plugin utilizes the public instance of OSRM, which may have
data limitations. You can use your own instance if desired.
## Configuration (Config File)
You can adjust more permanent plugin options in the `route_config.php` file
located in the root of the `rep_route_deliveries` directory.
The Available options there are:
### field_label
Your custom label name in the FrontAccounting additional_fields extention where
the GPS data is stored. The Default is 'Geocoding'.
### swap_cords
By default, OSRM expects GPS data in Long,Lat format. Set this to true if your
data is in Lat,Long format, and the software will swap it accordingly. Ensure
there are no spaces in your coordinates.
### home_point
GPS location to add to the start of your route. This location MUST be in
Long,Lat order.
### osrm_url
The API URL of the OSRM instance used for routing data. Replace it with another
URL if desired. Self hosted has no limits on request size and options.
### km
Set this to true to get kilometers. The default is miles
## Configuration (In App)
### Route Deliveries
With this it turns the routing function on, adds a route log to your report,
and sorts the delivery slips in route order for you. This report does allow
print by date that front accounting lacks by default.
### Remove Home Location
Remove the home_point location from the routing. Useful for starting at first
delivery location.
### Route Linear, Not Roundtrip
By default, the route will be a round trip starting from the home_point or the
first delivery stop. Set this to generate a route from the first stop
(oldest delivery) to the last stop (newest).
## Known Limitations
- `additional fields` does not have branch support, So Only one geocode per
client. If you have clients with more than one branch ie location they should be
seperated.
- Only one trip is supported, the locations have to connect by roadway. You
couldnt route deliveries in france and england at the same time.
- Doesn't support Shippers ie. Drivers. FrontAcconting core needs a small change
I have submitted to the github mirror repo
- Doesn't support more than one shipping location (home point) This would be
nice to add.
Ok, Sounds good. I wanted to make something that uses your own client geocode data (for accuracy) rather than trying to geocode from an address (rarely works, few free data sources,multiple regions, etc)
For the USA there is a Government data that is good found here
https://geocoding.geo.census.gov/geocoder/
The route delivery extension could have the option of sorting by delivery driver (shipper branch) if this core commit is added (it adds shipper_filter and add get_shipper function args)
https://github.com/trafficpest/FA/tree/shippers_branch
Ill post the readme here it has all the info need to get going and what it can do / options
I have the instance going for you to test. but I can not post the credentials publicly. It has clients data.
let me know if you would like me to email you.
FrontAccounting forum → Posts by trafficpest
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.