Would it be better to call the function Draw_watermark within the 3 header functions?

If this is possible; I think it will write the watermark first, then the report text would overwrite and therefore still be legible: and then the two setAlpha lines can be removed from the function. (Light/contrasting colours would have to be selected)
Also possibly the setX & Y could be removed: their settings would be moved to to the last two parameters of  MultiCell. (As it is using these parameters moves the watermark 3/4 of the way across the page; cutting off some of the text)

I had not realised that TCPDF has its own html to rgb function:-

File: \reporting\includes\tcpdf.php
5671:         function convertHTMLColorToDec($color="#000000") {

I have changed the Draw_watermark function in post #1 above to reflect this and deleted the function html2rgb as it is no longer necessary.

@boxygen, Customer Transaction Inquiry does not give any of the report options, its not possible to email the report or add a payment link from there either.
Adding option to fix watermark in company options defeats the object of adding a watermark on the fly on an ad hoc basis.

@boxygen, ????? Did you write what text you wanted? Choose the text colour?

Doing this

Gives me this

The following modification will improve the paperless office workflow – no more rubber stamps (and add a watermark when you want).

--- reporting\reports_main ORIGINAL.php
+++ reporting\reports_main.php
@@ -110,6 +110,8 @@
             _('To') => 'INVOICE',
             _('Currency Filter') => 'CURRENCY',
             _('email Customers') => 'YES_NO',
+            _('Stamp/Watermark Text') => 'TEXT',
+            _('Stamp/Watermark Colour') => 'COLOR',
             _('Payment Link') => 'PAYMENT_LINK',
             _('Comments') => 'TEXTBOX',
             _('Customer') => 'CUSTOMERS_NO_FILTER',

--- reporting\rep107 ORIGINAL.php
+++ reporting\rep107.php
@@ -58,10 +58,12 @@
     $to = $_POST['PARAM_1'];
     $currency = $_POST['PARAM_2'];
     $email = $_POST['PARAM_3'];
-    $pay_service = $_POST['PARAM_4'];
-    $comments = $_POST['PARAM_5'];
-    $customer = $_POST['PARAM_6'];
-    $orientation = $_POST['PARAM_7'];
+    $watermark_text = $_POST['PARAM_4'];
+    $watermark_color = $_POST['PARAM_5'];
+    $pay_service = $_POST['PARAM_6'];
+    $comments = $_POST['PARAM_7'];
+    $customer = $_POST['PARAM_8'];
+    $orientation = $_POST['PARAM_9'];
 
     if (!$from || !$to) return;
 
@@ -122,6 +124,8 @@
             $rep->SetCommonData($myrow, $branch, $sales_order, $baccount, ST_SALESINVOICE, $contacts);
             $rep->SetHeaderType('Header2');
             $rep->NewPage();
+            if ($watermark_text != '')
+            $rep->Draw_watermark($watermark_text, $watermark_color);
             // calculate summary start row for later use
             $summary_start_row = $rep->bottomMargin + (15 * $rep->lineHeight);

--- reporting\includes\reports_classes ORIGINAL.inc
+++ reporting\includes\reports_classes.inc
@@ -263,6 +263,9 @@
                 case 'TEXT':
                     return "<input type='text' name='$name'>";
 
+                case 'COLOR':
+                    return "<input type='color' name='$name'>";
+
                 case 'TEXTBOX':
                     $value = (isset($_POST[$name]) ? $_POST[$name] : "");
                     return "<textarea rows=4 cols=30 maxlength=130 name='$name'>$value</textarea>";

I added the new function to the report construct so its available for all reports

--- reporting\includes\pdf_report ORIGINAL.inc
+++ reporting\includes\pdf_report.inc
@@ -291,6 +291,25 @@
         $this->footerEnable = $footerenable;
         $this->footerText = $footertext;    
     }
+
+    function Draw_watermark($watermark_text, $watermark_color)
+    {
+        $this->SetX(30);
+        $this->SetY(550);
+        $this->SetFontSize(48);
+        $this->setAlpha(0.5);
+        $this->SetTextColorArray($this->convertHTMLColorToDec($watermark_color));
+        $this->Font('B');
+        $this->StartTransform();
+        $this->Rotate(45);
+        $this->MultiCell(0,10, $watermark_text,0,'C',0,1,0,0);
+        $this->StopTransform();
+        $this->setAlpha(1);
+        $this->SetTextColor(0, 0, 0);
+        $this->SetFontSize(9);
+        $this->Font();
+    }
+
     //
     //    Header for listings
     //

