Example #1
0
def _get_columns(filters):
    return [
        make_column("branch", type="Link", options="Branch", width=150),
        make_column("qty_sold", type="Float", width=90),
        make_column("cost_price", type="Currency"),
        make_column("sale_amount", type="Currency"),
        make_column("cost_pc", label="Cost %", type="Percent", width=90),
    ]
Example #2
0
def _get_columns(filters):
    return [
        make_column("posting_date", type="Date", width=90),
        make_column("voucher_type", type="Link", options="Doctype"),
        make_column("voucher_no", type="Dynamic Link", options="voucher_type"),
        make_column("points", type="Int", width=90),
        make_column("balance", type="Int", width=90),
    ]
Example #3
0
def _get_columns(filters, intervals):
    join_columns = compose(list, concatv)
    return join_columns(
        [make_column("branch", type="Link", options="Branch")],
        [
            merge(x, make_column(x.get("key"), x.get("label"), width=90))
            for x in intervals
        ],
        [make_column("total", type="Int", width=90)],
    )
Example #4
0
def _get_columns(filters):
    branches = pluck("name", frappe.get_all("Branch", filters={"disabled": 0}))
    join_columns = compose(list, concatv)
    return join_columns(
        [
            make_column(
                "item_group", "Item Group", type="Link", options="Item Group"),
            make_column("brand", "Brand", type="Link", options="Brand"),
            make_column("item_code", "Item Code", type="Link", options="Item"),
            make_column("item_name", "Item Name", width=180),
        ],
        [make_column("cost_price", "Cost Price", type="Currency", width=90)]
        if cint(filters.hqm_view) else [],
        [
            make_column("minimum_selling",
                        "Minimum Selling",
                        type="Currency",
                        width=90),
            make_column("standard_selling",
                        "Standard Selling",
                        type="Currency",
                        width=90),
        ],
        [make_column(x, x, type="Float", width=90) for x in branches],
        [make_column("total_qty", "Total Qty", type="Float", width=90)],
    )
Example #5
0
def _get_columns():
    return list(
        concatv(
            [
                make_column("outgoing_date", type="Date", width=90),
                make_column("incoming_date", type="Date", width=90),
                make_column("name",
                            "Doc Name",
                            type="Link",
                            options="Stock Transfer",
                            width=150),
                make_column("workflow_state", "Status", width=90),
                make_column(
                    "item_code", type="Link", options="Item", width=150),
                make_column("item_name", width=180),
                make_column("qty", type="Float", width=90),
            ],
            [
                make_column(
                    "outgoing_stock_entry",
                    "Outgoing Doc",
                    type="Link",
                    options="Stock Entry",
                    width=150,
                ),
                make_column(
                    "incoming_stock_entry",
                    "Incoming Doc",
                    type="Link",
                    options="Stock Entry",
                    width=150,
                ),
            ] if any(role in ["Accounts Manager"]
                     for role in frappe.get_roles()) else [],
        ))
Example #6
0
def _get_columns(filters):
    return [
        make_column("bank_name", "BANK CODE", width=90),
        make_column("bank_ac_no", "CREDIT ACCOUNT NO", width=150),
        make_column("employee_name", "EMP NAME", width=150),
        make_column("amount", "AMOUNT", type="Currency"),
        make_column("remarks", "REMARKS", width=150),
        make_column("placeholder1", "PAYMENT_PRODUCT"),
        make_column("placeholder2", "TXN_CCY"),
        make_column("placeholder3", "SWIFT_CHARGING_OPT"),
        make_column("placeholder3", "PAYMENT_VALUE_DATE"),
        make_column("account_number", "DEBIT_ACCOUNT NUMBER", width=150),
    ]
Example #7
0
def _get_columns(args):
    columns = [
        make_column("item_code", type="Link", options="Item"),
        make_column("brand", type="Link", options="Brand"),
        make_column("item_name", width=200),
        make_column("supplier", type="Link", options="Supplier"),
        make_column(
            "price",
            args.get("price_list", "Standard Buying Price"),
            type="Currency",
            width=90,
        ),
        make_column("stock", "Available Stock", type="Float", width=90),
    ]
    intervals = compose(
        list,
        partial(
            map,
            lambda x: merge(
                x,
                make_column(
                    x.get("key"), x.get("label"), type="Float", width=90)),
        ),
        generate_intervals,
    )
    return (columns + intervals(args.get("interval"), args.get("start_date"),
                                args.get("end_date")) +
            [make_column("total_consumption", type="Float", width=90)])
