From 3cb68e17b911b2945f7bb04906031075f39b6a09 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 15 Nov 2011 15:22:44 +0530 Subject: [PATCH] New Print Formats --- erpnext/patches/install_print_formats.py | 80 +++++ .../print_formats/DeliveryNoteClassic.html | 279 ++++++++++++++++ .../print_formats/DeliveryNoteModern.html | 306 ++++++++++++++++++ .../print_formats/DeliveryNoteSpartan.html | 302 +++++++++++++++++ .../print_formats/PurchaseOrderClassic.html | 249 ++++++++++++++ .../print_formats/PurchaseOrderModern.html | 276 ++++++++++++++++ .../print_formats/PurchaseOrderSpartan.html | 272 ++++++++++++++++ .../print_formats/QuotationClassic.html | 256 +++++++++++++++ .../print_formats/QuotationModern.html | 283 ++++++++++++++++ .../print_formats/QuotationSpartan.html | 279 ++++++++++++++++ .../print_formats/SalesInvoiceClassic.html | 261 +++++++++++++++ .../print_formats/SalesInvoiceModern.html | 288 +++++++++++++++++ .../print_formats/SalesInvoiceSpartan.html | 284 ++++++++++++++++ .../print_formats/SalesOrderClassic.html | 260 +++++++++++++++ .../print_formats/SalesOrderModern.html | 287 ++++++++++++++++ .../print_formats/SalesOrderSpartan.html | 283 ++++++++++++++++ index.html | 2 +- versions-master.db | Bin 591872 -> 730112 bytes 18 files changed, 4246 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/install_print_formats.py create mode 100644 erpnext/patches/print_formats/DeliveryNoteClassic.html create mode 100644 erpnext/patches/print_formats/DeliveryNoteModern.html create mode 100644 erpnext/patches/print_formats/DeliveryNoteSpartan.html create mode 100644 erpnext/patches/print_formats/PurchaseOrderClassic.html create mode 100644 erpnext/patches/print_formats/PurchaseOrderModern.html create mode 100644 erpnext/patches/print_formats/PurchaseOrderSpartan.html create mode 100644 erpnext/patches/print_formats/QuotationClassic.html create mode 100644 erpnext/patches/print_formats/QuotationModern.html create mode 100644 erpnext/patches/print_formats/QuotationSpartan.html create mode 100644 erpnext/patches/print_formats/SalesInvoiceClassic.html create mode 100644 erpnext/patches/print_formats/SalesInvoiceModern.html create mode 100644 erpnext/patches/print_formats/SalesInvoiceSpartan.html create mode 100644 erpnext/patches/print_formats/SalesOrderClassic.html create mode 100644 erpnext/patches/print_formats/SalesOrderModern.html create mode 100644 erpnext/patches/print_formats/SalesOrderSpartan.html diff --git a/erpnext/patches/install_print_formats.py b/erpnext/patches/install_print_formats.py new file mode 100644 index 0000000000..af9756bbd7 --- /dev/null +++ b/erpnext/patches/install_print_formats.py @@ -0,0 +1,80 @@ +import os, sys + +path_to_file = os.sep.join(os.path.abspath(__file__).split(os.sep)[:-1] + ['print_formats']) + +def prepare_pf_dict(args_list): + """ + + """ + pf_list = [] + for a in args_list: + for pf_type in ['Classic', 'Modern', 'Spartan']: + pf = {} + pf['name'] = " ".join([a['name'], pf_type]) + pf['file'] = os.sep.join([path_to_file, "".join(pf['name'].split(" ")) + ".html"]) + pf['module'] = a['module'] + pf['doc_type'] = a['doc_type'] + pf['standard'] = 'Yes' + pf_list += [pf] + return pf_list + + +pf_to_install = prepare_pf_dict([ + { + 'name' : 'Sales Invoice', + 'doc_type' : 'Receivable Voucher', + 'module' : 'Accounts' + }, + { + 'name' : 'Sales Order', + 'doc_type' : 'Sales Order', + 'module' : 'Selling' + }, + { + 'name' : 'Quotation', + 'doc_type' : 'Quotation', + 'module' : 'Selling' + }, + { + 'name' : 'Delivery Note', + 'doc_type' : 'Delivery Note', + 'module' : 'Stock' + }, + { + 'name' : 'Purchase Order', + 'doc_type' : 'Purchase Order', + 'module' : 'Buying' + } +]) + +def execute(): + """ + Install print formats + """ + global pf_to_install + print pf_to_install + for pf in pf_to_install: + install_print_format(pf) + print "Installed PF: " + pf['name'] + + +def install_print_format(args): + """ + Installs print format + args is a dict consisting of following keys: + * name + * module + * doctype + * standard = "Yes"/"No" + * file + """ + from webnotes.model.doc import Document + d = Document('Print Format') + d.name = args.name + f = open(args.file) + d.html = f.read() + f.close() + d.module = args.module + d.doc_type = args.doc_type + d.standard = args.standard + d.save(1) diff --git a/erpnext/patches/print_formats/DeliveryNoteClassic.html b/erpnext/patches/print_formats/DeliveryNoteClassic.html new file mode 100644 index 0000000000..0db80b9dab --- /dev/null +++ b/erpnext/patches/print_formats/DeliveryNoteClassic.html @@ -0,0 +1,279 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/DeliveryNoteModern.html b/erpnext/patches/print_formats/DeliveryNoteModern.html new file mode 100644 index 0000000000..634bea0c35 --- /dev/null +++ b/erpnext/patches/print_formats/DeliveryNoteModern.html @@ -0,0 +1,306 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/DeliveryNoteSpartan.html b/erpnext/patches/print_formats/DeliveryNoteSpartan.html new file mode 100644 index 0000000000..10ca9dd11b --- /dev/null +++ b/erpnext/patches/print_formats/DeliveryNoteSpartan.html @@ -0,0 +1,302 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/PurchaseOrderClassic.html b/erpnext/patches/print_formats/PurchaseOrderClassic.html new file mode 100644 index 0000000000..0e51c6148a --- /dev/null +++ b/erpnext/patches/print_formats/PurchaseOrderClassic.html @@ -0,0 +1,249 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/PurchaseOrderModern.html b/erpnext/patches/print_formats/PurchaseOrderModern.html new file mode 100644 index 0000000000..b159242ade --- /dev/null +++ b/erpnext/patches/print_formats/PurchaseOrderModern.html @@ -0,0 +1,276 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/PurchaseOrderSpartan.html b/erpnext/patches/print_formats/PurchaseOrderSpartan.html new file mode 100644 index 0000000000..ac4fc02f48 --- /dev/null +++ b/erpnext/patches/print_formats/PurchaseOrderSpartan.html @@ -0,0 +1,272 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/QuotationClassic.html b/erpnext/patches/print_formats/QuotationClassic.html new file mode 100644 index 0000000000..5672fe9e13 --- /dev/null +++ b/erpnext/patches/print_formats/QuotationClassic.html @@ -0,0 +1,256 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/QuotationModern.html b/erpnext/patches/print_formats/QuotationModern.html new file mode 100644 index 0000000000..fadecf2b8e --- /dev/null +++ b/erpnext/patches/print_formats/QuotationModern.html @@ -0,0 +1,283 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/QuotationSpartan.html b/erpnext/patches/print_formats/QuotationSpartan.html new file mode 100644 index 0000000000..bf51880812 --- /dev/null +++ b/erpnext/patches/print_formats/QuotationSpartan.html @@ -0,0 +1,279 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/SalesInvoiceClassic.html b/erpnext/patches/print_formats/SalesInvoiceClassic.html new file mode 100644 index 0000000000..f7eddcb7c2 --- /dev/null +++ b/erpnext/patches/print_formats/SalesInvoiceClassic.html @@ -0,0 +1,261 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesInvoiceModern.html b/erpnext/patches/print_formats/SalesInvoiceModern.html new file mode 100644 index 0000000000..f5d4d7c744 --- /dev/null +++ b/erpnext/patches/print_formats/SalesInvoiceModern.html @@ -0,0 +1,288 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesInvoiceSpartan.html b/erpnext/patches/print_formats/SalesInvoiceSpartan.html new file mode 100644 index 0000000000..d25bc1abfa --- /dev/null +++ b/erpnext/patches/print_formats/SalesInvoiceSpartan.html @@ -0,0 +1,284 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/erpnext/patches/print_formats/SalesOrderClassic.html b/erpnext/patches/print_formats/SalesOrderClassic.html new file mode 100644 index 0000000000..fcf104ebf0 --- /dev/null +++ b/erpnext/patches/print_formats/SalesOrderClassic.html @@ -0,0 +1,260 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesOrderModern.html b/erpnext/patches/print_formats/SalesOrderModern.html new file mode 100644 index 0000000000..7013e5d3f9 --- /dev/null +++ b/erpnext/patches/print_formats/SalesOrderModern.html @@ -0,0 +1,287 @@ + + + + + + + + + + + + +
+ + +
+ + diff --git a/erpnext/patches/print_formats/SalesOrderSpartan.html b/erpnext/patches/print_formats/SalesOrderSpartan.html new file mode 100644 index 0000000000..0352154208 --- /dev/null +++ b/erpnext/patches/print_formats/SalesOrderSpartan.html @@ -0,0 +1,283 @@ + + + + + + + + + + + + +
+ + +
+ + + diff --git a/index.html b/index.html index f4f087ba6b..4ab0b9bd55 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ ERPNext -