mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Add fields parsable by KiCost to KiCad part info
This commit is contained in:
parent
a235f05794
commit
c00edef69c
1 changed files with 19 additions and 0 deletions
|
@ -262,6 +262,25 @@ class KiCadHelper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Add fields for KiCost:
|
||||||
|
if ($part->getManufacturer() !== null) {
|
||||||
|
$result["fields"]["manf"] = $this->createField($part->getManufacturer()->getName());
|
||||||
|
}
|
||||||
|
if ($part->getManufacturerProductNumber() !== null) {
|
||||||
|
$result['fields']['manf#'] = $this->createField($part->getManufacturerProductNumber());
|
||||||
|
}
|
||||||
|
|
||||||
|
//For each supplier, add a field with the supplier name and the supplier part number for KiCost
|
||||||
|
if ($part->getOrderdetails(false)->count() > 0) {
|
||||||
|
foreach ($part->getOrderdetails(false) as $orderdetail) {
|
||||||
|
if ($orderdetail->getSupplier() !== null && $orderdetail->getSupplierPartNr() !== '') {
|
||||||
|
$fieldName = mb_strtolower($orderdetail->getSupplier()->getName()) . '#';
|
||||||
|
|
||||||
|
$result["fields"][$fieldName] = $this->createField($orderdetail->getSupplierPartNr());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue