教你创建virtuemart invoice收据 发票

原文地址,也是自己原创的,只不过先发布在自己的站上了:http://www.365joomla.com/Joomla%E6%89%A9%E5%B1%95%E4%B8%8B%E8%BD%BD/virtuemart-invoice.html

 

VirtueMart Invoice, Delivery Note and Receipt Addon (VM IDnR Addon)

(英文水平有限,翻译不对的地方请指出,您的支持是对我最大的安慰,先奉献上下载地址,你也可以根据下面的正文内容进行单个下载)

virtuemart invoice在1.1.6测试通过

virtuemart invoice在1.1.6测试通过,用户可以下载invoice,发送invoice给用户,这里教你一个不要钱的方法配置成功

压缩包包含了下文提到的所有(除了virtuemart)安装程序

   2011-02-26   Joomla 1.5  1.49 MB 0

VM IDnR addon is a "package" of components, plugins and small hacks which allow creating PDF Invoice, PDF Delivery Note, PDF Receipt and sending them through email to customers (Email feauture is available for users who are regularly active in Phoca Forum, are regularly translating Phoca Extensions or have donated to Phoca Project - get more info about how to contribute and get the Email feature on info[at]phoca[dot]cz).

这段就自己看吧,主要是介绍的是神马东东

Features(特点):

  • Creating Delivery (Partial delivery possible)
  • Creating PDF of Invoice, Delivery Note or Receipt  创建pdf格式的invoice,提货单或者收据
  • Sending PDF of Invoice, Delivery Note or Receipt through emal to customers (Phoca PDF VirtueMart Email plugin)通过邮件将invoice,提货单或者收据发给客户(Phoca PDF VirtueMart Email plugin)
  • Displaying PDF of Invoice, Delivery Note or Receipt in frontend in Account Maintenance (VirtueMart hack needed)在用户首页账户管理可以显示invoice,提货单或者手机(需要将virtuemart hack掉)
  • Creating Delivery, PDF of Invoice, Delivery Note or Receipt, sending them through the email - all automatically after changing order status (Phoca PDF VirtueMart Email plugin, VirtueMart hack needed)在修改订单状态后全部自动通过邮件将提货单,invoice,收据发送给客户(需要Phoca PDF VirtueMart Email plugin,将virtuemart hack掉)
  • Changing the PDF output in parameters (Changing header, footer height, fonts, etc.)自定义pdf输出参数
  • Changing the PDF output with help of CSS styles in parameters  自定义pdf css样式输出参数
  • Changing the PDF output easily in PDF templates (With help of HTML or CSS)很容易修改pdf模板
  • Changing the Email output (Email template) in parameters (Phoca PDF VirtueMart Email plugin) 根据参数修改email模板
  • Setting default values for creating Invoice, Delivery Note or Receipt in parameters (Phoca PDF VirtueMart Email plugin)根据默认参数生成invoice,提货单或者收据
  • Product attributes are displayed in PDF document  产品相关属性都显示在pdf文件中
  • Additional information like Bank Account Nr., VAT, etc. can be added in parameters (e.g. to header or footer area)附加信息,例如银行信息等

 

Basic requirements(安装需求):

  • Joomla! 1.5 (tested on 1.5.21)
  • VirtueMart (tested on 1.1.5)

Installation(安装)

1. Install Phoca PDF component (1.0.8 or later version, Phoca PDF component download link) in Joomla! Extension Manager. It is good to test, if you are able to create PDF documents on your site (e.g. with help of Phoca PDF Content plugin).

第一步:安装Phoca PDF component    组件(点击该链接下载Phoca PDF component download ).很容易进行测试。可以在您的站上创建pdf文档

2. Install Phoca PDF VirtueMart plugin (or Phoca PDF VirtueMart Email plugin) in Joomla! Extension Manager. Enable this plugin in Joomla! Plugin Manager (Phoca PDF VirtueMart plugin download site).

第二步:安装Phoca PDF VirtueMart plugin,点击该链接下载Phoca PDF VirtueMart plugin download

