bla
This commit is contained in:
186
reporting.ipynb
186
reporting.ipynb
@@ -141,7 +141,11 @@
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "a993570d-dea2-4bd6-80c0-b36297ce6a3a",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#Beispiel\n",
|
||||
@@ -1123,7 +1127,8 @@
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
}
|
||||
},
|
||||
"scrolled": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -1140,11 +1145,15 @@
|
||||
" \n",
|
||||
" logs = neo.Log.Activity.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
" location = log.location\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Activity:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\") \n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"location: {location[0].name}\")\n",
|
||||
" \n",
|
||||
" \t\n",
|
||||
" \n",
|
||||
@@ -1152,35 +1161,31 @@
|
||||
" \n",
|
||||
" logs = neo.Log.Maintenance.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Maintenance:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\") \n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"plant_crop: {plant.crop}\")\n",
|
||||
" print(f\"plant_season: {plant.season}\")\n",
|
||||
"\n",
|
||||
"#quantity\n",
|
||||
" input=neo.Log.Maintenance.from_id(log.id)\n",
|
||||
" print(f\"quant_type: {input.quantities[0].type}\")\n",
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"unit_name: {input.quantities[0].units.name}\")\n",
|
||||
" print (f\"unit_price_1: = {input.quantities[0].unit_price}\")\n",
|
||||
" print (f\"unit_price_1: = {input.quantities[0].total_price}\")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"#log Purchase\n",
|
||||
"\n",
|
||||
"#Log Purchase\n",
|
||||
" logs = neo.Log.Purchase.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Purchase:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\") \n",
|
||||
" \n",
|
||||
" #quantity\n",
|
||||
@@ -1189,8 +1194,8 @@
|
||||
" print(f\"quant0_type: {input.quantities[0].type}\")\n",
|
||||
" print(f\"quant0_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant0_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant0_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print(f\"unit0_name: {input.quantities[0].units.name}\")\n",
|
||||
" print(f\"quant0_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print (f\"unit0_price_1: = {input.quantities[0].unit_price}\")\n",
|
||||
" print (f\"unit0_price_1: = {input.quantities[0].total_price}\")\n",
|
||||
" print (f\"inventory_asset1: = {input.quantities[0].inventory_asset.name}\")\n",
|
||||
@@ -1206,58 +1211,95 @@
|
||||
" print(f\"quant2_type: {input.quantities[2].type}\") \n",
|
||||
" print(f\"quant2_measure: {input.quantities[2].measure}\")\n",
|
||||
" print(f\"quant2_value: {input.quantities[2].value}\") \n",
|
||||
" \n",
|
||||
"\n",
|
||||
" print(f\"quant3_type: {input.quantities[3].type}\") \n",
|
||||
" print(f\"quant3_measure: {input.quantities[3].measure}\")\n",
|
||||
" print(f\"quant3_value: {input.quantities[3].value}\") \n",
|
||||
"\n",
|
||||
" print(f\"quant4_type: {input.quantities[4].type}\") \n",
|
||||
" print(f\"quant4_measure: {input.quantities[4].measure}\")\n",
|
||||
" print(f\"quant4_value: {input.quantities[4].value}\") \n",
|
||||
"\n",
|
||||
"\n",
|
||||
" print(f\"quant5_type: {input.quantities[5].type}\") \n",
|
||||
" print(f\"quant5_measure: {input.quantities[5].measure}\")\n",
|
||||
" print(f\"quant5_value: {input.quantities[5].value}\") \n",
|
||||
"\n",
|
||||
" print(f\"quant6_type: {input.quantities[6].type}\") \n",
|
||||
" print(f\"quant6_measure: {input.quantities[6].measure}\")\n",
|
||||
" print(f\"quant6_value: {input.quantities[6].value}\") \n",
|
||||
" \n",
|
||||
" \n",
|
||||
"\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" \n",
|
||||
" \n",
|
||||
"\n",
|
||||
"\n",
|
||||
"#log Seeding \n",
|
||||
" logs = neo.Log.Seeding.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
" location = log.location\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Seeding:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" #print(f\"notes: {log.notes}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"plant_name: {plant.season}\")\n",
|
||||
" \n",
|
||||
" print(f\"plant loc: {log.location[0].name}\")\n",
|
||||
"#quantity\n",
|
||||
" print(f\"plant_crop: {plant.crop}\")\n",
|
||||
" print(f\"plant_season: {plant.season}\")\n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
" #quantity\n",
|
||||
" input=neo.Log.Seeding.from_id(log.id)\n",
|
||||
" print(f\"quant_type: {input.quantities[0].type}\")\n",
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"unit0_name: {input.quantities[0].units.name}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print(f\"quant_inventory_name: {input.quantities[0].inventory_asset.name}\")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" \n",
|
||||
"#log Input \n",
|
||||
" logs = neo.Log.Input.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Input:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" #print(f\"name: {log.id}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"plant_crop: {plant.crop}\")\n",
|
||||
" print(f\"plant_season: {plant.season}\")\n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
"\n",
|
||||
"#quantity\n",
|
||||
" \n",
|
||||
" #quantity\n",
|
||||
" input=neo.Log.Input.from_id(log.id)\n",
|
||||
" print(f\"quant_type: {input.quantities[0].type}\")\n",
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].units.name}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print (f\"inventory_asset: = {input.quantities[0].inventory_asset.name}\")\n",
|
||||
"\n",
|
||||
"#log Medical\n",
|
||||
" logs = neo.Log.Medical.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
"\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Medical:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"plant_crop: {plant.crop}\")\n",
|
||||
" print(f\"plant_season: {plant.season}\")\n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
"\n",
|
||||
"#quantity\n",
|
||||
@@ -1266,16 +1308,22 @@
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print(f\"quant_inventory_name: {input.quantities[0].inventory_asset.name}\")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"#log Harvest \n",
|
||||
" logs = neo.Log.Harvest.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
"\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Harvest:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"plant_crop: {plant.crop}\")\n",
|
||||
" print(f\"plant_season: {plant.season}\")\n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
"\n",
|
||||
"#quantity\n",
|
||||
@@ -1284,15 +1332,21 @@
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print(f\"quant_inventory_name: {input.quantities[0].inventory_asset.name}\")\n",
|
||||
"\n",
|
||||
" \n",
|
||||
"#log Sale \n",
|
||||
" logs = neo.Log.Sale.get_list()\n",
|
||||
" for log in logs:\n",
|
||||
" plant = log.plant\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Sale:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y %H:%M \") # Konvertiere in das gewünschte Format\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"plant_name: {plant.name}\")\n",
|
||||
" print(f\"plant_crop: {plant.crop}\")\n",
|
||||
" print(f\"plant_season: {plant.season}\")\n",
|
||||
"\n",
|
||||
"#quantity\n",
|
||||
" input=neo.Log.Sale.from_id(log.id)\n",
|
||||
@@ -1300,6 +1354,7 @@
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print(f\"quant_inventory_name: {input.quantities[0].inventory_asset.name}\")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
@@ -1353,9 +1408,84 @@
|
||||
" print(f\"quant2_measure: {input.quantities[2].measure}\")\n",
|
||||
" print(f\"quant2_value: {input.quantities[2].value}\") \n",
|
||||
" \n",
|
||||
" \n",
|
||||
" \n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "ac163dc6-3593-4bdb-976b-a4e4bd651b5e",
|
||||
"metadata": {
|
||||
"jupyter": {
|
||||
"source_hidden": true
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#log Purchase und Input\n",
|
||||
"import neofarm.lib as neo\n",
|
||||
"from datetime import datetime\n",
|
||||
"\n",
|
||||
"logs = neo.Log.Purchase.get_list()\n",
|
||||
"for log in logs:\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Purchase:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\") \n",
|
||||
" \n",
|
||||
"#quantity\n",
|
||||
" input=neo.Log.Purchase.from_id(log.id)\n",
|
||||
"\n",
|
||||
" print(f\"quant0_type: {input.quantities[0].type}\")\n",
|
||||
" print(f\"quant0_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant0_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"unit0_name: {input.quantities[0].units.name}\")\n",
|
||||
" print(f\"quant0_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print (f\"unit0_price_1: = {input.quantities[0].unit_price}\")\n",
|
||||
" print (f\"unit0_price_1: = {input.quantities[0].total_price}\")\n",
|
||||
" print (f\"inventory_asset1: = {input.quantities[0].inventory_asset.name}\")\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
" if len(input.quantities) > 1:\n",
|
||||
" print(f\"quant1_type: {input.quantities[1].type}\") \n",
|
||||
" print(f\"quant1_measure: {input.quantities[1].measure}\")\n",
|
||||
" print(f\"quant1_value: {input.quantities[1].value}\")\n",
|
||||
" #print(f\"taxonomy1_name: {input.quantities[1].taxonomy_term.name}\")\n",
|
||||
" \n",
|
||||
" print(f\"quant2_type: {input.quantities[2].type}\") \n",
|
||||
" print(f\"quant2_measure: {input.quantities[2].measure}\")\n",
|
||||
" print(f\"quant2_value: {input.quantities[2].value}\") \n",
|
||||
" \n",
|
||||
" \n",
|
||||
"#log Input \n",
|
||||
"logs = neo.Log.Input.get_list()\n",
|
||||
"for log in logs:\n",
|
||||
" print(\"\")\n",
|
||||
" print(\"Input:\")\n",
|
||||
" print(f\"name: {log.name}\")\n",
|
||||
" formatted_date = datetime.fromisoformat(log.timestamp).strftime(\"%d.%m.%y\") # Konvertiere in das gewünschte Format\n",
|
||||
" print(f\"timestamp: {formatted_date}\")\n",
|
||||
" print(f\"equipment: {log.equipment[0].name}\")\n",
|
||||
"\n",
|
||||
"#quantity\n",
|
||||
" input=neo.Log.Input.from_id(log.id)\n",
|
||||
" print(f\"quant_type: {input.quantities[0].type}\")\n",
|
||||
" print(f\"quant_measure: {input.quantities[0].measure}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].value}\")\n",
|
||||
" print(f\"quant_value: {input.quantities[0].units.name}\")\n",
|
||||
" print(f\"quant_inventory_adjustment: {input.quantities[0].inventory_adjustment}\")\n",
|
||||
" print (f\"inventory_asset: = {input.quantities[0].inventory_asset.name}\")\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "96e31109-66d8-44ae-98fb-0c11fad2a7ae",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
||||
Reference in New Issue
Block a user