Esempio n. 1
0
    def ImprCompLtxPre(self, os, tit, otra, tit_otra):
        if size():
            doc.append(pylatex_utils.ltx_tiny + '\n')
            doc.append(pylatex_utils.ltx_begin("longtable}{lrlrr|lrlrr") + '\n'
               + "\\multicolumn{5}{c|}{\\normalsize\\textbf{Proyecto de construcción}\\tiny} &"
               + "\\multicolumn{5}{c}{\\normalsize\\textbf{Proyecto modificado}\\tiny} \\\\"
               + '\n' + pylatex_utils.ltx_hline + '\n'
               + "Partida & Cantidad & Descripción & \\multicolumn{1}{p{1.5cm}}{P. unitario} & Importe & Partida & Cantidad & Descripción & \\multicolumn{1}{p{1.5cm}}{P. unitario} & Importe \\\\" + '\n'
               + pylatex_utils.ltx_hline + '\n'
               + pylatex_utils.ltx_endhead + '\n'
               + "\\multicolumn{10}{r}{../..}\\\\" + '\n'
               + pylatex_utils.ltx_endfoot + '\n'
               + pylatex_utils.ltx_endlastfoot + '\n')
            for i in self:
                 cod= (i).getUnitPriceCode()
                 for j in otra:
                     if(cod == (j).getUnitPriceCode()): break
                 if(j!=otra.end()): #Found it!
                     (i).ImprCompLtxPre(os,*(j))
                 else:
                     (i).ImprCompLtxPre(os)

            doc.append("\\multicolumn{4}{p{8cm}}{\\textbf{Total: "
               + tit_otra + "}} & \\textbf{" + otra.getLtxPriceString() + "} & " + '\n')
            doc.append("\\multicolumn{4}{p{8cm}}{\\textbf{Total: "
               + tit + "}} & \\textbf{" + getLtxPriceString() + "}\\\\" + '\n')
            doc.append("\\end{longtable}" + '\n')
            doc.append(pylatex_utils.NormalSizeCommand())
Esempio n. 2
0
    def writePriceTableOneIntoLatexDocument(self, doc):
        if (len(self) >= 1):
            num_campos = 5
            doc.append(pylatex_utils.SmallCommand())
            longTableStr = '|l|l|p{4cm}|p{3cm}|r|'
            headerRow1 = [
                u'Código', 'Ud.', u'Denominación',
                (pylatex.table.MultiColumn(2, align='|c|', data='Precio'))
            ]
            headerRow2 = ['', '', '', 'en letra', 'en cifra']
            with doc.create(
                    pylatex_utils.LongTable(longTableStr)) as data_table:
                data_table.add_hline()
                data_table.add_row(headerRow1)
                data_table.add_row(headerRow2)
                data_table.add_hline()
                data_table.end_table_header()
                data_table.add_hline()
                data_table.add_row((pylatex.table.MultiColumn(num_campos,
                                                              align='|r|',
                                                              data='../..'), ))
                data_table.add_hline()
                data_table.end_table_footer()
                data_table.add_hline()
                data_table.end_table_last_footer()
                for j in self.map.keys():
                    data_table.add_empty_row()
                    self.map[j].writePriceTableOneIntoLatexDocument(data_table)
                    data_table.add_empty_row()

            doc.append(pylatex_utils.NormalSizeCommand())
Esempio n. 3
0
 def writePriceJustification(self, doc):
     if (len(self) > 0):
         doc.append(pylatex_utils.SmallCommand())
         longTableStr = 'l'
         with doc.create(
                 pylatex_utils.LongTable(longTableStr)) as data_table:
             for j in self.map.keys():
                 self.map[j].writePriceJustification(data_table)
         doc.append(pylatex_utils.NormalSizeCommand())
Esempio n. 4
0
 def writePriceTableTwoIntoLatexDocument(self, doc):
     if (len(self) > 0):
         #doc.append(pylatex_utils.ltx_star_.chapter("Cuadro de precios no. 2") + '\n'
         doc.append(pylatex_utils.SmallCommand())
         longTableStr = 'l'
         with doc.create(
                 pylatex_utils.LongTable(longTableStr)) as data_table:
             for j in self.map.keys():
                 self.map[j].writePriceTableTwoIntoLatexDocument(data_table)
         doc.append(pylatex_utils.NormalSizeCommand())
