Parcourir la source

added get_parts func

marton levente il y a 1 an
Parent
commit
bd1aea2e44
1 fichiers modifiés avec 16 ajouts et 2 suppressions
  1. 16 2
      winmentor/dbread.py

+ 16 - 2
winmentor/dbread.py

@@ -355,8 +355,22 @@ class WinMentor(object):
             return 'Client'
         elif row.loc['Simbol_x'] in adv_clients:
             return 'Avans client'
-        
-        
+
+    def _get_parts(self, short_name):
+        firm_list = self.filtered_firmlist(None)
+        nparts_headres = ['Cod', 'Denumire', 'CodFiscal']
+        for firm in firm_list:
+            if firm[6] == short_name:
+                short_path = self.winment_path + short_name
+                # update files
+                nparts_db = self.update_copy(short_path + '/NPART.DB')
+                # convert dbs to dfs
+                dbtodf_parts = Dbtodf(nparts_db, *nparts_headres)
+                # actual converting
+                parts_dict = dbtodf_parts.convert_parts()
+                # self._oblig_sheet_name = firm[0]
+        return parts_dict
+
     def _get_oblig(self, short_name, db_file='/ObligPI.DB'):
         firm_list = self.filtered_firmlist(None)
         oblig_headers = ['Part', 'TipDoc', 'Cont', 'Doc', 'Moneda', 'Curs', 'NrDoc', 'DataDoc', 'Valoare', 'Rest']