3. Install Phoca Install - VirtueMart component (Phoca Install - VirtueMart component download link) in Joomla! Extension Manager. Check "Ignore SQL query" in case, on your site there is installed previously version of VM IDnR addon (to not lose data). Before you install files and data with help of this component, VirtueMart must allready be installed on your site.

第三步:安装Phoca Install和VirtueMart组件(点击链接下载 Phoca Install - VirtueMart component download ).如果你的站已经安装该virtuemart插件,选择"Ignore SQL query" 。在安装之前,必须保障virtuemart已经在您的站上安装好了

(4). If you are using Phoca PDF VirtueMart Email plugin, install Phoca Email Component (it must be installed before making following modifications - Phoca Email component download link).

第四步:在做下面的基本修改之前,必须保证Phoca PDF VirtueMart Email插件已经安装,Phoca Email Component 已经安装

Basic Modification(基本的修改)

1. Displaying Delivery tab in detail of an order  在订单详情页显示Deliver标签

Modify the following file:   修改一下文件

administrator/components/com_virtuemart/html/order.order_print.php

FROM (line cca 191):从第199行开始将以下代码

$tab->endTab(); $tab->endPane();

TO:改成

$tab->endTab(); // Delivery $lang =& JFactory::getLanguage(); $lang->load('plg_phocapdf_virtuemart', JPATH_ADMINISTRATOR, null, true); $tab->startTab( JText::_('PLG_PHOCAPDF_VM_DELIVERY_TAB_LBL'), "delivery_pane" ); require_once(CLASSPATH.'ps_order_delivery.php'); $tab->endTab(); // End Delivery $tab->endPane();


Now the basic addon is installed. Go to "Order List" in your VirtueMart and click on some order (to edit it). Now the "Delivery" tab will be displayed in detail of an order.

现在基本的插件已经安装好了。现在点击"Order List"  并且查看具体的订单信息。现在你可以看到"Delivery"标签已经显示在订单详情里面了

If you click on "New delivery" button, you will be able to create new delivery.

You can create Invoice or Receipt. Delivery Note will be created automatically. After saving delivery, you will be able to display Invoice or Receipt and Delivery Note as PDF.

你可以创建invoice或者收据。提货单将被自动创建。在保存了提货单以后,invoice或者收据等就可以以pdf文档的形式显示了

If you are using Phoca PDF VirtueMart Email plugin , you can send emails to your customers.

如果你使用Phoca PDF VirtueMart Email插件,你就可以给您的客户发送邮件

Advanced Modifications (Phoca PDF VirtueMart plugin)高级选项修改(Phoca PDF VirtueMart插件)

1. Displaying Invoice, Delivery Note or Receipt in frontend, in Account Maintenance   在账户管理页面,显示invoice,提货单或者收据

Modify the following file修改一下文件:

administrator/components/com_virtuemart/classes/ps_order.php

FROM (line cca 23)从第23行将一下代码


