Page 1 of 2
Hi Jan,T
Posted: 06 Jun 2008, 07:19
by laurie_lewis
Hi Jan,
Thanks for the work on this BTW.
A couple of things:-
1. When you go to create a new delivery note for an order the page loses focus and goes back to the main order tab and you have to go back into the delivery tab (just thought I would let you know)
2. Is it possible, or how do you go about, putting a link on the Account Maintenance Page so that when an order is shipped it shows you a link so that the user can then go and print up a receipt for their order as well as being able to view the order (already exists). That way they can access their own receipts if in the future they need another copy or similar.
3. How do you go about automating some processes after the order status has been updated. If I am looking at an order and I update the status to shipped (I have shipped for full order and part shipped for part shipped - ), but when I update the order to shipped is there any way of it automating that a receipt is issued for the order.
4. Another little bug - Is it possible to have it so that you can only select one option when your are creating a new delivery - that is create an invoice or customer has prepaid. I know that if you select both it comes up with creating an invoice.
5. (Last one I hope). In Australia our what you call invoices and receipts are very different. Different legal requirements etc. Are we able to change the code so that it calls different files to print up a receipt and an invoice?
Thank you and all the best
Laurie
Hi,1. th
Posted: 06 Jun 2008, 14:25
by Jan
Hi,
1. this is the VM bug, which should be fixed in next release (you get it for all follders)
2. I think, will be not so difficult
3. ??? it will be not so difficult, but if you click on shipped where to set that e.g. receipt or invoice with xx days and xx % should be created ???
4. ???
5. Yes, you can change the design and items in invoice too, but only in HTML/PHP
delivery.pdf.php
phoca.tcpdf.php
Hi Jan,T
Posted: 06 Jun 2008, 23:45
by laurie_lewis
Hi Jan,
Thank you for the response.
Issue 3:- At both locations where you can change the status of the order to Shipped there is a check box for Notify Customer. If you had another check box that said "Paid in Full" or similar, then the system could create a receipt if checked and an invoice with the default settings if not. I have to be honest in saying it is the receipt part that I am looking at. Delivery notes are secondary.
Issue 4:- At this time you can select to make a receipt and an invoice on the tab, but the system will only create one - not both as you know. Therefore you should only be able to select one option not both. Only cosmetic.
Jan, I know this add-on is based on the delivery part, but it is also a great basis for a ireceipt, billing system that VM is lacking and I have seen people calling out for. The fact that it is PDF based allows these documents to be produced with only minimal concerns about alterations etc. It is very useful if used with the email-addon. Just an idea for you - in your spare time .
All the best
Laurie
Therefore you should ...
Posted: 07 Jun 2008, 00:33
by Jan
Therefore you should only be able to select one option not both
I still don't understand. If you click on deliver, delivery not will be created, if do don't select the INVOICE, only receipt with delivery note will be created, if you select the INVOICE, Invoice with delivery note will be created.
You create INVOICE (user will pay e.g. in 14 days or some invoice for a business firm) OR you create RECEIPT (user pay now e.g. or for non business firms)
The second problem is, I didn't do basic system. I only rewrite it from Ingemar's solution (J!1.0.x) for J! 1.5, added the PDF functions and created an e-mailing system for it
great basis for a ireceipt, billing system ... yes you right, e.g. XML output for some accounting system ...
Sorry Jan,
Posted: 07 Jun 2008, 01:33
by laurie_lewis
Sorry Jan,
On my system you are able to select both options - that is to create a receipt and to also create a invoice. If you do this only the invoice is created though.
Just a bit confusing for a new user who selects both and then only gets one item created. You are looking at it with a detailed knowledge of what it does. When I first had a look at it after I went to create the delivery note I could select BOTH the invoice and receipt check boxes. I therefore thought that I would get both created for me. I now realise you won't and know how it works - but that initial impression. If I can only get one option I should only be able to select ONE checkbox. As I said cosmetic only.
In line with what I was saying about the updating of the status I have done a few little modifications to see how it looks with additional checkbox's.
File administrator/components/comn_virtuemanrt/html/order.order_print.php
Changed Line 84 to (Only changed colspan="4" to "3")
<th colspan="3"><?php echo $VM_LANG->_('PHPSHOP_ORDER_STATUS_CHANGE') ?></th>
Added at line 96
</td>
<td>
<input type="checkbox" name="create_receipt" id="create_receipt" checked="checked" value="Y" />
<label for="create_receipt"><?php echo $VM_LANG->_('PHPSHOP_ORDER_CREATE_RECEIPT') ?></label>
<br/>
File administrator/components/comn_virtuemanrt/html/order.order_list.php
Added after line 223
<input type="checkbox" class="inputbox" onclick="if(this.checked==true) {document.adminForm'. $i .'.create_receipt.value = \'Y\';} else {document.adminForm'. $i .'.create_receipt.value = \'N\';}" value="Y" />
'.$VM_LANG->_('PHPSHOP_ORDER_CREATE_RECEIPT') .'<br/>
File administrato/components/com_virtuemart/languages/order/english.php
Added after line 31
'PHPSHOP_ORDER_CREATE_RECEIPT' => 'Create Receipt?',
I do not know how to program so I am experimenting here on trying to get an easy automated flow of work done. I know you are busy and will probably not have time to do this, or perhaps don't think it should be done, but any pointers that might help me would be appreciated.
All the best
Laurie
I have also done a f
Posted: 07 Jun 2008, 03:09
by laurie_lewis
I have also done a few more things. In the file ps_order.php located in the classes directory I have added at lin 601 this:-
$pdf_url= $sess->url( URL
. "index2.php?page=order.order_print"
. "&func=deliveryNoteAsPDF&format=printpdf&tmpl=component"
. "&order_id=".$this->order_id
. "&no_menu=1&no_html&delivery_id=".$db->f('delivery_id'));
if ($order_status == "Shipped") {
$tmp_cell .= "<a href=\"". $pdf_url."\">\n";
$tmp_cell .= "<img src=\"".IMAGEURL."ps_image/receipt.jpg\" height=\"32\" width=\"32\" align=\"middle\" border=\"0\" alt=\"".$VM_LANG->_('PHPSHOP_RECEIPT_LINK')."\" /> ".$VM_LANG->_('PHPSHOP_RECEIPT')."<br />";
} else
{ $tmp_cell .= "<a href=\"". $pdf_url."\">\n";
$tmp_cell .= "<img src=\"".IMAGEURL."ps_image/receipt.jpg\" height=\"32\" width=\"32\" align=\"middle\" border=\"0\" alt=\"".$VM_LANG->_('PHPSHOP_BILL_LINK')."\" /> ".$VM_LANG->_('PHPSHOP_BILL')."<br />";
}
The image receipt.jpg has been added to the ps_images directory but you could use the existing file copy_f2.gif.
The links are being created but are not working for the code above. Obviously they are the wrong links and just need to be sorted to print either a Receipt or an Invoice in some way I do not understand, but will attempt to keep working on .
I also added these to the Common English Language file
'PHPSHOP_RECEIPT' => 'View Receipt',
'PHPSHOP_BILL' => 'View Bill',
'PHPSHOP_RECEIPT_LINK' => 'Follow this link to view the Order Receipt.',
'PHPSHOP_BILL_LINK' => 'Follow this link to view the Order Bill.',
I think all the options I have outlined so far work quite well - in a visual sense - now just to see if I can get them to work later on today if time permits.
All the best
Laurie
Hi again Jan,
Posted: 07 Jun 2008, 03:19
by laurie_lewis
Hi again Jan,
I have attached a couple of images so you can see what I am talking about. I will delete them in a day or so.
Account Maintenance Image
Order List Status Change
Order Status Change
Laurie
thank you, I will ta
Posted: 08 Jun 2008, 17:59
by Jan
thank you, I will take a look at it...
Jan
Hi Jan,I
Posted: 09 Jun 2008, 01:32
by laurie_lewis
Hi Jan,
I am just working on making my documents looks a bit more colourful and in going through this with my limited understanding was wondering why you had designed the form creation with the two files like you have.
Why is the header and foot in one file and the rest in the other file?
Just a learner remember.
Laurie
Just an OOP (object
Posted: 09 Jun 2008, 10:35
by Jan
Just an OOP (object oriented programming). If you want to have on your PDF footer and header (it means that e.g. by 10 site, you get footer and header on all 10 sites automatically), you must do extended class of TCPDF so in one file, there are extended class of TCPDF (footer and header - class PhocaTCPDF extends TCPDF ==> TCPDF) and in the second, there is the content (class PhocaDeliveryPDF extends JView ==> VM). Of course, you can add the both classes into one file