Demo here
username: demo
Password: password


Currently I have only modified rep107.php so go to Sales->Customer and Sales Reports->Print Invoices: Choose a lighter-ish shade as transparency is set to 50%.
All ten document files would need to be changed as well (Paid, Payment Due Immediately, Urgent, etc) as well as all Banking and General Ledger Reports (Confidential, For Your Eyes Only, Projected, etc) Not sure if it would be required on anyother reports?

Notes:

  • I’ve used MultiCell, so long text will wrap and center; function MultiCell states that ‘\n’ can be used to start a new line, whilst this works it still prints the \n! Using report class ‘TEXTBOX’ (and pressing enter for a newline) instead of ‘TEXT’ does work perfectly, but is there a solution to just using ‘TEXT’ with \n? As 'TEXTBOX' takes up so much room on the page and for most cases would not be needed

  • I’ve also hard coded most of the variables, as a) It could possibly over complicate the input and b)There is not that much space left in some of the report options.  I can only think of a popup window to add the rest of the variables: Anyone else have an idea?

Screenshots
Interface

Result

Is $go_debug = 1; (or 2) set in config.php?
Anything in the error log?

157

(9 replies, posted in FA Modifications)

@joe, thank you; it improves the workflow for a paperless system.

158

(9 replies, posted in FA Modifications)

@apmuthu,
@joe,

This is an old thread, but it hasn't been answered: All the other nine document print reports have an email to option; but Print Customer Receipt rep112.php does not? Is there a reason for this? Or is it an omission?

The following code works but needs to be checked:-

---\reporting\reports_mainOLD.php
+++ \reporting\reports_main.php
@@ -156,6 +156,7 @@
     array(    _('From') => 'RECEIPT',
             _('To') => 'RECEIPT',
             _('Currency Filter') => 'CURRENCY',
+            _('Email Customers') => 'YES_NO',
             _('Comments') => 'TEXTBOX',
             _('Orientation') => 'ORIENTATION'));

and

---\reporting\rep112OLD.php
+++ \reporting\rep112.php
@@ -60,8 +60,9 @@
     $from = $_POST['PARAM_0'];
     $to = $_POST['PARAM_1'];
     $currency = $_POST['PARAM_2'];
-    $comments = $_POST['PARAM_3'];
-    $orientation = $_POST['PARAM_4'];
+    $email = $_POST['PARAM_3'];
+    $comments = $_POST['PARAM_4'];
+    $orientation = $_POST['PARAM_5'];
 
     if (!$from || !$to) return;
 
@@ -82,9 +83,14 @@
 
     $cur = get_company_Pref('curr_default');
 
-    $rep = new FrontReport(_('RECEIPT'), "ReceiptBulk", user_pagesize(), 9, $orientation);
+    if ($email == 0)
+        $rep = new FrontReport(_('RECEIPT'), "ReceiptBulk", user_pagesize(), 9, $orientation);
        if ($orientation == 'L')
         recalculate_cols($cols);
+    if ($email == 1)
+        {
+            $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+        }
     $rep->currency = $cur;
     $rep->Font();
     $rep->Info($params, $cols, null, $aligns);
@@ -181,7 +187,12 @@
             $rep->TextCol(5, 6, "__________________", - 2);
             $rep->TextCol(6, 7, "__________________");
         }
+        if ($email == 1)
+            {
+                $rep->End($email);
+            }
     }
-    $rep->End();
+    if ($email == 0)
+        $rep->End();
 }

@apmuthu, not the default theme then, possible replacement for core 'dropdown' theme.

@apmuthu; Demo here
username: demo
Password: password

@apmuthu; The screen shots are kvvaradha's theme; are you looking at the right one?

@apmuthu, I think this one is less cluttered... have a look at puroV1

Download report as an excel file and then format as necessary

164

(28 replies, posted in Banking and General Ledger)

@peacecop kalmer: No you're right it doesn't have it's own security code.  It uses an existing security code - 'SA_BANKREP'. Make sure 'Bank reports and inquiries' is checked in the required role.

