Пример #1
0
 $dt['vMailSubject_fr'] = $db_email[0]['vSub_fr'];
 $dt['tMailContent_en'] = $emailContent_en;
 $dt['tMailContent_fr'] = $emailContent_fr;
 $dt['eSubject'] = "Invoice";
 $dt['iCreatedBy'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'];
 $dt['eCreatedType'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USER_TYPE_SHORT'];
 $dt['dActionDate'] = calcGTzTime(date('Y-m-d H:i:s'), 'Y-m-d H:i:s');
 //$userActionObj->setAllVar($dt);
 $userActionObj->insert($dt);
 // prints($dt); exit;
 if ($sfmail == 'yes') {
     if (!isset($ioaObj)) {
         include_once SITE_CLASS_APPLICATION . "user/class.InvoiceOrderAttachment.php";
         $ioaObj = new InvoiceOrderAttachment();
     }
     $inv_attach = $ioaObj->getDetails('*', " AND iInvoiceID={$id}");
     // $iInvoiceID
     if (is_array($inv_attach) && count($inv_attach) > 0) {
         for ($l = 0; $l < count($inv_attach); $l++) {
             $filepath = $generalobj->GetImagePath(array('section' => 'INV', 'type' => 'docs', 'id' => $id, 'name' => $inv_attach[$l]['vFile']));
             // prints($filepath); exit;
             if (file_exists($filepath)) {
                 $attachments[$l]['path'] = $filepath;
                 $attachments[$l]['name'] = $inv_attach[$l]['vFile'];
             }
             // $sendMail->SendWithAttachments($sub1,"Member",$email,$body_arr,$post_arr,$SITE_NAME,$sub2,'No',$attachments);
         }
     }
 }
 if ($sub1 == 'New Invoice Created') {
     $body_arr = array("#NAME#", "#ADDED_BY#", "#INVCODE#", "#SUPPLIERORG#", "#SUPORGCODE#", "#BUYERORG#", "#BUYORGCODE#", "#LINK#", "#MAIL_FOOTER#", "#SITE_URL#");
Пример #2
0
if ($invoiceData['iStatusID'] == $acptsts[0]['iStatusID']) {
    $postat = 'act';
}
$imgdt = '';
if (trim($invoiceData['vImage']) != '') {
    // prints($invoiceData); exit;
    $img = $generalobj->ShowImage(array('section' => 'INV', 'type' => 'image', 'id' => $invoiceData['iInvoiceID'], 'name' => $invoiceData['vImage']));
    $imgdt = 'yes';
    $img = $img[1];
    $smarty->assign('img', $img);
}
if (!isset($invAttachmentObj)) {
    include_once SITE_CLASS_APPLICATION . "user/class.InvoiceOrderAttachment.php";
    $invAttachmentObj = new InvoiceOrderAttachment();
}
$invAttachments = $invAttachmentObj->getDetails('*', " AND iInvoiceID='" . $iInvoiceID . "'");
//prints($_SESSION);
if ($invoiceData['iModifiedByID'] == $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'] && $invoiceData['eDelete'] == 'Yes') {
    $nxtstatus['vStatusMsg'] = $smarty->get_template_vars('MSG_OTHER_VERIFICATION_NEED');
} elseif ($invoiceData['iModifiedByID'] == $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID']) {
    $permitted = 'No';
}
if ($invoiceData['eDelete'] == 'Yes' && $invoiceData['iModifiedByID'] != $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID']) {
    $nxtstatus['vStatusMsg'] = $smarty->get_template_vars('LBL_VERIFY_TO_DELETE');
}
$act = 'n';
if ($invoiceData['iStatusID'] == $isusts[0]['iStatusID'] && $invoiceData['iaStatusID'] == 0 && $invoiceData['iBuyerOrganizationID'] == $curORGID) {
    $iouact = @explode(',', $invUserAcptIds);
    // prints($ures); exit;
    if (in_array($acptsts[0]['iStatusID'], $iouact) && ($invoiceData['iModifiedByID'] != $sess_id || $invoiceData['eCreateByBuyer'] == 'Yes')) {
        $permitted = 'Yes';