Esempio n. 5
0
 def ImprLtxResumen(self, doc, sect, recurre=True):
     if (self.hasQuantities()):
         if (sect != 'root'):
             doc.add_item(self.getTitle())
             doc.append(pylatex.Command('dotfill'))
             doc.append(self.getLtxPriceString())
         else:
             doc.append(pylatex_utils.LargeCommand())
             doc.append(pylatex.utils.bold('Total'))
             doc.append(pylatex.Command('dotfill'))
             doc.append(pylatex.utils.bold(self.getLtxPriceString()))
             doc.append(pylatex_utils.NormalSizeCommand())
         if (recurre):
             self.subcapitulos.ImprLtxResumen(
                 doc, pylatex_utils.getLatexSection(sect), recurre)
Esempio n. 6
0
 def ImprLtxPre(self, doc, sect):
     '''Imprime presupuestos parciales.'''
     if (self.hasQuantities()):
         if (sect != 'root'):
             doc.append(pylatex.Section(self.getTitle()))
         self.quantities.ImprLtxPre(doc, self.getTitle())
         self.subcapitulos.ImprLtxPre(doc,
                                      pylatex_utils.getLatexSection(sect))
         if self.subcapitulos:
             doc.append(pylatex.Command('noindent'))
             doc.append(pylatex_utils.largeCommand())
             doc.append(
                 pylatex.utils.bold('Total: ' + self.getTitle() + ' '))
             doc.append(pylatex.Command('dotfill'))
             doc.append(pylatex.utils.bold(self.getLtxPriceString()))
             doc.append(pylatex.NewLine())
             doc.append(pylatex_utils.NormalSizeCommand())
Esempio n. 7
0
 def ImprCompLtxMed(self, os, otra):
     if len(self):
         doc.append(pylatex_utils.ltx_tiny + '\n')
         doc.append(pylatex_utils.ltx_begin("longtable}{lrrrrr|lrrrrr") + '\n'
            + "\\multicolumn{6}{c|}{\\normalsize\\textbf{Proyecto de construcción}\\tiny} &"
            + "\\multicolumn{6}{c}{\\normalsize\\textbf{Proyecto modificado}\\tiny} \\\\"
            + '\n' + pylatex_utils.ltx_hline + '\n'
            + pylatex_utils.ltx_endhead + '\n'
            + "\\multicolumn{12}{r}{../..}\\\\" + '\n'
            + pylatex_utils.ltx_endfoot + '\n'
            + pylatex_utils.ltx_endlastfoot + '\n')
         for i in self:
              cod= (i).getUnitPriceCode()
              for j in otra:
                 if(cod == (j).getUnitPriceCode()): break
                 if(j!=otra.end()): #Found it!
                     (i).ImprCompLtxMed(os,*(j))
                 else:
                     (i).ImprCompLtxMed(os)
         doc.append("\\end{longtable}" + '\n')
         doc.append(pylatex_utils.NormalSizeCommand())
Esempio n. 8
0
 def ImprLtxPre(self, doc, tit):
     '''Imprime presupuestos parciales.'''
     if len(self):
         doc.append(pylatex_utils.SmallCommand())
         num_campos= 5
         longTableStr= 'lrlrr'
         header_row= ['Partida','Cantidad',u'Descripción']
         header_row.append(pylatex.table.MultiColumn(1, align=pylatex.utils.NoEscape('p{1.5cm}'),data='Precio unitario'))
         header_row.append('Importe')
                                         
         with doc.create(pylatex_utils.LongTable(longTableStr)) as data_table:
             data_table.add_row(header_row)
             data_table.add_hline()
             data_table.end_table_header()
             data_table.add_row((pylatex.table.MultiColumn(num_campos, align='r',data='../..'),))
             data_table.end_table_footer()
             data_table.end_table_last_footer()
             for i in self:
                 (i).ImprLtxPre(data_table)
             data_table.add_row([pylatex.table.MultiColumn(4, align=pylatex.utils.NoEscape('p{8cm}'),data=pylatex.utils.bold('Total: '+tit)),pylatex.utils.bold(self.getLtxPriceString())])
         doc.append(pylatex_utils.NormalSizeCommand())