Skip to content
This repository was archived by the owner on Jul 2, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added Profile
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ Ext.define("PartKeepr.Exporter.GridExporter", {
}

if (!column.isHidden()) {
rowValues.push(Ext.util.Format.stripTags(value));
try{
rowValues.push(Ext.util.Format.stripTags(value.replace(/[^\x1F-\x7D]/g,'')))
}
catch(err){
rowValues.push(Ext.util.Format.stripTags(value));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Ext.define('PartKeepr.Components.Project.MetaPartSubgrid', {
onApplyMetaPartsClick: function (button)
{
var parentRecord = button.up("grid").parentRecord;

this.convertMetaPartsToParts(parentRecord);
},
/**
Expand Down Expand Up @@ -113,13 +113,17 @@ Ext.define('PartKeepr.Components.Project.MetaPartSubgrid', {
} else {
missing = Math.abs(missing);
}


if(subPart.get("comment").indexOf("DO NOT CHANGE") == -1)
subPart.set("comment", subPart.get("comment") + "\nDO NOT CHANGE:" + record.data.report + record._part.data.name);
else if(subPart.get("comment").indexOf(record.data.report) != -1)
subPart.set("comment", subPart.get("comment") + record._part.data.name);
else
subPart.set("comment", subPart.get("comment").slice(0,subPart.get("comment").indexOf("DO NOT CHANGE")+14) + record.data.report + record._part.data.name);
projectReportItem = Ext.create("PartKeepr.ProjectBundle.Entity.ReportPart");
projectReportItem.setPart(subPart);
projectReportItem.set("quantity", subPart.get("stockToUse"));
projectReportItem.setReport(this.up("#projectReportResult").projectReport);


record.store.add(projectReportItem);
}
}
Expand Down Expand Up @@ -192,4 +196,4 @@ Ext.define('PartKeepr.Components.Project.MetaPartSubgrid', {
return total;
}

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Ext.define('PartKeepr.ProjectReportView', {
quantity: projectsToReport[i].quantity
}));
}

this.doSaveProjectReport();
},
/**
Expand All @@ -130,7 +130,6 @@ Ext.define('PartKeepr.ProjectReportView', {
{
this.reportResult.setProjectsToReport([]);
this.reportResult.setStore(new Ext.data.Store());

var selection = this.reportList.getSelection();
if (selection.length === 1)
{
Expand All @@ -153,6 +152,10 @@ Ext.define('PartKeepr.ProjectReportView', {
});

this.reportList.getStore().reload();




},
onProjectReportLoaded: function () {
this.reportResult.reconfigure(this.projectReport.reportParts());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Ext.define("PartKeepr.Components.Project.ProjectReportResultGrid", {
amount: item.get("quantity"),
comment: item.getReport().reportProjects().getFieldValues("project.name").join(", "),
lotNumber: item.projectParts().getFieldValues("lotNumber").join(", "),
projects: [] // item.getReport().reportProjects()
projects: []
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,42 @@ Ext.define("PartKeepr.Components.ProjectReport.Renderers.RemarksRenderer", {
return renderObj.getProjectParts(record);
},
getProjectParts: function (rec) {

var report = rec.getReport(),
i, j, project, projectPart, projectPartQuantities = [];
i, j, k, project, projectPart, projectPartQuantities = [];

for (i = 0; i < report.reportProjects().getCount(); i++)
{
project = report.reportProjects().getAt(i).getProject();

for (j = 0; j < project.parts().getCount(); j++)
{
projectPart = project.parts().getAt(j);



if (projectPart.getPart().getId() === rec.getPart().getId())
{
if (projectPart.get("remarks") !== "" && projectPart.get("remarks") !== null)
{
projectPartQuantities.push(project.get("name") + ": " + projectPart.get("remarks"));
}
}
else
{

if (rec.getPart().data.comment.includes(projectPart.getPart().data.name))
{
if (projectPart.get("remarks") !== "" && projectPart.get("remarks") !== null)
{
projectPartQuantities.push(project.get("name") + ": " + projectPart.get("remarks"));
}
}

}

}
}

return projectPartQuantities.join("&#013;&#010;")
},

Expand Down
1 change: 1 addition & 0 deletions src/PartKeepr/PartBundle/Entity/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
class Part extends BaseEntity
{
private $origin;
/**
* The category of the part.
*
Expand Down
17 changes: 17 additions & 0 deletions src/PartKeepr/ProjectBundle/Entity/ReportPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class ReportPart extends BaseEntity
* @var int
*/
private $quantity;

private $remarks;

/**
* @ORM\ManyToOne(targetEntity="PartKeepr\DistributorBundle\Entity\Distributor")
Expand Down Expand Up @@ -336,6 +338,21 @@ public function setPart($part)

return $this;
}

// remark getter
public function getRemarks()
{
return $this->remarks;
}

//remark setter
public function setRemarks($remarks)
{
$this->remarks = $remarks;

return $this;
}


public function __toString()
{
Expand Down