def _get_columns(filters):
    return [
        make_column("loyalty_card_no"),
        make_column("customer", type="Link", options="Customer"),
        make_column("customer_name", width=150),
        make_column("cpr_no", width=90),
        make_column("mobile_no", options="Phone"),
        make_column("points", type="Int", width=90),
        make_column("activation_date", type="Date", width=90),
        make_column("loyalty_program", type="Link", options="Loyalty Program"),
        make_column("tier"),
    ]
def _get_columns(filters):
    return [
        make_column("loyalty_card_no"),
        make_column("customer", type="Link", options="Customer"),
        make_column("customer_name", width=150),
        make_column("cpr_no", width=90),
        make_column("mobile_no", options="Phone"),
        make_column("points_earned", type="Int", width=90),
        make_column("date_earned", type="Date", width=90),
        make_column("points_redeemed", type="Int", width=90),
        make_column("expiry_date", type="Date", width=90),
    ]
def _get_columns(columns):
    return list(
        concatv(
            columns[:15],
            [
                make_column("purpose"),
                make_column(
                    "reference_stock_transfer",
                    "Stock Transfer",
                    type="Link",
                    options="Stock Transfer",
                ),
            ],
            columns[15:],
        )
    )
def _get_columns():
    return [
        make_column("brand", type="Link", options="Brand"),
        make_column("item_code", "Item", type="Link", options="Item"),
        make_column("item_group", type="Link", options="Item Group"),
        make_column("item_name", type="Data", width=150),
        make_column("standard_selling", type="Currency"),
        make_column("qty", type="Float"),
        make_column("minimum_selling", type="Currency"),
    ]
Example #12
0
def _get_columns(filters):
    return [
        make_column("item_code", type="Link", options="Item"),
        make_column("item_name", type="Data", width=180),
        make_column("brand", type="Link", options="Brand"),
        make_column("actual_qty", type="Float", width=90),
        make_column("reserved_qty", type="Float", width=90),
        make_column("projected_qty", type="Float", width=90),
        make_column("warehouse", type="Link", options="Warehouse"),
    ]
Example #13
0
def _get_columns():
    return [
        make_column("posting_date", "Date", type="Date", width=90),
        make_column("invoice",
                    "Invoice No",
                    type="Link",
                    options="Purchase Invoice"),
        make_column("supplier", type="Link", options="Supplier"),
        make_column("total", type="Currency"),
        make_column("discount", type="Currency"),
        make_column("net_total", type="Currency"),
        make_column("tax", type="Currency"),
        make_column("grand_total", type="Currency"),
    ]
def _get_columns():
    columns = [
        make_column("posting_date", "Date", type="Date", width=90),
        make_column("net_total", type="Currency"),
        make_column("tax_total", type="Currency"),
        make_column("grand_total", type="Currency"),
        make_column("returns grand_total", "Returns Total", type="Currency"),
    ]
    mops = pluck("name", frappe.get_all("Mode of Payment"))
    return (columns + [make_column(x, type="Currency") for x in mops] +
            [make_column("total_collected", type="Currency")])
def _get_columns(filters):
    join = compose(list, concatv)
    workflow_states = frappe.get_all(
        "Workflow Document State",
        filters={"parent": "Optic Store Sales Order"},
        fields="state",
        order_by="idx",
    )
    return join(
        [
            make_column(
                "sales_order", type="Link", options="Sales Order", width=150)
        ],
        [
            make_column(x, type="Datetime", width=180)
            for x in pluck("state", workflow_states)
        ],
        [
            make_column("lab_tech", width=150),
            make_column("total", type="Currency"),
            make_column("outstanding", type="Currency"),
        ],
    )
def _get_columns():
    return [
        make_column("customer", type="Link", options="Customer"),
        make_column("item_code", type="Link", options="Item"),
        make_column("item_name", width=180),
        make_column("qty", "Returned Qty", type="Float", width=90),
        make_column("rate", type="Currency"),
        make_column("gross", type="Currency"),
    ]
