Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Feature/download templates #290

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 113 additions & 4 deletions ulakbus/diagrams/bap_satin_alma_islemleri.bpmn
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.0">
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.8.2">
<bpmn:collaboration id="Collaboration_0a8mqal">
<bpmn:documentation>Bütçe Kalemi Seç</bpmn:documentation>
<bpmn:participant id="satin_alma_islemleri" name="BAP Satın Alma İşlemleri" processRef="bap_satin_alma_islemleri" />
</bpmn:collaboration>
<bpmn:process id="bap_satin_alma_islemleri" name="BAP Satın Alma İşlemleri" isExecutable="false">
Expand All @@ -21,6 +22,7 @@
<bpmn:incoming>SequenceFlow_0he8yzo</bpmn:incoming>
<bpmn:incoming>SequenceFlow_10vwch2</bpmn:incoming>
<bpmn:incoming>SequenceFlow_13vpeco</bpmn:incoming>
<bpmn:incoming>SequenceFlow_0pwlicm</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_14v8dxy</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="ExclusiveGateway_1dexsxe">
Expand Down Expand Up @@ -180,6 +182,7 @@
<bpmn:outgoing>SequenceFlow_0y8eudw</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_1kr1ya9</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_13l5qx4</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_0eiwiku</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_13l5qx4" sourceRef="ExclusiveGateway_02vx8n2" targetRef="TeklifeKapat">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[cmd == "teklife_kapat"]]></bpmn:conditionExpression>
Expand All @@ -204,6 +207,7 @@
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="ExclusiveGateway_06z2heg">
<bpmn:incoming>SequenceFlow_0wb428y</bpmn:incoming>
<bpmn:incoming>SequenceFlow_0svy1ih</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0hedib2</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_10vwch2</bpmn:outgoing>
</bpmn:exclusiveGateway>
Expand All @@ -230,11 +234,45 @@
<bpmn:outgoing>SequenceFlow_06cd6wz</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_13vpeco</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_0eiwiku" sourceRef="ExclusiveGateway_02vx8n2" targetRef="Task_15s0nfs">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[cmd=='template_sec']]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:userTask id="Task_15s0nfs" name="Oluşturulacak Belgeyi Seç" camunda:assignee="bap.bap_satin_alma_islemleri.TeklifDegerlendirme.template_sec">
<bpmn:incoming>SequenceFlow_0eiwiku</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1voaykx</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="ExclusiveGateway_1nmyid1">
<bpmn:incoming>SequenceFlow_1voaykx</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0jonedk</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_0svy1ih</bpmn:outgoing>
<bpmn:outgoing>SequenceFlow_1s8km8k</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="SequenceFlow_1voaykx" sourceRef="Task_15s0nfs" targetRef="ExclusiveGateway_1nmyid1" />
<bpmn:sequenceFlow id="SequenceFlow_0jonedk" sourceRef="ExclusiveGateway_1nmyid1" targetRef="Task_0vxdp66">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[cmd=='template_indir']]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0svy1ih" sourceRef="ExclusiveGateway_1nmyid1" targetRef="ExclusiveGateway_06z2heg">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[cmd=='geri_don']]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0pwlicm" sourceRef="Task_0vxdp66" targetRef="SatinAlmaDuyurulariniListele" />
<bpmn:sequenceFlow id="SequenceFlow_1s8km8k" sourceRef="ExclusiveGateway_1nmyid1" targetRef="Task_0j3dbvm">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression"><![CDATA[TemplateSecForm['belge'] == 'siparis_formu']]></bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:userTask id="Task_0vxdp66" name="Template İndir" camunda:assignee="bap.bap_satin_alma_islemleri.TeklifDegerlendirme.template_indir">
<bpmn:incoming>SequenceFlow_0jonedk</bpmn:incoming>
<bpmn:incoming>SequenceFlow_18voapg</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0pwlicm</bpmn:outgoing>
</bpmn:userTask>
<bpmn:sequenceFlow id="SequenceFlow_18voapg" sourceRef="Task_0j3dbvm" targetRef="Task_0vxdp66" />
<bpmn:userTask id="Task_0j3dbvm" name="Bütçe Kalemi Seç" camunda:assignee="bap.bap_satin_alma_islemleri.TeklifDegerlendirme.butce_kalemi_sec">
<bpmn:incoming>SequenceFlow_1s8km8k</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_18voapg</bpmn:outgoing>
</bpmn:userTask>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0a8mqal">
<bpmndi:BPMNShape id="Participant_0oo115r_di" bpmnElement="satin_alma_islemleri">
<dc:Bounds x="-250" y="-153" width="1372" height="931" />
<dc:Bounds x="-250" y="-153" width="1372" height="995" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="-72" y="104" width="36" height="36" />
Expand Down Expand Up @@ -580,10 +618,11 @@
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0kvqhlc_di" bpmnElement="SequenceFlow_0kvqhlc">
<di:waypoint xsi:type="dc:Point" x="102" y="662" />
<di:waypoint xsi:type="dc:Point" x="-60" y="662" />
<di:waypoint xsi:type="dc:Point" x="-34" y="662" />
<di:waypoint xsi:type="dc:Point" x="-34" y="152" />
<di:waypoint xsi:type="dc:Point" x="-8" y="122" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-24" y="640.5" width="90" height="13" />
<dc:Bounds x="-64" y="400.5" width="90" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0wwaycd_di" bpmnElement="SequenceFlow_0wwaycd">
Expand Down Expand Up @@ -657,6 +696,76 @@
<dc:Bounds x="77" y="359.5" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0eiwiku_di" bpmnElement="SequenceFlow_0eiwiku">
<di:waypoint xsi:type="dc:Point" x="161" y="137" />
<di:waypoint xsi:type="dc:Point" x="263" y="292" />
<di:waypoint xsi:type="dc:Point" x="263" y="662" />
<di:waypoint xsi:type="dc:Point" x="306" y="662" />
<bpmndi:BPMNLabel>
<dc:Bounds x="278" y="470.5" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1i6w8kx_di" bpmnElement="Task_15s0nfs">
<dc:Bounds x="306" y="622" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_1nmyid1_di" bpmnElement="ExclusiveGateway_1nmyid1" isMarkerVisible="true">
<dc:Bounds x="456.449494949495" y="637" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="481.449494949495" y="690" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1voaykx_di" bpmnElement="SequenceFlow_1voaykx">
<di:waypoint xsi:type="dc:Point" x="406" y="662" />
<di:waypoint xsi:type="dc:Point" x="456" y="662" />
<bpmndi:BPMNLabel>
<dc:Bounds x="431" y="640" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0jonedk_di" bpmnElement="SequenceFlow_0jonedk">
<di:waypoint xsi:type="dc:Point" x="481" y="687" />
<di:waypoint xsi:type="dc:Point" x="481" y="719" />
<bpmndi:BPMNLabel>
<dc:Bounds x="451" y="696.5" width="90" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0svy1ih_di" bpmnElement="SequenceFlow_0svy1ih">
<di:waypoint xsi:type="dc:Point" x="481" y="637" />
<di:waypoint xsi:type="dc:Point" x="481" y="437" />
<di:waypoint xsi:type="dc:Point" x="381" y="437" />
<bpmndi:BPMNLabel>
<dc:Bounds x="496" y="530" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0pwlicm_di" bpmnElement="SequenceFlow_0pwlicm">
<di:waypoint xsi:type="dc:Point" x="431" y="759" />
<di:waypoint xsi:type="dc:Point" x="-58" y="759" />
<di:waypoint xsi:type="dc:Point" x="-58" y="189" />
<di:waypoint xsi:type="dc:Point" x="-5" y="154" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-88" y="467.5" width="90" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_03x76hj_di" bpmnElement="Task_0vxdp66">
<dc:Bounds x="431" y="719" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1s8km8k_di" bpmnElement="SequenceFlow_1s8km8k">
<di:waypoint xsi:type="dc:Point" x="506" y="662" />
<di:waypoint xsi:type="dc:Point" x="557" y="662" />
<bpmndi:BPMNLabel>
<dc:Bounds x="531.5" y="640.5" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1p2al91_di" bpmnElement="Task_0j3dbvm">
<dc:Bounds x="557" y="622" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_18voapg_di" bpmnElement="SequenceFlow_18voapg">
<di:waypoint xsi:type="dc:Point" x="607" y="702" />
<di:waypoint xsi:type="dc:Point" x="607" y="759" />
<di:waypoint xsi:type="dc:Point" x="531" y="759" />
<bpmndi:BPMNLabel>
<dc:Bounds x="622" y="724" width="0" height="13" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
15 changes: 15 additions & 0 deletions ulakbus/lib/doc_render/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.