class vm_ps_order {

TO修改成以下代码 :


jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php')) { require_once(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php'); } else { return JError::raiseError('Include Error', 'Plugin: Phoca PDF VirtueMart Helper class not found'); } class vm_ps_order {

FROM (line cca 729):从第729行将以下代码


$listObj->addCell( $tmp_cell );

TO:修改成以下代码


$listObj->addCell( $tmp_cell ); $delivery = PhocaPDFVirtueMartHelper::renderPDFIconAccount($sess, URL, $db->f("order_id")); $listObj->addCell($delivery);

Then your customers will see PDF icon to Invoice, Delivery Note or Receipt (if created) in Account Maintenance view.

然后您的客户在账户管理页面就可以看到invoice,提货单,收据的图标,如下图所示

2. Fixing tab bug in detail window of an order (if you click on e.g. "New delivery" in delivery tab, the site is redirecting but not the delivery tab will be displayed - the first tab is displayed instead). The site should be redirecting back to delivery tab

在订单详情页修复标签bug(例如在deliver标签 点击 "New delivery",网站跳转但是deliver标签没有显示,第一个标签反而显示了)。网站按道理应该跳转到deliver标签页

Modify the following file修改一下文件:

administrator/components/com_virtuemart/classes/htmlTools.class.php

FROM (line cca 407):从第407行将一下代码

function endPane() { echo "
";

TO修改成一下代码 :


function endPane() { echo "
"; $d = JRequest::get('request'); if(isset($d['delivery_pane']) && $d['delivery_pane'] == 1) { $activeTab = 2; } else { $activeTab = 0; }

FROM: (line cca 421):从第421行开始将一下代码

activeTab: 0,

TO修改成一下代码 :


activeTab: {$activeTab},

Advanced Modifications (Phoca PDF VirtueMart Email plugin)      高级选项修改(Phoca PDF VirtueMart Email插件)

1. Creating Delivery, Creating PDF of Invoice, Delivery Note or Receipt, Sending email with the Invoice, Delivery Note or Receipt automatically after changing Order status

在修改了订单状态以后,创建invoice,提货单或者收据,并将它们自动发送给客户

E.g. if you will change the order status from pending to confirmed , then the delivery will be automatically created, PDF document (Invoice, Delivery Note or Receipt) will be created and sent through email to customer.

例如:例如将订单的状态由pending 修改成 confirmed状态,然后系统会自动创建pdf文档(invoice,提货单或者收据)并且通过邮件发送给客户

Modify修改:

administrator/components/com_virtuemart/classes/ps_order.php,

If you didn't do with some previous hack, then you should paste the following code如果之前你没有做过如何的修改的话,你需要复制一下代码:

FROM (line cca 23)从第23行起将一下代码


class vm_ps_order {

TO修改成如下代码 :


jimport('joomla.filesystem.file'); if (JFile::exists(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php')) { require_once(JPATH_ROOT.DS.'plugins'.DS.'phocapdf'.DS.'virtuemart'.DS.'virtuemarthelper.php'); } else { return JError::raiseError('Include Error', 'Plugin: Phoca PDF VirtueMart Helper class not found'); } class vm_ps_order {

and then然后 :

FROM (line cca 281):从第281行开始将一下代码


if( !empty($notify_customer) ) { $this->notify_customer( $d ); }

TO修改成一下代码 :


if( $curr_order_status=="P" && $d["order_status"]=="C" && $notify_customer == 1) { PhocaPDFVirtueMartHelper::createDeliveryAndPDFandSendEmail($vmLogger, $VM_LANG, CLASSPATH); } if( !empty($notify_customer) ) { //$this->notify_customer( $d ); }

PDF templates are created in HTML and CSS so they can be stylized in Phoca PDF VirtueMart (Email) plugin parameters or they can be modified directly in template files which are located in the follwing folder:

你可以通过修改Phoca PDF VirtueMart (Email)插件参数来达到修改pdf模板的目的 或者是直接到模板文件所在文件夹修改模板文件。

plugins/phocapdf/virtuemart/ (in your Joomla! site root folder)如下几个文件

  • tmpl.deliverynote.php
  • tmpl.invoice.php
  • tmpl.receipt.php

You can set default settings for creating of a delivery:可以设置默认值来创建delivery

  • If receipt or invoice will be created
  • Due days
  • Delay interest

Example of styled Invoice (CSS attributes and header changed in Phoca PDF VirtueMart plugin parameters - no edit in PDF templates):下面是一个例子的截图

Translation:

All language strings follows Joomla! translation rules and can be found in:语言文件

  • Phoca PDF VirtueMart plugin (Phoca PDF VirtueMart Email plugin) - en-GB.plg_phocapdf_virtuemart.ini
  • Phoca PDF component - en-GB.com_phocapdf.ini
  • Phoca Email component - en-GB.com_phocaemail.ini

Translation files can be translated to other languages and used on Joomla! site. See article: How to create translation for Joomla! extensions    你可以根据您的站点语言来创建语言文件。点击How to create translation for Joomla! extensions 查看如何创建语言文件

Phoca Install VirtueMart component is specific file needed for installation only (designed for developers or administrators), so it does not include translation (it is only in English available).

Phoca Install VirtueMart组件安装过程比较特殊(为开发人员或者超级管理员设计的),所以不包含翻译(只有英文的)

引用自:http://www.phoca.cz/documents/18-virtuemart/399-virtuemart-invoice-delivery-note-and-receipt-addon

你可能感兴趣的:(Joomla)