def _get_columns(filters):
    columns = concatv(
        [make_column("branch", type="Link", options="Branch")]
        if filters.branches
        else [],
        [
            make_column("item_group", type="Link", options="Item Group"),
            make_column("brand", type="Link", options="Brand"),
            make_column("item_code", type="Link", options="Item"),
            make_column("item_name", width=180),
            make_column("qty_sold", "Sold Qty", type="Float", width=90),
            make_column("qty_balance", "Balance Qty", type="Float", width=90),
        ],
    )
    return list(columns)
def _get_columns(filters):
    columns = concatv(
        [
            make_column(
                "invoice_name",
                "Sales Invoice",
                type="Link",
                options="Sales Invoice",
                width=150,
            ),
            make_column("invoice_date", type="Date", width=90),
            make_column("invoice_time", type="Time", width=90),
            make_column("brand", type="Link", options="Brand"),
            make_column("item_code", type="Link", options="Item"),
            make_column("item_group", type="Link", options="Item Group"),
            make_column("description"),
        ],
        [make_column("valuation_rate", "Cost Price", type="Currency", width=90)]
        if "Accounts Manager" in frappe.get_roles()
        else [],
        [
            make_column(
                "selling_rate", "Standard Selling Rate", type="Currency", width=90
            ),
            make_column("rate", "Sale Unit Rate", type="Currency", width=90),
            make_column("qty", type="Float", width=90),
        ],
        [make_column("valuation_amount", "Cost Amount", type="Currency", width=90)]
        if "Accounts Manager" in frappe.get_roles()
        else [],
        [
            make_column(
                "amount_before_discount",
                "Sale Amount Before Discount",
                type="Currency",
                width=90,
            ),
            make_column("discount_amount", type="Currency", width=90),
            make_column("discount_percentage", type="Percent", width=90),
            make_column(
                "amount_after_discount",
                "Sale Amount After Discount",
                type="Currency",
                width=90,
            ),
            make_column("ms1", "Minimum Selling Rate 1", type="Currency", width=90),
            make_column(
                "below_ms1",
                "Sold Below Mimimum Selling Rate 1",
                type="Select",
                options=["No", "Yes"],
                width=60,
            ),
            make_column("ms2", "Minimum Selling Rate 2", type="Currency", width=90),
            make_column(
                "below_ms2",
                "Sold Below Mimimum Selling Rate 2",
                type="Select",
                options=["No", "Yes"],
                width=60,
            ),
            make_column("total", "Invoice Total", type="Currency", width=90),
            make_column(
                "additional_discount_amount",
                "Invoice Additional Discount",
                type="Currency",
                width=90,
            ),
            make_column(
                "total_taxes_and_charges",
                "Invoice Taxes and Charges",
                type="Currency",
                width=90,
            ),
            make_column(
                "grand_total",
                "Invoice Grand Total",
                type="Currency",
                width=90,
            ),
            make_column("sales_person", type="Link", options="Employee"),
            make_column("sales_person_name", width="150"),
            make_column("commission_amount", type="Currency", width=90),
            make_column("remarks", type="Small Text", width=150),
            make_column("customer", type="Link", options="Customer"),
            make_column("customer_name", width="150"),
            make_column("notes", type="Small Text", width=150),
            make_column("dispensor", "Optometrist", type="Link", options="Employee"),
            make_column("branch", type="Link", options="Branch"),
            make_column(
                "sales_status", type="Select", options=["Achieved", "Collected"]
            ),
            make_column("collection_date", type="Date", width=90),
        ],
    )

    return list(columns)
def _get_columns():
    return [
        make_column("posting_date", "Payment Date", type="Date", width=90),
        make_column("posting_time", "Payment Time", type="Time", width=90),
        make_column("voucher_type"),
        make_column("voucher_no", type="Dynamic Link", options="voucher_type"),
        make_column("mode_of_payment", type="Link", options="Mode of Payment"),
        make_column("paid_amount", "Payment Amount", type="Currency"),
        make_column("customer", type="Link", options="Customer"),
        make_column("customer_name", width=150),
        make_column("branch", type="Link", options="Branch"),
        make_column("sales_person", type="Link", options="Employee"),
        make_column("sales_person_name", width=150),
    ]