from .bap_komisyon_toplanti_tutanagi import *
from .bap_muayene_ve_kabul_komisyon_tutanagi import *
from .bap_sozlesme import *
from .dogrudan_tek_kaynak import *
from .mal_ve_hizmet_alimlari_onay_belgesi import *
from .muayene_gorevlendirmesi import *
from .piyasa_fiyat_arastirmasi_tutanagi import *
from .siparis_formu import *
from .tasinir_islem_fisi import *
Binary file not shown.
34 changes: 34 additions & 0 deletions ulakbus/lib/doc_render/bap_komisyon_toplanti_tutanagi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.

from ulakbus.lib.document import RenderDocument


def bap_komisyon_toplanti_tutanagi_uret(context_data, wants_pdf=False):
"""
BAP Komisyon toplantı tutanağı şablonu için kullanılabilir değişkenler:

-> karar_tarihi
-> oturum_no
-> karar_no
-> kararlar : <list> Karar metinleri liste halinde buraya gelir.
-> baskan : Toplantı başkanı adı
-> bap_koordinatoru : BAP Koordinatörü adı
-> uyeler : <list> Toplamda 5 toplantı üyesi olmalı. 5 Zorunlu.


Args:
context_data (dict):
wants_pdf (Bool):
Returns:
str: URL
"""
template = "bap_komisyon_toplanti_tutanagi.odt"
rd = RenderDocument(template_name=template,
context=context_data,
wants_pdf=wants_pdf)
return rd.doc_url
Binary file not shown.
54 changes: 54 additions & 0 deletions ulakbus/lib/doc_render/bap_muayene_ve_kabul_komisyon_tutanagi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.

