@@ -38175,6 +38175,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>production_by_technician_one</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>purchases_by_cost_center_detail</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -36,7 +36,7 @@ export function JobsDocumentsDownloadButton({
|
||||
);
|
||||
const imagesToDownload = [
|
||||
...galleryImages.images.filter((image) => image.isSelected),
|
||||
// ...galleryImages.other.filter((image) => image.isSelected),
|
||||
...galleryImages.other.filter((image) => image.isSelected),
|
||||
];
|
||||
|
||||
function downloadProgress(progressEvent) {
|
||||
@@ -123,6 +123,7 @@ export function JobsDocumentsDownloadButton({
|
||||
a.click();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
|
||||
@@ -4,9 +4,24 @@ import { TemplateList } from "../../utils/TemplateConstants";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const ProdTemplates = TemplateList("production");
|
||||
const ProductionByTech = TemplateList("special").production_by_technician_one;
|
||||
|
||||
export default function ProductionListPrint() {
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ProductionListPrint);
|
||||
|
||||
export function ProductionListPrint({ bodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
return (
|
||||
@@ -33,6 +48,29 @@ export default function ProductionListPrint() {
|
||||
{ProdTemplates[key].title}
|
||||
</Menu.Item>
|
||||
))}
|
||||
<Menu.SubMenu
|
||||
title={t("reportcenter.templates.production_by_technician_one")}
|
||||
>
|
||||
{bodyshop.employees.map((e) => (
|
||||
<Menu.Item
|
||||
key={e.id}
|
||||
onClick={async () => {
|
||||
setLoading(true);
|
||||
await GenerateDocument(
|
||||
{
|
||||
name: ProductionByTech.key,
|
||||
variables: { id: e.id },
|
||||
},
|
||||
{},
|
||||
"p"
|
||||
);
|
||||
setLoading(false);
|
||||
}}
|
||||
>
|
||||
{e.first_name} {e.last_name}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</Menu.SubMenu>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -2268,6 +2268,7 @@
|
||||
"production_by_ro": "Production by RO",
|
||||
"production_by_target_date": "Production by Target Date",
|
||||
"production_by_technician": "Production by Technician",
|
||||
"production_by_technician_one": "Production filtered by Technician",
|
||||
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
|
||||
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
||||
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
||||
|
||||
@@ -2268,6 +2268,7 @@
|
||||
"production_by_ro": "",
|
||||
"production_by_target_date": "",
|
||||
"production_by_technician": "",
|
||||
"production_by_technician_one": "",
|
||||
"purchases_by_cost_center_detail": "",
|
||||
"purchases_by_cost_center_summary": "",
|
||||
"purchases_by_date_range_detail": "",
|
||||
|
||||
@@ -2268,6 +2268,7 @@
|
||||
"production_by_ro": "",
|
||||
"production_by_target_date": "",
|
||||
"production_by_technician": "",
|
||||
"production_by_technician_one": "",
|
||||
"purchases_by_cost_center_detail": "",
|
||||
"purchases_by_cost_center_summary": "",
|
||||
"purchases_by_date_range_detail": "",
|
||||
|
||||
@@ -1590,14 +1590,6 @@ export const TemplateList = (type, context) => {
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
},
|
||||
production_by_technician: {
|
||||
title: i18n.t("reportcenter.templates.production_by_technician"),
|
||||
description: "",
|
||||
subject: i18n.t("reportcenter.templates.production_by_technician"),
|
||||
key: "production_by_technician",
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
},
|
||||
production_by_category: {
|
||||
title: i18n.t("reportcenter.templates.production_by_category"),
|
||||
description: "",
|
||||
@@ -1606,6 +1598,14 @@ export const TemplateList = (type, context) => {
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
},
|
||||
production_by_technician: {
|
||||
title: i18n.t("reportcenter.templates.production_by_technician"),
|
||||
description: "",
|
||||
subject: i18n.t("reportcenter.templates.production_by_technician"),
|
||||
key: "production_by_technician",
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(!type || type === "special"
|
||||
@@ -1617,6 +1617,18 @@ export const TemplateList = (type, context) => {
|
||||
key: "ca_bc_etf_table",
|
||||
disabled: false,
|
||||
},
|
||||
production_by_technician_one: {
|
||||
title: i18n.t(
|
||||
"reportcenter.templates.production_by_technician_one"
|
||||
),
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"reportcenter.templates.production_by_technician_one"
|
||||
),
|
||||
key: "production_by_technician_one",
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
@@ -38,7 +38,9 @@ exports.default = function ({
|
||||
|
||||
if (
|
||||
(jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) ||
|
||||
((jobline.db_ref === "900511" || jobline.db_ref === "900510") &&
|
||||
((jobline.db_ref === "900511" ||
|
||||
jobline.db_ref === "900510" ||
|
||||
jobline.db_ref === "900500") &&
|
||||
jobline.prt_dsmk_m &&
|
||||
jobline.prt_dsmk_m !== 0)
|
||||
) {
|
||||
|
||||
@@ -72,7 +72,9 @@ exports.default = async function (socket, jobid) {
|
||||
|
||||
if (
|
||||
(val.prt_dsmk_p && val.prt_dsmk_p !== 0) ||
|
||||
((val.db_ref === "900511" || val.db_ref === "900510") &&
|
||||
((val.db_ref === "900511" ||
|
||||
val.db_ref === "900510" ||
|
||||
val.db_ref === "900500") &&
|
||||
val.prt_dsmk_m &&
|
||||
val.prt_dsmk_m !== 0)
|
||||
) {
|
||||
|
||||
@@ -113,6 +113,14 @@ exports.default = async (req, res) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// for (const xmlObj of allxmlsToUpload) {
|
||||
// fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
|
||||
// }
|
||||
|
||||
// res.json(allxmlsToUpload);
|
||||
// return;
|
||||
|
||||
let sftp = new Client();
|
||||
sftp.on("error", (errors) =>
|
||||
logger.log("autohouse-sftp-error", "ERROR", "api", null, {
|
||||
@@ -744,7 +752,12 @@ const GenerateDetailLines = (line, statuses) => {
|
||||
IOUPart: 0,
|
||||
LineNumber: line.line_no || 0,
|
||||
MarkUp: null,
|
||||
OrderedOn: null,
|
||||
OrderedOn:
|
||||
(line.parts_order_lines[0] &&
|
||||
moment(line.parts_order_lines[0].parts_order.order_date).format(
|
||||
AhDateFormat
|
||||
)) ||
|
||||
"",
|
||||
OriginalCost: null,
|
||||
OriginalInvoiceNumber: null,
|
||||
PriceEach: (line.billlines[0] && line.billlines[0].retail_price) || 0,
|
||||
@@ -760,7 +773,9 @@ const GenerateDetailLines = (line, statuses) => {
|
||||
VendorPrice: (line.billlines[0] && line.billlines[0].actual_price) || 0,
|
||||
Deleted: null,
|
||||
ExpectedOn: null,
|
||||
ReceivedOn: null,
|
||||
ReceivedOn:
|
||||
line.billlines[0] &&
|
||||
moment(line.billlines[0].bill.date).format(AhDateFormat),
|
||||
OrderedBy: null,
|
||||
ShipVia: null,
|
||||
VendorContact: null,
|
||||
@@ -780,7 +795,7 @@ const generateNullDetailLine = () => {
|
||||
IOUPart: 0,
|
||||
LineNumber: 0,
|
||||
MarkUp: null,
|
||||
OrderedOn: null,
|
||||
OrderedOn: "",
|
||||
OriginalCost: null,
|
||||
OriginalInvoiceNumber: null,
|
||||
PriceEach: 0,
|
||||
|
||||
@@ -642,7 +642,13 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
||||
lbr_op
|
||||
profitcenter_part
|
||||
profitcenter_labor
|
||||
billlines(order_by: {bill: {date: desc_nulls_last}}) {
|
||||
parts_order_lines(order_by: {parts_order: {order_date: desc_nulls_last}} limit: 1){
|
||||
parts_order{
|
||||
id
|
||||
order_date
|
||||
}
|
||||
}
|
||||
billlines(order_by: {bill: {date: desc_nulls_last}} limit: 1) {
|
||||
actual_cost
|
||||
actual_price
|
||||
quantity
|
||||
@@ -651,6 +657,7 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
||||
name
|
||||
}
|
||||
invoice_number
|
||||
date
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -695,8 +702,6 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
`;
|
||||
|
||||
exports.ENTEGRAL_EXPORT = `
|
||||
|
||||
@@ -271,7 +271,8 @@ function CalculatePartsTotals(jobLines) {
|
||||
.multiply(value.part_qty || 0)
|
||||
.add(
|
||||
(value.db_ref === "900511" ||
|
||||
value.db_ref === "900510") &&
|
||||
value.db_ref === "900510" ||
|
||||
value.db_ref === "900500") &&
|
||||
value.prt_dsmk_m &&
|
||||
value.prt_dsmk_m !== 0
|
||||
? Dinero({ amount: Math.round(value.prt_dsmk_m * 100) })
|
||||
@@ -298,7 +299,9 @@ function CalculatePartsTotals(jobLines) {
|
||||
parts: {
|
||||
...acc.parts,
|
||||
prt_dsmk_total: acc.parts.prt_dsmk_total.add(
|
||||
(value.db_ref === "900511" || value.db_ref === "900510") &&
|
||||
(value.db_ref === "900511" ||
|
||||
value.db_ref === "900510" ||
|
||||
value.db_ref === "900500") &&
|
||||
value.prt_dsmk_m &&
|
||||
value.prt_dsmk_m !== 0
|
||||
? Dinero({ amount: Math.round(value.prt_dsmk_m * 100) })
|
||||
@@ -344,7 +347,9 @@ function CalculatePartsTotals(jobLines) {
|
||||
}).multiply(value.part_qty || 0)
|
||||
)
|
||||
.add(
|
||||
(value.db_ref === "900511" || value.db_ref === "900510") &&
|
||||
(value.db_ref === "900511" ||
|
||||
value.db_ref === "900510" ||
|
||||
value.db_ref === "900500") &&
|
||||
value.prt_dsmk_m &&
|
||||
value.prt_dsmk_m !== 0
|
||||
? Dinero({ amount: Math.round(value.prt_dsmk_m * 100) })
|
||||
|
||||
Reference in New Issue
Block a user