Ejemplo n.º 1
0
from registration.models import Delivery
from model_report.report import reports, ReportAdmin


class DeliveryReport(ReportAdmin):
    title = ('Delivery Report')
    model = Delivery
    fields = [
        'Delivery_ID',
        'Delivery_Reg_Time',
        'Delivery_Total',
    ]
    list_order_by = ('Delivery_ID', 'Delivery_Reg_Time', 'Delivery_Total')
    type = 'report'


reports.register('anymodel-report', DeliveryReport)
Ejemplo n.º 2
0
    list_group_by = ('number_of_alternatives', 'matching_index')

    type = 'chart'

    chart_types = ('pie', 'column')

    report_totals = {
        'number_of_alternatives': count_column,
    }

    group_totals = {
        'number_of_alternatives': count_column
    }

reports.register('matching-report', MatchingLogReport)


def round_ngram_value(value):
    return round(value, 1)


def round_geo_distance_value(value):
    if isinstance(value, float):
        return round(value, 1)

    else:
        return 'None'


class MatchingPlacesLogReport(ReportAdmin):
Ejemplo n.º 3
0
        'date__month',
        'date__day',
        'resolution',
        'percentage',
    ]
    list_group_by = ('date__year', 'date__month',)
    list_filter = ('resolution',)
    type = 'report'
    override_field_labels = {
        'date__year': lambda x, y: _('Year'),
        'date__month': lambda x, y: _('Month'),
        'date__day': lambda x, y: _('Day'),
    }


reports.register('resolution-by-year-report', ResolutionByYearReport)


class OSReport(ReportAdmin):
    model = OS
    fields = [
        'company__name',
        'name',
    ]
    list_filter = ('company__name',)
    type = 'report'


reports.register('os-report', OSReport)

Ejemplo n.º 4
0
from model_report.report import reports, ReportAdmin


class TurtleBySpeciesReport(ReportAdmin):
    title = _('Turtles By Species')
    model = Turtle
    fields = [
        'turtle_species',
        'turtle_sex',
        'turtle_pit_tag_id',
    ]
    list_group_by = ('turtle_species', )
    list_filter = ('turtle_sex',)
    type = 'report'

reports.register('turtle-by-species-report', TurtleBySpeciesReport)