Once you have installed it and activated for each company that you want to use the report, you will see it under Report Class Banking, you may be looking under Report Class General Ledger

ajs wrote:

I'm not sure how to customze the invoice. Is there a help file or video help on this

Please post in the relevant forum.

I'm not aware of any video's, there are numourous posts about modifying invoices in the reporting forum; have a read, rename original files, backup etc.

For the format of invoices and the other documents have a look at reporting/includes/header2.php, you may also want to research tcpdf.

How many characters does your supplier description have?

No, as per your first table only if you want to manage your inventory.

Would Sales -> Template Invoice ease your workload?

Write a description of the problem in the Jobs wanted/offered, non-free offers forum.

Never close the year until you are absolutely sure it is correct.

So...
Roll back to backup before year close?

or

???? No other suggestions from me...

A way to do this:-

Create a UOM for hours; set to 2 decimal places, (or one for minutes to be exact)

Then create an item with the name of your service, make sure you select 'service' for Item Type:, select the above UOM and make sure you check the box marked Editable description:

Make sure you have the term of payment you require Setup ->  Payment Terms ('Day in the following month' would probably be best for you)

Then go to Sales -> Sales Order Entry

Select the credit terms you require; do not leave as 'Cash'. and fill out the rest of the details.
Select the item you created above, now because you checked the box marked Editable description, you can amend the Item Description to anything you want, in your case add the date, job number, etc. fill in the rest of the Item line...quantity...price(setup sales price first and this will fill automatically).. etc
When you finish click 'Place Order'.

The next day go to Sales ->Sales Order Inquiry and find the sales order you made the day before (you may need to change the search parameters ie date) Click the edit icon on the right, you should now see the previous order and can add another Item line with this days work...when you finish click the button labelled 'Commit Order Changes'. Then repeat this precedure for every day.

At the the end of the month after you've entered the last day you will see an option to 'Confirm Order Quantities and Make Delivery', check the details then click 'Process Despatch' button,  you will see an option to 'Invoice This Delivery', one last chance to change only quantities, click 'Process Invoice' and your customer will have an itemised bill.

Try it on your training company first.

171

(10 replies, posted in Dimensions)

Hi, FA uses locations for that - Items & Inventory -> Inventory Locations wiki read here You can then sell (or buy) products from each location; for the financial control and GL reporting side set up a dimension for each location.

Set up a training company to try it first and get to know how it works and links together, do some dummy transactions that reflect your actual business; read the wiki and any relevant forum posts

There are no restrictions on the number of locations or dimensions

So with what you stated, that part of the transaction may have been voided.

You can read about voiding a transaction here. After you have read it, try it out on your training company.

Backup your database

Its probably best to void the rest of that transaction and create a new sales order.

@apmuthu Any other suggestions?

Hi, have you activated debug in config.php? Then try the operation again and see what error appears.

Anything in the error log?

Also helpful would be version number, php & MySQL ver and op system. Try on default theme too to eliminate theme issues.

Also worthwhile  is to try on a separate clean installation to see if the issue can be replicated.

174

(0 replies, posted in Wish List)

As {C}, {B}, {S} and {L} are yet to be fully implemented, would it be possible to assign {L} 'location's to sales transaction types.

This may be advantageous to some users ref this forum post

I have given you some wrong information, it looks like {L} cannot be used in a sales order, if you look at File:includes\references.inc lines 27 - 52 it states which placeholders can be used in which transaction type.
Which leaves using pos; but for pos to work using location each user would have to be assigned a pos and therefore location. Which means you would need multiple log-ins per user which is not really practicable.

Edit it also seems that the following is not fully implemented yet:-

File:includes\references.inc
63: //    'C' => 'customer',
64: //    'B' => 'branch',
65: //    'S' => 'supplier',
66: //    'L' => 'location'

So please comment those lines again and remove any used from transaction refs

There is more info in this wiki page This pages will inform you of what place holders can be used in which transaction type.

My own testing results in the following:-

{C} works in sales direct invoice but only after page refresh

{B} in sales direct invoice gives a warning 'Missing refline context data: 'branch'' and gives a 'B' in ref #
{S} & {L} in supplier invoice gives a warning ''Missing refline context data: 'supplier'/ 'location' and gives a 'S'/'L' in ref #