from ulakbus.lib.document import RenderDocument

def bap_muayene_ve_kabul_komisyonu_tutanagi_uret(context_data, wants_pdf=False):
"""
BAP muayene ve kabul komisyonu tutanağı şablonu.

Template içerisinde kullanabileceğiniz değişkenler:

-> i_f_no : Tutanağın sağ üst köşesinde yer alan numara bilgisi.
-> nereden_geldigi : Taşnırın nereden geldiği.
-> dayandigi_belge_tarihi :
-> dayandigi_belge_sayisi :
-> muayene_kabul_komisyonu_tutanagi_tarihi: Belgenin oluşma tarihi.

-> tasinirlar:
### Aşağıdaki niteliklere sahip, dict veya object gönderilmeli.
--> miktari :
--> birimi :
--> adi_ve_ozellikleri :

-> tasinir_sayisi : Toplam taşınır sayısı. Yani kaç kalem taşınır girildi.
-> baskan:
### Aşağıdaki niteliklere sahip, dict veya object gönderilmeli.
--> adi : Başkanın adı, Someone.
--> unvan : Başkanın ünvanı, Proje Yürütücüsü, Öğretim Görevlisi vs.
-> uye1 :
### Aşağıdaki niteliklere sahip, dict veya object gönderilmeli.
--> adi : Üyenin adı
--> unvan : Ünvanı
-> uye2 :
### Aşağıdaki niteliklere sahip, dict veya object gönderilmeli.
--> adi : Üye adı.
--> unvan : Üyenin ünvanı.

Args:
context_data (dict) : Context variables for template engine.
wants_pdf (Bool) : If client wants the output as PDF, pass True.

Returns:
str : URL of rendered document.

"""
template = "bap_muayene_ve_kabul_komisyon_tutanagi.odt"
rd = RenderDocument(template_name=template,
context=context_data,
wants_pdf=wants_pdf)
return rd.doc_url
Binary file added ulakbus/lib/doc_render/bap_sozlesme.odt
Binary file not shown.
45 changes: 45 additions & 0 deletions ulakbus/lib/doc_render/bap_sozlesme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.

