So I did a serious attempt to getting this extra function, the ability to print a Request for Payment, which is identical to Sales Order Entry, but without loosing the Sales Order Entry function. I almost succeeded. However, almost is not good enough.
I did the following changes to the following files:
-----------------------------------------------------------------------------------------------
Request for Payment
-----------------------------------------------------------------------------------------------
fa/applications/customers.php
line 25 ADD:
$this->add_lapp_function(0, _("Request for Payment"),
"sales/sales_order_entry.php?ReqPayment=0", 'SA_SALESINVOICE', MENU_TRANSACTION);
-------------------------------------
fa/sales/sales_order_entry.php
line 68 ADD:
} elseif (isset($_GET['ReqPayment']) && is_numeric($_GET['ReqPayment'])) {
$_SESSION['page_title'] = _($help_context = "Request for Payment");
create_cart(ST_REQPAYMENT, 0);
line 186 ADD:
} elseif (isset($_GET['ReqPayment'])) {
$delivery = $_GET['ReqPayment'];
display_notification_centered(sprintf(_("Request for Payment # %d has been entered."),$delivery));
submenu_view(_("&View This RFP"), ST_REQPAYMENT, $delivery);
submenu_print(_("&Print RFP"), ST_REQPAYMENT, $delivery, 'prtopt');
submenu_print(_("&Email RFP"), ST_REQPAYMENT, $delivery, null, 1);
set_focus('prtopt');
display_note(get_gl_view_str(ST_REQPAYMENT, $delivery, _("View the GL Journal Entries for this RFP")),0, 1);
submenu_option(_("Make &Invoice Against This RFP"),
"/sales/customer_invoice.php?DeliveryNumber=$delivery");
submenu_option(_("Enter a &RFP"),
"/sales/sales_order_entry.php?NewRFP=0");
display_footer_exit();
line 624 ADD:
} elseif ($_SESSION['Items']->trans_type == ST_REQPAYMENT)
{
display_notification(_("This request for payment has been cancelled as requested."), 1);
submenu_option(_("Enter a New Request for Payment"), "/sales/sales_order_entry.php?NewRFP=Yes");
line 735 ADD:
} elseif ($_SESSION['Items']->trans_type == ST_REQPAYMENT) {
$idate = _("RFP Date:");
$orderitems = _("Request for Payment Items");
$deliverydetails = _("Enter RFP Details and Confirm RFP");
$cancelorder = _("Cancel RFP");
$porder = _("Place RFP");
$corder = _("Commit RFP Changes");
-------------------------------------
fa/includes/systypes.inc
line 63 ADD:
case ST_REQPAYMENT : return array("".TB_PREF."sales_orders", "trans_type", "order_no", "reference", "ord_date");
-------------------------------------
fa/includes/sysnames.inc
line 41 ADD:
ST_REQPAYMENT => _("Request for Payment"),
line 67 ADD:
ST_REQPAYMENT => _("RFP"),
-------------------------------------
fa/includes/types.inc
line 41 ADD:
define('ST_REQPAYMENT', 34);
-------------------------------------
fa/reporting/includes/reporting.inc
line 51 ADD:
case ST_REQPAYMENT :
$rep = 109;
// from, to, currency, email, quote, comments, orientation
$ar = array(
'PARAM_0' => $doc_no,
'PARAM_1' => $doc_no,
'PARAM_2' => '',
'PARAM_3' => $email,
'PARAM_4' => 2,
'PARAM_5' => '',
'PARAM_6' => $def_orientation);
break;
-------------------------------------
fa/reporting/includes/doctext.inc
line 52 ADD:
case ST_REQPAYMENT:
$this->title = ($print_as_quote==1 ? _("QUOTE") : _("REQUEST FOR PAYMENT"));
$this->formData['document_name'] =_("Order No.");
$this->formData['document_date'] = $this->formData['ord_date'];
$this->formData['document_number'] = $print_invoice_no == 0 && isset($this->formData['reference'])
? $this->formData['reference'] : $this->formData['order_no'];
$this->formData['document_amount'] = $this->formData['order_no'];
$aux_info = array(
_("Customer's Reference") => $this->formData["customer_ref"],
_("Sales Person") => get_salesman_name($this->formData['salesman']),
_("Your VAT no.") => $this->formData['tax_id'],
_("Our Order No") => $this->formData['order_no'],
_("Delivery Date") => sql2date($this->formData['delivery_date']),
);
break;
-------------------------------------
My problems are at the end, when the Update or Accept is clicked. Is there anyone who can help with this?
Thanks in advance
Carmelo