must be :class:`lino_cosi.lib.vat.models.VatAccountInvoice`) """ params_layout = "partner state year" column_names = "number voucher_date due_date " \ "partner " \ "total_incl " \ "total_base total_vat user workflow_buttons *" #~ "ledger_remark:10 " \ insert_layout = """ partner voucher_date total_incl """ VoucherTypes.add_item(VatAccountInvoice, InvoicesByJournal) class ItemsByInvoice(dd.Table): model = 'vat.InvoiceItem' column_names = "account title vat_class total_base total_vat total_incl" master_key = 'voucher' order_by = ["seqno"] auto_fit_column_widths = True class VouchersByPartner(dd.VirtualTable): """A :class:`lino.core.tables.VirtualTable` which shows all VatDocument vouchers by :class:`lino_xl.lib.contacts.models.Partner`. It has a customized slave summary.
""" order_by = ["-id"] class ProjectInvoicesByJournal(InvoicesByJournal): column_names = "number voucher_date " \ "project partner amount due_date user workflow_buttons *" insert_layout = """ project partner voucher_date """ detail_layout = ProjectInvoiceDetail() VoucherTypes.add_item(AccountInvoice, InvoicesByJournal, _("Invoices")) VoucherTypes.add_item(AccountInvoice, ProjectInvoicesByJournal, _("Project invoices")) class VouchersByPartner(dd.VirtualTable): """Shows all ledger vouchers of a given partner. This is a :class:`lino.core.tables.VirtualTable` with a customized slave summary. """ label = _("Partner vouchers") order_by = ["-date", '-id'] master = 'contacts.Partner' slave_grid_format = 'summary'
class ClientVouchers(PartnerVouchers): model = 'client_vouchers.ClientVoucher' order_by = ["-id"] column_names = "date id number project amount user *" detail_layout = ClientVoucherDetail() insert_layout = """ journal project date amount """ class ClientVouchersByJournal(ClientVouchers, ByJournal): """Shows all simple invoices of a given journal (whose :attr:`Journal.voucher_type` must be :class:`lino_cosi.lib.sales.models.ClientVoucher`). """ params_layout = "project partner state year" column_names = "number date project amount user workflow_buttons *" insert_layout = """ project date amount """ order_by = ["-number"] from .models import ClientVoucher VoucherTypes.add_item(ClientVoucher, ClientVouchersByJournal)
def add_voucher_type(sender, **kw): VoucherTypes.add_item('sales.VatProductInvoice', InvoicesByJournal)
voucher = item.voucher kw.update(for_journal=voucher.journal) if not dd.plugins.finan.suggest_future_vouchers: kw.update(date_until=voucher.voucher_date) kw.update(partner=item.partner) return kw class SuggestionsByBankStatementItem(SuggestionsByVoucherItem): """A :class:`SuggestionsByVoucherItem` table for a :class:`BankStatementItem`. """ master = 'finan.BankStatementItem' class SuggestionsByPaymentOrderItem(SuggestionsByVoucherItem): """A :class:`SuggestionsByVoucherItem` table for a :class:`PaymentOrderItem`. """ master = 'finan.PaymentOrderItem' # Declare the voucher types: VoucherTypes.add_item(JournalEntry, JournalEntriesByJournal) VoucherTypes.add_item(PaymentOrder, PaymentOrdersByJournal) VoucherTypes.add_item(BankStatement, BankStatementsByJournal) # VoucherTypes.add_item(Grouper, GroupersByJournal)
""" order_by = ["-id"] class ProjectInvoicesByJournal(InvoicesByJournal): column_names = "number voucher_date " \ "project partner amount due_date user workflow_buttons *" insert_layout = """ project partner voucher_date """ detail_layout = ProjectInvoiceDetail() VoucherTypes.add_item( AccountInvoice, InvoicesByJournal, _("Invoices")) VoucherTypes.add_item( AccountInvoice, ProjectInvoicesByJournal, _("Project invoices")) class VouchersByPartner(dd.VirtualTable): """Shows all ledger vouchers of a given partner. This is a :class:`lino.core.tables.VirtualTable` with a customized slave summary. """ label = _("Partner vouchers") order_by = ["-date", '-id'] master = 'contacts.Partner' slave_grid_format = 'summary'