This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| We use the code from this file to turn latex into pdf: | |
| https://github.com/MikeHungerford/thecontractbox/blob/production/thecontractbox/tools/make_pdf.py | |
| and here is an example of code that renders it: | |
| https://gist.github.com/acmisiti/5a3c5a8ae7a65923ea52 | |
| If you want full examples then you can look in documents/mixins.py EmployiiDocumentMixin. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from apps.staff.models import MHRBoxEmployee | |
| employee = MHRBoxEmployee.objects.get(id=uid) | |
| params = { | |
| 'employee' : employee, | |
| } | |
| # render the document with latex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kwargs = { | |
| 'type_of_agreement' : SERVICE_LEVEL, | |
| 'cid' : company.id, | |
| 'title' : 'Terms of Service', | |
| 'signature_is_required' : True, | |
| 'has_been_signed' : False | |
| } | |
| agreement = MAgreement.objects.create(**kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @login_required | |
| @json_view | |
| def api_generate_941_report(request): | |
| """ Generate 941 report """ | |
| params = {} | |
| params['success'] = True | |
| params['is_valid'] = True | |
| company_id = request.REQUEST.get("company_id") | |
| if company_id and request.user.is_superuser: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| that.options.employee.save({ | |
| payment_method : 'direct-deposit', | |
| payment_divide_type : that.payment_divide_type, | |
| },{ | |
| patch : true, | |
| success:function(model, response) { | |
| that.on_reset_page(); | |
| }, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.employee.save({ | |
| manager : that.$el.find('#manager').val(), | |
| title : that.$el.find('#title').val(), | |
| department : that.$el.find('#department').val(), | |
| }, {patch : true}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Staff model which creates resource uri and passes "'?type=consultant'" if is_consultant flag is true. | |
| TCB.Models.StaffModel = Backbone.Model.extend({ | |
| urlRoot : function(){ | |
| return '/m/api/v1/user/' + this.get('id') + '/'; | |
| }, | |
| url : function(){ | |
| if(this.get('is_consultant')){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TCB.Views.StaffProfileCompensation = Backbone.View.extend({ | |
| el: "#js-staff-profile-compensation", | |
| attributes : function(){ | |
| return {} | |
| }, | |
| initialize: function(){ | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function(){ | |
| $('input[type=submit]').on('click', function(e) { | |
| e.preventDefault(); | |
| $('.js-row-import').each(function(){ | |
| var $t = $(this); | |
| console.log($t.val()) | |
| }); |
NewerOlder