当前位置: 首页>>代码示例>>PHP>>正文


PHP Sections::createPettyCashFolder方法代码示例

本文整理汇总了PHP中Sections::createPettyCashFolder方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::createPettyCashFolder方法的具体用法?PHP Sections::createPettyCashFolder怎么用?PHP Sections::createPettyCashFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sections的用法示例。


在下文中一共展示了Sections::createPettyCashFolder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addDocumentToFolder


//.........这里部分代码省略.........
                        $libDoc->Subsection_ID = $subsectionId;
                        $libDoc->Access_Type = Storages::HAS_ACCESS;
                        $libDoc->Sort_Numb = 0;
                        if ($libDoc->validate()) {
                            $libDoc->save();
                        }
                    }
                }
            } elseif ($document->Document_Type == Documents::PO) {
                $po = Pos::model()->findByAttributes(array(
                    'Document_ID' => $docId,
                ));

                $year = substr($po->PO_Date, 0, 4);

                $subsectionId = Sections::createVendorFolder($document->Project_ID, $po->Vendor_ID, $year);
                if ($po->PO_Backup_Document_ID != 0) {
                    $bu = LibraryDocs::model()->findByAttributes(array(
                        'Document_ID' => $po->PO_Backup_Document_ID,
                        'Subsection_ID' => $subsectionId,
                    ));

                    if (!$bu) {
                        $libDoc = new LibraryDocs();
                        $libDoc->Document_ID = $po->PO_Backup_Document_ID;
                        $libDoc->Subsection_ID = $subsectionId;
                        $libDoc->Access_Type = Storages::HAS_ACCESS;
                        $libDoc->Sort_Numb = 0;
                        if ($libDoc->validate()) {
                            $libDoc->save();
                        }
                    }
                }
            } elseif ($document->Document_Type == Documents::BU) {
                //get po or ap date
                $ap = Aps::model()->findByAttributes(array(
                    'AP_Backup_Document_ID' => $docId,
                ));
                if ($ap) {
                    $year = substr($ap->Invoice_Date, 0, 4);
                } else {
                    $po = Pos::model()->findByAttributes(array(
                        'PO_Backup_Document_ID' => $docId,
                    ));
                    if ($po) {
                        $year = substr($po->PO_Date, 0, 4);
                    }
                }
                $subsectionId = Sections::createVendorFolder($document->Project_ID, $vendorID, $year);
            } elseif ($document->Document_Type == Documents::PR) {
                $payroll = Payrolls::model()->findByAttributes(array(
                    'Document_ID' => $document->Document_ID,
                ));

                $year = substr($payroll->Week_Ending, 0, 4);

                $subsectionId = Sections::createPayrollFolder($document->Project_ID, $year, $payroll->Week_Ending);
            } elseif ($document->Document_Type == Documents::JE) {
                $je = Journals::model()->findByAttributes(array(
                    'Document_ID' => $document->Document_ID,
                ));

                $subsectionId = Sections::createJournalEntryFolder($document->Project_ID, $je->JE_Date);
            } elseif ($document->Document_Type == Documents::PC) {
                $pc = Pcs::model()->findByAttributes(array(
                    'Document_ID' => $document->Document_ID,
                ));

                $year = substr($pc->Envelope_Date, 0, 4);

                $subsectionId = Sections::createPettyCashFolder($document->Project_ID, $year, $pc->Employee_Name);
            } elseif ($document->Document_Type == Documents::AR) {
                $ar = Ars::model()->findByAttributes(array(
                    'Document_ID' => $document->Document_ID,
                ));

                $year = substr($ar->Invoice_Date, 0, 4);

                $subsectionId = Sections::createAccountsReceivableFolder($document->Project_ID, $year, $ar->Invoice_Date);
            }

            $libDoc = LibraryDocs::model()->findByAttributes(array(
                'Document_ID' => $docId,
                'Subsection_ID' => $subsectionId,
            ));

            if (!$libDoc) {
                $libDoc = new LibraryDocs();
                $libDoc->Document_ID = $docId;
                $libDoc->Subsection_ID = $subsectionId;
                $libDoc->Access_Type = Storages::HAS_ACCESS;
                $libDoc->Sort_Numb = 0;
                if ($libDoc->validate()) {
                    $libDoc->save();
                }
            }

            LibraryDocs::sortDocumentsInSubsection($subsectionId);
        }
    }
开发者ID:ranvijayj,项目名称:htmlasa,代码行数:101,代码来源:LibraryDocs.php


注:本文中的Sections::createPettyCashFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。