from ulakbus.lib.document import RenderDocument


def bap_sozlesme_uret(context_data, wants_pdf=False):
"""
BAP Sözleşme Şablonu

Şablon içinde kullanabileceğiniz değişkenler:
-> proje_no : BAP proje numarası
-> proje_basligi : BAP proje başlığı
-> proje_yurutucusu : BAP proje yürütücüsü (x2 in Template)
-> proje_butcesi : BAP proje bütçesi
-> toplam_destek_tutari : Verilecek desteğin toplam değeri (TL)
-> sozlesme_imza_tarihi : Sözleşmenin imzalanma tarihi (x2 in Template)
-> bap_komisyon_baskani : BAP komisyon başkanının adı.
-> tuketim_malzemeleri : Proje için gerekecek olan malzemelerin listesi.
### Aşağıdaki attributelara sahip bir dict veya object olmalı.
--> yil : Malzeme yılı
--> tur : Malzeme türü
--> gerekce : Malzeme kullanımı için gerekçe.
--> miktar : Malzemenin ne kadar olacağı.
--> birim_fiyat : Malzemenin birim fiyatı.
--> toplam_tutar : Malzemenin `miktar`ı ile `birim_fiyat`ının çarpımı.

Args:
context_data (dict): Template içinde kullanılacak olan değişkenler.
wants_pdf (Bool) : Output olarak PDF isteniyorsa, True olmalı.

Returns:
str: Üretilmiş olan dökümanın, URL adresi.

"""

template = "bap_sozlesme.odt"
rd = RenderDocument(template_name=template,
context=context_data,
wants_pdf=wants_pdf)
return rd.doc_url
Binary file added ulakbus/lib/doc_render/dogrudan_tek_kaynak.odt
Binary file not shown.
49 changes: 49 additions & 0 deletions ulakbus/lib/doc_render/dogrudan_tek_kaynak.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3). See LICENSE.txt for details.

from ulakbus.lib.document import RenderDocument


def dogrudan_tek_kaynak_uret(context_data, wants_pdf=False):
"""
Doğrudan tek kaynak template.

Kullanılabilir değişkenler :
-> idare : Hangi daire hazırlıyor, BAP vs.
-> alim_yapan_birim :

-> ongorulen_teslim_zamani :
-> ongorulen_yaklasik_bedel:
-> satici_unvan :
-> satici_tebligat_adresi :

-> satici_vergi_dairesi_ve_numarasi:
-> satici_telefon_ve_faks_numarasi :
-> satici_eposta_adresi :
-> satici_ilgili_kisi :

-> ihtiyac_konusu_malin_nitelikleri:
-> alimin_hangi_kapsamda_yapildigi :

-> alim_maddesi : Alım maddesi, 21-a,b,c bendine göre bir işeretleme şeklidir.
Applied filters on alim_maddesi : string(), lower() (a, b, c)
Örnek : a,b,c,A,B,C,"a" vs.
-> ihale_yetkilisi :
### Aşağıdaki attributelara sahip bir dict veya object olmalı.
-> ad :
-> gorev :
Args:
context_data (dict):
wants_pdf (bool):
Returns:
str: URL
"""
template = "dogrudan_tek_kaynak.odt"
rd = RenderDocument(template_name=template,
context=context_data,
wants_pdf=wants_pdf)
return rd.doc_url
Binary file not shown.
Loading