'''class ObservationByPitTagReport(ReportAdmin):
    title = _('Observations By Pit Tag')
    model = Observation
    fields = [
        'turtle_species',
        'turtle_sex',
        'turtle_pit_tag_id',
    ]
    list_group_by = ('turtle_pit_tag_id', )
    list_filter = ('turtle_sex',)
    type = 'report'

reports.register('observation-by-pit-tag-report', ObservationByPitTagReport)
Ejemplo n.º 5
0
    #     ('effective_duration', Sum),
    #     ('effective_duration', Avg),
    #     ('billsec', Sum),
    #     ('total_cost', Sum),
    #     ('total_sell', Sum),
    # )
    # aggregate = (
    #     ('id', Count, 'Nb Calls'),
    #     ('effective_duration', Sum),
    #     ('effective_duration', Avg),
    #     ('billsec', Sum),
    #     ('total_cost', Sum),
    #     ('total_sell', Sum),
    # )
    # group_by = [
    #     'customer__name',
    #     ('customer__name', 'sell_destination'),
    #     'sell_destination',
    #     'lcr_carrier_id__name',
    #     ('lcr_carrier_id__name', 'cost_destination'),
    #     'cost_destination',
    # ]
    # list_filter = [
    #     'sell_destination',
    #     'lcr_carrier_id__name',
    # ]

    # date_hierarchy = 'start_stamp'

reports.register('CDR-report', CDRReport)
Ejemplo n.º 6
0
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from vehicles.models import Vehicles

from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column, count_column)


class VehiclesReport(ReportAdmin):
    title = _('Vehicles Report')
    model = Vehicles
    fields = [
        'driver_name',
        'max_gross',
        'use_stored_tare',
    ]
    type = 'report'

reports.register('vehicles-report', VehiclesReport)
Ejemplo n.º 7
0
from .models import Item, Category
from model_report.report import reports, ReportAdmin

class ItemsReport(ReportAdmin):
    title = ('Items report')
    model = Item
    fields = [
        'name',
        'cost',
    ]
    list_order_by = ('name',)
    type = 'report'

reports.register('items-report', ItemsReport)
Ejemplo n.º 8
0
# -*- coding: utf-8 -*-
from .models import Madurez
from model_report.report import reports, ReportAdmin


class MadurezReport(ReportAdmin):
    title = ('Reporte de madurez')
    model = Madurez
    fields = [
        'grado__nombre',
        'fecha',
        'registro__control__nombre',
        'registro__resultado',
        'registro__control__dominio__nombre',
        'registro__control__dominio__metodologia__nombre',
        ]
    list_order_by = ('grado',)
    type = 'chart'
    char_type = 'pie'

reports.register('madurez-report', MadurezReport)
Ejemplo n.º 9
0
        "phone",
        "country",
        "sponsored",
        "sponsor__name",
        "self.price",
        "self.paid",
        "self.balance",
    ]

    override_field_labels = {
        "id": _("ID"),
        "type__name": _("Type"),
        "profession__name": _("Profession"),
        "sponsor__name": _("Sponsor"),
        "self.price": _("Price"),
        "self.paid": _("Paid"),
        "self.balance": _("Balance"),
    }
    override_field_formats = {"extra": yesno_format, "main": yesno_format, "sponsored": yesno_format}
    list_order_by = ("first_name", "last_name")
    list_filter = ("id", "event", "country", "profession", "date_joined")
    exclude = {"field": "is_staff", "value": True}
    selectable_fields = True

    type = "report"


reports.register("attendee-report", AttendeeReport)
reports.register("accounting-report", AccountingReport)
reports.register("payment-report", PaymentReport)
Ejemplo n.º 10
0
from web.models import Producto
from model_report.report import reports, ReportAdmin


class ProductoModelReport(ReportAdmin):
    title = 'Reporte Producto'
    model = Producto
    fields = [
        'Ref_Producto',
        'Nombre_producto',
        'Cantidad',
    ]
    list_order_by = ('Ref_Producto', )
    type = 'report'


reports.register('Producto-report', ProductoModelReport)
Ejemplo n.º 11
0
from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column, count_column)


class OSReport(ReportAdmin):
    model = OS
    fields = [
        'company__name',
        'name',
    ]
    list_filter = ('company__name',)
    type = 'report'


reports.register('os-report', OSReport)


def men_format(value, instance):
    return _(u'M %s' % value)


def women_format(value, instance):
    return _(u'F %s' % value)


def men_label(report, field):
    return _("Mens")


class PopulationReport(ReportAdmin):
Ejemplo n.º 12
0
from web.models import Producto
from model_report.report import reports, ReportAdmin

class ProductoModelReport(ReportAdmin):
    title = 'Reporte Producto'
    model = Producto
    fields = ['Ref_Producto','Nombre_producto','Cantidad',]
    list_order_by = ('Ref_Producto',)
    type = 'report'

reports.register('Producto-report', ProductoModelReport)
Ejemplo n.º 13
0
from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column,
                                count_column)


class OSReport(ReportAdmin):
    model = OS
    fields = [
        'company__name',
        'name',
    ]
    list_filter = ('company__name', )
    type = 'report'


reports.register('os-report', OSReport)


def men_format(value, instance):
    return _(u'M %s' % value)


def women_format(value, instance):
    return _(u'F %s' % value)


def men_label(report, field):
    return _("Mens")


class PopulationReport(ReportAdmin):
Ejemplo n.º 14
0
    list_filter = ('tgl_pembelian','terjual',
                   'cabang__nama_cabang',)

    list_group_by = ('merek','tipe','tgl_pembelian',
                     'cabang__nama_cabang',)

    list_order_by = {'tgl_pembelian'}
    report_totals = {
        'biaya_total': sum_column,
        'tgl_pembelian' : count_column
    }
    exports = ('pdf',)

    type = 'report'
reports.register('Laporan-Pembelian-Kendaraan-Bermotor', PembelianReport)

class PenjualanReport(ReportAdmin):
    title=("Laporan Penjualan Kendaraan Bermotor")
    model = Penjualan
    fields = [
        'tgl_penjualan', 'customer__nama_lengkap','no_sp', 'stok__merek', 'stok__tipe', 'stok__no_polisi',
        'stok__no_bpkb', 'uang_muka', 'saldo_piutang','jangka_waktu', 'cicilan_bulanan',
        's_p_pokok', 'harga_netto','harga_total','cabang__nama_cabang',
    ]
    list_filter = ('cabang__nama_cabang','tgl_penjualan','status','no_sp',)
    list_filter_widget = {'status',}
    list_order_by = {'tgl_penjualan'}
    list_group_by = ('tgl_penjualan','cabang__nama_cabang')
    override_field_formats = {
Ejemplo n.º 15
0
        'self.total',
    ]
    list_filter = ('start',)
    list_order_by = ('start',)
    report_totals = {
        'self.men': sum_column,
        'self.women': sum_column,
        'self.total': sum_column,
    }

class ContactReport(ReportAdmin):
    title = _('Contact')
    model = Contact
    fields = [
        'first_name',
        'last_name',
        'sex',
    ]
    list_filter = ('events__event', 'events__event__start', 'events__event__monitor')
    list_order_by = ('first_name', 'last_name')
    list_group_by = ('sex')
    group_totals = {
        'sex': count_column,
    }
    type = 'chart'
    chart_types = ('pie', 'column', 'line')
    list_serie_fields = ('sex',)

reports.register('event-report', EventReport)
reports.register('contact-report', ContactReport)
Ejemplo n.º 16
0
from anyapp.models import AnyModel
from model_report.report import reports, ReportAdmin

class AnyModelReport(ReportAdmin):
    title = _('AnyModel Report Name')
    model = AnyModel
    fields = [
        'anymodelfield',
    ]
    list_order_by = ('anymodelfield',)
    type = 'report'

reports.register('anymodel-report', AnyModelReport)
Ejemplo n.º 17
0
from incidencias.apps.comun.models import Zona
from model_report.report import reports, ReportAdmin

class AnyModelReport(ReportAdmin):
    title = ('AnyModel Report Name')
    model = Zona
    fields = [
        'nombre',
    ]
    list_order_by = ('nombre',)
    type = 'report'

reports.register('prueba', AnyModelReport)
Ejemplo n.º 18
0
__author__ = 'Nicholas'

from models import Order
from model_report.report import reports, ReportAdmin

class OrderReport(ReportAdmin):
    title ='Order Report Name'
    model = Order
    fields = [
        'id','transaction_id','date','delivery_name'
    ]
    list_order_by = ('date',)
    type = 'report'

reports.register('orders', OrderReport)
Ejemplo n.º 19
0
    group_totals = {'men': avg_column, 'women': avg_column}
    report_totals = {'men': sum_column, 'women': sum_column}
    override_field_formats = {
        'men': men_format,
        'women': women_format,
    }
    override_field_labels = {
        'men': men_label,
    }
    list_serie_fields = (
        'men',
        'women',
    )


reports.register('population-report', PopulationReport)


def browser__name_label(report, field):
    return _("[Browser] Name")


def os__name_label(report, field):
    return _("[OS] Name")


class BrowserDownloadReport(ReportAdmin):
    model = BrowserDownload
    fields = [
        'download_date',
        'browser__name',
Ejemplo n.º 20
0
        'women': avg_column
    }
    report_totals = {
        'men': sum_column,
        'women': sum_column
    }
    override_field_formats = {
        'men': men_format,
        'women': women_format,
    }
    override_field_labels = {
        'men': men_label,
    }


reports.register('population-report', PopulationReport)


def browser__name_label(report, field):
    return _("[Browser] Name")


def os__name_label(report, field):
    return _("[OS] Name")


class BrowserDownloadReport(ReportAdmin):
    model = BrowserDownload
    fields = [
        'download_date',
        'browser__name',
Ejemplo n.º 21
0
        list_filter = ('date_of_record',)

	type = 'chart'
        
	group_totals = {
        #'department__name':count_column,
	
	}
	report_totals = {
        
        
    }
	override_field_formats = {
        
    }
	
        override_field_labels = {
        
         }

	chart_types = ('pie', 'column', 'line')


reports.register('all-Members-Report',Members_Report)
reports.register('all-visitors-Report',Visitors_Report)
reports.register('all-attendence-Report',Attendance_Report)




Ejemplo n.º 22
0
from model_report.report import reports, ReportAdmin
from apps.producto.models import Marca

class AnyModelReport(ReportAdmin):
 
    model = Marca
    fields = [
        'nombre',
    ]
    list_order_by = ('nombre',)
    type = 'report'

reports.register('anymodel-report', AnyModelReport)
Ejemplo n.º 23
0
    #     ('effective_duration', Avg),
    #     ('billsec', Sum),
    #     ('total_cost', Sum),
    #     ('total_sell', Sum),
    # )
    # aggregate = (
    #     ('id', Count, 'Nb Calls'),
    #     ('effective_duration', Sum),
    #     ('effective_duration', Avg),
    #     ('billsec', Sum),
    #     ('total_cost', Sum),
    #     ('total_sell', Sum),
    # )
    # group_by = [
    #     'customer__name',
    #     ('customer__name', 'sell_destination'),
    #     'sell_destination',
    #     'lcr_carrier_id__name',
    #     ('lcr_carrier_id__name', 'cost_destination'),
    #     'cost_destination',
    # ]
    # list_filter = [
    #     'sell_destination',
    #     'lcr_carrier_id__name',
    # ]

    # date_hierarchy = 'start_stamp'


reports.register('CDR-report', CDRReport)
Ejemplo n.º 24
0
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
from vehicles.models import Vehicles

from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column,
                                count_column)


class VehiclesReport(ReportAdmin):
    title = _('Vehicles Report')
    model = Vehicles
    fields = [
        'driver_name',
        'max_gross',
        'use_stored_tare',
    ]
    type = 'report'


reports.register('vehicles-report', VehiclesReport)
Ejemplo n.º 25
0
        'self.price',
        'self.paid',
        'self.balance',
    ]

    override_field_labels = {
        'id': _('ID'),
        'type__name': _('Type'),
        'profession__name': _('Profession'),
        'sponsor__name': _('Sponsor'),
        'self.price': _('Price'),
        'self.paid': _('Paid'),
        'self.balance': _('Balance'),
    }
    override_field_formats = {
        'extra': yesno_format,
        'main': yesno_format,
        'sponsored': yesno_format,
    }
    list_order_by = ('first_name', 'last_name')
    list_filter = ('id', 'event', 'country', 'profession', 'date_joined')
    exclude = {'field': 'is_staff', 'value': True}
    selectable_fields = True

    type = 'report'


reports.register('attendee-report', AttendeeReport)
reports.register('accounting-report', AccountingReport)
reports.register('payment-report', PaymentReport)
Ejemplo n.º 26
0
		'datahorafim',
		'ativo',
	]

	override_field_labels = {
    	'local_id': lambda x, y: ('Local'),
		'equipamento_id': lambda x, y: ('Equipamento'),
		'funcionario_id': lambda x, y: ('Funcionario'),
		'datahorainicio': lambda x, y: ('Inicio do aluguel'),
		'datahorafim': lambda x, y: ('Fim do aluguel'),
		'ativo': lambda x, y: ('Permanece alugado'),
	}
	override_field_formats = {
        'datahorafim': date_format,
		'datahorainicio': date_format,
		'ativo': yesno_format,
    }
	title = ('Relatorio de Alugueis')
	list_filter = ('funcionario_id','equipamento_id',)
	list_order_by = ('datahorainicio',)
	list_filter_queryset = {
        'local_id': {'groups__in': [1, 5]},
    }
	list_serie_fields = ('equipamento_id','ativo')
	type = 'report'

	chart_types = ('pie', 'column', 'line')


reports.register('aluguel-report', AluguelReport)
Ejemplo n.º 27
0
        'nationality_ar',
        'position_en',
        'position_ar',
        'ethnicity_en',
        'ethnicity_ar',
        'religion_en',
        'religion_ar',
        'spoken_dialect_en',
        'spoken_dialect_ar',
        'origin_id',
        'age_numeric',
        'family_name_en',
        'family_name_ar',
        'national_id_card',
        'national_number',
        'legal_status_en',
        'legal_status_ar',
        'health_status_en',
        'health_status_ar',
        'family_status_en',
        'family_status_ar',
        'cause_of_death_en',
        'cause_of_death_ar',
        'POB',
        'current_location',
    ]
    list_order_by = ('actor_modified',)
    type = 'report'

reports.register('actor-report', ActorModelReport)
Ejemplo n.º 28
0
    title = 'Muestras de tiempo' 
    model =  Ruta_Operacional
    fields = [
    'Nombre_producto__Nombre_Producto',
    'Actividad__Actividad',
    'Tiempo_Estandard',
    'Maquina__NombreRecurso',
    'Tiempo_Lote',
    'Recurso_humano'


    ]
    list_order_by =('Nombre_producto__Nombre_Producto','Actividad__Actividad')
    list_filter =('Nombre_producto__Nombre_Producto')

reports.register('MuestrasTiempo', MuestrasDeTiempo)



class ReporteGeneral(ReportAdmin):
    title = "Reporte General"
    model = Producto_Referencia
    fields = [
        'Nombre_Producto',
        'Tipo_De_Dia__Tipo_De_Dia__Jornada', 
        'Total_jornada',
        'Lote_A_Fabricar',
        'Eficiencia',
        'Tiempo_Total_lote',
        'Total_Recurso_humano',
        'Total_Recurso_por_actividad',
Ejemplo n.º 29
0
from .models import Restaurant
from model_report.report import reports, ReportAdmin

class RestaurantReport(ReportAdmin):
    title = _('Restaurant Report Name')
    model = Restaurant
    fields = [
        'anymodelfield',
    ]
    list_order_by = ('anymodelfield',)
    type = 'report'

reports.register('anymodel-report', Restaurant)
Ejemplo n.º 30
0
from models import Inventaris
from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column, count_column)

class InventarisReport(ReportAdmin):
    title=("Laporan Inventaris")
    model =Inventaris
    fields = [
        'tgl_pembelian',
        'nama_inventaris',
        'kategori_inventaris','harga_pembelian',
        'lama_penyusutan','periode','penyusutan_perbulan',
        'kumulatif_penyusutan','sisa_nilai',
    ]
    list_filter = ('tgl_pembelian',)
    list_group_by = ('nama_inventaris')
    report_totals = {
        'harga_pembelian': sum_column,
        'penyusutan_perbulan': sum_column,
        'kumulatif_penyusutan':sum_column,
        'sisa_nilai':sum_column,
    }

    type = 'report'
reports.register('Laporan-Inventaris', InventarisReport)
Ejemplo n.º 31
0
        'position_en',
        'position_ar',
        'ethnicity_en',
        'ethnicity_ar',
        'religion_en',
        'religion_ar',
        'spoken_dialect_en',
        'spoken_dialect_ar',
        'origin_id',
        'age_numeric',
        'family_name_en',
        'family_name_ar',
        'national_id_card',
        'national_number',
        'legal_status_en',
        'legal_status_ar',
        'health_status_en',
        'health_status_ar',
        'family_status_en',
        'family_status_ar',
        'cause_of_death_en',
        'cause_of_death_ar',
        'POB',
        'current_location',
    ]
    list_order_by = ('actor_modified', )
    type = 'report'


reports.register('actor-report', ActorModelReport)
Ejemplo n.º 32
0
        'self.politician.get_fullname': lambda i, j: _(u'Político'),
        'party__name': lambda i, j: _(u'Partido'),
    }
    group_totals = {
        'diem': custom_sum_column,
        'report_refund': custom_sum_column,
        'report_rest': custom_sum_column,
        'total_trip': custom_sum_column,
    }
    override_field_formats = {
        'diem': custom_usd_format,
        'report_refund': custom_usd_format,
        'report_rest': custom_usd_format,
        'total_trip': custom_usd_format,
    }
    report_total = {
        'diem': custom_sum_column,
        'report_refund': custom_sum_column,
        'report_rest': custom_sum_column,
        'total_trip': custom_sum_column,
    }

    def get_grouper_text(self, value, field, model_field):
        try:
            return Politician.objects.get(politician_id=value).get_fullname
        except:
            return value


reports.register('viaticos', DiemReport)
Ejemplo n.º 33
0
                   'number_of_alternatives', 'matching_index')

    list_group_by = ('number_of_alternatives', 'matching_index')

    type = 'chart'

    chart_types = ('pie', 'column')

    report_totals = {
        'number_of_alternatives': count_column,
    }

    group_totals = {'number_of_alternatives': count_column}


reports.register('matching-report', MatchingLogReport)


def round_ngram_value(value):
    return round(value, 1)


def round_geo_distance_value(value):
    if isinstance(value, float):
        return round(value, 1)

    else:
        return 'None'


class MatchingPlacesLogReport(ReportAdmin):
Ejemplo n.º 34
0
#                                  "inversionfuente",
#                                  "tipofuente",
#                                  "fuente",
#                                  "asignado",
#                                  "ejecutado"
#                                  ],
#               "GastoDetalle":[
#                                  "gasto",
#                                  "codigo",
#                                  "tipogasto",
#                                  "subtipogasto",
#                                  "subsubtipogasto",
#                                  "cuenta",
#                                  "asignado",
#                                  "ejecutado"
#                                  ],
#               "IngresoDetalle":[
#                                  "ingreso",
#                                  "codigo",
#                                  "tipoingreso",
#                                  "subtipoingreso",
#                                  "subsubtipoingreso",
#                                  "cuenta",
#                                  "asignado",
#                                  "ejecutado"
#                                  ],
#               }
#     title = u'Detalle del Presupuesto'

reports.register('plan-de-inversion', PlanInversionModelReport)
Ejemplo n.º 35
0
from .models import Item, Category
from model_report.report import reports, ReportAdmin


class ItemsReport(ReportAdmin):
    title = ('Items report')
    model = Item
    fields = [
        'name',
        'cost',
    ]
    list_order_by = ('name', )
    type = 'report'


reports.register('items-report', ItemsReport)
Ejemplo n.º 36
0
class PopulationReport(ReportAdmin):
    model = Population
    fields = ["age", "men", "women", "self.total"]
    list_filter = ("age",)
    list_order_by = ("age",)
    list_group_by = ("age",)
    type = "report"
    group_totals = {"men": avg_column, "women": avg_column}
    report_totals = {"men": sum_column, "women": sum_column}
    override_field_formats = {"men": men_format, "women": women_format}
    override_field_labels = {"men": men_label}
    list_serie_fields = ("men", "women")


reports.register("population-report", PopulationReport)


def browser__name_label(report, field):
    return _("[Browser] Name")


def os__name_label(report, field):
    return _("[OS] Name")


class BrowserDownloadReport(ReportAdmin):
    model = BrowserDownload
    fields = ["download_date", "browser__name", "os__name", "username"]
    list_filter = ("browser__name", "os__name", "download_date")
    list_order_by = ("download_date",)
Ejemplo n.º 37
0
# -*- coding: utf-8 -*-
from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column, count_column)

from models import Marca


class ReporteMarcas(ReportAdmin):
    model = Marca
    fields = [
        'fec_mar',
        'tra_mar',
    ]
    list_group_by = ('fec_mar', 'tra_mar',)
    list_filter = ('trabajador',)
    type = 'report'
    override_field_labels = {
        'fec_mar': lambda x, y: ('fec_mar'),
    }

reports.register('Reporte-Marcas', ReporteMarcas)
        'percentage',
    ]
    list_group_by = (
        'date__year',
        'date__month',
    )
    list_filter = ('resolution', )
    type = 'report'
    override_field_labels = {
        'date__year': lambda x, y: _('Year'),
        'date__month': lambda x, y: _('Month'),
        'date__day': lambda x, y: _('Day'),
    }


reports.register('resolution-by-year-report', ResolutionByYearReport)


class OSReport(ReportAdmin):
    model = OS
    fields = [
        'company__name',
        'name',
    ]
    list_filter = ('company__name', )
    type = 'report'


reports.register('os-report', OSReport)

Ejemplo n.º 39
0
	model= Crew_detail
	fields = ['surname','othernames','sex','date_Of_birth','Nationality','rank__rank','no_of_identity','ship__ship_name','email']
	#list_order_by = ('surname',)
	list_group_by = ('rank__rank','sex','ship__ship_name',)
	list_serie_fields = ('rank__rank','ship__ship_name',)

	type = 'chart'

	group_totals = {
        'speciality': count_column,
	
	}

	chart_types = ('pie', 'column', 'line')

reports.register('all-Crew-report',Crew_Details_Report)





class Ship_Crew_Details_Report(ReportAdmin):
	title=('Ship Crew Details')
	model= Crew_detail
	fields = ['surname','othernames','sex','date_Of_birth','Nationality','rank__rank','no_of_identity','ship__ship_name']
	list_order_by = ('surname',)
	list_filter = ('ship__ship_name','rank__rank',)
	list_serie_fields = ('ship__ship_name','rank__rank',)
	type = 'report'
	report_totals = {
        
Ejemplo n.º 40
0
    
    # override field formats by referencing a function
    override_field_formats = {
        'create_dt': us_date_format,
        'object_type': obj_type_format,
        'id': id_format,
        'balance': currency_format,
        'total': currency_format,
        'payments_credits': currency_format
    }
    
    # override the label for a field by referencing a function
    override_field_labels = {
        'create_dt': date_label
    }
    
    group_totals = {
        'balance': sum_column,
        'total': sum_column,
        'payments_credits': sum_column
    }
    
    report_totals = {
        'balance': sum_column,
        'total': sum_column,
        'payments_credits': sum_column
    }

# register your report with the slug and name
reports.register('invoices', InvoiceReport)
Ejemplo n.º 41
0
    list_filter = ('transporter','customer','createdDate','cases','consignor','company','isDispatched','fnDate')
    type = 'report'
    override_field_labels = {
        'date__year': lambda x, y: _('Year'),
        'date__month': lambda x, y: _('Month'),
        'date__day': lambda x, y: _('Day'),
        'transporter__contactNumber':'Transporter Contact Number',
        'transporter__name':'Transporter Name',
        'transporter':'TransporterId',
        'company__name':'Company Name',
        'company':'CompanyId',
        'customer':'CustomerId',
        'customer__name':'Customer Name',
    }

reports.register('ForwardingNote', ForwardingNote)

import datetime
def forwardingNote__fnDate(value, instance):
    res = 'NA'
    if len(value)>0:
        res = value[0].strftime("%d-%m-%y")
    return _(res)

def forwardingNote__company__name(value, instance):
    res = 'NA'
    if len(value)>0:
        res = str(value[0]).title()
    return _(res)

Ejemplo n.º 42
0
from model_report.report import reports, ReportAdmin
from appointment import models


class AnyModelReport(ReportAdmin):
    title = _('Appointments')
    model = Request_appointment
    fields = [
        'ailment',
    ]
    list_order_by = ('date_created',)
    type = 'report'

reports.register('Appointments-report', AnyModelReport)
Ejemplo n.º 43
0
from model_report.report import reports, ReportAdmin
from model_report.utils import (usd_format, avg_column, sum_column,
                                count_column)


class OEEMChart(ReportAdmin):
    model = OEETiempo
    fields = [
        'fecha',
        'fecha__year',
        'fecha__month',
        'fecha__day',
        'tmperdido',
        'tpperdido',
    ]
    list_group_by = (
        'fecha__day',
        'date__month',
    )
    list_filter = ('maquina', )
    type = 'report'
    override_field_labels = {
        'fecha__year': lambda x, y: _('Year'),
        'fecha__month': lambda x, y: _('Month'),
        'fecha__day': lambda x, y: _('Day'),
    }


reports.register('oee-report', OEEMChart)
#admin.register('oee-report', OEEMChart)
Ejemplo n.º 44
0
# reporte para extraer Muestras de tiempo
class MuestrasDeTiempo(ReportAdmin):
    title = 'Muestras de tiempo'
    model = Ruta_Operacional
    fields = [
        'Nombre_producto__Nombre_Producto', 'Actividad__Actividad',
        'Tiempo_Estandard', 'Maquina__NombreRecurso', 'Tiempo_Lote',
        'Recurso_humano'
    ]
    list_order_by = ('Nombre_producto__Nombre_Producto',
                     'Actividad__Actividad')
    list_filter = ('Nombre_producto__Nombre_Producto')


reports.register('MuestrasTiempo', MuestrasDeTiempo)


class ReporteGeneral(ReportAdmin):
    title = "Reporte General"
    model = Producto_Referencia
    fields = [
        'Nombre_Producto',
        'Tipo_De_Dia__Tipo_De_Dia__Jornada',
        'Total_jornada',
        'Lote_A_Fabricar',
        'Eficiencia',
        'Tiempo_Total_lote',
        'Total_Recurso_humano',
        'Total_Recurso_por_actividad',
    ]
Ejemplo n.º 45
0
from .models import GuestFacultyCandidate
from model_report.report import reports, ReportAdmin


class GFCandidateReport(ReportAdmin):
    title = _('Guest Faculty Candidate Report')
    model = GuestFacultyCandidate
    fields = [
        'application_number', 'name', 'application_status',
        'application_submission_date', 'current_location_id'
    ]
    list_order_by = ('name', )
    type = 'report'


reports.register('GuestFacultyCandidate-report', GFCandidateReport)