Author Topic: a New OFFER view, in PDF, independent from invoice created, how to?[SOLVED]  (Read 705 times)

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Hello Everyone,
I Need: an "offer" document created as PDF, but without an Invoice (before the Invoice is created, just for offering sth, without purchasing it yet).  As for now, it is impossible to have any new PDF file before the Invoice number is on.
Do I guess correctly that a new virtuemart VIEW is needed?
for instance:
components/com_virtuemart/view/offer/... ?
What do I need for this, which classes or includes - to make it working?
Will VM see my new "offer" view just as it is created?
 Any ideas?
2) How to attach such a new document to email?
-- Regards



Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2257
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #1 on: March 14, 2017, 22:37:13 pm »
Many questions and fuzzy.
You need to explain what should be the end result.
Eg. I need a link to a view that can generate a PDF to be attached to mail from my customer ?
What you need in this email and PDF :
- product : sku,desc,image ... ?
- user info, mail .... ?
- vendor info .... ?

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #2 on: March 15, 2017, 00:46:21 am »
Hello,
1. customer makes an order - with no confirmation from shop, yet. So, customer will not get invoice, but "offer" - in pdf. It is a regular order - with vendor, ordered items, addresses billto/ shipto. etc. With similar format to invoice.
2. When particular "offer" is accepted, confirmation to be done. Only now the invoice is created.
At step 1. i cannot generate any PDF file - due to fact that invoice number is not set. (step 2) - AFAIK.
So, from this point comes an idea of "forking" invoice view into separate "offer" view.
Regards


Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2257
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #3 on: March 15, 2017, 01:33:44 am »
I don't think it's possible, have you check for an existing solution ?
I think that step should be :
- save current cart to table(this can be a simple json or similar) if "offer" link is clicked.
- On confirm by vendor, send mail with link to use "offer" as a new cart.
- user can then process the checkout and pay.
I don't know if it's possible to modify the prices, so i don't understand why this is prefered as adding a wishlist for your customers.

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #4 on: March 16, 2017, 18:36:35 pm »
Ok, I see you gave some advise here:
http://forum.virtuemart.net/index.php?topic=136794.msg478466#msg478466
and its not so easy to make new view "seen" by Virtuemart... via plugin,...MVC..
Ok, let say, I m here: (no modifications, no wishlist, only unconfirmed orders from VM)
Starting from orders - single order view - I put some new link:

Quote
http://..../?option=com_virtuemart&view=invoice&layout=offerprice&format=html&tmpl=component&virtuemart_order_id=102&order_number=....&order_pass=...
(where layout=offerprice is a little modification of invoice layout)
I just want to make a PDF print from above view. Like this:

Quote
http://..../?option=com_virtuemart&view=invoice&layout=offerprice&format=pdf&tmpl=component&virtuemart_order_id=102&order_number=....&order_pass=...
AND - is it impossible? Because Invoice number is not yet created? I still receive message "Invoice not created".
Can I override this somehow?
OR: print PDF somehow overwise?

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2257
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #5 on: March 16, 2017, 23:46:23 pm »
Why not priting the cart directly using &layout=offerprice&format=pdf ?

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #6 on: March 17, 2017, 00:52:41 am »
Since Invoice is not created yet, cannot use view=invoice... otherway, without any view system throws an error...
But playing with different format=pdf combinations - i found some empty PDF-generating file:
 
Quote
FE/orders/tmpl/details_pdf.php
so, instead of
Code: [Select]
"echo: old layout used"I put some code and now I m playing with this new possibility.
So far so good, thank You!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #7 on: March 18, 2017, 07:49:14 am »
This exists already and we call it delivery note. Check your order list and there you see an icon on the left side of the invoice icon. Just use language overrides and exchange "delivery note" by "offer".
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: a New OFFER view, in PDF, independent from invoice created, how to?
« Reply #8 on: March 19, 2017, 18:24:08 pm »
Great! Thank You, Milbo.

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
This exists already and we call it delivery note. Check your order list and there you see an icon on the left side of the invoice icon. Just use language overrides and exchange "delivery note" by "offer".
Hello, one more question is, how to change this PDF header displaying "Invoice" (in English) to another?
Where to look for the place it comes from?
I m here:
Code: [Select]
..../?option=com_virtuemart&view=orders&layout=details&format=pdf&tmpl=component&virtuemart_order_id=119&order_number=....&order_pass=...Printscreen made from this PDF header.
Thank You in advance!
PS. One way is shop->Invoices/Emails->Appearance "Use page layout for product PDF " but i dont like this one.
EDIT:
OK, got this, it is here:
Code: [Select]
$document->setTitle(vmText::_('         '));