def _get_columns(filters):
    return [
        make_column("sales_no"),
        make_column("date"),
        make_column("description", width=150),
        make_column("qty", "Quantity"),
        make_column("item_sold_at"),
        make_column("total_sales_invoice"),
        make_column("sales_person"),
        make_column("customer_name", "Customer", width=150),
        make_column("customer", "Customer ID", type="Link", options="Customer"),
        make_column("old_customer_id", "Old Customer ID"),
        make_column("branch"),
    ]
Example #21
0
def _get_columns(filters):
    join_columns = compose(list, concatv)
    return join_columns(
        [
            make_column("posting_date", type="Date", width=90),
            make_column("posting_time", type="Time", width=90),
            make_column("invoice", type="Link", options="Sales Invoice"),
            make_column("customer", type="Link", options="Customer"),
            make_column("customer_name", width=150),
            # simplest way to ignore user permissions is to not make fieldtype Link
            make_column("branch"),
        ],
        [
            make_column("item_code", type="Link", options="Item"),
            make_column("item_name", width=150),
            make_column("item_group", type="Link", options="Item Group"),
            make_column("brand", type="Link", options="Brand"),
            make_column("rate", type="Currency", width=90),
            make_column("qty", type="Float", width=90),
            make_column("amount", type="Currency", width=90),
        ] if cint(filters.item_wise) else
        [make_column("grand_total", type="Currency", width=90)],
        [
            make_column(
                "sales_order", "Order", type="Link", options="Sales Order"),
            make_column("order_status", width=150),
            make_column("mops", "Modes of Payment", width=150),
        ],
    )
def _get_columns(filters):
    join_columns = compose(list, concatv)
    return join_columns(
        [make_column("supplier", type="Link", options="Supplier")]
        if filters.get("is_manager") else [],
        [
            make_column("brand", type="Link", options="Brand"),
            make_column("item_code", type="Link", options="Item"),
            make_column("item_name", width=200),
            make_column("item_group", type="Link", options="Item Group"),
            make_column("warehouse", type="Link", options="Warehouse"),
            make_column("batch_no", "Batch", type="Link", options="Batch"),
            make_column("expiry_date", type="Date", width=90),
            make_column(
                "expiry_in_days", "Expiry in Days", type="Int", width=90),
            make_column("qty", "Quantity", type="Float", width=90),
        ],
        [
            make_column("buying_price",
                        filters.get("buying_price_list"),
                        type="Currency")
        ] if filters.get("is_manager") else [],
        [
            make_column("selling_price",
                        filters.get("selling_price_list"),
                        type="Currency")
        ],
    )
Example #23
0
def _get_columns(filters):
    return [
        make_column("item_group", type="Link", options="Item Group"),
        make_column("brand", type="Link", options="Brand"),
        make_column("item_code", type="Link", options="Item"),
        make_column("item_name", width=150),
        make_column("opening_qty", type="Int", width=90),
        make_column("purchased_qty", type="Int", width=90),
        make_column("transit_qty", type="Int", width=90),
        make_column("returned_qty", type="Int", width=90),
        make_column("adjustments", type="Int", width=90),
        make_column("sold_qty", type="Int", width=90),
        make_column("total", type="Int", width=90),
        make_column("current_qty", type="Int", width=90),
    ]
Example #24
0
def _get_columns():
    columns = [
        make_column("sales_invoice", type="Link", options="Sales Invoice"),
        make_column("posting_time", "Time", type="Time", width=90),
        make_column("customer", type="Link", options="Customer"),
        make_column("customer_name", type="Data", width=150),
        make_column("total_qty", type="Float"),
        make_column("net_total", type="Currency"),
        make_column("tax_total", type="Currency"),
        make_column("grand_total", type="Currency"),
        make_column("outstanding_amount", "Outstanding", type="Currency"),
        make_column("sales_person", type="Link", options="Employee"),
        make_column("sales_person_name", width=150),
        make_column("is_return", type="Check", hidden=1),
        make_column("return_against",
                    type="Link",
                    options="Sales Invoice",
                    hidden=1),
    ]
    mops = pluck("name", frappe.get_all("Mode of Payment"))
    return (columns + [make_column(x, x) for x in mops] +
            [make_column("total_collected", "Total Collected")])
def _get_columns():
    return [
        make_column("brand", type="Link", options="Brand", width=180),
        make_column("item_group", type="Link", options="Item Group", width=180),
        make_column("qty", type="Float"),
    ]