Exemple #1
0
def print_box_barcode_label_admin(products):
    '''helper function to return the admin-data from the pdf generation'''
    product_data = {
        "box_label_{}.pdf".format(product.sku): box_barcode_label(product)
        for product in products
    }
    return dynamic_file_httpresponse(product_data, 'box_labels')
Exemple #2
0
def print_stock_label_38x90_admin(materials):
    ''' helper function to return all of the labels for stock-identifying'''
    stock_label_data = {
        'stock_label_{}.pdf'.format(mat.sku): stock_label_38x90(mat)
        for mat in materials
    }
    return dynamic_file_httpresponse(stock_label_data, 'stock_labels')
def export_pricelist_for_customer_admin(relations):
    exported_files = {}
    for relation in relations:
        exported_files['{} price list.csv'.format(
            relation)] = export_pricelist_csv(relation.price_list)

    return dynamic_file_httpresponse(exported_files, u'price_lists_csv')
def print_picking_list_admin(sales_order_shipments):
    items = {
        '{} {}.pdf'.format(pr.__unicode__(), pr.sales_order.client):
        pr.picking_list()
        for pr in sales_order_shipments
    }
    return dynamic_file_httpresponse(items, 'picking_lists')
def print_stock_label_38x90_admin(materials):
    '''helper function to return the admin-data from the pdf generation of the picking list'''
    files = {
        'material_label_{}.pdf'.format(i.name): stock_label_38x90(i)
        for i in materials
    }
    return dynamic_file_httpresponse(files, u'material_labels')
Exemple #6
0
def print_production_order_report_admin(production_orders):
    items = {}
    for pr in production_orders:
        doc_name = 'Production order {} #{}.pdf'.format(
            pr.production_location.own_address.company_name, pr.id)
        items[doc_name] = production_order_report(pr)

    return dynamic_file_httpresponse(items, 'purchase_orders')
def print_internal_transport_picking_list_admin(internal_transports):
    '''helper function to return the admin-data from the pdf generation of the picking list'''
    files = {
        'picking_list_{}.pdf'.format(i.id):
        print_internal_transport_picking_list(i)
        for i in internal_transports
    }
    return dynamic_file_httpresponse(files, u'picking_lists')
Exemple #8
0
def print_purchase_order_report_admin(purchase_orders):
    pos = {}
    for po in purchase_orders:
        doc_name = 'Purchase order {} #{}.pdf'.format(
            po.supplier.business_name, po.id)
        pos[doc_name] = purchase_order_report(po)

    return dynamic_file_httpresponse(pos, 'purchase_orders')
def export_datafile_for_customer_admin(relations, active_only):
    exported_files = {}
    for relation in relations:
        # pricelist = PriceList.objects.get(currency=relation.currency,
        #     customer_type=relation.customer_type)
        exported_files['{} product file.csv'.format(
            relation)] = export_product_datafile(relation.price_list,
                                                 active_only=active_only)

    return dynamic_file_httpresponse(exported_files, u'data_files_csv')
Exemple #10
0
def print_address_label_admin(relations):
    label_data = {}
    for relation in relations:
        filename = u'{}.pdf'.format(relation.business_name)
        address = relation.printing_address_newlines().replace(
            '\n', '<br></br>')
        label_data[filename] = simple_label_38x90(address,
                                                  center=True,
                                                  margin_top=5)

    return dynamic_file_httpresponse(label_data, u'address_labels')
Exemple #11
0
def export_pricelist_pdf_admin(pricelists, include_stock=False, active_only=True):
    if include_stock:
        items = {'Price- and stocklist {}.pdf'.format(pr.name): export_pricelist_pdf(pr, include_stock, active_only) for pr in pricelists}
    else:
        items = {'Pricelist {}.pdf'.format(pr.name): export_pricelist_pdf(pr, include_stock, active_only) for pr in pricelists}
    return dynamic_file_httpresponse(items, 'Price Lists')
Exemple #12
0
def print_picking_list_admin(production_order_shipments):
    items = {
        'Production Shipment {}.pdf'.format(pr.id): pr.picking_list()
        for pr in production_order_shipments
    }
    return dynamic_file_httpresponse(items, 'picking_lists')
Exemple #13
0
def print_washinglabel_admin(products):
    ''' helper function to print washinglabels for products'''
    washing_label_data = {"washing_label_{}.pdf".format(product.sku): washinglabel(product) for \
        product in products}
    return dynamic_file_httpresponse(washing_label_data, 'washing_labels')
Exemple #14
0
def print_production_notes_for_umbrella_product_admin(umbrella_products,
                                                      language):
    pr_notes = {"suzys_production_notes_{}.pdf".format(umbrella_product.base_sku):production_notes_for_umbrella_product(umbrella_product, language) for\
        umbrella_product in umbrella_products}
    return dynamic_file_httpresponse(pr_notes, 'suzys_production_notes')
Exemple #15
0
def print_customs_invoice_admin(sales_order_shipments):
    items = {
        'Commercial Invoice {}.pdf'.format(pr.id): pr.customs_invoice()
        for pr in sales_order_shipments
    }
    return dynamic_file_httpresponse(items, 'Commercial_invoices')